From owner-svn-src-head@freebsd.org Sun Jan 24 02:11:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA976A8FD66; Sun, 24 Jan 2016 02:11:21 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A23B3147F; Sun, 24 Jan 2016 02:11:21 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ig0-x22a.google.com with SMTP id t15so15036974igr.0; Sat, 23 Jan 2016 18:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=IwvZcuUZ9md9QU5kC8ZH9O65Y9b89T1iGheSRr2mQ34=; b=FwbgA5gFezwzGfTXyq8di40q6I6QHQmy8vmz9QaFLfR4gfWU6bbtsXSHQDeWVZsGux mn6YmjoN6Fr7ttEetMh32+Bf+2gE4kqCAl574HOqptgSxBNWx2kLTuTs6HEc7VMgp12B 2OY7OAL6IKajGzS3kxLhTvQEziRDI+4sCcuWk+rOR336LRMlaKor3HvItxaLogY7N29S +cclNRXyZwd4Xw+fzc9vfgpz2RU7DmAY4giEQBa9MguxvsGsVfTQcijQNm3YB5nLJtNi XXXnZN/RwoF61p0969qfVA/wddsuEjCS0a2ipHvi6t/f9Dm51E0p+OhA9f78MCIjB7Qt QWOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=IwvZcuUZ9md9QU5kC8ZH9O65Y9b89T1iGheSRr2mQ34=; b=JwoQlB5yA6Unyw2PzVS/Rjm9OLI1c+lsWL0jU6iU4q5EoLtc3SpG6d9Tho/Vpca8ky QjvkSRw/JQx5BE+dctSByEOaqtZVOSzyq+Rnj1nWJRO+6qF0oNBouo+pwtui/0jmeDfq zyHOJOP2RknHEtNo7i3HtwRkzERDSWNoB5XlZpiBnNcWD66XcjFekeGf6h7riW4hhNnb /7ayZokGb6Sq6EocDmRoSBJZZQ8XWvaPdTh83gi0K9scS9qQyKx+VMnfB0Pf4/Ps2NVE gNtSfpRokfw5rYn8yX8+URx0+q1repsjbpsNhMMBS2f5/kJY7BHZxfxWi2F3hMqFcPHD 0BBQ== X-Gm-Message-State: AG10YOSmvrw44ciOjNq3lP1MIZY3RVb/LRuizkvlU5Qs8IPkk7jX4v94fKig3Fw30JCxhR8OSvkWbmJsUJO1iA== MIME-Version: 1.0 X-Received: by 10.50.61.243 with SMTP id t19mr9959862igr.86.1453601481166; Sat, 23 Jan 2016 18:11:21 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Sat, 23 Jan 2016 18:11:21 -0800 (PST) In-Reply-To: <201601202257.u0KMvA89056089@repo.freebsd.org> References: <201601202257.u0KMvA89056089@repo.freebsd.org> Date: Sat, 23 Jan 2016 18:11:21 -0800 X-Google-Sender-Auth: lG2DeAos9gczL8NeZDj2t40Esl0 Message-ID: Subject: Re: svn commit: r294464 - in head: crypto/openssh crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-compat crypto/openssh/regress crypto/openssh/regress/unittests crypto/... From: Craig Rodrigues To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: "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-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 02:11:22 -0000 On Wed, Jan 20, 2016 at 2:57 PM, Dag-Erling Sm=C3=B8rgrav wrote: > Author: des > Date: Wed Jan 20 22:57:10 2016 > New Revision: 294464 > URL: https://svnweb.freebsd.org/changeset/base/294464 > > Log: > Upgrade to OpenSSH 7.0p1. > > Modified: > head/crypto/openssh/openbsd-compat/realpath.c > clang is emitting a new warning on this file: https://jenkins.freebsd.org/job/FreeBSD_HEAD/62/warnings7Result/new/ Is it a legitimate problem which needs to be fixed upstream, or is it a non-issue? -- Craig From owner-svn-src-head@freebsd.org Sun Jan 24 02:25:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C0D2A84351; Sun, 24 Jan 2016 02:25:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E37921CB7; Sun, 24 Jan 2016 02:25:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0O2PfRI051929; Sun, 24 Jan 2016 02:25:41 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0O2PfRG051928; Sun, 24 Jan 2016 02:25:41 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601240225.u0O2PfRG051928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 24 Jan 2016 02:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294652 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 02:25:43 -0000 Author: pfg Date: Sun Jan 24 02:25:41 2016 New Revision: 294652 URL: https://svnweb.freebsd.org/changeset/base/294652 Log: ext2: Initialize i_flag after allocation. We use i_flag to carry some flags like IN_E4INDEX which newer ext2fs variants uses internally. fsck.ext3 rightfully complains after our implementation tags non-directory inodes with INDEX_FL. Initializing i_flag during allocation removes the noise factor and quiets down fsck. Patch from: Damjan Jovanovic PR: 206530 Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun Jan 24 02:10:05 2016 (r294651) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun Jan 24 02:25:41 2016 (r294652) @@ -393,6 +393,7 @@ ext2_valloc(struct vnode *pvp, int mode, * Linux doesn't read the old inode in when it is allocating a * new one. I will set at least i_size and i_blocks to zero. */ + ip->i_flag = 0; ip->i_size = 0; ip->i_blocks = 0; ip->i_mode = 0; From owner-svn-src-head@freebsd.org Sun Jan 24 02:41:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63374A84906; Sun, 24 Jan 2016 02:41:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B703131F; Sun, 24 Jan 2016 02:41:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0O2foh5055659; Sun, 24 Jan 2016 02:41:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0O2fnPW055654; Sun, 24 Jan 2016 02:41:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601240241.u0O2fnPW055654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 24 Jan 2016 02:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294653 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 02:41:51 -0000 Author: pfg Date: Sun Jan 24 02:41:49 2016 New Revision: 294653 URL: https://svnweb.freebsd.org/changeset/base/294653 Log: Rename some directory index constants. Directory index was introduced in ext3. We don't always use the prefix to denote the ext2 variant they belong to but when we do we should try to be accurate. Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Sun Jan 24 02:25:41 2016 (r294652) +++ head/sys/fs/ext2fs/ext2_dinode.h Sun Jan 24 02:41:49 2016 (r294653) @@ -51,7 +51,7 @@ /* * Inode flags * The system supports EXT2_IMMUTABLE, EXT2_APPEND and EXT2_NODUMP flags. - * The current implementation also uses EXT4_INDEX, EXT4_EXTENTS and + * The current implementation also uses EXT3_INDEX, EXT4_EXTENTS and * EXT4_HUGE_FILE with some restrictions, imposed the lack of write * support. */ @@ -63,7 +63,7 @@ #define EXT2_APPEND 0x00000020 /* Writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* Do not dump file */ #define EXT2_NOATIME 0x00000080 /* Do not update atime */ -#define EXT4_INDEX 0x00001000 /* Hash-indexed directory */ +#define EXT3_INDEX 0x00001000 /* Hash-indexed directory */ #define EXT4_IMAGIC 0x00002000 /* AFS directory */ #define EXT4_JOURNAL_DATA 0x00004000 /* File data should be journaled */ #define EXT4_NOTAIL 0x00008000 /* File tail should not be merged */ Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Sun Jan 24 02:25:41 2016 (r294652) +++ head/sys/fs/ext2fs/ext2_htree.c Sun Jan 24 02:41:49 2016 (r294653) @@ -90,7 +90,7 @@ int ext2_htree_has_idx(struct inode *ip) { if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) && - ip->i_flag & IN_E4INDEX) + ip->i_flag & IN_E3INDEX) return (1); else return (0); @@ -653,7 +653,7 @@ ext2_htree_create_index(struct vnode *vp ((char *)ep + ep->e2d_reclen); ep->e2d_reclen = buf1 + blksize - (char *)ep; - dp->i_flag |= IN_E4INDEX; + dp->i_flag |= IN_E3INDEX; /* * Initialize index root. Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jan 24 02:25:41 2016 (r294652) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jan 24 02:41:49 2016 (r294653) @@ -110,7 +110,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, stru ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0; ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0; ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0; - ip->i_flag |= (ei->e2di_flags & EXT4_INDEX) ? IN_E4INDEX : 0; + ip->i_flag |= (ei->e2di_flags & EXT3_INDEX) ? IN_E3INDEX : 0; ip->i_flag |= (ei->e2di_flags & EXT4_EXTENTS) ? IN_E4EXTENTS : 0; ip->i_blocks = ei->e2di_nblock; if (E2DI_HAS_HUGE_FILE(ip)) { @@ -160,7 +160,7 @@ ext2_i2ei(struct inode *ip, struct ext2f ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0; ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0; - ei->e2di_flags |= (ip->i_flag & IN_E4INDEX) ? EXT4_INDEX: 0; + ei->e2di_flags |= (ip->i_flag & IN_E3INDEX) ? EXT3_INDEX: 0; ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS: 0; ei->e2di_nblock = ip->i_blocks & 0xffffffff; ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff; Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sun Jan 24 02:25:41 2016 (r294652) +++ head/sys/fs/ext2fs/ext2_lookup.c Sun Jan 24 02:41:49 2016 (r294653) @@ -888,7 +888,7 @@ ext2_direnter(struct inode *ip, struct v if (ext2_htree_has_idx(dp)) { error = ext2_htree_add_entry(dvp, &newdir, cnp); if (error) { - dp->i_flag &= ~IN_E4INDEX; + dp->i_flag &= ~IN_E3INDEX; dp->i_flag |= IN_CHANGE | IN_UPDATE; } return (error); From owner-svn-src-head@freebsd.org Sun Jan 24 02:44:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFCF2A849C6; Sun, 24 Jan 2016 02:44:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1EA41558; Sun, 24 Jan 2016 02:44:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0O2i0VT057720; Sun, 24 Jan 2016 02:44:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0O2i0ps057719; Sun, 24 Jan 2016 02:44:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601240244.u0O2i0ps057719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 24 Jan 2016 02:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294654 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 02:44:01 -0000 Author: pfg Date: Sun Jan 24 02:44:00 2016 New Revision: 294654 URL: https://svnweb.freebsd.org/changeset/base/294654 Log: Fix comment. Modified: head/sys/fs/ext2fs/ext2_dinode.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Sun Jan 24 02:41:49 2016 (r294653) +++ head/sys/fs/ext2fs/ext2_dinode.h Sun Jan 24 02:44:00 2016 (r294654) @@ -52,7 +52,7 @@ * Inode flags * The system supports EXT2_IMMUTABLE, EXT2_APPEND and EXT2_NODUMP flags. * The current implementation also uses EXT3_INDEX, EXT4_EXTENTS and - * EXT4_HUGE_FILE with some restrictions, imposed the lack of write + * EXT4_HUGE_FILE with some restrictions imposed by the lack of write * support. */ #define EXT2_SECRM 0x00000001 /* Secure deletion */ From owner-svn-src-head@freebsd.org Sun Jan 24 03:26:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CD39A8E8B3; Sun, 24 Jan 2016 03:26:04 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id C963E1BCB; Sun, 24 Jan 2016 03:26:03 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 6294D5AFE; Sun, 24 Jan 2016 03:26:01 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 25B88482D1; Sun, 24 Jan 2016 04:26:02 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Craig Rodrigues Cc: "src-committers\@freebsd.org" , "svn-src-all\@freebsd.org" , "svn-src-head\@freebsd.org" Subject: Re: svn commit: r294464 - in head: crypto/openssh crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-compat crypto/openssh/regress crypto/openssh/regress/unittests crypto/... References: <201601202257.u0KMvA89056089@repo.freebsd.org> Date: Sun, 24 Jan 2016 04:26:02 +0100 In-Reply-To: (Craig Rodrigues's message of "Sat, 23 Jan 2016 18:11:21 -0800") Message-ID: <86si1nd5f9.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 03:26:04 -0000 Craig Rodrigues writes: > clang is emitting a new warning on this file: > > https://jenkins.freebsd.org/job/FreeBSD_HEAD/62/warnings7Result/new/ > > Is it a legitimate problem which needs to be fixed upstream, or is it > a non-issue? The warning is technically correct, but the error is harmless since the source and destination are fixed buffers of identical size. The code was fixed upstream in October, after 7.1 was released. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Sun Jan 24 04:30:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4EEFA8E0D8; Sun, 24 Jan 2016 04:30:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B693F17D2; Sun, 24 Jan 2016 04:30:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0O4UUk6087991; Sun, 24 Jan 2016 04:30:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0O4UURZ087990; Sun, 24 Jan 2016 04:30:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601240430.u0O4UURZ087990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 24 Jan 2016 04:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294655 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 04:30:32 -0000 Author: pfg Date: Sun Jan 24 04:30:30 2016 New Revision: 294655 URL: https://svnweb.freebsd.org/changeset/base/294655 Log: ext2: rename some directory index constants. Missed from r294653. Pointyhat: me Modified: head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Sun Jan 24 02:44:00 2016 (r294654) +++ head/sys/fs/ext2fs/inode.h Sun Jan 24 04:30:30 2016 (r294655) @@ -157,7 +157,7 @@ struct inode { * These are translation flags for some attributes that Ext4 * passes as inode flags but that we cannot pass directly. */ -#define IN_E4INDEX 0x010000 +#define IN_E3INDEX 0x010000 #define IN_E4EXTENTS 0x020000 #define i_devvp i_ump->um_devvp From owner-svn-src-head@freebsd.org Sun Jan 24 07:56:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EBDBA8FE1D; Sun, 24 Jan 2016 07:56:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 699AF1B1D; Sun, 24 Jan 2016 07:56:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0O7ufpm008889 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Jan 2016 23:56:41 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0O7uf8K008888; Sat, 23 Jan 2016 23:56:41 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 23 Jan 2016 23:56:40 -0800 From: Gleb Smirnoff To: Lawrence Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294536 - head/sys/netinet Message-ID: <20160124075640.GD1004@FreeBSD.org> References: <201601212253.u0LMrC7B016136@repo.freebsd.org> <56A1C9F6.2010708@freebsd.org> <20160122180411.GA1004@FreeBSD.org> <56A3271F.6010904@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <56A3271F.6010904@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 07:56:47 -0000 --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Lawrence, On Sat, Jan 23, 2016 at 06:09:19PM +1100, Lawrence Stewart wrote: L> > Is that the race you refer to? L> L> No, the TCP_CONGESTION refactoring i.e. this commit, introduced races in L> the get and set cases. I guess I didn't provide enough context in L> Crucible, so here goes... L> L> The post refactoring get code is now: L> L> case TCP_CONGESTION: L> INP_WUNLOCK(inp); L> error = sooptcopyout(sopt, CC_ALGO(tp)->name, TCP_CA_NAME_MAX); L> break; L> L> Consider that tp is using cc_blah and that the cc_blah module is L> unloaded as the copy out is happening. By not holding the INP lock, the L> CC module unload code is able to walk the list of active connections, L> find this connection is using cc_blah, acquire the INP lock, switch this L> connection to cc_newreno, release the lock and finally unload the L> cc_blah module, rendering the pointer passed in to sooptcopyout garbage. L> See cc_deregister_algo() in cc.c and tcp_ccalgounload() in tcp_subr.c L> for details related to CC module unload. Understood. Can you please review this patch? It basicly shifts INP_WLOCK earlier in the SOPT_SET case, and reverts to old code the SOPT_GET case. It returns back the stack based string buffer. -- Totus tuus, Glebius. --UlVJffcvxoiEqYs2 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="tcp_usrreq.c.diff" Index: tcp_usrreq.c =================================================================== --- tcp_usrreq.c (revision 294658) +++ tcp_usrreq.c (working copy) @@ -1479,7 +1479,7 @@ tcp_default_ctloutput(struct socket *so, struct so u_int ui; struct tcp_info ti; struct cc_algo *algo; - char *buf; + char *pbuf, buf[TCP_CA_NAME_MAX]; /* * For TCP_CCALGOOPT forward the control to CC module, for both @@ -1488,22 +1488,22 @@ tcp_default_ctloutput(struct socket *so, struct so switch (sopt->sopt_name) { case TCP_CCALGOOPT: INP_WUNLOCK(inp); - buf = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK | M_ZERO); - error = sooptcopyin(sopt, buf, sopt->sopt_valsize, + pbuf = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK | M_ZERO); + error = sooptcopyin(sopt, pbuf, sopt->sopt_valsize, sopt->sopt_valsize); if (error) { - free(buf, M_TEMP); + free(pbuf, M_TEMP); return (error); } INP_WLOCK_RECHECK(inp); if (CC_ALGO(tp)->ctl_output != NULL) - error = CC_ALGO(tp)->ctl_output(tp->ccv, sopt, buf); + error = CC_ALGO(tp)->ctl_output(tp->ccv, sopt, pbuf); else error = ENOENT; INP_WUNLOCK(inp); if (error == 0 && sopt->sopt_dir == SOPT_GET) - error = sooptcopyout(sopt, buf, sopt->sopt_valsize); - free(buf, M_TEMP); + error = sooptcopyout(sopt, pbuf, sopt->sopt_valsize); + free(pbuf, M_TEMP); return (error); } @@ -1600,12 +1600,10 @@ unlock_and_done: case TCP_CONGESTION: INP_WUNLOCK(inp); - buf = malloc(TCP_CA_NAME_MAX, M_TEMP, M_WAITOK|M_ZERO); error = sooptcopyin(sopt, buf, TCP_CA_NAME_MAX, 1); - if (error) { - free(buf, M_TEMP); + if (error) break; - } + INP_WLOCK_RECHECK(inp); CC_LIST_RLOCK(); STAILQ_FOREACH(algo, &cc_list, entries) if (strncmp(buf, algo->name, @@ -1612,12 +1610,11 @@ unlock_and_done: TCP_CA_NAME_MAX) == 0) break; CC_LIST_RUNLOCK(); - free(buf, M_TEMP); if (algo == NULL) { + INP_WUNLOCK(inp); error = EINVAL; break; } - INP_WLOCK_RECHECK(inp); /* * We hold a write lock over the tcb so it's safe to * do these things without ordering concerns. @@ -1786,9 +1783,10 @@ unlock_and_done: error = sooptcopyout(sopt, &ti, sizeof ti); break; case TCP_CONGESTION: + bzero(buf, sizeof(buf)); + strlcpy(buf, CC_ALGO(tp)->name, TCP_CA_NAME_MAX); INP_WUNLOCK(inp); - error = sooptcopyout(sopt, CC_ALGO(tp)->name, - TCP_CA_NAME_MAX); + error = sooptcopyout(sopt, buf, TCP_CA_NAME_MAX); break; case TCP_KEEPIDLE: case TCP_KEEPINTVL: --UlVJffcvxoiEqYs2-- From owner-svn-src-head@freebsd.org Sun Jan 24 08:07:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0190A8E31B; Sun, 24 Jan 2016 08:07:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A1351F79; Sun, 24 Jan 2016 08:07:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0O87KlZ008931 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 24 Jan 2016 00:07:20 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0O87Kb3008930; Sun, 24 Jan 2016 00:07:20 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 24 Jan 2016 00:07:20 -0800 From: Gleb Smirnoff To: Lawrence Stewart Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r294535 - in head/sys/netinet: . cc tcp_stacks Message-ID: <20160124080720.GE1004@FreeBSD.org> References: <201601212234.u0LMYpKT009948@repo.freebsd.org> <56A1D6B2.1010406@freebsd.org> <20160122181816.GB1004@FreeBSD.org> <56A31B78.2090100@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56A31B78.2090100@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 08:07:21 -0000 Lawrence, On Sat, Jan 23, 2016 at 05:19:36PM +1100, Lawrence Stewart wrote: L> > The problem is that cc.h (or tcp_cc.h) is already depening on many L> > TCP types. So, the structures defined inside are not agnostic, including L> > tcp headers before cc.h is required. L> L> Not in any significant way that tightly couples the API to TCP from L> consumers' perspective. L> L> > The old cc.h used to include tcp.h implicitly, which is a bad style. L> > L> > Since many developers sorted netinet/* includes in a .c file using L> > sort(1), that lead to cc.h always come before actual tcp includes, L> > hiding the real requirement for tcp.h in a .c file. L> L> To provide some more context, I considered that choice to be a lesser L> evil at the time. Linux had set the defacto standard macro naming and L> location so even though I would have put the CC related defines in cc.h L> given the choice, I wanted third-party software which checked for L> modular CC the Linux way to work on FreeBSD. The alphabetical ordering L> of includes is what prompted me to include tcp.h in cc.h so that cc.h L> could happily sit at the top of the list. I probably could have just L> moved cc.h to the cc subdir, in which case it would always come L> logically after the TCP includes as - perhaps that's L> the right solution. Well, if the intent was to provide some sort of compatibility with Linux, then my rename is even more valid! Look what left in the cc.h in the Netflix source (which is kinda forward of FreeBSD): almost the whole file is under _KERNEL. Only the tcp.h pollution left for userland. If Linux has cc.h and we want to put same definitions in cc.h, then we should start new cc.h and keep this one renamed. Because if we provided that one, we won't provide any compatibility, but would just pollute with tcp.h. I am fine with netinet/cc/cc.h. If you agree I can run the rename. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Sun Jan 24 11:00:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A817E45; Sun, 24 Jan 2016 11:00:40 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1035A339; Sun, 24 Jan 2016 11:00:39 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OB0dxx018614; Sun, 24 Jan 2016 11:00:39 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OB0caq018610; Sun, 24 Jan 2016 11:00:38 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601241100.u0OB0caq018610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 24 Jan 2016 11:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294660 - in head/sys: conf dev/extres dev/extres/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 11:00:40 -0000 Author: mmel Date: Sun Jan 24 11:00:38 2016 New Revision: 294660 URL: https://svnweb.freebsd.org/changeset/base/294660 Log: Add clock framework, a first part of new 'extended resources' family of support frameworks(i.e. reset/regulators/phy/tsensors/fuses...). The clock framework significantly simplifies handling of complex clock structures found in modern SoCs. It provides the unified consumers interface, holds and manages actual clock topology, frequency and gating. It's tested on three different ARM boards (Nvidia Tegra TK1, Inforce 6410 and Odroid XU2) and on one MIPS board (Creator Ci20) by kan@. The framework is still far from perfect and probably doesn't have stable interface yet, but we want to start testing it on more real boards and different architectures. Reviewed by: ian, kan (earlier version) Added: head/sys/dev/extres/ head/sys/dev/extres/clk/ head/sys/dev/extres/clk/clk.c (contents, props changed) head/sys/dev/extres/clk/clk.h (contents, props changed) head/sys/dev/extres/clk/clk_div.c (contents, props changed) head/sys/dev/extres/clk/clk_div.h (contents, props changed) head/sys/dev/extres/clk/clk_fixed.c (contents, props changed) head/sys/dev/extres/clk/clk_fixed.h (contents, props changed) head/sys/dev/extres/clk/clk_gate.c (contents, props changed) head/sys/dev/extres/clk/clk_gate.h (contents, props changed) head/sys/dev/extres/clk/clk_mux.c (contents, props changed) head/sys/dev/extres/clk/clk_mux.h (contents, props changed) head/sys/dev/extres/clk/clkdev_if.m (contents, props changed) head/sys/dev/extres/clk/clknode_if.m (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 24 09:24:23 2016 (r294659) +++ head/sys/conf/files Sun Jan 24 11:00:38 2016 (r294660) @@ -1410,6 +1410,13 @@ dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa dev/ex/if_ex_pccard.c optional ex pccard dev/exca/exca.c optional cbb +dev/extres/clk/clk.c optional ext_resources clk +dev/extres/clk/clkdev_if.m optional ext_resources clk +dev/extres/clk/clknode_if.m optional ext_resources clk +dev/extres/clk/clk_div.c optional ext_resources clk +dev/extres/clk/clk_fixed.c optional ext_resources clk +dev/extres/clk/clk_gate.c optional ext_resources clk +dev/extres/clk/clk_mux.c optional ext_resources clk dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Jan 24 09:24:23 2016 (r294659) +++ head/sys/conf/options Sun Jan 24 11:00:38 2016 (r294660) @@ -90,6 +90,7 @@ COMPAT_LINUXKPI opt_compat.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h +EXT_RESOURCES opt_global.h DIRECTIO FILEMON opt_dontuse.h FFCLOCK Added: head/sys/dev/extres/clk/clk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/clk/clk.c Sun Jan 24 11:00:38 2016 (r294660) @@ -0,0 +1,1261 @@ +/*- + * Copyright 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif +#include + +MALLOC_DEFINE(M_CLOCK, "clocks", "Clock framework"); + +/* Forward declarations. */ +struct clk; +struct clknodenode; +struct clkdom; + +typedef TAILQ_HEAD(clknode_list, clknode) clknode_list_t; +typedef TAILQ_HEAD(clkdom_list, clkdom) clkdom_list_t; + +/* Default clock methods. */ +static int clknode_method_init(struct clknode *clk, device_t dev); +static int clknode_method_recalc_freq(struct clknode *clk, uint64_t *freq); +static int clknode_method_set_freq(struct clknode *clk, uint64_t fin, + uint64_t *fout, int flags, int *stop); +static int clknode_method_set_gate(struct clknode *clk, bool enable); +static int clknode_method_set_mux(struct clknode *clk, int idx); + +/* + * Clock controller methods. + */ +static clknode_method_t clknode_methods[] = { + CLKNODEMETHOD(clknode_init, clknode_method_init), + CLKNODEMETHOD(clknode_recalc_freq, clknode_method_recalc_freq), + CLKNODEMETHOD(clknode_set_freq, clknode_method_set_freq), + CLKNODEMETHOD(clknode_set_gate, clknode_method_set_gate), + CLKNODEMETHOD(clknode_set_mux, clknode_method_set_mux), + + CLKNODEMETHOD_END +}; +DEFINE_CLASS_0(clknode, clknode_class, clknode_methods, 0); + +/* + * Clock node - basic element for modeling SOC clock graph. It holds the clock + * provider's data about the clock, and the links for the clock's membership in + * various lists. + */ +struct clknode { + KOBJ_FIELDS; + + /* Clock nodes topology. */ + struct clkdom *clkdom; /* Owning clock domain */ + TAILQ_ENTRY(clknode) clkdom_link; /* Domain list entry */ + TAILQ_ENTRY(clknode) clklist_link; /* Global list entry */ + + /* String based parent list. */ + const char **parent_names; /* Array of parent names */ + int parent_cnt; /* Number of parents */ + int parent_idx; /* Parent index or -1 */ + + /* Cache for already resolved names. */ + struct clknode **parents; /* Array of potential parents */ + struct clknode *parent; /* Current parent */ + + /* Parent/child relationship links. */ + clknode_list_t children; /* List of our children */ + TAILQ_ENTRY(clknode) sibling_link; /* Our entry in parent's list */ + + /* Details of this device. */ + void *softc; /* Instance softc */ + const char *name; /* Globally unique name */ + intptr_t id; /* Per domain unique id */ + int flags; /* CLK_FLAG_* */ + struct sx lock; /* Lock for this clock */ + int ref_cnt; /* Reference counter */ + int enable_cnt; /* Enabled counter */ + + /* Cached values. */ + uint64_t freq; /* Actual frequency */ +}; + +/* + * Per consumer data, information about how a consumer is using a clock node. + * A pointer to this structure is used as a handle in the consumer interface. + */ +struct clk { + device_t dev; + struct clknode *clknode; + int enable_cnt; +}; + +/* + * Clock domain - a group of clocks provided by one clock device. + */ +struct clkdom { + device_t dev; /* Link to provider device */ + TAILQ_ENTRY(clkdom) link; /* Global domain list entry */ + clknode_list_t clknode_list; /* All clocks in the domain */ + +#ifdef FDT + clknode_ofw_mapper_func *ofw_mapper; /* Find clock using FDT xref */ +#endif +}; + +/* + * The system-wide list of clock domains. + */ +static clkdom_list_t clkdom_list = TAILQ_HEAD_INITIALIZER(clkdom_list); + +/* + * Each clock node is linked on a system-wide list and can be searched by name. + */ +static clknode_list_t clknode_list = TAILQ_HEAD_INITIALIZER(clknode_list); + +/* + * Locking - we use three levels of locking: + * - First, topology lock is taken. This one protect all lists. + * - Second level is per clknode lock. It protects clknode data. + * - Third level is outside of this file, it protect clock device registers. + * First two levels use sleepable locks; clock device can use mutex or sx lock. + */ +static struct sx clk_topo_lock; +SX_SYSINIT(clock_topology, &clk_topo_lock, "Clock topology lock"); + +#define CLK_TOPO_SLOCK() sx_slock(&clk_topo_lock) +#define CLK_TOPO_XLOCK() sx_xlock(&clk_topo_lock) +#define CLK_TOPO_UNLOCK() sx_unlock(&clk_topo_lock) +#define CLK_TOPO_ASSERT() sx_assert(&clk_topo_lock, SA_LOCKED) +#define CLK_TOPO_XASSERT() sx_assert(&clk_topo_lock, SA_XLOCKED) + +#define CLKNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) +#define CLKNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) +#define CLKNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) + +static void clknode_adjust_parent(struct clknode *clknode, int idx); + +/* + * Default clock methods for base class. + */ +static int +clknode_method_init(struct clknode *clknode, device_t dev) +{ + + return (0); +} + +static int +clknode_method_recalc_freq(struct clknode *clknode, uint64_t *freq) +{ + + return (0); +} + +static int +clknode_method_set_freq(struct clknode *clknode, uint64_t fin, uint64_t *fout, + int flags, int *stop) +{ + + *stop = 0; + return (0); +} + +static int +clknode_method_set_gate(struct clknode *clk, bool enable) +{ + + return (0); +} + +static int +clknode_method_set_mux(struct clknode *clk, int idx) +{ + + return (0); +} + +/* + * Internal functions. + */ + +/* + * Duplicate an array of parent names. + * + * Compute total size and allocate a single block which holds both the array of + * pointers to strings and the copied strings themselves. Returns a pointer to + * the start of the block where the array of copied string pointers lives. + * + * XXX Revisit this, no need for the DECONST stuff. + */ +static const char ** +strdup_list(const char **names, int num) +{ + size_t len, slen; + const char **outptr, *ptr; + int i; + + len = sizeof(char *) * num; + for (i = 0; i < num; i++) { + if (names[i] == NULL) + continue; + slen = strlen(names[i]); + if (slen == 0) + panic("Clock parent names array have empty string"); + len += slen + 1; + } + outptr = malloc(len, M_CLOCK, M_WAITOK | M_ZERO); + ptr = (char *)(outptr + num); + for (i = 0; i < num; i++) { + if (names[i] == NULL) + continue; + outptr[i] = ptr; + slen = strlen(names[i]) + 1; + bcopy(names[i], __DECONST(void *, outptr[i]), slen); + ptr += slen; + } + return (outptr); +} + +/* + * Recompute the cached frequency for this node and all its children. + */ +static int +clknode_refresh_cache(struct clknode *clknode, uint64_t freq) +{ + int rv; + struct clknode *entry; + + CLK_TOPO_XASSERT(); + + /* Compute generated frequency. */ + rv = CLKNODE_RECALC_FREQ(clknode, &freq); + if (rv != 0) { + /* XXX If an error happens while refreshing children + * this leaves the world in a partially-updated state. + * Panic for now. + */ + panic("clknode_refresh_cache failed for '%s'\n", + clknode->name); + return (rv); + } + /* Refresh cache for this node. */ + clknode->freq = freq; + + /* Refresh cache for all children. */ + TAILQ_FOREACH(entry, &(clknode->children), sibling_link) { + rv = clknode_refresh_cache(entry, freq); + if (rv != 0) + return (rv); + } + return (0); +} + +/* + * Public interface. + */ + +struct clknode * +clknode_find_by_name(const char *name) +{ + struct clknode *entry; + + CLK_TOPO_ASSERT(); + + TAILQ_FOREACH(entry, &clknode_list, clklist_link) { + if (strcmp(entry->name, name) == 0) + return (entry); + } + return (NULL); +} + +struct clknode * +clknode_find_by_id(struct clkdom *clkdom, intptr_t id) +{ + struct clknode *entry; + + CLK_TOPO_ASSERT(); + + TAILQ_FOREACH(entry, &clkdom->clknode_list, clkdom_link) { + if (entry->id == id) + return (entry); + } + + return (NULL); +} + +/* -------------------------------------------------------------------------- */ +/* + * Clock domain functions + */ + +/* Find clock domain associated to device in global list. */ +struct clkdom * +clkdom_get_by_dev(const device_t dev) +{ + struct clkdom *entry; + + CLK_TOPO_ASSERT(); + + TAILQ_FOREACH(entry, &clkdom_list, link) { + if (entry->dev == dev) + return (entry); + } + return (NULL); +} + + +#ifdef FDT +/* Default DT mapper. */ +static int +clknode_default_ofw_map(struct clkdom *clkdom, uint32_t ncells, + phandle_t *cells, struct clknode **clk) +{ + + CLK_TOPO_ASSERT(); + + if (ncells == 0) + *clk = clknode_find_by_id(clkdom, 1); + else if (ncells == 1) + *clk = clknode_find_by_id(clkdom, cells[0]); + else + return (ERANGE); + + if (*clk == NULL) + return (ENXIO); + return (0); +} +#endif + +/* + * Create a clock domain. Returns with the topo lock held. + */ +struct clkdom * +clkdom_create(device_t dev) +{ + struct clkdom *clkdom; + + clkdom = malloc(sizeof(struct clkdom), M_CLOCK, M_WAITOK | M_ZERO); + clkdom->dev = dev; + TAILQ_INIT(&clkdom->clknode_list); +#ifdef FDT + clkdom->ofw_mapper = clknode_default_ofw_map; +#endif + + return (clkdom); +} + +void +clkdom_unlock(struct clkdom *clkdom) +{ + + CLK_TOPO_UNLOCK(); +} + +void +clkdom_xlock(struct clkdom *clkdom) +{ + + CLK_TOPO_XLOCK(); +} + +/* + * Finalize initialization of clock domain. Releases topo lock. + * + * XXX Revisit failure handling. + */ +int +clkdom_finit(struct clkdom *clkdom) +{ + struct clknode *clknode; + int i, rv; +#ifdef FDT + phandle_t node; + + + if ((node = ofw_bus_get_node(clkdom->dev)) == -1) { + device_printf(clkdom->dev, + "%s called on not ofw based device\n", __func__); + return (ENXIO); + } +#endif + rv = 0; + + /* Make clock domain globally visible. */ + CLK_TOPO_XLOCK(); + TAILQ_INSERT_TAIL(&clkdom_list, clkdom, link); +#ifdef FDT + OF_device_register_xref(OF_xref_from_node(node), clkdom->dev); +#endif + + /* Register all clock names into global list. */ + TAILQ_FOREACH(clknode, &clkdom->clknode_list, clkdom_link) { + TAILQ_INSERT_TAIL(&clknode_list, clknode, clklist_link); + } + /* + * At this point all domain nodes must be registered and all + * parents must be valid. + */ + TAILQ_FOREACH(clknode, &clkdom->clknode_list, clkdom_link) { + if (clknode->parent_cnt == 0) + continue; + for (i = 0; i < clknode->parent_cnt; i++) { + if (clknode->parents[i] != NULL) + continue; + if (clknode->parent_names[i] == NULL) + continue; + clknode->parents[i] = clknode_find_by_name( + clknode->parent_names[i]); + if (clknode->parents[i] == NULL) { + device_printf(clkdom->dev, + "Clock %s have unknown parent: %s\n", + clknode->name, clknode->parent_names[i]); + rv = ENODEV; + } + } + + /* If parent index is not set yet... */ + if (clknode->parent_idx == CLKNODE_IDX_NONE) { + device_printf(clkdom->dev, + "Clock %s have not set parent idx\n", + clknode->name); + rv = ENXIO; + continue; + } + if (clknode->parents[clknode->parent_idx] == NULL) { + device_printf(clkdom->dev, + "Clock %s have unknown parent(idx %d): %s\n", + clknode->name, clknode->parent_idx, + clknode->parent_names[clknode->parent_idx]); + rv = ENXIO; + continue; + } + clknode_adjust_parent(clknode, clknode->parent_idx); + } + CLK_TOPO_UNLOCK(); + return (rv); +} + +/* Dump clock domain. */ +void +clkdom_dump(struct clkdom * clkdom) +{ + struct clknode *clknode; + int rv; + uint64_t freq; + + CLK_TOPO_SLOCK(); + TAILQ_FOREACH(clknode, &clkdom->clknode_list, clkdom_link) { + rv = clknode_get_freq(clknode, &freq); + printf("Clock: %s, parent: %s(%d), freq: %llu\n", clknode->name, + clknode->parent == NULL ? "(NULL)" : clknode->parent->name, + clknode->parent_idx, + ((rv == 0) ? freq: rv)); + } + CLK_TOPO_UNLOCK(); +} + +/* + * Create and initialize clock object, but do not register it. + */ +struct clknode * +clknode_create(struct clkdom * clkdom, clknode_class_t clknode_class, + const struct clknode_init_def *def) +{ + struct clknode *clknode; + + KASSERT(def->name != NULL, ("clock name is NULL")); + KASSERT(def->name[0] != '\0', ("clock name is empty")); +#ifdef INVARIANTS + CLK_TOPO_SLOCK(); + if (clknode_find_by_name(def->name) != NULL) + panic("Duplicated clock registration: %s\n", def->name); + CLK_TOPO_UNLOCK(); +#endif + + /* Create object and initialize it. */ + clknode = malloc(sizeof(struct clknode), M_CLOCK, M_WAITOK | M_ZERO); + kobj_init((kobj_t)clknode, (kobj_class_t)clknode_class); + sx_init(&clknode->lock, "Clocknode lock"); + + /* Allocate softc if required. */ + if (clknode_class->size > 0) { + clknode->softc = malloc(clknode_class->size, + M_CLOCK, M_WAITOK | M_ZERO); + } + + /* Prepare array for ptrs to parent clocks. */ + clknode->parents = malloc(sizeof(struct clknode *) * def->parent_cnt, + M_CLOCK, M_WAITOK | M_ZERO); + + /* Copy all strings unless they're flagged as static. */ + if (def->flags & CLK_NODE_STATIC_STRINGS) { + clknode->name = def->name; + clknode->parent_names = def->parent_names; + } else { + clknode->name = strdup(def->name, M_CLOCK); + clknode->parent_names = + strdup_list(def->parent_names, def->parent_cnt); + } + + /* Rest of init. */ + clknode->id = def->id; + clknode->clkdom = clkdom; + clknode->flags = def->flags; + clknode->parent_cnt = def->parent_cnt; + clknode->parent = NULL; + clknode->parent_idx = CLKNODE_IDX_NONE; + TAILQ_INIT(&clknode->children); + + return (clknode); +} + +/* + * Register clock object into clock domain hierarchy. + */ +struct clknode * +clknode_register(struct clkdom * clkdom, struct clknode *clknode) +{ + int rv; + + rv = CLKNODE_INIT(clknode, clknode_get_device(clknode)); + if (rv != 0) { + printf(" CLKNODE_INIT failed: %d\n", rv); + return (NULL); + } + + TAILQ_INSERT_TAIL(&clkdom->clknode_list, clknode, clkdom_link); + + return (clknode); +} + +/* + * Clock providers interface. + */ + +/* + * Reparent clock node. + */ +static void +clknode_adjust_parent(struct clknode *clknode, int idx) +{ + + CLK_TOPO_XASSERT(); + + if (clknode->parent_cnt == 0) + return; + if ((idx == CLKNODE_IDX_NONE) || (idx >= clknode->parent_cnt)) + panic("Invalid clock parent index\n"); + + if (clknode->parents[idx] == NULL) + panic("%s: Attempt to set invalid parent %d for clock %s", + __func__, idx, clknode->name); + + /* Remove me from old children list. */ + if (clknode->parent != NULL) { + TAILQ_REMOVE(&clknode->parent->children, clknode, sibling_link); + } + + /* Insert into children list of new parent. */ + clknode->parent_idx = idx; + clknode->parent = clknode->parents[idx]; + TAILQ_INSERT_TAIL(&clknode->parent->children, clknode, sibling_link); +} + +/* + * Set parent index - init function. + */ +void +clknode_init_parent_idx(struct clknode *clknode, int idx) +{ + + if (clknode->parent_cnt == 0) { + clknode->parent_idx = CLKNODE_IDX_NONE; + clknode->parent = NULL; + return; + } + if ((idx == CLKNODE_IDX_NONE) || + (idx >= clknode->parent_cnt) || + (clknode->parent_names[idx] == NULL)) + panic("%s: Invalid clock parent index: %d\n", __func__, idx); + + clknode->parent_idx = idx; +} + +int +clknode_set_parent_by_idx(struct clknode *clknode, int idx) +{ + int rv; + uint64_t freq; + int oldidx; + + /* We have exclusive topology lock, node lock is not needed. */ + CLK_TOPO_XASSERT(); + + if (clknode->parent_cnt == 0) + return (0); + + if (clknode->parent_idx == idx) + return (0); + + oldidx = clknode->parent_idx; + clknode_adjust_parent(clknode, idx); + rv = CLKNODE_SET_MUX(clknode, idx); + if (rv != 0) { + clknode_adjust_parent(clknode, oldidx); + return (rv); + } + rv = clknode_get_freq(clknode->parent, &freq); + if (rv != 0) + return (rv); + rv = clknode_refresh_cache(clknode, freq); + return (rv); +} + +int +clknode_set_parent_by_name(struct clknode *clknode, const char *name) +{ + int rv; + uint64_t freq; + int oldidx, idx; + + /* We have exclusive topology lock, node lock is not needed. */ + CLK_TOPO_XASSERT(); + + if (clknode->parent_cnt == 0) + return (0); + + /* + * If this node doesnt have mux, then passthrough request to parent. + * This feature is used in clock domain initialization and allows us to + * set clock source and target frequency on the tail node of the clock + * chain. + */ + if (clknode->parent_cnt == 1) { + rv = clknode_set_parent_by_name(clknode->parent, name); + return (rv); + } + + for (idx = 0; idx < clknode->parent_cnt; idx++) { + if (clknode->parent_names[idx] == NULL) + continue; + if (strcmp(clknode->parent_names[idx], name) == 0) + break; + } + if (idx >= clknode->parent_cnt) { + return (ENXIO); + } + if (clknode->parent_idx == idx) + return (0); + + oldidx = clknode->parent_idx; + clknode_adjust_parent(clknode, idx); + rv = CLKNODE_SET_MUX(clknode, idx); + if (rv != 0) { + clknode_adjust_parent(clknode, oldidx); + CLKNODE_UNLOCK(clknode); + return (rv); + } + rv = clknode_get_freq(clknode->parent, &freq); + if (rv != 0) + return (rv); + rv = clknode_refresh_cache(clknode, freq); + return (rv); +} + +struct clknode * +clknode_get_parent(struct clknode *clknode) +{ + + return (clknode->parent); +} + +const char * +clknode_get_name(struct clknode *clknode) +{ + + return (clknode->name); +} + +const char ** +clknode_get_parent_names(struct clknode *clknode) +{ + + return (clknode->parent_names); +} + +int +clknode_get_parents_num(struct clknode *clknode) +{ + + return (clknode->parent_cnt); +} + +int +clknode_get_parent_idx(struct clknode *clknode) +{ + + return (clknode->parent_idx); +} + +int +clknode_get_flags(struct clknode *clknode) +{ + + return (clknode->flags); +} + + +void * +clknode_get_softc(struct clknode *clknode) +{ + + return (clknode->softc); +} + +device_t +clknode_get_device(struct clknode *clknode) +{ + + return (clknode->clkdom->dev); +} + +#ifdef FDT +void +clkdom_set_ofw_mapper(struct clkdom * clkdom, clknode_ofw_mapper_func *map) +{ + + clkdom->ofw_mapper = map; +} +#endif + +/* + * Real consumers executive + */ +int +clknode_get_freq(struct clknode *clknode, uint64_t *freq) +{ + int rv; + + CLK_TOPO_ASSERT(); + + /* Use cached value, if it exists. */ + *freq = clknode->freq; + if (*freq != 0) + return (0); + + /* Get frequency from parent, if the clock has a parent. */ + if (clknode->parent_cnt > 0) { + rv = clknode_get_freq(clknode->parent, freq); + if (rv != 0) { + return (rv); + } + } + + /* And recalculate my output frequency. */ + CLKNODE_XLOCK(clknode); + rv = CLKNODE_RECALC_FREQ(clknode, freq); + if (rv != 0) { + CLKNODE_UNLOCK(clknode); + printf("Cannot get frequency for clk: %s, error: %d\n", + clknode->name, rv); + return (rv); + } + + /* Save new frequency to cache. */ + clknode->freq = *freq; + CLKNODE_UNLOCK(clknode); + return (0); +} + +int +clknode_set_freq(struct clknode *clknode, uint64_t freq, int flags, + int enablecnt) +{ + int rv, done; + uint64_t parent_freq; + + /* We have exclusive topology lock, node lock is not needed. */ + CLK_TOPO_XASSERT(); + + parent_freq = 0; + + /* + * We can set frequency only if + * clock is disabled + * OR + * clock is glitch free and is enabled by calling consumer only + */ + if ((clknode->enable_cnt > 1) && + ((clknode->enable_cnt > enablecnt) || + !(clknode->flags & CLK_NODE_GLITCH_FREE))) { + return (EBUSY); + } + + /* Get frequency from parent, if the clock has a parent. */ + if (clknode->parent_cnt > 0) { + rv = clknode_get_freq(clknode->parent, &parent_freq); + if (rv != 0) { + return (rv); + } + } + + /* Set frequency for this clock. */ + rv = CLKNODE_SET_FREQ(clknode, parent_freq, &freq, flags, &done); + if (rv != 0) { + printf("Cannot set frequency for clk: %s, error: %d\n", + clknode->name, rv); + if ((flags & CLK_SET_DRYRUN) == 0) + clknode_refresh_cache(clknode, parent_freq); + return (rv); + } + + if (done) { + /* Success - invalidate frequency cache for all children. */ + clknode->freq = freq; + if ((flags & CLK_SET_DRYRUN) == 0) + clknode_refresh_cache(clknode, parent_freq); + } else if (clknode->parent != NULL) { + /* Nothing changed, pass request to parent. */ + rv = clknode_set_freq(clknode->parent, freq, flags, enablecnt); + } else { + /* End of chain without action. */ + printf("Cannot set frequency for clk: %s, end of chain\n", + clknode->name); + rv = ENXIO; + } + + return (rv); +} + +int +clknode_enable(struct clknode *clknode) +{ + int rv; + + CLK_TOPO_ASSERT(); + + /* Enable clock for each node in chain, starting from source. */ + if (clknode->parent_cnt > 0) { + rv = clknode_enable(clknode->parent); + if (rv != 0) { + return (rv); + } + } + + /* Handle this node */ + CLKNODE_XLOCK(clknode); + if (clknode->enable_cnt == 0) { + rv = CLKNODE_SET_GATE(clknode, 1); + if (rv != 0) { + CLKNODE_UNLOCK(clknode); + return (rv); + } + } + clknode->enable_cnt++; + CLKNODE_UNLOCK(clknode); + return (0); +} + +int +clknode_disable(struct clknode *clknode) +{ + int rv; + + CLK_TOPO_ASSERT(); + rv = 0; + + CLKNODE_XLOCK(clknode); + /* Disable clock for each node in chain, starting from consumer. */ + if ((clknode->enable_cnt == 1) && + ((clknode->flags & CLK_NODE_CANNOT_STOP) == 0)) { + rv = CLKNODE_SET_GATE(clknode, 0); + if (rv != 0) { + CLKNODE_UNLOCK(clknode); + return (rv); + } + } + clknode->enable_cnt--; + CLKNODE_UNLOCK(clknode); + + if (clknode->parent_cnt > 0) { + rv = clknode_disable(clknode->parent); + } + return (rv); +} + +int +clknode_stop(struct clknode *clknode, int depth) +{ + int rv; + + CLK_TOPO_ASSERT(); + rv = 0; + + CLKNODE_XLOCK(clknode); + /* The first node cannot be enabled. */ + if ((clknode->enable_cnt != 0) && (depth == 0)) { + CLKNODE_UNLOCK(clknode); + return (EBUSY); + } + /* Stop clock for each node in chain, starting from consumer. */ + if ((clknode->enable_cnt == 0) && + ((clknode->flags & CLK_NODE_CANNOT_STOP) == 0)) { + rv = CLKNODE_SET_GATE(clknode, 0); + if (rv != 0) { + CLKNODE_UNLOCK(clknode); + return (rv); + } + } + CLKNODE_UNLOCK(clknode); + + if (clknode->parent_cnt > 0) + rv = clknode_stop(clknode->parent, depth + 1); + return (rv); +} + +/* -------------------------------------------------------------------------- + * + * Clock consumers interface. + * + */ +/* Helper function for clk_get*() */ +static clk_t +clk_create(struct clknode *clknode, device_t dev) +{ + struct clk *clk; + + CLK_TOPO_ASSERT(); + + clk = malloc(sizeof(struct clk), M_CLOCK, M_WAITOK); + clk->dev = dev; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Jan 24 11:03:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B67D07F1F; Sun, 24 Jan 2016 11:03:36 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91CB28D9; Sun, 24 Jan 2016 11:03:36 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OB3ZGw021312; Sun, 24 Jan 2016 11:03:35 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OB3Zqo021307; Sun, 24 Jan 2016 11:03:35 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601241103.u0OB3Zqo021307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 24 Jan 2016 11:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294661 - in head/sys: conf dev/extres/hwreset X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 11:03:36 -0000 Author: mmel Date: Sun Jan 24 11:03:35 2016 New Revision: 294661 URL: https://svnweb.freebsd.org/changeset/base/294661 Log: Add reset framework, a second part of new 'extended resources' family of support frameworks (i.e. regulators/phy/tsensors/fuses...). It provides simple unified consumers interface for manipulations with on-chip resets. Reviewed by: ian, imp (paritaly) Added: head/sys/dev/extres/hwreset/ head/sys/dev/extres/hwreset/hwreset.c (contents, props changed) head/sys/dev/extres/hwreset/hwreset.h (contents, props changed) head/sys/dev/extres/hwreset/hwreset_if.m (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 24 11:00:38 2016 (r294660) +++ head/sys/conf/files Sun Jan 24 11:03:35 2016 (r294661) @@ -1417,6 +1417,8 @@ dev/extres/clk/clk_div.c optional ext_re dev/extres/clk/clk_fixed.c optional ext_resources clk dev/extres/clk/clk_gate.c optional ext_resources clk dev/extres/clk/clk_mux.c optional ext_resources clk +dev/extres/hwreset/hwreset.c optional ext_resources hwreset +dev/extres/hwreset/hwreset_if.m optional ext_resources hwreset dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard Added: head/sys/dev/extres/hwreset/hwreset.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/hwreset/hwreset.c Sun Jan 24 11:03:35 2016 (r294661) @@ -0,0 +1,186 @@ +/*- + * Copyright 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#endif + +#include + +#include "hwreset_if.h" + +struct hwreset { + device_t consumer_dev; /* consumer device*/ + device_t provider_dev; /* provider device*/ + int rst_id; /* reset id */ +}; + +MALLOC_DEFINE(M_HWRESET, "hwreset", "Reset framework"); + +int +hwreset_assert(hwreset_t rst) +{ + + return (HWRESET_ASSERT(rst->provider_dev, rst->rst_id, true)); +} + +int +hwreset_deassert(hwreset_t rst) +{ + + return (HWRESET_ASSERT(rst->provider_dev, rst->rst_id, false)); +} + +int +hwreset_is_asserted(hwreset_t rst, bool *value) +{ + + return (HWRESET_IS_ASSERTED(rst->provider_dev, rst->rst_id, value)); +} + +void +hwreset_release(hwreset_t rst) +{ + free(rst, M_HWRESET); +} + +int +hwreset_get_by_id(device_t consumer_dev, device_t provider_dev, intptr_t id, + hwreset_t *rst_out) +{ + hwreset_t rst; + + /* Create handle */ + rst = malloc(sizeof(struct hwreset), M_HWRESET, + M_WAITOK | M_ZERO); + rst->consumer_dev = consumer_dev; + rst->provider_dev = provider_dev; + rst->rst_id = id; + *rst_out = rst; + return (0); +} + +#ifdef FDT +int +hwreset_default_ofw_map(device_t provider_dev, phandle_t xref, int ncells, + pcell_t *cells, intptr_t *id) +{ + if (ncells == 0) + *id = 1; + else if (ncells == 1) + *id = cells[0]; + else + return (ERANGE); + + return (0); +} + +int +hwreset_get_by_ofw_idx(device_t consumer_dev, int idx, hwreset_t *rst) +{ + phandle_t cnode, xnode; + pcell_t *cells; + device_t rstdev; + int ncells, rv; + intptr_t id; + + cnode = ofw_bus_get_node(consumer_dev); + if (cnode <= 0) { + device_printf(consumer_dev, + "%s called on not ofw based device\n", __func__); + return (ENXIO); + } + + rv = ofw_bus_parse_xref_list_alloc(cnode, "resets", "#reset-cells", + idx, &xnode, &ncells, &cells); + if (rv != 0) + return (rv); + + /* Tranlate provider to device */ + rstdev = OF_device_from_xref(xnode); + if (rstdev == NULL) { + free(cells, M_OFWPROP); + return (ENODEV); + } + /* Map reset to number */ + rv = HWRESET_MAP(rstdev, xnode, ncells, cells, &id); + free(cells, M_OFWPROP); + if (rv != 0) + return (rv); + + return (hwreset_get_by_id(consumer_dev, rstdev, id, rst)); +} + +int +hwreset_get_by_ofw_name(device_t consumer_dev, char *name, hwreset_t *rst) +{ + int rv, idx; + phandle_t cnode; + + cnode = ofw_bus_get_node(consumer_dev); + if (cnode <= 0) { + device_printf(consumer_dev, + "%s called on not ofw based device\n", __func__); + return (ENXIO); + } + rv = ofw_bus_find_string_index(cnode, "reset-names", name, &idx); + if (rv != 0) + return (rv); + return (hwreset_get_by_ofw_idx(consumer_dev, idx, rst)); +} + +void +hwreset_register_ofw_provider(device_t provider_dev) +{ + phandle_t xref, node; + + node = ofw_bus_get_node(provider_dev); + if (node <= 0) + panic("%s called on not ofw based device.\n", __func__); + + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, provider_dev); +} + +void +hwreset_unregister_ofw_provider(device_t provider_dev) +{ + phandle_t xref; + + xref = OF_xref_from_device(provider_dev); + OF_device_register_xref(xref, NULL); +} +#endif Added: head/sys/dev/extres/hwreset/hwreset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/hwreset/hwreset.h Sun Jan 24 11:03:35 2016 (r294661) @@ -0,0 +1,67 @@ +/*- + * Copyright 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_EXTRES_HWRESET_HWRESET_H +#define DEV_EXTRES_HWRESET_HWRESET_H + +#include "opt_platform.h" +#include +#ifdef FDT +#include +#endif + +typedef struct hwreset *hwreset_t; + +/* + * Provider interface + */ +#ifdef FDT +int hwreset_default_ofw_map(device_t provider_dev, phandle_t xref, int ncells, + pcell_t *cells, intptr_t *id); +void hwreset_register_ofw_provider(device_t provider_dev); +void hwreset_unregister_ofw_provider(device_t provider_dev); +#endif + +/* + * Consumer interface + */ +int hwreset_get_by_id(device_t consumer_dev, device_t provider_dev, intptr_t id, + hwreset_t *rst); +void hwreset_release(hwreset_t rst); + +int hwreset_assert(hwreset_t rst); +int hwreset_deassert(hwreset_t rst); +int hwreset_is_asserted(hwreset_t rst, bool *value); + +#ifdef FDT +int hwreset_get_by_ofw_name(device_t consumer_dev, char *name, hwreset_t *rst); +int hwreset_get_by_ofw_idx(device_t consumer_dev, int idx, hwreset_t *rst); +#endif + + + +#endif /* DEV_EXTRES_HWRESET_HWRESET_H */ Added: head/sys/dev/extres/hwreset/hwreset_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/hwreset/hwreset_if.m Sun Jan 24 11:03:35 2016 (r294661) @@ -0,0 +1,72 @@ +#- +# Copyright 2016 Michal Meloun +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#ifdef FDT +#include +#include +#endif + +INTERFACE hwreset; + +#ifdef FDT +HEADER { +int hwreset_default_ofw_map(device_t , phandle_t, int, pcell_t *, intptr_t *); +} + +# +# map fdt property cells to reset id +# Returns 0 on success or a standard errno value. +# +METHOD int map { + device_t provider_dev; + phandle_t xref; + int ncells; + pcell_t *cells; + intptr_t *id; +} DEFAULT hwreset_default_ofw_map; +#endif + +# +# Assert/deassert given reset. +# Returns 0 on success or a standard errno value. +# +METHOD int assert { + device_t provider_dev; + intptr_t id; + bool value; +}; + +# +# Get actual status of given reset. +# Returns 0 on success or a standard errno value. +# +METHOD int is_asserted { + device_t provider_dev; + intptr_t id; + bool *value; +}; From owner-svn-src-head@freebsd.org Sun Jan 24 12:10:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 489F97CED; Sun, 24 Jan 2016 12:10:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id F0D2E65C; Sun, 24 Jan 2016 12:10:30 +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 u0OCAUGq040879; Sun, 24 Jan 2016 12:10:30 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OCATgB040877; Sun, 24 Jan 2016 12:10:29 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601241210.u0OCATgB040877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sun, 24 Jan 2016 12:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294662 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 12:10:31 -0000 Author: br Date: Sun Jan 24 12:10:29 2016 New Revision: 294662 URL: https://svnweb.freebsd.org/changeset/base/294662 Log: Add support for RISC-V ISA. Reviewed by: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5040 Modified: head/lib/libproc/proc_bkpt.c head/lib/libproc/proc_regs.c Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Sun Jan 24 11:03:35 2016 (r294661) +++ head/lib/libproc/proc_bkpt.c Sun Jan 24 12:10:29 2016 (r294662) @@ -61,6 +61,9 @@ __FBSDID("$FreeBSD$"); #elif defined(__powerpc__) #define BREAKPOINT_INSTR 0x7fe00008 /* trap */ #define BREAKPOINT_INSTR_SZ 4 +#elif defined(__riscv__) +#define BREAKPOINT_INSTR 0x00100073 /* sbreak */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif Modified: head/lib/libproc/proc_regs.c ============================================================================== --- head/lib/libproc/proc_regs.c Sun Jan 24 11:03:35 2016 (r294661) +++ head/lib/libproc/proc_regs.c Sun Jan 24 12:10:29 2016 (r294662) @@ -66,6 +66,8 @@ proc_regget(struct proc_handle *phdl, pr *regvalue = regs.r_regs[PC]; #elif defined(__powerpc__) *regvalue = regs.pc; +#elif defined(__riscv__) + *regvalue = regs.sepc; #endif break; case REG_SP: @@ -81,6 +83,8 @@ proc_regget(struct proc_handle *phdl, pr *regvalue = regs.r_regs[SP]; #elif defined(__powerpc__) *regvalue = regs.fixreg[1]; +#elif defined(__riscv__) + *regvalue = regs.sp; #endif break; default: @@ -117,6 +121,8 @@ proc_regset(struct proc_handle *phdl, pr regs.r_regs[PC] = regvalue; #elif defined(__powerpc__) regs.pc = regvalue; +#elif defined(__riscv__) + regs.sepc = regvalue; #endif break; case REG_SP: @@ -132,6 +138,8 @@ proc_regset(struct proc_handle *phdl, pr regs.r_regs[PC] = regvalue; #elif defined(__powerpc__) regs.fixreg[1] = regvalue; +#elif defined(__riscv__) + regs.sp = regvalue; #endif break; default: From owner-svn-src-head@freebsd.org Sun Jan 24 13:38:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE82C7D88; Sun, 24 Jan 2016 13:38:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBB157C0; Sun, 24 Jan 2016 13:38:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ODcfc5067762; Sun, 24 Jan 2016 13:38:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ODcfYr067761; Sun, 24 Jan 2016 13:38:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601241338.u0ODcfYr067761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 24 Jan 2016 13:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294663 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 13:38:43 -0000 Author: kib Date: Sun Jan 24 13:38:41 2016 New Revision: 294663 URL: https://svnweb.freebsd.org/changeset/base/294663 Log: Typo in comment. Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Jan 24 12:10:29 2016 (r294662) +++ head/sys/vm/vm_map.c Sun Jan 24 13:38:41 2016 (r294663) @@ -1553,7 +1553,7 @@ again: * * The map must be locked. * - * This routine guarentees that the passed entry remains valid (though + * This routine guarantees that the passed entry remains valid (though * possibly extended). When merging, this routine may delete one or * both neighbors. */ From owner-svn-src-head@freebsd.org Sun Jan 24 13:58:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 452709C261F; Sun, 24 Jan 2016 13:58:09 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001: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 0DC7D7CD; Sun, 24 Jan 2016 13:58:09 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-ig0-x22d.google.com with SMTP id t15so19736632igr.0; Sun, 24 Jan 2016 05:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=y+w1guYgXH1n5HB4U7JpKvYsmQ8gkzZOHb4smrwGEmE=; b=HpEf6kPqGUMVcepJG4JkMsFUNEcma7yvUON7u329SY5nXflMDkQWukNdY1NEwiBDYC Wf73ovdSVr17IU0TOQSCErKV951LUeshGJ7wkPi46yDqpK4gd/at5l5ydySuAiRLjcw1 nX8OCaf26p5lLdF4e9hk/lZLcIYnCxEo09csNgtW2YPEfO1vpJlK4d0+aDrcdgNLpN6E VBR9Bh/bxu9TFJ1HXLNO3gwORcqOGRxIhHYUFbN1H+temiXhnC5ko49abh9/vF+g2fHV WUrs4jYMRu+a/QyxSJg/v0fYSUAaiTXVetBhMv8xSFggxmqUCApO+xvh55xNfqyYhA6t B6WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=y+w1guYgXH1n5HB4U7JpKvYsmQ8gkzZOHb4smrwGEmE=; b=d4z3zcBfusMnO78c2eZhcgx2rKhmiVU/KRZ2e4vDHS+ltb/zyIFEh84QJ8HxredrGT DJN9bnlq6I++xcKZpsUS5QBQboA07DskQ4dTNRUCTCUOwZXqQTKAtEZX1kiCXYali3Eu xdAwKyGWMn9c6lr05YxhYfB5Qz6FiXl457vfnC8FS0l+yPJdtQQm9zN9nwAG2jsl0r9o tlYtZDFczvFYKiVkjwigt5Y8XTCeTLquiJ/ol371f6aTeeo2sYQOLN9gzn/Drgujdcgz VZFLkWOrgQbk+FnSXP8Te2LXQSxli9yz61wPlzEKwmRBroHiXZU6ddTTEX5HpOu/qcGG EIbA== X-Gm-Message-State: AG10YOR91i8l+GpZyF6qSEZ8Rsstt7TepjcwXoIyapDxwn3yublUCxLvpQRWmbapN4gx+b7a0VVWidmCFbKafA== MIME-Version: 1.0 X-Received: by 10.50.102.69 with SMTP id fm5mr12988181igb.24.1453643888382; Sun, 24 Jan 2016 05:58:08 -0800 (PST) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.159.195 with HTTP; Sun, 24 Jan 2016 05:58:08 -0800 (PST) Received: by 10.107.159.195 with HTTP; Sun, 24 Jan 2016 05:58:08 -0800 (PST) In-Reply-To: <201601130149.u0D1nZmI053966@repo.freebsd.org> References: <201601130149.u0D1nZmI053966@repo.freebsd.org> Date: Sun, 24 Jan 2016 13:58:08 +0000 X-Google-Sender-Auth: Ys0Ki2zZDeYZIBI0ysjf5PdQ0AU Message-ID: Subject: Re: svn commit: r293801 - in head: . etc share/examples/ypldap usr.sbin/ypldap From: Antoine Brodin To: "araujo@FreeBSD.org" Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 13:58:09 -0000 On Jan 13, 2016 2:49 AM, "Marcelo Araujo" wrote: > > Author: araujo > Date: Wed Jan 13 01:49:35 2016 > New Revision: 293801 > URL: https://svnweb.freebsd.org/changeset/base/293801 > > Log: > ypldap(8) is a feature ready to be used to translate nis(8) database to ldap(3). > > This commit, fix a core dump on ypldap(8) related with memory allocation. > Also an example of how to set the ypldap.conf(5) properly is added to > examples files. > > A new user _ypldap is required to be able to run ypldap(8) as well as > in a chroot mode. > > Reviewed by: rodrigc (mentor), bjk > Approved by: bapt (mentor) > Relnotes: Yes > Sponsored by: gandi.net > Differential Revision: https://reviews.freebsd.org/D4744 > Hi, Uid 93 is already used in the ports tree by jabber. (/usr/ports/UIDs) Cheers, Antoine > Added: > head/share/examples/ypldap/ > head/share/examples/ypldap/ypldap.conf (contents, props changed) > Modified: > head/UPDATING > head/etc/master.passwd > head/usr.sbin/ypldap/yp.c > head/usr.sbin/ypldap/ypldap.conf.5 > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Wed Jan 13 01:32:04 2016 (r293800) > +++ head/UPDATING Wed Jan 13 01:49:35 2016 (r293801) > @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20160113: > + With the addition of ypldap(8), a new _ypldap user is now required > + during installworld. "mergemaster -p" can be used to add the user > + prior to installworld, as documented in the handbook. > + > 20151216: > The tftp loader (pxeboot) now uses the option root-path directive. As a > consequence it no longer looks for a pxeboot.4th file on the tftp > > Modified: head/etc/master.passwd > ============================================================================== > --- head/etc/master.passwd Wed Jan 13 01:32:04 2016 (r293800) > +++ head/etc/master.passwd Wed Jan 13 01:49:35 2016 (r293801) > @@ -22,5 +22,6 @@ uucp:*:66:66::0:0:UUCP pseudo-user:/var/ > pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin > auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin > www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin > +_ypldap:*:93:93::0:0:YP Ldap unprivileged user:/var/empty:/usr/sbin/nologin > hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin > nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin > > Added: head/share/examples/ypldap/ypldap.conf > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/examples/ypldap/ypldap.conf Wed Jan 13 01:49:35 2016 (r293801) > @@ -0,0 +1,40 @@ > +$FreeBSD$ > +domain "freebsd.org" > +interval 60 > +provide map "passwd.byname" > +provide map "passwd.byuid" > +provide map "group.byname" > +provide map "group.bygid" > +provide map "netid.byname" > + > +directory "127.0.0.1" { > + # directory options > + binddn "cn=ldap,dc=freebsd,dc=org" > + bindcred "secret" > + basedn "dc=freebsd.,dc=org" > + # starting point for groups directory search, default to basedn > + groupdn "ou=Groups,dc=freebsd,dc=org" > + > + # passwd maps configuration (RFC 2307 posixAccount object class) > + passwd filter "(objectClass=posixAccount)" > + > + attribute name maps to "uid" > + fixed attribute passwd "*" > + attribute uid maps to "uidNumber" > + attribute gid maps to "gidNumber" > + attribute gecos maps to "cn" > + attribute home maps to "homeDirectory" > + attribute shell maps to "loginShell" > + fixed attribute change "0" > + fixed attribute expire "0" > + fixed attribute class "" > + > + # group maps configuration (RFC 2307 posixGroup object class) > + group filter "(objectClass=posixGroup)" > + > + attribute groupname maps to "cn" > + fixed attribute grouppasswd "*" > + attribute groupgid maps to "gidNumber" > + # memberUid returns multiple group members > + list groupmembers maps to "memberUid" > +} > > Modified: head/usr.sbin/ypldap/yp.c > ============================================================================== > --- head/usr.sbin/ypldap/yp.c Wed Jan 13 01:32:04 2016 (r293800) > +++ head/usr.sbin/ypldap/yp.c Wed Jan 13 01:49:35 2016 (r293801) > @@ -83,10 +83,10 @@ void > yp_enable_events(void) > { > int i; > - extern fd_set svc_fdset; > + extern fd_set svc_fdset; > struct yp_event *ye; > > - for (i = 0; i < getdtablesize(); i++) { > + for (i = 0; i < FD_SETSIZE; i++) { > if (FD_ISSET(i, &svc_fdset)) { > if ((ye = calloc(1, sizeof(*ye))) == NULL) > fatal(NULL); > > Modified: head/usr.sbin/ypldap/ypldap.conf.5 > ============================================================================== > --- head/usr.sbin/ypldap/ypldap.conf.5 Wed Jan 13 01:32:04 2016 (r293800) > +++ head/usr.sbin/ypldap/ypldap.conf.5 Wed Jan 13 01:49:35 2016 (r293801) > @@ -15,7 +15,7 @@ > .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF > .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > .\" > -.Dd $Mdocdate: April 30 2012 $ > +.Dd $Mdocdate: January 13 2016 $ > .Dt YPLDAP.CONF 5 > .Os > .Sh NAME > @@ -155,6 +155,9 @@ Use the supplied LDAP filter to retrieve > .It Pa /etc/ypldap.conf > .Xr ypldap 8 > configuration file. > +.It Pa /usr/share/example/ypldap/ypldap.conf > +.Xr ypldap 8 > +configuration file example. > .El > .Sh SEE ALSO > .Xr ypbind 8 , > From owner-svn-src-head@freebsd.org Sun Jan 24 14:13:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B24849C2C51 for ; Sun, 24 Jan 2016 14:13:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x22f.google.com (mail-qg0-x22f.google.com [IPv6:2607:f8b0:400d:c04::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 68C25FA4 for ; Sun, 24 Jan 2016 14:13:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x22f.google.com with SMTP id 6so91281306qgy.1 for ; Sun, 24 Jan 2016 06:13:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=nVeM28EElP2c57G60j+MRwWZxy4xcqW7nvIcFM2rQxk=; b=uzzdDEqdFvGLMjJesICihw7J3XSCXtseZFpiCCnitZ6CYN6ZfmhnnIufO4YcH35t6a +dyle2DT6IPgk5x/VgS6HyByXX7LEmEi4SEPdjVfno9CEDI8JDpkzr1nPcnrVmHsQ5V6 +B+5Zg0cbVuY8J5iyvQWDyd0RFTWYNa+GKo5/WYAFeGj/YL/+GTf9MFjbDt0PRTWQwpv x1DraaY5RctgoMtApMlQ2xeWT3WeNzYi62NocEByM8xpseNpFVNkebPrGVprK0zTya4Z f0PlrD/s8UN1PhGWP5c/9aiF339gOuDAyWN8DHRX5I7npFcKzFabSG4vQew8akDh45kd p1yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=nVeM28EElP2c57G60j+MRwWZxy4xcqW7nvIcFM2rQxk=; b=ZVbEssD+IpI9oFrtnRiSncLtxaYxZY2mn0ayDE5AAihEW9zlqYY5f21twjHqJc+1G0 6Mx+8z1Yl6PRZqNtEr1wS1ZX1+Yyn7gormt9DXkmEzbtBrpfGrVJNFPG6qOY0iLXWL1Y Kv53puijOfrZOx77pKr79L/NzQahGhBAffQO9jTpZqU8lFuSBjUe56/xVKIZNNmxtlnA 7lu7QhyoX5LvAnE8YGDTyFPC//EQ2aQQ1PoqV+DQX0e1vhKYUzc7jFenf6/mwdkwFhsi xxVV2dU5RwJzmrvO+d42ZAeu6FEEacsLFfPiKgvuDmLScWhd5GjIHxL87xGo6fHSTfQu KVpg== X-Gm-Message-State: AG10YORUlwMSPT5s5svr9v+2inP4fTwQc1Gy45i0o3lKdGroH/qiZYfdeR99+qy+LCRdy6RX X-Received: by 10.140.171.5 with SMTP id r5mr16812202qhr.51.1453644817449; Sun, 24 Jan 2016 06:13:37 -0800 (PST) Received: from mutt-hardenedbsd (c-73-135-80-144.hsd1.md.comcast.net. [73.135.80.144]) by smtp.gmail.com with ESMTPSA id l139sm6874931qhc.24.2016.01.24.06.13.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jan 2016 06:13:35 -0800 (PST) Date: Sun, 24 Jan 2016 09:13:33 -0500 From: Shawn Webb To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294329 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys Message-ID: <20160124141333.GA19117@mutt-hardenedbsd> References: <201601191700.u0JH0P6k061610@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <201601191700.u0JH0P6k061610@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 14:13:38 -0000 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 19, 2016 at 05:00:25PM +0000, Alan Somers wrote: > Author: asomers > Date: Tue Jan 19 17:00:25 2016 > New Revision: 294329 > URL: https://svnweb.freebsd.org/changeset/base/294329 >=20 > Log: > Disallow zvol-backed ZFS pools > =20 > Using zvols as backing devices for ZFS pools is fraught with panics and > deadlocks. For example, attempting to online a missing device in the > presence of a zvol can cause a panic when vdev_geom tastes the zvol. B= etter > to completely disable vdev_geom from ever opening a zvol. The solution > relies on setting a thread-local variable during vdev_geom_open, and > returning EOPNOTSUPP during zvol_open if that thread-local variable is = set. > =20 > Remove the check for MUTEX_HELD(&zfsdev_state_lock) in zvol_open. Its i= ntent > was to prevent a recursive mutex acquisition panic. However, the new ch= eck > for the thread-local variable also fixes that problem. > =20 > Also, fix a panic in vdev_geom_taste_orphan. For an unknown reason, this > function was set to panic. But it can occur that a device disappears du= ring > tasting, and it causes no problems to ignore this departure. > =20 > Reviewed by: delphij > MFC after: 1 week > Relnotes: yes > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D4986 I've just been bit by this pretty hard. I have a bhyve VM that's backed by a zvol. The VM is running root-on-zfs. I wrote some experimental code that's now preventing the VM from booting (kernel panic due to userland change). Since I can't import the pool, I have no way of fixing the problem. I'm probably just going to go revert this commit locally on my box so I can get some work done. Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWpNwKAAoJEGqEZY9SRW7u0MUP/i7mAOrXGAWq9LUGWbZ2Khiq CIfq9DUKtwDvfEMSqk8tpvyMyqXll68BcFcZBT7lPOOX4DUhkKyYsvhllzu9Yq/a UHA+tXO/64WEXwTCMKBp3pPARr/wD7BRHturAQMgfsBmjWS3LbNXlle3fSMDfq5f X83wsvmU7AbYfmLS3twr9dP4kgp+LFcgGLC8zLHE7HkESXq/rEblLxrTUJCkdZuZ kT79/PkHrr0E8nhyOojCadLHfg1V0toc4Gj03ADHi17G3Bh5P8AZyniZa6fOdXtO Moc8+yMqqAmwh7J/R1QxNtGATs8oEhjgz+55jRUFVml+qlExC7aXh0PrOHSPkPc7 6890Z3HFSahDYbIfBQcku/O41i4DTOticyaAJ82O2Gc8VI4SZLagziai8RIGyETR qhqxJP3jP+g3KoF+QIQu72Ea6p/ww67Edweq80oHfSYsKKSRMP/lFrulIc4E1eP9 QHORBECiFnRvU0FQCNSuSeQ9W0IA5/Rl0Du7NNjaGpd+xsNlHKrjy50FmzgG/GWu HItpdZzQ6QhBbno2mr8AcyL4XoTi9sEWXHeKOWLx9VWqiYCfUKgkFAKh4VoJ+79r LbtMDbjDYstdnSTL7LUerRSz7iSPs/jI4Esoku4LZoCbV22ao0YiXWysR6BwSl0a L8pQ/dPnyR8VtAn7QnAb =1JIc -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO-- From owner-svn-src-head@freebsd.org Sun Jan 24 14:20:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 654289C2FBB; Sun, 24 Jan 2016 14:20:17 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2712F859; Sun, 24 Jan 2016 14:20:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u0OEJmLP085450 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 24 Jan 2016 06:19:53 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r294329 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys To: Shawn Webb , Alan Somers References: <201601191700.u0JH0P6k061610@repo.freebsd.org> <20160124141333.GA19117@mutt-hardenedbsd> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Xin LI From: Julian Elischer Message-ID: <56A4DD7E.7040303@freebsd.org> Date: Sun, 24 Jan 2016 22:19:42 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160124141333.GA19117@mutt-hardenedbsd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 14:20:17 -0000 On 24/01/2016 10:13 PM, Shawn Webb wrote: > On Tue, Jan 19, 2016 at 05:00:25PM +0000, Alan Somers wrote: >> Author: asomers >> Date: Tue Jan 19 17:00:25 2016 >> New Revision: 294329 >> URL: https://svnweb.freebsd.org/changeset/base/294329 >> >> Log: >> Disallow zvol-backed ZFS pools >> >> Using zvols as backing devices for ZFS pools is fraught with panics and >> deadlocks. For example, attempting to online a missing device in the >> presence of a zvol can cause a panic when vdev_geom tastes the zvol. Better >> to completely disable vdev_geom from ever opening a zvol. The solution >> relies on setting a thread-local variable during vdev_geom_open, and >> returning EOPNOTSUPP during zvol_open if that thread-local variable is set. >> >> Remove the check for MUTEX_HELD(&zfsdev_state_lock) in zvol_open. Its intent >> was to prevent a recursive mutex acquisition panic. However, the new check >> for the thread-local variable also fixes that problem. >> >> Also, fix a panic in vdev_geom_taste_orphan. For an unknown reason, this >> function was set to panic. But it can occur that a device disappears during >> tasting, and it causes no problems to ignore this departure. >> >> Reviewed by: delphij >> MFC after: 1 week >> Relnotes: yes >> Sponsored by: Spectra Logic Corp >> Differential Revision: https://reviews.freebsd.org/D4986 > I've just been bit by this pretty hard. I have a bhyve VM that's backed > by a zvol. The VM is running root-on-zfs. I wrote some experimental code > that's now preventing the VM from booting (kernel panic due to userland > change). Since I can't import the pool, I have no way of fixing the > problem. > > I'm probably just going to go revert this commit locally on my box so I > can get some work done. I use an md device to do this in bhyve but I was considering using a zvol. Populating it in the host system and then presenting it to the VM as a disk. maybe it could be enabled with a sysctl? Is the problem always present? > > Thanks, > From owner-svn-src-head@freebsd.org Sun Jan 24 14:35:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32287537; Sun, 24 Jan 2016 14:35:22 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::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 A32641B3; Sun, 24 Jan 2016 14:35:22 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id e65so68302853pfe.0; Sun, 24 Jan 2016 06:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:mime-version:from:subject:date:to:cc:content-type; bh=kRB229AmBlHEx8ARzNEdP21zQtL1MEXdgo7LTrlh2/s=; b=yaYIkAPqrt8+F/Bt3z9euy3oS7hzdDQw1S4BesGIJtKxfjGfxDFWhdP2WIaeFHyCUX Qop18RjFiEPapV6Rccvzv0l66ZnrgQnOlkXCbXR/lj7p5zVyiDENQOfR9Q/dVErNODHc RZonRSE0/lmy6n3iyhtPmqOt3rSFARVqs9ANpv61q0P6eaQCd1MokxJ0UUUJGYAUEvWI KLIBVZvinttNTDbQNtLbQ5P+SoMvBp20XMH74oQKEeqdbZ2X952bjnYst1E0+Px7ORqG yQvqn2msa9IpqyY7FfWkXiVvVKASYZjOJHfPRHqVJ1blMHASfas2kwD7cO8kU7NQslt3 P6Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:mime-version:from:subject:date:to:cc :content-type; bh=kRB229AmBlHEx8ARzNEdP21zQtL1MEXdgo7LTrlh2/s=; b=QnViE9q+TyWubcLFalNoZEzqitUSDl5KArQeIYMbsGtYtxTLOrwzD+CWMSMWpffmPb mDAkP53LqEmmuDepgFbsv0TWH472U2hCFePjSWjfHhy6nmGomJOuoDLbSbfT42A9t540 3UHEjH0LI4Aj5H4T4r0yUmLh8Nt29qUj5vsGnST+Cf7+yy2EEmev+b7QE6FDOuMut+59 LG/zRXt6X7/7oy1FFLGX+QjtwE1ZKNKgMFnSa+6of6PGM6416DwqR2ElD6qoSR9j1i7R PXx0i3S9+0321xVe45Fe86MIbW4xrnj42ENtdVDDT9sDrFXTrfE3Sh/13Jfkt0WoRPMQ mldg== X-Gm-Message-State: AG10YOS6aESrxDG7mi5g9V7RwbZdXfWlZC7wPUnt1ooaEATSMGdn21KEtckz+8vWFo0xcA== X-Received: by 10.98.70.17 with SMTP id t17mr18765725pfa.107.1453646122230; Sun, 24 Jan 2016 06:35:22 -0800 (PST) Received: from [10.168.3.103] (S0106d4ca6d8943b0.gv.shawcable.net. [24.68.134.59]) by smtp.gmail.com with ESMTPSA id qz9sm22135447pab.39.2016.01.24.06.35.21 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Jan 2016 06:35:21 -0800 (PST) Message-ID: <56a4e129.a98b420a.ebf8f.ffffe225@mx.google.com> MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r294329 - inhead/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys Date: Sun, 24 Jan 2016 06:35:22 -0800 To: Julian Elischer , Shawn Webb , Alan Somers CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Xin LI , "cy.schubert@cschubert.com" Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 14:35:23 -0000 A previous email in this thread said that a sysctl will be committed before= MFC. I personally have never encountered this particular problem. Sent from my cellphone, ~Cy -----Original Message----- From: Julian Elischer Sent: 24/01/2016 06:20 To: Shawn Webb; Alan Somers Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org; Xin LI Subject: Re: svn commit: r294329 - inhead/sys/cddl/contrib/opensolaris/uts/= common/fs/zfs: . sys On 24/01/2016 10:13 PM, Shawn Webb wrote: > On Tue, Jan 19, 2016 at 05:00:25PM +0000, Alan Somers wrote: >> Author: asomers >> Date: Tue Jan 19 17:00:25 2016 >> New Revision: 294329 >> URL: https://svnweb.freebsd.org/changeset/base/294329 >> >> Log: >> Disallow zvol-backed ZFS pools >> =20 >> Using zvols as backing devices for ZFS pools is fraught with panics a= nd >> deadlocks. For example, attempting to online a missing device in the >> presence of a zvol can cause a panic when vdev_geom tastes the zvol. = Better >> to completely disable vdev_geom from ever opening a zvol. The solutio= n >> relies on setting a thread-local variable during vdev_geom_open, and >> returning EOPNOTSUPP during zvol_open if that thread-local variable i= s set. >> =20 >> Remove the check for MUTEX_HELD(&zfsdev_state_lock) in zvol_open. Its= intent >> was to prevent a recursive mutex acquisition panic. However, the new = check >> for the thread-local variable also fixes that problem. >> =20 >> Also, fix a panic in vdev_geom_taste_orphan. For an unknown reason, t= his >> function was set to panic. But it can occur that a device disappears = during >> tasting, and it causes no problems to ignore this departure. >> =20 >> Reviewed by: delphij >> MFC after: 1 week >> Relnotes: yes >> Sponsored by: Spectra Logic Corp >> Differential Revision: https://reviews.freebsd.org/D4986 > I've just been bit by this pretty hard. I have a bhyve VM that's backed > by a zvol. The VM is running root-on-zfs. I wrote some experimental code > that's now preventing the VM from booting (kernel panic due to userland > change). Since I can't import the pool, I have no way of fixing the > problem. > > I'm probably just going to go revert this commit locally on my box so I > can get some work done. I use an md device to do this in bhyve but I was considering using a zvol. Populating it in the host system and then presenting it to the VM as a=20 disk. maybe it could be enabled with a sysctl? Is the problem always present? > > Thanks, > From owner-svn-src-head@freebsd.org Sun Jan 24 15:12:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 695D09D2D58; Sun, 24 Jan 2016 15:12:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 366A975B; Sun, 24 Jan 2016 15:12:51 +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 u0OFCoor001462; Sun, 24 Jan 2016 15:12:50 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OFCocB001461; Sun, 24 Jan 2016 15:12:50 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601241512.u0OFCocB001461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sun, 24 Jan 2016 15:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294664 - head/contrib/elftoolchain/libelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 15:12:51 -0000 Author: br Date: Sun Jan 24 15:12:49 2016 New Revision: 294664 URL: https://svnweb.freebsd.org/changeset/base/294664 Log: Add config for RISC-V ISA. Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5046 Modified: head/contrib/elftoolchain/libelf/_libelf_config.h Modified: head/contrib/elftoolchain/libelf/_libelf_config.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf_config.h Sun Jan 24 13:38:41 2016 (r294663) +++ head/contrib/elftoolchain/libelf/_libelf_config.h Sun Jan 24 15:12:49 2016 (r294664) @@ -97,6 +97,12 @@ #define LIBELF_BYTEORDER ELFDATA2MSB #define LIBELF_CLASS ELFCLASS32 +#elif defined(__riscv64) + +#define LIBELF_ARCH EM_RISCV +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 + #elif defined(__sparc__) #define LIBELF_ARCH EM_SPARCV9 From owner-svn-src-head@freebsd.org Sun Jan 24 15:15:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3CCF9D2FB0; Sun, 24 Jan 2016 15:15:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id B6C2AC24; Sun, 24 Jan 2016 15:15:58 +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 u0OFFvLt001609; Sun, 24 Jan 2016 15:15:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OFFvhb001608; Sun, 24 Jan 2016 15:15:57 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601241515.u0OFFvhb001608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sun, 24 Jan 2016 15:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294665 - head/usr.bin/ldd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 15:15:59 -0000 Author: br Date: Sun Jan 24 15:15:57 2016 New Revision: 294665 URL: https://svnweb.freebsd.org/changeset/base/294665 Log: We don't support a.out executables on RISC-V. Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5048 Modified: head/usr.bin/ldd/ldd.c Modified: head/usr.bin/ldd/ldd.c ============================================================================== --- head/usr.bin/ldd/ldd.c Sun Jan 24 15:12:49 2016 (r294664) +++ head/usr.bin/ldd/ldd.c Sun Jan 24 15:15:57 2016 (r294665) @@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -/* We don't support a.out executables on arm64 */ -#ifndef __aarch64__ +/* We don't support a.out executables on arm64 and riscv */ +#if !defined(__aarch64__) && !defined(__riscv__) #include #define AOUT_SUPPORTED #endif From owner-svn-src-head@freebsd.org Sun Jan 24 17:01:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6E39A1D004; Sun, 24 Jan 2016 17:01:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 847CE76F; Sun, 24 Jan 2016 17:01:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OH1YII034367; Sun, 24 Jan 2016 17:01:34 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OH1YHn034366; Sun, 24 Jan 2016 17:01:34 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601241701.u0OH1YHn034366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 24 Jan 2016 17:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294667 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 17:01:36 -0000 Author: jilles Date: Sun Jan 24 17:01:34 2016 New Revision: 294667 URL: https://svnweb.freebsd.org/changeset/base/294667 Log: sh: Remove a global variable from cd.c. Modified: head/bin/sh/cd.c Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Sun Jan 24 15:44:57 2016 (r294666) +++ head/bin/sh/cd.c Sun Jan 24 17:01:34 2016 (r294667) @@ -68,14 +68,13 @@ __FBSDID("$FreeBSD$"); static int cdlogical(char *); static int cdphysical(char *); static int docd(char *, int, int); -static char *getcomponent(void); +static char *getcomponent(char **); static char *findcwd(char *); static void updatepwd(char *); static char *getpwd(void); static char *getpwd2(void); static char *curdir = NULL; /* current working directory */ -static char *cdcomppath; int cdcmd(int argc __unused, char **argv __unused) @@ -177,6 +176,7 @@ cdlogical(char *dest) char *p; char *q; char *component; + char *path; struct stat statb; int first; int badstat; @@ -187,14 +187,14 @@ cdlogical(char *dest) * next time we get the value of the current directory. */ badstat = 0; - cdcomppath = stsavestr(dest); + path = stsavestr(dest); STARTSTACKSTR(p); if (*dest == '/') { STPUTC('/', p); - cdcomppath++; + path++; } first = 1; - while ((q = getcomponent()) != NULL) { + while ((q = getcomponent(&path)) != NULL) { if (q[0] == '\0' || (q[0] == '.' && q[1] == '\0')) continue; if (! first) @@ -243,25 +243,25 @@ cdphysical(char *dest) } /* - * Get the next component of the path name pointed to by cdcomppath. - * This routine overwrites the string pointed to by cdcomppath. + * Get the next component of the path name pointed to by *path. + * This routine overwrites *path and the string pointed to by it. */ static char * -getcomponent(void) +getcomponent(char **path) { char *p; char *start; - if ((p = cdcomppath) == NULL) + if ((p = *path) == NULL) return NULL; - start = cdcomppath; + start = *path; while (*p != '/' && *p != '\0') p++; if (*p == '\0') { - cdcomppath = NULL; + *path = NULL; } else { *p++ = '\0'; - cdcomppath = p; + *path = p; } return start; } @@ -272,6 +272,7 @@ findcwd(char *dir) { char *new; char *p; + char *path; /* * If our argument is NULL, we don't know the current directory @@ -280,14 +281,14 @@ findcwd(char *dir) */ if (dir == NULL || curdir == NULL) return getpwd2(); - cdcomppath = stsavestr(dir); + path = stsavestr(dir); STARTSTACKSTR(new); if (*dir != '/') { STPUTS(curdir, new); if (STTOPC(new) == '/') STUNPUTC(new); } - while ((p = getcomponent()) != NULL) { + while ((p = getcomponent(&path)) != NULL) { if (equal(p, "..")) { while (new > stackblock() && (STUNPUTC(new), *new) != '/'); } else if (*p != '\0' && ! equal(p, ".")) { From owner-svn-src-head@freebsd.org Sun Jan 24 17:09:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 026ECA1D422; Sun, 24 Jan 2016 17:09:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id C3916A2B; Sun, 24 Jan 2016 17:09:12 +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 u0OH9B8o036587; Sun, 24 Jan 2016 17:09:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OH9B7P036586; Sun, 24 Jan 2016 17:09:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601241709.u0OH9B7P036586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 24 Jan 2016 17:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294668 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 17:09:13 -0000 Author: andrew Date: Sun Jan 24 17:09:11 2016 New Revision: 294668 URL: https://svnweb.freebsd.org/changeset/base/294668 Log: Fix the style of the reading of a nodes xref to make it readable. Modified: head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sun Jan 24 17:01:34 2016 (r294667) +++ head/sys/dev/ofw/openfirm.c Sun Jan 24 17:09:11 2016 (r294668) @@ -599,10 +599,9 @@ OF_xref_from_node(phandle_t node) return (xi->xref); } - if (OF_getencprop(node, "phandle", &xref, sizeof(xref)) == - -1 && OF_getencprop(node, "ibm,phandle", &xref, - sizeof(xref)) == -1 && OF_getencprop(node, - "linux,phandle", &xref, sizeof(xref)) == -1) + if (OF_getencprop(node, "phandle", &xref, sizeof(xref)) == -1 && + OF_getencprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 && + OF_getencprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) return (node); return (xref); } From owner-svn-src-head@freebsd.org Sun Jan 24 17:15:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0C0DA1D6F5; Sun, 24 Jan 2016 17:15: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 mx1.freebsd.org (Postfix) with ESMTPS id 92519E9D; Sun, 24 Jan 2016 17:15: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 u0OHFgOl039422; Sun, 24 Jan 2016 17:15:42 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OHFghe039421; Sun, 24 Jan 2016 17:15:42 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601241715.u0OHFghe039421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 24 Jan 2016 17:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294669 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 17:15:43 -0000 Author: dteske Date: Sun Jan 24 17:15:42 2016 New Revision: 294669 URL: https://svnweb.freebsd.org/changeset/base/294669 Log: Fix a typo in a comment MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Sun Jan 24 17:09:11 2016 (r294668) +++ head/usr.sbin/bsdconfig/share/strings.subr Sun Jan 24 17:15:42 2016 (r294669) @@ -110,7 +110,7 @@ f_sprintf() # Example 2: # # limit=12 format="%s %s" -# format_args=" 'doghouse' 'foxhound' " +# format_args=" 'doghouse' 'fox' " # # even more spaces added to illustrate escape-method # f_vsnprintf foo $limit "$format" "$format_args" # foo=[doghouse fox] # From owner-svn-src-head@freebsd.org Sun Jan 24 18:11:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5900C79A4; Sun, 24 Jan 2016 18:11:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id 33B70B93; Sun, 24 Jan 2016 18:11:38 +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 u0OIBbjx055595; Sun, 24 Jan 2016 18:11:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OIBa4Y055588; Sun, 24 Jan 2016 18:11:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201601241811.u0OIBa4Y055588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 24 Jan 2016 18:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294670 - in head/usr.sbin: autofs iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 18:11:38 -0000 Author: trasz Date: Sun Jan 24 18:11:36 2016 New Revision: 294670 URL: https://svnweb.freebsd.org/changeset/base/294670 Log: The is an ordinary header file; should sort just like any other. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automount.c head/usr.sbin/autofs/automountd.c head/usr.sbin/autofs/autounmountd.c head/usr.sbin/autofs/common.c head/usr.sbin/autofs/defined.c head/usr.sbin/iscsid/iscsid.c Modified: head/usr.sbin/autofs/automount.c ============================================================================== --- head/usr.sbin/autofs/automount.c Sun Jan 24 17:15:42 2016 (r294669) +++ head/usr.sbin/autofs/automount.c Sun Jan 24 18:11:36 2016 (r294670) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -55,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "common.h" #include "mntopts.h" Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Sun Jan 24 17:15:42 2016 (r294669) +++ head/usr.sbin/autofs/automountd.c Sun Jan 24 18:11:36 2016 (r294670) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -55,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "autofs_ioctl.h" #include "common.h" Modified: head/usr.sbin/autofs/autounmountd.c ============================================================================== --- head/usr.sbin/autofs/autounmountd.c Sun Jan 24 17:15:42 2016 (r294669) +++ head/usr.sbin/autofs/autounmountd.c Sun Jan 24 18:11:36 2016 (r294670) @@ -37,13 +37,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include #include -#include #include "common.h" Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Sun Jan 24 17:15:42 2016 (r294669) +++ head/usr.sbin/autofs/common.c Sun Jan 24 18:11:36 2016 (r294670) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,8 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "autofs_ioctl.h" #include "common.h" Modified: head/usr.sbin/autofs/defined.c ============================================================================== --- head/usr.sbin/autofs/defined.c Sun Jan 24 17:15:42 2016 (r294669) +++ head/usr.sbin/autofs/defined.c Sun Jan 24 18:11:36 2016 (r294670) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -60,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "common.h" static TAILQ_HEAD(, defined_value) defined_values; Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Sun Jan 24 17:15:42 2016 (r294669) +++ head/usr.sbin/iscsid/iscsid.c Sun Jan 24 18:11:36 2016 (r294670) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -51,8 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "iscsid.h" static volatile bool sigalrm_received = false; From owner-svn-src-head@freebsd.org Sun Jan 24 19:10:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9E5AA31DE8; Sun, 24 Jan 2016 19:10:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id 93C259EB; Sun, 24 Jan 2016 19:10:31 +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 u0OJAUgW073140; Sun, 24 Jan 2016 19:10:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OJAUUD073138; Sun, 24 Jan 2016 19:10:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601241910.u0OJAUUD073138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 24 Jan 2016 19:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294675 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 19:10:31 -0000 Author: andrew Date: Sun Jan 24 19:10:30 2016 New Revision: 294675 URL: https://svnweb.freebsd.org/changeset/base/294675 Log: Add support for controlling the clocks for the audio codec and DMA engines. Submitted by: Jared McNeill Differential Revision: https://reviews.freebsd.org/D5052 Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Sun Jan 24 18:54:55 2016 (r294674) +++ head/sys/arm/allwinner/a10_clk.c Sun Jan 24 19:10:30 2016 (r294675) @@ -255,6 +255,58 @@ a10_clk_pll6_get_rate(void) return ((CCM_CLK_REF_FREQ * n * k) / 2); } +static int +a10_clk_pll2_set_rate(unsigned int freq) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + unsigned int prediv, postdiv, n; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + + reg_value = ccm_read_4(sc, CCM_PLL2_CFG); + reg_value &= ~(CCM_PLL2_CFG_PREDIV | CCM_PLL2_CFG_POSTDIV | + CCM_PLL_CFG_FACTOR_N); + + /* + * Audio Codec needs PLL2 to be either 24576000 Hz or 22579200 Hz + * + * PLL2 output frequency is 24MHz * n / prediv / postdiv. + * To get as close as possible to the desired rate, we use a + * pre-divider of 21 and a post-divider of 4. With these values, + * a multiplier of 86 or 79 gets us close to the target rates. + */ + prediv = 21; + postdiv = 4; + + switch (freq) { + case 24576000: + n = 86; + reg_value |= CCM_PLL_CFG_ENABLE; + break; + case 22579200: + n = 79; + reg_value |= CCM_PLL_CFG_ENABLE; + break; + case 0: + n = 1; + reg_value &= ~CCM_PLL_CFG_ENABLE; + break; + default: + return (EINVAL); + } + + reg_value |= (prediv << CCM_PLL2_CFG_PREDIV_SHIFT); + reg_value |= (postdiv << CCM_PLL2_CFG_POSTDIV_SHIFT); + reg_value |= (n << CCM_PLL_CFG_FACTOR_N_SHIFT); + ccm_write_4(sc, CCM_PLL2_CFG, reg_value); + + return (0); +} + int a10_clk_ahci_activate(void) { @@ -347,3 +399,46 @@ a10_clk_mmc_cfg(int devid, int freq) return (0); } + +int +a10_clk_dmac_activate(void) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + /* Gating AHB clock for DMA controller */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING0); + reg_value |= CCM_AHB_GATING_DMA; + ccm_write_4(sc, CCM_AHB_GATING0, reg_value); + + return (0); +} + +int +a10_clk_codec_activate(unsigned int freq) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + a10_clk_pll2_set_rate(freq); + + /* Gating APB clock for ADDA */ + reg_value = ccm_read_4(sc, CCM_APB0_GATING); + reg_value |= CCM_APB0_GATING_ADDA; + ccm_write_4(sc, CCM_APB0_GATING, reg_value); + + /* Enable audio codec clock */ + reg_value = ccm_read_4(sc, CCM_AUDIO_CODEC_CLK); + reg_value |= CCM_AUDIO_CODEC_ENABLE; + ccm_write_4(sc, CCM_AUDIO_CODEC_CLK, reg_value); + + return (0); +} Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Sun Jan 24 18:54:55 2016 (r294674) +++ head/sys/arm/allwinner/a10_clk.h Sun Jan 24 19:10:30 2016 (r294675) @@ -106,10 +106,14 @@ #define CCM_GMAC_CLK_EXT_RGMII 0x1 #define CCM_GMAC_CLK_RGMII 0x2 +/* APB0_GATING */ +#define CCM_APB0_GATING_ADDA (1 << 0) + /* AHB_GATING_REG0 */ #define CCM_AHB_GATING_USB0 (1 << 0) #define CCM_AHB_GATING_EHCI0 (1 << 1) #define CCM_AHB_GATING_EHCI1 (1 << 3) +#define CCM_AHB_GATING_DMA (1 << 6) #define CCM_AHB_GATING_SDMMC0 (1 << 8) #define CCM_AHB_GATING_EMAC (1 << 17) #define CCM_AHB_GATING_SATA (1 << 25) @@ -132,6 +136,11 @@ #define CCM_PLL_CFG_FACTOR_K_SHIFT 4 #define CCM_PLL_CFG_FACTOR_M 0x3 +#define CCM_PLL2_CFG_POSTDIV 0x3c000000 +#define CCM_PLL2_CFG_POSTDIV_SHIFT 26 +#define CCM_PLL2_CFG_PREDIV 0x1f +#define CCM_PLL2_CFG_PREDIV_SHIFT 0 + #define CCM_PLL6_CFG_SATA_CLKEN (1U << 14) #define CCM_SD_CLK_SRC_SEL 0x3000000 @@ -146,6 +155,8 @@ #define CCM_SD_CLK_OPHASE_CTR_SHIFT 8 #define CCM_SD_CLK_DIV_RATIO_M 0xf +#define CCM_AUDIO_CODEC_ENABLE (1U << 31) + #define CCM_CLK_REF_FREQ 24000000U int a10_clk_usb_activate(void); @@ -155,5 +166,7 @@ int a10_clk_gmac_activate(phandle_t); int a10_clk_ahci_activate(void); int a10_clk_mmc_activate(int); int a10_clk_mmc_cfg(int, int); +int a10_clk_dmac_activate(void); +int a10_clk_codec_activate(unsigned int); #endif /* _A10_CLK_H_ */ From owner-svn-src-head@freebsd.org Sun Jan 24 19:12:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2827FA31F4F; Sun, 24 Jan 2016 19:12:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id E9E3CD11; Sun, 24 Jan 2016 19:12:17 +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 u0OJCGr6075698; Sun, 24 Jan 2016 19:12:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OJCG2p075697; Sun, 24 Jan 2016 19:12:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601241912.u0OJCG2p075697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 24 Jan 2016 19:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294676 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 19:12:18 -0000 Author: andrew Date: Sun Jan 24 19:12:16 2016 New Revision: 294676 URL: https://svnweb.freebsd.org/changeset/base/294676 Log: Remove an extra newline that crept in. Modified: head/sys/arm/allwinner/a10_clk.c Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Sun Jan 24 19:10:30 2016 (r294675) +++ head/sys/arm/allwinner/a10_clk.c Sun Jan 24 19:12:16 2016 (r294676) @@ -266,7 +266,6 @@ a10_clk_pll2_set_rate(unsigned int freq) if (sc == NULL) return (ENXIO); - reg_value = ccm_read_4(sc, CCM_PLL2_CFG); reg_value &= ~(CCM_PLL2_CFG_PREDIV | CCM_PLL2_CFG_POSTDIV | CCM_PLL_CFG_FACTOR_N); From owner-svn-src-head@freebsd.org Sun Jan 24 21:18:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63D559D9440; Sun, 24 Jan 2016 21:18:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id 31F8CC4C; Sun, 24 Jan 2016 21:18:56 +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 u0OLIth1011790; Sun, 24 Jan 2016 21:18:55 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OLIt0R011789; Sun, 24 Jan 2016 21:18:55 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601242118.u0OLIt0R011789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 24 Jan 2016 21:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294684 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 21:18:56 -0000 Author: dteske Date: Sun Jan 24 21:18:54 2016 New Revision: 294684 URL: https://svnweb.freebsd.org/changeset/base/294684 Log: Bump copyright for change from fbt to syscall MFC after: 3 days X-MFC-to: stable/10 X-MFC-with: r294548 r294556 Modified: head/share/dtrace/watch_kill Modified: head/share/dtrace/watch_kill ============================================================================== --- head/share/dtrace/watch_kill Sun Jan 24 21:04:06 2016 (r294683) +++ head/share/dtrace/watch_kill Sun Jan 24 21:18:54 2016 (r294684) @@ -1,6 +1,6 @@ #!/usr/sbin/dtrace -s /* - - * Copyright (c) 2014-2015 Devin Teske + * Copyright (c) 2014-2016 Devin Teske * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@freebsd.org Sun Jan 24 21:45:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B079D9CB1 for ; Sun, 24 Jan 2016 21:45:42 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::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 EE595B03 for ; Sun, 24 Jan 2016 21:45:41 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x236.google.com with SMTP id 123so44254751wmz.0 for ; Sun, 24 Jan 2016 13:45:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=qPz3GfwjhcNWCILHpOD4WS2LZkA9vLBjhtGEg8/o0pc=; b=kk//FD7dZQZxRFgt6af0P5IojmT8ZixxMLxdOwfgq9OuNxAlMeCyiAkqQBLUOtfQ1a IqEbKK5pWtvnLMOtv/vXs+v/Cw1VNpG3Kp2zdfKeJzDe14wFyPAsRCV/fBaDEeKmIOzh glRAIiP30yXo3E0kZLflKe4UBKisMZmnZ/g0OxwWhVNRKUmTFV15RmRLYTqQz6daQjrL pvesPaTXpa+rX9R/htt0Wkc0r08a5M0rr/KepkgW6+qMFnqbu/oJJw7gqPusC4lNflRW ZnFytYvP1u/8Sb8tI7s71ry6vaxNuB5e6aeGEAFhELH7HkF3BpwgtSaUHYM3EaGGRw62 KQSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=qPz3GfwjhcNWCILHpOD4WS2LZkA9vLBjhtGEg8/o0pc=; b=Shl8VmzepMsB197B9W7nX9gcPIVzJuoLxZshdd4WtsylrrnVb4Ql6hJNk+HtKTcDFo EHF3ujPo2TaIGB+hpMgctJD/xuWwp69EDfPqsluzKJTS0n3CTcoeUDTNAK0vSUMC0zOl /VJqvUlRgEiBNGjOAqpbpeSuPIBmsAwPLX5B8z692eTkDm65vZ2QAPS74lTqqzFLVPl6 EK9yXBwqB0Hsr1OdDGzLbLKpDbDMJOobVCPe/wSKJeYYKLI4SM4f5jnUQxLKeBZVbFEa Wk9gtmGnMH1Y+bJQV/DmmD/BGso/EL1TuTA4QVI7eUaNqPhk+Y7/VRQjzboS+NMxn7O+ ebvA== X-Gm-Message-State: AG10YOT4l04zd6DGXae1zeeyKBZlstPgo0S5jFdTQEyxH/0JMYKSqW9y6t0eYbzec8TbHRATT8y7l5nGdUGLuwWY MIME-Version: 1.0 X-Received: by 10.28.5.213 with SMTP id 204mr14171063wmf.20.1453671940487; Sun, 24 Jan 2016 13:45:40 -0800 (PST) Received: by 10.194.82.6 with HTTP; Sun, 24 Jan 2016 13:45:40 -0800 (PST) In-Reply-To: <563F1A27.6030002@selasky.org> References: <201511070143.tA71h13k038232@repo.freebsd.org> <563DDE73.6030307@selasky.org> <563F1A27.6030002@selasky.org> Date: Sun, 24 Jan 2016 22:45:40 +0100 Message-ID: Subject: Re: svn commit: r290475 - in head: share/man/man9 sys/kern sys/sys From: Oliver Pinter To: Hans Petter Selasky Cc: cem@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, emaste@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 21:45:42 -0000 On 11/8/15, Hans Petter Selasky wrote: > On 11/07/15 19:26, Conrad Meyer wrote: >> Can do =E2=80=94 fixed in r290505. >> >> Thanks, >> Conrad > > Thank you. Looks good! > > --HPS Hi All! Is there any way to merge back to 10-STABLE these patches? > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sun Jan 24 22:08:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DAE4739B; Sun, 24 Jan 2016 22:08:17 +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 mx1.freebsd.org (Postfix) with ESMTPS id D7052924; Sun, 24 Jan 2016 22:08:16 +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 u0OM8Fvx027007; Sun, 24 Jan 2016 22:08:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OM8Fsk027006; Sun, 24 Jan 2016 22:08:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601242208.u0OM8Fsk027006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 24 Jan 2016 22:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294688 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 22:08:17 -0000 Author: tuexen Date: Sun Jan 24 22:08:15 2016 New Revision: 294688 URL: https://svnweb.freebsd.org/changeset/base/294688 Log: sctp_sendv() needs to fill in the association id on return. MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sun Jan 24 22:06:56 2016 (r294687) +++ head/lib/libc/net/sctp_sys_calls.c Sun Jan 24 22:08:15 2016 (r294688) @@ -984,6 +984,7 @@ sctp_sendv(int sd, struct sockaddr *addr; struct sockaddr_in *addr_in; struct sockaddr_in6 *addr_in6; + sctp_assoc_t *assoc_id; if ((addrcnt < 0) || (iovcnt < 0) || @@ -1002,6 +1003,7 @@ sctp_sendv(int sd, errno = ENOMEM; return (-1); } + assoc_id = NULL; msg.msg_control = cmsgbuf; msg.msg_controllen = 0; cmsg = (struct cmsghdr *)cmsgbuf; @@ -1025,6 +1027,7 @@ sctp_sendv(int sd, memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_sndinfo)); msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + assoc_id = &(((struct sctp_sndinfo *)info)->snd_assoc_id); break; case SCTP_SENDV_PRINFO: if ((info == NULL) || (infolen < sizeof(struct sctp_prinfo))) { @@ -1066,6 +1069,7 @@ sctp_sendv(int sd, memcpy(CMSG_DATA(cmsg), &spa_info->sendv_sndinfo, sizeof(struct sctp_sndinfo)); msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + assoc_id = &(spa_info->sendv_sndinfo.snd_assoc_id); } if (spa_info->sendv_flags & SCTP_SEND_PRINFO_VALID) { cmsg->cmsg_level = IPPROTO_SCTP; @@ -1164,6 +1168,9 @@ sctp_sendv(int sd, msg.msg_flags = 0; ret = sendmsg(sd, &msg, flags); free(cmsgbuf); + if ((ret >= 0) && (addrs != NULL) && (assoc_id != NULL)) { + *assoc_id = sctp_getassocid(sd, addrs); + } return (ret); } From owner-svn-src-head@freebsd.org Sun Jan 24 22:20:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDB1577C4; Sun, 24 Jan 2016 22:20:14 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA967FCA; Sun, 24 Jan 2016 22:20:14 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OMKDtp029918; Sun, 24 Jan 2016 22:20:13 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OMKD5C029917; Sun, 24 Jan 2016 22:20:13 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201601242220.u0OMKD5C029917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sun, 24 Jan 2016 22:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294691 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 22:20:14 -0000 Author: sobomax Date: Sun Jan 24 22:20:13 2016 New Revision: 294691 URL: https://svnweb.freebsd.org/changeset/base/294691 Log: Fix bug in the readpassphrase(3) function, which can be exposed by application closing its stdin (i.e. STDIN_FILENO) prior to calling readpassphrase WITHOUT setting RPP_STDIN. What happens then is that the readpassphrase would open /dev/tty, and since file descriptors are reused, the call would return first unused fd, which is 0 which is also STDIN_FILENO. Then due to the usage of "input != STDIN_FILENO" in the code to do its logic, that would result in noecho flags not set on that file descriptor, which was original issue I've been trying to fix. In addition to that, the readpassphrase() would leak file descriptor on its way out, so fix that one as well. This problem can be tested with: $ ssh-add - < /tmp/myprivate.key The password will not be hidden as it should and ktrace will show: 53326 ssh-add CALL open(0x80142443c,0x100002,0x165f030) 53326 ssh-add NAMI "/dev/tty" 53326 ssh-add RET open 0 53326 ssh-add CALL sigprocmask(SIG_SETMASK,0x802eb1324,0x7fffffffd5e0) 53326 ssh-add RET sigprocmask 0 53326 ssh-add CALL sigaction(SIGALRM,0x7fffffffd630,0x7fffffffd610) Instead of: 57690 ssh-add CALL open(0x80142443c,0x100002,0x165f030) 57690 ssh-add NAMI "/dev/tty" 57690 ssh-add RET open 4 57690 ssh-add CALL ioctl(0x4,TIOCGETA,0x7fffffffd860) 57690 ssh-add RET ioctl 0 57690 ssh-add CALL ioctl(0x4,TIOCSETAF,0x7fffffffd680) 57690 ssh-add RET ioctl 0 57690 ssh-add CALL sigprocmask(SIG_SETMASK,0x802eb1324,0x7fffffffd620) 57690 ssh-add RET sigprocmask 0 57690 ssh-add CALL sigaction(SIGALRM,0x7fffffffd670,0x7fffffffd650) For the case when the key is read from the file. Technically this can also be workaround'ed at the application side by not closing the STDIN_FILENO in the first place, but readpassphrase(3) doesn't need to make any assumptions about that. Plus the file descriptor leak confirms that this is an oversight, rather than a deliberate behaviour. MFC after: 1 week Modified: head/lib/libc/gen/readpassphrase.c Modified: head/lib/libc/gen/readpassphrase.c ============================================================================== --- head/lib/libc/gen/readpassphrase.c Sun Jan 24 22:17:05 2016 (r294690) +++ head/lib/libc/gen/readpassphrase.c Sun Jan 24 22:20:13 2016 (r294691) @@ -46,7 +46,7 @@ char * readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) { ssize_t nr; - int input, output, save_errno, i, need_restart; + int input, output, save_errno, i, need_restart, input_is_tty; char ch, *p, *end; struct termios term, oterm; struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; @@ -68,12 +68,20 @@ restart: * Read and write to /dev/tty if available. If not, read from * stdin and write to stderr unless a tty is required. */ - if ((flags & RPP_STDIN) || - (input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC)) == -1) { - if (flags & RPP_REQUIRE_TTY) { - errno = ENOTTY; - return(NULL); + input_is_tty = 0; + if (!(flags & RPP_STDIN)) { + input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC); + if (input == -1) { + if (flags & RPP_REQUIRE_TTY) { + errno = ENOTTY; + return(NULL); + } + input = STDIN_FILENO; + output = STDERR_FILENO; + } else { + input_is_tty = 1; } + } else { input = STDIN_FILENO; output = STDERR_FILENO; } @@ -83,7 +91,7 @@ restart: * If we are using a tty but are not the foreground pgrp this will * generate SIGTTOU, so do it *before* installing the signal handlers. */ - if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { + if (input_is_tty && tcgetattr(input, &oterm) == 0) { memcpy(&term, &oterm, sizeof(term)); if (!(flags & RPP_ECHO_ON)) term.c_lflag &= ~(ECHO | ECHONL); @@ -152,7 +160,7 @@ restart: (void)__libc_sigaction(SIGTSTP, &savetstp, NULL); (void)__libc_sigaction(SIGTTIN, &savettin, NULL); (void)__libc_sigaction(SIGTTOU, &savettou, NULL); - if (input != STDIN_FILENO) + if (input_is_tty) (void)_close(input); /* From owner-svn-src-head@freebsd.org Sun Jan 24 22:26:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA267AD8; Sun, 24 Jan 2016 22:26:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5440886B; Sun, 24 Jan 2016 22:26:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OMQPkS032849; Sun, 24 Jan 2016 22:26:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OMQPG6032848; Sun, 24 Jan 2016 22:26:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601242226.u0OMQPG6032848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 24 Jan 2016 22:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294692 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 22:26:26 -0000 Author: jilles Date: Sun Jan 24 22:26:25 2016 New Revision: 294692 URL: https://svnweb.freebsd.org/changeset/base/294692 Log: sh: Constify internal representation in expand.c. Forbid (temporary or permanent) modifications of the strings in NARG nodes during expansion. Tilde expansion now needs to copy the username for the terminating '\0'. Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Jan 24 22:20:13 2016 (r294691) +++ head/bin/sh/expand.c Sun Jan 24 22:26:25 2016 (r294692) @@ -91,13 +91,13 @@ struct worddest { static char *expdest; /* output of current string */ static struct nodelist *argbackq; /* list of back quote expressions */ -static char *argstr(char *, int, struct worddest *); -static char *exptilde(char *, int); -static char *expari(char *, int, struct worddest *); +static const char *argstr(const char *, int, struct worddest *); +static const char *exptilde(const char *, int); +static const char *expari(const char *, int, struct worddest *); static void expbackq(union node *, int, int, struct worddest *); -static void subevalvar_trim(char *, int, int, int); -static int subevalvar_misc(char *, const char *, int, int, int); -static char *evalvar(char *, int, struct worddest *); +static void subevalvar_trim(const char *, int, int, int); +static int subevalvar_misc(const char *, const char *, int, int, int); +static const char *evalvar(const char *, int, struct worddest *); static int varisset(const char *, int); static void strtodest(const char *, int, int, int, struct worddest *); static void reprocess(int, int, int, int, struct worddest *); @@ -262,8 +262,8 @@ expandarg(union node *arg, struct arglis * * If EXP_SPLIT is set, dst receives any complete words produced. */ -static char * -argstr(char *p, int flag, struct worddest *dst) +static const char * +argstr(const char *p, int flag, struct worddest *dst) { char c; int quotes = flag & (EXP_GLOB | EXP_CASE); /* do CTLESC */ @@ -352,12 +352,15 @@ argstr(char *p, int flag, struct worddes * Perform tilde expansion, placing the result in the stack string and * returning the next position in the input string to process. */ -static char * -exptilde(char *p, int flag) +static const char * +exptilde(const char *p, int flag) { - char c, *startp = p; + char c; + const char *startp = p; + const char *user; struct passwd *pw; char *home; + int len; for (;;) { c = *p; @@ -377,14 +380,17 @@ exptilde(char *p, int flag) case '\0': case '/': case CTLENDVAR: - *p = '\0'; - if (*(startp+1) == '\0') { + len = p - startp - 1; + STPUTBIN(startp + 1, len, expdest); + STACKSTRNUL(expdest); + user = expdest - len; + if (*user == '\0') { home = lookupvar("HOME"); } else { - pw = getpwnam(startp+1); + pw = getpwnam(user); home = pw != NULL ? pw->pw_dir : NULL; } - *p = c; + STADJUST(-len, expdest); if (home == NULL || *home == '\0') return (startp); strtodest(home, flag, VSNORMAL, 1, NULL); @@ -398,8 +404,8 @@ exptilde(char *p, int flag) /* * Expand arithmetic expression. */ -static char * -expari(char *p, int flag, struct worddest *dst) +static const char * +expari(const char *p, int flag, struct worddest *dst) { char *q, *start; arith_t result; @@ -532,7 +538,7 @@ recordleft(const char *str, const char * } static void -subevalvar_trim(char *p, int strloc, int subtype, int startloc) +subevalvar_trim(const char *p, int strloc, int subtype, int startloc) { char *startp; char *loc = NULL; @@ -606,7 +612,7 @@ subevalvar_trim(char *p, int strloc, int static int -subevalvar_misc(char *p, const char *var, int subtype, int startloc, +subevalvar_misc(const char *p, const char *var, int subtype, int startloc, int varflags) { char *startp; @@ -645,12 +651,12 @@ subevalvar_misc(char *p, const char *var * input string. */ -static char * -evalvar(char *p, int flag, struct worddest *dst) +static const char * +evalvar(const char *p, int flag, struct worddest *dst) { int subtype; int varflags; - char *var; + const char *var; const char *val; int patloc; int c; From owner-svn-src-head@freebsd.org Sun Jan 24 22:31:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D90D97CAD; Sun, 24 Jan 2016 22:31:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id ABE4FC00; Sun, 24 Jan 2016 22:31:35 +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 u0OMVYEg033757; Sun, 24 Jan 2016 22:31:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OMVYKa033756; Sun, 24 Jan 2016 22:31:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601242231.u0OMVYKa033756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 24 Jan 2016 22:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294694 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 22:31:36 -0000 Author: tuexen Date: Sun Jan 24 22:31:34 2016 New Revision: 294694 URL: https://svnweb.freebsd.org/changeset/base/294694 Log: sctp_sendx() needs to provide the assoc_id back. MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sun Jan 24 22:28:18 2016 (r294693) +++ head/lib/libc/net/sctp_sys_calls.c Sun Jan 24 22:31:34 2016 (r294694) @@ -700,14 +700,19 @@ sctp_sendx(int sd, const void *msg, size #ifdef SYS_sctp_generic_sendmsg if (addrcnt == 1) { socklen_t l; + ssize_t ret; /* * Quick way, we don't need to do a connectx so lets use the * syscall directly. */ l = addrs->sa_len; - return (syscall(SYS_sctp_generic_sendmsg, sd, - msg, msg_len, addrs, l, sinfo, flags)); + ret = syscall(SYS_sctp_generic_sendmsg, sd, + msg, msg_len, addrs, l, sinfo, flags); + if ((ret >= 0) && (sinfo != NULL)) { + sinfo->sinfo_assoc_id = sctp_getassocid(sd, addrs); + } + return (ret); } #endif From owner-svn-src-head@freebsd.org Sun Jan 24 23:24:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7377A31F71; Sun, 24 Jan 2016 23:24:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96AAF275; Sun, 24 Jan 2016 23:24:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ONOlFI050475; Sun, 24 Jan 2016 23:24:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ONOloe050474; Sun, 24 Jan 2016 23:24:47 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601242324.u0ONOloe050474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 24 Jan 2016 23:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294695 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 23:24:48 -0000 Author: pfg Date: Sun Jan 24 23:24:47 2016 New Revision: 294695 URL: https://svnweb.freebsd.org/changeset/base/294695 Log: ext2fs: passthrough any extra timestamps to the dinode struct. In general we don't trust any of the extended timestamps unless the EXT2F_ROCOMPAT_EXTRA_ISIZE feature is set. However, in the case where we freshly allocated a new inode the information is valid and it is better to pass it along instead of leaving the value undefined. This should have no practical effect but should reduce the amount of garbage if EXT2F_ROCOMPAT_EXTRA_ISIZE is set, like in cases where the filesystem is converted from ext3 to ext4. MFC after: 4 days Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jan 24 22:31:34 2016 (r294694) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Sun Jan 24 23:24:47 2016 (r294695) @@ -149,13 +149,11 @@ ext2_i2ei(struct inode *ip, struct ext2f ei->e2di_atime = ip->i_atime; ei->e2di_mtime = ip->i_mtime; ei->e2di_ctime = ip->i_ctime; - if (E2DI_HAS_XTIME(ip)) { - ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec); - ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec); - ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec); - ei->e2di_crtime = ip->i_birthtime; - ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec); - } + ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec); + ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec); + ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec); + ei->e2di_crtime = ip->i_birthtime; + ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec); ei->e2di_flags = 0; ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0; From owner-svn-src-head@freebsd.org Sun Jan 24 23:28:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A41D77071; Sun, 24 Jan 2016 23:28:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id 77AD5664; Sun, 24 Jan 2016 23:28:15 +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 u0ONSElr050689; Sun, 24 Jan 2016 23:28:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ONSEpN050688; Sun, 24 Jan 2016 23:28:14 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601242328.u0ONSEpN050688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 24 Jan 2016 23:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294696 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 23:28:15 -0000 Author: avos Date: Sun Jan 24 23:28:14 2016 New Revision: 294696 URL: https://svnweb.freebsd.org/changeset/base/294696 Log: net80211: reduce code duplication Do not duplicate code between IEEE80211_IOC_WPAIE and IEEE80211_IOC_WPAIE2 switch cases. Approved by: adrian (mentor) Differential Revision: D5041 (part) Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Jan 24 23:24:47 2016 (r294695) +++ head/sys/net80211/ieee80211_ioctl.c Sun Jan 24 23:28:14 2016 (r294696) @@ -932,8 +932,6 @@ ieee80211_ioctl_get80211(struct ieee8021 ireq->i_len); break; case IEEE80211_IOC_WPAIE: - error = ieee80211_ioctl_getwpaie(vap, ireq, ireq->i_type); - break; case IEEE80211_IOC_WPAIE2: error = ieee80211_ioctl_getwpaie(vap, ireq, ireq->i_type); break; From owner-svn-src-head@freebsd.org Sun Jan 24 23:35:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59BB372CF; Sun, 24 Jan 2016 23:35:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6F5A3A; Sun, 24 Jan 2016 23:35:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ONZKZS053627; Sun, 24 Jan 2016 23:35:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ONZKwW053626; Sun, 24 Jan 2016 23:35:20 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601242335.u0ONZKwW053626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 24 Jan 2016 23:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294697 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 23:35:21 -0000 Author: avos Date: Sun Jan 24 23:35:20 2016 New Revision: 294697 URL: https://svnweb.freebsd.org/changeset/base/294697 Log: net80211: reduce stack usage for ieee80211_ioctl*() methods. Use malloc(9) for - struct ieee80211req_wpaie2 (518 bytes, used in ieee80211_ioctl_getwpaie()) - struct ieee80211_scan_req (128 bytes, used in setmlme_assoc_adhoc() and ieee80211_ioctl_scanreq()) Also, drop __noinline workarounds; stack overflow is not reproducible with recent compilers. Tested with Clang 3.7.1, GCC 4.2.1 (from 9.3-RELEASE) and 4.9.4 (with -fstack-usage flag) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5041 Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Jan 24 23:28:14 2016 (r294696) +++ head/sys/net80211/ieee80211_ioctl.c Sun Jan 24 23:35:20 2016 (r294697) @@ -68,7 +68,7 @@ static struct ieee80211_channel *findcha static int ieee80211_scanreq(struct ieee80211vap *, struct ieee80211_scan_req *); -static __noinline int +static int ieee80211_ioctl_getkey(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -124,7 +124,7 @@ ieee80211_ioctl_getkey(struct ieee80211v return copyout(&ik, ireq->i_data, sizeof(ik)); } -static __noinline int +static int ieee80211_ioctl_getchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -134,7 +134,7 @@ ieee80211_ioctl_getchanlist(struct ieee8 return copyout(&ic->ic_chan_active, ireq->i_data, ireq->i_len); } -static __noinline int +static int ieee80211_ioctl_getchaninfo(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -148,36 +148,40 @@ ieee80211_ioctl_getchaninfo(struct ieee8 return copyout(&ic->ic_nchans, ireq->i_data, space); } -static __noinline int +static int ieee80211_ioctl_getwpaie(struct ieee80211vap *vap, struct ieee80211req *ireq, int req) { struct ieee80211_node *ni; - struct ieee80211req_wpaie2 wpaie; + struct ieee80211req_wpaie2 *wpaie; int error; if (ireq->i_len < IEEE80211_ADDR_LEN) return EINVAL; - error = copyin(ireq->i_data, wpaie.wpa_macaddr, IEEE80211_ADDR_LEN); + wpaie = IEEE80211_MALLOC(sizeof(*wpaie), M_TEMP, + IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); + if (wpaie == NULL) + return ENOMEM; + error = copyin(ireq->i_data, wpaie->wpa_macaddr, IEEE80211_ADDR_LEN); if (error != 0) - return error; - ni = ieee80211_find_vap_node(&vap->iv_ic->ic_sta, vap, wpaie.wpa_macaddr); - if (ni == NULL) - return ENOENT; - memset(wpaie.wpa_ie, 0, sizeof(wpaie.wpa_ie)); + goto bad; + ni = ieee80211_find_vap_node(&vap->iv_ic->ic_sta, vap, wpaie->wpa_macaddr); + if (ni == NULL) { + error = ENOENT; + goto bad; + } if (ni->ni_ies.wpa_ie != NULL) { int ielen = ni->ni_ies.wpa_ie[1] + 2; - if (ielen > sizeof(wpaie.wpa_ie)) - ielen = sizeof(wpaie.wpa_ie); - memcpy(wpaie.wpa_ie, ni->ni_ies.wpa_ie, ielen); + if (ielen > sizeof(wpaie->wpa_ie)) + ielen = sizeof(wpaie->wpa_ie); + memcpy(wpaie->wpa_ie, ni->ni_ies.wpa_ie, ielen); } if (req == IEEE80211_IOC_WPAIE2) { - memset(wpaie.rsn_ie, 0, sizeof(wpaie.rsn_ie)); if (ni->ni_ies.rsn_ie != NULL) { int ielen = ni->ni_ies.rsn_ie[1] + 2; - if (ielen > sizeof(wpaie.rsn_ie)) - ielen = sizeof(wpaie.rsn_ie); - memcpy(wpaie.rsn_ie, ni->ni_ies.rsn_ie, ielen); + if (ielen > sizeof(wpaie->rsn_ie)) + ielen = sizeof(wpaie->rsn_ie); + memcpy(wpaie->rsn_ie, ni->ni_ies.rsn_ie, ielen); } if (ireq->i_len > sizeof(struct ieee80211req_wpaie2)) ireq->i_len = sizeof(struct ieee80211req_wpaie2); @@ -186,18 +190,21 @@ ieee80211_ioctl_getwpaie(struct ieee8021 /* XXX check ic_flags? */ if (ni->ni_ies.rsn_ie != NULL) { int ielen = ni->ni_ies.rsn_ie[1] + 2; - if (ielen > sizeof(wpaie.wpa_ie)) - ielen = sizeof(wpaie.wpa_ie); - memcpy(wpaie.wpa_ie, ni->ni_ies.rsn_ie, ielen); + if (ielen > sizeof(wpaie->wpa_ie)) + ielen = sizeof(wpaie->wpa_ie); + memcpy(wpaie->wpa_ie, ni->ni_ies.rsn_ie, ielen); } if (ireq->i_len > sizeof(struct ieee80211req_wpaie)) ireq->i_len = sizeof(struct ieee80211req_wpaie); } ieee80211_free_node(ni); - return copyout(&wpaie, ireq->i_data, ireq->i_len); + error = copyout(wpaie, ireq->i_data, ireq->i_len); +bad: + IEEE80211_FREE(wpaie, M_TEMP); + return error; } -static __noinline int +static int ieee80211_ioctl_getstastats(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_node *ni; @@ -252,7 +259,7 @@ get_scan_space(void *arg, const struct i req->space += scan_space(se, &ielen); } -static __noinline void +static void get_scan_result(void *arg, const struct ieee80211_scan_entry *se) { struct scanreq *req = arg; @@ -302,7 +309,7 @@ get_scan_result(void *arg, const struct req->sr = (struct ieee80211req_scan_result *)(((uint8_t *)sr) + len); } -static __noinline int +static int ieee80211_ioctl_getscanresults(struct ieee80211vap *vap, struct ieee80211req *ireq) { @@ -366,7 +373,7 @@ get_sta_space(void *arg, struct ieee8021 req->space += sta_space(ni, &ielen); } -static __noinline void +static void get_sta_info(void *arg, struct ieee80211_node *ni) { struct stainforeq *req = arg; @@ -452,7 +459,7 @@ get_sta_info(void *arg, struct ieee80211 req->space -= len; } -static __noinline int +static int getstainfo_common(struct ieee80211vap *vap, struct ieee80211req *ireq, struct ieee80211_node *ni, size_t off) { @@ -496,7 +503,7 @@ bad: return error; } -static __noinline int +static int ieee80211_ioctl_getstainfo(struct ieee80211vap *vap, struct ieee80211req *ireq) { uint8_t macaddr[IEEE80211_ADDR_LEN]; @@ -519,7 +526,7 @@ ieee80211_ioctl_getstainfo(struct ieee80 return getstainfo_common(vap, ireq, ni, off); } -static __noinline int +static int ieee80211_ioctl_getstatxpow(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_node *ni; @@ -540,7 +547,7 @@ ieee80211_ioctl_getstatxpow(struct ieee8 return error; } -static __noinline int +static int ieee80211_ioctl_getwmeparam(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -583,7 +590,7 @@ ieee80211_ioctl_getwmeparam(struct ieee8 return 0; } -static __noinline int +static int ieee80211_ioctl_getmaccmd(struct ieee80211vap *vap, struct ieee80211req *ireq) { const struct ieee80211_aclator *acl = vap->iv_acl; @@ -591,7 +598,7 @@ ieee80211_ioctl_getmaccmd(struct ieee802 return (acl == NULL ? EINVAL : acl->iac_getioctl(vap, ireq)); } -static __noinline int +static int ieee80211_ioctl_getcurchan(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -648,7 +655,7 @@ ieee80211_ioctl_getappie(struct ieee8021 return EINVAL; } -static __noinline int +static int ieee80211_ioctl_getregdomain(struct ieee80211vap *vap, const struct ieee80211req *ireq) { @@ -660,7 +667,7 @@ ieee80211_ioctl_getregdomain(struct ieee sizeof(ic->ic_regdomain)); } -static __noinline int +static int ieee80211_ioctl_getroam(struct ieee80211vap *vap, const struct ieee80211req *ireq) { @@ -671,7 +678,7 @@ ieee80211_ioctl_getroam(struct ieee80211 return copyout(vap->iv_roamparms, ireq->i_data, len); } -static __noinline int +static int ieee80211_ioctl_gettxparams(struct ieee80211vap *vap, const struct ieee80211req *ireq) { @@ -682,7 +689,7 @@ ieee80211_ioctl_gettxparams(struct ieee8 return copyout(vap->iv_txparms, ireq->i_data, len); } -static __noinline int +static int ieee80211_ioctl_getdevcaps(struct ieee80211com *ic, const struct ieee80211req *ireq) { @@ -716,7 +723,7 @@ ieee80211_ioctl_getdevcaps(struct ieee80 return error; } -static __noinline int +static int ieee80211_ioctl_getstavlan(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_node *ni; @@ -765,23 +772,7 @@ ieee80211_ioctl_getdefault(struct ieee80 return EINVAL; } -/* - * When building the kernel with -O2 on the i386 architecture, gcc - * seems to want to inline this function into ieee80211_ioctl() - * (which is the only routine that calls it). When this happens, - * ieee80211_ioctl() ends up consuming an additional 2K of stack - * space. (Exactly why it needs so much is unclear.) The problem - * is that it's possible for ieee80211_ioctl() to invoke other - * routines (including driver init functions) which could then find - * themselves perilously close to exhausting the stack. - * - * To avoid this, we deliberately prevent gcc from inlining this - * routine. Another way to avoid this is to use less agressive - * optimization when compiling this file (i.e. -O instead of -O2) - * but special-casing the compilation of this one module in the - * build system would be awkward. - */ -static __noinline int +static int ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_long cmd, struct ieee80211req *ireq) { @@ -1136,7 +1127,7 @@ ieee80211_ioctl_get80211(struct ieee8021 #undef MS } -static __noinline int +static int ieee80211_ioctl_setkey(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211req_key ik; @@ -1210,7 +1201,7 @@ ieee80211_ioctl_setkey(struct ieee80211v return error; } -static __noinline int +static int ieee80211_ioctl_delkey(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211req_del_key dk; @@ -1352,7 +1343,7 @@ setmlme_dropsta(struct ieee80211vap *vap return error; } -static __noinline int +static int setmlme_common(struct ieee80211vap *vap, int op, const uint8_t mac[IEEE80211_ADDR_LEN], int reason) { @@ -1513,7 +1504,7 @@ mlmelookup(void *arg, const struct ieee8 look->se = se; } -static __noinline int +static int setmlme_assoc_sta(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], int ssid_len, const uint8_t ssid[IEEE80211_NWID_LEN]) @@ -1538,12 +1529,13 @@ setmlme_assoc_sta(struct ieee80211vap *v return 0; } -static __noinline int +static int setmlme_assoc_adhoc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], int ssid_len, const uint8_t ssid[IEEE80211_NWID_LEN]) { - struct ieee80211_scan_req sr; + struct ieee80211_scan_req *sr; + int error; KASSERT(vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_AHDEMO, @@ -1553,23 +1545,30 @@ setmlme_assoc_adhoc(struct ieee80211vap if (ssid_len == 0) return EINVAL; + sr = IEEE80211_MALLOC(sizeof(*sr), M_TEMP, + IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); + if (sr == NULL) + return ENOMEM; + /* NB: IEEE80211_IOC_SSID call missing for ap_scan=2. */ memset(vap->iv_des_ssid[0].ssid, 0, IEEE80211_NWID_LEN); vap->iv_des_ssid[0].len = ssid_len; memcpy(vap->iv_des_ssid[0].ssid, ssid, ssid_len); vap->iv_des_nssid = 1; - memset(&sr, 0, sizeof(sr)); - sr.sr_flags = IEEE80211_IOC_SCAN_ACTIVE | IEEE80211_IOC_SCAN_ONCE; - sr.sr_duration = IEEE80211_IOC_SCAN_FOREVER; - memcpy(sr.sr_ssid[0].ssid, ssid, ssid_len); - sr.sr_ssid[0].len = ssid_len; - sr.sr_nssid = 1; + sr->sr_flags = IEEE80211_IOC_SCAN_ACTIVE | IEEE80211_IOC_SCAN_ONCE; + sr->sr_duration = IEEE80211_IOC_SCAN_FOREVER; + memcpy(sr->sr_ssid[0].ssid, ssid, ssid_len); + sr->sr_ssid[0].len = ssid_len; + sr->sr_nssid = 1; + + error = ieee80211_scanreq(vap, sr); - return ieee80211_scanreq(vap, &sr); + IEEE80211_FREE(sr, M_TEMP); + return error; } -static __noinline int +static int ieee80211_ioctl_setmlme(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211req_mlme mlme; @@ -1594,7 +1593,7 @@ ieee80211_ioctl_setmlme(struct ieee80211 mlme.im_macaddr, mlme.im_reason); } -static __noinline int +static int ieee80211_ioctl_macmac(struct ieee80211vap *vap, struct ieee80211req *ireq) { uint8_t mac[IEEE80211_ADDR_LEN]; @@ -1619,7 +1618,7 @@ ieee80211_ioctl_macmac(struct ieee80211v return 0; } -static __noinline int +static int ieee80211_ioctl_setmaccmd(struct ieee80211vap *vap, struct ieee80211req *ireq) { const struct ieee80211_aclator *acl = vap->iv_acl; @@ -1657,7 +1656,7 @@ ieee80211_ioctl_setmaccmd(struct ieee802 return 0; } -static __noinline int +static int ieee80211_ioctl_setchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -1703,7 +1702,7 @@ ieee80211_ioctl_setchanlist(struct ieee8 return ENETRESET; } -static __noinline int +static int ieee80211_ioctl_setstastats(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_node *ni; @@ -1729,7 +1728,7 @@ ieee80211_ioctl_setstastats(struct ieee8 return 0; } -static __noinline int +static int ieee80211_ioctl_setstatxpow(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_node *ni; @@ -1749,7 +1748,7 @@ ieee80211_ioctl_setstatxpow(struct ieee8 return error; } -static __noinline int +static int ieee80211_ioctl_setwmeparam(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -1975,7 +1974,7 @@ setcurchan(struct ieee80211vap *vap, str * Old api for setting the current channel; this is * deprecated because channel numbers are ambiguous. */ -static __noinline int +static int ieee80211_ioctl_setchannel(struct ieee80211vap *vap, const struct ieee80211req *ireq) { @@ -2054,7 +2053,7 @@ ieee80211_ioctl_setchannel(struct ieee80 * channel description is provide so there is no ambiguity in * identifying the channel. */ -static __noinline int +static int ieee80211_ioctl_setcurchan(struct ieee80211vap *vap, const struct ieee80211req *ireq) { @@ -2078,7 +2077,7 @@ ieee80211_ioctl_setcurchan(struct ieee80 return setcurchan(vap, c); } -static __noinline int +static int ieee80211_ioctl_setregdomain(struct ieee80211vap *vap, const struct ieee80211req *ireq) { @@ -2152,7 +2151,7 @@ checkmcs(int mcs) return (mcs & 0x7f) <= 15; /* XXX could search ht rate set */ } -static __noinline int +static int ieee80211_ioctl_settxparams(struct ieee80211vap *vap, const struct ieee80211req *ireq) { @@ -2273,7 +2272,7 @@ setwparsnie(struct ieee80211vap *vap, ui vap->iv_rsn_ie = ie; } -static __noinline int +static int ieee80211_ioctl_setappie_locked(struct ieee80211vap *vap, const struct ieee80211req *ireq, int fc0) { @@ -2351,7 +2350,7 @@ ieee80211_ioctl_setappie_locked(struct i return error; } -static __noinline int +static int ieee80211_ioctl_setappie(struct ieee80211vap *vap, const struct ieee80211req *ireq) { @@ -2369,7 +2368,7 @@ ieee80211_ioctl_setappie(struct ieee8021 return error; } -static __noinline int +static int ieee80211_ioctl_chanswitch(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -2505,21 +2504,28 @@ ieee80211_scanreq(struct ieee80211vap *v #undef IEEE80211_IOC_SCAN_FLAGS } -static __noinline int +static int ieee80211_ioctl_scanreq(struct ieee80211vap *vap, struct ieee80211req *ireq) { - struct ieee80211_scan_req sr; /* XXX off stack? */ + struct ieee80211_scan_req *sr; int error; - if (ireq->i_len != sizeof(sr)) + if (ireq->i_len != sizeof(*sr)) return EINVAL; - error = copyin(ireq->i_data, &sr, sizeof(sr)); + sr = IEEE80211_MALLOC(sizeof(*sr), M_TEMP, + IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); + if (sr == NULL) + return ENOMEM; + error = copyin(ireq->i_data, sr, sizeof(*sr)); if (error != 0) - return error; - return ieee80211_scanreq(vap, &sr); + goto bad; + error = ieee80211_scanreq(vap, sr); +bad: + IEEE80211_FREE(sr, M_TEMP); + return error; } -static __noinline int +static int ieee80211_ioctl_setstavlan(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_node *ni; @@ -2583,7 +2589,7 @@ ieee80211_ioctl_setdefault(struct ieee80 return EINVAL; } -static __noinline int +static int ieee80211_ioctl_set80211(struct ieee80211vap *vap, u_long cmd, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; From owner-svn-src-head@freebsd.org Mon Jan 25 00:24:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E9E5A45718; Mon, 25 Jan 2016 00:24:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 21739A4; Mon, 25 Jan 2016 00:24:59 +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 u0P0Ow76068311; Mon, 25 Jan 2016 00:24:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P0Ov2w068306; Mon, 25 Jan 2016 00:24:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601250024.u0P0Ov2w068306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Jan 2016 00:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294698 - in head/sys/arm: allwinner conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 00:24:59 -0000 Author: andrew Date: Mon Jan 25 00:24:57 2016 New Revision: 294698 URL: https://svnweb.freebsd.org/changeset/base/294698 Log: Update the Allwinner kernels: * Use the ARM PLATFORM framework * Use ARM_INTRNG on teh A20 as it has a GICv2 * Add a method to find which Allwinner SoC we are running on Differential Revision: https://reviews.freebsd.org/D5059 Added: head/sys/arm/allwinner/allwinner_machdep.c - copied, changed from r294697, head/sys/arm/allwinner/a10_machdep.c Deleted: head/sys/arm/allwinner/a10_machdep.c Modified: head/sys/arm/allwinner/a10_common.c head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/A20 head/sys/arm/conf/CUBIEBOARD Modified: head/sys/arm/allwinner/a10_common.c ============================================================================== --- head/sys/arm/allwinner/a10_common.c Sun Jan 24 23:35:20 2016 (r294697) +++ head/sys/arm/allwinner/a10_common.c Mon Jan 25 00:24:57 2016 (r294698) @@ -42,6 +42,8 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +#ifndef ARM_INTRNG + static int fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) @@ -66,3 +68,5 @@ fdt_pic_decode_t fdt_pic_table[] = { &fdt_aintc_decode_ic, NULL }; + +#endif /* ARM_INTRNG */ Copied and modified: head/sys/arm/allwinner/allwinner_machdep.c (from r294697, head/sys/arm/allwinner/a10_machdep.c) ============================================================================== --- head/sys/arm/allwinner/a10_machdep.c Sun Jan 24 23:35:20 2016 (r294697, copy source) +++ head/sys/arm/allwinner/allwinner_machdep.c Mon Jan 25 00:24:57 2016 (r294698) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2015-2016 Emmanuel Vadot * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe @@ -45,32 +46,41 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include +#include -vm_offset_t -platform_lastaddr(void) -{ +#include "platform_if.h" - return (arm_devmap_lastaddr()); -} +static u_int soc_type; +static u_int soc_family; -void -platform_probe_and_attach(void) +static int +a10_attach(platform_t plat) { + soc_type = ALLWINNERSOC_A10; + soc_family = ALLWINNERSOC_SUN4I; + return (0); } -void -platform_gpio_init(void) +static int +a20_attach(platform_t plat) { + soc_type = ALLWINNERSOC_A20; + soc_family = ALLWINNERSOC_SUN7I; + + return (0); } -void -platform_late_init(void) + +static vm_offset_t +allwinner_lastaddr(platform_t plat) { + + return (arm_devmap_lastaddr()); } /* @@ -83,8 +93,8 @@ platform_late_init(void) * shouldn't be device-mapped. The original code mapped a 4MB block, but * perhaps a 1MB block would be more appropriate. */ -int -platform_devmap_init(void) +static int +allwinner_devmap_init(platform_t plat) { arm_devmap_add_entry(0x01C00000, 0x00400000); /* 4MB */ @@ -111,3 +121,34 @@ cpu_reset() printf("Reset failed!\n"); while (1); } + +static platform_method_t a10_methods[] = { + PLATFORMMETHOD(platform_attach, a10_attach), + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), + PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + + PLATFORMMETHOD_END, +}; + +static platform_method_t a20_methods[] = { + PLATFORMMETHOD(platform_attach, a20_attach), + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), + PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + + PLATFORMMETHOD_END, +}; + +u_int +allwinner_soc_type(void) +{ + return (soc_type); +} + +u_int +allwinner_soc_family(void) +{ + return (soc_family); +} + +FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10"); +FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20"); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sun Jan 24 23:35:20 2016 (r294697) +++ head/sys/arm/allwinner/files.allwinner Mon Jan 25 00:24:57 2016 (r294698) @@ -6,11 +6,11 @@ arm/allwinner/a10_clk.c standard arm/allwinner/a10_common.c standard arm/allwinner/a10_ehci.c optional ehci arm/allwinner/a10_gpio.c optional gpio -arm/allwinner/a10_machdep.c standard arm/allwinner/a10_mmc.c optional mmc arm/allwinner/a10_sramc.c standard arm/allwinner/a10_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard +arm/allwinner/allwinner_machdep.c standard arm/allwinner/if_emac.c optional emac arm/allwinner/timer.c standard #arm/allwinner/console.c standard Modified: head/sys/arm/conf/A20 ============================================================================== --- head/sys/arm/conf/A20 Sun Jan 24 23:35:20 2016 (r294697) +++ head/sys/arm/conf/A20 Mon Jan 25 00:24:57 2016 (r294698) @@ -23,9 +23,12 @@ ident A20 include "std.armv6" include "../allwinner/a20/std.a20" +options ARM_INTRNG + options HZ=100 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores +options PLATFORM # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Sun Jan 24 23:35:20 2016 (r294697) +++ head/sys/arm/conf/CUBIEBOARD Mon Jan 25 00:24:57 2016 (r294698) @@ -26,6 +26,7 @@ include "../allwinner/std.a10" options HZ=100 options SCHED_4BSD # 4BSD scheduler +options PLATFORM # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols From owner-svn-src-head@freebsd.org Mon Jan 25 00:28:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E990CA45804; Mon, 25 Jan 2016 00:28:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id BCDC2289; Mon, 25 Jan 2016 00:28:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (97e175b7.skybroadband.com [151.225.117.183]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 33DF5D78FE; Mon, 25 Jan 2016 00:27:38 +0000 (UTC) Date: Mon, 25 Jan 2016 00:27:36 +0000 From: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294698 - in head/sys/arm: allwinner conf Message-ID: <20160125002736.6247ad33@zapp.Home> In-Reply-To: <201601250024.u0P0Ov2w068306@repo.freebsd.org> References: <201601250024.u0P0Ov2w068306@repo.freebsd.org> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 00:28:10 -0000 On Mon, 25 Jan 2016 00:24:57 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Mon Jan 25 00:24:57 2016 > New Revision: 294698 > URL: https://svnweb.freebsd.org/changeset/base/294698 > > Log: > Update the Allwinner kernels: > * Use the ARM PLATFORM framework > * Use ARM_INTRNG on teh A20 as it has a GICv2 > * Add a method to find which Allwinner SoC we are running on > > Differential Revision: https://reviews.freebsd.org/D5059 I missed: Submitted by: Emmanuel Vadot From owner-svn-src-head@freebsd.org Mon Jan 25 00:38:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DFEDA45A93; Mon, 25 Jan 2016 00:38:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com [209.85.160.176]) (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 DA7EA8BB; Mon, 25 Jan 2016 00:38:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f176.google.com with SMTP id u68so15707595ykd.2; Sun, 24 Jan 2016 16:38:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=XS77FSlH9wxOaFIqLW2lU5Pp/DBms4iQkIstdnKSD78=; b=VEvQ7ak1TrzNJmIuZi1rUf1iXJsBCE/0DFOW8LOpUhQUOzijNoYywalhXrbU09Em6p wFSvAavkUplmW1pTGc7hD2ko5fP+5jc1d44Js40Zd82OkC2VSdyeCYeC4yUYjAkZhxsB 1v4S06C8A+hwwsBd+uN5no7B7MweeSbz7QpEqFUptpGnEGvT+C4VBfcc68yUwFWK9qsd LAx/yoRCMFnnfqjfNcyk/66Ii62w3R4QLZXMLqiu1QrfMq1hz4BxAUZ4HWl25MNjcsaI OkzWKKb0b+Eke4A4cDM8fn60KbuH5TAITHsvATyu/byBmjsEfmh957i0OT7jXp+960KP Rj0Q== X-Gm-Message-State: AG10YOTrxFHGfqdtt1WRYiCMV8OOLdyEdSygIilrntvQpyDr+DsfM2ZRcTS7hhnqmF9GaQ== X-Received: by 10.37.85.67 with SMTP id j64mr7681364ybb.172.1453682278971; Sun, 24 Jan 2016 16:37:58 -0800 (PST) Received: from mail-yk0-f173.google.com (mail-yk0-f173.google.com. [209.85.160.173]) by smtp.gmail.com with ESMTPSA id m188sm12449232ywe.46.2016.01.24.16.37.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jan 2016 16:37:58 -0800 (PST) Received: by mail-yk0-f173.google.com with SMTP id u68so15707381ykd.2; Sun, 24 Jan 2016 16:37:58 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.37.102.70 with SMTP id a67mr7637727ybc.89.1453682278179; Sun, 24 Jan 2016 16:37:58 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.69 with HTTP; Sun, 24 Jan 2016 16:37:58 -0800 (PST) In-Reply-To: References: <201511070143.tA71h13k038232@repo.freebsd.org> <563DDE73.6030307@selasky.org> <563F1A27.6030002@selasky.org> Date: Sun, 24 Jan 2016 16:37:58 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r290475 - in head: share/man/man9 sys/kern sys/sys From: Conrad Meyer To: Oliver Pinter Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Maste Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 00:38:06 -0000 No. They break ABI. Best, Conrad On Sun, Jan 24, 2016 at 1:45 PM, Oliver Pinter wrote: > On 11/8/15, Hans Petter Selasky wrote: >> On 11/07/15 19:26, Conrad Meyer wrote: >>> Can do =E2=80=94 fixed in r290505. >>> >>> Thanks, >>> Conrad >> >> Thank you. Looks good! >> >> --HPS > > Hi All! > > Is there any way to merge back to 10-STABLE these patches? > >> >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon Jan 25 03:18:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D82599D9D85 for ; Mon, 25 Jan 2016 03:18:29 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: from vfemail.net (onethreetwo.vfemail.net [199.16.11.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 989F2B2B for ; Mon, 25 Jan 2016 03:18:29 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: (qmail 90786 invoked by uid 89); 25 Jan 2016 03:18:23 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 25 Jan 2016 03:18:23 -0000 Received: (qmail 63788 invoked by uid 89); 24 Jan 2016 16:37:27 -0000 Received: by simscan 1.3.1 ppid: 63785, pid: 63786, t: 0.0026s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 24 Jan 2016 16:37:27 -0000 Received: (qmail 4559 invoked by uid 89); 24 Jan 2016 16:37:27 -0000 Received: by simscan 1.4.0 ppid: 4536, pid: 4555, t: 0.9478s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by mail.vfemail.net with ESMTPA; 24 Jan 2016 16:37:26 -0000 From: Jan Beich To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294665 - head/usr.bin/ldd References: <201601241515.u0OFFvhb001608@repo.freebsd.org> Date: Sun, 24 Jan 2016 17:37:14 +0100 In-Reply-To: <201601241515.u0OFFvhb001608@repo.freebsd.org> (Ruslan Bukin's message of "Sun, 24 Jan 2016 15:15:57 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 03:18:29 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ruslan Bukin writes: > Modified: head/usr.bin/ldd/ldd.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/ldd/ldd.c Sun Jan 24 15:12:49 2016 (r294664) > +++ head/usr.bin/ldd/ldd.c Sun Jan 24 15:15:57 2016 (r294665) > @@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$"); >=20=20 > #include "extern.h" >=20=20 > -/* We don't support a.out executables on arm64 */ > -#ifndef __aarch64__ > +/* We don't support a.out executables on arm64 and riscv */ > +#if !defined(__aarch64__) && !defined(__riscv__) a.out in userland is only supported by i386. On amd64 it'd mean 32bit jail after |kldload aout|. r292623 maybe an example fix if you can ignore whitespace noise. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJWpP26XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3b4sUIAJhzcAMMqosxZV7dAfchM9OS +1dQMtX106fJ8EzqYhi1dPKUBC5B6tbq8o7JpnyRrWBtetRMSODb5rdP18dl0s2X yJaBRwFliO+7ouf1xn7Q17ARaIL1nkLPipW3eK8dSdAgArlrOYAa0e0nJn+Oldu7 PVZzJfZbvZW5KlnJ4ZfAFsg23x3auMYhSDbSfBB5r08HZRRgmRlXasW7+8QPc7NF 4XNNv7+ZbDtJjqy7/KCUk0KsCIYPiFh7zWuKdpYQ5laL4mCg+2CMTEmt1Y2vgYn4 lrwUiWXrQ++O34YhUJ4zw9+dWWaSSdkis1jakGYQ7oSpaoINADC9KRJcco5z5b0= =QSsd -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@freebsd.org Mon Jan 25 04:22:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A4A7FBA; Mon, 25 Jan 2016 04:22:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E9C324C; Mon, 25 Jan 2016 04:22:02 +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 u0P4M1ke037338; Mon, 25 Jan 2016 04:22:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P4M1iI037337; Mon, 25 Jan 2016 04:22:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601250422.u0P4M1iI037337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Jan 2016 04:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294699 - head/usr.bin/elfdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 04:22:02 -0000 Author: emaste Date: Mon Jan 25 04:22:01 2016 New Revision: 294699 URL: https://svnweb.freebsd.org/changeset/base/294699 Log: elfdump: handle STT_SPARC_REGISTER STT_SPARC_REGISTER is a SPARC-specific symbol type specified by the Sparcv9 ABI to provide some information on register use by the object. Also rework st_info type lookup to avoid out-of-bounds array access. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Mon Jan 25 00:24:57 2016 (r294698) +++ head/usr.bin/elfdump/elfdump.c Mon Jan 25 04:22:01 2016 (r294699) @@ -408,9 +408,27 @@ static const char *sh_flags[] = { "SHF_WRITE|SHF_ALLOC|SHF_EXECINSTR" }; -static const char *st_types[] = { - "STT_NOTYPE", "STT_OBJECT", "STT_FUNC", "STT_SECTION", "STT_FILE" -}; +static const char * +st_type(unsigned int mach, unsigned int type) +{ + static char s_type[32]; + + switch (type) { + case STT_NOTYPE: return "STT_NOTYPE"; + case STT_OBJECT: return "STT_OBJECT"; + case STT_FUNC: return "STT_FUNC"; + case STT_SECTION: return "STT_SECTION"; + case STT_FILE: return "STT_FILE"; + case STT_COMMON: return "STT_COMMON"; + case STT_TLS: return "STT_TLS"; + case 13: + if (mach == EM_SPARCV9) + return "STT_SPARC_REGISTER"; + break; + } + snprintf(s_type, sizeof(s_type), "", type); + return (s_type); +} static const char *st_bindings[] = { "STB_LOCAL", "STB_GLOBAL", "STB_WEAK" @@ -824,6 +842,7 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh) static void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str) { + u_int64_t machine; u_int64_t offset; u_int64_t entsize; u_int64_t size; @@ -835,6 +854,7 @@ elf_print_symtab(Elf32_Ehdr *e, void *sh int len; int i; + machine = elf_get_quarter(e, e, E_MACHINE); offset = elf_get_off(e, sh, SH_OFFSET); entsize = elf_get_size(e, sh, SH_ENTSIZE); size = elf_get_size(e, sh, SH_SIZE); @@ -854,7 +874,7 @@ elf_print_symtab(Elf32_Ehdr *e, void *sh fprintf(out, "\tst_value: %#jx\n", value); fprintf(out, "\tst_size: %jd\n", (intmax_t)size); fprintf(out, "\tst_info: %s %s\n", - st_types[ELF32_ST_TYPE(info)], + st_type(machine, ELF32_ST_TYPE(info)), st_bindings[ELF32_ST_BIND(info)]); fprintf(out, "\tst_shndx: %jd\n", (intmax_t)shndx); } From owner-svn-src-head@freebsd.org Mon Jan 25 05:01:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1370DA31AB7; Mon, 25 Jan 2016 05:01:35 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE5DE98; Mon, 25 Jan 2016 05:01:34 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P51XB9047990; Mon, 25 Jan 2016 05:01:33 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P51XXV046894; Mon, 25 Jan 2016 05:01:33 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601250501.u0P51XXV046894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Jan 2016 05:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294700 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 05:01:35 -0000 Author: sephe Date: Mon Jan 25 05:01:32 2016 New Revision: 294700 URL: https://svnweb.freebsd.org/changeset/base/294700 Log: hyperv/hn: Partly rework transmission path - Avoid unnecessary malloc/free on transmission path. - busdma(9)-fy transmission path. - Properly handle IFF_DRV_OACTIVE. This should fix the network stalls reported by many. - Properly setup TSO parameters. - Properly handle bpf(4) tapping. This 5 times the performance during TCP sending test, when there is one bpf(4) attached. - Allow size of chimney sending be tuned on a running system. Default value still needs more test to determine. Reviewed by: adrian, delphij Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4972 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Jan 25 04:22:01 2016 (r294699) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Jan 25 05:01:32 2016 (r294700) @@ -1028,4 +1028,6 @@ hv_nv_on_channel_callback(void *context) if (bufferlen > NETVSC_PACKET_SIZE) free(buffer, M_NETVSC); + + hv_rf_channel_rollup(net_dev); } Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jan 25 04:22:01 2016 (r294699) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jan 25 05:01:32 2016 (r294700) @@ -38,12 +38,16 @@ #ifndef __HV_NET_VSC_H__ #define __HV_NET_VSC_H__ -#include #include #include #include +#include #include +#include +#include +#include + #include #include @@ -984,6 +988,9 @@ typedef struct { hv_bool_uint8_t link_state; } netvsc_device_info; +struct hn_txdesc; +SLIST_HEAD(hn_txdesc_list, hn_txdesc); + /* * Device-specific softc structure */ @@ -1001,6 +1008,18 @@ typedef struct hn_softc { struct hv_device *hn_dev_obj; netvsc_dev *net_dev; + int hn_txdesc_cnt; + struct hn_txdesc *hn_txdesc; + bus_dma_tag_t hn_tx_data_dtag; + bus_dma_tag_t hn_tx_rndis_dtag; + int hn_tx_chimney_size; + int hn_tx_chimney_max; + + struct mtx hn_txlist_spin; + struct hn_txdesc_list hn_txlist; + int hn_txdesc_avail; + int hn_txeof; + struct lro_ctrl hn_lro; int hn_lro_hiwat; @@ -1012,6 +1031,11 @@ typedef struct hn_softc { u_long hn_csum_trusted; u_long hn_lro_tried; u_long hn_small_pkts; + u_long hn_no_txdescs; + u_long hn_send_failed; + u_long hn_txdma_failed; + u_long hn_tx_collapsed; + u_long hn_tx_chimney; } hn_softc_t; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 04:22:01 2016 (r294699) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:01:32 2016 (r294700) @@ -129,6 +129,41 @@ __FBSDID("$FreeBSD$"); #define HV_NV_SC_PTR_OFFSET_IN_BUF 0 #define HV_NV_PACKET_OFFSET_IN_BUF 16 +/* YYY should get it from the underlying channel */ +#define HN_TX_DESC_CNT 512 + +#define HN_RNDIS_MSG_LEN \ + (sizeof(rndis_msg) + \ + RNDIS_VLAN_PPI_SIZE + \ + RNDIS_TSO_PPI_SIZE + \ + RNDIS_CSUM_PPI_SIZE) +#define HN_RNDIS_MSG_BOUNDARY PAGE_SIZE +#define HN_RNDIS_MSG_ALIGN CACHE_LINE_SIZE + +#define HN_TX_DATA_BOUNDARY PAGE_SIZE +#define HN_TX_DATA_MAXSIZE IP_MAXPACKET +#define HN_TX_DATA_SEGSIZE PAGE_SIZE +#define HN_TX_DATA_SEGCNT_MAX \ + (NETVSC_PACKET_MAXPAGE - HV_RF_NUM_TX_RESERVED_PAGE_BUFS) + +struct hn_txdesc { + SLIST_ENTRY(hn_txdesc) link; + struct mbuf *m; + struct hn_softc *sc; + int refs; + uint32_t flags; /* HN_TXD_FLAG_ */ + netvsc_packet netvsc_pkt; /* XXX to be removed */ + + bus_dmamap_t data_dmap; + + bus_addr_t rndis_msg_paddr; + rndis_msg *rndis_msg; + bus_dmamap_t rndis_msg_dmap; +}; + +#define HN_TXD_FLAG_ONLIST 0x1 +#define HN_TXD_FLAG_DMAMAP 0x2 + /* * A unified flag for all outbound check sum flags is useful, * and it helps avoiding unnecessary check sum calculation in @@ -174,6 +209,16 @@ int hv_promisc_mode = 0; /* normal mo static int hn_trust_hosttcp = 0; TUNABLE_INT("dev.hn.trust_hosttcp", &hn_trust_hosttcp); +#if __FreeBSD_version >= 1100045 +/* Limit TSO burst size */ +static int hn_tso_maxlen = 0; +TUNABLE_INT("dev.hn.tso_maxlen", &hn_tso_maxlen); +#endif + +/* Limit chimney send size */ +static int hn_tx_chimney_size = 0; +TUNABLE_INT("dev.hn.tx_chimney_size", &hn_tx_chimney_size); + /* * Forward declarations */ @@ -181,14 +226,17 @@ static void hn_stop(hn_softc_t *sc); static void hn_ifinit_locked(hn_softc_t *sc); static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -static int hn_start_locked(struct ifnet *ifp); +static void hn_start_locked(struct ifnet *ifp); static void hn_start(struct ifnet *ifp); static int hn_ifmedia_upd(struct ifnet *ifp); static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); #ifdef HN_LRO_HIWAT static int hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS); #endif +static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); +static int hn_create_tx_ring(struct hn_softc *sc); +static void hn_destroy_tx_ring(struct hn_softc *sc); static __inline void hn_set_lro_hiwat(struct hn_softc *sc, int hiwat) @@ -318,10 +366,13 @@ netvsc_attach(device_t dev) netvsc_device_info device_info; hn_softc_t *sc; int unit = device_get_unit(dev); - struct ifnet *ifp; + struct ifnet *ifp = NULL; struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; - int ret; + int error; +#if __FreeBSD_version >= 1100045 + int tso_maxlen; +#endif sc = device_get_softc(dev); if (sc == NULL) { @@ -334,6 +385,10 @@ netvsc_attach(device_t dev) sc->hn_lro_hiwat = HN_LRO_HIWAT_DEF; sc->hn_trust_hosttcp = hn_trust_hosttcp; + error = hn_create_tx_ring(sc); + if (error) + goto failed; + NV_LOCK_INIT(sc, "NetVSCLock"); sc->hn_dev_obj = device_ctx; @@ -381,12 +436,10 @@ netvsc_attach(device_t dev) else ifp->if_hwassist = CSUM_TCP | CSUM_TSO; - ret = hv_rf_on_device_add(device_ctx, &device_info); - if (ret != 0) { - if_free(ifp); + error = hv_rf_on_device_add(device_ctx, &device_info); + if (error) + goto failed; - return (ret); - } if (device_info.link_state == 0) { sc->hn_carrier = 1; } @@ -400,8 +453,30 @@ netvsc_attach(device_t dev) #endif #endif /* INET || INET6 */ +#if __FreeBSD_version >= 1100045 + tso_maxlen = hn_tso_maxlen; + if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) + tso_maxlen = IP_MAXPACKET; + + ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; + ifp->if_hw_tsomax = tso_maxlen - + (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); +#endif + ether_ifattach(ifp, device_info.mac_addr); +#if __FreeBSD_version >= 1100045 + if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, + ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); +#endif + + sc->hn_tx_chimney_max = sc->net_dev->send_section_size; + sc->hn_tx_chimney_size = sc->hn_tx_chimney_max; + if (hn_tx_chimney_size > 0 && + hn_tx_chimney_size < sc->hn_tx_chimney_max) + sc->hn_tx_chimney_size = hn_tx_chimney_size; + ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); @@ -429,6 +504,26 @@ netvsc_attach(device_t dev) "# of TCP segements that we trust host's csum verification"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "small_pkts", CTLFLAG_RW, &sc->hn_small_pkts, "# of small packets received"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_txdescs", + CTLFLAG_RW, &sc->hn_no_txdescs, "# of times short of TX descs"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "send_failed", + CTLFLAG_RW, &sc->hn_send_failed, "# of hyper-v sending failure"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "txdma_failed", + CTLFLAG_RW, &sc->hn_txdma_failed, "# of TX DMA failure"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_collapsed", + CTLFLAG_RW, &sc->hn_tx_collapsed, "# of TX mbuf collapsed"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_chimney", + CTLFLAG_RW, &sc->hn_tx_chimney, "# of chimney send"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_cnt", + CTLFLAG_RD, &sc->hn_txdesc_cnt, 0, "# of total TX descs"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", + CTLFLAG_RD, &sc->hn_txdesc_avail, 0, "# of available TX descs"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_chimney_max", + CTLFLAG_RD, &sc->hn_tx_chimney_max, 0, + "Chimney send packet size upper boundary"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_size", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_tx_chimney_size_sysctl, + "I", "Chimney send packet size limit"); if (unit == 0) { struct sysctl_ctx_list *dc_ctx; @@ -446,9 +541,21 @@ netvsc_attach(device_t dev) CTLFLAG_RD, &hn_trust_hosttcp, 0, "Trust tcp segement verification on host side, " "when csum info is missing (global setting)"); + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tx_chimney_size", + CTLFLAG_RD, &hn_tx_chimney_size, 0, + "Chimney send packet size limit"); +#if __FreeBSD_version >= 1100045 + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tso_maxlen", + CTLFLAG_RD, &hn_tso_maxlen, 0, "TSO burst limit"); +#endif } return (0); +failed: + hn_destroy_tx_ring(sc); + if (ifp != NULL) + if_free(ifp); + return (error); } /* @@ -480,6 +587,7 @@ netvsc_detach(device_t dev) #if defined(INET) || defined(INET6) tcp_lro_free(&sc->hn_lro); #endif + hn_destroy_tx_ring(sc); return (0); } @@ -493,6 +601,112 @@ netvsc_shutdown(device_t dev) return (0); } +static __inline int +hn_txdesc_dmamap_load(struct hn_softc *sc, struct hn_txdesc *txd, + struct mbuf **m_head, bus_dma_segment_t *segs, int *nsegs) +{ + struct mbuf *m = *m_head; + int error; + + error = bus_dmamap_load_mbuf_sg(sc->hn_tx_data_dtag, txd->data_dmap, + m, segs, nsegs, BUS_DMA_NOWAIT); + if (error == EFBIG) { + struct mbuf *m_new; + + m_new = m_collapse(m, M_NOWAIT, HN_TX_DATA_SEGCNT_MAX); + if (m_new == NULL) + return ENOBUFS; + else + *m_head = m = m_new; + sc->hn_tx_collapsed++; + + error = bus_dmamap_load_mbuf_sg(sc->hn_tx_data_dtag, + txd->data_dmap, m, segs, nsegs, BUS_DMA_NOWAIT); + } + if (!error) { + bus_dmamap_sync(sc->hn_tx_data_dtag, txd->data_dmap, + BUS_DMASYNC_PREWRITE); + txd->flags |= HN_TXD_FLAG_DMAMAP; + } + return error; +} + +static __inline void +hn_txdesc_dmamap_unload(struct hn_softc *sc, struct hn_txdesc *txd) +{ + + if (txd->flags & HN_TXD_FLAG_DMAMAP) { + bus_dmamap_sync(sc->hn_tx_data_dtag, + txd->data_dmap, BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->hn_tx_data_dtag, + txd->data_dmap); + txd->flags &= ~HN_TXD_FLAG_DMAMAP; + } +} + +static __inline int +hn_txdesc_put(struct hn_softc *sc, struct hn_txdesc *txd) +{ + + KASSERT((txd->flags & HN_TXD_FLAG_ONLIST) == 0, + ("put an onlist txd %#x", txd->flags)); + + KASSERT(txd->refs > 0, ("invalid txd refs %d", txd->refs)); + if (atomic_fetchadd_int(&txd->refs, -1) != 1) + return 0; + + hn_txdesc_dmamap_unload(sc, txd); + if (txd->m != NULL) { + m_freem(txd->m); + txd->m = NULL; + } + + txd->flags |= HN_TXD_FLAG_ONLIST; + + mtx_lock_spin(&sc->hn_txlist_spin); + KASSERT(sc->hn_txdesc_avail >= 0 && + sc->hn_txdesc_avail < sc->hn_txdesc_cnt, + ("txdesc_put: invalid txd avail %d", sc->hn_txdesc_avail)); + sc->hn_txdesc_avail++; + SLIST_INSERT_HEAD(&sc->hn_txlist, txd, link); + mtx_unlock_spin(&sc->hn_txlist_spin); + + return 1; +} + +static __inline struct hn_txdesc * +hn_txdesc_get(struct hn_softc *sc) +{ + struct hn_txdesc *txd; + + mtx_lock_spin(&sc->hn_txlist_spin); + txd = SLIST_FIRST(&sc->hn_txlist); + if (txd != NULL) { + KASSERT(sc->hn_txdesc_avail > 0, + ("txdesc_get: invalid txd avail %d", sc->hn_txdesc_avail)); + sc->hn_txdesc_avail--; + SLIST_REMOVE_HEAD(&sc->hn_txlist, link); + } + mtx_unlock_spin(&sc->hn_txlist_spin); + + if (txd != NULL) { + KASSERT(txd->m == NULL && txd->refs == 0 && + (txd->flags & HN_TXD_FLAG_ONLIST), ("invalid txd")); + txd->flags &= ~HN_TXD_FLAG_ONLIST; + txd->refs = 1; + } + return txd; +} + +static __inline void +hn_txdesc_hold(struct hn_txdesc *txd) +{ + + /* 0->1 transition will never work */ + KASSERT(txd->refs > 0, ("invalid refs %d", txd->refs)); + atomic_add_int(&txd->refs, 1); +} + /* * Send completion processing * @@ -503,34 +717,46 @@ netvsc_shutdown(device_t dev) void netvsc_xmit_completion(void *context) { - netvsc_packet *packet = (netvsc_packet *)context; - struct mbuf *mb; - uint8_t *buf; + netvsc_packet *packet = context; + struct hn_txdesc *txd; + struct hn_softc *sc; + + txd = (struct hn_txdesc *)(uintptr_t) + packet->compl.send.send_completion_tid; + + sc = txd->sc; + sc->hn_txeof = 1; + hn_txdesc_put(sc, txd); +} - mb = (struct mbuf *)(uintptr_t)packet->compl.send.send_completion_tid; - buf = ((uint8_t *)packet) - HV_NV_PACKET_OFFSET_IN_BUF; +void +netvsc_channel_rollup(struct hv_device *device_ctx) +{ + struct hn_softc *sc = device_get_softc(device_ctx->device); + struct ifnet *ifp; - free(buf, M_NETVSC); + if (!sc->hn_txeof) + return; - if (mb != NULL) { - m_freem(mb); - } + sc->hn_txeof = 0; + ifp = sc->hn_ifp; + NV_LOCK(sc); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + hn_start_locked(ifp); + NV_UNLOCK(sc); } /* * Start a transmit of one or more packets */ -static int +static void hn_start_locked(struct ifnet *ifp) { hn_softc_t *sc = ifp->if_softc; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); netvsc_dev *net_dev = sc->net_dev; - device_t dev = device_ctx->device; - uint8_t *buf; netvsc_packet *packet; struct mbuf *m_head, *m; - struct mbuf *mc_head = NULL; struct ether_vlan_header *eh; rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; @@ -539,84 +765,40 @@ hn_start_locked(struct ifnet *ifp) rndis_tcp_ip_csum_info *csum_info; rndis_tcp_tso_info *tso_info; int ether_len; - int i; - int num_frags; - int len; - int retries = 0; - int ret = 0; uint32_t rndis_msg_size = 0; uint32_t trans_proto_type; uint32_t send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; - while (!IFQ_DRV_IS_EMPTY(&sc->hn_ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&sc->hn_ifp->if_snd, m_head); - if (m_head == NULL) { - break; - } - - len = 0; - num_frags = 0; - - /* Walk the mbuf list computing total length and num frags */ - for (m = m_head; m != NULL; m = m->m_next) { - if (m->m_len != 0) { - num_frags++; - len += m->m_len; - } - } + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) + return; - /* - * Reserve the number of pages requested. Currently, - * one page is reserved for the message in the RNDIS - * filter packet - */ - num_frags += HV_RF_NUM_TX_RESERVED_PAGE_BUFS; + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; + int error, nsegs, i, send_failed = 0; + struct hn_txdesc *txd; - /* If exceeds # page_buffers in netvsc_packet */ - if (num_frags > NETVSC_PACKET_MAXPAGE) { - device_printf(dev, "exceed max page buffers,%d,%d\n", - num_frags, NETVSC_PACKET_MAXPAGE); - m_freem(m_head); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return (EINVAL); - } + IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); + if (m_head == NULL) + break; - /* - * Allocate a buffer with space for a netvsc packet plus a - * number of reserved areas. First comes a (currently 16 - * bytes, currently unused) reserved data area. Second is - * the netvsc_packet. Third is an area reserved for an - * rndis_filter_packet struct. Fourth (optional) is a - * rndis_per_packet_info struct. - * Changed malloc to M_NOWAIT to avoid sleep under spin lock. - * No longer reserving extra space for page buffers, as they - * are already part of the netvsc_packet. - */ - buf = malloc(HV_NV_PACKET_OFFSET_IN_BUF + - sizeof(netvsc_packet) + - sizeof(rndis_msg) + - RNDIS_VLAN_PPI_SIZE + - RNDIS_TSO_PPI_SIZE + - RNDIS_CSUM_PPI_SIZE, - M_NETVSC, M_ZERO | M_NOWAIT); - if (buf == NULL) { - device_printf(dev, "hn:malloc packet failed\n"); - m_freem(m_head); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return (ENOMEM); + txd = hn_txdesc_get(sc); + if (txd == NULL) { + sc->hn_no_txdescs++; + IF_PREPEND(&ifp->if_snd, m_head); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; } - packet = (netvsc_packet *)(buf + HV_NV_PACKET_OFFSET_IN_BUF); - *(vm_offset_t *)buf = HV_NV_SC_PTR_OFFSET_IN_BUF; + packet = &txd->netvsc_pkt; + /* XXX not necessary */ + memset(packet, 0, sizeof(*packet)); packet->is_data_pkt = TRUE; - /* Set up the rndis header */ - packet->page_buf_count = num_frags; - /* Initialize it from the mbuf */ - packet->tot_data_buf_len = len; + packet->tot_data_buf_len = m_head->m_pkthdr.len; /* * extension points to the area reserved for the @@ -624,8 +806,9 @@ hn_start_locked(struct ifnet *ifp) * the netvsc_packet (and rppi struct, if present; * length is updated later). */ - packet->rndis_mesg = packet + 1; - rndis_mesg = (rndis_msg *)packet->rndis_mesg; + rndis_mesg = txd->rndis_msg; + /* XXX not necessary */ + memset(rndis_mesg, 0, HN_RNDIS_MSG_LEN); rndis_mesg->ndis_msg_type = REMOTE_NDIS_PACKET_MSG; rndis_pkt = &rndis_mesg->msg.packet; @@ -644,8 +827,6 @@ hn_start_locked(struct ifnet *ifp) * set up some additional fields so the Hyper-V infrastructure will stuff the VLAN tag * into the frame. */ - packet->vlan_tci = m_head->m_pkthdr.ether_vtag; - rndis_msg_size += RNDIS_VLAN_PPI_SIZE; rppi = hv_set_rppi_data(rndis_mesg, RNDIS_VLAN_PPI_SIZE, @@ -656,7 +837,7 @@ hn_start_locked(struct ifnet *ifp) rppi->per_packet_info_offset); /* FreeBSD does not support CFI or priority */ rppi_vlan_info->u1.s1.vlan_id = - packet->vlan_tci & 0xfff; + m_head->m_pkthdr.ether_vtag & 0xfff; } /* Only check the flags for outbound and ignore the ones for inbound */ @@ -758,7 +939,7 @@ pre_send: packet->tot_data_buf_len = rndis_mesg->msg_len; /* send packet with send buffer */ - if (packet->tot_data_buf_len < net_dev->send_section_size) { + if (packet->tot_data_buf_len < sc->hn_tx_chimney_size) { send_buf_section_idx = hv_nv_get_next_send_section(net_dev); if (send_buf_section_idx != @@ -783,33 +964,49 @@ pre_send: packet->send_buf_section_size = packet->tot_data_buf_len; packet->page_buf_count = 0; + sc->hn_tx_chimney++; goto do_send; } } + error = hn_txdesc_dmamap_load(sc, txd, &m_head, segs, &nsegs); + if (error) { + int freed; + + /* + * This mbuf is not linked w/ the txd yet, so free + * it now. + */ + m_freem(m_head); + freed = hn_txdesc_put(sc, txd); + KASSERT(freed != 0, + ("fail to free txd upon txdma error")); + + sc->hn_txdma_failed++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + continue; + } + + packet->page_buf_count = nsegs + + HV_RF_NUM_TX_RESERVED_PAGE_BUFS; + /* send packet with page buffer */ - packet->page_buffers[0].pfn = - atop(hv_get_phys_addr(rndis_mesg)); + packet->page_buffers[0].pfn = atop(txd->rndis_msg_paddr); packet->page_buffers[0].offset = - (unsigned long)rndis_mesg & PAGE_MASK; + txd->rndis_msg_paddr & PAGE_MASK; packet->page_buffers[0].length = rndis_msg_size; /* * Fill the page buffers with mbuf info starting at index * HV_RF_NUM_TX_RESERVED_PAGE_BUFS. */ - i = HV_RF_NUM_TX_RESERVED_PAGE_BUFS; - for (m = m_head; m != NULL; m = m->m_next) { - if (m->m_len) { - vm_offset_t paddr = - vtophys(mtod(m, vm_offset_t)); - packet->page_buffers[i].pfn = - paddr >> PAGE_SHIFT; - packet->page_buffers[i].offset = - paddr & (PAGE_SIZE - 1); - packet->page_buffers[i].length = m->m_len; - i++; - } + for (i = 0; i < nsegs; ++i) { + hv_vmbus_page_buffer *pb = &packet->page_buffers[ + i + HV_RF_NUM_TX_RESERVED_PAGE_BUFS]; + + pb->pfn = atop(segs[i].ds_addr); + pb->offset = segs[i].ds_addr & PAGE_MASK; + pb->length = segs[i].ds_len; } packet->send_buf_section_idx = @@ -817,63 +1014,65 @@ pre_send: packet->send_buf_section_size = 0; do_send: + txd->m = m_head; - /* - * If bpf, copy the mbuf chain. This is less expensive than - * it appears; the mbuf clusters are not copied, only their - * reference counts are incremented. - * Needed to avoid a race condition where the completion - * callback is invoked, freeing the mbuf chain, before the - * bpf_mtap code has a chance to run. - */ - if (ifp->if_bpf) { - mc_head = m_copypacket(m_head, M_NOWAIT); - } -retry_send: /* Set the completion routine */ packet->compl.send.on_send_completion = netvsc_xmit_completion; packet->compl.send.send_completion_context = packet; - packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)m_head; + packet->compl.send.send_completion_tid = + (uint64_t)(uintptr_t)txd; - /* Removed critical_enter(), does not appear necessary */ - ret = hv_nv_on_send(device_ctx, packet); - if (ret == 0) { +again: + /* + * Make sure that txd is not freed before ETHER_BPF_MTAP. + */ + hn_txdesc_hold(txd); + error = hv_nv_on_send(device_ctx, packet); + if (!error) { + ETHER_BPF_MTAP(ifp, m_head); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - /* if bpf && mc_head, call bpf_mtap code */ - if (mc_head) { - ETHER_BPF_MTAP(ifp, mc_head); - } - } else { - retries++; - if (retries < 4) { - goto retry_send; - } + } + hn_txdesc_put(sc, txd); - IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if (__predict_false(error)) { + int freed; /* - * Null the mbuf pointer so the completion function - * does not free the mbuf chain. We just pushed the - * mbuf chain back on the if_snd queue. + * This should "really rarely" happen. + * + * XXX Too many RX to be acked or too many sideband + * commands to run? Ask netvsc_channel_rollup() + * to kick start later. */ - packet->compl.send.send_completion_tid = 0; + sc->hn_txeof = 1; + if (!send_failed) { + sc->hn_send_failed++; + send_failed = 1; + /* + * Try sending again after set hn_txeof; + * in case that we missed the last + * netvsc_channel_rollup(). + */ + goto again; + } + if_printf(ifp, "send failed\n"); /* - * Release the resources since we will not get any - * send completion + * This mbuf will be prepended, don't free it + * in hn_txdesc_put(); only unload it from the + * DMA map in hn_txdesc_put(), if it was loaded. */ - netvsc_xmit_completion(packet); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - } + txd->m = NULL; + freed = hn_txdesc_put(sc, txd); + KASSERT(freed != 0, + ("fail to free txd upon send error")); - /* if bpf && mc_head, free the mbuf chain copy */ - if (mc_head) { - m_freem(mc_head); + sc->hn_send_failed++; + IF_PREPEND(&ifp->if_snd, m_head); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; } } - - return (ret); } /* @@ -1220,6 +1419,9 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, break; } + sc->hn_tx_chimney_max = sc->net_dev->send_section_size; + if (sc->hn_tx_chimney_size > sc->hn_tx_chimney_max) + sc->hn_tx_chimney_size = sc->hn_tx_chimney_max; hn_ifinit_locked(sc); NV_LOCK(sc); @@ -1477,6 +1679,25 @@ hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS) #endif /* HN_LRO_HIWAT */ static int +hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int chimney_size, error; + + chimney_size = sc->hn_tx_chimney_size; + error = sysctl_handle_int(oidp, &chimney_size, 0, req); + if (error || req->newptr == NULL) + return error; + + if (chimney_size > sc->hn_tx_chimney_max || chimney_size <= 0) + return EINVAL; + + if (sc->hn_tx_chimney_size != chimney_size) + sc->hn_tx_chimney_size = chimney_size; + return 0; +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; @@ -1551,6 +1772,150 @@ hn_check_iplen(const struct mbuf *m, int return ip->ip_p; } +static void +hn_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + bus_addr_t *paddr = arg; + + if (error) + return; + + KASSERT(nseg == 1, ("too many segments %d!", nseg)); + *paddr = segs->ds_addr; +} + +static int +hn_create_tx_ring(struct hn_softc *sc) +{ + bus_dma_tag_t parent_dtag; + int error, i; + + sc->hn_txdesc_cnt = HN_TX_DESC_CNT; + sc->hn_txdesc = malloc(sizeof(struct hn_txdesc) * sc->hn_txdesc_cnt, + M_NETVSC, M_WAITOK | M_ZERO); + SLIST_INIT(&sc->hn_txlist); + mtx_init(&sc->hn_txlist_spin, "hn txlist", NULL, MTX_SPIN); + + parent_dtag = bus_get_dma_tag(sc->hn_dev); + + /* DMA tag for RNDIS messages. */ + error = bus_dma_tag_create(parent_dtag, /* parent */ + HN_RNDIS_MSG_ALIGN, /* alignment */ + HN_RNDIS_MSG_BOUNDARY, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + HN_RNDIS_MSG_LEN, /* maxsize */ + 1, /* nsegments */ + HN_RNDIS_MSG_LEN, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &sc->hn_tx_rndis_dtag); + if (error) { + device_printf(sc->hn_dev, "failed to create rndis dmatag\n"); + return error; + } + + /* DMA tag for data. */ + error = bus_dma_tag_create(parent_dtag, /* parent */ + 1, /* alignment */ + HN_TX_DATA_BOUNDARY, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + HN_TX_DATA_MAXSIZE, /* maxsize */ + HN_TX_DATA_SEGCNT_MAX, /* nsegments */ + HN_TX_DATA_SEGSIZE, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &sc->hn_tx_data_dtag); + if (error) { + device_printf(sc->hn_dev, "failed to create data dmatag\n"); + return error; + } + + for (i = 0; i < sc->hn_txdesc_cnt; ++i) { + struct hn_txdesc *txd = &sc->hn_txdesc[i]; + + txd->sc = sc; + + /* + * Allocate and load RNDIS messages. + */ + error = bus_dmamem_alloc(sc->hn_tx_rndis_dtag, + (void **)&txd->rndis_msg, + BUS_DMA_WAITOK | BUS_DMA_COHERENT, + &txd->rndis_msg_dmap); + if (error) { + device_printf(sc->hn_dev, + "failed to allocate rndis_msg, %d\n", i); + return error; + } + + error = bus_dmamap_load(sc->hn_tx_rndis_dtag, + txd->rndis_msg_dmap, + txd->rndis_msg, HN_RNDIS_MSG_LEN, + hn_dma_map_paddr, &txd->rndis_msg_paddr, + BUS_DMA_NOWAIT); + if (error) { + device_printf(sc->hn_dev, + "failed to load rndis_msg, %d\n", i); + bus_dmamem_free(sc->hn_tx_rndis_dtag, + txd->rndis_msg, txd->rndis_msg_dmap); + return error; + } + + /* DMA map for TX data. */ + error = bus_dmamap_create(sc->hn_tx_data_dtag, 0, + &txd->data_dmap); + if (error) { + device_printf(sc->hn_dev, + "failed to allocate tx data dmamap\n"); + bus_dmamap_unload(sc->hn_tx_rndis_dtag, + txd->rndis_msg_dmap); + bus_dmamem_free(sc->hn_tx_rndis_dtag, + txd->rndis_msg, txd->rndis_msg_dmap); + return error; + } + + /* All set, put it to list */ + txd->flags |= HN_TXD_FLAG_ONLIST; + SLIST_INSERT_HEAD(&sc->hn_txlist, txd, link); + } + sc->hn_txdesc_avail = sc->hn_txdesc_cnt; + + return 0; +} + +static void +hn_destroy_tx_ring(struct hn_softc *sc) +{ + struct hn_txdesc *txd; + + while ((txd = SLIST_FIRST(&sc->hn_txlist)) != NULL) { + KASSERT(txd->m == NULL, ("still has mbuf installed")); + KASSERT((txd->flags & HN_TXD_FLAG_DMAMAP) == 0, + ("still dma mapped")); + SLIST_REMOVE_HEAD(&sc->hn_txlist, link); + + bus_dmamap_unload(sc->hn_tx_rndis_dtag, + txd->rndis_msg_dmap); + bus_dmamem_free(sc->hn_tx_rndis_dtag, + txd->rndis_msg, txd->rndis_msg_dmap); + + bus_dmamap_destroy(sc->hn_tx_data_dtag, txd->data_dmap); + } + + if (sc->hn_tx_data_dtag != NULL) + bus_dma_tag_destroy(sc->hn_tx_data_dtag); + if (sc->hn_tx_rndis_dtag != NULL) + bus_dma_tag_destroy(sc->hn_tx_rndis_dtag); + free(sc->hn_txdesc, M_NETVSC); + mtx_destroy(&sc->hn_txlist_spin); +} + static device_method_t netvsc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, netvsc_probe), Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Mon Jan 25 04:22:01 2016 (r294699) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Mon Jan 25 05:01:32 2016 (r294700) @@ -1050,6 +1050,7 @@ int netvsc_recv(struct hv_device *device netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info); void netvsc_recv_rollup(struct hv_device *device_ctx); +void netvsc_channel_rollup(struct hv_device *device_ctx); void* hv_set_rppi_data(rndis_msg *rndis_mesg, uint32_t rppi_size, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Jan 25 04:22:01 2016 (r294699) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Jan 25 05:01:32 2016 (r294700) @@ -974,3 +974,21 @@ hv_rf_receive_rollup(netvsc_dev *net_dev rndis_dev = (rndis_device *)net_dev->extension; netvsc_recv_rollup(rndis_dev->net_dev->dev); } + +void +hv_rf_channel_rollup(netvsc_dev *net_dev) +{ + rndis_device *rndis_dev; + + rndis_dev = (rndis_device *)net_dev->extension; + + /* + * This could be called pretty early, so we need + * to make sure everything has been setup. + */ + if (rndis_dev == NULL || + rndis_dev->net_dev == NULL || + rndis_dev->net_dev->dev == NULL) + return; + netvsc_channel_rollup(rndis_dev->net_dev->dev); +} Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Mon Jan 25 04:22:01 2016 (r294699) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Mon Jan 25 05:01:32 2016 (r294700) @@ -99,6 +99,7 @@ typedef struct rndis_device_ { int hv_rf_on_receive(netvsc_dev *net_dev, struct hv_device *device, netvsc_packet *pkt); void hv_rf_receive_rollup(netvsc_dev *net_dev); +void hv_rf_channel_rollup(netvsc_dev *net_dev); int hv_rf_on_device_add(struct hv_device *device, void *additl_info); int hv_rf_on_device_remove(struct hv_device *device, boolean_t destroy_channel); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Jan 25 05:12:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E457DA31F50; Mon, 25 Jan 2016 05:12:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4A814AD; Mon, 25 Jan 2016 05:12:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P5C0Se051181; Mon, 25 Jan 2016 05:12:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P5C0iF051180; Mon, 25 Jan 2016 05:12:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601250512.u0P5C0iF051180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Jan 2016 05:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294701 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 05:12:02 -0000 Author: sephe Date: Mon Jan 25 05:12:00 2016 New Revision: 294701 URL: https://svnweb.freebsd.org/changeset/base/294701 Log: hyperv/hn: Use m_copydata for chimney sending. While I'm here, move stack variables near their usage. Reviewed by: adrian, delphij, Jun Su Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4977 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:01:32 2016 (r294700) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:12:00 2016 (r294701) @@ -756,7 +756,6 @@ hn_start_locked(struct ifnet *ifp) struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); netvsc_dev *net_dev = sc->net_dev; netvsc_packet *packet; - struct mbuf *m_head, *m; struct ether_vlan_header *eh; rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; @@ -767,8 +766,6 @@ hn_start_locked(struct ifnet *ifp) int ether_len; uint32_t rndis_msg_size = 0; uint32_t trans_proto_type; - uint32_t send_buf_section_idx = - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) @@ -778,6 +775,7 @@ hn_start_locked(struct ifnet *ifp) bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; int error, nsegs, i, send_failed = 0; struct hn_txdesc *txd; + struct mbuf *m_head; IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) @@ -940,24 +938,21 @@ pre_send: /* send packet with send buffer */ if (packet->tot_data_buf_len < sc->hn_tx_chimney_size) { + uint32_t send_buf_section_idx; + send_buf_section_idx = hv_nv_get_next_send_section(net_dev); if (send_buf_section_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { - char *dest = ((char *)net_dev->send_buf + - send_buf_section_idx * - net_dev->send_section_size); + uint8_t *dest = ((uint8_t *)net_dev->send_buf + + (send_buf_section_idx * + net_dev->send_section_size)); memcpy(dest, rndis_mesg, rndis_msg_size); dest += rndis_msg_size; - for (m = m_head; m != NULL; m = m->m_next) { - if (m->m_len) { - memcpy(dest, - (void *)mtod(m, vm_offset_t), - m->m_len); - dest += m->m_len; - } - } + + m_copydata(m_head, 0, m_head->m_pkthdr.len, + dest); packet->send_buf_section_idx = send_buf_section_idx; From owner-svn-src-head@freebsd.org Mon Jan 25 05:18:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C92A45133; Mon, 25 Jan 2016 05:18:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BB721A3D; Mon, 25 Jan 2016 05:18:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P5IvdK052093; Mon, 25 Jan 2016 05:18:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P5IvkW052092; Mon, 25 Jan 2016 05:18:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601250518.u0P5IvkW052092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Jan 2016 05:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294702 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 05:18:58 -0000 Author: sephe Date: Mon Jan 25 05:18:57 2016 New Revision: 294702 URL: https://svnweb.freebsd.org/changeset/base/294702 Log: hyperv/hn: Remove unnecessary zeroing out the netvsc_packet All used fields are setup one by one, so there is no need to zero out this large struct. While I'm here, move the stack variable near its usage. Reviewed by: adrian, delphij, Jun Su Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4978 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:12:00 2016 (r294701) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:18:57 2016 (r294702) @@ -755,7 +755,6 @@ hn_start_locked(struct ifnet *ifp) hn_softc_t *sc = ifp->if_softc; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); netvsc_dev *net_dev = sc->net_dev; - netvsc_packet *packet; struct ether_vlan_header *eh; rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; @@ -775,6 +774,7 @@ hn_start_locked(struct ifnet *ifp) bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; int error, nsegs, i, send_failed = 0; struct hn_txdesc *txd; + netvsc_packet *packet; struct mbuf *m_head; IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); @@ -790,11 +790,7 @@ hn_start_locked(struct ifnet *ifp) } packet = &txd->netvsc_pkt; - /* XXX not necessary */ - memset(packet, 0, sizeof(*packet)); - packet->is_data_pkt = TRUE; - /* Initialize it from the mbuf */ packet->tot_data_buf_len = m_head->m_pkthdr.len; From owner-svn-src-head@freebsd.org Mon Jan 25 05:25:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE6AEA45478; Mon, 25 Jan 2016 05:25:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFA691F2D; Mon, 25 Jan 2016 05:25:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P5PdZV054809; Mon, 25 Jan 2016 05:25:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P5PdeY054808; Mon, 25 Jan 2016 05:25:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601250525.u0P5PdeY054808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Jan 2016 05:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294703 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 05:25:41 -0000 Author: sephe Date: Mon Jan 25 05:25:39 2016 New Revision: 294703 URL: https://svnweb.freebsd.org/changeset/base/294703 Log: hyperv/hn: Trust host TCP segment checksum verification by default. According to all available information, VMSWITCH always does the TCP segment checksum verification before sending the segment to guest. Reviewed by: adrian, delphij, Hongjiang Zhang Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4991 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:18:57 2016 (r294702) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:25:39 2016 (r294703) @@ -206,7 +206,7 @@ struct hn_txdesc { int hv_promisc_mode = 0; /* normal mode by default */ /* Trust tcp segements verification on host side. */ -static int hn_trust_hosttcp = 0; +static int hn_trust_hosttcp = 1; TUNABLE_INT("dev.hn.trust_hosttcp", &hn_trust_hosttcp); #if __FreeBSD_version >= 1100045 From owner-svn-src-head@freebsd.org Mon Jan 25 05:28:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CE28A4555A; Mon, 25 Jan 2016 05:28:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19BE4306; Mon, 25 Jan 2016 05:28:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P5SKWp054955; Mon, 25 Jan 2016 05:28:20 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P5SKhp054954; Mon, 25 Jan 2016 05:28:20 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601250528.u0P5SKhp054954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 25 Jan 2016 05:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294704 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 05:28:21 -0000 Author: melifaro Date: Mon Jan 25 05:28:19 2016 New Revision: 294704 URL: https://svnweb.freebsd.org/changeset/base/294704 Log: Remove unused radix_mpath definitions. Modified: head/sys/net/radix_mpath.h Modified: head/sys/net/radix_mpath.h ============================================================================== --- head/sys/net/radix_mpath.h Mon Jan 25 05:25:39 2016 (r294703) +++ head/sys/net/radix_mpath.h Mon Jan 25 05:28:19 2016 (r294704) @@ -51,10 +51,7 @@ struct rtentry *rt_mpath_matchgate(struc int rt_mpath_conflict(struct radix_node_head *, struct rtentry *, struct sockaddr *); void rtalloc_mpath_fib(struct route *, u_int32_t, u_int); -#define rtalloc_mpath(_route, _hash) rtalloc_mpath_fib((_route), (_hash), 0) struct rtentry *rt_mpath_select(struct rtentry *, uint32_t); -struct radix_node *rn_mpath_lookup(void *, void *, - struct radix_node_head *); int rt_mpath_deldup(struct rtentry *, struct rtentry *); int rn4_mpath_inithead(void **, int); int rn6_mpath_inithead(void **, int); From owner-svn-src-head@freebsd.org Mon Jan 25 05:33:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83B6BA45703; Mon, 25 Jan 2016 05:33:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 416348DE; Mon, 25 Jan 2016 05:33:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P5XIGO057742; Mon, 25 Jan 2016 05:33:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P5XISm057741; Mon, 25 Jan 2016 05:33:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601250533.u0P5XISm057741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Jan 2016 05:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294705 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 05:33:19 -0000 Author: sephe Date: Mon Jan 25 05:33:18 2016 New Revision: 294705 URL: https://svnweb.freebsd.org/changeset/base/294705 Log: hyperv/vmbus: Avoid extra copy of page information. The page information array could contain up to 32 elements (i.e. 512B). And on network side w/ TSO, 11+ (176B+) elements, i.e. ~44K TSO packet, in the page information array is quite common. This saves us some cpu cycles. Reviewed by: adrian, delphij Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4992 Modified: head/sys/dev/hyperv/vmbus/hv_channel.c Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Mon Jan 25 05:28:19 2016 (r294704) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Mon Jan 25 05:33:18 2016 (r294705) @@ -665,11 +665,11 @@ hv_vmbus_channel_send_packet_pagebuffer( { int ret = 0; - int i = 0; boolean_t need_sig; uint32_t packet_len; + uint32_t page_buflen; uint32_t packetLen_aligned; - hv_vmbus_sg_buffer_list buffer_list[3]; + hv_vmbus_sg_buffer_list buffer_list[4]; hv_vmbus_channel_packet_page_buffer desc; uint32_t descSize; uint64_t alignedData = 0; @@ -681,36 +681,33 @@ hv_vmbus_channel_send_packet_pagebuffer( * Adjust the size down since hv_vmbus_channel_packet_page_buffer * is the largest size we support */ - descSize = sizeof(hv_vmbus_channel_packet_page_buffer) - - ((HV_MAX_PAGE_BUFFER_COUNT - page_count) * - sizeof(hv_vmbus_page_buffer)); - packet_len = descSize + buffer_len; + descSize = __offsetof(hv_vmbus_channel_packet_page_buffer, range); + page_buflen = sizeof(hv_vmbus_page_buffer) * page_count; + packet_len = descSize + page_buflen + buffer_len; packetLen_aligned = HV_ALIGN_UP(packet_len, sizeof(uint64_t)); /* Setup the descriptor */ desc.type = HV_VMBUS_PACKET_TYPE_DATA_USING_GPA_DIRECT; desc.flags = HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED; - desc.data_offset8 = descSize >> 3; /* in 8-bytes granularity */ + /* in 8-bytes granularity */ + desc.data_offset8 = (descSize + page_buflen) >> 3; desc.length8 = (uint16_t) (packetLen_aligned >> 3); desc.transaction_id = request_id; desc.range_count = page_count; - for (i = 0; i < page_count; i++) { - desc.range[i].length = page_buffers[i].length; - desc.range[i].offset = page_buffers[i].offset; - desc.range[i].pfn = page_buffers[i].pfn; - } - buffer_list[0].data = &desc; buffer_list[0].length = descSize; - buffer_list[1].data = buffer; - buffer_list[1].length = buffer_len; + buffer_list[1].data = page_buffers; + buffer_list[1].length = page_buflen; - buffer_list[2].data = &alignedData; - buffer_list[2].length = packetLen_aligned - packet_len; + buffer_list[2].data = buffer; + buffer_list[2].length = buffer_len; - ret = hv_ring_buffer_write(&channel->outbound, buffer_list, 3, + buffer_list[3].data = &alignedData; + buffer_list[3].length = packetLen_aligned - packet_len; + + ret = hv_ring_buffer_write(&channel->outbound, buffer_list, 4, &need_sig); /* TODO: We should determine if this is optional */ From owner-svn-src-head@freebsd.org Mon Jan 25 06:33:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE68C79A8; Mon, 25 Jan 2016 06:33:17 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EB352DE; Mon, 25 Jan 2016 06:33:17 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P6XG3w075370; Mon, 25 Jan 2016 06:33:16 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P6XGfr075362; Mon, 25 Jan 2016 06:33:16 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601250633.u0P6XGfr075362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 25 Jan 2016 06:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294706 - in head/sys: kern net netinet netinet6 netpfil/ipfw netpfil/pf nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 06:33:18 -0000 Author: melifaro Date: Mon Jan 25 06:33:15 2016 New Revision: 294706 URL: https://svnweb.freebsd.org/changeset/base/294706 Log: MFP r287070,r287073: split radix implementation and route table structure. There are number of radix consumers in kernel land (pf,ipfw,nfs,route) with different requirements. In fact, first 3 don't have _any_ requirements and first 2 does not use radix locking. On the other hand, routing structure do have these requirements (rnh_gen, multipath, custom to-be-added control plane functions, different locking). Additionally, radix should not known anything about its consumers internals. So, radix code now uses tiny 'struct radix_head' structure along with internal 'struct radix_mask_head' instead of 'struct radix_node_head'. Existing consumers still uses the same 'struct radix_node_head' with slight modifications: they need to pass pointer to (embedded) 'struct radix_head' to all radix callbacks. Routing code now uses new 'struct rib_head' with different locking macro: RADIX_NODE_HEAD prefix was renamed to RIB_ (which stands for routing information base). New net/route_var.h header was added to hold routing subsystem internal data. 'struct rib_head' was placed there. 'struct rtentry' will also be moved there soon. Added: head/sys/net/route_var.h (contents, props changed) Modified: head/sys/kern/vfs_export.c head/sys/net/radix.c head/sys/net/radix.h head/sys/net/radix_mpath.c head/sys/net/radix_mpath.h head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/netinet/in_fib.c head/sys/netinet/in_rmx.c head/sys/netinet/in_var.h head/sys/netinet6/in6_fib.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6_rtr.c head/sys/netpfil/ipfw/ip_fw_table_algo.c head/sys/netpfil/pf/pf_table.c head/sys/nfs/bootp_subr.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Mon Jan 25 05:33:18 2016 (r294705) +++ head/sys/kern/vfs_export.c Mon Jan 25 06:33:15 2016 (r294706) @@ -199,7 +199,7 @@ vfs_hang_addrlist(struct mount *mp, stru goto out; } RADIX_NODE_HEAD_LOCK(rnh); - rn = (*rnh->rnh_addaddr)(saddr, smask, rnh, np->netc_rnodes); + rn = (*rnh->rnh_addaddr)(saddr, smask, &rnh->rh, np->netc_rnodes); RADIX_NODE_HEAD_UNLOCK(rnh); if (rn == NULL || np != (struct netcred *)rn) { /* already exists */ error = EPERM; @@ -231,7 +231,7 @@ vfs_free_netcred(struct radix_node *rn, struct radix_node_head *rnh = (struct radix_node_head *) w; struct ucred *cred; - (*rnh->rnh_deladdr) (rn->rn_key, rn->rn_mask, rnh); + (*rnh->rnh_deladdr) (rn->rn_key, rn->rn_mask, &rnh->rh); cred = ((struct netcred *)rn)->netc_anon; if (cred != NULL) crfree(cred); @@ -256,7 +256,7 @@ vfs_free_addrlist_af(struct radix_node_h rnh = *prnh; RADIX_NODE_HEAD_LOCK(rnh); - (*rnh->rnh_walktree) (rnh, vfs_free_netcred, rnh); + (*rnh->rnh_walktree)(&rnh->rh, vfs_free_netcred, &rnh->rh); RADIX_NODE_HEAD_UNLOCK(rnh); RADIX_NODE_HEAD_DESTROY(rnh); free(rnh, M_RTABLE); @@ -470,7 +470,7 @@ vfs_export_lookup(struct mount *mp, stru if (rnh != NULL) { RADIX_NODE_HEAD_RLOCK(rnh); np = (struct netcred *) - (*rnh->rnh_matchaddr)(saddr, rnh); + (*rnh->rnh_matchaddr)(saddr, &rnh->rh); RADIX_NODE_HEAD_RUNLOCK(rnh); if (np && np->netc_rnodes->rn_flags & RNF_ROOT) np = NULL; Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Mon Jan 25 05:33:18 2016 (r294705) +++ head/sys/net/radix.c Mon Jan 25 06:33:15 2016 (r294706) @@ -56,18 +56,15 @@ #include #endif /* !_KERNEL */ -static int rn_walktree_from(struct radix_node_head *h, void *a, void *m, - walktree_f_t *f, void *w); -static int rn_walktree(struct radix_node_head *, walktree_f_t *, void *); static struct radix_node - *rn_insert(void *, struct radix_node_head *, int *, + *rn_insert(void *, struct radix_head *, int *, struct radix_node [2]), *rn_newpair(void *, int, struct radix_node[2]), *rn_search(void *, struct radix_node *), *rn_search_m(void *, struct radix_node *, void *); +static struct radix_node *rn_addmask(void *, struct radix_mask_head *, int,int); -static void rn_detachhead_internal(void **head); -static int rn_inithead_internal(void **head, int off); +static void rn_detachhead_internal(struct radix_head *); #define RADIX_MAX_KEY_LEN 32 @@ -215,7 +212,7 @@ rn_refines(void *m_arg, void *n_arg) * from host routes. */ struct radix_node * -rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head) +rn_lookup(void *v_arg, void *m_arg, struct radix_head *head) { struct radix_node *x; caddr_t netmask; @@ -277,7 +274,7 @@ rn_satisfies_leaf(char *trial, struct ra * Search for longest-prefix match in given @head */ struct radix_node * -rn_match(void *v_arg, struct radix_node_head *head) +rn_match(void *v_arg, struct radix_head *head) { caddr_t v = v_arg; struct radix_node *t = head->rnh_treetop, *x; @@ -426,7 +423,7 @@ rn_newpair(void *v, int b, struct radix_ } static struct radix_node * -rn_insert(void *v_arg, struct radix_node_head *head, int *dupentry, +rn_insert(void *v_arg, struct radix_head *head, int *dupentry, struct radix_node nodes[2]) { caddr_t v = v_arg; @@ -490,7 +487,7 @@ on1: } struct radix_node * -rn_addmask(void *n_arg, struct radix_node_head *maskhead, int search, int skip) +rn_addmask(void *n_arg, struct radix_mask_head *maskhead, int search, int skip) { unsigned char *netmask = n_arg; unsigned char *cp, *cplim; @@ -505,7 +502,7 @@ rn_addmask(void *n_arg, struct radix_nod if (skip == 0) skip = 1; if (mlen <= skip) - return (maskhead->rnh_nodes); + return (maskhead->mask_nodes); bzero(addmask_key, RADIX_MAX_KEY_LEN); if (skip > 1) @@ -518,9 +515,9 @@ rn_addmask(void *n_arg, struct radix_nod cp--; mlen = cp - addmask_key; if (mlen <= skip) - return (maskhead->rnh_nodes); + return (maskhead->mask_nodes); *addmask_key = mlen; - x = rn_search(addmask_key, maskhead->rnh_treetop); + x = rn_search(addmask_key, maskhead->head.rnh_treetop); if (bcmp(addmask_key, x->rn_key, mlen) != 0) x = 0; if (x || search) @@ -530,7 +527,7 @@ rn_addmask(void *n_arg, struct radix_nod return (0); netmask = cp = (unsigned char *)(x + 2); bcopy(addmask_key, cp, mlen); - x = rn_insert(cp, maskhead, &maskduplicated, x); + x = rn_insert(cp, &maskhead->head, &maskduplicated, x); if (maskduplicated) { log(LOG_ERR, "rn_addmask: mask impossibly already in tree"); R_Free(saved_x); @@ -598,7 +595,7 @@ rn_new_radix_mask(struct radix_node *tt, } struct radix_node * -rn_addroute(void *v_arg, void *n_arg, struct radix_node_head *head, +rn_addroute(void *v_arg, void *n_arg, struct radix_head *head, struct radix_node treenodes[2]) { caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg; @@ -772,7 +769,7 @@ on2: } struct radix_node * -rn_delete(void *v_arg, void *netmask_arg, struct radix_node_head *head) +rn_delete(void *v_arg, void *netmask_arg, struct radix_head *head) { struct radix_node *t, *p, *x, *tt; struct radix_mask *m, *saved_m, **mp; @@ -959,8 +956,8 @@ out: * This is the same as rn_walktree() except for the parameters and the * exit. */ -static int -rn_walktree_from(struct radix_node_head *h, void *a, void *m, +int +rn_walktree_from(struct radix_head *h, void *a, void *m, walktree_f_t *f, void *w) { int error; @@ -1065,8 +1062,8 @@ rn_walktree_from(struct radix_node_head return (0); } -static int -rn_walktree(struct radix_node_head *h, walktree_f_t *f, void *w) +int +rn_walktree(struct radix_head *h, walktree_f_t *f, void *w) { int error; struct radix_node *base, *next; @@ -1105,75 +1102,76 @@ rn_walktree(struct radix_node_head *h, w } /* - * Allocate and initialize an empty tree. This has 3 nodes, which are - * part of the radix_node_head (in the order ) and are + * Initialize an empty tree. This has 3 nodes, which are passed + * via base_nodes (in the order ) and are * marked RNF_ROOT so they cannot be freed. * The leaves have all-zero and all-one keys, with significant * bits starting at 'off'. - * Return 1 on success, 0 on error. */ -static int -rn_inithead_internal(void **head, int off) +void +rn_inithead_internal(struct radix_head *rh, struct radix_node *base_nodes, int off) { - struct radix_node_head *rnh; struct radix_node *t, *tt, *ttt; - if (*head) - return (1); - R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh)); - if (rnh == 0) - return (0); - *head = rnh; - t = rn_newpair(rn_zeros, off, rnh->rnh_nodes); - ttt = rnh->rnh_nodes + 2; + + t = rn_newpair(rn_zeros, off, base_nodes); + ttt = base_nodes + 2; t->rn_right = ttt; t->rn_parent = t; - tt = t->rn_left; /* ... which in turn is rnh->rnh_nodes */ + tt = t->rn_left; /* ... which in turn is base_nodes */ tt->rn_flags = t->rn_flags = RNF_ROOT | RNF_ACTIVE; tt->rn_bit = -1 - off; *ttt = *tt; ttt->rn_key = rn_ones; - rnh->rnh_addaddr = rn_addroute; - rnh->rnh_deladdr = rn_delete; - rnh->rnh_matchaddr = rn_match; - rnh->rnh_lookup = rn_lookup; - rnh->rnh_walktree = rn_walktree; - rnh->rnh_walktree_from = rn_walktree_from; - rnh->rnh_treetop = t; - return (1); + + rh->rnh_treetop = t; } static void -rn_detachhead_internal(void **head) +rn_detachhead_internal(struct radix_head *head) { - struct radix_node_head *rnh; - KASSERT((head != NULL && *head != NULL), + KASSERT((head != NULL), ("%s: head already freed", __func__)); - rnh = *head; /* Free nodes. */ - R_Free(rnh); - - *head = NULL; + R_Free(head); } +/* Functions used by 'struct radix_node_head' users */ + int rn_inithead(void **head, int off) { struct radix_node_head *rnh; + struct radix_mask_head *rmh; + + rnh = *head; + rmh = NULL; if (*head != NULL) return (1); - if (rn_inithead_internal(head, off) == 0) + R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh)); + R_Zalloc(rmh, struct radix_mask_head *, sizeof (*rmh)); + if (rnh == NULL || rmh == NULL) { + if (rnh != NULL) + R_Free(rnh); return (0); + } - rnh = (struct radix_node_head *)(*head); + /* Init trees */ + rn_inithead_internal(&rnh->rh, rnh->rnh_nodes, off); + rn_inithead_internal(&rmh->head, rmh->mask_nodes, 0); + *head = rnh; + rnh->rh.rnh_masks = rmh; - if (rn_inithead_internal((void **)&rnh->rnh_masks, 0) == 0) { - rn_detachhead_internal(head); - return (0); - } + /* Finally, set base callbacks */ + rnh->rnh_addaddr = rn_addroute; + rnh->rnh_deladdr = rn_delete; + rnh->rnh_matchaddr = rn_match; + rnh->rnh_lookup = rn_lookup; + rnh->rnh_walktree = rn_walktree; + rnh->rnh_walktree_from = rn_walktree_from; return (1); } @@ -1181,7 +1179,7 @@ rn_inithead(void **head, int off) static int rn_freeentry(struct radix_node *rn, void *arg) { - struct radix_node_head * const rnh = arg; + struct radix_head * const rnh = arg; struct radix_node *x; x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh); @@ -1198,11 +1196,14 @@ rn_detachhead(void **head) KASSERT((head != NULL && *head != NULL), ("%s: head already freed", __func__)); - rnh = *head; + rnh = (struct radix_node_head *)(*head); + + rn_walktree(&rnh->rh.rnh_masks->head, rn_freeentry, rnh->rh.rnh_masks); + rn_detachhead_internal(&rnh->rh.rnh_masks->head); + rn_detachhead_internal(&rnh->rh); + + *head = NULL; - rn_walktree(rnh->rnh_masks, rn_freeentry, rnh->rnh_masks); - rn_detachhead_internal((void **)&rnh->rnh_masks); - rn_detachhead_internal(head); return (1); } Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Mon Jan 25 05:33:18 2016 (r294705) +++ head/sys/net/radix.h Mon Jan 25 06:33:15 2016 (r294706) @@ -101,35 +101,53 @@ struct radix_mask { #define rm_mask rm_rmu.rmu_mask #define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */ +struct radix_head; + typedef int walktree_f_t(struct radix_node *, void *); +typedef struct radix_node *rn_matchaddr_f_t(void *v, + struct radix_head *head); +typedef struct radix_node *rn_addaddr_f_t(void *v, void *mask, + struct radix_head *head, struct radix_node nodes[]); +typedef struct radix_node *rn_deladdr_f_t(void *v, void *mask, + struct radix_head *head); +typedef struct radix_node *rn_lookup_f_t(void *v, void *mask, + struct radix_head *head); +typedef int rn_walktree_t(struct radix_head *head, walktree_f_t *f, + void *w); +typedef int rn_walktree_from_t(struct radix_head *head, + void *a, void *m, walktree_f_t *f, void *w); +typedef void rn_close_t(struct radix_node *rn, struct radix_head *head); -struct radix_node_head { +struct radix_mask_head; + +struct radix_head { struct radix_node *rnh_treetop; - u_int rnh_gen; /* generation counter */ - int rnh_multipath; /* multipath capable ? */ - struct radix_node *(*rnh_addaddr) /* add based on sockaddr */ - (void *v, void *mask, - struct radix_node_head *head, struct radix_node nodes[]); - struct radix_node *(*rnh_deladdr) /* remove based on sockaddr */ - (void *v, void *mask, struct radix_node_head *head); - struct radix_node *(*rnh_matchaddr) /* longest match for sockaddr */ - (void *v, struct radix_node_head *head); - struct radix_node *(*rnh_lookup) /*exact match for sockaddr*/ - (void *v, void *mask, struct radix_node_head *head); - int (*rnh_walktree) /* traverse tree */ - (struct radix_node_head *head, walktree_f_t *f, void *w); - int (*rnh_walktree_from) /* traverse tree below a */ - (struct radix_node_head *head, void *a, void *m, - walktree_f_t *f, void *w); - void (*rnh_close) /* do something when the last ref drops */ - (struct radix_node *rn, struct radix_node_head *head); + struct radix_mask_head *rnh_masks; /* Storage for our masks */ +}; + +struct radix_node_head { + struct radix_head rh; + rn_matchaddr_f_t *rnh_matchaddr; /* longest match for sockaddr */ + rn_addaddr_f_t *rnh_addaddr; /* add based on sockaddr*/ + rn_deladdr_f_t *rnh_deladdr; /* remove based on sockaddr */ + rn_lookup_f_t *rnh_lookup; /* exact match for sockaddr */ + rn_walktree_t *rnh_walktree; /* traverse tree */ + rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */ + rn_close_t *rnh_close; /*do something when the last ref drops*/ struct radix_node rnh_nodes[3]; /* empty tree for common case */ - struct radix_node_head *rnh_masks; /* Storage for our masks */ #ifdef _KERNEL struct rwlock rnh_lock; /* locks entire radix tree */ #endif }; +struct radix_mask_head { + struct radix_head head; + struct radix_node mask_nodes[3]; +}; + +void rn_inithead_internal(struct radix_head *rh, struct radix_node *base_nodes, + int off); + #ifndef _KERNEL #define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n))) #define R_Zalloc(p, t, n) (p = (t) calloc(1,(unsigned int)(n))) @@ -156,13 +174,14 @@ struct radix_node_head { int rn_inithead(void **, int); int rn_detachhead(void **); int rn_refines(void *, void *); -struct radix_node - *rn_addmask(void *, struct radix_node_head *, int, int), - *rn_addroute (void *, void *, struct radix_node_head *, - struct radix_node [2]), - *rn_delete(void *, void *, struct radix_node_head *), - *rn_lookup (void *v_arg, void *m_arg, - struct radix_node_head *head), - *rn_match(void *, struct radix_node_head *); +struct radix_node *rn_addroute(void *, void *, struct radix_head *, + struct radix_node[2]); +struct radix_node *rn_delete(void *, void *, struct radix_head *); +struct radix_node *rn_lookup (void *v_arg, void *m_arg, + struct radix_head *head); +struct radix_node *rn_match(void *, struct radix_head *); +int rn_walktree_from(struct radix_head *h, void *a, void *m, + walktree_f_t *f, void *w); +int rn_walktree(struct radix_head *, walktree_f_t *, void *); #endif /* _RADIX_H_ */ Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Mon Jan 25 05:33:18 2016 (r294705) +++ head/sys/net/radix_mpath.c Mon Jan 25 06:33:15 2016 (r294706) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -57,12 +58,19 @@ __FBSDID("$FreeBSD$"); static uint32_t hashjitter; int -rn_mpath_capable(struct radix_node_head *rnh) +rt_mpath_capable(struct rib_head *rnh) { return rnh->rnh_multipath; } +int +rn_mpath_capable(struct radix_head *rh) +{ + + return (rt_mpath_capable((struct rib_head *)rh)); +} + struct radix_node * rn_mpath_next(struct radix_node *rn) { @@ -159,14 +167,14 @@ rt_mpath_deldup(struct rtentry *headrt, * Assume @rt rt_key host bits are cleared according to @netmask */ int -rt_mpath_conflict(struct radix_node_head *rnh, struct rtentry *rt, +rt_mpath_conflict(struct rib_head *rnh, struct rtentry *rt, struct sockaddr *netmask) { struct radix_node *rn, *rn1; struct rtentry *rt1; rn = (struct radix_node *)rt; - rn1 = rnh->rnh_lookup(rt_key(rt), netmask, rnh); + rn1 = rnh->rnh_lookup(rt_key(rt), netmask, &rnh->head); if (!rn1 || rn1->rn_flags & RNF_ROOT) return (0); @@ -284,11 +292,11 @@ extern int in_inithead(void **head, int int rn4_mpath_inithead(void **head, int off) { - struct radix_node_head *rnh; + struct rib_head *rnh; hashjitter = arc4random(); if (in_inithead(head, off) == 1) { - rnh = (struct radix_node_head *)*head; + rnh = (struct rib_head *)*head; rnh->rnh_multipath = 1; return 1; } else @@ -300,11 +308,11 @@ rn4_mpath_inithead(void **head, int off) int rn6_mpath_inithead(void **head, int off) { - struct radix_node_head *rnh; + struct rib_head *rnh; hashjitter = arc4random(); if (in6_inithead(head, off) == 1) { - rnh = (struct radix_node_head *)*head; + rnh = (struct rib_head *)*head; rnh->rnh_multipath = 1; return 1; } else Modified: head/sys/net/radix_mpath.h ============================================================================== --- head/sys/net/radix_mpath.h Mon Jan 25 05:33:18 2016 (r294705) +++ head/sys/net/radix_mpath.h Mon Jan 25 06:33:15 2016 (r294706) @@ -44,11 +44,13 @@ struct route; struct rtentry; struct sockaddr; -int rn_mpath_capable(struct radix_node_head *); +struct rib_head; +int rt_mpath_capable(struct rib_head *); +int rn_mpath_capable(struct radix_head *); struct radix_node *rn_mpath_next(struct radix_node *); u_int32_t rn_mpath_count(struct radix_node *); struct rtentry *rt_mpath_matchgate(struct rtentry *, struct sockaddr *); -int rt_mpath_conflict(struct radix_node_head *, struct rtentry *, +int rt_mpath_conflict(struct rib_head *, struct rtentry *, struct sockaddr *); void rtalloc_mpath_fib(struct route *, u_int32_t, u_int); struct rtentry *rt_mpath_select(struct rtentry *, uint32_t); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jan 25 05:33:18 2016 (r294705) +++ head/sys/net/route.c Mon Jan 25 06:33:15 2016 (r294706) @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -114,7 +115,7 @@ SYSCTL_UINT(_net, OID_AUTO, add_addr_all VNET_DEFINE(struct rtstat, rtstat); #define V_rtstat VNET(rtstat) -VNET_DEFINE(struct radix_node_head *, rt_tables); +VNET_DEFINE(struct rib_head *, rt_tables); #define V_rt_tables VNET(rt_tables) VNET_DEFINE(int, rttrash); /* routes not in table but not freed */ @@ -136,15 +137,15 @@ VNET_DEFINE(int, rttrash); /* routes no static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) -static int rtrequest1_fib_change(struct radix_node_head *, struct rt_addrinfo *, +static int rtrequest1_fib_change(struct rib_head *, struct rt_addrinfo *, struct rtentry **, u_int); static void rt_setmetrics(const struct rt_addrinfo *, struct rtentry *); static int rt_ifdelroute(const struct rtentry *rt, void *arg); -static struct rtentry *rt_unlinkrte(struct radix_node_head *rnh, +static struct rtentry *rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror); static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info); #ifdef RADIX_MPATH -static struct radix_node *rt_mpath_unlink(struct radix_node_head *rnh, +static struct radix_node *rt_mpath_unlink(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry *rto, int *perror); #endif static int rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, @@ -175,10 +176,10 @@ sysctl_my_fibnum(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net, OID_AUTO, my_fibnum, CTLTYPE_INT|CTLFLAG_RD, NULL, 0, &sysctl_my_fibnum, "I", "default FIB of caller"); -static __inline struct radix_node_head ** +static __inline struct rib_head ** rt_tables_get_rnh_ptr(int table, int fam) { - struct radix_node_head **rnh; + struct rib_head **rnh; KASSERT(table >= 0 && table < rt_numfibs, ("%s: table out of bounds.", __func__)); @@ -186,14 +187,14 @@ rt_tables_get_rnh_ptr(int table, int fam __func__)); /* rnh is [fib=0][af=0]. */ - rnh = (struct radix_node_head **)V_rt_tables; + rnh = (struct rib_head **)V_rt_tables; /* Get the offset to the requested table and fam. */ rnh += table * (AF_MAX+1) + fam; return (rnh); } -struct radix_node_head * +struct rib_head * rt_tables_get_rnh(int table, int fam) { @@ -263,12 +264,12 @@ static void vnet_route_init(const void *unused __unused) { struct domain *dom; - struct radix_node_head **rnh; + struct rib_head **rnh; int table; int fam; V_rt_tables = malloc(rt_numfibs * (AF_MAX+1) * - sizeof(struct radix_node_head *), M_RTABLE, M_WAITOK|M_ZERO); + sizeof(struct rib_head *), M_RTABLE, M_WAITOK|M_ZERO); V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), rtentry_ctor, rtentry_dtor, @@ -299,7 +300,7 @@ vnet_route_uninit(const void *unused __u int table; int fam; struct domain *dom; - struct radix_node_head **rnh; + struct rib_head **rnh; for (dom = domains; dom; dom = dom->dom_next) { if (dom->dom_rtdetach == NULL) @@ -325,6 +326,43 @@ VNET_SYSUNINIT(vnet_route_uninit, SI_SUB vnet_route_uninit, 0); #endif +struct rib_head * +rt_table_init(int offset) +{ + struct rib_head *rh; + + rh = malloc(sizeof(struct rib_head), M_RTABLE, M_WAITOK | M_ZERO); + + /* TODO: These details should be hidded inside radix.c */ + /* Init masks tree */ + rn_inithead_internal(&rh->head, rh->rnh_nodes, offset); + rn_inithead_internal(&rh->rmhead.head, rh->rmhead.mask_nodes, 0); + rh->head.rnh_masks = &rh->rmhead; + + /* Init locks */ + rw_init(&rh->rib_lock, "rib head lock"); + + /* Finally, set base callbacks */ + rh->rnh_addaddr = rn_addroute; + rh->rnh_deladdr = rn_delete; + rh->rnh_matchaddr = rn_match; + rh->rnh_lookup = rn_lookup; + rh->rnh_walktree = rn_walktree; + rh->rnh_walktree_from = rn_walktree_from; + + return (rh); +} + +void +rt_table_destroy(struct rib_head *rh) +{ + + /* Assume table is already empty */ + rw_destroy(&rh->rib_lock); + free(rh, M_RTABLE); +} + + #ifndef _SYS_SYSPROTO_H_ struct setfib_args { int fibnum; @@ -375,32 +413,32 @@ struct rtentry * rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags, u_int fibnum) { - struct radix_node_head *rnh; + struct rib_head *rh; struct radix_node *rn; struct rtentry *newrt; struct rt_addrinfo info; int err = 0, msgtype = RTM_MISS; KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); - rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + rh = rt_tables_get_rnh(fibnum, dst->sa_family); newrt = NULL; - if (rnh == NULL) + if (rh == NULL) goto miss; /* * Look up the address in the table for that Address Family */ - RADIX_NODE_HEAD_RLOCK(rnh); - rn = rnh->rnh_matchaddr(dst, rnh); + RIB_RLOCK(rh); + rn = rh->rnh_matchaddr(dst, &rh->head); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { newrt = RNTORT(rn); RT_LOCK(newrt); RT_ADDREF(newrt); - RADIX_NODE_HEAD_RUNLOCK(rnh); + RIB_RUNLOCK(rh); return (newrt); } else - RADIX_NODE_HEAD_RUNLOCK(rnh); + RIB_RUNLOCK(rh); /* * Either we hit the root or couldn't find any match, @@ -430,7 +468,7 @@ miss: void rtfree(struct rtentry *rt) { - struct radix_node_head *rnh; + struct rib_head *rnh; KASSERT(rt != NULL,("%s: NULL rt", __func__)); rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); @@ -458,7 +496,7 @@ rtfree(struct rtentry *rt) * on the entry so that the code below reclaims the storage. */ if (rt->rt_refcnt == 0 && rnh->rnh_close) - rnh->rnh_close((struct radix_node *)rt, rnh); + rnh->rnh_close((struct radix_node *)rt, &rnh->head); /* * If we are no longer "up" (and ref == 0) @@ -522,7 +560,7 @@ rtredirect_fib(struct sockaddr *dst, short *stat = NULL; struct rt_addrinfo info; struct ifaddr *ifa; - struct radix_node_head *rnh; + struct rib_head *rnh; ifa = NULL; rnh = rt_tables_get_rnh(fibnum, dst->sa_family); @@ -608,10 +646,10 @@ rtredirect_fib(struct sockaddr *dst, * add the key and gateway (in one malloc'd chunk). */ RT_UNLOCK(rt); - RADIX_NODE_HEAD_LOCK(rnh); + RIB_WLOCK(rnh); RT_LOCK(rt); rt_setgate(rt, rt_key(rt), gateway); - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WUNLOCK(rnh); } } else error = EHOSTUNREACH; @@ -853,7 +891,7 @@ int rib_lookup_info(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, uint32_t flowid, struct rt_addrinfo *info) { - struct radix_node_head *rh; + struct rib_head *rh; struct radix_node *rn; struct rtentry *rt; int error; @@ -863,20 +901,20 @@ rib_lookup_info(uint32_t fibnum, const s if (rh == NULL) return (ENOENT); - RADIX_NODE_HEAD_RLOCK(rh); - rn = rh->rnh_matchaddr(__DECONST(void *, dst), rh); + RIB_RLOCK(rh); + rn = rh->rnh_matchaddr(__DECONST(void *, dst), &rh->head); if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { rt = RNTORT(rn); /* Ensure route & ifp is UP */ if (RT_LINK_IS_UP(rt->rt_ifp)) { flags = (flags & NHR_REF) | NHR_COPY; error = rt_exportinfo(rt, info, flags); - RADIX_NODE_HEAD_RUNLOCK(rh); + RIB_RUNLOCK(rh); return (error); } } - RADIX_NODE_HEAD_RUNLOCK(rh); + RIB_RUNLOCK(rh); return (ENOENT); } @@ -903,7 +941,7 @@ void rt_foreach_fib_walk(int af, rt_setwarg_t *setwa_f, rt_walktree_f_t *wa_f, void *arg) { - struct radix_node_head *rnh; + struct rib_head *rnh; uint32_t fibnum; int i; @@ -916,9 +954,9 @@ rt_foreach_fib_walk(int af, rt_setwarg_t if (setwa_f != NULL) setwa_f(rnh, fibnum, af, arg); - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, (walktree_f_t *)wa_f, arg); - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WLOCK(rnh); + rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f,arg); + RIB_WUNLOCK(rnh); continue; } @@ -929,9 +967,9 @@ rt_foreach_fib_walk(int af, rt_setwarg_t if (setwa_f != NULL) setwa_f(rnh, fibnum, i, arg); - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, (walktree_f_t *)wa_f, arg); - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WLOCK(rnh); + rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f,arg); + RIB_WUNLOCK(rnh); } } } @@ -939,7 +977,7 @@ rt_foreach_fib_walk(int af, rt_setwarg_t struct rt_delinfo { struct rt_addrinfo info; - struct radix_node_head *rnh; + struct rib_head *rnh; struct rtentry *head; }; @@ -987,7 +1025,7 @@ rt_checkdelroute(struct radix_node *rn, void rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg) { - struct radix_node_head *rnh; + struct rib_head *rnh; struct rt_delinfo di; struct rtentry *rt; uint32_t fibnum; @@ -1013,9 +1051,9 @@ rt_foreach_fib_walk_del(int af, rt_filte continue; di.rnh = rnh; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, rt_checkdelroute, &di); - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WLOCK(rnh); + rnh->rnh_walktree(&rnh->head, rt_checkdelroute, &di); + RIB_WUNLOCK(rnh); if (di.head == NULL) continue; @@ -1092,7 +1130,7 @@ rt_flushifroutes(struct ifnet *ifp) * ENOENT - if supplied filter function returned 0 (not matched). */ static struct rtentry * -rt_unlinkrte(struct radix_node_head *rnh, struct rt_addrinfo *info, int *perror) +rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror) { struct sockaddr *dst, *netmask; struct rtentry *rt; @@ -1101,7 +1139,7 @@ rt_unlinkrte(struct radix_node_head *rnh dst = info->rti_info[RTAX_DST]; netmask = info->rti_info[RTAX_NETMASK]; - rt = (struct rtentry *)rnh->rnh_lookup(dst, netmask, rnh); + rt = (struct rtentry *)rnh->rnh_lookup(dst, netmask, &rnh->head); if (rt == NULL) { *perror = ESRCH; return (NULL); @@ -1136,11 +1174,11 @@ rt_unlinkrte(struct radix_node_head *rnh */ *perror = ESRCH; #ifdef RADIX_MPATH - if (rn_mpath_capable(rnh)) + if (rt_mpath_capable(rnh)) rn = rt_mpath_unlink(rnh, info, rt, perror); else #endif - rn = rnh->rnh_deladdr(dst, netmask, rnh); + rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); if (rn == NULL) return (NULL); @@ -1273,7 +1311,7 @@ void rt_updatemtu(struct ifnet *ifp) { struct if_mtuinfo ifmtu; - struct radix_node_head *rnh; + struct rib_head *rnh; int i, j; ifmtu.ifp = ifp; @@ -1289,9 +1327,9 @@ rt_updatemtu(struct ifnet *ifp) rnh = rt_tables_get_rnh(j, i); if (rnh == NULL) continue; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, if_updatemtu_cb, &ifmtu); - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WLOCK(rnh); + rnh->rnh_walktree(&rnh->head, if_updatemtu_cb, &ifmtu); + RIB_WUNLOCK(rnh); } } } @@ -1357,7 +1395,7 @@ rt_print(char *buf, int buflen, struct r * and sets @perror to ESRCH. */ static struct radix_node * -rt_mpath_unlink(struct radix_node_head *rnh, struct rt_addrinfo *info, +rt_mpath_unlink(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry *rto, int *perror) { /* @@ -1409,7 +1447,7 @@ rt_mpath_unlink(struct radix_node_head * * use the normal delete code to remove * the first entry */ - rn = rnh->rnh_deladdr(dst, netmask, rnh); + rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); *perror = 0; return (rn); } @@ -1427,7 +1465,7 @@ rt_mpath_unlink(struct radix_node_head * #ifdef FLOWTABLE static struct rtentry * -rt_flowtable_check_route(struct radix_node_head *rnh, struct rt_addrinfo *info) +rt_flowtable_check_route(struct rib_head *rnh, struct rt_addrinfo *info) { #if defined(INET6) || defined(INET) struct radix_node *rn; @@ -1499,7 +1537,7 @@ rtrequest1_fib(int req, struct rt_addrin struct rtentry *rt0; #endif struct radix_node *rn; - struct radix_node_head *rnh; + struct rib_head *rnh; struct ifaddr *ifa; struct sockaddr *ndst; struct sockaddr_storage mdst; @@ -1537,9 +1575,9 @@ rtrequest1_fib(int req, struct rt_addrin dst = (struct sockaddr *)&mdst; } - RADIX_NODE_HEAD_LOCK(rnh); + RIB_WLOCK(rnh); rt = rt_unlinkrte(rnh, info, &error); - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WUNLOCK(rnh); if (error != 0) return (error); @@ -1616,13 +1654,13 @@ rtrequest1_fib(int req, struct rt_addrin rt_setmetrics(info, rt); - RADIX_NODE_HEAD_LOCK(rnh); + RIB_WLOCK(rnh); RT_LOCK(rt); #ifdef RADIX_MPATH /* do not permit exactly the same dst/mask/gw pair */ - if (rn_mpath_capable(rnh) && + if (rt_mpath_capable(rnh) && rt_mpath_conflict(rnh, rt, netmask)) { - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WUNLOCK(rnh); ifa_free(rt->rt_ifa); R_Free(rt_key(rt)); @@ -1636,7 +1674,7 @@ rtrequest1_fib(int req, struct rt_addrin #endif /* FLOWTABLE */ /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ - rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes); + rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); rt_old = NULL; if (rn == NULL && (info->rti_flags & RTF_PINNED) != 0) { @@ -1653,10 +1691,10 @@ rtrequest1_fib(int req, struct rt_addrin info->rti_flags |= RTF_PINNED; info->rti_info[RTAX_DST] = info_dst; if (rt_old != NULL) - rn = rnh->rnh_addaddr(ndst, netmask, rnh, + rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); } - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WUNLOCK(rnh); if (rt_old != NULL) RT_UNLOCK(rt_old); @@ -1705,9 +1743,9 @@ rtrequest1_fib(int req, struct rt_addrin RT_UNLOCK(rt); break; case RTM_CHANGE: - RADIX_NODE_HEAD_LOCK(rnh); + RIB_WLOCK(rnh); error = rtrequest1_fib_change(rnh, info, ret_nrt, fibnum); - RADIX_NODE_HEAD_UNLOCK(rnh); + RIB_WUNLOCK(rnh); break; default: error = EOPNOTSUPP; @@ -1724,7 +1762,7 @@ rtrequest1_fib(int req, struct rt_addrin #undef flags static int -rtrequest1_fib_change(struct radix_node_head *rnh, struct rt_addrinfo *info, +rtrequest1_fib_change(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry **ret_nrt, u_int fibnum) { struct rtentry *rt = NULL; @@ -1734,7 +1772,7 @@ rtrequest1_fib_change(struct radix_node_ struct if_mtuinfo ifmtu; rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], - info->rti_info[RTAX_NETMASK], rnh); + info->rti_info[RTAX_NETMASK], &rnh->head); if (rt == NULL) return (ESRCH); @@ -1744,7 +1782,7 @@ rtrequest1_fib_change(struct radix_node_ * If we got multipath routes, * we require users to specify a matching RTAX_GATEWAY. */ - if (rn_mpath_capable(rnh)) { + if (rt_mpath_capable(rnh)) { rt = rt_mpath_matchgate(rt, info->rti_info[RTAX_GATEWAY]); if (rt == NULL) return (ESRCH); @@ -1935,7 +1973,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int int didwork = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Jan 25 06:58:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D75FA450E4; Mon, 25 Jan 2016 06:58:43 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [IPv6:2607:f8b0:4003:c01::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 01DBEE54; Mon, 25 Jan 2016 06:58:43 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-ob0-x22c.google.com with SMTP id zv1so7544425obb.2; Sun, 24 Jan 2016 22:58:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=2/hslY4Lv1WVqeE4ojQaNfI0D9ABCaHbl26faoBCjx8=; b=d+yeBLpCkmHd2mMdim4OrPNTLz7QRyxX6n0ng4jKKbToaVe5odFACqSMkzL10Dzdii I+hkFkaKi+j2wdPbONFOaocA8FRdRPdkv507JbtE2PPRqIbaNkBZgRKnhQ6QmHLYFZZ5 /rLTuoypB1UiEW9tkBTzuzUfjRiRaCLptHCgb9g/2AGlZFDGG7MDnOf6DOctWlJWbA8n N7A2qqXKCw2SDTgVvc8RnhEUyn9t7dS15JzGrPdBuclBgt/z9/pw9Kf0US4uH0vzLM3S pyK7c/Fwcm4qimO17EUx4n3sV3dZX+sLbixjWUbApLEGmm/WCSSS61brhyewLTWxrqkN 5xvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=2/hslY4Lv1WVqeE4ojQaNfI0D9ABCaHbl26faoBCjx8=; b=gCIMJv/VT2kY3exIIlk9t7lE1O4ik2C3CW0IDzgCKxHelQN0le69PgudGkwNq0SuPs liepvhp612wrAEeYvNsxi40pDZGCXNb+Zt3c9lBWUYT8kXFZThnaSC093oQYBRacLlQU cHz+5eXUANP2coRrT4w18sDpRKN/VLGRVDLb+VQ0evwt3zwMiH4GFsRyAD6YJAe4w+xH wUUBWe8GrX4RylTqRT9dBHB3r4Gwm1SDfXsy+D7f0Fj5vyihTWRSv1NUXUQI1JlzANhl UZozP2hWVj8aDv9uLLFkuXkpNLckfHk6NteKXQua/YuUHL/8IE9jraczBL1a867G8iMq O0kA== X-Gm-Message-State: AG10YOSOHIVy3itwesoL697URIDVlLLzDB6fJv2UZJLqEGgjcY4N/hky1ure/QPN5e0f3NI5vfVH0hzmCfP/MQ== MIME-Version: 1.0 X-Received: by 10.60.81.103 with SMTP id z7mr12276463oex.59.1453705122207; Sun, 24 Jan 2016 22:58:42 -0800 (PST) Received: by 10.182.40.194 with HTTP; Sun, 24 Jan 2016 22:58:42 -0800 (PST) Reply-To: araujo@FreeBSD.org In-Reply-To: References: <201601130149.u0D1nZmI053966@repo.freebsd.org> Date: Mon, 25 Jan 2016 14:58:42 +0800 Message-ID: Subject: Re: svn commit: r293801 - in head: . etc share/examples/ypldap usr.sbin/ypldap From: Marcelo Araujo To: Antoine Brodin Cc: "src-committers@freebsd.org" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 06:58:43 -0000 Thanks to point it out! I have sent a patch for review and approve. Best, 2016-01-24 21:58 GMT+08:00 Antoine Brodin : > > On Jan 13, 2016 2:49 AM, "Marcelo Araujo" wrote: > > > > Author: araujo > > Date: Wed Jan 13 01:49:35 2016 > > New Revision: 293801 > > URL: https://svnweb.freebsd.org/changeset/base/293801 > > > > Log: > > ypldap(8) is a feature ready to be used to translate nis(8) database > to ldap(3). > > > > This commit, fix a core dump on ypldap(8) related with memory > allocation. > > Also an example of how to set the ypldap.conf(5) properly is added to > > examples files. > > > > A new user _ypldap is required to be able to run ypldap(8) as well as > > in a chroot mode. > > > > Reviewed by: rodrigc (mentor), bjk > > Approved by: bapt (mentor) > > Relnotes: Yes > > Sponsored by: gandi.net > > Differential Revision: https://reviews.freebsd.org/D4744 > > > > Hi, > > Uid 93 is already used in the ports tree by jabber. (/usr/ports/UIDs) > > Cheers, > > Antoine > > > Added: > > head/share/examples/ypldap/ > > head/share/examples/ypldap/ypldap.conf (contents, props changed) > > Modified: > > head/UPDATING > > head/etc/master.passwd > > head/usr.sbin/ypldap/yp.c > > head/usr.sbin/ypldap/ypldap.conf.5 > > > > Modified: head/UPDATING > > > ============================================================================== > > --- head/UPDATING Wed Jan 13 01:32:04 2016 (r293800) > > +++ head/UPDATING Wed Jan 13 01:49:35 2016 (r293801) > > @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > > disable the most expensive debugging functionality run > > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > +20160113: > > + With the addition of ypldap(8), a new _ypldap user is now > required > > + during installworld. "mergemaster -p" can be used to add the user > > + prior to installworld, as documented in the handbook. > > + > > 20151216: > > The tftp loader (pxeboot) now uses the option root-path > directive. As a > > consequence it no longer looks for a pxeboot.4th file on the tftp > > > > Modified: head/etc/master.passwd > > > ============================================================================== > > --- head/etc/master.passwd Wed Jan 13 01:32:04 2016 (r293800) > > +++ head/etc/master.passwd Wed Jan 13 01:49:35 2016 (r293801) > > @@ -22,5 +22,6 @@ uucp:*:66:66::0:0:UUCP pseudo-user:/var/ > > pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin > > auditdistd:*:78:77::0:0:Auditdistd unprivileged > user:/var/empty:/usr/sbin/nologin > > www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin > > +_ypldap:*:93:93::0:0:YP Ldap unprivileged > user:/var/empty:/usr/sbin/nologin > > hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin > > nobody:*:65534:65534::0:0:Unprivileged > user:/nonexistent:/usr/sbin/nologin > > > > Added: head/share/examples/ypldap/ypldap.conf > > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/share/examples/ypldap/ypldap.conf Wed Jan 13 01:49:35 > 2016 (r293801) > > @@ -0,0 +1,40 @@ > > +$FreeBSD$ > > +domain "freebsd.org" > > +interval 60 > > +provide map "passwd.byname" > > +provide map "passwd.byuid" > > +provide map "group.byname" > > +provide map "group.bygid" > > +provide map "netid.byname" > > + > > +directory "127.0.0.1" { > > + # directory options > > + binddn "cn=ldap,dc=freebsd,dc=org" > > + bindcred "secret" > > + basedn "dc=freebsd.,dc=org" > > + # starting point for groups directory search, default to basedn > > + groupdn "ou=Groups,dc=freebsd,dc=org" > > + > > + # passwd maps configuration (RFC 2307 posixAccount object class) > > + passwd filter "(objectClass=posixAccount)" > > + > > + attribute name maps to "uid" > > + fixed attribute passwd "*" > > + attribute uid maps to "uidNumber" > > + attribute gid maps to "gidNumber" > > + attribute gecos maps to "cn" > > + attribute home maps to "homeDirectory" > > + attribute shell maps to "loginShell" > > + fixed attribute change "0" > > + fixed attribute expire "0" > > + fixed attribute class "" > > + > > + # group maps configuration (RFC 2307 posixGroup object class) > > + group filter "(objectClass=posixGroup)" > > + > > + attribute groupname maps to "cn" > > + fixed attribute grouppasswd "*" > > + attribute groupgid maps to "gidNumber" > > + # memberUid returns multiple group members > > + list groupmembers maps to "memberUid" > > +} > > > > Modified: head/usr.sbin/ypldap/yp.c > > > ============================================================================== > > --- head/usr.sbin/ypldap/yp.c Wed Jan 13 01:32:04 2016 (r293800) > > +++ head/usr.sbin/ypldap/yp.c Wed Jan 13 01:49:35 2016 (r293801) > > @@ -83,10 +83,10 @@ void > > yp_enable_events(void) > > { > > int i; > > - extern fd_set svc_fdset; > > + extern fd_set svc_fdset; > > struct yp_event *ye; > > > > - for (i = 0; i < getdtablesize(); i++) { > > + for (i = 0; i < FD_SETSIZE; i++) { > > if (FD_ISSET(i, &svc_fdset)) { > > if ((ye = calloc(1, sizeof(*ye))) == NULL) > > fatal(NULL); > > > > Modified: head/usr.sbin/ypldap/ypldap.conf.5 > > > ============================================================================== > > --- head/usr.sbin/ypldap/ypldap.conf.5 Wed Jan 13 01:32:04 2016 > (r293800) > > +++ head/usr.sbin/ypldap/ypldap.conf.5 Wed Jan 13 01:49:35 2016 > (r293801) > > @@ -15,7 +15,7 @@ > > .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING > OUT OF > > .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > > .\" > > -.Dd $Mdocdate: April 30 2012 $ > > +.Dd $Mdocdate: January 13 2016 $ > > .Dt YPLDAP.CONF 5 > > .Os > > .Sh NAME > > @@ -155,6 +155,9 @@ Use the supplied LDAP filter to retrieve > > .It Pa /etc/ypldap.conf > > .Xr ypldap 8 > > configuration file. > > +.It Pa /usr/share/example/ypldap/ypldap.conf > > +.Xr ypldap 8 > > +configuration file example. > > .El > > .Sh SEE ALSO > > .Xr ypbind 8 , > > > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Mon Jan 25 07:15:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F80A455FC; Mon, 25 Jan 2016 07:15:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 5C183A46; Mon, 25 Jan 2016 07:15:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id C86A3782913; Mon, 25 Jan 2016 17:43:44 +1100 (AEDT) Date: Mon, 25 Jan 2016 17:43:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Voskoboinyk cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294697 - head/sys/net80211 In-Reply-To: <201601242335.u0ONZKwW053626@repo.freebsd.org> Message-ID: <20160125170231.H986@besplex.bde.org> References: <201601242335.u0ONZKwW053626@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.1 cv=R4L+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=s9b9jv-nJyFL7ZVnhwEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 07:15:30 -0000 On Sun, 24 Jan 2016, Andriy Voskoboinyk wrote: > Log: > net80211: reduce stack usage for ieee80211_ioctl*() methods. > > Use malloc(9) for > - struct ieee80211req_wpaie2 (518 bytes, used in > ieee80211_ioctl_getwpaie()) > - struct ieee80211_scan_req (128 bytes, used in setmlme_assoc_adhoc() > and ieee80211_ioctl_scanreq()) > > Also, drop __noinline workarounds; stack overflow is not reproducible > with recent compilers. > > Tested with Clang 3.7.1, GCC 4.2.1 (from 9.3-RELEASE) and 4.9.4 > (with -fstack-usage flag) Inlining also breaks debugging. It is best avoided generally using gcc -fnon-inline-functions-called-once. This flag is broken (not supported) in clang. > Modified: head/sys/net80211/ieee80211_ioctl.c > ============================================================================== > --- head/sys/net80211/ieee80211_ioctl.c Sun Jan 24 23:28:14 2016 (r294696) > +++ head/sys/net80211/ieee80211_ioctl.c Sun Jan 24 23:35:20 2016 (r294697) > -/* > - * When building the kernel with -O2 on the i386 architecture, gcc > - * seems to want to inline this function into ieee80211_ioctl() > - * (which is the only routine that calls it). When this happens, > - * ieee80211_ioctl() ends up consuming an additional 2K of stack > - * space. (Exactly why it needs so much is unclear.) The problem > - * is that it's possible for ieee80211_ioctl() to invoke other > - * routines (including driver init functions) which could then find > - * themselves perilously close to exhausting the stack. > - * > - * To avoid this, we deliberately prevent gcc from inlining this > - * routine. Another way to avoid this is to use less agressive > - * optimization when compiling this file (i.e. -O instead of -O2) > - * but special-casing the compilation of this one module in the > - * build system would be awkward. > - */ Even with -O1 -mtune=i386 -fno-inline-functions-called-once, gcc-4.2.1 still breaks debugging of static functions by using a different calling convention for them. The first couple of args are passed in registers. This breaks ddb stack traces on i386 not quite as badly as they have always been broken on amd64. (ddb cannot determine the number of args or where they are on amd64, and used to print 5 words of stack garbage. On i386, the args list is still printed and is almost as confusing as garbage, since it is correct for extern functions but for static functions it starts at about the third arg). I use __attribute__((__regparm(0))) to unbreak the ABI for a few functions designed to be called from within ddb as well as the main code. Some older functions like inb_() with this desgn still work accidentally because they are extern. I haven't figured out the command-line flag to fix this yet. Maybe just -mregparm. I didn't try hard to fix this since I was working on optimizations more than debugging when I added the attribute. Inlining really should reduce stack usage and thus be an optimization that is actually useful for kernels. Compilers are clueless about optimizations that are useful for kernels. -Os should help, but is very broken in gcc-4.2.1 (it fails to compile some files due to hitting inlining limits, and after working around this, gives a negative optimization for space of about 30%). -Os works OK for clang -- it reduces the space a little and the time by almost as much as -O2. But optimizations like clang -O2 -march=native are less than 10% faster than pessimizations like gcc-old -O1 -mtune=i386 -fno-inline-functions-called-once -fno-unit-at-a-time in kernels, in micro-benchmarks that are favourable to the optimizations. More like 1% for normal use. (-fno-unit-at-a-time should reduce opportunities for inlining static functions if -fno-inline-functions-called-once doesn't work, but is also broken (not supported) in clang.) Optimizations larger than 1% can possibly be obtained by using compiler builtins, but compiler builtins are turned off by -ffreestanding. I no longer bother to turn some like __builtin_memcpy() back on. Bruce From owner-svn-src-head@freebsd.org Mon Jan 25 08:12:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43D8EA45A33; Mon, 25 Jan 2016 08:12:45 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E8D8B69A; Mon, 25 Jan 2016 08:12:44 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.9/8.14.9) with ESMTP id u0P8BRne075016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Jan 2016 16:11:27 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.9/8.14.9/Submit) id u0P8BRxm075015; Mon, 25 Jan 2016 16:11:27 +0800 (CST) (envelope-from kevlo) Date: Mon, 25 Jan 2016 16:11:26 +0800 From: Kevin Lo To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294698 - in head/sys/arm: allwinner conf Message-ID: <20160125081126.GA74995@ns.kevlo.org> References: <201601250024.u0P0Ov2w068306@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601250024.u0P0Ov2w068306@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 08:12:45 -0000 Hi Andrew, The allwinner_machdep.h file seems to be missing. On Mon, Jan 25, 2016 at 12:24:57AM +0000, Andrew Turner wrote: > > Author: andrew > Date: Mon Jan 25 00:24:57 2016 > New Revision: 294698 > URL: https://svnweb.freebsd.org/changeset/base/294698 > > Log: > Update the Allwinner kernels: > * Use the ARM PLATFORM framework > * Use ARM_INTRNG on teh A20 as it has a GICv2 > * Add a method to find which Allwinner SoC we are running on > > Differential Revision: https://reviews.freebsd.org/D5059 > > Added: > head/sys/arm/allwinner/allwinner_machdep.c > - copied, changed from r294697, head/sys/arm/allwinner/a10_machdep.c > Deleted: > head/sys/arm/allwinner/a10_machdep.c > Modified: > head/sys/arm/allwinner/a10_common.c > head/sys/arm/allwinner/files.allwinner > head/sys/arm/conf/A20 > head/sys/arm/conf/CUBIEBOARD > > Modified: head/sys/arm/allwinner/a10_common.c > ============================================================================== > --- head/sys/arm/allwinner/a10_common.c Sun Jan 24 23:35:20 2016 (r294697) > +++ head/sys/arm/allwinner/a10_common.c Mon Jan 25 00:24:57 2016 (r294698) > @@ -42,6 +42,8 @@ struct fdt_fixup_entry fdt_fixup_table[] > { NULL, NULL } > }; > > +#ifndef ARM_INTRNG > + > static int > fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, > int *pol) > @@ -66,3 +68,5 @@ fdt_pic_decode_t fdt_pic_table[] = { > &fdt_aintc_decode_ic, > NULL > }; > + > +#endif /* ARM_INTRNG */ > > Copied and modified: head/sys/arm/allwinner/allwinner_machdep.c (from r294697, head/sys/arm/allwinner/a10_machdep.c) > ============================================================================== > --- head/sys/arm/allwinner/a10_machdep.c Sun Jan 24 23:35:20 2016 (r294697, copy source) > +++ head/sys/arm/allwinner/allwinner_machdep.c Mon Jan 25 00:24:57 2016 (r294698) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2012 Ganbold Tsagaankhuu > + * Copyright (c) 2015-2016 Emmanuel Vadot > * All rights reserved. > * > * This code is derived from software written for Brini by Mark Brinicombe > @@ -45,32 +46,41 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > +#include > > #include > > #include > +#include > > -vm_offset_t > -platform_lastaddr(void) > -{ > +#include "platform_if.h" > > - return (arm_devmap_lastaddr()); > -} > +static u_int soc_type; > +static u_int soc_family; > > -void > -platform_probe_and_attach(void) > +static int > +a10_attach(platform_t plat) > { > + soc_type = ALLWINNERSOC_A10; > + soc_family = ALLWINNERSOC_SUN4I; > + return (0); > } > > -void > -platform_gpio_init(void) > +static int > +a20_attach(platform_t plat) > { > + soc_type = ALLWINNERSOC_A20; > + soc_family = ALLWINNERSOC_SUN7I; > + > + return (0); > } > > -void > -platform_late_init(void) > + > +static vm_offset_t > +allwinner_lastaddr(platform_t plat) > { > + > + return (arm_devmap_lastaddr()); > } > > /* > @@ -83,8 +93,8 @@ platform_late_init(void) > * shouldn't be device-mapped. The original code mapped a 4MB block, but > * perhaps a 1MB block would be more appropriate. > */ > -int > -platform_devmap_init(void) > +static int > +allwinner_devmap_init(platform_t plat) > { > > arm_devmap_add_entry(0x01C00000, 0x00400000); /* 4MB */ > @@ -111,3 +121,34 @@ cpu_reset() > printf("Reset failed!\n"); > while (1); > } > + > +static platform_method_t a10_methods[] = { > + PLATFORMMETHOD(platform_attach, a10_attach), > + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), > + PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), > + > + PLATFORMMETHOD_END, > +}; > + > +static platform_method_t a20_methods[] = { > + PLATFORMMETHOD(platform_attach, a20_attach), > + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), > + PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), > + > + PLATFORMMETHOD_END, > +}; > + > +u_int > +allwinner_soc_type(void) > +{ > + return (soc_type); > +} > + > +u_int > +allwinner_soc_family(void) > +{ > + return (soc_family); > +} > + > +FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10"); > +FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20"); > > Modified: head/sys/arm/allwinner/files.allwinner > ============================================================================== > --- head/sys/arm/allwinner/files.allwinner Sun Jan 24 23:35:20 2016 (r294697) > +++ head/sys/arm/allwinner/files.allwinner Mon Jan 25 00:24:57 2016 (r294698) > @@ -6,11 +6,11 @@ arm/allwinner/a10_clk.c standard > arm/allwinner/a10_common.c standard > arm/allwinner/a10_ehci.c optional ehci > arm/allwinner/a10_gpio.c optional gpio > -arm/allwinner/a10_machdep.c standard > arm/allwinner/a10_mmc.c optional mmc > arm/allwinner/a10_sramc.c standard > arm/allwinner/a10_wdog.c standard > arm/allwinner/a20/a20_cpu_cfg.c standard > +arm/allwinner/allwinner_machdep.c standard > arm/allwinner/if_emac.c optional emac > arm/allwinner/timer.c standard > #arm/allwinner/console.c standard > > Modified: head/sys/arm/conf/A20 > ============================================================================== > --- head/sys/arm/conf/A20 Sun Jan 24 23:35:20 2016 (r294697) > +++ head/sys/arm/conf/A20 Mon Jan 25 00:24:57 2016 (r294698) > @@ -23,9 +23,12 @@ ident A20 > include "std.armv6" > include "../allwinner/a20/std.a20" > > +options ARM_INTRNG > + > options HZ=100 > options SCHED_ULE # ULE scheduler > options SMP # Enable multiple cores > +options PLATFORM > > # Debugging for use in -current > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > > Modified: head/sys/arm/conf/CUBIEBOARD > ============================================================================== > --- head/sys/arm/conf/CUBIEBOARD Sun Jan 24 23:35:20 2016 (r294697) > +++ head/sys/arm/conf/CUBIEBOARD Mon Jan 25 00:24:57 2016 (r294698) > @@ -26,6 +26,7 @@ include "../allwinner/std.a10" > > options HZ=100 > options SCHED_4BSD # 4BSD scheduler > +options PLATFORM > > # Debugging for use in -current > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > > From owner-svn-src-head@freebsd.org Mon Jan 25 08:19:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D760A45D7B; Mon, 25 Jan 2016 08:19:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 12B14A34; Mon, 25 Jan 2016 08:19:17 +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 u0P8JHo0005940; Mon, 25 Jan 2016 08:19:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P8JHO6005939; Mon, 25 Jan 2016 08:19:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601250819.u0P8JHO6005939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Jan 2016 08:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294707 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 08:19:18 -0000 Author: andrew Date: Mon Jan 25 08:19:16 2016 New Revision: 294707 URL: https://svnweb.freebsd.org/changeset/base/294707 Log: Add allwinner_machdep.h, it was missed in r294698. Added: head/sys/arm/allwinner/allwinner_machdep.h (contents, props changed) Added: head/sys/arm/allwinner/allwinner_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/allwinner_machdep.h Mon Jan 25 08:19:16 2016 (r294707) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2015 Emmanuel Vadot + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef AW_MACHDEP_H +#define AW_MACHDEP_H + +#define ALLWINNERSOC_A10 0x10000000 +#define ALLWINNERSOC_A13 0x13000000 +#define ALLWINNERSOC_A10S 0x10000001 +#define ALLWINNERSOC_A20 0x20000000 + +#define ALLWINNERSOC_SUN4I 0x40000000 +#define ALLWINNERSOC_SUN5I 0x50000000 +#define ALLWINNERSOC_SUN7I 0x70000000 + +u_int allwinner_soc_type(void); +u_int allwinner_soc_family(void); + +#endif /* AW_MACHDEP_H */ From owner-svn-src-head@freebsd.org Mon Jan 25 08:21:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A578A45F11; Mon, 25 Jan 2016 08:21:33 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 59A14CF9; Mon, 25 Jan 2016 08:21:33 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (97e175b7.skybroadband.com [151.225.117.183]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id F0702D78FE; Mon, 25 Jan 2016 08:21:31 +0000 (UTC) Date: Mon, 25 Jan 2016 08:20:44 +0000 From: Andrew Turner To: Kevin Lo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294698 - in head/sys/arm: allwinner conf Message-ID: <20160125082044.118f8a2b@zapp.Home> In-Reply-To: <20160125081126.GA74995@ns.kevlo.org> References: <201601250024.u0P0Ov2w068306@repo.freebsd.org> <20160125081126.GA74995@ns.kevlo.org> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 08:21:33 -0000 On Mon, 25 Jan 2016 16:11:26 +0800 Kevin Lo wrote: > Hi Andrew, > > The allwinner_machdep.h file seems to be missing. > Fixed in r294707. Andrew From owner-svn-src-head@freebsd.org Mon Jan 25 09:31:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C96EA31A90; Mon, 25 Jan 2016 09:31:34 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEAA2F7; Mon, 25 Jan 2016 09:31:33 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P9VWBU028756; Mon, 25 Jan 2016 09:31:32 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P9VWD1028755; Mon, 25 Jan 2016 09:31:32 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601250931.u0P9VWD1028755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 25 Jan 2016 09:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294710 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 09:31:34 -0000 Author: melifaro Date: Mon Jan 25 09:31:32 2016 New Revision: 294710 URL: https://svnweb.freebsd.org/changeset/base/294710 Log: Fix flowtable part missed in r294706. Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jan 25 09:29:29 2016 (r294709) +++ head/sys/net/route.c Mon Jan 25 09:31:32 2016 (r294710) @@ -1482,7 +1482,7 @@ rt_flowtable_check_route(struct rib_head case AF_INET: #endif #if defined(INET6) || defined(INET) - rn = rnh->rnh_matchaddr(dst, rnh); + rn = rnh->rnh_matchaddr(dst, &rnh->head); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { struct sockaddr *mask; u_char *m, *n; From owner-svn-src-head@freebsd.org Mon Jan 25 10:06:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2924AA458DA; Mon, 25 Jan 2016 10:06:51 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 057C4390; Mon, 25 Jan 2016 10:06:50 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PA6ohf038732; Mon, 25 Jan 2016 10:06:50 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PA6ovK038731; Mon, 25 Jan 2016 10:06:50 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601251006.u0PA6ovK038731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 25 Jan 2016 10:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294712 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 10:06:51 -0000 Author: melifaro Date: Mon Jan 25 10:06:49 2016 New Revision: 294712 URL: https://svnweb.freebsd.org/changeset/base/294712 Log: Convert TCP mtu checks to the new routing KPI. Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Jan 25 09:40:25 2016 (r294711) +++ head/sys/netinet/tcp_subr.c Mon Jan 25 10:06:49 2016 (r294712) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -78,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET6 #include +#include #include #include #include @@ -2205,27 +2207,20 @@ tcp_mtudisc(struct inpcb *inp, int mtuof u_long tcp_maxmtu(struct in_conninfo *inc, struct tcp_ifcap *cap) { - struct route sro; - struct sockaddr_in *dst; + struct nhop4_extended nh4; struct ifnet *ifp; u_long maxmtu = 0; KASSERT(inc != NULL, ("tcp_maxmtu with NULL in_conninfo pointer")); - bzero(&sro, sizeof(sro)); if (inc->inc_faddr.s_addr != INADDR_ANY) { - dst = (struct sockaddr_in *)&sro.ro_dst; - dst->sin_family = AF_INET; - dst->sin_len = sizeof(*dst); - dst->sin_addr = inc->inc_faddr; - in_rtalloc_ign(&sro, 0, inc->inc_fibnum); - } - if (sro.ro_rt != NULL) { - ifp = sro.ro_rt->rt_ifp; - if (sro.ro_rt->rt_mtu == 0) - maxmtu = ifp->if_mtu; - else - maxmtu = min(sro.ro_rt->rt_mtu, ifp->if_mtu); + + if (fib4_lookup_nh_ext(inc->inc_fibnum, inc->inc_faddr, + NHR_REF, 0, &nh4) != 0) + return (0); + + ifp = nh4.nh_ifp; + maxmtu = nh4.nh_mtu; /* Report additional interface capabilities. */ if (cap != NULL) { @@ -2237,7 +2232,7 @@ tcp_maxmtu(struct in_conninfo *inc, stru cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } - RTFREE(sro.ro_rt); + fib4_free_nh_ext(inc->inc_fibnum, &nh4); } return (maxmtu); } @@ -2247,26 +2242,22 @@ tcp_maxmtu(struct in_conninfo *inc, stru u_long tcp_maxmtu6(struct in_conninfo *inc, struct tcp_ifcap *cap) { - struct route_in6 sro6; + struct nhop6_extended nh6; + struct in6_addr dst6; + uint32_t scopeid; struct ifnet *ifp; u_long maxmtu = 0; KASSERT(inc != NULL, ("tcp_maxmtu6 with NULL in_conninfo pointer")); - bzero(&sro6, sizeof(sro6)); if (!IN6_IS_ADDR_UNSPECIFIED(&inc->inc6_faddr)) { - sro6.ro_dst.sin6_family = AF_INET6; - sro6.ro_dst.sin6_len = sizeof(struct sockaddr_in6); - sro6.ro_dst.sin6_addr = inc->inc6_faddr; - in6_rtalloc_ign(&sro6, 0, inc->inc_fibnum); - } - if (sro6.ro_rt != NULL) { - ifp = sro6.ro_rt->rt_ifp; - if (sro6.ro_rt->rt_mtu == 0) - maxmtu = IN6_LINKMTU(sro6.ro_rt->rt_ifp); - else - maxmtu = min(sro6.ro_rt->rt_mtu, - IN6_LINKMTU(sro6.ro_rt->rt_ifp)); + in6_splitscope(&inc->inc6_faddr, &dst6, &scopeid); + if (fib6_lookup_nh_ext(inc->inc_fibnum, &dst6, scopeid, 0, + 0, &nh6) != 0) + return (0); + + ifp = nh6.nh_ifp; + maxmtu = nh6.nh_mtu; /* Report additional interface capabilities. */ if (cap != NULL) { @@ -2278,7 +2269,7 @@ tcp_maxmtu6(struct in_conninfo *inc, str cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } - RTFREE(sro6.ro_rt); + fib6_free_nh_ext(inc->inc_fibnum, &nh6); } return (maxmtu); From owner-svn-src-head@freebsd.org Mon Jan 25 10:18:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02908A45E0E; Mon, 25 Jan 2016 10:18:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id C905DD77; Mon, 25 Jan 2016 10:18:42 +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 u0PAIfVg041964; Mon, 25 Jan 2016 10:18:41 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PAIfIn041963; Mon, 25 Jan 2016 10:18:41 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601251018.u0PAIfIn041963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 25 Jan 2016 10:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294713 - head/cddl/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 10:18:43 -0000 Author: br Date: Mon Jan 25 10:18:41 2016 New Revision: 294713 URL: https://svnweb.freebsd.org/changeset/base/294713 Log: We don't support libdtrace for RISC-V yet. Modified: head/cddl/lib/Makefile Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Mon Jan 25 10:06:49 2016 (r294712) +++ head/cddl/lib/Makefile Mon Jan 25 10:18:41 2016 (r294713) @@ -26,7 +26,7 @@ _libzpool= libzpool .endif .endif -.if ${MACHINE_CPUARCH} != "sparc64" +.if ${MACHINE_CPUARCH} != "sparc64" && ${MACHINE_CPUARCH} != "riscv" _drti= drti _libdtrace= libdtrace .endif From owner-svn-src-head@freebsd.org Mon Jan 25 10:23:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EECCA451AA; Mon, 25 Jan 2016 10:23:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id F3D78319; Mon, 25 Jan 2016 10:23:37 +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 u0PANadL044733; Mon, 25 Jan 2016 10:23:36 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PANa80044732; Mon, 25 Jan 2016 10:23:36 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601251023.u0PANa80044732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 25 Jan 2016 10:23:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294714 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 10:23:38 -0000 Author: br Date: Mon Jan 25 10:23:36 2016 New Revision: 294714 URL: https://svnweb.freebsd.org/changeset/base/294714 Log: Do build libproc and librtld_db for RISC-V as well. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Jan 25 10:18:41 2016 (r294713) +++ head/lib/Makefile Mon Jan 25 10:23:36 2016 (r294714) @@ -264,7 +264,7 @@ _libproc= libproc _librtld_db= librtld_db .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "riscv" _libproc= libproc _librtld_db= librtld_db .endif From owner-svn-src-head@freebsd.org Mon Jan 25 10:44:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87462A458F3; Mon, 25 Jan 2016 10:44:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 597C4F45; Mon, 25 Jan 2016 10:44:11 +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 u0PAiAwJ050709; Mon, 25 Jan 2016 10:44:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PAiAon050708; Mon, 25 Jan 2016 10:44:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601251044.u0PAiAon050708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 25 Jan 2016 10:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294717 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 10:44:11 -0000 Author: br Date: Mon Jan 25 10:44:10 2016 New Revision: 294717 URL: https://svnweb.freebsd.org/changeset/base/294717 Log: Style. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Jan 25 10:43:44 2016 (r294716) +++ head/lib/Makefile Mon Jan 25 10:44:10 2016 (r294717) @@ -264,7 +264,8 @@ _libproc= libproc _librtld_db= librtld_db .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "riscv" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ + ${MACHINE_CPUARCH} == "riscv" _libproc= libproc _librtld_db= librtld_db .endif From owner-svn-src-head@freebsd.org Mon Jan 25 12:43:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0947DA45129; Mon, 25 Jan 2016 12:43:09 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7BBF264; Mon, 25 Jan 2016 12:43:08 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PCh76T089063; Mon, 25 Jan 2016 12:43:07 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PCh7Tw089056; Mon, 25 Jan 2016 12:43:07 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601251243.u0PCh7Tw089056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 25 Jan 2016 12:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294722 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 12:43:09 -0000 Author: skra Date: Mon Jan 25 12:43:07 2016 New Revision: 294722 URL: https://svnweb.freebsd.org/changeset/base/294722 Log: Create new pmap dump interface for minidump and use it for existing pmap implementations on ARM. This way minidump code can be used without any platform specific modification. Also, this is the last piece missing for ARM_NEW_PMAP. Differential Revision: https://reviews.freebsd.org/D5023 Modified: head/sys/arm/arm/minidump_machdep.c head/sys/arm/arm/pmap-v6-new.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h head/sys/arm/include/pte.h Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Mon Jan 25 10:55:52 2016 (r294721) +++ head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:43:07 2016 (r294722) @@ -61,8 +61,6 @@ CTASSERT(sizeof(struct kerneldumpheader) uint32_t *vm_page_dump; int vm_page_dump_size; -#ifndef ARM_NEW_PMAP - static struct kerneldumpheader kdh; static off_t dumplo; @@ -196,8 +194,9 @@ blk_write_cont(struct dumperinfo *di, vm return (0); } -/* A fake page table page, to avoid having to handle both 4K and 2M pages */ -static pt_entry_t fakept[NPTEPG]; +/* A buffer for general use. Its size must be one page at least. */ +static char dumpbuf[PAGE_SIZE]; +CTASSERT(sizeof(dumpbuf) % sizeof(pt2_entry_t) == 0); int minidumpsys(struct dumperinfo *di) @@ -208,9 +207,7 @@ minidumpsys(struct dumperinfo *di) uint32_t bits; uint32_t pa, prev_pa = 0, count = 0; vm_offset_t va; - pd_entry_t *pdp; - pt_entry_t *pt, *ptp; - int i, k, bit, error; + int i, bit, error; char *addr; /* @@ -228,48 +225,11 @@ minidumpsys(struct dumperinfo *di) counter = 0; /* Walk page table pages, set bits in vm_page_dump */ ptesize = 0; - for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) { - /* - * We always write a page, even if it is zero. Each - * page written corresponds to 2MB of space - */ - ptesize += L2_TABLE_SIZE_REAL; - pmap_get_pde_pte(pmap_kernel(), va, &pdp, &ptp); - if (pmap_pde_v(pdp) && pmap_pde_section(pdp)) { - /* This is a section mapping 1M page. */ - pa = (*pdp & L1_S_ADDR_MASK) | (va & ~L1_S_ADDR_MASK); - for (k = 0; k < (L1_S_SIZE / PAGE_SIZE); k++) { - if (is_dumpable(pa)) - dump_add_page(pa); - pa += PAGE_SIZE; - } - continue; - } - if (pmap_pde_v(pdp) && pmap_pde_page(pdp)) { - /* Set bit for each valid page in this 1MB block */ - addr = pmap_kenter_temporary(*pdp & L1_C_ADDR_MASK, 0); - pt = (pt_entry_t*)(addr + - (((uint32_t)*pdp & L1_C_ADDR_MASK) & PAGE_MASK)); - for (k = 0; k < 256; k++) { - if ((pt[k] & L2_TYPE_MASK) == L2_TYPE_L) { - pa = (pt[k] & L2_L_FRAME) | - (va & L2_L_OFFSET); - for (i = 0; i < 16; i++) { - if (is_dumpable(pa)) - dump_add_page(pa); - k++; - pa += PAGE_SIZE; - } - } else if ((pt[k] & L2_TYPE_MASK) == L2_TYPE_S) { - pa = (pt[k] & L2_S_FRAME) | - (va & L2_S_OFFSET); - if (is_dumpable(pa)) - dump_add_page(pa); - } - } - } else { - /* Nothing, we're going to dump a null page */ - } + for (va = KERNBASE; va < kernel_vm_end; va += PAGE_SIZE) { + pa = pmap_dump_kextract(va, NULL); + if (pa != 0 && is_dumpable(pa)) + dump_add_page(pa); + ptesize += sizeof(pt2_entry_t); } /* Calculate dump size. */ @@ -331,9 +291,9 @@ minidumpsys(struct dumperinfo *di) dumplo += sizeof(kdh); /* Dump my header */ - bzero(&fakept, sizeof(fakept)); - bcopy(&mdhdr, &fakept, sizeof(mdhdr)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + bzero(dumpbuf, sizeof(dumpbuf)); + bcopy(&mdhdr, dumpbuf, sizeof(mdhdr)); + error = blk_write(di, dumpbuf, 0, PAGE_SIZE); if (error) goto fail; @@ -349,81 +309,21 @@ minidumpsys(struct dumperinfo *di) goto fail; /* Dump kernel page table pages */ - for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) { - /* We always write a page, even if it is zero */ - pmap_get_pde_pte(pmap_kernel(), va, &pdp, &ptp); - - if (pmap_pde_v(pdp) && pmap_pde_section(pdp)) { - if (count) { - error = blk_write_cont(di, prev_pa, - count * L2_TABLE_SIZE_REAL); - if (error) - goto fail; - count = 0; - prev_pa = 0; - } - /* This is a single 2M block. Generate a fake PTP */ - pa = (*pdp & L1_S_ADDR_MASK) | (va & ~L1_S_ADDR_MASK); - for (k = 0; k < (L1_S_SIZE / PAGE_SIZE); k++) { - fakept[k] = L2_S_PROTO | (pa + (k * PAGE_SIZE)) | - L2_S_PROT(PTE_KERNEL, - VM_PROT_READ | VM_PROT_WRITE); - } - error = blk_write(di, (char *)&fakept, 0, - L2_TABLE_SIZE_REAL); - if (error) - goto fail; - /* Flush, in case we reuse fakept in the same block */ - error = blk_flush(di); - if (error) - goto fail; - continue; - } - if (pmap_pde_v(pdp) && pmap_pde_page(pdp)) { - pa = *pdp & L1_C_ADDR_MASK; - if (!count) { - prev_pa = pa; - count++; - } - else { - if (pa == (prev_pa + count * L2_TABLE_SIZE_REAL)) - count++; - else { - error = blk_write_cont(di, prev_pa, - count * L2_TABLE_SIZE_REAL); - if (error) - goto fail; - count = 1; - prev_pa = pa; - } - } - } else { - if (count) { - error = blk_write_cont(di, prev_pa, - count * L2_TABLE_SIZE_REAL); - if (error) - goto fail; - count = 0; - prev_pa = 0; - } - bzero(fakept, sizeof(fakept)); - error = blk_write(di, (char *)&fakept, 0, - L2_TABLE_SIZE_REAL); - if (error) - goto fail; - /* Flush, in case we reuse fakept in the same block */ - error = blk_flush(di); - if (error) + addr = dumpbuf; + for (va = KERNBASE; va < kernel_vm_end; va += PAGE_SIZE) { + pmap_dump_kextract(va, (pt2_entry_t *)addr); + addr += sizeof(pt2_entry_t); + if (addr == dumpbuf + sizeof(dumpbuf)) { + error = blk_write(di, dumpbuf, 0, sizeof(dumpbuf)); + if (error != 0) goto fail; + addr = dumpbuf; } } - - if (count) { - error = blk_write_cont(di, prev_pa, count * L2_TABLE_SIZE_REAL); - if (error) + if (addr != dumpbuf) { + error = blk_write(di, dumpbuf, 0, addr - dumpbuf); + if (error != 0) goto fail; - count = 0; - prev_pa = 0; } /* Dump memory chunks */ @@ -484,17 +384,6 @@ fail: return (0); } -#else /* ARM_NEW_PMAP */ - -int -minidumpsys(struct dumperinfo *di) -{ - - return (0); -} - -#endif - void dump_add_page(vm_paddr_t pa) { Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Mon Jan 25 10:55:52 2016 (r294721) +++ head/sys/arm/arm/pmap-v6-new.c Mon Jan 25 12:43:07 2016 (r294722) @@ -1049,6 +1049,36 @@ pmap_kextract(vm_offset_t va) return (pa); } +/* + * Extract from the kernel page table the physical address + * that is mapped by the given virtual address "va". Also + * return L2 page table entry which maps the address. + * + * This is only intended to be used for panic dumps. + */ +vm_paddr_t +pmap_dump_kextract(vm_offset_t va, pt2_entry_t *pte2p) +{ + vm_paddr_t pa; + pt1_entry_t pte1; + pt2_entry_t pte2; + + pte1 = pte1_load(kern_pte1(va)); + if (pte1_is_section(pte1)) { + pa = pte1_pa(pte1) | (va & PTE1_OFFSET); + pte2 = pa | ATTR_TO_L2(pte1) | PTE2_V; + } else if (pte1_is_link(pte1)) { + pte2 = pte2_load(pt2map_entry(va)); + pa = pte2_pa(pte2); + } else { + pte2 = 0; + pa = 0; + } + if (pte2p != NULL) + *pte2p = pte2; + return (pa); +} + /***************************************************************************** * * PMAP second stage initialization and utility functions Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Jan 25 10:55:52 2016 (r294721) +++ head/sys/arm/arm/pmap-v6.c Mon Jan 25 12:43:07 2016 (r294722) @@ -3536,6 +3536,52 @@ retry: return (m); } +vm_paddr_t +pmap_dump_kextract(vm_offset_t va, pt2_entry_t *pte2p) +{ + struct l2_dtable *l2; + pd_entry_t l1pd; + pt_entry_t *ptep, pte; + vm_paddr_t pa; + u_int l1idx; + + l1idx = L1_IDX(va); + l1pd = kernel_pmap->pm_l1->l1_kva[l1idx]; + if (l1pte_section_p(l1pd)) { + if (l1pd & L1_S_SUPERSEC) + pa = (l1pd & L1_SUP_FRAME) | (va & L1_SUP_OFFSET); + else + pa = (l1pd & L1_S_FRAME) | (va & L1_S_OFFSET); + pte = L2_S_PROTO | pa | + L2_S_PROT(PTE_KERNEL, VM_PROT_READ | VM_PROT_WRITE); + } else { + l2 = kernel_pmap->pm_l2[L2_IDX(l1idx)]; + if (l2 == NULL || + (ptep = l2->l2_bucket[L2_BUCKET(l1idx)].l2b_kva) == NULL) { + pte = 0; + pa = 0; + goto out; + } + pte = ptep[l2pte_index(va)]; + if (pte == 0) { + pa = 0; + goto out; + } + switch (pte & L2_TYPE_MASK) { + case L2_TYPE_L: + pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET); + break; + default: + pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); + break; + } + } +out: + if (pte2p != NULL) + *pte2p = pte; + return (pa); +} + /* * Initialize a preallocated and zeroed pmap structure, * such as one in a vmspace structure. Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Mon Jan 25 10:55:52 2016 (r294721) +++ head/sys/arm/arm/pmap.c Mon Jan 25 12:43:07 2016 (r294722) @@ -3738,6 +3738,52 @@ retry: return (m); } +vm_paddr_t +pmap_dump_kextract(vm_offset_t va, pt2_entry_t *pte2p) +{ + struct l2_dtable *l2; + pd_entry_t l1pd; + pt_entry_t *ptep, pte; + vm_paddr_t pa; + u_int l1idx; + + l1idx = L1_IDX(va); + l1pd = kernel_pmap->pm_l1->l1_kva[l1idx]; + if (l1pte_section_p(l1pd)) { + if (l1pd & L1_S_SUPERSEC) + pa = (l1pd & L1_SUP_FRAME) | (va & L1_SUP_OFFSET); + else + pa = (l1pd & L1_S_FRAME) | (va & L1_S_OFFSET); + pte = L2_S_PROTO | pa | + L2_S_PROT(PTE_KERNEL, VM_PROT_READ | VM_PROT_WRITE); + } else { + l2 = kernel_pmap->pm_l2[L2_IDX(l1idx)]; + if (l2 == NULL || + (ptep = l2->l2_bucket[L2_BUCKET(l1idx)].l2b_kva) == NULL) { + pte = 0; + pa = 0; + goto out; + } + pte = ptep[l2pte_index(va)]; + if (pte == 0) { + pa = 0; + goto out; + } + switch (pte & L2_TYPE_MASK) { + case L2_TYPE_L: + pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET); + break; + default: + pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); + break; + } + } +out: + if (pte2p != NULL) + *pte2p = pte; + return (pa); +} + /* * Initialize a preallocated and zeroed pmap structure, * such as one in a vmspace structure. Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Mon Jan 25 10:55:52 2016 (r294721) +++ head/sys/arm/include/pmap-v6.h Mon Jan 25 12:43:07 2016 (r294722) @@ -200,6 +200,8 @@ void pmap_tlb_flush_range(pmap_t , vm_of void pmap_dcache_wb_range(vm_paddr_t , vm_size_t , vm_memattr_t ); vm_paddr_t pmap_kextract(vm_offset_t ); +vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *); + int pmap_fault(pmap_t , vm_offset_t , uint32_t , int , bool); #define vtophys(va) pmap_kextract((vm_offset_t)(va)) Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon Jan 25 10:55:52 2016 (r294721) +++ head/sys/arm/include/pmap.h Mon Jan 25 12:43:07 2016 (r294722) @@ -263,6 +263,7 @@ void pmap_kremove_device(vm_offset_t, vm void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_user(vm_offset_t va, vm_paddr_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); +vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *); void pmap_kremove(vm_offset_t); void *pmap_mapdev(vm_offset_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); Modified: head/sys/arm/include/pte.h ============================================================================== --- head/sys/arm/include/pte.h Mon Jan 25 10:55:52 2016 (r294721) +++ head/sys/arm/include/pte.h Mon Jan 25 12:43:07 2016 (r294722) @@ -43,6 +43,7 @@ #ifndef LOCORE typedef uint32_t pd_entry_t; /* page directory entry */ typedef uint32_t pt_entry_t; /* page table entry */ +typedef pt_entry_t pt2_entry_t; /* compatibility with v6 */ #endif #define PG_FRAME 0xfffff000 From owner-svn-src-head@freebsd.org Mon Jan 25 12:49:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B1FA452CE; Mon, 25 Jan 2016 12:49:10 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1498E783; Mon, 25 Jan 2016 12:49:10 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PCn9gP089309; Mon, 25 Jan 2016 12:49:09 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PCn9Nw089308; Mon, 25 Jan 2016 12:49:09 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601251249.u0PCn9Nw089308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 25 Jan 2016 12:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294723 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 12:49:10 -0000 Author: skra Date: Mon Jan 25 12:49:08 2016 New Revision: 294723 URL: https://svnweb.freebsd.org/changeset/base/294723 Log: Make minidump more like its i386 original back as with new pmap dump interface all used physical addresses are PAGE_SIZE aligned. Add missing copyright. This is a follow up to r294722. Modified: head/sys/arm/arm/minidump_machdep.c Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:43:07 2016 (r294722) +++ head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:49:08 2016 (r294723) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2006 Peter Wemm * Copyright (c) 2008 Semihalf, Grzegorz Bernacki * All rights reserved. * @@ -66,7 +67,7 @@ static struct kerneldumpheader kdh; static off_t dumplo; /* Handle chunked writes. */ -static size_t fragsz, offset; +static size_t fragsz; static void *dump_va; static uint64_t counter, progress; @@ -94,10 +95,9 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_write(di, (char*)dump_va + offset, 0, dumplo, fragsz - offset); - dumplo += (fragsz - offset); + error = dump_write(di, dump_va, 0, dumplo, fragsz); + dumplo += fragsz; fragsz = 0; - offset = 0; return (error); } @@ -108,36 +108,36 @@ blk_write(struct dumperinfo *di, char *p int error, i, c; u_int maxdumpsz; - maxdumpsz = di->maxiosize; - + maxdumpsz = min(di->maxiosize, MAXDUMPPGS * PAGE_SIZE); if (maxdumpsz == 0) /* seatbelt */ maxdumpsz = PAGE_SIZE; - error = 0; - if (ptr != NULL && pa != 0) { printf("cant have both va and pa!\n"); return (EINVAL); } - + if (pa != 0) { + if ((sz % PAGE_SIZE) != 0) { + printf("size not page aligned\n"); + return (EINVAL); + } + if ((pa & PAGE_MASK) != 0) { + printf("address not page aligned\n"); + return (EINVAL); + } + } if (ptr != NULL) { /* If we're doing a virtual dump, flush any pre-existing pa pages */ error = blk_flush(di); if (error) return (error); } - while (sz) { - if (fragsz == 0) { - offset = pa & PAGE_MASK; - fragsz += offset; - } len = maxdumpsz - fragsz; if (len > sz) len = sz; counter += len; progress -= len; - if (counter >> 22) { printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); counter &= (1<<22) - 1; From owner-svn-src-head@freebsd.org Mon Jan 25 12:55:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D7C8A4574A; Mon, 25 Jan 2016 12:55:26 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA46BFF3; Mon, 25 Jan 2016 12:55:25 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PCtOei092286; Mon, 25 Jan 2016 12:55:24 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PCtO69092285; Mon, 25 Jan 2016 12:55:24 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601251255.u0PCtO69092285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 25 Jan 2016 12:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294724 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 12:55:26 -0000 Author: skra Date: Mon Jan 25 12:55:24 2016 New Revision: 294724 URL: https://svnweb.freebsd.org/changeset/base/294724 Log: Do not use blk_write_cont() and remove it. There si no need to call blk_flush() between two writes by physical address when these are PAGE_SIZE aligned. Fix some style nits. Modified: head/sys/arm/arm/minidump_machdep.c Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:49:08 2016 (r294723) +++ head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:55:24 2016 (r294724) @@ -127,7 +127,7 @@ blk_write(struct dumperinfo *di, char *p } } if (ptr != NULL) { - /* If we're doing a virtual dump, flush any pre-existing pa pages */ + /* Flush any pre-existing pa pages before a virtual dump. */ error = blk_flush(di); if (error) return (error); @@ -178,22 +178,6 @@ blk_write(struct dumperinfo *di, char *p return (0); } -static int -blk_write_cont(struct dumperinfo *di, vm_paddr_t pa, size_t sz) -{ - int error; - - error = blk_write(di, 0, pa, sz); - if (error) - return (error); - - error = blk_flush(di); - if (error) - return (error); - - return (0); -} - /* A buffer for general use. Its size must be one page at least. */ static char dumpbuf[PAGE_SIZE]; CTASSERT(sizeof(dumpbuf) % sizeof(pt2_entry_t) == 0); @@ -298,7 +282,8 @@ minidumpsys(struct dumperinfo *di) goto fail; /* Dump msgbuf up front */ - error = blk_write(di, (char *)msgbufp->msg_ptr, 0, round_page(msgbufp->msg_size)); + error = blk_write(di, (char *)msgbufp->msg_ptr, 0, + round_page(msgbufp->msg_size)); if (error) goto fail; @@ -340,7 +325,7 @@ minidumpsys(struct dumperinfo *di) if (pa == (prev_pa + count * PAGE_SIZE)) count++; else { - error = blk_write_cont(di, prev_pa, + error = blk_write(di, NULL, prev_pa, count * PAGE_SIZE); if (error) goto fail; @@ -352,13 +337,17 @@ minidumpsys(struct dumperinfo *di) } } if (count) { - error = blk_write_cont(di, prev_pa, count * PAGE_SIZE); + error = blk_write(di, NULL, prev_pa, count * PAGE_SIZE); if (error) goto fail; count = 0; prev_pa = 0; } + error = blk_flush(di); + if (error) + goto fail; + /* Dump trailer */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); if (error) From owner-svn-src-head@freebsd.org Mon Jan 25 14:09:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8882AA462F4; Mon, 25 Jan 2016 14:09:37 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF1BB59; Mon, 25 Jan 2016 14:09:37 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PE9aCV013307; Mon, 25 Jan 2016 14:09:36 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PE9abE013306; Mon, 25 Jan 2016 14:09:36 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601251409.u0PE9abE013306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 25 Jan 2016 14:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294727 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 14:09:37 -0000 Author: skra Date: Mon Jan 25 14:09:35 2016 New Revision: 294727 URL: https://svnweb.freebsd.org/changeset/base/294727 Log: Fix an occasional undefined instruction abort during module loading. Even if data cache maintenance was done by IO code, the relocation fixup process creates dirty cache entries that we must write back before doing icache sync. Reported by: Thiagarajan Venkatasubramanian Reviewed by: ian Modified: head/sys/arm/arm/elf_machdep.c Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Mon Jan 25 13:35:28 2016 (r294726) +++ head/sys/arm/arm/elf_machdep.c Mon Jan 25 14:09:35 2016 (r294727) @@ -256,7 +256,7 @@ elf_reloc_local(linker_file_t lf, Elf_Ad } int -elf_cpu_load_file(linker_file_t lf __unused) +elf_cpu_load_file(linker_file_t lf) { /* @@ -265,13 +265,25 @@ elf_cpu_load_file(linker_file_t lf __unu * that kernel memory allocations always have EXECUTABLE protection even * when the memory isn't going to hold executable code. The only time * kernel memory holding instructions does need a sync is after loading - * a kernel module, and that's when this function gets called. Normal - * data cache maintenance has already been done by the IO code, and TLB - * maintenance has been done by the pmap code, so all we have to do here - * is invalidate the instruction cache (which also invalidates the - * branch predictor cache on platforms that have one). + * a kernel module, and that's when this function gets called. + * + * This syncs data and instruction caches after loading a module. We + * don't worry about the kernel itself (lf->id is 1) as locore.S did + * that on entry. Even if data cache maintenance was done by IO code, + * the relocation fixup process creates dirty cache entries that we must + * write back before doing icache sync. The instruction cache sync also + * invalidates the branch predictor cache on platforms that have one. */ + if (lf->id == 1) + return (0); +#if __ARM_ARCH >= 6 + dcache_wb_pou((vm_offset_t)lf->address, (vm_size_t)lf->size); + icache_inv_all(); +#else + cpu_dcache_wb_range((vm_offset_t)lf->address, (vm_size_t)lf->size); + cpu_l2cache_wb_range((vm_offset_t)lf->address, (vm_size_t)lf->size); cpu_icache_sync_all(); +#endif return (0); } From owner-svn-src-head@freebsd.org Mon Jan 25 14:42:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 943C8A46E02; Mon, 25 Jan 2016 14:42:45 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6536E30F; Mon, 25 Jan 2016 14:42:45 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PEgiqx025217; Mon, 25 Jan 2016 14:42:44 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PEgi2t025216; Mon, 25 Jan 2016 14:42:44 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601251442.u0PEgi2t025216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Mon, 25 Jan 2016 14:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294729 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 14:42:45 -0000 Author: zbb Date: Mon Jan 25 14:42:44 2016 New Revision: 294729 URL: https://svnweb.freebsd.org/changeset/base/294729 Log: Do not destroy input buffer of the OF_getencprop() function on error Currently when the OF_getprop() function returns with error, the caller (OF_getencprop()) still changes the buffer endiannes. This may destroy the default value passed in the input buffer if used on a Little Endian platform. Reviewed by: mmel Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Cavium Modified: head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Mon Jan 25 14:13:28 2016 (r294728) +++ head/sys/dev/ofw/openfirm.c Mon Jan 25 14:42:44 2016 (r294729) @@ -394,6 +394,9 @@ OF_getencprop(phandle_t node, const char KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes")); retval = OF_getprop(node, propname, buf, len); + if (retval <= 0) + return (retval); + for (i = 0; i < len/4; i++) buf[i] = be32toh(buf[i]); From owner-svn-src-head@freebsd.org Mon Jan 25 14:59:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51374A45235 for ; Mon, 25 Jan 2016 14:59:30 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6C58B98 for ; Mon, 25 Jan 2016 14:59:29 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x22b.google.com with SMTP id 17so86184516lfz.1 for ; Mon, 25 Jan 2016 06:59:29 -0800 (PST) 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:content-type; bh=I+7ZeBLKMsPBynLFxtulq5YQ9oWedNd8APiHeBDic0E=; b=dxHU4ULMmrys99GocOQvJHxtONuAyVjET8fLO1CPVLgdV8rrCkGd9jPcNt4IstxSZJ hkQBib4Oult5sW2j9VHWoYS0azq/pKzd2kFH6Rqs4mRyp5kCMb9DleUwCdqXKLsJa7HE btO5dWTKpOF7o6NNHbDCdEhl0ZDJa9ZxbbJ7Rfa4k5qxVpRlB83DZS4EWUBNXieak4i/ qldsdYpOtsF80LRrgkKFZuFqyS696vf5ZKXhiRqHs79MtaYqiLkL+rixvQ6pzGRJYwlV DDRWttoo9r0EpMwi45qLUEtWKtBxVh4UCavsp3udVUjcwwLeK1aygFhHhqAVxfldUGt5 8DnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=I+7ZeBLKMsPBynLFxtulq5YQ9oWedNd8APiHeBDic0E=; b=D6WhqFD9TIC+mmYnOevW0Ltnr/o1yN+nnpgq+E3PcwrQgHvay2bRw/L2eLENTy8Ebk RcPobgwceHNfN/dvUsbNjo91AiWvt5NqNUk4OJmyW/wsBdfTuTBmm5SO/2Ce+7d5cpqj D5/aBZ+FBUu9jv+axlVcsXKSmwi14qXfBgxmx3/QL8AzNUACkOIGz6QO132kgsiMYPym 3TQ2x4WX1Rq7AB3Rzqmz46OiGt7v0Wn5bHc4f+DjUcbxNENhq3VlOl/AyVGHJGCWpWXQ Ah5OnL1NEuFn1m/1j24i2CNw5z/2rcHABzt8qSCY9WJciKlDJ5gfmqIb8iZoDDLs8wOv Cx3Q== X-Gm-Message-State: AG10YOTN7xh5hcxAfkgHMur4A0KrVOkbSAuA3OlRe66af2ZIwguHmQhDEvlqjXePpPORQJ/pxyG1poJV+F6E7A== X-Received: by 10.25.205.81 with SMTP id d78mr6948928lfg.15.1453733967755; Mon, 25 Jan 2016 06:59:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.24.93 with HTTP; Mon, 25 Jan 2016 06:59:08 -0800 (PST) In-Reply-To: <201601251442.u0PEgi2t025216@repo.freebsd.org> References: <201601251442.u0PEgi2t025216@repo.freebsd.org> From: Zbigniew Bodek Date: Mon, 25 Jan 2016 15:59:08 +0100 Message-ID: Subject: Re: svn commit: r294729 - head/sys/dev/ofw To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 14:59:30 -0000 I forgot Differential Revision: https://reviews.freebsd.org/D5065 2016-01-25 15:42 GMT+01:00 Zbigniew Bodek : > Author: zbb > Date: Mon Jan 25 14:42:44 2016 > New Revision: 294729 > URL: https://svnweb.freebsd.org/changeset/base/294729 > > Log: > Do not destroy input buffer of the OF_getencprop() function on error > > Currently when the OF_getprop() function returns with error, > the caller (OF_getencprop()) still changes the buffer endiannes. > This may destroy the default value passed in the input buffer if > used on a Little Endian platform. > > Reviewed by: mmel > Submitted by: Zbigniew Bodek > Obtained from: Semihalf > Sponsored by: Cavium > > Modified: > head/sys/dev/ofw/openfirm.c > > Modified: head/sys/dev/ofw/openfirm.c > > ============================================================================== > --- head/sys/dev/ofw/openfirm.c Mon Jan 25 14:13:28 2016 (r294728) > +++ head/sys/dev/ofw/openfirm.c Mon Jan 25 14:42:44 2016 (r294729) > @@ -394,6 +394,9 @@ OF_getencprop(phandle_t node, const char > KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes")); > > retval = OF_getprop(node, propname, buf, len); > + if (retval <= 0) > + return (retval); > + > for (i = 0; i < len/4; i++) > buf[i] = be32toh(buf[i]); > > _______________________________________________ > 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-head@freebsd.org Mon Jan 25 15:10:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6618FA45656; Mon, 25 Jan 2016 15:10:45 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D214226; Mon, 25 Jan 2016 15:10:45 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PFAiZO031246; Mon, 25 Jan 2016 15:10:44 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PFAhdP031242; Mon, 25 Jan 2016 15:10:43 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601251510.u0PFAhdP031242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Mon, 25 Jan 2016 15:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294730 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 15:10:45 -0000 Author: zbb Date: Mon Jan 25 15:10:43 2016 New Revision: 294730 URL: https://svnweb.freebsd.org/changeset/base/294730 Log: Create proper FDT attachment for GICv2m Avoid probing GICv2m to any parent bus/driver. Instead, match GICv2m driver with FDT complatible strings as not every GIC has a MSI controller in the form of GICv2m extension. Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5015 Modified: head/sys/arm64/arm64/gic.c head/sys/arm64/arm64/gic.h head/sys/arm64/arm64/gic_fdt.c Modified: head/sys/arm64/arm64/gic.c ============================================================================== --- head/sys/arm64/arm64/gic.c Mon Jan 25 14:42:44 2016 (r294729) +++ head/sys/arm64/arm64/gic.c Mon Jan 25 15:10:43 2016 (r294730) @@ -355,22 +355,6 @@ DEFINE_CLASS_0(gic, arm_gic_driver, arm_ #define GICv2M_MSI_SETSPI_NS 0x040 #define GICV2M_MSI_IIDR 0xFCC -struct gicv2m_softc { - struct resource *sc_mem; - struct mtx sc_mutex; - u_int sc_spi_start; - u_int sc_spi_count; - u_int sc_spi_offset; -}; - -static int -gicv2m_probe(device_t dev) -{ - - device_set_desc(dev, "ARM Generic Interrupt Controller MSI/MSIX"); - return (BUS_PROBE_DEFAULT); -} - static int gicv2m_attach(device_t dev) { @@ -478,7 +462,6 @@ gicv2m_map_msi(device_t dev, device_t pc static device_method_t arm_gicv2m_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, gicv2m_probe), DEVMETHOD(device_attach, gicv2m_attach), /* MSI/MSI-X */ @@ -489,9 +472,5 @@ static device_method_t arm_gicv2m_method { 0, 0 } }; -static devclass_t arm_gicv2m_devclass; - DEFINE_CLASS_0(gicv2m, arm_gicv2m_driver, arm_gicv2m_methods, sizeof(struct gicv2m_softc)); -EARLY_DRIVER_MODULE(gicv2m, gic, arm_gicv2m_driver, arm_gicv2m_devclass, - 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm64/arm64/gic.h ============================================================================== --- head/sys/arm64/arm64/gic.h Mon Jan 25 14:42:44 2016 (r294729) +++ head/sys/arm64/arm64/gic.h Mon Jan 25 15:10:43 2016 (r294730) @@ -51,6 +51,16 @@ struct arm_gic_softc { uint32_t nirqs; }; +DECLARE_CLASS(arm_gicv2m_driver); + +struct gicv2m_softc { + struct resource *sc_mem; + struct mtx sc_mutex; + u_int sc_spi_start; + u_int sc_spi_count; + u_int sc_spi_offset; +}; + int arm_gic_attach(device_t); #endif Modified: head/sys/arm64/arm64/gic_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_fdt.c Mon Jan 25 14:42:44 2016 (r294729) +++ head/sys/arm64/arm64/gic_fdt.c Mon Jan 25 15:10:43 2016 (r294730) @@ -290,3 +290,38 @@ EARLY_DRIVER_MODULE(gic, simplebus, arm_ arm_gic_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); EARLY_DRIVER_MODULE(gic, ofwbus, arm_gic_fdt_driver, arm_gic_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); + +static struct ofw_compat_data gicv2m_compat_data[] = { + {"arm,gic-v2m-frame", true}, + {NULL, false} +}; + +static int +arm_gicv2m_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, gicv2m_compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "ARM Generic Interrupt Controller MSI/MSIX"); + return (BUS_PROBE_DEFAULT); +} + +static device_method_t arm_gicv2m_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, arm_gicv2m_fdt_probe), + + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_1(gicv2m, arm_gicv2m_fdt_driver, arm_gicv2m_fdt_methods, + sizeof(struct gicv2m_softc), arm_gicv2m_driver); + +static devclass_t arm_gicv2m_fdt_devclass; + +EARLY_DRIVER_MODULE(gicv2m, gic, arm_gicv2m_fdt_driver, + arm_gicv2m_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-head@freebsd.org Mon Jan 25 15:18:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA31A45A9F; Mon, 25 Jan 2016 15:18:34 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E59AD48; Mon, 25 Jan 2016 15:18:34 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PFIXSk034386; Mon, 25 Jan 2016 15:18:33 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PFIXYB034383; Mon, 25 Jan 2016 15:18:33 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601251518.u0PFIXYB034383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Mon, 25 Jan 2016 15:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294731 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 15:18:34 -0000 Author: zbb Date: Mon Jan 25 15:18:32 2016 New Revision: 294731 URL: https://svnweb.freebsd.org/changeset/base/294731 Log: Simplify GICv3 related drivers' naming Rename gic_v3_ instances to simply use 'gic' and 'its'. The information about the controller's revision is printed in the device announcement during boot anyway. The intention behind this change is to avoid somewhat misleading GIC instances naming such as: gic_v30 gic_v31 ... etc. Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5016 Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Mon Jan 25 15:10:43 2016 (r294730) +++ head/sys/arm64/arm64/gic_v3.c Mon Jan 25 15:18:32 2016 (r294731) @@ -84,7 +84,7 @@ static device_method_t gic_v3_methods[] DEVMETHOD_END }; -DEFINE_CLASS_0(gic_v3, gic_v3_driver, gic_v3_methods, +DEFINE_CLASS_0(gic, gic_v3_driver, gic_v3_methods, sizeof(struct gic_v3_softc)); /* Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Mon Jan 25 15:10:43 2016 (r294730) +++ head/sys/arm64/arm64/gic_v3_fdt.c Mon Jan 25 15:18:32 2016 (r294731) @@ -78,7 +78,7 @@ static device_method_t gic_v3_fdt_method DEVMETHOD_END }; -DEFINE_CLASS_1(gic_v3, gic_v3_fdt_driver, gic_v3_fdt_methods, +DEFINE_CLASS_1(gic, gic_v3_fdt_driver, gic_v3_fdt_methods, sizeof(struct gic_v3_softc), gic_v3_driver); static devclass_t gic_v3_fdt_devclass; @@ -287,12 +287,12 @@ static device_method_t gic_v3_its_fdt_me DEVMETHOD_END }; -DEFINE_CLASS_1(gic_v3_its, gic_v3_its_fdt_driver, gic_v3_its_fdt_methods, +DEFINE_CLASS_1(its, gic_v3_its_fdt_driver, gic_v3_its_fdt_methods, sizeof(struct gic_v3_its_softc), gic_v3_its_driver); static devclass_t gic_v3_its_fdt_devclass; -EARLY_DRIVER_MODULE(gic_v3_its, gic_v3, gic_v3_its_fdt_driver, +EARLY_DRIVER_MODULE(its, gic, gic_v3_its_fdt_driver, gic_v3_its_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); static int Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Mon Jan 25 15:10:43 2016 (r294730) +++ head/sys/arm64/arm64/gic_v3_its.c Mon Jan 25 15:18:32 2016 (r294731) @@ -82,7 +82,7 @@ static device_method_t gic_v3_its_method DEVMETHOD_END }; -DEFINE_CLASS_0(gic_v3_its, gic_v3_its_driver, gic_v3_its_methods, +DEFINE_CLASS_0(its, gic_v3_its_driver, gic_v3_its_methods, sizeof(struct gic_v3_its_softc)); MALLOC_DEFINE(M_GIC_V3_ITS, "GICv3 ITS", GIC_V3_ITS_DEVSTR); From owner-svn-src-head@freebsd.org Mon Jan 25 15:37:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0238CA461D4; Mon, 25 Jan 2016 15:37:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADB98AFC; Mon, 25 Jan 2016 15:37:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PFb1xI040273; Mon, 25 Jan 2016 15:37:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PFb1Av040272; Mon, 25 Jan 2016 15:37:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601251537.u0PFb1Av040272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 25 Jan 2016 15:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294732 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 15:37:03 -0000 Author: kib Date: Mon Jan 25 15:37:01 2016 New Revision: 294732 URL: https://svnweb.freebsd.org/changeset/base/294732 Log: Fix the %b flags string for ddb. All bits above the 5th (TF_OPENED_CONS) were broken in r188147 by adding TF_OPENED_CONS without updating the string. It was especially confusing to display OPENED_CONS as GONE and BYPASS as ZOMBIE. 2 flags at the end were not updated in r188487. Don't print an extra 0x prefix for %p in a ddb command. In the rest of the kernel there are more than 6000 lines with %p and only about 40 with this bug. Print a non-extra 0x prefix for %b in a ddb command. In the rest of the kernel, there are approx. 180 lines with %b and 2/3 of them have this bug. Submitted by: bde MFC after: 2 weeks Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Jan 25 15:18:32 2016 (r294731) +++ head/sys/kern/tty.c Mon Jan 25 15:37:01 2016 (r294732) @@ -2109,9 +2109,11 @@ static struct { }; #define TTY_FLAG_BITS \ - "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN\5OPENED_OUT\6GONE" \ - "\7OPENCLOSE\10ASYNC\11LITERAL\12HIWAT_IN\13HIWAT_OUT\14STOPPED" \ - "\15EXCLUDE\16BYPASS\17ZOMBIE\20HOOK" + "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN" \ + "\5OPENED_OUT\6OPENED_CONS\7GONE\10OPENCLOSE" \ + "\11ASYNC\12LITERAL\13HIWAT_IN\14HIWAT_OUT" \ + "\15STOPPED\16EXCLUDE\17BYPASS\20ZOMBIE" \ + "\21HOOK\22BUSY_IN\23BUSY_OUT" #define DB_PRINTSYM(name, addr) \ db_printf("%s " #name ": ", sep); \ @@ -2174,9 +2176,9 @@ DB_SHOW_COMMAND(tty, db_show_tty) } tp = (struct tty *)addr; - db_printf("0x%p: %s\n", tp, tty_devname(tp)); + db_printf("%p: %s\n", tp, tty_devname(tp)); db_printf("\tmtx: %p\n", tp->t_mtx); - db_printf("\tflags: %b\n", tp->t_flags, TTY_FLAG_BITS); + db_printf("\tflags: 0x%b\n", tp->t_flags, TTY_FLAG_BITS); db_printf("\trevokecnt: %u\n", tp->t_revokecnt); /* Buffering mechanisms. */ From owner-svn-src-head@freebsd.org Mon Jan 25 15:45:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56A75A4652F; Mon, 25 Jan 2016 15:45:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 E526534A; Mon, 25 Jan 2016 15:45:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u0PFirLQ067099 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 25 Jan 2016 17:44:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u0PFirLQ067099 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u0PFirrt067098; Mon, 25 Jan 2016 17:44:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 25 Jan 2016 17:44:53 +0200 From: Konstantin Belousov To: Svatopluk Kraus , Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294727 - head/sys/arm/arm Message-ID: <20160125154453.GA3942@kib.kiev.ua> References: <201601251409.u0PE9abE013306@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601251409.u0PE9abE013306@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 15:45:07 -0000 On Mon, Jan 25, 2016 at 02:09:36PM +0000, Svatopluk Kraus wrote: > Author: skra > Date: Mon Jan 25 14:09:35 2016 > New Revision: 294727 > URL: https://svnweb.freebsd.org/changeset/base/294727 > > Log: > Fix an occasional undefined instruction abort during module loading. > > Even if data cache maintenance was done by IO code, the relocation > fixup process creates dirty cache entries that we must write back > before doing icache sync. Does arm64 need the same fix ? From owner-svn-src-head@freebsd.org Mon Jan 25 16:18:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B08AA45146; Mon, 25 Jan 2016 16:18:55 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14DD9C26; Mon, 25 Jan 2016 16:18:55 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PGIsRh052581; Mon, 25 Jan 2016 16:18:54 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PGIsQ4052580; Mon, 25 Jan 2016 16:18:54 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251618.u0PGIsQ4052580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 16:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294734 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 16:18:55 -0000 Author: smh Date: Mon Jan 25 16:18:53 2016 New Revision: 294734 URL: https://svnweb.freebsd.org/changeset/base/294734 Log: Fix ixgbe compliation with DBG 1 Fixed ERROR_REPORTXX macros so that ixgbe compiles with #define DBG 1 MFC after: 1 week Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D5061 Modified: head/sys/dev/ixgbe/ixgbe_osdep.h Modified: head/sys/dev/ixgbe/ixgbe_osdep.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_osdep.h Mon Jan 25 16:18:08 2016 (r294733) +++ head/sys/dev/ixgbe/ixgbe_osdep.h Mon Jan 25 16:18:53 2016 (r294734) @@ -57,6 +57,15 @@ #define ASSERT(x) if(!(x)) panic("IXGBE: x") #define EWARN(H, W, S) printf(W) +enum { + IXGBE_ERROR_SOFTWARE, + IXGBE_ERROR_POLLING, + IXGBE_ERROR_INVALID_STATE, + IXGBE_ERROR_UNSUPPORTED, + IXGBE_ERROR_ARGUMENT, + IXGBE_ERROR_CAUTION, +}; + /* The happy-fun DELAY macro is defined in /usr/src/sys/i386/include/clock.h */ #define usec_delay(x) DELAY(x) #define msec_delay(x) DELAY(1000*(x)) @@ -73,9 +82,23 @@ #define DEBUGOUT5(S,A,B,C,D,E) printf(S "\n",A,B,C,D,E) #define DEBUGOUT6(S,A,B,C,D,E,F) printf(S "\n",A,B,C,D,E,F) #define DEBUGOUT7(S,A,B,C,D,E,F,G) printf(S "\n",A,B,C,D,E,F,G) - #define ERROR_REPORT1(S,A) printf(S "\n",A) - #define ERROR_REPORT2(S,A,B) printf(S "\n",A,B) - #define ERROR_REPORT3(S,A,B,C) printf(S "\n",A,B,C) + #define ERROR_REPORT1 ERROR_REPORT + #define ERROR_REPORT2 ERROR_REPORT + #define ERROR_REPORT3 ERROR_REPORT + #define ERROR_REPORT(level, format, arg...) do { \ + switch (level) { \ + case IXGBE_ERROR_SOFTWARE: \ + case IXGBE_ERROR_CAUTION: \ + case IXGBE_ERROR_POLLING: \ + case IXGBE_ERROR_INVALID_STATE: \ + case IXGBE_ERROR_UNSUPPORTED: \ + case IXGBE_ERROR_ARGUMENT: \ + device_printf(ixgbe_dev_from_hw(hw), format, ## arg); \ + break; \ + default: \ + break; \ + } \ + } while (0) #else #define DEBUGOUT(S) #define DEBUGOUT1(S,A) From owner-svn-src-head@freebsd.org Mon Jan 25 16:47:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A2D3A45FB2; Mon, 25 Jan 2016 16:47:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2310350; Mon, 25 Jan 2016 16:47:21 +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 u0PGlKYD061942; Mon, 25 Jan 2016 16:47:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PGlKRA061941; Mon, 25 Jan 2016 16:47:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601251647.u0PGlKRA061941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 25 Jan 2016 16:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294735 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 16:47:22 -0000 Author: kib Date: Mon Jan 25 16:47:20 2016 New Revision: 294735 URL: https://svnweb.freebsd.org/changeset/base/294735 Log: Don't allow opening the callout device when the callin device is already open (in disguise as the console device). The only allowed combination was supposed to be the callin device with the console. Fix the assertion in ttydev_close() that was meant to detect this (it only detected all 3 devices being open). Assert this in ttydev_open() too. Submitted by: bde MFC after: 2 weeks Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Jan 25 16:18:53 2016 (r294734) +++ head/sys/kern/tty.c Mon Jan 25 16:47:20 2016 (r294735) @@ -263,10 +263,10 @@ ttydev_open(struct cdev *dev, int oflags /* * Make sure the "tty" and "cua" device cannot be opened at the - * same time. + * same time. The console is a "tty" device. */ if (TTY_CALLOUT(tp, dev)) { - if (tp->t_flags & TF_OPENED_IN) { + if (tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) { error = EBUSY; goto done; } @@ -319,6 +319,8 @@ ttydev_open(struct cdev *dev, int oflags tp->t_flags |= TF_OPENED_OUT; else tp->t_flags |= TF_OPENED_IN; + MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || + (tp->t_flags & TF_OPENED_OUT) == 0); done: tp->t_flags &= ~TF_OPENCLOSE; cv_broadcast(&tp->t_dcdwait); @@ -338,7 +340,8 @@ ttydev_close(struct cdev *dev, int fflag * Don't actually close the device if it is being used as the * console. */ - MPASS((tp->t_flags & TF_OPENED) != TF_OPENED); + MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || + (tp->t_flags & TF_OPENED_OUT) == 0); if (dev == dev_console) tp->t_flags &= ~TF_OPENED_CONS; else From owner-svn-src-head@freebsd.org Mon Jan 25 16:49:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E42AA46091; Mon, 25 Jan 2016 16:49:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0C745765; Mon, 25 Jan 2016 16:49:40 +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 u0PGnd6m062061; Mon, 25 Jan 2016 16:49:39 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PGndk2062060; Mon, 25 Jan 2016 16:49:39 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601251649.u0PGndk2062060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 25 Jan 2016 16:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294736 - head/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 16:49:41 -0000 Author: br Date: Mon Jan 25 16:49:39 2016 New Revision: 294736 URL: https://svnweb.freebsd.org/changeset/base/294736 Log: Disable gprof and users on RISC-V, they don't build. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Jan 25 16:47:20 2016 (r294735) +++ head/usr.bin/Makefile Mon Jan 25 16:49:39 2016 (r294736) @@ -268,7 +268,8 @@ SUBDIR.${MK_TOOLCHAIN}+= ctags SUBDIR.${MK_TOOLCHAIN}+= cxxfilt SUBDIR.${MK_TOOLCHAIN}+= elfcopy SUBDIR.${MK_TOOLCHAIN}+= file2c -.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO gprof does not build +.if ${MACHINE_ARCH} != "aarch64" && \ # ARM64TODO gprof does not build + ${MACHINE_CPUARCH} != "riscv" # RISCVTODO gprof does not build SUBDIR.${MK_TOOLCHAIN}+= gprof .endif SUBDIR.${MK_TOOLCHAIN}+= indent @@ -290,7 +291,9 @@ SUBDIR.${MK_VT}+= vtfontcvt SUBDIR.${MK_USB}+= usbhidaction SUBDIR.${MK_USB}+= usbhidctl SUBDIR.${MK_UTMPX}+= last +.if ${MACHINE_CPUARCH} != "riscv" # RISCVTODO users does not build SUBDIR.${MK_UTMPX}+= users +.endif SUBDIR.${MK_UTMPX}+= who SUBDIR.${MK_SVN}+= svn SUBDIR.${MK_SVNLITE}+= svn From owner-svn-src-head@freebsd.org Mon Jan 25 17:01:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98B00A4651C; Mon, 25 Jan 2016 17:01:01 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 69EE8FD6; Mon, 25 Jan 2016 17:01:01 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (97e175b7.skybroadband.com [151.225.117.183]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id ACEA7D78FE; Mon, 25 Jan 2016 17:00:54 +0000 (UTC) Date: Mon, 25 Jan 2016 17:00:53 +0000 From: Andrew Turner To: Konstantin Belousov Cc: Svatopluk Kraus , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294727 - head/sys/arm/arm Message-ID: <20160125170053.7ae20536@zapp.Home> In-Reply-To: <20160125154453.GA3942@kib.kiev.ua> References: <201601251409.u0PE9abE013306@repo.freebsd.org> <20160125154453.GA3942@kib.kiev.ua> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 17:01:01 -0000 On Mon, 25 Jan 2016 17:44:53 +0200 Konstantin Belousov wrote: > On Mon, Jan 25, 2016 at 02:09:36PM +0000, Svatopluk Kraus wrote: > > Author: skra > > Date: Mon Jan 25 14:09:35 2016 > > New Revision: 294727 > > URL: https://svnweb.freebsd.org/changeset/base/294727 > > > > Log: > > Fix an occasional undefined instruction abort during module > > loading. > > Even if data cache maintenance was done by IO code, the relocation > > fixup process creates dirty cache entries that we must write back > > before doing icache sync. > Does arm64 need the same fix ? > I don't think so. On arm64 we call cpu_icache_sync_range to sync the I and D cache. This will clean the D-Cache to the Point of Coherency, then invalidate the I-Cache. I think this is slightly wrong as we only need to clean to the Point of Unification. Looking at the ARMv7 implementation of cpu_icache_sync_all is wrong, it only invalidates the I-Cache. cpu_icache_sync_range is almost correct, it will clean the D-Cache, with the same issue as arm64, but it is missing a barrier after this operation, and is missing a branch predictor invalidation. This change seems to be working around the brokenness of the existing cache sync operations rather than fixing them, however I don't know the details on why this approach to fixing the issue was taken. Andrew From owner-svn-src-head@freebsd.org Mon Jan 25 17:28:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E368BA46FE3 for ; Mon, 25 Jan 2016 17:28:54 +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 ACE531C3 for ; Mon, 25 Jan 2016 17:28:54 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 25 Jan 2016 17:29:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0PHSkbc025993; Mon, 25 Jan 2016 10:28:46 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1453742926.42081.8.camel@freebsd.org> Subject: Re: svn commit: r294727 - head/sys/arm/arm From: Ian Lepore To: Andrew Turner , Konstantin Belousov Cc: Svatopluk Kraus , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 25 Jan 2016 10:28:46 -0700 In-Reply-To: <20160125170053.7ae20536@zapp.Home> References: <201601251409.u0PE9abE013306@repo.freebsd.org> <20160125154453.GA3942@kib.kiev.ua> <20160125170053.7ae20536@zapp.Home> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 17:28:55 -0000 On Mon, 2016-01-25 at 17:00 +0000, Andrew Turner wrote: > On Mon, 25 Jan 2016 17:44:53 +0200 > Konstantin Belousov wrote: > > > On Mon, Jan 25, 2016 at 02:09:36PM +0000, Svatopluk Kraus wrote: > > > Author: skra > > > Date: Mon Jan 25 14:09:35 2016 > > > New Revision: 294727 > > > URL: https://svnweb.freebsd.org/changeset/base/294727 > > > > > > Log: > > > Fix an occasional undefined instruction abort during module > > > loading. > > > Even if data cache maintenance was done by IO code, the > > > relocation > > > fixup process creates dirty cache entries that we must write > > > back > > > before doing icache sync. > > Does arm64 need the same fix ? > > > > I don't think so. On arm64 we call cpu_icache_sync_range to sync the > I > and D cache. This will clean the D-Cache to the Point of Coherency, > then invalidate the I-Cache. I think this is slightly wrong as we > only > need to clean to the Point of Unification. > > Looking at the ARMv7 implementation of cpu_icache_sync_all is wrong, > it > only invalidates the I-Cache. cpu_icache_sync_range is almost > correct, > it will clean the D-Cache, with the same issue as arm64, but it is > missing a barrier after this operation, and is missing a branch > predictor invalidation. > > This change seems to be working around the brokenness of the existing > cache sync operations rather than fixing them, however I don't know > the > details on why this approach to fixing the issue was taken. > > Andrew > I disagree that the fact that icache_sync only cleans the icache means it's broken. It means that the callers have to do the right thing with the data cache before calling the icache ops depending on the situation, and that's what arm code has always done. In this case, we weren't failing to do the right thing because of broken code, we were failing due to my flawed analysis of the situation. As the original comment indicated, I believed the data caches were already clean due to the IO code cache operations. I negle cted to take into account the relocation fixup activity after the IO which re-dirtied some of the cache lines. -- Ian From owner-svn-src-head@freebsd.org Mon Jan 25 17:44:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C60A45900; Mon, 25 Jan 2016 17:44:10 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 51E8F22F; Mon, 25 Jan 2016 17:44:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (97e175b7.skybroadband.com [151.225.117.183]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 85819D78FE; Mon, 25 Jan 2016 17:43:39 +0000 (UTC) Date: Mon, 25 Jan 2016 17:43:38 +0000 From: Andrew Turner To: Ian Lepore Cc: Konstantin Belousov , Svatopluk Kraus , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294727 - head/sys/arm/arm Message-ID: <20160125174338.29103e6b@zapp.Home> In-Reply-To: <1453742926.42081.8.camel@freebsd.org> References: <201601251409.u0PE9abE013306@repo.freebsd.org> <20160125154453.GA3942@kib.kiev.ua> <20160125170053.7ae20536@zapp.Home> <1453742926.42081.8.camel@freebsd.org> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 17:44:10 -0000 On Mon, 25 Jan 2016 10:28:46 -0700 Ian Lepore wrote: > On Mon, 2016-01-25 at 17:00 +0000, Andrew Turner wrote: > > On Mon, 25 Jan 2016 17:44:53 +0200 > > Konstantin Belousov wrote: > > > > > On Mon, Jan 25, 2016 at 02:09:36PM +0000, Svatopluk Kraus wrote: > > > > Author: skra > > > > Date: Mon Jan 25 14:09:35 2016 > > > > New Revision: 294727 > > > > URL: https://svnweb.freebsd.org/changeset/base/294727 > > > > > > > > Log: > > > > Fix an occasional undefined instruction abort during module > > > > loading. > > > > Even if data cache maintenance was done by IO code, the > > > > relocation > > > > fixup process creates dirty cache entries that we must write > > > > back > > > > before doing icache sync. > > > Does arm64 need the same fix ? > > > > > > > I don't think so. On arm64 we call cpu_icache_sync_range to sync the > > I > > and D cache. This will clean the D-Cache to the Point of Coherency, > > then invalidate the I-Cache. I think this is slightly wrong as we > > only > > need to clean to the Point of Unification. > > > > Looking at the ARMv7 implementation of cpu_icache_sync_all is wrong, > > it > > only invalidates the I-Cache. cpu_icache_sync_range is almost > > correct, > > it will clean the D-Cache, with the same issue as arm64, but it is > > missing a barrier after this operation, and is missing a branch > > predictor invalidation. > > > > This change seems to be working around the brokenness of the > > existing cache sync operations rather than fixing them, however I > > don't know the > > details on why this approach to fixing the issue was taken. > > > > Andrew > > > > I disagree that the fact that icache_sync only cleans the icache means > it's broken. It means that the callers have to do the right thing > with the data cache before calling the icache ops depending on the > situation, and that's what arm code has always done. If it's not broken then we are needlessly issuing extra cache handling operations in other places. If we expect these function to sync the icache with an already clean dcache then armv7_icache_sync_all looks correct (other than a missing branch predictor invalidation). However in this case why are we cleaning the dcache in armv7_icache_sync_range? In arm9_icache_sync_all and arm9_icache_sync_range we flush the icache before cleaning the dcache. This also seems wrong given the above, however I'm unsure on the details of cache handling on these older CPUs. Andrew From owner-svn-src-head@freebsd.org Mon Jan 25 18:02:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8D05A45F92; Mon, 25 Jan 2016 18:02:29 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5C24D24; Mon, 25 Jan 2016 18:02:29 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PI2Svw085223; Mon, 25 Jan 2016 18:02:28 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PI2S8N085219; Mon, 25 Jan 2016 18:02:28 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601251802.u0PI2S8N085219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Mon, 25 Jan 2016 18:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294740 - in head/sys: arm/arm arm/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 18:02:29 -0000 Author: zbb Date: Mon Jan 25 18:02:28 2016 New Revision: 294740 URL: https://svnweb.freebsd.org/changeset/base/294740 Log: Introduce support for HW watchpoints and single stepping for ARMv6/v7 Allows for using hardware watchpoints for 1, 2, 4, 8 byte long addresses. The default configuration of watchpoint is RW but code allows to select RO or WO and X. Since debugging registers are per-CPU (CP14) the watchpoint is set on the CPU that was lucky (or not) to enter DDB. HW breakpoints are used to perform single step in KDB. When HW breakpoint is enabled all watchpoints are temporary disabled to avoid recursive abort on both watchpoint and breakpoint. In case of branch, the breakpoint is set to both - next instruction and possible branch address. This requires at least 2 breakpoints supported in the CPU however this is a must for ARMv6/v7 CPUs. Reviewed by: imp Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4037 Added: head/sys/arm/arm/debug_monitor.c (contents, props changed) head/sys/arm/include/debug_monitor.h (contents, props changed) Modified: head/sys/arm/arm/db_trace.c head/sys/arm/arm/machdep.c head/sys/arm/arm/trap-v6.c head/sys/arm/include/cpu-v6.h head/sys/arm/include/db_machdep.h head/sys/arm/include/kdb.h head/sys/arm/include/sysreg.h head/sys/conf/files.arm Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Mon Jan 25 17:40:53 2016 (r294739) +++ head/sys/arm/arm/db_trace.c Mon Jan 25 18:02:28 2016 (r294740) @@ -28,6 +28,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ +#include "opt_ddb.h" #include __FBSDID("$FreeBSD$"); @@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -127,22 +129,25 @@ db_stack_trace_cmd(struct unwind_state * } } -/* XXX stubs */ void db_md_list_watchpoints() { + + dbg_show_watchpoint(); } int db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) { - return (0); + + return (dbg_remove_watchpoint(addr, size)); } int db_md_set_watchpoint(db_expr_t addr, db_expr_t size) { - return (0); + + return (dbg_setup_watchpoint(addr, size, HW_WATCHPOINT_RW)); } int Added: head/sys/arm/arm/debug_monitor.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/debug_monitor.c Mon Jan 25 18:02:28 2016 (r294740) @@ -0,0 +1,943 @@ +/* + * Copyright (c) 2015 Juniper Networks Inc. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ddb.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +enum dbg_t { + DBG_TYPE_BREAKPOINT = 0, + DBG_TYPE_WATCHPOINT = 1, +}; + +struct dbg_wb_conf { + enum dbg_t type; + enum dbg_access_t access; + db_addr_t address; + db_expr_t size; + u_int slot; +}; + +static int dbg_reset_state(void); +static int dbg_setup_breakpoint(db_expr_t, db_expr_t, u_int); +static int dbg_remove_breakpoint(u_int); +static u_int dbg_find_slot(enum dbg_t, db_expr_t); +static boolean_t dbg_check_slot_free(enum dbg_t, u_int); + +static int dbg_remove_xpoint(struct dbg_wb_conf *); +static int dbg_setup_xpoint(struct dbg_wb_conf *); + +static boolean_t dbg_capable; /* Indicates that machine is capable of using + HW watchpoints/breakpoints */ +static boolean_t dbg_ready[MAXCPU]; /* Debug arch. reset performed on this CPU */ + +static uint32_t dbg_model; /* Debug Arch. Model */ +static boolean_t dbg_ossr; /* OS Save and Restore implemented */ + +static uint32_t dbg_watchpoint_num; +static uint32_t dbg_breakpoint_num; + +static int dbg_ref_count_mme[MAXCPU]; /* Times monitor mode was enabled */ + +/* ID_DFR0 - Debug Feature Register 0 */ +#define ID_DFR0_CP_DEBUG_M_SHIFT 0 +#define ID_DFR0_CP_DEBUG_M_MASK (0xF << ID_DFR0_CP_DEBUG_M_SHIFT) +#define ID_DFR0_CP_DEBUG_M_NS (0x0) /* Not supported */ +#define ID_DFR0_CP_DEBUG_M_V6 (0x2) /* v6 Debug arch. CP14 access */ +#define ID_DFR0_CP_DEBUG_M_V6_1 (0x3) /* v6.1 Debug arch. CP14 access */ +#define ID_DFR0_CP_DEBUG_M_V7 (0x4) /* v7 Debug arch. CP14 access */ +#define ID_DFR0_CP_DEBUG_M_V7_1 (0x5) /* v7.1 Debug arch. CP14 access */ + +/* DBGDIDR - Debug ID Register */ +#define DBGDIDR_WRPS_SHIFT 28 +#define DBGDIDR_WRPS_MASK (0xF << DBGDIDR_WRPS_SHIFT) +#define DBGDIDR_WRPS_NUM(reg) \ + ((((reg) & DBGDIDR_WRPS_MASK) >> DBGDIDR_WRPS_SHIFT) + 1) + +#define DBGDIDR_BRPS_SHIFT 24 +#define DBGDIDR_BRPS_MASK (0xF << DBGDIDR_BRPS_SHIFT) +#define DBGDIDR_BRPS_NUM(reg) \ + ((((reg) & DBGDIDR_BRPS_MASK) >> DBGDIDR_BRPS_SHIFT) + 1) + +/* DBGPRSR - Device Powerdown and Reset Status Register */ +#define DBGPRSR_PU (1 << 0) /* Powerup status */ + +/* DBGOSLSR - OS Lock Status Register */ +#define DBGOSLSR_OSLM0 (1 << 0) + +/* DBGOSDLR - OS Double Lock Register */ +#define DBGPRSR_DLK (1 << 0) /* OS Double Lock set */ + +/* DBGDSCR - Debug Status and Control Register */ +#define DBGSCR_MDBG_EN (1 << 15) /* Monitor debug-mode enable */ + +/* DBGWVR - Watchpoint Value Register */ +#define DBGWVR_ADDR_MASK (~0x3U) + +/* Watchpoints/breakpoints control register bitfields */ +#define DBG_WB_CTRL_LEN_1 (0x1 << 5) +#define DBG_WB_CTRL_LEN_2 (0x3 << 5) +#define DBG_WB_CTRL_LEN_4 (0xf << 5) +#define DBG_WB_CTRL_LEN_8 (0xff << 5) +#define DBG_WB_CTRL_LEN_MASK(x) ((x) & (0xff << 5)) +#define DBG_WB_CTRL_EXEC (0x0 << 3) +#define DBG_WB_CTRL_LOAD (0x1 << 3) +#define DBG_WB_CTRL_STORE (0x2 << 3) +#define DBG_WB_CTRL_ACCESS_MASK(x) ((x) & (0x3 << 3)) + +/* Common for breakpoint and watchpoint */ +#define DBG_WB_CTRL_PL1 (0x1 << 1) +#define DBG_WB_CTRL_PL0 (0x2 << 1) +#define DBG_WB_CTRL_PLX_MASK(x) ((x) & (0x3 << 1)) +#define DBG_WB_CTRL_E (0x1 << 0) + +/* + * Watchpoint/breakpoint helpers + */ +#define DBG_BKPT_BT_SLOT 0 /* Slot for branch taken */ +#define DBG_BKPT_BNT_SLOT 1 /* Slot for branch not taken */ + +#define OP2_SHIFT 4 + +/* Opc2 numbers for coprocessor instructions */ +#define DBG_WB_BVR 4 +#define DBG_WB_BCR 5 +#define DBG_WB_WVR 6 +#define DBG_WB_WCR 7 + +#define DBG_REG_BASE_BVR (DBG_WB_BVR << OP2_SHIFT) +#define DBG_REG_BASE_BCR (DBG_WB_BCR << OP2_SHIFT) +#define DBG_REG_BASE_WVR (DBG_WB_WVR << OP2_SHIFT) +#define DBG_REG_BASE_WCR (DBG_WB_WCR << OP2_SHIFT) + +#define DBG_WB_READ(cn, cm, op2, val) do { \ + __asm __volatile("mrc p14, 0, %0, " #cn "," #cm "," #op2 : "=r" (val)); \ +} while (0) + +#define DBG_WB_WRITE(cn, cm, op2, val) do { \ + __asm __volatile("mcr p14, 0, %0, " #cn "," #cm "," #op2 :: "r" (val)); \ +} while (0) + +#define READ_WB_REG_CASE(op2, m, val) \ + case (((op2) << OP2_SHIFT) + m): \ + DBG_WB_READ(c0, c ## m, op2, val); \ + break + +#define WRITE_WB_REG_CASE(op2, m, val) \ + case (((op2) << OP2_SHIFT) + m): \ + DBG_WB_WRITE(c0, c ## m, op2, val); \ + break + +#define SWITCH_CASES_READ_WB_REG(op2, val) \ + READ_WB_REG_CASE(op2, 0, val); \ + READ_WB_REG_CASE(op2, 1, val); \ + READ_WB_REG_CASE(op2, 2, val); \ + READ_WB_REG_CASE(op2, 3, val); \ + READ_WB_REG_CASE(op2, 4, val); \ + READ_WB_REG_CASE(op2, 5, val); \ + READ_WB_REG_CASE(op2, 6, val); \ + READ_WB_REG_CASE(op2, 7, val); \ + READ_WB_REG_CASE(op2, 8, val); \ + READ_WB_REG_CASE(op2, 9, val); \ + READ_WB_REG_CASE(op2, 10, val); \ + READ_WB_REG_CASE(op2, 11, val); \ + READ_WB_REG_CASE(op2, 12, val); \ + READ_WB_REG_CASE(op2, 13, val); \ + READ_WB_REG_CASE(op2, 14, val); \ + READ_WB_REG_CASE(op2, 15, val) + +#define SWITCH_CASES_WRITE_WB_REG(op2, val) \ + WRITE_WB_REG_CASE(op2, 0, val); \ + WRITE_WB_REG_CASE(op2, 1, val); \ + WRITE_WB_REG_CASE(op2, 2, val); \ + WRITE_WB_REG_CASE(op2, 3, val); \ + WRITE_WB_REG_CASE(op2, 4, val); \ + WRITE_WB_REG_CASE(op2, 5, val); \ + WRITE_WB_REG_CASE(op2, 6, val); \ + WRITE_WB_REG_CASE(op2, 7, val); \ + WRITE_WB_REG_CASE(op2, 8, val); \ + WRITE_WB_REG_CASE(op2, 9, val); \ + WRITE_WB_REG_CASE(op2, 10, val); \ + WRITE_WB_REG_CASE(op2, 11, val); \ + WRITE_WB_REG_CASE(op2, 12, val); \ + WRITE_WB_REG_CASE(op2, 13, val); \ + WRITE_WB_REG_CASE(op2, 14, val); \ + WRITE_WB_REG_CASE(op2, 15, val) + +static uint32_t +dbg_wb_read_reg(int reg, int n) +{ + uint32_t val; + + val = 0; + + switch (reg + n) { + SWITCH_CASES_READ_WB_REG(DBG_WB_WVR, val); + SWITCH_CASES_READ_WB_REG(DBG_WB_WCR, val); + SWITCH_CASES_READ_WB_REG(DBG_WB_BVR, val); + SWITCH_CASES_READ_WB_REG(DBG_WB_BCR, val); + default: + db_printf( + "trying to read from CP14 reg. using wrong opc2 %d\n", + reg >> OP2_SHIFT); + } + + return (val); +} + +static void +dbg_wb_write_reg(int reg, int n, uint32_t val) +{ + + switch (reg + n) { + SWITCH_CASES_WRITE_WB_REG(DBG_WB_WVR, val); + SWITCH_CASES_WRITE_WB_REG(DBG_WB_WCR, val); + SWITCH_CASES_WRITE_WB_REG(DBG_WB_BVR, val); + SWITCH_CASES_WRITE_WB_REG(DBG_WB_BCR, val); + default: + db_printf( + "trying to write to CP14 reg. using wrong opc2 %d\n", + reg >> OP2_SHIFT); + } + isb(); +} + +boolean_t +kdb_cpu_pc_is_singlestep(db_addr_t pc) +{ + + if (dbg_find_slot(DBG_TYPE_BREAKPOINT, pc) != ~0U) + return (TRUE); + + return (FALSE); +} + +void +kdb_cpu_set_singlestep(void) +{ + db_expr_t inst; + db_addr_t pc, brpc; + uint32_t wcr; + u_int i; + + /* + * Disable watchpoints, e.g. stepping over watched instruction will + * trigger break exception instead of single-step exception and locks + * CPU on that instruction for ever. + */ + for (i = 0; i < dbg_watchpoint_num; i++) { + wcr = dbg_wb_read_reg(DBG_REG_BASE_WCR, i); + if ((wcr & DBG_WB_CTRL_E) != 0) { + dbg_wb_write_reg(DBG_REG_BASE_WCR, i, + (wcr & ~DBG_WB_CTRL_E)); + } + } + + pc = PC_REGS(); + + inst = db_get_value(pc, sizeof(pc), FALSE); + if (inst_branch(inst) || inst_call(inst) || inst_return(inst)) { + brpc = branch_taken(inst, pc); + dbg_setup_breakpoint(brpc, INSN_SIZE, DBG_BKPT_BT_SLOT); + } + pc = next_instr_address(pc, 0); + dbg_setup_breakpoint(pc, INSN_SIZE, DBG_BKPT_BNT_SLOT); +} + +void +kdb_cpu_clear_singlestep(void) +{ + uint32_t wvr, wcr; + u_int i; + + dbg_remove_breakpoint(DBG_BKPT_BT_SLOT); + dbg_remove_breakpoint(DBG_BKPT_BNT_SLOT); + + /* Restore all watchpoints */ + for (i = 0; i < dbg_watchpoint_num; i++) { + wcr = dbg_wb_read_reg(DBG_REG_BASE_WCR, i); + wvr = dbg_wb_read_reg(DBG_REG_BASE_WVR, i); + /* Watchpoint considered not empty if address value is not 0 */ + if ((wvr & DBGWVR_ADDR_MASK) != 0) { + dbg_wb_write_reg(DBG_REG_BASE_WCR, i, + (wcr | DBG_WB_CTRL_E)); + } + } +} + +int +dbg_setup_watchpoint(db_expr_t addr, db_expr_t size, enum dbg_access_t access) +{ + struct dbg_wb_conf conf; + + if (access == HW_BREAKPOINT_X) { + db_printf("Invalid access type for watchpoint: %d\n", access); + return (EINVAL); + } + + conf.address = addr; + conf.size = size; + conf.access = access; + conf.type = DBG_TYPE_WATCHPOINT; + + return (dbg_setup_xpoint(&conf)); +} + +int +dbg_remove_watchpoint(db_expr_t addr, db_expr_t size __unused) +{ + struct dbg_wb_conf conf; + + conf.address = addr; + conf.type = DBG_TYPE_WATCHPOINT; + + return (dbg_remove_xpoint(&conf)); +} + +static int +dbg_setup_breakpoint(db_expr_t addr, db_expr_t size, u_int slot) +{ + struct dbg_wb_conf conf; + + conf.address = addr; + conf.size = size; + conf.access = HW_BREAKPOINT_X; + conf.type = DBG_TYPE_BREAKPOINT; + conf.slot = slot; + + return (dbg_setup_xpoint(&conf)); +} + +static int +dbg_remove_breakpoint(u_int slot) +{ + struct dbg_wb_conf conf; + + /* Slot already cleared. Don't recurse */ + if (dbg_check_slot_free(DBG_TYPE_BREAKPOINT, slot)) + return (0); + + conf.slot = slot; + conf.type = DBG_TYPE_BREAKPOINT; + + return (dbg_remove_xpoint(&conf)); +} + +static const char * +dbg_watchtype_str(uint32_t type) +{ + + switch (type) { + case DBG_WB_CTRL_EXEC: + return ("execute"); + case DBG_WB_CTRL_STORE: + return ("write"); + case DBG_WB_CTRL_LOAD: + return ("read"); + case DBG_WB_CTRL_LOAD | DBG_WB_CTRL_STORE: + return ("read/write"); + default: + return ("invalid"); + } +} + +static int +dbg_watchtype_len(uint32_t len) +{ + + switch (len) { + case DBG_WB_CTRL_LEN_1: + return (1); + case DBG_WB_CTRL_LEN_2: + return (2); + case DBG_WB_CTRL_LEN_4: + return (4); + case DBG_WB_CTRL_LEN_8: + return (8); + default: + return (0); + } +} + +void +dbg_show_watchpoint(void) +{ + uint32_t wcr, len, type; + uint32_t addr; + boolean_t is_enabled; + int i; + + if (!dbg_capable) { + db_printf("Architecture does not support HW " + "breakpoints/watchpoints\n"); + return; + } + + db_printf("\nhardware watchpoints:\n"); + db_printf(" watch status type len address symbol\n"); + db_printf(" ----- -------- ---------- --- ---------- ------------------\n"); + for (i = 0; i < dbg_watchpoint_num; i++) { + wcr = dbg_wb_read_reg(DBG_REG_BASE_WCR, i); + if ((wcr & DBG_WB_CTRL_E) != 0) + is_enabled = TRUE; + else + is_enabled = FALSE; + + type = DBG_WB_CTRL_ACCESS_MASK(wcr); + len = DBG_WB_CTRL_LEN_MASK(wcr); + addr = dbg_wb_read_reg(DBG_REG_BASE_WVR, i) & DBGWVR_ADDR_MASK; + db_printf(" %-5d %-8s %10s %3d 0x%08x ", i, + is_enabled ? "enabled" : "disabled", + is_enabled ? dbg_watchtype_str(type) : "", + is_enabled ? dbg_watchtype_len(len) : 0, + addr); + db_printsym((db_addr_t)addr, DB_STGY_ANY); + db_printf("\n"); + } +} + +static boolean_t +dbg_check_slot_free(enum dbg_t type, u_int slot) +{ + uint32_t cr, vr; + uint32_t max; + + switch(type) { + case DBG_TYPE_BREAKPOINT: + max = dbg_breakpoint_num; + cr = DBG_REG_BASE_BCR; + vr = DBG_REG_BASE_BVR; + break; + case DBG_TYPE_WATCHPOINT: + max = dbg_watchpoint_num; + cr = DBG_REG_BASE_WCR; + vr = DBG_REG_BASE_WVR; + break; + default: + db_printf("%s: Unsupported event type %d\n", __func__, type); + return (FALSE); + } + + if (slot >= max) { + db_printf("%s: Invalid slot number %d, max %d\n", + __func__, slot, max - 1); + return (FALSE); + } + + if ((dbg_wb_read_reg(cr, slot) & DBG_WB_CTRL_E) == 0 && + (dbg_wb_read_reg(vr, slot) & DBGWVR_ADDR_MASK) == 0) + return (TRUE); + + return (FALSE); +} + +static u_int +dbg_find_free_slot(enum dbg_t type) +{ + u_int max, i; + + switch(type) { + case DBG_TYPE_BREAKPOINT: + max = dbg_breakpoint_num; + break; + case DBG_TYPE_WATCHPOINT: + max = dbg_watchpoint_num; + break; + default: + db_printf("Unsupported debug type\n"); + return (~0U); + } + + for (i = 0; i < max; i++) { + if (dbg_check_slot_free(type, i)) + return (i); + } + + return (~0U); +} + +static u_int +dbg_find_slot(enum dbg_t type, db_expr_t addr) +{ + uint32_t reg_addr, reg_ctrl; + u_int max, i; + + switch(type) { + case DBG_TYPE_BREAKPOINT: + max = dbg_breakpoint_num; + reg_addr = DBG_REG_BASE_BVR; + reg_ctrl = DBG_REG_BASE_BCR; + break; + case DBG_TYPE_WATCHPOINT: + max = dbg_watchpoint_num; + reg_addr = DBG_REG_BASE_WVR; + reg_ctrl = DBG_REG_BASE_WCR; + break; + default: + db_printf("Unsupported debug type\n"); + return (~0U); + } + + for (i = 0; i < max; i++) { + if ((dbg_wb_read_reg(reg_addr, i) == addr) && + ((dbg_wb_read_reg(reg_ctrl, i) & DBG_WB_CTRL_E) != 0)) + return (i); + } + + return (~0U); +} + +static __inline boolean_t +dbg_monitor_is_enabled(void) +{ + + return ((cp14_dbgdscrint_get() & DBGSCR_MDBG_EN) != 0); +} + +static int +dbg_enable_monitor(void) +{ + uint32_t dbg_dscr; + + /* Already enabled? Just increment reference counter and return */ + if (dbg_monitor_is_enabled()) { + dbg_ref_count_mme[PCPU_GET(cpuid)]++; + return (0); + } + + dbg_dscr = cp14_dbgdscrint_get(); + + switch (dbg_model) { + case ID_DFR0_CP_DEBUG_M_V6: + case ID_DFR0_CP_DEBUG_M_V6_1: /* fall through */ + cp14_dbgdscr_v6_set(dbg_dscr | DBGSCR_MDBG_EN); + break; + case ID_DFR0_CP_DEBUG_M_V7: /* fall through */ + case ID_DFR0_CP_DEBUG_M_V7_1: + cp14_dbgdscr_v7_set(dbg_dscr | DBGSCR_MDBG_EN); + break; + default: + break; + } + isb(); + + /* Verify that Monitor mode is set */ + if (dbg_monitor_is_enabled()) { + dbg_ref_count_mme[PCPU_GET(cpuid)]++; + return (0); + } + + return (ENXIO); +} + +static int +dbg_disable_monitor(void) +{ + uint32_t dbg_dscr; + + if (!dbg_monitor_is_enabled()) + return (0); + + if (--dbg_ref_count_mme[PCPU_GET(cpuid)] > 0) + return (0); + + dbg_dscr = cp14_dbgdscrint_get(); + switch (dbg_model) { + case ID_DFR0_CP_DEBUG_M_V6: + case ID_DFR0_CP_DEBUG_M_V6_1: /* fall through */ + dbg_dscr &= ~DBGSCR_MDBG_EN; + cp14_dbgdscr_v6_set(dbg_dscr); + break; + case ID_DFR0_CP_DEBUG_M_V7: /* fall through */ + case ID_DFR0_CP_DEBUG_M_V7_1: + dbg_dscr &= ~DBGSCR_MDBG_EN; + cp14_dbgdscr_v7_set(dbg_dscr); + break; + default: + return (ENXIO); + } + isb(); + + return (0); +} + +static int +dbg_setup_xpoint(struct dbg_wb_conf *conf) +{ + const char *typestr; + uint32_t cr_size, cr_priv, cr_access; + uint32_t reg_ctrl, reg_addr, ctrl, addr; + boolean_t is_bkpt; + u_int cpuid; + u_int i; + int err; + + if (!dbg_capable) + return (ENXIO); + + is_bkpt = (conf->type == DBG_TYPE_BREAKPOINT); + typestr = is_bkpt ? "breakpoint" : "watchpoint"; + + cpuid = PCPU_GET(cpuid); + if (!dbg_ready[cpuid]) { + err = dbg_reset_state(); + if (err != 0) + return (err); + dbg_ready[cpuid] = TRUE; + } + + if (is_bkpt) { + if (dbg_breakpoint_num == 0) { + db_printf("Breakpoints not supported on this architecture\n"); + return (ENXIO); + } + i = conf->slot; + if (!dbg_check_slot_free(DBG_TYPE_BREAKPOINT, i)) { + /* + * This should never happen. If it does it means that + * there is an erroneus scenario somewhere. Still, it can + * be done but let's inform the user. + */ + db_printf("ERROR: Breakpoint already set. Replacing...\n"); + } + } else { + i = dbg_find_free_slot(DBG_TYPE_WATCHPOINT); + if (i == ~0U) { + db_printf("Can not find slot for %s, max %d slots supported\n", + typestr, dbg_watchpoint_num); + return (ENXIO); + } + } + + /* Kernel access only */ + cr_priv = DBG_WB_CTRL_PL1; + + switch(conf->size) { + case 1: + cr_size = DBG_WB_CTRL_LEN_1; + break; + case 2: + cr_size = DBG_WB_CTRL_LEN_2; + break; + case 4: + cr_size = DBG_WB_CTRL_LEN_4; + break; + case 8: + cr_size = DBG_WB_CTRL_LEN_8; + break; + default: + db_printf("Unsupported address size for %s\n", typestr); + return (EINVAL); + } + + if (is_bkpt) { + cr_access = DBG_WB_CTRL_EXEC; + reg_ctrl = DBG_REG_BASE_BCR; + reg_addr = DBG_REG_BASE_BVR; + /* Always unlinked BKPT */ + ctrl = (cr_size | cr_access | cr_priv | DBG_WB_CTRL_E); + } else { + switch(conf->access) { + case HW_WATCHPOINT_R: + cr_access = DBG_WB_CTRL_LOAD; + break; + case HW_WATCHPOINT_W: + cr_access = DBG_WB_CTRL_STORE; + break; + case HW_WATCHPOINT_RW: + cr_access = DBG_WB_CTRL_LOAD | DBG_WB_CTRL_STORE; + break; + default: + db_printf("Unsupported exception level for %s\n", typestr); + return (EINVAL); + } + + reg_ctrl = DBG_REG_BASE_WCR; + reg_addr = DBG_REG_BASE_WVR; + ctrl = (cr_size | cr_access | cr_priv | DBG_WB_CTRL_E); + } + + addr = conf->address; + + dbg_wb_write_reg(reg_addr, i, addr); + dbg_wb_write_reg(reg_ctrl, i, ctrl); + + return (dbg_enable_monitor()); +} + +static int +dbg_remove_xpoint(struct dbg_wb_conf *conf) +{ + uint32_t reg_ctrl, reg_addr, addr; + u_int cpuid; + u_int i; + int err; + + if (!dbg_capable) + return (ENXIO); + + cpuid = PCPU_GET(cpuid); + if (!dbg_ready[cpuid]) { + err = dbg_reset_state(); + if (err != 0) + return (err); + dbg_ready[cpuid] = TRUE; + } + + addr = conf->address; + + if (conf->type == DBG_TYPE_BREAKPOINT) { + i = conf->slot; + reg_ctrl = DBG_REG_BASE_BCR; + reg_addr = DBG_REG_BASE_BVR; + } else { + i = dbg_find_slot(DBG_TYPE_WATCHPOINT, addr); + if (i == ~0U) { + db_printf("Can not find watchpoint for address 0%x\n", addr); + return (EINVAL); + } + reg_ctrl = DBG_REG_BASE_WCR; + reg_addr = DBG_REG_BASE_WVR; + } + + dbg_wb_write_reg(reg_ctrl, i, 0); + dbg_wb_write_reg(reg_addr, i, 0); + + return (dbg_disable_monitor()); +} + +static __inline uint32_t +dbg_get_debug_model(void) +{ + uint32_t dbg_m; + + dbg_m = ((cpuinfo.id_dfr0 & ID_DFR0_CP_DEBUG_M_MASK) >> + ID_DFR0_CP_DEBUG_M_SHIFT); + + return (dbg_m); +} + +static __inline boolean_t +dbg_get_ossr(void) +{ + + switch (dbg_model) { + case ID_DFR0_CP_DEBUG_M_V6_1: + if ((cp14_dbgoslsr_get() & DBGOSLSR_OSLM0) != 0) + return (TRUE); + + return (FALSE); + case ID_DFR0_CP_DEBUG_M_V7_1: + return (TRUE); + default: + return (FALSE); + } +} + +static __inline boolean_t +dbg_arch_supported(void) +{ + + switch (dbg_model) { + case ID_DFR0_CP_DEBUG_M_V6: + case ID_DFR0_CP_DEBUG_M_V6_1: + case ID_DFR0_CP_DEBUG_M_V7: + case ID_DFR0_CP_DEBUG_M_V7_1: /* fall through */ + return (TRUE); + default: + /* We only support valid v6.x/v7.x modes through CP14 */ + return (FALSE); + } +} + +static __inline uint32_t +dbg_get_wrp_num(void) +{ + uint32_t dbg_didr; + + dbg_didr = cp14_dbgdidr_get(); + + return (DBGDIDR_WRPS_NUM(dbg_didr)); +} + +static __inline uint32_t +dgb_get_brp_num(void) +{ + uint32_t dbg_didr; + + dbg_didr = cp14_dbgdidr_get(); + + return (DBGDIDR_BRPS_NUM(dbg_didr)); +} + +static int +dbg_reset_state(void) +{ + u_int cpuid; + size_t i; + int err; + + cpuid = PCPU_GET(cpuid); + err = 0; + + switch (dbg_model) { + case ID_DFR0_CP_DEBUG_M_V6: + /* v6 Debug logic reset upon power-up */ + return (0); + case ID_DFR0_CP_DEBUG_M_V6_1: + /* Is core power domain powered up? */ + if ((cp14_dbgprsr_get() & DBGPRSR_PU) == 0) + err = ENXIO; + + if (err != 0) + break; + + if (dbg_ossr) + goto vectr_clr; + break; + case ID_DFR0_CP_DEBUG_M_V7: + break; + case ID_DFR0_CP_DEBUG_M_V7_1: + /* Is double lock set? */ + if ((cp14_dbgosdlr_get() & DBGPRSR_DLK) != 0) + err = ENXIO; + + break; + default: + break; + } + + if (err != 0) { + db_printf("Debug facility locked (CPU%d)\n", cpuid); + return (err); + } + + /* + * DBGOSLAR is always implemented for v7.1 Debug Arch. however is + * optional for v7 (depends on OS save and restore support). + */ + if (((dbg_model & ID_DFR0_CP_DEBUG_M_V7_1) != 0) || dbg_ossr) { + /* + * Clear OS lock. + * Writing any other value than 0xC5ACCESS will unlock. + */ + cp14_dbgoslar_set(0); + isb(); + } + +vectr_clr: + /* + * After reset we must ensure that DBGVCR has a defined value. + * Disable all vector catch events. Safe to use - required in all + * implementations. + */ + cp14_dbgvcr_set(0); + isb(); + + /* + * We have limited number of {watch,break}points, each consists of + * two registers: + * - wcr/bcr regsiter configurates corresponding {watch,break}point + * behaviour + * - wvr/bvr register keeps address we are hunting for + * + * Reset all breakpoints and watchpoints. + */ + for (i = 0; i < dbg_watchpoint_num; ++i) { + dbg_wb_write_reg(DBG_REG_BASE_WCR, i, 0); + dbg_wb_write_reg(DBG_REG_BASE_WVR, i, 0); + } + + for (i = 0; i < dbg_breakpoint_num; ++i) { + dbg_wb_write_reg(DBG_REG_BASE_BCR, i, 0); + dbg_wb_write_reg(DBG_REG_BASE_BVR, i, 0); + } + + return (0); +} + +void +dbg_monitor_init(void) +{ + int err; + + /* Fetch ARM Debug Architecture model */ + dbg_model = dbg_get_debug_model(); + + if (!dbg_arch_supported()) { + db_printf("ARM Debug Architecture not supported\n"); + return; + } + + if (bootverbose) { + db_printf("ARM Debug Architecture %s\n", + (dbg_model == ID_DFR0_CP_DEBUG_M_V6) ? "v6" : + (dbg_model == ID_DFR0_CP_DEBUG_M_V6_1) ? "v6.1" : + (dbg_model == ID_DFR0_CP_DEBUG_M_V7) ? "v7" : + (dbg_model == ID_DFR0_CP_DEBUG_M_V7_1) ? "v7.1" : "unknown"); + } + + /* Do we have OS Save and Restore mechanism? */ + dbg_ossr = dbg_get_ossr(); + + /* Find out many breakpoints and watchpoints we can use */ + dbg_watchpoint_num = dbg_get_wrp_num(); + dbg_breakpoint_num = dgb_get_brp_num(); + + if (bootverbose) { + db_printf("%d watchpoints and %d breakpoints supported\n", + dbg_watchpoint_num, dbg_breakpoint_num); + } + + err = dbg_reset_state(); + if (err == 0) { + dbg_capable = TRUE; + return; + } + + db_printf("HW Breakpoints/Watchpoints not enabled on CPU%d\n", + PCPU_GET(cpuid)); +} Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Jan 25 17:40:53 2016 (r294739) +++ head/sys/arm/arm/machdep.c Mon Jan 25 18:02:28 2016 (r294740) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Jan 25 18:16:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A11F7718; Mon, 25 Jan 2016 18:16:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id 357F28C1; Mon, 25 Jan 2016 18:16: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 u0PIGgcd088407; Mon, 25 Jan 2016 18:16:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PIGgBd088406; Mon, 25 Jan 2016 18:16:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601251816.u0PIGgBd088406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 18:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294741 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 18:16:43 -0000 Author: bdrewery Date: Mon Jan 25 18:16:41 2016 New Revision: 294741 URL: https://svnweb.freebsd.org/changeset/base/294741 Log: Import latest auto.obj.mk 1.12 from contrib/bmake/mk. Modified: head/share/mk/auto.obj.mk Modified: head/share/mk/auto.obj.mk ============================================================================== --- head/share/mk/auto.obj.mk Mon Jan 25 18:02:28 2016 (r294740) +++ head/share/mk/auto.obj.mk Mon Jan 25 18:16:41 2016 (r294741) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: auto.obj.mk,v 1.10 2015/04/16 16:59:00 sjg Exp $ +# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -41,12 +41,12 @@ MKOBJDIRS= auto .if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto # Use __objdir here so it is easier to tweak without impacting # the logic. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}) +.if !empty(MAKEOBJDIRPREFIX) __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} -__objdir:= ${__objdir:tA} -.if ${.OBJDIR} != ${__objdir} +__objdir:= ${__objdir} +.if ${.OBJDIR:tA} != ${__objdir:tA} # We need to chdir, make the directory if needed .if !exists(${__objdir}/) && \ (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") @@ -54,11 +54,10 @@ __objdir:= ${__objdir:tA} __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ ${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \ ${Mkdirs}; Mkdirs ${__objdir} -__objdir:= ${__objdir:tA} .endif # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} -.if ${.OBJDIR} != ${__objdir} && ${__objdir_made:Uno:M${__objdir}/*} != "" +.if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .endif From owner-svn-src-head@freebsd.org Mon Jan 25 18:34:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DDE77E0A; Mon, 25 Jan 2016 18:34: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 mx1.freebsd.org (Postfix) with ESMTPS id 3EFBE250; Mon, 25 Jan 2016 18:34: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 u0PIYFHh094106; Mon, 25 Jan 2016 18:34:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PIYFFE094105; Mon, 25 Jan 2016 18:34:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601251834.u0PIYFFE094105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 18:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294742 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 18:34:16 -0000 Author: bdrewery Date: Mon Jan 25 18:34:15 2016 New Revision: 294742 URL: https://svnweb.freebsd.org/changeset/base/294742 Log: Import latest meta.subdir.mk 1.11 from contrib/bmake/mk Modified: head/share/mk/meta.subdir.mk Modified: head/share/mk/meta.subdir.mk ============================================================================== --- head/share/mk/meta.subdir.mk Mon Jan 25 18:16:41 2016 (r294741) +++ head/share/mk/meta.subdir.mk Mon Jan 25 18:34:15 2016 (r294742) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: meta.subdir.mk,v 1.10 2012/07/03 05:26:46 sjg Exp $ +# $Id: meta.subdir.mk,v 1.11 2015/11/24 22:26:51 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -63,7 +63,7 @@ _subdeps != cd ${.CURDIR} && \ DIRDEPS = .else # clean up if needed -DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIREPS_FILTER:Uu}} +DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIRDEPS_FILTER:Uu}} .endif # we just dealt with it, if we leave it defined, # dirdeps.mk will compute some interesting combinations. From owner-svn-src-head@freebsd.org Mon Jan 25 18:40:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 733FDA45098; Mon, 25 Jan 2016 18:40:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4135E6CE; Mon, 25 Jan 2016 18:40:26 +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 u0PIePeq094352; Mon, 25 Jan 2016 18:40:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PIePbQ094351; Mon, 25 Jan 2016 18:40:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601251840.u0PIePbQ094351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 18:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294743 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 18:40:26 -0000 Author: bdrewery Date: Mon Jan 25 18:40:25 2016 New Revision: 294743 URL: https://svnweb.freebsd.org/changeset/base/294743 Log: Import latest gendirdeps.mk 1.29 from contrib/bmake/mk Modified: head/share/mk/gendirdeps.mk Modified: head/share/mk/gendirdeps.mk ============================================================================== --- head/share/mk/gendirdeps.mk Mon Jan 25 18:34:15 2016 (r294742) +++ head/share/mk/gendirdeps.mk Mon Jan 25 18:40:25 2016 (r294743) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: gendirdeps.mk,v 1.27 2015/06/08 20:55:11 sjg Exp $ +# $Id: gendirdeps.mk,v 1.29 2015/10/03 05:00:46 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -158,7 +158,7 @@ M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OB .endif # we are only interested in the dirs -# sepecifically those we read something from. +# specifically those we read something from. # we canonicalize them to keep things simple # if we are using a split-fs sandbox, it gets a little messier. _objtop := ${_OBJTOP:tA} From owner-svn-src-head@freebsd.org Mon Jan 25 18:43:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54D7CA452EC; Mon, 25 Jan 2016 18:43:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0C366BF6; Mon, 25 Jan 2016 18:43:22 +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 u0PIhMDh097057; Mon, 25 Jan 2016 18:43:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PIhMa0097056; Mon, 25 Jan 2016 18:43:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601251843.u0PIhMa0097056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 18:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294744 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 18:43:23 -0000 Author: bdrewery Date: Mon Jan 25 18:43:21 2016 New Revision: 294744 URL: https://svnweb.freebsd.org/changeset/base/294744 Log: Import latest host-target.mk 1.11 from contrib/bmake/mk Modified: head/share/mk/host-target.mk Modified: head/share/mk/host-target.mk ============================================================================== --- head/share/mk/host-target.mk Mon Jan 25 18:40:25 2016 (r294743) +++ head/share/mk/host-target.mk Mon Jan 25 18:43:21 2016 (r294744) @@ -1,6 +1,6 @@ # $FreeBSD$ # RCSid: -# $Id: host-target.mk,v 1.7 2014/05/16 17:54:52 sjg Exp $ +# $Id: host-target.mk,v 1.11 2015/10/25 00:07:20 sjg Exp $ # Host platform information; may be overridden .if !defined(_HOST_OSNAME) @@ -11,24 +11,33 @@ _HOST_OSNAME != uname -s _HOST_OSREL != uname -r .export _HOST_OSREL .endif +.if !defined(_HOST_MACHINE) +_HOST_MACHINE != uname -m +.export _HOST_MACHINE +.endif .if !defined(_HOST_ARCH) -_HOST_ARCH != uname -p 2>/dev/null || uname -m +# for NetBSD prefer $MACHINE (amd64 rather than x86_64) +.if ${_HOST_OSNAME:NNetBSD} == "" +_HOST_ARCH := ${_HOST_MACHINE} +.else +_HOST_ARCH != uname -p 2> /dev/null || uname -m # uname -p may produce garbage on linux -.if ${_HOST_ARCH:[\#]} > 1 -_HOST_ARCH != uname -m +.if ${_HOST_ARCH:[\#]} > 1 || ${_HOST_ARCH:Nunknown} == "" +_HOST_ARCH := ${_HOST_MACHINE} +.endif .endif .export _HOST_ARCH .endif .if !defined(HOST_MACHINE) -HOST_MACHINE != uname -m +HOST_MACHINE := ${_HOST_MACHINE} .export HOST_MACHINE .endif HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//} -HOST_OSTYPE := ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} +HOST_OSTYPE := ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} HOST_OS := ${_HOST_OSNAME} host_os := ${_HOST_OSNAME:tl} -HOST_TARGET := ${host_os}${HOST_OSMAJOR}-${_HOST_ARCH} +HOST_TARGET := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH} # tr is insanely non-portable, accommodate the lowest common denominator TR ?= tr From owner-svn-src-head@freebsd.org Mon Jan 25 18:47:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0863A45455; Mon, 25 Jan 2016 18:47:11 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::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 BC806F5F; Mon, 25 Jan 2016 18:47:11 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-ig0-x22c.google.com with SMTP id ik10so40775830igb.1; Mon, 25 Jan 2016 10:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wcRDTreqRtVIVyFGRRD5USfrUaVbh9p99/J9Hq6zxqM=; b=euPwLnJRy6xl8cCzApbwRtUS9pxKSPQhF197X+n1ttv7Xz8gICrFws35wfmwc5sdfI jmjGtWDLjcKNX+HyiDN6qI3fMUdyxpab9Y2R6Pb4j+sPE4+U12TzlL/gsi7PdLKPoZcD giHpEMmyI0WGgmbCGRMlZX4kzXCUE7q/qQkN4vc5xT1vg0gKJP8R1faERO1t/gu46M1A ro3ih0tly5CPPHfXeXMePRzVgdYYEXCDlB32iKRePu/rciB0Kbr4nlxyHJWHwuxNZ4gR kMlHdRB6q82HgtGnV+BKet0ZAbP2c3YhGErzPikLBPxQOhXghxOLrpTpwfeohNdaloEe hwOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wcRDTreqRtVIVyFGRRD5USfrUaVbh9p99/J9Hq6zxqM=; b=cRT6DnLRRYaVccCgwpUPdrOusMout4wRZ2PCic78vEw0W2bMWZ+68hiSgVBtETrtmL 96gtbbmX1WNbNayaXV1pNNuAef0Ft5pUMcZTfmjh2BYYZ6jaTUA0Xs0jMzn8fR5+12MQ JeWV+Pua8X+ouCAJJWyM0qoYomGfMRAtPl0Dj/qA2uSUJnoTKTiBbXKTy91pkG/AfXWW z00P5EKt5DNzMQNbHmGYa2b3p+QmRQCPY6tih7R2sRHJoWt3m8EcQs5jYwCdDOeBqHB0 V/zTxXV8LlXwxxSd2yq+xzAhlsx3iTCWxxs3KrT8KHfM3fX8wYUgZ3DHioNFmKl9FZyP zEDA== X-Gm-Message-State: AG10YORgaKYr5zIEGpffoq8r7gzLmnkJCnRGvji1PB5hRVmbYriAy5vKdlnqkXKVK4Hnu0DA9h68sujsBhoKVg== MIME-Version: 1.0 X-Received: by 10.50.40.8 with SMTP id t8mr19436418igk.26.1453747631217; Mon, 25 Jan 2016 10:47:11 -0800 (PST) Received: by 10.64.55.97 with HTTP; Mon, 25 Jan 2016 10:47:11 -0800 (PST) In-Reply-To: <20160125174338.29103e6b@zapp.Home> References: <201601251409.u0PE9abE013306@repo.freebsd.org> <20160125154453.GA3942@kib.kiev.ua> <20160125170053.7ae20536@zapp.Home> <1453742926.42081.8.camel@freebsd.org> <20160125174338.29103e6b@zapp.Home> Date: Mon, 25 Jan 2016 19:47:11 +0100 Message-ID: Subject: Re: svn commit: r294727 - head/sys/arm/arm From: Svatopluk Kraus To: Andrew Turner Cc: Ian Lepore , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 18:47:12 -0000 On Mon, Jan 25, 2016 at 6:43 PM, Andrew Turner wrote: > On Mon, 25 Jan 2016 10:28:46 -0700 > Ian Lepore wrote: > >> On Mon, 2016-01-25 at 17:00 +0000, Andrew Turner wrote: >> > On Mon, 25 Jan 2016 17:44:53 +0200 >> > Konstantin Belousov wrote: >> > >> > > On Mon, Jan 25, 2016 at 02:09:36PM +0000, Svatopluk Kraus wrote: >> > > > Author: skra >> > > > Date: Mon Jan 25 14:09:35 2016 >> > > > New Revision: 294727 >> > > > URL: https://svnweb.freebsd.org/changeset/base/294727 >> > > > >> > > > Log: >> > > > Fix an occasional undefined instruction abort during module >> > > > loading. >> > > > Even if data cache maintenance was done by IO code, the >> > > > relocation >> > > > fixup process creates dirty cache entries that we must write >> > > > back >> > > > before doing icache sync. >> > > Does arm64 need the same fix ? >> > > >> > >> > I don't think so. On arm64 we call cpu_icache_sync_range to sync the >> > I >> > and D cache. This will clean the D-Cache to the Point of Coherency, >> > then invalidate the I-Cache. I think this is slightly wrong as we >> > only >> > need to clean to the Point of Unification. >> > >> > Looking at the ARMv7 implementation of cpu_icache_sync_all is wrong, >> > it >> > only invalidates the I-Cache. cpu_icache_sync_range is almost >> > correct, >> > it will clean the D-Cache, with the same issue as arm64, but it is >> > missing a barrier after this operation, and is missing a branch >> > predictor invalidation. >> > >> > This change seems to be working around the brokenness of the >> > existing cache sync operations rather than fixing them, however I >> > don't know the >> > details on why this approach to fixing the issue was taken. >> > >> > Andrew >> > >> >> I disagree that the fact that icache_sync only cleans the icache means >> it's broken. It means that the callers have to do the right thing >> with the data cache before calling the icache ops depending on the >> situation, and that's what arm code has always done. > > If it's not broken then we are needlessly issuing extra cache handling > operations in other places. > > If we expect these function to sync the icache with an already clean > dcache then armv7_icache_sync_all looks correct (other than a missing > branch predictor invalidation). However in this case why are we > cleaning the dcache in armv7_icache_sync_range? > > In arm9_icache_sync_all and arm9_icache_sync_range we flush the icache > before cleaning the dcache. This also seems wrong given the above, > however I'm unsure on the details of cache handling on these older CPUs. > > Andrew Well, looking at patch, there is #if __ARM_ARCH >= 6 in the patch. For armv6/v7, the patch is perfectly correct. It does dcache_wb_pou() and then icache_inv_all(). According to arm arm manual, icache-invalidate-all does invalidate branch predictor cache too. I believe that cpu specific function (like armv7_icache_sync_all) are not used anymore for ARM_NEW_PMAP, which means armv6/v7. WRT armv4, I'm not familiar with their implementation, but the function calling sequence should be okay too. Svata From owner-svn-src-head@freebsd.org Mon Jan 25 19:11:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5F9CA45F3A; Mon, 25 Jan 2016 19:11:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id B83441F33; Mon, 25 Jan 2016 19:11:35 +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 u0PJBYYn006008; Mon, 25 Jan 2016 19:11:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PJBYo8006007; Mon, 25 Jan 2016 19:11:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601251911.u0PJBYo8006007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 19:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294745 - head/lib/libc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 19:11:36 -0000 Author: bdrewery Date: Mon Jan 25 19:11:34 2016 New Revision: 294745 URL: https://svnweb.freebsd.org/changeset/base/294745 Log: Replace .CURDIR with SRCTOP to respect LIBC_SRCTOP feature. Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Mon Jan 25 18:43:21 2016 (r294744) +++ head/lib/libc/Makefile Mon Jan 25 19:11:34 2016 (r294745) @@ -169,15 +169,15 @@ SUBDIR+= tests .if !defined(_SKIP_BUILD) # We need libutil.h, get it directly to avoid # recording a build dependency -CFLAGS+= -I${.CURDIR:H}/libutil +CFLAGS+= -I${SRCTOP}/lib/libutil # Same issue with libm -MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${.CURDIR:H}/msun -V ARCH_SUBDIR +MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${SRCTOP}/lib/msun -V ARCH_SUBDIR # unfortunately msun/src contains both private and public headers -CFLAGS+= -I${.CURDIR:H}/msun/${MSUN_ARCH_SUBDIR} +CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR} .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -I${.CURDIR:H}/msun/x86 +CFLAGS+= -I${SRCTOP}/lib/msun/x86 .endif -CFLAGS+= -I${.CURDIR:H}/msun/src +CFLAGS+= -I${SRCTOP}/lib/msun/src # and we do not want to record a dependency on msun .if ${.MAKE.LEVEL} > 0 GENDIRDEPS_FILTER+= N${RELDIR:H}/msun From owner-svn-src-head@freebsd.org Mon Jan 25 20:35:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E417A45E01; Mon, 25 Jan 2016 20:35:17 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5AC7D76; Mon, 25 Jan 2016 20:35:16 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PKZFMR029653; Mon, 25 Jan 2016 20:35:15 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PKZFb7029652; Mon, 25 Jan 2016 20:35:15 GMT (envelope-from zec@FreeBSD.org) Message-Id: <201601252035.u0PKZFb7029652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Mon, 25 Jan 2016 20:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294747 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 20:35:17 -0000 Author: zec Date: Mon Jan 25 20:35:15 2016 New Revision: 294747 URL: https://svnweb.freebsd.org/changeset/base/294747 Log: Prune a definition which is / was never used. Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Mon Jan 25 20:04:06 2016 (r294746) +++ head/sys/net/vnet.c Mon Jan 25 20:35:15 2016 (r294747) @@ -171,7 +171,6 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_ */ #define VNET_MODMIN 8192 #define VNET_SIZE roundup2(VNET_BYTES, PAGE_SIZE) -#define VNET_MODSIZE (VNET_SIZE - (VNET_BYTES - VNET_MODMIN)) /* * Space to store virtualized global variables from loadable kernel modules, From owner-svn-src-head@freebsd.org Mon Jan 25 20:57:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B50EA464D5; Mon, 25 Jan 2016 20:57:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::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 DE1829D0; Mon, 25 Jan 2016 20:57:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x22c.google.com with SMTP id h129so93583727lfh.3; Mon, 25 Jan 2016 12:57:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wTVIdoa5iQ9utHaPFm12CsksOqDAaxEnRWClUxL59Do=; b=o5+4Ac30Znsu/9NvQG5aSDBUjL59K7K9ImSpZF5bA6SyfpaubmFdKcPlZ/rMKtKJX8 +7UlskpouMeg5AvDE9+o54/7ESsqHUojM3Hg7EH+Ri4H4CaLYnMUzBigBoRoUDDojYAH +aQoAi8HO8G08Y3TvzyPHH1qins8ZagVWnMhivECnkre54lCkp2ensROLa1u6FVZfZdA ULRzi/K6zKhqx1jn0Frajx939WvN0JxKh8APiAySi+05SkQpGuA1TAjOA8uxxxmNw/K8 8FrirWd9AbchDXJCrECVEhCZiBDHsXH2qFVYnY390nlQ3xt3vzLHVQ8eCeJbopIEEc1n eF/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wTVIdoa5iQ9utHaPFm12CsksOqDAaxEnRWClUxL59Do=; b=cqw4QmNE3awbrH9zq8ARjxEMpb5h/crz4hEuby8NF93SpGfxV8sqMZo7EA0TeLl2tq VTWuwIJRcoAmGxHZmaURLbCxOVggTi+hrDhXqWtugxbWEh/6UiFVicbRiN5uXzykwM3p EQKdKXWhhuWU17XPw5+W2lT3BQXBZKsI9kmlnDVq5MyRz25N+92QsF+SaOigVAKKuJ2n XMBHwAoyuCkHXpLJL4t7KY6ytiOdsrmQcz9/UVBPm4sgO+MT8NyB+RaAajNbAcqoQVy4 TI2vElr/fTzZEXoibYWg9fqfnsScqPRcFe1iKEmfCvPv8O6vtpHQNKNRRYZESU/h21zW pjpA== X-Gm-Message-State: AG10YOSNKONP36gWFS6OFrU39vNRC7KmbbrRBwbAiZFqNXkDVt3B4sMpGf2m5m4mW67Mxp2gLy98oP5rNM9f7w== MIME-Version: 1.0 X-Received: by 10.25.208.213 with SMTP id h204mr7645155lfg.112.1453755433027; Mon, 25 Jan 2016 12:57:13 -0800 (PST) Received: by 10.112.160.133 with HTTP; Mon, 25 Jan 2016 12:57:12 -0800 (PST) In-Reply-To: <201601251843.u0PIhMa0097056@repo.freebsd.org> References: <201601251843.u0PIhMa0097056@repo.freebsd.org> Date: Mon, 25 Jan 2016 12:57:12 -0800 Message-ID: Subject: Re: svn commit: r294744 - head/share/mk From: NGie Cooper To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 20:57:15 -0000 On Mon, Jan 25, 2016 at 10:43 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Jan 25 18:43:21 2016 > New Revision: 294744 > URL: https://svnweb.freebsd.org/changeset/base/294744 > > Log: > Import latest host-target.mk 1.11 from contrib/bmake/mk Could this please be de-duped by using `.PATH: ${.CURDIR} ${SRCTOP}/contrib/bmake/mk` to find the copy in contrib/bmake/mk ? Thanks! -NGie From owner-svn-src-head@freebsd.org Mon Jan 25 20:58:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E0DEA46534; Mon, 25 Jan 2016 20:58:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2F6B34; Mon, 25 Jan 2016 20:58:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 177491246; Mon, 25 Jan 2016 20:58:29 +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 C4D95198EE; Mon, 25 Jan 2016 20:58:28 +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 QcbjFNU0bxxh; Mon, 25 Jan 2016 20:58:26 +0000 (UTC) Subject: Re: svn commit: r294744 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com C57C8198E5 To: NGie Cooper References: <201601251843.u0PIhMa0097056@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Organization: FreeBSD Message-ID: <56A68C6F.90808@FreeBSD.org> Date: Mon, 25 Jan 2016 12:58:23 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 20:58:29 -0000 On 1/25/16 12:57 PM, NGie Cooper wrote: > On Mon, Jan 25, 2016 at 10:43 AM, Bryan Drewery wrote: >> Author: bdrewery >> Date: Mon Jan 25 18:43:21 2016 >> New Revision: 294744 >> URL: https://svnweb.freebsd.org/changeset/base/294744 >> >> Log: >> Import latest host-target.mk 1.11 from contrib/bmake/mk > > Could this please be de-duped by using `.PATH: ${.CURDIR} > ${SRCTOP}/contrib/bmake/mk` to find the copy in contrib/bmake/mk ? > Thanks! > -NGie > Ours does not match that version in all cases. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Mon Jan 25 22:14:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1105A46102; Mon, 25 Jan 2016 22:14:32 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2CAC623; Mon, 25 Jan 2016 22:14:32 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PMEVoc058980; Mon, 25 Jan 2016 22:14:31 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PMEVn4058979; Mon, 25 Jan 2016 22:14:31 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201601252214.u0PMEVn4058979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Jan 2016 22:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294749 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 22:14:32 -0000 Author: jamie Date: Mon Jan 25 22:14:31 2016 New Revision: 294749 URL: https://svnweb.freebsd.org/changeset/base/294749 Log: Allow the (old rc-style) exec_afterstart jail parameters to start numbering at 0, like exec_prestart and the others do. Make param0 optional, i.e. still look for param1. PR: 142973 MFC after: 3 days Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Mon Jan 25 22:12:03 2016 (r294748) +++ head/etc/rc.d/jail Mon Jan 25 22:14:31 2016 (r294749) @@ -32,7 +32,7 @@ need_dad_wait= # Extract value from ${jail_$jv_$name} or ${jail_$name} and # set it to $param. If not defined, $defval is used. # When $num is [0-9]*, ${jail_$jv_$name$num} are looked up and -# $param is set by using +=. +# $param is set by using +=. $num=0 is optional (params may start at 1). # When $num is YN or NY, the value is interpret as boolean. extract_var() { @@ -72,7 +72,7 @@ extract_var() eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" if [ -n "$_tmpargs" ]; then echo " $_param += \"$_tmpargs\";" - else + elif [ $i != 0 ]; then break; fi i=$(($i + 1)) @@ -202,7 +202,7 @@ parse_options() extract_var $_jv exec_poststop exec.poststop 0 "" echo " exec.start += \"$_exec_start\";" - extract_var $_jv exec_afterstart exec.start 1 "" + extract_var $_jv exec_afterstart exec.start 0 "" echo " exec.stop = \"$_exec_stop\";" extract_var $_jv consolelog exec.consolelog - \ From owner-svn-src-head@freebsd.org Mon Jan 25 22:29:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8153A46576; Mon, 25 Jan 2016 22:29:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9FD43C52; Mon, 25 Jan 2016 22:29:33 +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 u0PMTWfQ062084; Mon, 25 Jan 2016 22:29:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PMTWYr062083; Mon, 25 Jan 2016 22:29:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601252229.u0PMTWYr062083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 22:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294750 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 22:29:34 -0000 Author: bdrewery Date: Mon Jan 25 22:29:32 2016 New Revision: 294750 URL: https://svnweb.freebsd.org/changeset/base/294750 Log: Fix incremental build of dtrace probes. Currently dtrace(1) -Go does not properly rebuild the target if it exists. It results in missing symbols. dtrace -C -x nolibs -G -o usdt.o -s /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d tst.usdt.o dtrace: target object (usdt.o) already exists. Please remove the target dtrace: object and rebuild all the source objects if you wish to run the DTrace dtrace: linking process again cc -O2 -pipe -O0 -g -I/root/git/freebsd/cddl/usr.sbin/dtrace/tests/common/json -std=gnu99 -fstack-protector-strong -Qunused-arguments -o tst.usdt.exe.full tst.usdt.o usdt.o tst.usdt.o: In function `main': /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c:56: undefined reference to `__dtrace_bunyan_fake___log__debug' /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c:60: undefined reference to `__dtrace_bunyan_fake___log__debug' cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [tst.usdt.exe.full] Error code 1 This is a consequence of r212358. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Jan 25 22:14:31 2016 (r294749) +++ head/share/mk/bsd.dep.mk Mon Jan 25 22:29:32 2016 (r294750) @@ -136,12 +136,15 @@ SRCS:= ${SRCS:S/^${_DSRC}$//} OBJS+= ${_D}.o CLEANFILES+= ${_D}.h ${_D}.o ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} + @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} .if defined(LIB) CLEANFILES+= ${_D}.So ${_D}.po ${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} + @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} + @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} .endif .endfor From owner-svn-src-head@freebsd.org Mon Jan 25 22:29:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ED7BA4659D; Mon, 25 Jan 2016 22:29:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id D1711D9C; Mon, 25 Jan 2016 22:29:42 +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 u0PMTfPE062132; Mon, 25 Jan 2016 22:29:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PMTfaY062131; Mon, 25 Jan 2016 22:29:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601252229.u0PMTfaY062131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 22:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294751 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 22:29:43 -0000 Author: bdrewery Date: Mon Jan 25 22:29:41 2016 New Revision: 294751 URL: https://svnweb.freebsd.org/changeset/base/294751 Log: Remove unneeded beforebuild hacks for dtrace probes. This still allows skipping 'make depend'. Headers in SRCS generate properly. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Jan 25 22:29:32 2016 (r294750) +++ head/share/mk/bsd.dep.mk Mon Jan 25 22:29:41 2016 (r294751) @@ -129,7 +129,7 @@ CFLAGS+= -I${.OBJDIR} .endif .for _DSRC in ${SRCS:M*.d:N*/*} .for _D in ${_DSRC:R} -DHDRS+= ${_D}.h +SRCS+= ${_D}.h ${_D}.h: ${_DSRC} ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC} SRCS:= ${SRCS:S/^${_DSRC}$//} @@ -137,20 +137,18 @@ OBJS+= ${_D}.o CLEANFILES+= ${_D}.h ${_D}.o ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} @rm -f ${.TARGET} - ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .if defined(LIB) CLEANFILES+= ${_D}.So ${_D}.po ${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} @rm -f ${.TARGET} - ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} @rm -f ${.TARGET} - ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .endif .endfor .endfor -beforedepend: ${DHDRS} -beforebuild: ${DHDRS} .if ${MK_FAST_DEPEND} == "yes" && \ From owner-svn-src-head@freebsd.org Mon Jan 25 22:29:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB549A465B2; Mon, 25 Jan 2016 22:29:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id BDB2ADA2; Mon, 25 Jan 2016 22:29:45 +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 u0PMTiDS062178; Mon, 25 Jan 2016 22:29:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PMTiJU062177; Mon, 25 Jan 2016 22:29:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601252229.u0PMTiJU062177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 22:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294752 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 22:29:46 -0000 Author: bdrewery Date: Mon Jan 25 22:29:44 2016 New Revision: 294752 URL: https://svnweb.freebsd.org/changeset/base/294752 Log: Fix PROGS not reading .depend files after r284288 by making DEPENDFILE work. We have had this user-modifable DEPENDFILE variable forever that does nothing relevant for the user since fmake always used '.depend'. Bmake introduced the .MAKE.DEPENDFILE variable that can be modified to change the name of '.depend'. Prior to r284288, bsd.progs.mk was setting .MAKE.DEPENDFILE to allow working incremental builds. This was modified most likely to not conflict with the META MODE handling of .MAKE.DEPENDFILE as it has a lot more special logic for that variable. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Jan 25 22:29:41 2016 (r294751) +++ head/share/mk/bsd.dep.mk Mon Jan 25 22:29:44 2016 (r294752) @@ -56,6 +56,7 @@ _MKDEPCC+= ${DEPFLAGS} .endif MKDEPCMD?= CC='${_MKDEPCC}' mkdep DEPENDFILE?= .depend +.MAKE.DEPENDFILE= ${DEPENDFILE} DEPENDFILES= ${DEPENDFILE} # Keep `tags' here, before SRCS are mangled below for `depend'. From owner-svn-src-head@freebsd.org Mon Jan 25 22:58:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43500A46E2E; Mon, 25 Jan 2016 22:58:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14FDA1BED; Mon, 25 Jan 2016 22:58:08 +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 u0PMw7Mn070769; Mon, 25 Jan 2016 22:58:07 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PMw6o5070766; Mon, 25 Jan 2016 22:58:06 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201601252258.u0PMw6o5070766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 25 Jan 2016 22:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294753 - in head/sys: dev/uart kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 22:58:08 -0000 Author: marius Date: Mon Jan 25 22:58:06 2016 New Revision: 294753 URL: https://svnweb.freebsd.org/changeset/base/294753 Log: - Make the code consistent with itself style-wise and bring it closer to style(9). - Mark unused arguments as such. - Make the ttystates table const. Modified: head/sys/dev/uart/uart_tty.c head/sys/kern/tty.c head/sys/sys/ttydevsw.h Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Mon Jan 25 22:29:44 2016 (r294752) +++ head/sys/dev/uart/uart_tty.c Mon Jan 25 22:58:06 2016 (r294753) @@ -57,6 +57,16 @@ static cn_putc_t uart_cnputc; static cn_grab_t uart_cngrab; static cn_ungrab_t uart_cnungrab; +static tsw_open_t uart_tty_open; +static tsw_close_t uart_tty_close; +static tsw_outwakeup_t uart_tty_outwakeup; +static tsw_inwakeup_t uart_tty_inwakeup; +static tsw_ioctl_t uart_tty_ioctl; +static tsw_param_t uart_tty_param; +static tsw_modem_t uart_tty_modem; +static tsw_free_t uart_tty_free; +static tsw_busy_t uart_tty_busy; + CONSOLE_DRIVER(uart); static struct uart_devinfo uart_console; @@ -157,7 +167,7 @@ uart_tty_close(struct tty *tp) struct uart_softc *sc; sc = tty_softc(tp); - if (sc == NULL || sc->sc_leaving || !sc->sc_opened) + if (sc == NULL || sc->sc_leaving || !sc->sc_opened) return; if (sc->sc_hwiflow) @@ -169,7 +179,6 @@ uart_tty_close(struct tty *tp) wakeup(sc); sc->sc_opened = 0; - return; } static void @@ -215,7 +224,8 @@ uart_tty_inwakeup(struct tty *tp) } static int -uart_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) +uart_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, + struct thread *td __unused) { struct uart_softc *sc; @@ -256,8 +266,8 @@ uart_tty_param(struct tty *tp, struct te } stopbits = (t->c_cflag & CSTOPB) ? 2 : 1; if (t->c_cflag & PARENB) - parity = (t->c_cflag & PARODD) ? UART_PARITY_ODD - : UART_PARITY_EVEN; + parity = (t->c_cflag & PARODD) ? UART_PARITY_ODD : + UART_PARITY_EVEN; else parity = UART_PARITY_NONE; if (UART_PARAM(sc, t->c_ospeed, databits, stopbits, parity) != 0) @@ -285,7 +295,7 @@ uart_tty_modem(struct tty *tp, int biton sc = tty_softc(tp); if (biton != 0 || bitoff != 0) - UART_SETSIG(sc, SER_DELTA(bitoff|biton) | biton); + UART_SETSIG(sc, SER_DELTA(bitoff | biton) | biton); return (sc->sc_hwsig); } @@ -344,7 +354,7 @@ uart_tty_intr(void *arg) } static void -uart_tty_free(void *arg) +uart_tty_free(void *arg __unused) { /* @@ -359,7 +369,7 @@ static bool uart_tty_busy(struct tty *tp) { struct uart_softc *sc; - + sc = tty_softc(tp); if (sc == NULL || sc->sc_leaving) return (FALSE); Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Jan 25 22:29:44 2016 (r294752) +++ head/sys/kern/tty.c Mon Jan 25 22:58:06 2016 (r294753) @@ -175,6 +175,7 @@ tty_drain(struct tty *tp, int leaving) static __inline int ttydev_enter(struct tty *tp) { + tty_lock(tp); if (tty_gone(tp) || !tty_opened(tp)) { @@ -189,6 +190,7 @@ ttydev_enter(struct tty *tp) static void ttydev_leave(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); if (tty_opened(tp) || tp->t_flags & TF_OPENCLOSE) { @@ -234,7 +236,8 @@ ttydev_leave(struct tty *tp) * Operations that are exposed through the character device in /dev. */ static int -ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +ttydev_open(struct cdev *dev, int oflags, int devtype __unused, + struct thread *td) { struct tty *tp; int error; @@ -330,7 +333,8 @@ done: tp->t_flags &= ~TF_OPENCLOSE; } static int -ttydev_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +ttydev_close(struct cdev *dev, int fflag, int devtype __unused, + struct thread *td __unused) { struct tty *tp = dev->si_drv1; @@ -372,6 +376,7 @@ ttydev_close(struct cdev *dev, int fflag static __inline int tty_is_ctty(struct tty *tp, struct proc *p) { + tty_lock_assert(tp, MA_OWNED); return (p->p_session == tp->t_session && p->p_flag & P_CONTROLT); @@ -652,7 +657,7 @@ tty_kqops_read_detach(struct knote *kn) } static int -tty_kqops_read_event(struct knote *kn, long hint) +tty_kqops_read_event(struct knote *kn, long hint __unused) { struct tty *tp = kn->kn_hook; @@ -676,7 +681,7 @@ tty_kqops_write_detach(struct knote *kn) } static int -tty_kqops_write_event(struct knote *kn, long hint) +tty_kqops_write_event(struct knote *kn, long hint __unused) { struct tty *tp = kn->kn_hook; @@ -696,6 +701,7 @@ static struct filterops tty_kqops_read = .f_detach = tty_kqops_read_detach, .f_event = tty_kqops_read_event, }; + static struct filterops tty_kqops_write = { .f_isfd = 1, .f_detach = tty_kqops_write_detach, @@ -751,7 +757,8 @@ static struct cdevsw ttydev_cdevsw = { */ static int -ttyil_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +ttyil_open(struct cdev *dev, int oflags __unused, int devtype __unused, + struct thread *td) { struct tty *tp; int error; @@ -767,14 +774,18 @@ ttyil_open(struct cdev *dev, int oflags, } static int -ttyil_close(struct cdev *dev, int flag, int mode, struct thread *td) +ttyil_close(struct cdev *dev __unused, int flag __unused, int mode __unused, + struct thread *td __unused) { + return (0); } static int -ttyil_rdwr(struct cdev *dev, struct uio *uio, int ioflag) +ttyil_rdwr(struct cdev *dev __unused, struct uio *uio __unused, + int ioflag __unused) { + return (ENODEV); } @@ -871,45 +882,49 @@ tty_init_console(struct tty *tp, speed_t */ static int -ttydevsw_defopen(struct tty *tp) +ttydevsw_defopen(struct tty *tp __unused) { return (0); } static void -ttydevsw_defclose(struct tty *tp) +ttydevsw_defclose(struct tty *tp __unused) { + } static void -ttydevsw_defoutwakeup(struct tty *tp) +ttydevsw_defoutwakeup(struct tty *tp __unused) { panic("Terminal device has output, while not implemented"); } static void -ttydevsw_definwakeup(struct tty *tp) +ttydevsw_definwakeup(struct tty *tp __unused) { + } static int -ttydevsw_defioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) +ttydevsw_defioctl(struct tty *tp __unused, u_long cmd __unused, + caddr_t data __unused, struct thread *td __unused) { return (ENOIOCTL); } static int -ttydevsw_defcioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, struct thread *td) +ttydevsw_defcioctl(struct tty *tp __unused, int unit __unused, + u_long cmd __unused, caddr_t data __unused, struct thread *td __unused) { return (ENOIOCTL); } static int -ttydevsw_defparam(struct tty *tp, struct termios *t) +ttydevsw_defparam(struct tty *tp __unused, struct termios *t) { /* @@ -931,7 +946,8 @@ ttydevsw_defparam(struct tty *tp, struct } static int -ttydevsw_defmodem(struct tty *tp, int sigon, int sigoff) +ttydevsw_defmodem(struct tty *tp __unused, int sigon __unused, + int sigoff __unused) { /* Simulate a carrier to make the TTY layer happy. */ @@ -939,20 +955,22 @@ ttydevsw_defmodem(struct tty *tp, int si } static int -ttydevsw_defmmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, - int nprot, vm_memattr_t *memattr) +ttydevsw_defmmap(struct tty *tp __unused, vm_ooffset_t offset __unused, + vm_paddr_t *paddr __unused, int nprot __unused, + vm_memattr_t *memattr __unused) { return (-1); } static void -ttydevsw_defpktnotify(struct tty *tp, char event) +ttydevsw_defpktnotify(struct tty *tp __unused, char event __unused) { + } static void -ttydevsw_deffree(void *softc) +ttydevsw_deffree(void *softc __unused) { panic("Terminal device freed without a free-handler"); @@ -1091,6 +1109,7 @@ tty_rel_free(struct tty *tp) void tty_rel_pgrp(struct tty *tp, struct pgrp *pg) { + MPASS(tp->t_sessioncnt > 0); tty_lock_assert(tp, MA_OWNED); @@ -1103,6 +1122,7 @@ tty_rel_pgrp(struct tty *tp, struct pgrp void tty_rel_sess(struct tty *tp, struct session *sess) { + MPASS(tp->t_sessioncnt > 0); /* Current session has left. */ @@ -1117,6 +1137,7 @@ tty_rel_sess(struct tty *tp, struct sess void tty_rel_gone(struct tty *tp) { + MPASS(!tty_gone(tp)); /* Simulate carrier removal. */ @@ -1138,6 +1159,7 @@ tty_rel_gone(struct tty *tp) static void tty_to_xtty(struct tty *tp, struct xtty *xt) { + tty_lock_assert(tp, MA_OWNED); xt->xt_size = sizeof(struct xtty); @@ -1370,6 +1392,7 @@ tty_signal_pgrp(struct tty *tp, int sig) void tty_wakeup(struct tty *tp, int flags) { + if (tp->t_flags & TF_ASYNC && tp->t_sigio != NULL) pgsigio(&tp->t_sigio, SIGIO, (tp->t_session != NULL)); @@ -1432,6 +1455,7 @@ tty_timedwait(struct tty *tp, struct cv void tty_flush(struct tty *tp, int flags) { + if (flags & FWRITE) { tp->t_flags &= ~TF_HIWAT_OUT; ttyoutq_flush(&tp->t_outq); @@ -1822,10 +1846,11 @@ tty_ioctl(struct tty *tp, u_long cmd, vo dev_t tty_udev(struct tty *tp) { + if (tp->t_dev) - return dev2udev(tp->t_dev); + return (dev2udev(tp->t_dev)); else - return NODEV; + return (NODEV); } int @@ -1894,8 +1919,8 @@ ttyhook_defrint(struct tty *tp, char c, } int -ttyhook_register(struct tty **rtp, struct proc *p, int fd, - struct ttyhook *th, void *softc) +ttyhook_register(struct tty **rtp, struct proc *p, int fd, struct ttyhook *th, + void *softc) { struct tty *tp; struct file *fp; @@ -2046,7 +2071,7 @@ static struct cdevsw ttyconsdev_cdevsw = }; static void -ttyconsdev_init(void *unused) +ttyconsdev_init(void *unused __unused) { dev_console = make_dev_credf(MAKEDEV_ETERNAL, &ttyconsdev_cdevsw, 0, @@ -2071,7 +2096,7 @@ ttyconsdev_select(const char *name) #include #include -static struct { +static const struct { int flag; char val; } ttystates[] = { @@ -2126,6 +2151,7 @@ static struct { static void _db_show_devsw(const char *sep, const struct ttydevsw *tsw) { + db_printf("%sdevsw: ", sep); db_printsym((db_addr_t)tsw, DB_STGY_ANY); db_printf(" (%p)\n", tsw); @@ -2140,9 +2166,11 @@ _db_show_devsw(const char *sep, const st DB_PRINTSYM(pktnotify, tsw->tsw_pktnotify); DB_PRINTSYM(free, tsw->tsw_free); } + static void _db_show_hooks(const char *sep, const struct ttyhook *th) { + db_printf("%shook: ", sep); db_printsym((db_addr_t)th, DB_STGY_ANY); db_printf(" (%p)\n", th); @@ -2248,17 +2276,13 @@ DB_SHOW_ALL_COMMAND(ttys, db_show_all_tt isiz = tp->t_inq.ti_nblocks * TTYINQ_DATASIZE; osiz = tp->t_outq.to_nblocks * TTYOUTQ_DATASIZE; - db_printf("%p %10s %5zu %4u %4u %4zu %5zu %4u %4zu %5u %5d %5d ", - tp, - tty_devname(tp), - isiz, + db_printf("%p %10s %5zu %4u %4u %4zu %5zu %4u %4zu %5u %5d " + "%5d ", tp, tty_devname(tp), isiz, tp->t_inq.ti_linestart - tp->t_inq.ti_begin, tp->t_inq.ti_end - tp->t_inq.ti_linestart, - isiz - tp->t_inlow, - osiz, + isiz - tp->t_inlow, osiz, tp->t_outq.to_end - tp->t_outq.to_begin, - osiz - tp->t_outlow, - MIN(tp->t_column, 99999), + osiz - tp->t_outlow, MIN(tp->t_column, 99999), tp->t_session ? tp->t_session->s_sid : 0, tp->t_pgrp ? tp->t_pgrp->pg_id : 0); Modified: head/sys/sys/ttydevsw.h ============================================================================== --- head/sys/sys/ttydevsw.h Mon Jan 25 22:29:44 2016 (r294752) +++ head/sys/sys/ttydevsw.h Mon Jan 25 22:58:06 2016 (r294753) @@ -83,15 +83,17 @@ struct ttydevsw { static __inline int ttydevsw_open(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_open(tp); + return (tp->t_devsw->tsw_open(tp)); } static __inline void ttydevsw_close(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); @@ -101,6 +103,7 @@ ttydevsw_close(struct tty *tp) static __inline void ttydevsw_outwakeup(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); @@ -114,6 +117,7 @@ ttydevsw_outwakeup(struct tty *tp) static __inline void ttydevsw_inwakeup(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); @@ -127,49 +131,56 @@ ttydevsw_inwakeup(struct tty *tp) static __inline int ttydevsw_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_ioctl(tp, cmd, data, td); + return (tp->t_devsw->tsw_ioctl(tp, cmd, data, td)); } static __inline int -ttydevsw_cioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, struct thread *td) +ttydevsw_cioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, + struct thread *td) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_cioctl(tp, unit, cmd, data, td); + return (tp->t_devsw->tsw_cioctl(tp, unit, cmd, data, td)); } static __inline int ttydevsw_param(struct tty *tp, struct termios *t) { + MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_param(tp, t); + return (tp->t_devsw->tsw_param(tp, t)); } static __inline int ttydevsw_modem(struct tty *tp, int sigon, int sigoff) { + MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_modem(tp, sigon, sigoff); + return (tp->t_devsw->tsw_modem(tp, sigon, sigoff)); } static __inline int ttydevsw_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) { + MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot, memattr); + return (tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot, memattr)); } static __inline void ttydevsw_pktnotify(struct tty *tp, char event) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); @@ -179,6 +190,7 @@ ttydevsw_pktnotify(struct tty *tp, char static __inline void ttydevsw_free(struct tty *tp) { + MPASS(tty_gone(tp)); tp->t_devsw->tsw_free(tty_softc(tp)); From owner-svn-src-head@freebsd.org Mon Jan 25 23:04:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 095F7A4609E; Mon, 25 Jan 2016 23:04:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id D640A1F96; Mon, 25 Jan 2016 23:04:41 +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 u0PN4ex9073594; Mon, 25 Jan 2016 23:04:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PN4eEa073591; Mon, 25 Jan 2016 23:04:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601252304.u0PN4eEa073591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Jan 2016 23:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294754 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 23:04:42 -0000 Author: andrew Date: Mon Jan 25 23:04:40 2016 New Revision: 294754 URL: https://svnweb.freebsd.org/changeset/base/294754 Log: Allow us to be told about memory past the first 4GB point, but ignore it. This allows, for example, UEFI pass a memory map with some ram in this region, but for us to ignore it. This is the case when running under the qemu virt machine type. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/physmem.c head/sys/arm/include/ofw_machdep.h head/sys/arm/include/physmem.h Modified: head/sys/arm/arm/physmem.c ============================================================================== --- head/sys/arm/arm/physmem.c Mon Jan 25 22:58:06 2016 (r294753) +++ head/sys/arm/arm/physmem.c Mon Jan 25 23:04:40 2016 (r294754) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #define MAX_HWCNT 10 #define MAX_EXCNT 10 +#define MAX_PHYS_ADDR 0xFFFFFFFFull + struct region { vm_paddr_t addr; vm_size_t size; @@ -273,14 +275,25 @@ insert_region(struct region *regions, si * Add a hardware memory region. */ void -arm_physmem_hardware_region(vm_paddr_t pa, vm_size_t sz) +arm_physmem_hardware_region(uint64_t pa, uint64_t sz) { vm_offset_t adj; /* * Filter out the page at PA 0x00000000. The VM can't handle it, as * pmap_extract() == 0 means failure. - * + */ + if (pa == 0) { + if (sz <= PAGE_SIZE) + return; + pa = PAGE_SIZE; + sz -= PAGE_SIZE; + } else if (pa > MAX_PHYS_ADDR) { + /* This range is past usable memory, ignore it */ + return; + } + + /* * Also filter out the page at the end of the physical address space -- * if addr is non-zero and addr+size is zero we wrapped to the next byte * beyond what vm_paddr_t can express. That leads to a NULL pointer @@ -291,12 +304,8 @@ arm_physmem_hardware_region(vm_paddr_t p * pointer deref in _vm_map_lock_read(). Better to give up a megabyte * than leave some folks with an unusable system while we investigate. */ - if (pa == 0) { - if (sz <= PAGE_SIZE) - return; - pa = PAGE_SIZE; - sz -= PAGE_SIZE; - } else if (pa + sz == 0) { + if ((pa + sz) > (MAX_PHYS_ADDR - 1024 * 1024)) { + sz = MAX_PHYS_ADDR - pa + 1; if (sz <= 1024 * 1024) return; sz -= 1024 * 1024; Modified: head/sys/arm/include/ofw_machdep.h ============================================================================== --- head/sys/arm/include/ofw_machdep.h Mon Jan 25 22:58:06 2016 (r294753) +++ head/sys/arm/include/ofw_machdep.h Mon Jan 25 23:04:40 2016 (r294754) @@ -40,8 +40,8 @@ typedef uint32_t cell_t; struct mem_region { - vm_offset_t mr_start; - vm_size_t mr_size; + uint64_t mr_start; + uint64_t mr_size; }; #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: head/sys/arm/include/physmem.h ============================================================================== --- head/sys/arm/include/physmem.h Mon Jan 25 22:58:06 2016 (r294753) +++ head/sys/arm/include/physmem.h Mon Jan 25 23:04:40 2016 (r294754) @@ -52,7 +52,7 @@ extern vm_paddr_t arm_physmem_kernaddr; #define EXFLAG_NODUMP 0x01 #define EXFLAG_NOALLOC 0x02 -void arm_physmem_hardware_region(vm_paddr_t pa, vm_size_t sz); +void arm_physmem_hardware_region(uint64_t pa, uint64_t sz); void arm_physmem_exclude_region(vm_paddr_t pa, vm_size_t sz, uint32_t flags); void arm_physmem_init_kernel_globals(void); void arm_physmem_print_tables(void); From owner-svn-src-head@freebsd.org Tue Jan 26 01:02:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 551A9A46FEB; Tue, 26 Jan 2016 01:02:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26FC4F1B; Tue, 26 Jan 2016 01:02:21 +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 u0Q12KF0008704; Tue, 26 Jan 2016 01:02:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q12KkD008703; Tue, 26 Jan 2016 01:02:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <201601260102.u0Q12KkD008703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 26 Jan 2016 01:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294756 - head/contrib/ofed/librdmacm/examples/build/rping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 01:02:21 -0000 Author: np Date: Tue Jan 26 01:02:19 2016 New Revision: 294756 URL: https://svnweb.freebsd.org/changeset/base/294756 Log: Use LIBADD instead of LDADD in rping's Makefile and add libcxgb4 (the userspace iWARP library for cxgbe) to the list of libraries. rping using the libcxgb4 + iw_cxgbe combo was tested with T5 hardware. Obtained from: Chelsio Communications Modified: head/contrib/ofed/librdmacm/examples/build/rping/Makefile Modified: head/contrib/ofed/librdmacm/examples/build/rping/Makefile ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/rping/Makefile Tue Jan 26 00:22:02 2016 (r294755) +++ head/contrib/ofed/librdmacm/examples/build/rping/Makefile Tue Jan 26 01:02:19 2016 (r294756) @@ -5,7 +5,8 @@ PROG= rping MAN= SRCS= rping.c -LDADD+= -libverbs -lrdmacm -lpthread -LDADD+= -lmlx4 +LIBADD+= ibverbs rdmacm pthread +LIBADD+= mlx4 +LIBADD+= cxgb4 .include From owner-svn-src-head@freebsd.org Tue Jan 26 01:15:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A6E8A46424; Tue, 26 Jan 2016 01:15:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BB9D789; Tue, 26 Jan 2016 01:15:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q1FJpq011730; Tue, 26 Jan 2016 01:15:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q1FJWf011729; Tue, 26 Jan 2016 01:15:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201601260115.u0Q1FJWf011729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Jan 2016 01:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294757 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 01:15:20 -0000 Author: markj Date: Tue Jan 26 01:15:18 2016 New Revision: 294757 URL: https://svnweb.freebsd.org/changeset/base/294757 Log: Evaluate the sysctl_running fail point before taking the sysctl lock. The fail point handler may sleep, but this is not permitted while holding a rm read lock. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue Jan 26 01:02:19 2016 (r294756) +++ head/sys/kern/kern_sysctl.c Tue Jan 26 01:15:18 2016 (r294757) @@ -166,6 +166,8 @@ sysctl_root_handler_locked(struct sysctl if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_unlock(&Giant); + KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); + if (tracker != NULL) SYSCTL_RLOCK(tracker); else @@ -1838,8 +1840,6 @@ sysctl_root(SYSCTL_HANDLER_ARGS) #endif error = sysctl_root_handler_locked(oid, arg1, arg2, req, &tracker); - KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); - out: SYSCTL_RUNLOCK(&tracker); return (error); From owner-svn-src-head@freebsd.org Tue Jan 26 01:16:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE3D7A464CF; Tue, 26 Jan 2016 01:16:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF55293D; Tue, 26 Jan 2016 01:16:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q1GjSS011814; Tue, 26 Jan 2016 01:16:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q1GjoG011813; Tue, 26 Jan 2016 01:16:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201601260116.u0Q1GjoG011813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Jan 2016 01:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294758 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 01:16:47 -0000 Author: markj Date: Tue Jan 26 01:16:45 2016 New Revision: 294758 URL: https://svnweb.freebsd.org/changeset/base/294758 Log: Remove a duplicate setting of the AH_DEBUG_ALQ option. Modified: head/sys/mips/conf/AR934X_BASE Modified: head/sys/mips/conf/AR934X_BASE ============================================================================== --- head/sys/mips/conf/AR934X_BASE Tue Jan 26 01:15:18 2016 (r294757) +++ head/sys/mips/conf/AR934X_BASE Tue Jan 26 01:16:45 2016 (r294758) @@ -83,7 +83,6 @@ device ath_ahb # Atheros host bus glue options ATH_DEBUG options ATH_DIAGAPI option ATH_ENABLE_11N -option AH_DEBUG_ALQ #device ath_hal device ath_ar9300 # AR9330 HAL; no need for the others From owner-svn-src-head@freebsd.org Tue Jan 26 03:52:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90CDDA46BA6; Tue, 26 Jan 2016 03:52:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61432180E; Tue, 26 Jan 2016 03:52:15 +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 u0Q3qE8D058915; Tue, 26 Jan 2016 03:52:14 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q3qEE2058914; Tue, 26 Jan 2016 03:52:14 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601260352.u0Q3qEE2058914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 26 Jan 2016 03:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294759 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 03:52:15 -0000 Author: jhibbits Date: Tue Jan 26 03:52:14 2016 New Revision: 294759 URL: https://svnweb.freebsd.org/changeset/base/294759 Log: Fix a debug printf(). Somehow this printf() was missed in the conversion of vm_paddr_t to 64-bit, and made it through until now. Sponsored by: Alex Perez/Inertial Computing Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Jan 26 01:16:45 2016 (r294758) +++ head/sys/powerpc/booke/pmap.c Tue Jan 26 03:52:14 2016 (r294759) @@ -1305,8 +1305,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("Maxmem = 0x%08lx\n", Maxmem); debugf("phys_avail_count = %d\n", phys_avail_count); - debugf("physsz = 0x%08x physmem = %ld (0x%08lx)\n", physsz, physmem, - physmem); + debugf("physsz = 0x%09jx physmem = %jd (0x%09jx)\n", + (uintmax_t)physsz, (uintmax_t)physmem, (uintmax_t)physmem); /*******************************************************/ /* Initialize (statically allocated) kernel pmap. */ From owner-svn-src-head@freebsd.org Tue Jan 26 04:41:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AD84A46815; Tue, 26 Jan 2016 04:41:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57173E56; Tue, 26 Jan 2016 04:41:19 +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 u0Q4fIdg071505; Tue, 26 Jan 2016 04:41:18 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q4fIUo071504; Tue, 26 Jan 2016 04:41:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601260441.u0Q4fIUo071504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 26 Jan 2016 04:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294760 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 04:41:19 -0000 Author: jhibbits Date: Tue Jan 26 04:41:18 2016 New Revision: 294760 URL: https://svnweb.freebsd.org/changeset/base/294760 Log: Older Book-E processors (e500v1/e500v2) don't support dcbzl. The only difference between dcbzl and dcbz is dcbzl operates on native cache line lengths regardless of L1CSR0[DCBZ32]. Since we don't change the cache line size, the cacheline_size variable will reflect the used cache line length, and dcbz will work as expected. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Jan 26 03:52:14 2016 (r294759) +++ head/sys/powerpc/booke/pmap.c Tue Jan 26 04:41:18 2016 (r294760) @@ -2254,7 +2254,7 @@ mmu_booke_zero_page(mmu_t mmu, vm_page_t mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); for (off = 0; off < PAGE_SIZE; off += cacheline_size) - __asm __volatile("dcbzl 0,%0" :: "r"(va + off)); + __asm __volatile("dcbz 0,%0" :: "r"(va + off)); mmu_booke_kremove(mmu, va); mtx_unlock(&zero_page_mutex); From owner-svn-src-head@freebsd.org Tue Jan 26 04:48:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D883A46BA2; Tue, 26 Jan 2016 04:48:26 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D28C1289; Tue, 26 Jan 2016 04:48:26 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q4mP9S074251; Tue, 26 Jan 2016 04:48:25 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q4mPW2074250; Tue, 26 Jan 2016 04:48:25 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601260448.u0Q4mPW2074250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 26 Jan 2016 04:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294761 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 04:48:26 -0000 Author: luigi Date: Tue Jan 26 04:48:24 2016 New Revision: 294761 URL: https://svnweb.freebsd.org/changeset/base/294761 Log: Revert one chunk from commit 285362, which introduced an off-by-one error in computing a shift index. The error was due to the use of mixed fls() / __fls() functions in another implementation of qfq. To avoid that the problem occurs again, properly document which incarnation of the function we need. Note that the bug only affects QFQ in FreeBSD head from last july, as the patch was not merged to other versions. Modified: head/sys/netpfil/ipfw/dn_sched_qfq.c Modified: head/sys/netpfil/ipfw/dn_sched_qfq.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_qfq.c Tue Jan 26 04:41:18 2016 (r294760) +++ head/sys/netpfil/ipfw/dn_sched_qfq.c Tue Jan 26 04:48:24 2016 (r294761) @@ -60,6 +60,10 @@ typedef unsigned long bitmap; /* * bitmaps ops are critical. Some linux versions have __fls * and the bitmap ops. Some machines have ffs + * NOTE: fls() returns 1 for the least significant bit, + * __fls() returns 0 for the same case. + * We use the base-0 version __fls() to match the description in + * the ToN QFQ paper */ #if defined(_WIN32) || (defined(__MIPSEL__) && defined(LINUX_24)) int fls(unsigned int n) @@ -409,8 +413,8 @@ qfq_make_eligible(struct qfq_sched *q, u old_vslot = old_V >> QFQ_MIN_SLOT_SHIFT; if (vslot != old_vslot) { - /* should be 1ULL not 2ULL */ - mask = (1ULL << (__fls(vslot ^ old_vslot))) - 1; + /* must be 2ULL, see ToN QFQ article fig.5, we use base-0 fls */ + mask = (2ULL << (__fls(vslot ^ old_vslot))) - 1; qfq_move_groups(q, mask, IR, ER); qfq_move_groups(q, mask, IB, EB); } From owner-svn-src-head@freebsd.org Tue Jan 26 06:26:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2A23A47061; Tue, 26 Jan 2016 06:26:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B444A78D; Tue, 26 Jan 2016 06:26: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 u0Q6QKjt003341; Tue, 26 Jan 2016 06:26:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q6QJ0E003328; Tue, 26 Jan 2016 06:26:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601260626.u0Q6QJ0E003328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 06:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294765 - in head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common efi/boot1 i386/boot2 i386/gptboot i386/zfsboot mips/beri/boot2 pc98/boot2 powerpc/boot1.chrp sparc64/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 06:26:22 -0000 Author: imp Date: Tue Jan 26 06:26:19 2016 New Revision: 294765 URL: https://svnweb.freebsd.org/changeset/base/294765 Log: Move all the separate copies of the same strings into paths.h. There's nothing machine specific about these. Differential Revision: https://reviews.freebsd.org/D5038 Added: head/sys/boot/common/paths.h (contents, props changed) Modified: head/sys/boot/arm/at91/boot2/boot2.c head/sys/boot/arm/ixp425/boot2/boot2.c head/sys/boot/efi/boot1/boot1.c head/sys/boot/i386/boot2/boot2.c head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/mips/beri/boot2/boot2.c head/sys/boot/pc98/boot2/boot2.c head/sys/boot/powerpc/boot1.chrp/boot1.c head/sys/boot/sparc64/boot1/boot1.c Modified: head/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/at91/boot2/boot2.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/arm/at91/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2008 John Hay - * Copyright (c) 2006 Warner Losh + * Copyright (c) 2006 M Warner Losh * Copyright (c) 1998 Robert Nordier * All rights reserved. * @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "board.h" +#include "paths.h" #define RBX_ASKNAME 0x0 /* -a */ #define RBX_SINGLE 0x1 /* -s */ @@ -64,9 +65,7 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -//#define PATH_KERNEL "/boot/kernel/kernel" +#undef PATH_KERNEL #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" extern uint32_t _end; Modified: head/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/ixp425/boot2/boot2.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/arm/ixp425/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include "lib.h" +#include "paths.h" #define RBX_ASKNAME 0x0 /* -a */ #define RBX_SINGLE 0x1 /* -s */ @@ -62,10 +63,6 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_KERNEL "/boot/kernel/kernel" - extern uint32_t _end; #define NOPT 6 Added: head/sys/boot/common/paths.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/paths.h Tue Jan 26 06:26:19 2016 (r294765) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2016 M. Warner Losh + * 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$ + */ + +#ifndef _PATHS_H_ +#define _PATHS_H_ + +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" +#define PATH_BOOT3 "/boot/loader" +#define PATH_LOADER "/boot/loader" +#define PATH_LOADER_EFI "/boot/loader.efi" +#define PATH_KERNEL "/boot/kernel/kernel" + +#endif /* _PATHS_H_ */ Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/efi/boot1/boot1.c Tue Jan 26 06:26:19 2016 (r294765) @@ -31,8 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include "boot_module.h" - -#define _PATH_LOADER "/boot/loader.efi" +#include "paths.h" static const boot_module_t *boot_modules[] = { @@ -99,13 +98,13 @@ try_load(const boot_module_t *mod) EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; - status = mod->load(_PATH_LOADER, &dev, &buf, &bufsize); + status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) return; if (status != EFI_SUCCESS) { - printf("%s failed to load %s (%lu)\n", mod->name, _PATH_LOADER, - EFI_ERROR_CODE(status)); + printf("%s failed to load %s (%lu)\n", mod->name, + PATH_LOADER_EFI, EFI_ERROR_CODE(status)); return; } @@ -174,7 +173,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T conout->ClearScreen(conout); printf("\n>> FreeBSD EFI boot block\n"); - printf(" Loader path: %s\n\n", _PATH_LOADER); + printf(" Loader path: %s\n\n", PATH_LOADER_EFI); printf(" Initializing modules:"); for (i = 0; i < NUM_BOOT_MODULES; i++) { if (boot_modules[i] == NULL) Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/i386/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +#include "paths.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -87,11 +88,6 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/i386/gptboot/gptboot.c Tue Jan 26 06:26:19 2016 (r294765) @@ -37,11 +37,7 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "cons.h" #include "gpt.h" - -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" #define ARGS 0x900 #define NOPT 14 Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/i386/zfsboot/zfsboot.c Tue Jan 26 06:26:19 2016 (r294765) @@ -42,14 +42,10 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "cons.h" #include "bootargs.h" +#include "paths.h" #include "libzfs.h" -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/zfsloader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 Modified: head/sys/boot/mips/beri/boot2/boot2.c ============================================================================== --- head/sys/boot/mips/beri/boot2/boot2.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/mips/beri/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "paths.h" + static int beri_argc; static const char **beri_argv, **beri_envv; static uint64_t beri_memsize; @@ -108,11 +110,6 @@ static uint64_t beri_memsize; OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define MEM_BASE 0x12 Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/pc98/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +#include "paths.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -89,11 +90,6 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_DOTCONFIG "/boot.config" -#define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" -#define PATH_KERNEL "/boot/kernel/kernel" - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/boot1.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/powerpc/boot1.chrp/boot1.c Tue Jan 26 06:26:19 2016 (r294765) @@ -23,8 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" #define BSIZEMAX 16384 @@ -396,7 +395,7 @@ main(int ac, char **av) char bootpath_full[255]; int i, len; - path = _PATH_LOADER; + path = PATH_LOADER; for (i = 0; i < ac; i++) { switch (av[i][0]) { case '-': Modified: head/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- head/sys/boot/sparc64/boot1/boot1.c Tue Jan 26 06:05:55 2016 (r294764) +++ head/sys/boot/sparc64/boot1/boot1.c Tue Jan 26 06:26:19 2016 (r294765) @@ -24,8 +24,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define _PATH_LOADER "/boot/loader" -#define _PATH_KERNEL "/boot/kernel/kernel" +#include "paths.h" + #define READ_BUF_SIZE 8192 typedef int putc_func_t(char c, void *arg); @@ -324,7 +324,7 @@ main(int ac, char **av) const char *path; int i; - path = _PATH_LOADER; + path = PATH_LOADER; for (i = 0; i < ac; i++) { switch (av[i][0]) { case '-': From owner-svn-src-head@freebsd.org Tue Jan 26 06:26:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB24A470AA; Tue, 26 Jan 2016 06:26:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6632C8F5; Tue, 26 Jan 2016 06:26:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q6QjwX003398; Tue, 26 Jan 2016 06:26:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q6QiN6003392; Tue, 26 Jan 2016 06:26:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601260626.u0Q6QiN6003392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 06:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294766 - in head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common i386/boot2 i386/common mips/beri/boot2 pc98/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 06:26:46 -0000 Author: imp Date: Tue Jan 26 06:26:44 2016 New Revision: 294766 URL: https://svnweb.freebsd.org/changeset/base/294766 Log: RBX_ defines are in rbx.h, move it there. Differential Revision: https://reviews.freebsd.org/D5038 Added: head/sys/boot/common/rbx.h - copied, changed from r294765, head/sys/boot/i386/common/rbx.h Deleted: head/sys/boot/i386/common/rbx.h Modified: head/sys/boot/arm/at91/boot2/boot2.c head/sys/boot/arm/ixp425/boot2/boot2.c head/sys/boot/i386/boot2/boot2.c head/sys/boot/mips/beri/boot2/boot2.c head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/at91/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) +++ head/sys/boot/arm/at91/boot2/boot2.c Tue Jan 26 06:26:44 2016 (r294766) @@ -31,39 +31,7 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "board.h" #include "paths.h" - -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6 -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -/* #define RBX_SERIAL 0xc -h */ -/* #define RBX_CDROM 0xd -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -/* #define RBX_MUTE 0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL 0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) +#include "rbx.h" #undef PATH_KERNEL #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" @@ -72,9 +40,6 @@ extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char bootflags[NOPT] = { RBX_ASKNAME, Modified: head/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/ixp425/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) +++ head/sys/boot/arm/ixp425/boot2/boot2.c Tue Jan 26 06:26:44 2016 (r294766) @@ -29,47 +29,12 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include "paths.h" - -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -/* #define RBX_KDB 0x6 -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -/* #define RBX_SERIAL 0xc -h */ -/* #define RBX_CDROM 0xd -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -/* #define RBX_MUTE 0x10 -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -/* #define RBX_PAUSE 0x14 -p */ -/* #define RBX_QUIET 0x15 -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -/* #define RBX_DUAL 0x1d -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -v, -g */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | \ - OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB)) +#include "rbx.h" extern uint32_t _end; #define NOPT 6 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - static const char optstr[NOPT] = "agnrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, Copied and modified: head/sys/boot/common/rbx.h (from r294765, head/sys/boot/i386/common/rbx.h) ============================================================================== Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) +++ head/sys/boot/i386/boot2/boot2.c Tue Jan 26 06:26:44 2016 (r294766) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" #include "paths.h" +#include "rbx.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -53,41 +54,6 @@ __FBSDID("$FreeBSD$"); #define SECOND 18 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -102,9 +68,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_MAXHARD TYPE_DA #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ @@ -139,7 +102,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; static struct bootinfo bootinfo; #if SERIAL static int comspeed = SIOSPD; Modified: head/sys/boot/mips/beri/boot2/boot2.c ============================================================================== --- head/sys/boot/mips/beri/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) +++ head/sys/boot/mips/beri/boot2/boot2.c Tue Jan 26 06:26:44 2016 (r294766) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include "paths.h" +#include "rbx.h" static int beri_argc; static const char **beri_argv, **beri_envv; @@ -75,41 +76,6 @@ static uint64_t beri_memsize; #define SECOND 1 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - #define ARGS 0x900 #define NOPT 14 #define MEM_BASE 0x12 @@ -128,9 +94,6 @@ static uint64_t beri_memsize; /* Hard-coded assumption about location of JTAG-loaded kernel. */ #define DRAM_KERNEL_ADDR ((void *)mips_phys_to_cached(0x20000)) -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Tue Jan 26 06:26:19 2016 (r294765) +++ head/sys/boot/pc98/boot2/boot2.c Tue Jan 26 06:26:44 2016 (r294766) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" #include "paths.h" +#include "rbx.h" /* Define to 0 to omit serial support */ #ifndef SERIAL @@ -55,41 +56,6 @@ __FBSDID("$FreeBSD$"); #define SECOND 1 /* Circa that many ticks in a second. */ -#define RBX_ASKNAME 0x0 /* -a */ -#define RBX_SINGLE 0x1 /* -s */ -/* 0x2 is reserved for log2(RB_NOSYNC). */ -/* 0x3 is reserved for log2(RB_HALT). */ -/* 0x4 is reserved for log2(RB_INITNAME). */ -#define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ -/* 0x7 is reserved for log2(RB_RDONLY). */ -/* 0x8 is reserved for log2(RB_DUMP). */ -/* 0x9 is reserved for log2(RB_MINIROOT). */ -#define RBX_CONFIG 0xa /* -c */ -#define RBX_VERBOSE 0xb /* -v */ -#define RBX_SERIAL 0xc /* -h */ -#define RBX_CDROM 0xd /* -C */ -/* 0xe is reserved for log2(RB_POWEROFF). */ -#define RBX_GDB 0xf /* -g */ -#define RBX_MUTE 0x10 /* -m */ -/* 0x11 is reserved for log2(RB_SELFTEST). */ -/* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ -/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ -#define RBX_DUAL 0x1d /* -D */ -/* 0x1f is reserved for log2(RB_BOOTINFO). */ - -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ -#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ - OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) - #define ARGS 0x900 #define NOPT 14 #define NDEV 3 @@ -101,9 +67,6 @@ __FBSDID("$FreeBSD$"); #define TYPE_DA 1 #define TYPE_FD 2 -#define OPT_SET(opt) (1 << (opt)) -#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) - extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ From owner-svn-src-head@freebsd.org Tue Jan 26 06:26:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6702A470B1; Tue, 26 Jan 2016 06:26: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 mx1.freebsd.org (Postfix) with ESMTPS id 921C08F8; Tue, 26 Jan 2016 06:26: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 u0Q6QkJL003441; Tue, 26 Jan 2016 06:26:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q6QkIk003440; Tue, 26 Jan 2016 06:26:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601260626.u0Q6QkIk003440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 06:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294767 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 06:26:47 -0000 Author: imp Date: Tue Jan 26 06:26:46 2016 New Revision: 294767 URL: https://svnweb.freebsd.org/changeset/base/294767 Log: Parse the command line arguments, and do it before we initialize the console so it can be changed by the command line arguments. Differential Revision: https://reviews.freebsd.org/D5038 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue Jan 26 06:26:44 2016 (r294766) +++ head/sys/boot/efi/loader/main.c Tue Jan 26 06:26:46 2016 (r294767) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -83,13 +85,22 @@ print_str16(const CHAR16 *str) printf("%c", (char)str[i]); } +static void +cp16to8(const CHAR16 *src, char *dst, size_t len) +{ + size_t i; + + for (i = 0; i < len && src[i]; i++) + dst[i] = (char)src[i]; +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { char var[128]; EFI_LOADED_IMAGE *img; EFI_GUID *guid; - int i, j, vargood, unit; + int i, j, vargood, unit, howto; struct devsw *dev; uint64_t pool_guid; UINTN k; @@ -113,27 +124,97 @@ main(int argc, CHAR16 *argv[]) cons_probe(); /* + * Parse the args to set the console settings, etc + * boot1.efi passes these in, if it can read /boot.config or /boot/config + * or iPXE may be setup to pass these in. + * * Loop through the args, and for each one that contains an '=' that is * not the first character, add it to the environment. This allows * loader and kernel env vars to be passed on the command line. Convert * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. */ + howto = 0; for (i = 1; i < argc; i++) { - vargood = 0; - for (j = 0; argv[i][j] != 0; j++) { - if (j == sizeof(var)) { - vargood = 0; - break; + if (argv[i][0] == '-') { + for (j = 1; argv[i][j] != 0; j++) { + int ch; + + ch = argv[i][j]; + switch (ch) { + case 'a': + howto |= RB_ASKNAME; + break; + case 'd': + howto |= RB_KDB; + break; + case 'D': + howto |= RB_MULTIPLE; + break; + case 'm': + howto |= RB_MUTE; + break; + case 'h': + howto |= RB_SERIAL; + break; + case 'p': + howto |= RB_PAUSE; + break; + case 'r': + howto |= RB_DFLTROOT; + break; + case 's': + howto |= RB_SINGLE; + break; + case 'S': + if (argv[i][j + 1] == 0) { + if (i + 1 == argc) { + setenv("comconsole_speed", "115200", 1); + } else { + cp16to8(&argv[i + 1][0], var, + sizeof(var)); + setenv("comconsole_speedspeed", var, 1); + } + i++; + break; + } else { + cp16to8(&argv[i][j + 1], var, + sizeof(var)); + setenv("comconsole_speed", var, 1); + break; + } + case 'v': + howto |= RB_VERBOSE; + break; + } + } + } else { + vargood = 0; + for (j = 0; argv[i][j] != 0; j++) { + if (j == sizeof(var)) { + vargood = 0; + break; + } + if (j > 0 && argv[i][j] == '=') + vargood = 1; + var[j] = (char)argv[i][j]; + } + if (vargood) { + var[j] = 0; + putenv(var); } - if (j > 0 && argv[i][j] == '=') - vargood = 1; - var[j] = (char)argv[i][j]; - } - if (vargood) { - var[j] = 0; - putenv(var); } } + for (i = 0; howto_names[i].ev != NULL; i++) + if (howto & howto_names[i].mask) + setenv(howto_names[i].ev, "YES", 1); + if (howto & RB_MULTIPLE) { + if (howto & RB_SERIAL) + setenv("console", "comconsole efi" , 1); + else + setenv("console", "efi comconsole" , 1); + } else if (howto & RB_SERIAL) { + setenv("console", "comconsole" , 1); + } if (efi_copy_init()) { printf("failed to allocate staging area\n"); From owner-svn-src-head@freebsd.org Tue Jan 26 06:26:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24A09A470FD; Tue, 26 Jan 2016 06: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 mx1.freebsd.org (Postfix) with ESMTPS id D1A21B9D; Tue, 26 Jan 2016 06:26:56 +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 u0Q6QtOn003487; Tue, 26 Jan 2016 06:26:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q6Qtio003486; Tue, 26 Jan 2016 06:26:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601260626.u0Q6Qtio003486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 06:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294768 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 06:26:57 -0000 Author: imp Date: Tue Jan 26 06:26:55 2016 New Revision: 294768 URL: https://svnweb.freebsd.org/changeset/base/294768 Log: Read in /boot/config and /boot.config, like all the other boot loaders and pass it along to /boot/loader.efi. Differential Revision: https://reviews.freebsd.org/D5038 Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Tue Jan 26 06:26:46 2016 (r294767) +++ head/sys/boot/efi/boot1/boot1.c Tue Jan 26 06:26:55 2016 (r294768) @@ -91,13 +91,41 @@ Free(void *buf, const char *file __unuse void try_load(const boot_module_t *mod) { - size_t bufsize; + size_t bufsize, cmdsize; void *buf; + char *cmd; dev_info_t *dev; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + /* + * Read in and parse the command line from /boot.config or /boot/config, + * if present. We'll pass it the next stage via a simple ASCII + * string. loader.efi has a hack for ASCII strings, so we'll use that to + * keep the size down here. We only try to read the alternate file if + * we get EFI_NOT_FOUND because all other errors mean that the boot_module + * had troubles with the filesystem. We could return early, but we'll let + * loading the actual kernel sort all that out. Since these files are + * optional, we don't report errors in trying to read them. + */ + cmd = NULL; + cmdsize = 0; + status = mod->load(PATH_DOTCONFIG, &dev, &buf, &bufsize); + if (status == EFI_NOT_FOUND) + status = mod->load(PATH_CONFIG, &dev, &buf, &bufsize); + if (status == EFI_SUCCESS) { + cmdsize = bufsize + 1; + cmd = malloc(cmdsize); + if (cmd == NULL) { + free(buf); + return; + } + memcpy(cmd, buf, bufsize); + cmd[bufsize] = '\0'; + free(buf); + } + status = mod->load(PATH_LOADER_EFI, &dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) return; @@ -115,6 +143,9 @@ try_load(const boot_module_t *mod) return; } + if (cmd != NULL) + printf(" command args: %s\n", cmd); + if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image)) != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", @@ -123,11 +154,16 @@ try_load(const boot_module_t *mod) } loaded_image->DeviceHandle = dev->devhandle; + loaded_image->LoadOptionsSize = cmdsize; + loaded_image->LoadOptions = cmd; if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { printf("Failed to start image provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); + free(cmd); + loaded_image->LoadOptionsSize = 0; + loaded_image->LoadOptions = NULL; return; } } From owner-svn-src-head@freebsd.org Tue Jan 26 06:26:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F55CA47102; Tue, 26 Jan 2016 06:26:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01909BA7; Tue, 26 Jan 2016 06: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 u0Q6Qv6k003530; Tue, 26 Jan 2016 06:26:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q6QvBr003529; Tue, 26 Jan 2016 06:26:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601260626.u0Q6QvBr003529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 06:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294769 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 06:26:58 -0000 Author: imp Date: Tue Jan 26 06:26:56 2016 New Revision: 294769 URL: https://svnweb.freebsd.org/changeset/base/294769 Log: Allow new lines as white space for arguments that are parsed to allow boot1 to pass in files with newlines in them. Now that the EFI loader groks foo=bar on the command line, this can allow a more general setup than traditional boot loader args will allow. Differential Revision: https://reviews.freebsd.org/D5038 Modified: head/sys/boot/efi/libefi/libefi.c Modified: head/sys/boot/efi/libefi/libefi.c ============================================================================== --- head/sys/boot/efi/libefi/libefi.c Tue Jan 26 06:26:55 2016 (r294768) +++ head/sys/boot/efi/libefi/libefi.c Tue Jan 26 06:26:56 2016 (r294769) @@ -44,7 +44,7 @@ static CHAR16 * arg_skipsep(CHAR16 *argp) { - while (*argp == ' ' || *argp == '\t') + while (*argp == ' ' || *argp == '\t' || *argp == '\n') argp++; return (argp); } @@ -53,7 +53,7 @@ static CHAR16 * arg_skipword(CHAR16 *argp) { - while (*argp && *argp != ' ' && *argp != '\t') + while (*argp && *argp != ' ' && *argp != '\t' && *argp != '\n') argp++; return (argp); } From owner-svn-src-head@freebsd.org Tue Jan 26 07:06:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 670FDA461E3; Tue, 26 Jan 2016 07:06:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1D74D29B; Tue, 26 Jan 2016 07:06:45 +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 u0Q76jf6015317; Tue, 26 Jan 2016 07:06:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q76iWk015311; Tue, 26 Jan 2016 07:06:44 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201601260706.u0Q76iWk015311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 26 Jan 2016 07:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294773 - in head/etc: . defaults periodic/daily rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 07:06:46 -0000 Author: cy Date: Tue Jan 26 07:06:44 2016 New Revision: 294773 URL: https://svnweb.freebsd.org/changeset/base/294773 Log: Add support for automatic leap-second file updates. The working copy of leapfile resides in /var/dbntpd.leap-seconds.list. /etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should automatic leapfile updates be disabled (default). Automatic leapfile updates are fetched from $ntp_leapfile_sources, defaulting to https://www.ietf.org/timezones/data/leap-seconds.list, within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds file expiry. Automatic updates can be enabled by setting $daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting the ntp leapfile source the automatic update randomized by default but can be disabled through daily_ntpd_avoid_congestion="NO" in periodic.conf. Suggested by: des Reviewed by: des, roberto, dwmalone, ian, cperciva, glebius, gjb MFC after: 1 week X-MFC with: r289421, r293037 Added: head/etc/periodic/daily/480.leapfile-ntpd (contents, props changed) Modified: head/etc/defaults/periodic.conf head/etc/defaults/rc.conf head/etc/ntp.conf head/etc/periodic/daily/Makefile head/etc/rc.d/ntpd Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Tue Jan 26 07:06:38 2016 (r294772) +++ head/etc/defaults/periodic.conf Tue Jan 26 07:06:44 2016 (r294773) @@ -134,6 +134,11 @@ daily_status_mail_rejects_enable="YES" daily_status_mail_rejects_logs=3 # How many logs to check daily_status_mail_rejects_shorten="NO" # Shorten output +# 480.leapfile-ntpd +daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_avoid_congestion="YES" # Avoid congesting + # leapfile sources + # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Jan 26 07:06:38 2016 (r294772) +++ head/etc/defaults/rc.conf Tue Jan 26 07:06:44 2016 (r294773) @@ -362,6 +362,15 @@ ntpd_config="/etc/ntp.conf" # ntpd(8) co ntpd_sync_on_start="NO" # Sync time on ntpd startup, even if offset is high ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift" # Flags to ntpd (if enabled). +ntp_src_leapfile="/etc/ntp/leap-seconds" + # Initial source for ntpd leapfile +ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" + # Working copy (updated weekly) leapfile +ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" + # Source from which to fetch leapfile +ntp_leapfile_expiry_days=30 # Check for new leapfile 30 days prior to + # expiry. +ntp_leapfile_fetch_verbose="NO" # Be verbose during NTP leapfile fetch # Network Information Services (NIS) options: All need rpcbind_enable="YES" ### nis_client_enable="NO" # We're an NIS client (or NO). Modified: head/etc/ntp.conf ============================================================================== --- head/etc/ntp.conf Tue Jan 26 07:06:38 2016 (r294772) +++ head/etc/ntp.conf Tue Jan 26 07:06:44 2016 (r294773) @@ -81,4 +81,6 @@ restrict 127.127.1.0 # See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14. # for documentation regarding leapfile. Updates to the file can be obtained # from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. -leapfile "/etc/ntp/leap-seconds" +# Use either leapfile in /etc/ntp or weekly updated leapfile in /var/db. +#leapfile "/etc/ntp/leap-seconds" +leapfile "/var/db/ntpd.leap-seconds.list" Added: head/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/periodic/daily/480.leapfile-ntpd Tue Jan 26 07:06:44 2016 (r294773) @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$daily_ntpd_leapfile_enable" in + [Yy][Ee][Ss]) + case "$daily_ntpd_avoid_congestion" in + [Yy][Ee][Ss]) + # Avoid dogpiling + (sleep $(jot -r 1 0 86400); service ntpd fetch) & + ;; + *) + service ntpd fetch + ;; + esac + ;; +esac + +exit $rc Modified: head/etc/periodic/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Tue Jan 26 07:06:38 2016 (r294772) +++ head/etc/periodic/daily/Makefile Tue Jan 26 07:06:44 2016 (r294773) @@ -35,7 +35,8 @@ FILES+= 130.clean-msgs .endif .if ${MK_NTP} != "no" -FILES+= 480.status-ntpd +FILES+= 480.status-ntpd \ + 480.leapfile-ntpd .endif .if ${MK_RCMDS} != "no" Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Tue Jan 26 07:06:38 2016 (r294772) +++ head/etc/rc.d/ntpd Tue Jan 26 07:06:44 2016 (r294773) @@ -14,6 +14,8 @@ name="ntpd" rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" +extra_commands="fetch" +fetch_cmd="ntpd_fetch_leapfile" start_precmd="ntpd_precmd" load_rc_config $name @@ -30,6 +32,10 @@ ntpd_precmd() return 0; fi + if [ ! -f $ntp_db_leapfile ]; then + ntpd_fetch_leapfile + fi + # If running in a chroot cage, ensure that the appropriate files # exist inside the cage, as well as helper symlinks into the cage # from outside. @@ -44,10 +50,71 @@ ntpd_precmd() ( cd /dev ; /bin/pax -rw -pe clockctl "${ntpd_chrootdir}/dev" ) fi ln -fs "${ntpd_chrootdir}/var/db/ntp.drift" /var/db/ntp.drift + ln -fs "${ntpd_chrootdir}${ntp_tmp_leapfile}" ${ntp_tmp_leapfile} # Change run_rc_commands()'s internal copy of $ntpd_flags # rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags" } +current_ntp_ts() { + # Seconds between 1900-01-01 and 1970-01-01 + # echo $(((70*365+17)*86400)) + ntp_to_unix=2208988800 + + echo $(($(date -u +%s)+$ntp_to_unix)) +} + +get_ntp_leapfile_ver() { + expr "$(awk '$1 == "#$" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +get_ntp_leapfile_expiry() { + expr "$(awk '$1 == "#@" { print $2 }' "$1" 2>/dev/null)" : \ + '^\([1-9][0-9]*\)$' \| 0 +} + +ntpd_fetch_leapfile() { + local ntp_tmp_leapfile rc verbose + + if checkyesno ntp_leapfile_fetch_verbose; then + verbose=echo + else + verbose=: + fi + + ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" + + ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) + ntp_ver_no_db=$(get_ntp_leapfile_ver $ntp_db_leapfile) + $verbose ntp_src_leapfile version is $ntp_ver_no_src + $verbose ntp_db_leapfile version is $ntp_ver_no_db + + if [ "$ntp_ver_no_src" -gt "$ntp_ver_no_db" ]; then + $verbose replacing $ntp_db_leapfile with $ntp_src_leapfile + cp -p $ntp_src_leapfile $ntp_db_leapfile + ntp_ver_no_db=$ntp_ver_no_src + else + $verbose not replacing $ntp_db_leapfile with $ntp_src_leapfile + fi + ntp_leap_expiry=$(get_ntp_leapfile_expiry $ntp_db_leapfile) + ntp_leapfile_expiry_seconds=$((ntp_leapfile_expiry_days*86400)) + ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) + if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then + $verbose Within ntp leapfile expiry limit, initiating fetch + for url in $ntp_leapfile_sources ; do + $verbose fetching $url + fetch -mqo $ntp_tmp_leapfile $url && break + done + ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) + if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then + $verbose using $url as $ntp_db_leapfile + mv $ntp_tmp_leapfile $ntp_db_leapfile + else + $verbose using existing $ntp_db_leapfile + fi + fi +} + run_rc_command "$1" From owner-svn-src-head@freebsd.org Tue Jan 26 07:17:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 316FAA4659C; Tue, 26 Jan 2016 07:17:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 034149A4; Tue, 26 Jan 2016 07:17:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q7HMUs018198; Tue, 26 Jan 2016 07:17:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q7HLOl018195; Tue, 26 Jan 2016 07:17:21 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601260717.u0Q7HLOl018195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 26 Jan 2016 07:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294774 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 07:17:23 -0000 Author: araujo Date: Tue Jan 26 07:17:21 2016 New Revision: 294774 URL: https://svnweb.freebsd.org/changeset/base/294774 Log: Cleanup unused-but-set-variable spotted by gcc-4.9. Reviewed by: neel Approved by: rodrigc (mentor) Differential Revision: https://reviews.freebsd.org/D5042 Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Tue Jan 26 07:06:44 2016 (r294773) +++ head/usr.sbin/bhyve/block_if.c Tue Jan 26 07:17:21 2016 (r294774) @@ -692,9 +692,7 @@ int blockif_close(struct blockif_ctxt *bc) { void *jval; - int err, i; - - err = 0; + int i; assert(bc->bc_magic == BLOCKIF_SIG); Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Tue Jan 26 07:06:44 2016 (r294773) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Jan 26 07:17:21 2016 (r294774) @@ -1201,10 +1201,9 @@ atapi_read_toc(struct ahci_port *p, int { int msf, size; uint64_t sectors; - uint8_t start_track, *bp, buf[50]; + uint8_t *bp, buf[50]; msf = (acmd[1] >> 1) & 1; - start_track = acmd[6]; bp = buf + 2; *bp++ = 1; *bp++ = 1; @@ -1312,13 +1311,11 @@ atapi_read(struct ahci_port *p, int slot struct ahci_cmd_hdr *hdr; struct ahci_prdt_entry *prdt; struct blockif_req *breq; - struct pci_ahci_softc *sc; uint8_t *acmd; uint64_t lba; uint32_t len; int err; - sc = p->pr_sc; acmd = cfis + 0x40; hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); prdt = (struct ahci_prdt_entry *)(cfis + 0x80); From owner-svn-src-head@freebsd.org Tue Jan 26 07:22:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B51BCA46879; Tue, 26 Jan 2016 07:22:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91642DF1; Tue, 26 Jan 2016 07:22:24 +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 u0Q7MNaQ020864; Tue, 26 Jan 2016 07:22:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q7MMZR020856; Tue, 26 Jan 2016 07:22:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601260722.u0Q7MMZR020856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 07:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294775 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 07:22:24 -0000 Author: imp Date: Tue Jan 26 07:22:22 2016 New Revision: 294775 URL: https://svnweb.freebsd.org/changeset/base/294775 Log: Fix the various qemu configs to be buildable. Modified: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg head/tools/tools/nanobsd/embedded/qemu-i386.cfg head/tools/tools/nanobsd/embedded/qemu-mips.cfg head/tools/tools/nanobsd/embedded/qemu-mips64.cfg head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Modified: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Tue Jan 26 07:17:21 2016 (r294774) +++ head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Tue Jan 26 07:22:22 2016 (r294775) @@ -29,6 +29,6 @@ NANO_ARCH=amd64 NANO_NAME=qemu-amd64 -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-i386.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-i386.cfg Tue Jan 26 07:17:21 2016 (r294774) +++ head/tools/tools/nanobsd/embedded/qemu-i386.cfg Tue Jan 26 07:22:22 2016 (r294775) @@ -29,6 +29,6 @@ NANO_ARCH=i386 NANO_NAME=qemu-i386 -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-mips.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-mips.cfg Tue Jan 26 07:17:21 2016 (r294774) +++ head/tools/tools/nanobsd/embedded/qemu-mips.cfg Tue Jan 26 07:22:22 2016 (r294775) @@ -31,6 +31,6 @@ NANO_KERNEL=MALTA NANO_DRIVE=ada0 NANO_NAME=qemu-mips -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-mips64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-mips64.cfg Tue Jan 26 07:17:21 2016 (r294774) +++ head/tools/tools/nanobsd/embedded/qemu-mips64.cfg Tue Jan 26 07:22:22 2016 (r294775) @@ -31,6 +31,6 @@ NANO_KERNEL=MALTA64 NANO_DRIVE=ada0 NANO_NAME=qemu-mips64 -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg Tue Jan 26 07:17:21 2016 (r294774) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg Tue Jan 26 07:22:22 2016 (r294775) @@ -32,6 +32,6 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Tue Jan 26 07:17:21 2016 (r294774) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Tue Jan 26 07:22:22 2016 (r294775) @@ -31,6 +31,6 @@ NANO_KERNEL=GENERIC64 NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc64 -NANO_DISKIMAGE_FORMAT=qcow2 +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env Modified: head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Tue Jan 26 07:17:21 2016 (r294774) +++ head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Tue Jan 26 07:22:22 2016 (r294775) @@ -31,6 +31,6 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-sparc64 -qemu_env +. common # Pull in common definitions -. common # Pull in common definitions, keep last +qemu_env From owner-svn-src-head@freebsd.org Tue Jan 26 07:57:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDDB0A6E806; Tue, 26 Jan 2016 07:57: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 mx1.freebsd.org (Postfix) with ESMTPS id 92948191; Tue, 26 Jan 2016 07:57: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 u0Q7vid4029951; Tue, 26 Jan 2016 07:57:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q7viGW029949; Tue, 26 Jan 2016 07:57:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601260757.u0Q7viGW029949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Jan 2016 07:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294778 - in head: lib/libc/sys sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 07:57:45 -0000 Author: kib Date: Tue Jan 26 07:57:44 2016 New Revision: 294778 URL: https://svnweb.freebsd.org/changeset/base/294778 Log: Restore flushing of output for revoke(2) again. Document revoke()'s intended behaviour in its man page. Simplify tty_drain() to match. Don't call ttydevsw methods in tty_flush() if the device is gone since we now sometimes call it then. The flushing was supposed to be implemented by passing the FNONBLOCK flag to VOP_CLOSE() for revoke(). The tty driver is one of the few that can block in close and was one of the fewer that knew about this. This almost worked in FreeBSD-1 and similarly in Net/2. These versions only almost worked because there was and is considerable confusion between IO_NDELAY and FNONBLOCK (aka O_NONBLOCK). IO_NDELAY is only valid for VOP_READ() and VOP_WRITE(). For other VOPs it has the same value as O_SHLOCK. But since vfs_subr.c and tty.c consistently used the wrong flag and the O_SHLOCK flag is rarely set, this mostly worked. It also gave the feature than applications could get the non-blocking close by abusing O_SHLOCK. This was first broken then fixed in 1995. I changed only the tty driver to use FNONBLOCK, as a hack to get non-blocking via the normal flag FNONBLOCK for last closes. I didn't know about revoke()'s use of IO_NDELAY or change it to be consistent, so revoke() was broken. Then I changed revoke() to match. This was next broken in 1997 then fixed in 1998. Importing Lite2 made the flags inconsistent again by undoing the fix only in vfs_subr.c. This was next broken in 2008 by replacing everything in tty.c and not checking any flags in last close. Other bugs in draining limited the resulting unbounded waits to drain in some cases. It is now possible to fix this better using the new FREVOKE flag. Just restore flushing for revoke() for now. Don't restore or undo any hacks for ordinary last closes yet. But remove dead code in the 1-second relative timeout (r272789). This did extra work to extend the buggy draining for revoke() for as long as possible. The 1-second timeout made this not very long by usually flushing after 1 second. Submitted by: bde MFC after: 2 weeks Modified: head/lib/libc/sys/revoke.2 head/sys/kern/tty.c Modified: head/lib/libc/sys/revoke.2 ============================================================================== --- head/lib/libc/sys/revoke.2 Tue Jan 26 07:49:11 2016 (r294777) +++ head/lib/libc/sys/revoke.2 Tue Jan 26 07:57:44 2016 (r294778) @@ -31,7 +31,7 @@ .\" @(#)revoke.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd Jan 25, 2016 .Dt REVOKE 2 .Os .Sh NAME @@ -59,7 +59,8 @@ and a system call will succeed. If the file is a special file for a device which is open, the device close function -is called as if all open references to the file had been closed. +is called as if all open references to the file had been closed +using a special close method which does not block. .Pp Access to a file may be revoked only by its owner or the super user. The @@ -104,3 +105,6 @@ The .Fn revoke system call first appeared in .Bx 4.3 Reno . +.Sh BUGS +The non-blocking close method is only correctly implemented for +terminal devices. Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Tue Jan 26 07:49:11 2016 (r294777) +++ head/sys/kern/tty.c Tue Jan 26 07:57:44 2016 (r294778) @@ -126,7 +126,7 @@ static int tty_drain(struct tty *tp, int leaving) { size_t bytesused; - int error, revokecnt; + int error; if (ttyhook_hashook(tp, getc_inject)) /* buffer is inaccessible */ @@ -141,18 +141,10 @@ tty_drain(struct tty *tp, int leaving) /* Wait for data to be drained. */ if (leaving) { - revokecnt = tp->t_revokecnt; error = tty_timedwait(tp, &tp->t_outwait, hz); - switch (error) { - case ERESTART: - if (revokecnt != tp->t_revokecnt) - error = 0; - break; - case EWOULDBLOCK: - if (ttyoutq_bytesused(&tp->t_outq) < bytesused) - error = 0; - break; - } + if (error == EWOULDBLOCK && + ttyoutq_bytesused(&tp->t_outq) < bytesused) + error = 0; } else error = tty_wait(tp, &tp->t_outwait); @@ -356,6 +348,10 @@ ttydev_close(struct cdev *dev, int fflag return (0); } + /* If revoking, flush output now to avoid draining it later. */ + if (fflag & FREVOKE) + tty_flush(tp, FWRITE); + /* * This can only be called once. The callin and the callout * devices cannot be opened at the same time. @@ -1460,13 +1456,16 @@ tty_flush(struct tty *tp, int flags) tp->t_flags &= ~TF_HIWAT_OUT; ttyoutq_flush(&tp->t_outq); tty_wakeup(tp, FWRITE); - ttydevsw_pktnotify(tp, TIOCPKT_FLUSHWRITE); + if (!tty_gone(tp)) + ttydevsw_pktnotify(tp, TIOCPKT_FLUSHWRITE); } if (flags & FREAD) { tty_hiwat_in_unblock(tp); ttyinq_flush(&tp->t_inq); - ttydevsw_inwakeup(tp); - ttydevsw_pktnotify(tp, TIOCPKT_FLUSHREAD); + if (!tty_gone(tp)) { + ttydevsw_inwakeup(tp); + ttydevsw_pktnotify(tp, TIOCPKT_FLUSHREAD); + } } } From owner-svn-src-head@freebsd.org Tue Jan 26 09:10:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB4C0A47DF2; Tue, 26 Jan 2016 09:10:39 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::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 9CBC51130; Tue, 26 Jan 2016 09:10:39 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pa0-x231.google.com with SMTP id cy9so95246038pac.0; Tue, 26 Jan 2016 01:10:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=NPw4+8QZijRdxrTP/oQtQqKPIRIq9P8u1aH+ssQkOAA=; b=HygSFB3K93wWWFF8jKLtzIea7kGKXqfXRrqDf/TFoB57pNbLMOjyHSXFazLPWsg+q/ Y20orZrHquN2K/xD6ZqOITVtzQp+i3HKkAy5S0LljOwiB8sjThS0PavQXnSE+cdlyncw NJfqgCASmoHXP4RnweEQqaIszWCzqMoBbwJXD2o5x1ozXoLYa6Vm5zYcmu+zj/wtqpyu 3pozs0J09f2ZGUxB0zhzHqJOA2DYHKr2Somaj/Eql9Q40JvB0IgalAv7Z2jOHfpDdBB8 bwyKCLpWOiI57YnqlJsJFne6TtJ+iaAWxkbtWo3BMFjhgK5BggoT3EusQ9mTQS0c+tQA g8sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=NPw4+8QZijRdxrTP/oQtQqKPIRIq9P8u1aH+ssQkOAA=; b=AcdFuGGOVFYZZDmi+UJzTY5jJ4hd0+KjfTaVJjmfa+9vdUqVqA7Fi0jMKrbscgJMOi nawrB9Ssud2hfuokhP6mtjHbUYpw80sAlPfR7gQd9k+jnjblo1YNO1bavPjxCDtEL5SO HmR4IP2B2WJCXi1LQyEAS0BvtwX63rDsSG6rhq8a/AFu8O5aRlzV1eKD20R1Jv/3XZjG yr9kgTEMoqSaMIvh1PThXlB9sp/Us47gpqYfHhQo49YQCDUYwaXu6wGLHBoZqUonNZUZ s55vlXjZHepufBHwJOZGrEThJ181wYJixR6cXh4EyAENHXrTPSkzZMuLiRi/lzWhFWva W8WA== X-Gm-Message-State: AG10YOTDC/qH8+8sjXas7fBV2eYxmzPYIglL73D/A4ArN0ta05HKt8hlwA0djY0yAocmAw== X-Received: by 10.66.194.230 with SMTP id hz6mr21774015pac.70.1453799439028; Tue, 26 Jan 2016 01:10:39 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:e955:70fa:3edd:219e? (2001-44b8-31ae-7b01-e955-70fa-3edd-219e.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:e955:70fa:3edd:219e]) by smtp.gmail.com with ESMTPSA id m87sm634467pfi.47.2016.01.26.01.10.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Jan 2016 01:10:38 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r294778 - in head: lib/libc/sys sys/kern References: <201601260757.u0Q7viGW029949@repo.freebsd.org> To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <56A73806.4080800@FreeBSD.org> Date: Tue, 26 Jan 2016 20:10:30 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Thunderbird/44.0 MIME-Version: 1.0 In-Reply-To: <201601260757.u0Q7viGW029949@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 09:10:39 -0000 On 26/01/2016 6:57 PM, Konstantin Belousov wrote: > Author: kib > Date: Tue Jan 26 07:57:44 2016 > New Revision: 294778 > URL: https://svnweb.freebsd.org/changeset/base/294778 > > Log: > Restore flushing of output for revoke(2) again. Document revoke()'s > intended behaviour in its man page. Simplify tty_drain() to match. > Don't call ttydevsw methods in tty_flush() if the device is gone > since we now sometimes call it then. > > The flushing was supposed to be implemented by passing the FNONBLOCK > flag to VOP_CLOSE() for revoke(). The tty driver is one of the few > that can block in close and was one of the fewer that knew about this. > > This almost worked in FreeBSD-1 and similarly in Net/2. These > versions only almost worked because there was and is considerable > confusion between IO_NDELAY and FNONBLOCK (aka O_NONBLOCK). IO_NDELAY > is only valid for VOP_READ() and VOP_WRITE(). For other VOPs it has > the same value as O_SHLOCK. But since vfs_subr.c and tty.c > consistently used the wrong flag and the O_SHLOCK flag is rarely set, > this mostly worked. It also gave the feature than applications could > get the non-blocking close by abusing O_SHLOCK. > > This was first broken then fixed in 1995. I changed only the tty > driver to use FNONBLOCK, as a hack to get non-blocking via the normal > flag FNONBLOCK for last closes. I didn't know about revoke()'s use > of IO_NDELAY or change it to be consistent, so revoke() was broken. > Then I changed revoke() to match. Seems like > This was next broken in 1997 then fixed in 1998. Importing Lite2 made > the flags inconsistent again by undoing the fix only in vfs_subr.c. A fantastic > This was next broken in 2008 by replacing everything in tty.c and not > checking any flags in last close. Other bugs in draining limited the > resulting unbounded waits to drain in some cases. Regression test candidate :) > It is now possible to fix this better using the new FREVOKE flag. > Just restore flushing for revoke() for now. Don't restore or undo any > hacks for ordinary last closes yet. But remove dead code in the > 1-second relative timeout (r272789). This did extra work to extend > the buggy draining for revoke() for as long as possible. The 1-second > timeout made this not very long by usually flushing after 1 second. > > Submitted by: bde > MFC after: 2 weeks > > Modified: > head/lib/libc/sys/revoke.2 > head/sys/kern/tty.c > > Modified: head/lib/libc/sys/revoke.2 > ============================================================================== > --- head/lib/libc/sys/revoke.2 Tue Jan 26 07:49:11 2016 (r294777) > +++ head/lib/libc/sys/revoke.2 Tue Jan 26 07:57:44 2016 (r294778) > @@ -31,7 +31,7 @@ > .\" @(#)revoke.2 8.1 (Berkeley) 6/4/93 > .\" $FreeBSD$ > .\" > -.Dd June 4, 1993 > +.Dd Jan 25, 2016 > .Dt REVOKE 2 > .Os > .Sh NAME > @@ -59,7 +59,8 @@ and a > system call will succeed. > If the file is a special file for a device which is open, > the device close function > -is called as if all open references to the file had been closed. > +is called as if all open references to the file had been closed > +using a special close method which does not block. > .Pp > Access to a file may be revoked only by its owner or the super user. > The > @@ -104,3 +105,6 @@ The > .Fn revoke > system call first appeared in > .Bx 4.3 Reno . > +.Sh BUGS > +The non-blocking close method is only correctly implemented for > +terminal devices. > > Modified: head/sys/kern/tty.c > ============================================================================== > --- head/sys/kern/tty.c Tue Jan 26 07:49:11 2016 (r294777) > +++ head/sys/kern/tty.c Tue Jan 26 07:57:44 2016 (r294778) > @@ -126,7 +126,7 @@ static int > tty_drain(struct tty *tp, int leaving) > { > size_t bytesused; > - int error, revokecnt; > + int error; > > if (ttyhook_hashook(tp, getc_inject)) > /* buffer is inaccessible */ > @@ -141,18 +141,10 @@ tty_drain(struct tty *tp, int leaving) > > /* Wait for data to be drained. */ > if (leaving) { > - revokecnt = tp->t_revokecnt; > error = tty_timedwait(tp, &tp->t_outwait, hz); > - switch (error) { > - case ERESTART: > - if (revokecnt != tp->t_revokecnt) > - error = 0; > - break; > - case EWOULDBLOCK: > - if (ttyoutq_bytesused(&tp->t_outq) < bytesused) > - error = 0; > - break; > - } > + if (error == EWOULDBLOCK && > + ttyoutq_bytesused(&tp->t_outq) < bytesused) > + error = 0; > } else > error = tty_wait(tp, &tp->t_outwait); > > @@ -356,6 +348,10 @@ ttydev_close(struct cdev *dev, int fflag > return (0); > } > > + /* If revoking, flush output now to avoid draining it later. */ > + if (fflag & FREVOKE) > + tty_flush(tp, FWRITE); > + > /* > * This can only be called once. The callin and the callout > * devices cannot be opened at the same time. > @@ -1460,13 +1456,16 @@ tty_flush(struct tty *tp, int flags) > tp->t_flags &= ~TF_HIWAT_OUT; > ttyoutq_flush(&tp->t_outq); > tty_wakeup(tp, FWRITE); > - ttydevsw_pktnotify(tp, TIOCPKT_FLUSHWRITE); > + if (!tty_gone(tp)) > + ttydevsw_pktnotify(tp, TIOCPKT_FLUSHWRITE); > } > if (flags & FREAD) { > tty_hiwat_in_unblock(tp); > ttyinq_flush(&tp->t_inq); > - ttydevsw_inwakeup(tp); > - ttydevsw_pktnotify(tp, TIOCPKT_FLUSHREAD); > + if (!tty_gone(tp)) { > + ttydevsw_inwakeup(tp); > + ttydevsw_pktnotify(tp, TIOCPKT_FLUSHREAD); > + } > } > } > From owner-svn-src-head@freebsd.org Tue Jan 26 09:42:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CA8AA46036; Tue, 26 Jan 2016 09:42:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB5C8C16; Tue, 26 Jan 2016 09:42:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q9gD0R062311; Tue, 26 Jan 2016 09:42:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q9gD14062309; Tue, 26 Jan 2016 09:42:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601260942.u0Q9gD14062309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Jan 2016 09:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294788 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 09:42:15 -0000 Author: sephe Date: Tue Jan 26 09:42:13 2016 New Revision: 294788 URL: https://svnweb.freebsd.org/changeset/base/294788 Log: hyperv/hn: Improve sending performance - Avoid main lock contention by trylock for if_start, if that fails, schedule TX taskqueue for if_start - Don't do direct sending if the packet to be sent is large, e.g. TSO packet. This change gives me stable 9.1Gbps TCP sending performance w/ TSO over a 10Gbe directly connected network (the performance fluctuated between 4Gbps and 9Gbps before this commit). It also improves non- TSO TCP sending performance a lot. Reviewed by: adrian, royger Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5074 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jan 26 09:09:20 2016 (r294787) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jan 26 09:42:13 2016 (r294788) @@ -39,9 +39,11 @@ #define __HV_NET_VSC_H__ #include +#include #include #include #include +#include #include #include @@ -1008,7 +1010,6 @@ typedef struct hn_softc { struct hv_device *hn_dev_obj; netvsc_dev *net_dev; - int hn_txdesc_cnt; struct hn_txdesc *hn_txdesc; bus_dma_tag_t hn_tx_data_dtag; bus_dma_tag_t hn_tx_rndis_dtag; @@ -1017,9 +1018,15 @@ typedef struct hn_softc { struct mtx hn_txlist_spin; struct hn_txdesc_list hn_txlist; + int hn_txdesc_cnt; int hn_txdesc_avail; int hn_txeof; + int hn_direct_tx_size; + struct taskqueue *hn_tx_taskq; + struct task hn_start_task; + struct task hn_txeof_task; + struct lro_ctrl hn_lro; int hn_lro_hiwat; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 26 09:09:20 2016 (r294787) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jan 26 09:42:13 2016 (r294788) @@ -146,6 +146,8 @@ __FBSDID("$FreeBSD$"); #define HN_TX_DATA_SEGCNT_MAX \ (NETVSC_PACKET_MAXPAGE - HV_RF_NUM_TX_RESERVED_PAGE_BUFS) +#define HN_DIRECT_TX_SIZE_DEF 128 + struct hn_txdesc { SLIST_ENTRY(hn_txdesc) link; struct mbuf *m; @@ -194,6 +196,7 @@ struct hn_txdesc { #define NV_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->hn_lock, _name, MTX_NETWORK_LOCK, MTX_DEF) #define NV_LOCK(_sc) mtx_lock(&(_sc)->hn_lock) +#define NV_TRYLOCK(_sc) mtx_trylock(&(_sc)->hn_lock) #define NV_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->hn_lock, MA_OWNED) #define NV_UNLOCK(_sc) mtx_unlock(&(_sc)->hn_lock) #define NV_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->hn_lock) @@ -219,6 +222,10 @@ TUNABLE_INT("dev.hn.tso_maxlen", &hn_tso static int hn_tx_chimney_size = 0; TUNABLE_INT("dev.hn.tx_chimney_size", &hn_tx_chimney_size); +/* Limit the size of packet for direct transmission */ +static int hn_direct_tx_size = HN_DIRECT_TX_SIZE_DEF; +TUNABLE_INT("dev.hn.direct_tx_size", &hn_direct_tx_size); + /* * Forward declarations */ @@ -226,8 +233,9 @@ static void hn_stop(hn_softc_t *sc); static void hn_ifinit_locked(hn_softc_t *sc); static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -static void hn_start_locked(struct ifnet *ifp); +static int hn_start_locked(struct ifnet *ifp, int len); static void hn_start(struct ifnet *ifp); +static void hn_start_txeof(struct ifnet *ifp); static int hn_ifmedia_upd(struct ifnet *ifp); static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); #ifdef HN_LRO_HIWAT @@ -237,6 +245,8 @@ static int hn_tx_chimney_size_sysctl(SYS static int hn_check_iplen(const struct mbuf *, int); static int hn_create_tx_ring(struct hn_softc *sc); static void hn_destroy_tx_ring(struct hn_softc *sc); +static void hn_start_taskfunc(void *xsc, int pending); +static void hn_txeof_taskfunc(void *xsc, int pending); static __inline void hn_set_lro_hiwat(struct hn_softc *sc, int hiwat) @@ -384,6 +394,14 @@ netvsc_attach(device_t dev) sc->hn_dev = dev; sc->hn_lro_hiwat = HN_LRO_HIWAT_DEF; sc->hn_trust_hosttcp = hn_trust_hosttcp; + sc->hn_direct_tx_size = hn_direct_tx_size; + + sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &sc->hn_tx_taskq); + taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", + device_get_nameunit(dev)); + TASK_INIT(&sc->hn_start_task, 0, hn_start_taskfunc, sc); + TASK_INIT(&sc->hn_txeof_task, 0, hn_txeof_taskfunc, sc); error = hn_create_tx_ring(sc); if (error) @@ -524,6 +542,9 @@ netvsc_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_size", CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_tx_chimney_size_sysctl, "I", "Chimney send packet size limit"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "direct_tx_size", + CTLFLAG_RW, &sc->hn_direct_tx_size, 0, + "Size of the packet for direct transmission"); if (unit == 0) { struct sysctl_ctx_list *dc_ctx; @@ -548,6 +569,9 @@ netvsc_attach(device_t dev) SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tso_maxlen", CTLFLAG_RD, &hn_tso_maxlen, 0, "TSO burst limit"); #endif + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "direct_tx_size", + CTLFLAG_RD, &hn_direct_tx_size, 0, + "Size of the packet for direct transmission"); } return (0); @@ -583,6 +607,10 @@ netvsc_detach(device_t dev) hv_rf_on_device_remove(hv_device, HV_RF_NV_DESTROY_CHANNEL); + taskqueue_drain(sc->hn_tx_taskq, &sc->hn_start_task); + taskqueue_drain(sc->hn_tx_taskq, &sc->hn_txeof_task); + taskqueue_free(sc->hn_tx_taskq); + ifmedia_removeall(&sc->hn_media); #if defined(INET) || defined(INET6) tcp_lro_free(&sc->hn_lro); @@ -733,24 +761,19 @@ void netvsc_channel_rollup(struct hv_device *device_ctx) { struct hn_softc *sc = device_get_softc(device_ctx->device); - struct ifnet *ifp; if (!sc->hn_txeof) return; sc->hn_txeof = 0; - ifp = sc->hn_ifp; - NV_LOCK(sc); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - hn_start_locked(ifp); - NV_UNLOCK(sc); + hn_start_txeof(sc->hn_ifp); } /* * Start a transmit of one or more packets */ -static void -hn_start_locked(struct ifnet *ifp) +static int +hn_start_locked(struct ifnet *ifp, int len) { hn_softc_t *sc = ifp->if_softc; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); @@ -768,7 +791,7 @@ hn_start_locked(struct ifnet *ifp) if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) - return; + return 0; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; @@ -781,11 +804,21 @@ hn_start_locked(struct ifnet *ifp) if (m_head == NULL) break; + if (len > 0 && m_head->m_pkthdr.len > len) { + /* + * This sending could be time consuming; let callers + * dispatch this packet sending (and sending of any + * following up packets) to tx taskqueue. + */ + IF_PREPEND(&ifp->if_snd, m_head); + return 1; + } + txd = hn_txdesc_get(sc); if (txd == NULL) { sc->hn_no_txdescs++; IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } @@ -1060,10 +1093,11 @@ again: sc->hn_send_failed++; IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } } + return 0; } /* @@ -1555,7 +1589,8 @@ hn_stop(hn_softc_t *sc) if (bootverbose) printf(" Closing Device ...\n"); - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + atomic_clear_int(&ifp->if_drv_flags, + (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)); if_link_state_change(ifp, LINK_STATE_DOWN); sc->hn_initdone = 0; @@ -1571,13 +1606,43 @@ hn_start(struct ifnet *ifp) hn_softc_t *sc; sc = ifp->if_softc; - NV_LOCK(sc); - if (sc->temp_unusable) { + if (NV_TRYLOCK(sc)) { + int sched; + + sched = hn_start_locked(ifp, sc->hn_direct_tx_size); NV_UNLOCK(sc); - return; + if (!sched) + return; + } + taskqueue_enqueue_fast(sc->hn_tx_taskq, &sc->hn_start_task); +} + +static void +hn_start_txeof(struct ifnet *ifp) +{ + hn_softc_t *sc; + + sc = ifp->if_softc; + if (NV_TRYLOCK(sc)) { + int sched; + + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + sched = hn_start_locked(ifp, sc->hn_direct_tx_size); + NV_UNLOCK(sc); + if (sched) { + taskqueue_enqueue_fast(sc->hn_tx_taskq, + &sc->hn_start_task); + } + } else { + /* + * Release the OACTIVE earlier, with the hope, that + * others could catch up. The task will clear the + * flag again with the NV_LOCK to avoid possible + * races. + */ + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + taskqueue_enqueue_fast(sc->hn_tx_taskq, &sc->hn_txeof_task); } - hn_start_locked(ifp); - NV_UNLOCK(sc); } /* @@ -1604,8 +1669,8 @@ hn_ifinit_locked(hn_softc_t *sc) } else { sc->hn_initdone = 1; } - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + atomic_set_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); if_link_state_change(ifp, LINK_STATE_UP); } @@ -1907,6 +1972,28 @@ hn_destroy_tx_ring(struct hn_softc *sc) mtx_destroy(&sc->hn_txlist_spin); } +static void +hn_start_taskfunc(void *xsc, int pending __unused) +{ + struct hn_softc *sc = xsc; + + NV_LOCK(sc); + hn_start_locked(sc->hn_ifp, 0); + NV_UNLOCK(sc); +} + +static void +hn_txeof_taskfunc(void *xsc, int pending __unused) +{ + struct hn_softc *sc = xsc; + struct ifnet *ifp = sc->hn_ifp; + + NV_LOCK(sc); + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + hn_start_locked(ifp, 0); + NV_UNLOCK(sc); +} + static device_method_t netvsc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, netvsc_probe), From owner-svn-src-head@freebsd.org Tue Jan 26 09:50:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D996A465F3; Tue, 26 Jan 2016 09:50:25 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24A0EB6; Tue, 26 Jan 2016 09:50:25 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q9oOKR062642; Tue, 26 Jan 2016 09:50:24 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q9oNWJ062640; Tue, 26 Jan 2016 09:50:23 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601260950.u0Q9oNWJ062640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 26 Jan 2016 09:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294789 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 09:50:25 -0000 Author: skra Date: Tue Jan 26 09:50:23 2016 New Revision: 294789 URL: https://svnweb.freebsd.org/changeset/base/294789 Log: Make code more compact and readable better in pmap_extract() like functions. No functional change. This is a follow up to r294722. Suggested by: kib Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Tue Jan 26 09:42:13 2016 (r294788) +++ head/sys/arm/arm/pmap-v6.c Tue Jan 26 09:50:23 2016 (r294789) @@ -3446,14 +3446,10 @@ pmap_extract_locked(pmap_t pmap, vm_offs pte = ptep[l2pte_index(va)]; if (pte == 0) return (0); - switch (pte & L2_TYPE_MASK) { - case L2_TYPE_L: + if ((pte & L2_TYPE_MASK) == L2_TYPE_L) pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET); - break; - default: + else pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); - break; - } } return (pa); } @@ -3515,20 +3511,15 @@ retry: PMAP_UNLOCK(pmap); return (NULL); } else { - switch (pte & L2_TYPE_MASK) { - case L2_TYPE_L: + if ((pte & L2_TYPE_MASK) == L2_TYPE_L) panic("extract and hold section mapping"); - break; - default: + else pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); - break; - } if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr)) goto retry; m = PHYS_TO_VM_PAGE(pa); vm_page_hold(m); } - } PMAP_UNLOCK(pmap); @@ -3567,14 +3558,10 @@ pmap_dump_kextract(vm_offset_t va, pt2_e pa = 0; goto out; } - switch (pte & L2_TYPE_MASK) { - case L2_TYPE_L: + if ((pte & L2_TYPE_MASK) == L2_TYPE_L) pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET); - break; - default: + else pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); - break; - } } out: if (pte2p != NULL) Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Tue Jan 26 09:42:13 2016 (r294788) +++ head/sys/arm/arm/pmap.c Tue Jan 26 09:50:23 2016 (r294789) @@ -2787,18 +2787,14 @@ pmap_kremove(vm_offset_t va) pte = &l2b->l2b_kva[l2pte_index(va)]; opte = *pte; if (l2pte_valid(opte)) { - /* pa = vtophs(va) taken from pmap_extract() */ - switch (opte & L2_TYPE_MASK) { - case L2_TYPE_L: + /* pa = vtophs(va) taken from pmap_extract() */ + if ((opte & L2_TYPE_MASK) == L2_TYPE_L) pa = (opte & L2_L_FRAME) | (va & L2_L_OFFSET); - break; - default: + else pa = (opte & L2_S_FRAME) | (va & L2_S_OFFSET); - break; - } - /* note: should never have to remove an allocation - * before the pvzone is initialized. - */ + /* note: should never have to remove an allocation + * before the pvzone is initialized. + */ rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap_kernel()); if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa)) && @@ -3645,14 +3641,10 @@ pmap_extract_locked(pmap_t pmap, vm_offs pte = ptep[l2pte_index(va)]; if (pte == 0) return (0); - switch (pte & L2_TYPE_MASK) { - case L2_TYPE_L: + if ((pte & L2_TYPE_MASK) == L2_TYPE_L) pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET); - break; - default: + else pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); - break; - } } return (pa); } @@ -3717,15 +3709,10 @@ retry: return (NULL); } if (pte & L2_S_PROT_W || (prot & VM_PROT_WRITE) == 0) { - switch (pte & L2_TYPE_MASK) { - case L2_TYPE_L: + if ((pte & L2_TYPE_MASK) == L2_TYPE_L) pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET); - break; - - default: + else pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); - break; - } if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr)) goto retry; m = PHYS_TO_VM_PAGE(pa); @@ -3769,14 +3756,10 @@ pmap_dump_kextract(vm_offset_t va, pt2_e pa = 0; goto out; } - switch (pte & L2_TYPE_MASK) { - case L2_TYPE_L: + if ((pte & L2_TYPE_MASK) == L2_TYPE_L) pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET); - break; - default: + else pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); - break; - } } out: if (pte2p != NULL) From owner-svn-src-head@freebsd.org Tue Jan 26 10:24:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29AD8A6E430; Tue, 26 Jan 2016 10:24:20 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B99164D; Tue, 26 Jan 2016 10:24:19 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QAOInA074244; Tue, 26 Jan 2016 10:24:18 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QAOIEr074243; Tue, 26 Jan 2016 10:24:18 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601261024.u0QAOIEr074243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 26 Jan 2016 10:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294791 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 10:24:20 -0000 Author: skra Date: Tue Jan 26 10:24:18 2016 New Revision: 294791 URL: https://svnweb.freebsd.org/changeset/base/294791 Log: Don't do icache sync on kernel memory and keep in line with comment in elf_cpu_load_file(). The only time when the sync is needed is after kernel module is loaded and the relocation info is processed. And it's done in elf_cpu_load_file(). Modified: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Jan 26 09:50:36 2016 (r294790) +++ head/sys/arm/arm/pmap-v6-new.c Tue Jan 26 10:24:18 2016 (r294791) @@ -3799,14 +3799,19 @@ validate: * is set. Do it now, before the mapping is stored and made * valid for hardware table walk. If done later, there is a race * for other threads of current process in lazy loading case. + * Don't do it for kernel memory which is mapped with exec + * permission even if the memory isn't going to hold executable + * code. The only time when icache sync is needed is after + * kernel module is loaded and the relocation info is processed. + * And it's done in elf_cpu_load_file(). * * QQQ: (1) Does it exist any better way where * or how to sync icache? * (2) Now, we do it on a page basis. */ - if ((prot & VM_PROT_EXECUTE) && - (m->md.pat_mode == PTE2_ATTR_WB_WA) && - ((opa != pa) || (opte2 & PTE2_NX))) + if ((prot & VM_PROT_EXECUTE) && pmap != kernel_pmap && + m->md.pat_mode == PTE2_ATTR_WB_WA && + (opa != pa || (opte2 & PTE2_NX))) cache_icache_sync_fresh(va, pa, PAGE_SIZE); npte2 |= PTE2_A; @@ -4405,7 +4410,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ l2prot |= PTE2_U | PTE2_NG; if ((prot & VM_PROT_EXECUTE) == 0) l2prot |= PTE2_NX; - else if (m->md.pat_mode == PTE2_ATTR_WB_WA) { + else if (m->md.pat_mode == PTE2_ATTR_WB_WA && pmap != kernel_pmap) { /* * Sync icache if exec permission and attribute PTE2_ATTR_WB_WA * is set. QQQ: For more info, see comments in pmap_enter(). @@ -4476,7 +4481,7 @@ pmap_enter_pte1(pmap_t pmap, vm_offset_t l1prot |= PTE1_U | PTE1_NG; if ((prot & VM_PROT_EXECUTE) == 0) l1prot |= PTE1_NX; - else if (m->md.pat_mode == PTE2_ATTR_WB_WA) { + else if (m->md.pat_mode == PTE2_ATTR_WB_WA && pmap != kernel_pmap) { /* * Sync icache if exec permission and attribute PTE2_ATTR_WB_WA * is set. QQQ: For more info, see comments in pmap_enter(). From owner-svn-src-head@freebsd.org Tue Jan 26 10:29:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 358BDA6E60C for ; Tue, 26 Jan 2016 10:29:08 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB7301A1A for ; Tue, 26 Jan 2016 10:29:07 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22a.google.com with SMTP id n5so122442518wmn.0 for ; Tue, 26 Jan 2016 02:29:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=GcASHzqCVTaO/N5UPAwhEVB3hzeZzAN3xdJKdmKvzDc=; b=Y/fJ0ar4Z1UlPCe7e9OGfopvtcYJNLtqyomkHpa16t8YgpbEDuvqSC8dCuRcWIn4It WdAdGh9FOgtPS2eFV//9NGLU3oVgk3RTNKDQ2qVe32E3jou2NECA2Qn1zksRyGtcKvnW 1Mhr++XnlG3DD14g37mwFDKh4lafpKUWxV5/Etp1HhXO/3O5jV9svOFg0gdvjJqS5LT9 QH0reMdUTVY5FdLcUOmICNGJj4/udB2/aMSrYTyge4vVCQUXajU4GitakEX5pzUUvUN2 jheM9WubzJMYzUv9Cx87kPZJHkzQ5FJG5vOSEb7YpY6RghpOyu01hniJLvXxYPrxAyr5 qaBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=GcASHzqCVTaO/N5UPAwhEVB3hzeZzAN3xdJKdmKvzDc=; b=TG+Z9j/uhan9SzIpRDS19Bvn70mneULYXKUpw9W8rapo9h1JDWbV9fLHDjvdXZTaHx rVVwaX1uIpurkCmwlccRc67C6SLv8CVV7GksArW9A8Z5DUTArUQImVwIHyBIk8UEUyFY iFK+FV71N700SQTyZh1GaKJcMq9RlTik5qxZ6elDOAOAP4Cape6jvt/oaIWU4IgmB3OJ mqyase9SxYKnBMaJYolukWvsF+QCkKJdxcwIrGsHwL52o+ab7A7weNyAauOA+9yaY8NE PGcnMeknEq3jsA8xxGrYAZYbMo9bJzpJ8Lz1o6v4UHDNgcMX7Kz+6q5RvCF5wZVXanWX bgsw== X-Gm-Message-State: AG10YOQ8/EMcY9rfyKYdhk8hpwTlmdVzWLb+leeZcIuIRNS6WapPGX/LHZh/KjfZ9+gEuHkh X-Received: by 10.194.117.134 with SMTP id ke6mr25465666wjb.94.1453804145881; Tue, 26 Jan 2016 02:29:05 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id s2sm730623wjs.43.2016.01.26.02.29.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Jan 2016 02:29:04 -0800 (PST) Subject: Re: svn commit: r294767 - head/sys/boot/efi/loader To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601260626.u0Q6QkIk003440@repo.freebsd.org> From: Steven Hartland Message-ID: <56A74A7D.8010903@multiplay.co.uk> Date: Tue, 26 Jan 2016 10:29:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601260626.u0Q6QkIk003440@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 10:29:08 -0000 No plan to MFC these changes? On 26/01/2016 06:26, Warner Losh wrote: > Author: imp > Date: Tue Jan 26 06:26:46 2016 > New Revision: 294767 > URL: https://svnweb.freebsd.org/changeset/base/294767 > > Log: > Parse the command line arguments, and do it before we initialize the > console so it can be changed by the command line arguments. > > Differential Revision: https://reviews.freebsd.org/D5038 > > Modified: > head/sys/boot/efi/loader/main.c > > Modified: head/sys/boot/efi/loader/main.c > ============================================================================== > --- head/sys/boot/efi/loader/main.c Tue Jan 26 06:26:44 2016 (r294766) > +++ head/sys/boot/efi/loader/main.c Tue Jan 26 06:26:46 2016 (r294767) > @@ -29,6 +29,8 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include > +#include > #include > #include > #include > @@ -83,13 +85,22 @@ print_str16(const CHAR16 *str) > printf("%c", (char)str[i]); > } > > +static void > +cp16to8(const CHAR16 *src, char *dst, size_t len) > +{ > + size_t i; > + > + for (i = 0; i < len && src[i]; i++) > + dst[i] = (char)src[i]; > +} > + > EFI_STATUS > main(int argc, CHAR16 *argv[]) > { > char var[128]; > EFI_LOADED_IMAGE *img; > EFI_GUID *guid; > - int i, j, vargood, unit; > + int i, j, vargood, unit, howto; > struct devsw *dev; > uint64_t pool_guid; > UINTN k; > @@ -113,27 +124,97 @@ main(int argc, CHAR16 *argv[]) > cons_probe(); > > /* > + * Parse the args to set the console settings, etc > + * boot1.efi passes these in, if it can read /boot.config or /boot/config > + * or iPXE may be setup to pass these in. > + * > * Loop through the args, and for each one that contains an '=' that is > * not the first character, add it to the environment. This allows > * loader and kernel env vars to be passed on the command line. Convert > * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. > */ > + howto = 0; > for (i = 1; i < argc; i++) { > - vargood = 0; > - for (j = 0; argv[i][j] != 0; j++) { > - if (j == sizeof(var)) { > - vargood = 0; > - break; > + if (argv[i][0] == '-') { > + for (j = 1; argv[i][j] != 0; j++) { > + int ch; > + > + ch = argv[i][j]; > + switch (ch) { > + case 'a': > + howto |= RB_ASKNAME; > + break; > + case 'd': > + howto |= RB_KDB; > + break; > + case 'D': > + howto |= RB_MULTIPLE; > + break; > + case 'm': > + howto |= RB_MUTE; > + break; > + case 'h': > + howto |= RB_SERIAL; > + break; > + case 'p': > + howto |= RB_PAUSE; > + break; > + case 'r': > + howto |= RB_DFLTROOT; > + break; > + case 's': > + howto |= RB_SINGLE; > + break; > + case 'S': > + if (argv[i][j + 1] == 0) { > + if (i + 1 == argc) { > + setenv("comconsole_speed", "115200", 1); > + } else { > + cp16to8(&argv[i + 1][0], var, > + sizeof(var)); > + setenv("comconsole_speedspeed", var, 1); > + } > + i++; > + break; > + } else { > + cp16to8(&argv[i][j + 1], var, > + sizeof(var)); > + setenv("comconsole_speed", var, 1); > + break; > + } > + case 'v': > + howto |= RB_VERBOSE; > + break; > + } > + } > + } else { > + vargood = 0; > + for (j = 0; argv[i][j] != 0; j++) { > + if (j == sizeof(var)) { > + vargood = 0; > + break; > + } > + if (j > 0 && argv[i][j] == '=') > + vargood = 1; > + var[j] = (char)argv[i][j]; > + } > + if (vargood) { > + var[j] = 0; > + putenv(var); > } > - if (j > 0 && argv[i][j] == '=') > - vargood = 1; > - var[j] = (char)argv[i][j]; > - } > - if (vargood) { > - var[j] = 0; > - putenv(var); > } > } > + for (i = 0; howto_names[i].ev != NULL; i++) > + if (howto & howto_names[i].mask) > + setenv(howto_names[i].ev, "YES", 1); > + if (howto & RB_MULTIPLE) { > + if (howto & RB_SERIAL) > + setenv("console", "comconsole efi" , 1); > + else > + setenv("console", "efi comconsole" , 1); > + } else if (howto & RB_SERIAL) { > + setenv("console", "comconsole" , 1); > + } > > if (efi_copy_init()) { > printf("failed to allocate staging area\n"); > From owner-svn-src-head@freebsd.org Tue Jan 26 11:28:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 195DAA46F20; Tue, 26 Jan 2016 11:28:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id DC89A1AAE; Tue, 26 Jan 2016 11:28:56 +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 u0QBSt7T091468; Tue, 26 Jan 2016 11:28:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QBStRS091467; Tue, 26 Jan 2016 11:28:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201601261128.u0QBStRS091467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 26 Jan 2016 11:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294792 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 11:28:57 -0000 Author: trasz Date: Tue Jan 26 11:28:55 2016 New Revision: 294792 URL: https://svnweb.freebsd.org/changeset/base/294792 Log: Fix the way RCTL handles rules' rrl_exceeded on credenials change. Because of what this variable does, it was probably harmless - but still incorrect. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Tue Jan 26 10:24:18 2016 (r294791) +++ head/sys/kern/kern_rctl.c Tue Jan 26 11:28:55 2016 (r294792) @@ -1745,6 +1745,7 @@ again: for (i = 0; i < rulecnt; i++) { newlink = uma_zalloc(rctl_rule_link_zone, M_WAITOK); newlink->rrl_rule = NULL; + newlink->rrl_exceeded = 0; LIST_INSERT_HEAD(&newrules, newlink, rrl_next); } @@ -1761,6 +1762,7 @@ again: goto goaround; rctl_rule_acquire(link->rrl_rule); newlink->rrl_rule = link->rrl_rule; + newlink->rrl_exceeded = link->rrl_exceeded; newlink = LIST_NEXT(newlink, rrl_next); rulecnt--; } @@ -1771,6 +1773,7 @@ again: goto goaround; rctl_rule_acquire(link->rrl_rule); newlink->rrl_rule = link->rrl_rule; + newlink->rrl_exceeded = link->rrl_exceeded; newlink = LIST_NEXT(newlink, rrl_next); rulecnt--; } @@ -1780,6 +1783,7 @@ again: goto goaround; rctl_rule_acquire(link->rrl_rule); newlink->rrl_rule = link->rrl_rule; + newlink->rrl_exceeded = link->rrl_exceeded; newlink = LIST_NEXT(newlink, rrl_next); rulecnt--; } @@ -1789,6 +1793,7 @@ again: goto goaround; rctl_rule_acquire(link->rrl_rule); newlink->rrl_rule = link->rrl_rule; + newlink->rrl_exceeded = link->rrl_exceeded; newlink = LIST_NEXT(newlink, rrl_next); rulecnt--; } From owner-svn-src-head@freebsd.org Tue Jan 26 12:00:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D8DA46100; Tue, 26 Jan 2016 12:00:10 +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 D0BA6DC1; Tue, 26 Jan 2016 12:00:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 895831A2F36; Tue, 26 Jan 2016 22:38:36 +1100 (AEDT) Date: Tue, 26 Jan 2016 22:38:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kubilay Kocak cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294778 - in head: lib/libc/sys sys/kern In-Reply-To: <56A73806.4080800@FreeBSD.org> Message-ID: <20160126204713.P1692@besplex.bde.org> References: <201601260757.u0Q7viGW029949@repo.freebsd.org> <56A73806.4080800@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.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=VnRtmwVBtHlHhgADq_kA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:00:10 -0000 On Tue, 26 Jan 2016, Kubilay Kocak wrote: >> Log: >> Restore flushing of output for revoke(2) again. Document revoke()'s >> intended behaviour in its man page. Simplify tty_drain() to match. >> Don't call ttydevsw methods in tty_flush() if the device is gone >> since we now sometimes call it then. >> ... >> This was first broken then fixed in 1995. I changed only the tty >> ... > > Seems like > >> This was next broken in 1997 then fixed in 1998. Importing Lite2 made >> ... > > A fantastic > >> This was next broken in 2008 by replacing everything in tty.c and not >> ... > > Regression test candidate :) > >> It is now possible to fix this better using the new FREVOKE flag. Regression tests for devices are difficult to write and more difficult to run. Simpler for ttys than for networking or disks, but you still need at least 2 generic tty ports just to test things that are not very related to hardware. Bugs in flushing and draining are sometimes obvious by observing if echo 123 >/dev/ttyXx works when it should fail or fails when it should work. For more arcane bugs, I use the old NIST POSIX test suite. This is badly written and hard to use and not very complete, but it finds about 30 regressions between FreeBSD-5 and FreeBSD-9. 30 over-counts for error cascades but undercounts for blocking and some other timing bugs, and of course strict POSIX tests don't get near FreeBSD features like revoke() or bidrectional devices. Bruce From owner-svn-src-head@freebsd.org Tue Jan 26 12:28:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B0AA46D7E; Tue, 26 Jan 2016 12:28:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE181E5D; Tue, 26 Jan 2016 12:28:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCSrbv009142; Tue, 26 Jan 2016 12:28:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCSrbq009141; Tue, 26 Jan 2016 12:28:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261228.u0QCSrbq009141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294794 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:28:54 -0000 Author: mav Date: Tue Jan 26 12:28:53 2016 New Revision: 294794 URL: https://svnweb.freebsd.org/changeset/base/294794 Log: MFV r294793: 6367 spa_config_tryenter incorrectly handles the multiple-lock case Reviewed by: Alek Pinchuk Reviewed by: Josef 'Jeff' Sipek Reviewed by: Prashanth Sreenivasa Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Reviewed by: Steven Hartland Approved by: Matthew Ahrens illumos/illumos-gate@e495b6e6735b803e422025a630352ef9bba788c5 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Jan 26 12:26:32 2016 (r294793) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Jan 26 12:28:53 2016 (r294794) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -449,14 +449,16 @@ spa_config_tryenter(spa_t *spa, int lock if (rw == RW_READER) { if (scl->scl_writer || scl->scl_write_wanted) { mutex_exit(&scl->scl_lock); - spa_config_exit(spa, locks ^ (1 << i), tag); + spa_config_exit(spa, locks & ((1 << i) - 1), + tag); return (0); } } else { ASSERT(scl->scl_writer != curthread); if (!refcount_is_zero(&scl->scl_count)) { mutex_exit(&scl->scl_lock); - spa_config_exit(spa, locks ^ (1 << i), tag); + spa_config_exit(spa, locks & ((1 << i) - 1), + tag); return (0); } scl->scl_writer = curthread; From owner-svn-src-head@freebsd.org Tue Jan 26 12:30:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F36A4A46E55; Tue, 26 Jan 2016 12:30:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B07FD1FE2; Tue, 26 Jan 2016 12:30:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCUHL4009245; Tue, 26 Jan 2016 12:30:17 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCUH5D009243; Tue, 26 Jan 2016 12:30:17 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601261230.u0QCUH5D009243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 26 Jan 2016 12:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294795 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:30:19 -0000 Author: smh Date: Tue Jan 26 12:30:17 2016 New Revision: 294795 URL: https://svnweb.freebsd.org/changeset/base/294795 Log: ixgbe sysctl hardware defaults Added hw.ix.flow_control which enables the default flow_control of all ix interfaces to be set in loader.conf. Added hw.ix.advertise_speed which enables the default advertised_speed of all ix interfaces to be set in loader.conf. Made enable_aim device independent based on hw.ix.enable_aim default. Reviewed by: erj MFC after: 1 week Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D5060 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Tue Jan 26 12:28:53 2016 (r294794) +++ head/sys/dev/ixgbe/if_ix.c Tue Jan 26 12:30:17 2016 (r294795) @@ -166,12 +166,14 @@ static void ixgbe_unregister_vlan(void * static void ixgbe_add_device_sysctls(struct adapter *); static void ixgbe_add_hw_stats(struct adapter *); +static int ixgbe_set_flowcntl(struct adapter *, int); +static int ixgbe_set_advertise(struct adapter *, int); /* Sysctl handlers */ static void ixgbe_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); -static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); -static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); @@ -290,6 +292,16 @@ SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_ "Maximum number of sent packets to process at a time," "-1 means unlimited"); +/* Flow control setting, default to full */ +static int ixgbe_flow_control = ixgbe_fc_full; +SYSCTL_INT(_hw_ix, OID_AUTO, flow_control, CTLFLAG_RDTUN, + &ixgbe_flow_control, 0, "Default flow control used for all adapters"); + +/* Advertise Speed, default to 0 (auto) */ +static int ixgbe_advertise_speed = 0; +SYSCTL_INT(_hw_ix, OID_AUTO, advertise_speed, CTLFLAG_RDTUN, + &ixgbe_advertise_speed, 0, "Default advertised speed for all adapters"); + /* ** Smart speed setting, default to on ** this only works as a compile option @@ -568,6 +580,11 @@ ixgbe_attach(device_t dev) break; } + /* hw.ix defaults init */ + ixgbe_set_advertise(adapter, ixgbe_advertise_speed); + ixgbe_set_flowcntl(adapter, ixgbe_flow_control); + adapter->enable_aim = ixgbe_enable_aim; + if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -1553,7 +1570,7 @@ ixgbe_msix_que(void *arg) /* Do AIM now? */ - if (ixgbe_enable_aim == FALSE) + if (adapter->enable_aim == FALSE) goto no_calc; /* ** Do Adaptive Interrupt Moderation: @@ -4276,7 +4293,7 @@ ixgbe_add_device_sysctls(struct adapter /* Sysctls for all devices */ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, - ixgbe_set_flowcntl, "I", IXGBE_SYSCTL_DESC_SET_FC); + ixgbe_sysctl_flowcntl, "I", IXGBE_SYSCTL_DESC_SET_FC); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "enable_aim", CTLFLAG_RW, @@ -4284,7 +4301,7 @@ ixgbe_add_device_sysctls(struct adapter SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, - ixgbe_set_advertise, "I", IXGBE_SYSCTL_DESC_ADV_SPEED); + ixgbe_sysctl_advertise, "I", IXGBE_SYSCTL_DESC_ADV_SPEED); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "thermal_test", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, @@ -4649,41 +4666,51 @@ ixgbe_set_sysctl_value(struct adapter *a ** 3 - full */ static int -ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) +ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS) { - int error, last; - struct adapter *adapter = (struct adapter *) arg1; + int error, fc; + struct adapter *adapter; + + adapter = (struct adapter *) arg1; + fc = adapter->fc; - last = adapter->fc; - error = sysctl_handle_int(oidp, &adapter->fc, 0, req); + error = sysctl_handle_int(oidp, &fc, 0, req); if ((error) || (req->newptr == NULL)) return (error); /* Don't bother if it's not changed */ - if (adapter->fc == last) + if (adapter->fc == fc) return (0); - switch (adapter->fc) { - case ixgbe_fc_rx_pause: - case ixgbe_fc_tx_pause: - case ixgbe_fc_full: - adapter->hw.fc.requested_mode = adapter->fc; - if (adapter->num_queues > 1) - ixgbe_disable_rx_drop(adapter); - break; - case ixgbe_fc_none: - adapter->hw.fc.requested_mode = ixgbe_fc_none; - if (adapter->num_queues > 1) - ixgbe_enable_rx_drop(adapter); - break; - default: - adapter->fc = last; - return (EINVAL); + return ixgbe_set_flowcntl(adapter, fc); +} + + +static int +ixgbe_set_flowcntl(struct adapter *adapter, int fc) +{ + + switch (fc) { + case ixgbe_fc_rx_pause: + case ixgbe_fc_tx_pause: + case ixgbe_fc_full: + adapter->hw.fc.requested_mode = adapter->fc; + if (adapter->num_queues > 1) + ixgbe_disable_rx_drop(adapter); + break; + case ixgbe_fc_none: + adapter->hw.fc.requested_mode = ixgbe_fc_none; + if (adapter->num_queues > 1) + ixgbe_enable_rx_drop(adapter); + break; + default: + return (EINVAL); } + adapter->fc = fc; /* Don't autoneg if forcing a value */ adapter->hw.fc.disable_fc_autoneg = TRUE; ixgbe_fc_enable(&adapter->hw); - return error; + return (0); } /* @@ -4694,31 +4721,39 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) ** 0x4 - advertise 10G */ static int -ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) +ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS) { - int error = 0, requested; - struct adapter *adapter; - device_t dev; - struct ixgbe_hw *hw; - ixgbe_link_speed speed = 0; + int error, advertise; + struct adapter *adapter; adapter = (struct adapter *) arg1; - dev = adapter->dev; - hw = &adapter->hw; + advertise = adapter->advertise; - requested = adapter->advertise; - error = sysctl_handle_int(oidp, &requested, 0, req); + error = sysctl_handle_int(oidp, &advertise, 0, req); if ((error) || (req->newptr == NULL)) return (error); + /* Checks to validate new value */ + if (adapter->advertise == advertise) /* no change */ + return (0); + + return ixgbe_set_advertise(adapter, advertise); +} + +static int +ixgbe_set_advertise(struct adapter *adapter, int advertise) +{ + device_t dev; + struct ixgbe_hw *hw; + ixgbe_link_speed speed; + + hw = &adapter->hw; + dev = adapter->dev; + /* No speed changes for backplane media */ if (hw->phy.media_type == ixgbe_media_type_backplane) return (ENODEV); - /* Checks to validate new value */ - if (adapter->advertise == requested) /* no change */ - return (0); - if (!((hw->phy.media_type == ixgbe_media_type_copper) || (hw->phy.multispeed_fiber))) { device_printf(dev, @@ -4727,13 +4762,13 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) return (EINVAL); } - if (requested < 0x1 || requested > 0x7) { + if (advertise < 0x1 || advertise > 0x7) { device_printf(dev, "Invalid advertised speed; valid modes are 0x1 through 0x7\n"); return (EINVAL); } - if ((requested & 0x1) + if ((advertise & 0x1) && (hw->mac.type != ixgbe_mac_X540) && (hw->mac.type != ixgbe_mac_X550)) { device_printf(dev, "Set Advertise: 100Mb on X540/X550 only\n"); @@ -4741,18 +4776,19 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) } /* Set new value and report new advertised mode */ - if (requested & 0x1) + speed = 0; + if (advertise & 0x1) speed |= IXGBE_LINK_SPEED_100_FULL; - if (requested & 0x2) + if (advertise & 0x2) speed |= IXGBE_LINK_SPEED_1GB_FULL; - if (requested & 0x4) + if (advertise & 0x4) speed |= IXGBE_LINK_SPEED_10GB_FULL; + adapter->advertise = advertise; hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); - adapter->advertise = requested; - return (error); + return (0); } /* Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Tue Jan 26 12:28:53 2016 (r294794) +++ head/sys/dev/ixgbe/ixgbe.h Tue Jan 26 12:30:17 2016 (r294795) @@ -497,6 +497,7 @@ struct adapter { u32 optics; u32 fc; /* local flow ctrl setting */ int advertise; /* link speeds */ + bool enable_aim; /* adaptive interrupt moderation */ bool link_active; u16 max_frame_size; u16 num_segs; From owner-svn-src-head@freebsd.org Tue Jan 26 12:34:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E236A6E078; Tue, 26 Jan 2016 12:34:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E358F7E7; Tue, 26 Jan 2016 12:33:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCXwHj011912; Tue, 26 Jan 2016 12:33:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCXwdw011911; Tue, 26 Jan 2016 12:33:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261233.u0QCXwdw011911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294797 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:34:00 -0000 Author: mav Date: Tue Jan 26 12:33:58 2016 New Revision: 294797 URL: https://svnweb.freebsd.org/changeset/base/294797 Log: MFV r294796: 6319 assertion failed in zio_ddt_write: bp->blk_birth == txg Reviewed by: George Wilson Approved by: Dan McDonald illumos/illumos-gate@b39b744be78c6327db43c1f69d11c2f5909f73cb This is revert of 5693. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Jan 26 12:32:46 2016 (r294796) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Jan 26 12:33:58 2016 (r294797) @@ -1217,6 +1217,8 @@ zio_write_bp_init(zio_t *zio) zio->io_pipeline |= ZIO_STAGE_DDT_WRITE; return (ZIO_PIPELINE_CONTINUE); } + zio->io_bp_override = NULL; + BP_ZERO(bp); } if (!BP_IS_HOLE(bp) && bp->blk_birth == zio->io_txg) { From owner-svn-src-head@freebsd.org Tue Jan 26 12:37:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D35EA6E1DA; Tue, 26 Jan 2016 12:37:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E0B3B2E; Tue, 26 Jan 2016 12:37:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCbNPp012130; Tue, 26 Jan 2016 12:37:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCbN1Y012129; Tue, 26 Jan 2016 12:37:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261237.u0QCbN1Y012129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294799 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:37:24 -0000 Author: mav Date: Tue Jan 26 12:37:23 2016 New Revision: 294799 URL: https://svnweb.freebsd.org/changeset/base/294799 Log: MFV r294798: 6292 exporting a pool while an async destroy is running can leave entries in the deferred tree Reviewed by: Paul Dagnelie Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Reviewed by: Fabian Keil Approved by: Gordon Ross illumos/illumos-gate@a443cc80c742af740aa82130db840f02b4389365 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Jan 26 12:36:30 2016 (r294798) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Jan 26 12:37:23 2016 (r294799) @@ -1441,10 +1441,23 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * } /* + * Only process scans in sync pass 1. + */ + if (spa_sync_pass(dp->dp_spa) > 1) + return; + + /* + * If the spa is shutting down, then stop scanning. This will + * ensure that the scan does not dirty any new data during the + * shutdown phase. + */ + if (spa_shutting_down(spa)) + return; + + /* * If the scan is inactive due to a stalled async destroy, try again. */ - if ((!scn->scn_async_stalled && !dsl_scan_active(scn)) || - spa_sync_pass(dp->dp_spa) > 1) + if (!scn->scn_async_stalled && !dsl_scan_active(scn)) return; scn->scn_visited_this_txg = 0; From owner-svn-src-head@freebsd.org Tue Jan 26 12:44:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7035FA6E4C5; Tue, 26 Jan 2016 12:44:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 421C01AF; Tue, 26 Jan 2016 12:44:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCinnH015033; Tue, 26 Jan 2016 12:44:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCincR015032; Tue, 26 Jan 2016 12:44:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261244.u0QCincR015032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294801 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:44:50 -0000 Author: mav Date: Tue Jan 26 12:44:49 2016 New Revision: 294801 URL: https://svnweb.freebsd.org/changeset/base/294801 Log: MFV r294800: 6385 Fix unlocking order in zfs_zget Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Andriy Gapon Approved by: Robert Mustacchi Author: Richard Yao illumos/illumos-gate@eaef6a96de3f6afbbccc69bd7a0aed4463689d0a Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Jan 26 12:39:07 2016 (r294800) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Jan 26 12:44:49 2016 (r294801) @@ -1175,13 +1175,13 @@ again: *zpp = zp; err = 0; } - sa_buf_rele(db, NULL); /* Don't let the vnode disappear after ZFS_OBJ_HOLD_EXIT. */ if (err == 0) VN_HOLD(vp); mutex_exit(&zp->z_lock); + sa_buf_rele(db, NULL); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); if (err == 0) { From owner-svn-src-head@freebsd.org Tue Jan 26 12:48:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED5BDA6E5EC; Tue, 26 Jan 2016 12:48:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA464777; Tue, 26 Jan 2016 12:48:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCmAHP015245; Tue, 26 Jan 2016 12:48:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCmAI1015244; Tue, 26 Jan 2016 12:48:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261248.u0QCmAI1015244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294803 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:48:12 -0000 Author: mav Date: Tue Jan 26 12:48:10 2016 New Revision: 294803 URL: https://svnweb.freebsd.org/changeset/base/294803 Log: MFV r294802: 6334 Cannot unlink files when over quota Reviewed by: Matthew Ahrens Reviewed by: Toomas Soome Approved by: Dan McDonald Author: Simon Klinkert illumos/illumos-gate@6575bca01367958c7237253d88e5fa9ef0b1650a Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jan 26 12:47:33 2016 (r294802) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jan 26 12:48:10 2016 (r294803) @@ -2009,12 +2009,9 @@ top: dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); /* - * Mark this transaction as typically resulting in a net free of - * space, unless object removal will be delayed indefinitely - * (due to active holds on the vnode due to the file being open). + * Mark this transaction as typically resulting in a net free of space */ - if (may_delete_now) - dmu_tx_mark_netfree(tx); + dmu_tx_mark_netfree(tx); error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT); if (error) { From owner-svn-src-head@freebsd.org Tue Jan 26 12:50:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C536A6E6DB; Tue, 26 Jan 2016 12:50:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B411A41; Tue, 26 Jan 2016 12:50:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCoEio015423; Tue, 26 Jan 2016 12:50:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCoEqw015422; Tue, 26 Jan 2016 12:50:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261250.u0QCoEqw015422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294805 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:50:15 -0000 Author: mav Date: Tue Jan 26 12:50:14 2016 New Revision: 294805 URL: https://svnweb.freebsd.org/changeset/base/294805 Log: MFV r294804: 6386 Fix function call with uninitialized value in vdev_inuse Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Robert Mustacchi Author: Richard Yao illumos/illumos-gate@5bdd995ddb777f538bfbcc5e2d5ff1bed07ae56e Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Tue Jan 26 12:49:31 2016 (r294804) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Tue Jan 26 12:50:14 2016 (r294805) @@ -602,7 +602,8 @@ vdev_inuse(vdev_t *vd, uint64_t crtxg, v * read-only. Instead we look to see if the pools is marked * read-only in the namespace and set the state to active. */ - if ((spa = spa_by_guid(pool_guid, device_guid)) != NULL && + if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE && + (spa = spa_by_guid(pool_guid, device_guid)) != NULL && spa_mode(spa) == FREAD) state = POOL_STATE_ACTIVE; From owner-svn-src-head@freebsd.org Tue Jan 26 12:52:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3014BA6E932; Tue, 26 Jan 2016 12:52:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 010CAF17; Tue, 26 Jan 2016 12:52:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCqHY1017549; Tue, 26 Jan 2016 12:52:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCqH6m017548; Tue, 26 Jan 2016 12:52:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261252.u0QCqH6m017548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294807 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:52:18 -0000 Author: mav Date: Tue Jan 26 12:52:16 2016 New Revision: 294807 URL: https://svnweb.freebsd.org/changeset/base/294807 Log: MFV r294806: 6388 Failure of userland copy should return EFAULT Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Robert Mustacchi Author: Richard Yao illumos/illumos-gate@c71c00bbe8a9cdc7e3f4048b751f48e80441d506 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jan 26 12:51:41 2016 (r294806) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jan 26 12:52:16 2016 (r294807) @@ -1339,7 +1339,7 @@ get_nvlist(uint64_t nvl, uint64_t size, if ((error = ddi_copyin((void *)(uintptr_t)nvl, packed, size, iflag)) != 0) { kmem_free(packed, size); - return (error); + return (SET_ERROR(EFAULT)); } if ((error = nvlist_unpack(packed, size, &list, 0)) != 0) { From owner-svn-src-head@freebsd.org Tue Jan 26 12:54:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4011AA6EAEC; Tue, 26 Jan 2016 12:54:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C804126D; Tue, 26 Jan 2016 12:54:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCs3Lt018325; Tue, 26 Jan 2016 12:54:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCs3ro018324; Tue, 26 Jan 2016 12:54:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261254.u0QCs3ro018324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294809 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:54:05 -0000 Author: mav Date: Tue Jan 26 12:54:03 2016 New Revision: 294809 URL: https://svnweb.freebsd.org/changeset/base/294809 Log: MFV r294808: 6421 Add missing multilist_destroy calls to arc_fini Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Reviewed by: Jorgen Lundman Approved by: Robert Mustacchi Author: Prakash Surya illumos/illumos-gate@57deb2328260c447bf1db25fe74e0eece102733e Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Jan 26 12:53:23 2016 (r294808) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Jan 26 12:54:03 2016 (r294809) @@ -5567,10 +5567,12 @@ arc_fini(void) multilist_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA]); multilist_destroy(&arc_mfu->arcs_list[ARC_BUFC_METADATA]); multilist_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA]); + multilist_destroy(&arc_l2c_only->arcs_list[ARC_BUFC_METADATA]); multilist_destroy(&arc_mru->arcs_list[ARC_BUFC_DATA]); multilist_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA]); multilist_destroy(&arc_mfu->arcs_list[ARC_BUFC_DATA]); multilist_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]); + multilist_destroy(&arc_l2c_only->arcs_list[ARC_BUFC_DATA]); buf_fini(); From owner-svn-src-head@freebsd.org Tue Jan 26 12:59:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B48DA6ECD6; Tue, 26 Jan 2016 12:59:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31EAB1614; Tue, 26 Jan 2016 12:59:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCwxsE018606; Tue, 26 Jan 2016 12:58:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCwwII018603; Tue, 26 Jan 2016 12:58:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261258.u0QCwwII018603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294811 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:59:00 -0000 Author: mav Date: Tue Jan 26 12:58:58 2016 New Revision: 294811 URL: https://svnweb.freebsd.org/changeset/base/294811 Log: MFV r294810: 6414 vdev_config_sync could be simpler Reviewed by: George Wilson Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Will Andrews illumos/illumos-gate@eb5bb58421f46cee79155a55688e6c675e7dd361 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 26 12:55:43 2016 (r294810) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 26 12:58:58 2016 (r294811) @@ -6768,16 +6768,10 @@ spa_sync(spa_t *spa, uint64_t txg) if (svdcount == SPA_DVAS_PER_BP) break; } - error = vdev_config_sync(svd, svdcount, txg, B_FALSE); - if (error != 0) - error = vdev_config_sync(svd, svdcount, txg, - B_TRUE); + error = vdev_config_sync(svd, svdcount, txg); } else { error = vdev_config_sync(rvd->vdev_child, - rvd->vdev_children, txg, B_FALSE); - if (error != 0) - error = vdev_config_sync(rvd->vdev_child, - rvd->vdev_children, txg, B_TRUE); + rvd->vdev_children, txg); } if (error == 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Jan 26 12:55:43 2016 (r294810) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Jan 26 12:58:58 2016 (r294811) @@ -127,8 +127,7 @@ extern void vdev_queue_register_lastoffs extern void vdev_config_dirty(vdev_t *vd); extern void vdev_config_clean(vdev_t *vd); -extern int vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, - boolean_t); +extern int vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg); extern void vdev_state_dirty(vdev_t *vd); extern void vdev_state_clean(vdev_t *vd); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Tue Jan 26 12:55:43 2016 (r294810) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Tue Jan 26 12:58:58 2016 (r294811) @@ -1194,15 +1194,16 @@ vdev_label_sync_list(spa_t *spa, int l, * at any time, you can just call it again, and it will resume its work. */ int -vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, boolean_t tryhard) +vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg) { spa_t *spa = svd[0]->vdev_spa; uberblock_t *ub = &spa->spa_uberblock; vdev_t *vd; zio_t *zio; - int error; + int error = 0; int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL; +retry: /* * Normally, we don't want to try too hard to write every label and * uberblock. If there is a flaky disk, we don't want the rest of the @@ -1210,8 +1211,11 @@ vdev_config_sync(vdev_t **svd, int svdco * single label out, we should retry with ZIO_FLAG_TRYHARD before * bailing out and declaring the pool faulted. */ - if (tryhard) + if (error != 0) { + if ((flags & ZIO_FLAG_TRYHARD) != 0) + return (error); flags |= ZIO_FLAG_TRYHARD; + } ASSERT(ub->ub_txg <= txg); @@ -1255,7 +1259,7 @@ vdev_config_sync(vdev_t **svd, int svdco * are committed to stable storage before the uberblock update. */ if ((error = vdev_label_sync_list(spa, 0, txg, flags)) != 0) - return (error); + goto retry; /* * Sync the uberblocks to all vdevs in svd[]. @@ -1273,7 +1277,7 @@ vdev_config_sync(vdev_t **svd, int svdco * to the new uberblocks. */ if ((error = vdev_uberblock_sync_list(svd, svdcount, ub, flags)) != 0) - return (error); + goto retry; /* * Sync out odd labels for every dirty vdev. If the system dies @@ -1286,7 +1290,7 @@ vdev_config_sync(vdev_t **svd, int svdco * stable storage before the next transaction group begins. */ if ((error = vdev_label_sync_list(spa, 1, txg, flags)) != 0) - return (error); + goto retry;; trim_thread_wakeup(spa); From owner-svn-src-head@freebsd.org Tue Jan 26 13:03:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D24A6EF23; Tue, 26 Jan 2016 13:03:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 829071C23; Tue, 26 Jan 2016 13:03:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QD31Zl021443; Tue, 26 Jan 2016 13:03:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QD31Bt021442; Tue, 26 Jan 2016 13:03:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261303.u0QD31Bt021442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 13:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294813 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 13:03:02 -0000 Author: mav Date: Tue Jan 26 13:03:01 2016 New Revision: 294813 URL: https://svnweb.freebsd.org/changeset/base/294813 Log: MFV r294812: 6434 sa_find_sizes() may compute wrong SA header size Reviewed-by: Ned Bass Reviewed-by: Brian Behlendorf Reviewed by: Andriy Gapon Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: James Pan illumos/illumos-gate@3502ed6e7cb3f3d2e781960ab8fe465fdc884834 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Tue Jan 26 13:02:16 2016 (r294812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Tue Jan 26 13:03:01 2016 (r294813) @@ -547,10 +547,9 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ { int var_size = 0; int i; - int j = -1; int full_space; int hdrsize; - boolean_t done = B_FALSE; + int extra_hdrsize; if (buftype == SA_BONUS && sa->sa_force_spill) { *total = 0; @@ -561,10 +560,9 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ *index = -1; *total = 0; + *will_spill = B_FALSE; - if (buftype == SA_BONUS) - *will_spill = B_FALSE; - + extra_hdrsize = 0; hdrsize = (SA_BONUSTYPE_FROM_DB(db) == DMU_OT_ZNODE) ? 0 : sizeof (sa_hdr_phys_t); @@ -576,8 +574,8 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ *total = P2ROUNDUP(*total, 8); *total += attr_desc[i].sa_length; - if (done) - goto next; + if (*will_spill) + continue; is_var_sz = (SA_REGISTERED_LEN(sa, attr_desc[i].sa_attr) == 0); if (is_var_sz) { @@ -585,21 +583,28 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ } if (is_var_sz && var_size > 1) { - if (P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) + + /* + * Don't worry that the spill block might overflow. + * It will be resized if needed in sa_build_layouts(). + */ + if (buftype == SA_SPILL || + P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) + *total < full_space) { /* * Account for header space used by array of * optional sizes of variable-length attributes. - * Record the index in case this increase needs - * to be reversed due to spill-over. + * Record the extra header size in case this + * increase needs to be reversed due to + * spill-over. */ hdrsize += sizeof (uint16_t); - j = i; + if (*index != -1) + extra_hdrsize += sizeof (uint16_t); } else { - done = B_TRUE; - *index = i; - if (buftype == SA_BONUS) - *will_spill = B_TRUE; + ASSERT(buftype == SA_BONUS); + if (*index == -1) + *index = i; + *will_spill = B_TRUE; continue; } } @@ -614,22 +619,15 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ (*total + P2ROUNDUP(hdrsize, 8)) > (full_space - sizeof (blkptr_t))) { *index = i; - done = B_TRUE; } -next: if ((*total + P2ROUNDUP(hdrsize, 8)) > full_space && buftype == SA_BONUS) *will_spill = B_TRUE; } - /* - * j holds the index of the last variable-sized attribute for - * which hdrsize was increased. Reverse the increase if that - * attribute will be relocated to the spill block. - */ - if (*will_spill && j == *index) - hdrsize -= sizeof (uint16_t); + if (*will_spill) + hdrsize -= extra_hdrsize; hdrsize = P2ROUNDUP(hdrsize, 8); return (hdrsize); From owner-svn-src-head@freebsd.org Tue Jan 26 13:14:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20E1AA46324; Tue, 26 Jan 2016 13:14:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFB5F29C; Tue, 26 Jan 2016 13:14:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QDEdm7024397; Tue, 26 Jan 2016 13:14:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QDEdNT024393; Tue, 26 Jan 2016 13:14:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261314.u0QDEdNT024393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 13:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294815 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 13:14:41 -0000 Author: mav Date: Tue Jan 26 13:14:39 2016 New Revision: 294815 URL: https://svnweb.freebsd.org/changeset/base/294815 Log: MFV r294814: 6393 zfs receive a full send as a clone Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Richard Elling Approved by: Dan McDonald Author: Paul Dagnelie illumos/illumos-gate@68ecb2ec930c4b0f00acaf8e0abb2b19c4b8b76f This allows to do a full (non-incremental send) and receive it as a clone of an existing dataset. It can leverage nopwrite to share blocks with the origin. This can be used to change the relationship of datasets on the target. For example, maybe on the source you have: A ---- B ---- C And you have sent to the target a full of B, and the incremental B->C: B ---- C You later realize that you want to have A on the target. You will have to do a full send of A, but nopwrite can save you space on the target if you receive it as a clone of B, assuming that A and B have some blocks inxi common: B ---- C \ A Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jan 26 13:09:16 2016 (r294814) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jan 26 13:14:39 2016 (r294815) @@ -2841,8 +2841,11 @@ Do not actually receive the stream. This option to verify the name the receive operation would use. .It Fl o Sy origin Ns = Ns Ar snapshot Forces the stream to be received as a clone of the given snapshot. -This is only valid if the stream is an incremental stream whose source -is the same as the provided origin. +If the stream is a full send stream, this will create the filesystem +described by the stream as a clone of the specified snapshot. Which +snapshot was specified will not affect the success or failure of the +receive, as long as the snapshot does exist. If the stream is an +incremental send stream, all the normal verification will be performed. .It Fl F Force a rollback of the file system to the most recent snapshot before performing the receive operation. If receiving an incremental replication Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Jan 26 13:09:16 2016 (r294814) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Jan 26 13:14:39 2016 (r294815) @@ -158,6 +158,14 @@ dump_record(dmu_sendarg_t *dsp, void *pa return (0); } +/* + * Fill in the drr_free struct, or perform aggregation if the previous record is + * also a free record, and the two are adjacent. + * + * Note that we send free records even for a full send, because we want to be + * able to receive a full send as a clone, which requires a list of all the free + * and freeobject records that were generated on the source. + */ static int dump_free(dmu_sendarg_t *dsp, uint64_t object, uint64_t offset, uint64_t length) @@ -181,15 +189,6 @@ dump_free(dmu_sendarg_t *dsp, uint64_t o (object == dsp->dsa_last_data_object && offset > dsp->dsa_last_data_offset)); - /* - * If we are doing a non-incremental send, then there can't - * be any data in the dataset we're receiving into. Therefore - * a free record would simply be a no-op. Save space by not - * sending it to begin with. - */ - if (!dsp->dsa_incremental) - return (0); - if (length != -1ULL && offset + length < offset) length = -1ULL; @@ -368,10 +367,6 @@ dump_freeobjects(dmu_sendarg_t *dsp, uin { struct drr_freeobjects *drrfo = &(dsp->dsa_drr->drr_u.drr_freeobjects); - /* See comment in dump_free(). */ - if (!dsp->dsa_incremental) - return (0); - /* * If there is a pending op, but it's not PENDING_FREEOBJECTS, * push it out, since free block aggregation can only be done for @@ -776,6 +771,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(to_ds)->ds_guid; if (dsl_dataset_phys(to_ds)->ds_flags & DS_FLAG_CI_DATASET) drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA; + drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS; if (ancestor_zb != NULL) { drr->drr_u.drr_begin.drr_fromguid = @@ -799,7 +795,6 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsp->dsa_off = off; dsp->dsa_toguid = dsl_dataset_phys(to_ds)->ds_guid; dsp->dsa_pending_op = PENDING_NONE; - dsp->dsa_incremental = (ancestor_zb != NULL); dsp->dsa_featureflags = featureflags; dsp->dsa_resume_object = resumeobj; dsp->dsa_resume_offset = resumeoff; @@ -1321,7 +1316,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t /* target fs already exists; recv into temp clone */ /* Can't recv a clone into an existing fs */ - if (flags & DRR_FLAG_CLONE) { + if (flags & DRR_FLAG_CLONE || drba->drba_origin) { dsl_dataset_rele(ds, FTAG); return (SET_ERROR(EINVAL)); } @@ -1340,6 +1335,15 @@ dmu_recv_begin_check(void *arg, dmu_tx_t drba->drba_origin)) return (SET_ERROR(ENOENT)); + /* + * If we're receiving a full send as a clone, and it doesn't + * contain all the necessary free records and freeobject + * records, reject it. + */ + if (fromguid == 0 && drba->drba_origin && + !(flags & DRR_FLAG_FREERECORDS)) + return (SET_ERROR(EINVAL)); + /* Open the parent of tofs */ ASSERT3U(strlen(tofs), <, MAXNAMELEN); (void) strlcpy(buf, tofs, strrchr(tofs, '/') - tofs + 1); @@ -1379,7 +1383,8 @@ dmu_recv_begin_check(void *arg, dmu_tx_t dsl_dataset_rele(ds, FTAG); return (SET_ERROR(EINVAL)); } - if (dsl_dataset_phys(origin)->ds_guid != fromguid) { + if (dsl_dataset_phys(origin)->ds_guid != fromguid && + fromguid != 0) { dsl_dataset_rele(origin, FTAG); dsl_dataset_rele(ds, FTAG); return (SET_ERROR(ENODEV)); @@ -1709,6 +1714,20 @@ struct receive_writer_arg { uint64_t bytes_read; /* bytes read when current record created */ }; +struct objlist { + list_t list; /* List of struct receive_objnode. */ + /* + * Last object looked up. Used to assert that objects are being looked + * up in ascending order. + */ + uint64_t last_lookup; +}; + +struct receive_objnode { + list_node_t node; + uint64_t object; +}; + struct receive_arg { objset_t *os; kthread_t *td; @@ -1727,12 +1746,7 @@ struct receive_arg { int err; boolean_t byteswap; /* Sorted list of objects not to issue prefetches for. */ - list_t ignore_obj_list; -}; - -struct receive_ign_obj_node { - list_node_t node; - uint64_t object; + struct objlist ignore_objlist; }; typedef struct guid_map_entry { @@ -2068,13 +2082,14 @@ receive_freeobjects(struct receive_write struct drr_freeobjects *drrfo) { uint64_t obj; + int next_err = 0; if (drrfo->drr_firstobj + drrfo->drr_numobjs < drrfo->drr_firstobj) return (SET_ERROR(EINVAL)); for (obj = drrfo->drr_firstobj; - obj < drrfo->drr_firstobj + drrfo->drr_numobjs; - (void) dmu_object_next(rwa->os, &obj, FALSE, 0)) { + obj < drrfo->drr_firstobj + drrfo->drr_numobjs && next_err == 0; + next_err = dmu_object_next(rwa->os, &obj, FALSE, 0)) { int err; if (dmu_object_info(rwa->os, obj, NULL) != 0) @@ -2084,7 +2099,8 @@ receive_freeobjects(struct receive_write if (err != 0) return (err); } - + if (next_err != ESRCH) + return (next_err); return (0); } @@ -2414,6 +2430,66 @@ receive_read_payload_and_next_header(str return (0); } +static void +objlist_create(struct objlist *list) +{ + list_create(&list->list, sizeof (struct receive_objnode), + offsetof(struct receive_objnode, node)); + list->last_lookup = 0; +} + +static void +objlist_destroy(struct objlist *list) +{ + for (struct receive_objnode *n = list_remove_head(&list->list); + n != NULL; n = list_remove_head(&list->list)) { + kmem_free(n, sizeof (*n)); + } + list_destroy(&list->list); +} + +/* + * This function looks through the objlist to see if the specified object number + * is contained in the objlist. In the process, it will remove all object + * numbers in the list that are smaller than the specified object number. Thus, + * any lookup of an object number smaller than a previously looked up object + * number will always return false; therefore, all lookups should be done in + * ascending order. + */ +static boolean_t +objlist_exists(struct objlist *list, uint64_t object) +{ + struct receive_objnode *node = list_head(&list->list); + ASSERT3U(object, >=, list->last_lookup); + list->last_lookup = object; + while (node != NULL && node->object < object) { + VERIFY3P(node, ==, list_remove_head(&list->list)); + kmem_free(node, sizeof (*node)); + node = list_head(&list->list); + } + return (node != NULL && node->object == object); +} + +/* + * The objlist is a list of object numbers stored in ascending order. However, + * the insertion of new object numbers does not seek out the correct location to + * store a new object number; instead, it appends it to the list for simplicity. + * Thus, any users must take care to only insert new object numbers in ascending + * order. + */ +static void +objlist_insert(struct objlist *list, uint64_t object) +{ + struct receive_objnode *node = kmem_zalloc(sizeof (*node), KM_SLEEP); + node->object = object; +#ifdef ZFS_DEBUG + struct receive_objnode *last_object = list_tail(&list->list); + uint64_t last_objnum = (last_object != NULL ? last_object->object : 0); + ASSERT3U(node->object, >, last_objnum); +#endif + list_insert_tail(&list->list, node); +} + /* * Issue the prefetch reads for any necessary indirect blocks. * @@ -2436,13 +2512,7 @@ static void receive_read_prefetch(struct receive_arg *ra, uint64_t object, uint64_t offset, uint64_t length) { - struct receive_ign_obj_node *node = list_head(&ra->ignore_obj_list); - while (node != NULL && node->object < object) { - VERIFY3P(node, ==, list_remove_head(&ra->ignore_obj_list)); - kmem_free(node, sizeof (*node)); - node = list_head(&ra->ignore_obj_list); - } - if (node == NULL || node->object > object) { + if (!objlist_exists(&ra->ignore_objlist, object)) { dmu_prefetch(ra->os, object, 1, offset, length, ZIO_PRIORITY_SYNC_READ); } @@ -2475,18 +2545,7 @@ receive_read_record(struct receive_arg * */ if (err == ENOENT || (err == 0 && doi.doi_data_block_size != drro->drr_blksz)) { - struct receive_ign_obj_node *node = - kmem_zalloc(sizeof (*node), - KM_SLEEP); - node->object = drro->drr_object; -#ifdef ZFS_DEBUG - struct receive_ign_obj_node *last_object = - list_tail(&ra->ignore_obj_list); - uint64_t last_objnum = (last_object != NULL ? - last_object->object : 0); - ASSERT3U(node->object, >, last_objnum); -#endif - list_insert_tail(&ra->ignore_obj_list, node); + objlist_insert(&ra->ignore_objlist, drro->drr_object); err = 0; } return (err); @@ -2704,7 +2763,6 @@ resume_check(struct receive_arg *ra, nvl return (0); } - /* * Read in the stream's records, one by one, and apply them to the pool. There * are two threads involved; the thread that calls this function will spin up a @@ -2739,8 +2797,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, sizeof (ra.bytes_read), 1, &ra.bytes_read); } - list_create(&ra.ignore_obj_list, sizeof (struct receive_ign_obj_node), - offsetof(struct receive_ign_obj_node, node)); + objlist_create(&ra.ignore_objlist); /* these were verified in dmu_recv_begin */ ASSERT3U(DMU_GET_STREAM_HDRTYPE(drc->drc_drrb->drr_versioninfo), ==, @@ -2894,12 +2951,7 @@ out: } *voffp = ra.voff; - for (struct receive_ign_obj_node *n = - list_remove_head(&ra.ignore_obj_list); n != NULL; - n = list_remove_head(&ra.ignore_obj_list)) { - kmem_free(n, sizeof (*n)); - } - list_destroy(&ra.ignore_obj_list); + objlist_destroy(&ra.ignore_objlist); return (err); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Tue Jan 26 13:09:16 2016 (r294814) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Tue Jan 26 13:14:39 2016 (r294815) @@ -25,7 +25,7 @@ /* * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_DMU_IMPL_H @@ -296,7 +296,6 @@ typedef struct dmu_sendarg { uint64_t dsa_toguid; int dsa_err; dmu_pendop_t dsa_pending_op; - boolean_t dsa_incremental; uint64_t dsa_featureflags; uint64_t dsa_last_data_object; uint64_t dsa_last_data_offset; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Tue Jan 26 13:09:16 2016 (r294814) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Tue Jan 26 13:14:39 2016 (r294815) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_ZFS_IOCTL_H @@ -126,6 +126,16 @@ typedef enum dmu_send_resume_token_versi #define DRR_FLAG_CLONE (1<<0) #define DRR_FLAG_CI_DATA (1<<1) +/* + * This send stream, if it is a full send, includes the FREE and FREEOBJECT + * records that are created by the sending process. This means that the send + * stream can be received as a clone, even though it is not an incremental. + * This is not implemented as a feature flag, because the receiving side does + * not need to have implemented it to receive this stream; it is fully backwards + * compatible. We need a flag, though, because full send streams without it + * cannot necessarily be received as a clone correctly. + */ +#define DRR_FLAG_FREERECORDS (1<<2) /* * flags in the drr_checksumflags field in the DRR_WRITE and From owner-svn-src-head@freebsd.org Tue Jan 26 13:37:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9283AA46BB5; Tue, 26 Jan 2016 13:37:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 543C2FBE; Tue, 26 Jan 2016 13:37:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QDbUND030283; Tue, 26 Jan 2016 13:37:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QDbUvG030281; Tue, 26 Jan 2016 13:37:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261337.u0QDbUvG030281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 13:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294817 - in head: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 13:37:31 -0000 Author: mav Date: Tue Jan 26 13:37:30 2016 New Revision: 294817 URL: https://svnweb.freebsd.org/changeset/base/294817 Log: MFV r294816: 4986 receiving replication stream fails if any snapshot exceeds refquota Reviewed by: John Kennedy Reviewed by: Matthew Ahrens Approved by: Gordon Ross Author: Dan McDonald illumos/illumos-gate@5878fad70d76d8711f6608c1f80b0447601261c6 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Jan 26 13:20:31 2016 (r294816) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Jan 26 13:37:30 2016 (r294817) @@ -26,6 +26,7 @@ * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. */ #include @@ -67,7 +68,7 @@ extern void zfs_setprop_error(libzfs_han static int zfs_receive_impl(libzfs_handle_t *, const char *, const char *, recvflags_t *, int, const char *, nvlist_t *, avl_tree_t *, char **, int, - uint64_t *); + uint64_t *, const char *); static int guid_to_name(libzfs_handle_t *, const char *, uint64_t, boolean_t, char *); @@ -2602,6 +2603,7 @@ zfs_receive_package(libzfs_handle_t *hdl nvlist_t *stream_nv = NULL; avl_tree_t *stream_avl = NULL; char *fromsnap = NULL; + char *sendsnap = NULL; char *cp; char tofs[ZFS_MAXNAMELEN]; char sendfs[ZFS_MAXNAMELEN]; @@ -2750,8 +2752,16 @@ zfs_receive_package(libzfs_handle_t *hdl */ (void) strlcpy(sendfs, drr->drr_u.drr_begin.drr_toname, ZFS_MAXNAMELEN); - if ((cp = strchr(sendfs, '@')) != NULL) + if ((cp = strchr(sendfs, '@')) != NULL) { *cp = '\0'; + /* + * Find the "sendsnap", the final snapshot in a replication + * stream. zfs_receive_one() handles certain errors + * differently, depending on if the contained stream is the + * last one or not. + */ + sendsnap = (cp + 1); + } /* Finally, receive each contained stream */ do { @@ -2764,7 +2774,7 @@ zfs_receive_package(libzfs_handle_t *hdl */ error = zfs_receive_impl(hdl, destname, NULL, flags, fd, sendfs, stream_nv, stream_avl, top_zfs, cleanup_fd, - action_handlep); + action_handlep, sendsnap); if (error == ENODATA) { error = 0; break; @@ -2930,7 +2940,7 @@ zfs_receive_one(libzfs_handle_t *hdl, in const char *originsnap, recvflags_t *flags, dmu_replay_record_t *drr, dmu_replay_record_t *drr_noswap, const char *sendfs, nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd, - uint64_t *action_handlep) + uint64_t *action_handlep, const char *finalsnap) { zfs_cmd_t zc = { 0 }; time_t begin_time; @@ -2947,6 +2957,7 @@ zfs_receive_one(libzfs_handle_t *hdl, in nvlist_t *snapprops_nvlist = NULL; zprop_errflags_t prop_errflags; boolean_t recursive; + char *snapname = NULL; begin_time = time(NULL); @@ -2957,7 +2968,6 @@ zfs_receive_one(libzfs_handle_t *hdl, in ENOENT); if (stream_avl != NULL) { - char *snapname; nvlist_t *fs = fsavl_find(stream_avl, drrb->drr_toguid, &snapname); nvlist_t *props; @@ -3313,7 +3323,21 @@ zfs_receive_one(libzfs_handle_t *hdl, in ZPROP_N_MORE_ERRORS) == 0) { trunc_prop_errs(intval); break; - } else { + } else if (snapname == NULL || finalsnap == NULL || + strcmp(finalsnap, snapname) == 0 || + strcmp(nvpair_name(prop_err), + zfs_prop_to_name(ZFS_PROP_REFQUOTA)) != 0) { + /* + * Skip the special case of, for example, + * "refquota", errors on intermediate + * snapshots leading up to a final one. + * That's why we have all of the checks above. + * + * See zfs_ioctl.c's extract_delay_props() for + * a list of props which can fail on + * intermediate snapshots, but shouldn't + * affect the overall receive. + */ (void) snprintf(tbuf, sizeof (tbuf), dgettext(TEXT_DOMAIN, "cannot receive %s property on %s"), @@ -3498,7 +3522,7 @@ static int zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, const char *originsnap, recvflags_t *flags, int infd, const char *sendfs, nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd, - uint64_t *action_handlep) + uint64_t *action_handlep, const char *finalsnap) { int err; dmu_replay_record_t drr, drr_noswap; @@ -3594,10 +3618,11 @@ zfs_receive_impl(libzfs_handle_t *hdl, c if ((cp = strchr(nonpackage_sendfs, '@')) != NULL) *cp = '\0'; sendfs = nonpackage_sendfs; + VERIFY(finalsnap == NULL); } return (zfs_receive_one(hdl, infd, tosnap, originsnap, flags, &drr, &drr_noswap, sendfs, stream_nv, stream_avl, top_zfs, - cleanup_fd, action_handlep)); + cleanup_fd, action_handlep, finalsnap)); } else { assert(DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) == DMU_COMPOUNDSTREAM); @@ -3632,7 +3657,7 @@ zfs_receive(libzfs_handle_t *hdl, const VERIFY(cleanup_fd >= 0); err = zfs_receive_impl(hdl, tosnap, originsnap, flags, infd, NULL, NULL, - stream_avl, &top_zfs, cleanup_fd, &action_handle); + stream_avl, &top_zfs, cleanup_fd, &action_handle, NULL); VERIFY(0 == close(cleanup_fd)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jan 26 13:20:31 2016 (r294816) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jan 26 13:37:30 2016 (r294817) @@ -25,6 +25,7 @@ * All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright 2014 Xin Li . All rights reserved. + * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. @@ -4177,6 +4178,56 @@ next: } } +/* + * Extract properties that cannot be set PRIOR to the receipt of a dataset. + * For example, refquota cannot be set until after the receipt of a dataset, + * because in replication streams, an older/earlier snapshot may exceed the + * refquota. We want to receive the older/earlier snapshot, but setting + * refquota pre-receipt will set the dsl's ACTUAL quota, which will prevent + * the older/earlier snapshot from being received (with EDQUOT). + * + * The ZFS test "zfs_receive_011_pos" demonstrates such a scenario. + * + * libzfs will need to be judicious handling errors encountered by props + * extracted by this function. + */ +static nvlist_t * +extract_delay_props(nvlist_t *props) +{ + nvlist_t *delayprops; + nvpair_t *nvp, *tmp; + static const zfs_prop_t delayable[] = { ZFS_PROP_REFQUOTA, 0 }; + int i; + + VERIFY(nvlist_alloc(&delayprops, NV_UNIQUE_NAME, KM_SLEEP) == 0); + + for (nvp = nvlist_next_nvpair(props, NULL); nvp != NULL; + nvp = nvlist_next_nvpair(props, nvp)) { + /* + * strcmp() is safe because zfs_prop_to_name() always returns + * a bounded string. + */ + for (i = 0; delayable[i] != 0; i++) { + if (strcmp(zfs_prop_to_name(delayable[i]), + nvpair_name(nvp)) == 0) { + break; + } + } + if (delayable[i] != 0) { + tmp = nvlist_prev_nvpair(props, nvp); + VERIFY(nvlist_add_nvpair(delayprops, nvp) == 0); + VERIFY(nvlist_remove_nvpair(props, nvp) == 0); + nvp = tmp; + } + } + + if (nvlist_empty(delayprops)) { + nvlist_free(delayprops); + delayprops = NULL; + } + return (delayprops); +} + #ifdef DEBUG static boolean_t zfs_ioc_recv_inject_err; #endif @@ -4213,6 +4264,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) offset_t off; nvlist_t *props = NULL; /* sent properties */ nvlist_t *origprops = NULL; /* existing properties */ + nvlist_t *delayprops = NULL; /* sent properties applied post-receive */ char *origin = NULL; char *tosnap; char tofs[ZFS_MAXNAMELEN]; @@ -4298,21 +4350,12 @@ zfs_ioc_recv(zfs_cmd_t *zc) props_error = dsl_prop_set_hasrecvd(tofs); if (props_error == 0) { + delayprops = extract_delay_props(props); (void) zfs_set_prop_nvlist(tofs, ZPROP_SRC_RECEIVED, props, errors); } } - if (zc->zc_nvlist_dst_size != 0 && - (nvlist_smush(errors, zc->zc_nvlist_dst_size) != 0 || - put_nvlist(zc, errors) != 0)) { - /* - * Caller made zc->zc_nvlist_dst less than the minimum expected - * size or supplied an invalid address. - */ - props_error = SET_ERROR(EINVAL); - } - off = fp->f_offset; error = dmu_recv_stream(&drc, fp, &off, zc->zc_cleanup_fd, &zc->zc_action_handle); @@ -4337,6 +4380,40 @@ zfs_ioc_recv(zfs_cmd_t *zc) } else { error = dmu_recv_end(&drc, NULL); } + + /* Set delayed properties now, after we're done receiving. */ + if (delayprops != NULL && error == 0) { + (void) zfs_set_prop_nvlist(tofs, ZPROP_SRC_RECEIVED, + delayprops, errors); + } + } + + if (delayprops != NULL) { + /* + * Merge delayed props back in with initial props, in case + * we're DEBUG and zfs_ioc_recv_inject_err is set (which means + * we have to make sure clear_received_props() includes + * the delayed properties). + * + * Since zfs_ioc_recv_inject_err is only in DEBUG kernels, + * using ASSERT() will be just like a VERIFY. + */ + ASSERT(nvlist_merge(props, delayprops, 0) == 0); + nvlist_free(delayprops); + } + + /* + * Now that all props, initial and delayed, are set, report the prop + * errors to the caller. + */ + if (zc->zc_nvlist_dst_size != 0 && + (nvlist_smush(errors, zc->zc_nvlist_dst_size) != 0 || + put_nvlist(zc, errors) != 0)) { + /* + * Caller made zc->zc_nvlist_dst less than the minimum expected + * size or supplied an invalid address. + */ + props_error = SET_ERROR(EINVAL); } zc->zc_cookie = off - fp->f_offset; From owner-svn-src-head@freebsd.org Tue Jan 26 13:45:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F04E7A46FF1; Tue, 26 Jan 2016 13:45:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC73B18CB; Tue, 26 Jan 2016 13:45:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QDjf9U033157; Tue, 26 Jan 2016 13:45:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QDjfCk033156; Tue, 26 Jan 2016 13:45:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261345.u0QDjfCk033156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 13:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294820 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 13:45:43 -0000 Author: mav Date: Tue Jan 26 13:45:41 2016 New Revision: 294820 URL: https://svnweb.freebsd.org/changeset/base/294820 Log: MFV r294819: 6495 Fix mutex leak in dmu_objset_find_dp Reviewed by: George Wilson Reviewed by: Matthew Ahrens Approved by: Albert Lee Author: Steven Hartland illumos/illumos-gate@2bad22584defe4667f99737e3158d336e4dcca11 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Jan 26 13:44:47 2016 (r294819) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Jan 26 13:45:41 2016 (r294820) @@ -1789,6 +1789,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 * thread suffices. For now, stay single threaded. */ dmu_objset_find_dp_impl(dcp); + mutex_destroy(&err_lock); return (error); } @@ -1800,6 +1801,8 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 INT_MAX, 0); if (tq == NULL) { kmem_free(dcp, sizeof (*dcp)); + mutex_destroy(&err_lock); + return (SET_ERROR(ENOMEM)); } dcp->dc_tq = tq; From owner-svn-src-head@freebsd.org Tue Jan 26 13:50:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ADD3A6E14C; Tue, 26 Jan 2016 13:50:46 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3D11C8C; Tue, 26 Jan 2016 13:50:45 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QDojbW033420; Tue, 26 Jan 2016 13:50:45 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QDojWM033418; Tue, 26 Jan 2016 13:50:45 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601261350.u0QDojWM033418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 26 Jan 2016 13:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294822 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 13:50:46 -0000 Author: skra Date: Tue Jan 26 13:50:44 2016 New Revision: 294822 URL: https://svnweb.freebsd.org/changeset/base/294822 Log: Make pmap_fault() return values vm subsystem compliant to simplify their handling in abort_handler(). While here, remove one extra initialization of pcb variable. Modified: head/sys/arm/arm/pmap-v6-new.c head/sys/arm/arm/trap-v6.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Jan 26 13:49:46 2016 (r294821) +++ head/sys/arm/arm/pmap-v6-new.c Tue Jan 26 13:50:44 2016 (r294822) @@ -6151,7 +6151,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, __func__, pmap, pmap->pm_pt1, far); panic("%s: pm_pt1 abort", __func__); } - return (EFAULT); + return (KERN_INVALID_ADDRESS); } if (__predict_false(IN_RANGE2(far, PT2MAP, PT2MAP_SIZE))) { /* @@ -6167,7 +6167,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, __func__, pmap, PT2MAP, far); panic("%s: PT2MAP abort", __func__); } - return (EFAULT); + return (KERN_INVALID_ADDRESS); } /* @@ -6187,7 +6187,7 @@ pte2_seta: if (!pte2_cmpset(pte2p, pte2, pte2 | PTE2_A)) { goto pte2_seta; } - return (0); + return (KERN_SUCCESS); } } if (idx == FAULT_ACCESS_L1) { @@ -6198,7 +6198,7 @@ pte1_seta: if (!pte1_cmpset(pte1p, pte1, pte1 | PTE1_A)) { goto pte1_seta; } - return (0); + return (KERN_SUCCESS); } } @@ -6222,7 +6222,7 @@ pte2_setrw: goto pte2_setrw; } tlb_flush(trunc_page(far)); - return (0); + return (KERN_SUCCESS); } } if ((fsr & FSR_WNR) && (idx == FAULT_PERM_L1)) { @@ -6235,7 +6235,7 @@ pte1_setrw: goto pte1_setrw; } tlb_flush(pte1_trunc(far)); - return (0); + return (KERN_SUCCESS); } } @@ -6274,7 +6274,7 @@ pte1_setrw: } } #endif - return (EAGAIN); + return (KERN_FAILURE); } /* !!!! REMOVE !!!! */ Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Tue Jan 26 13:49:46 2016 (r294821) +++ head/sys/arm/arm/trap-v6.c Tue Jan 26 13:50:44 2016 (r294822) @@ -336,14 +336,10 @@ abort_handler(struct trapframe *tf, int #ifdef ARM_NEW_PMAP rv = pmap_fault(PCPU_GET(curpmap), far, fsr, idx, usermode); - if (rv == 0) { + if (rv == KERN_SUCCESS) return; - } else if (rv == EFAULT) { - - call_trapsignal(td, SIGSEGV, SEGV_MAPERR, far); - userret(td, tf); - return; - } + if (rv == KERN_INVALID_ADDRESS) + goto nogo; #endif /* * Now, when we handled imprecise and debug aborts, the rest of @@ -452,7 +448,6 @@ abort_handler(struct trapframe *tf, int */ /* fusubailout is used by [fs]uswintr to avoid page faulting. */ - pcb = td->td_pcb; if (__predict_false(pcb->pcb_onfault == fusubailout)) { tf->tf_r0 = EFAULT; tf->tf_pc = (register_t)pcb->pcb_onfault; From owner-svn-src-head@freebsd.org Tue Jan 26 14:17:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1BDAA6E935; Tue, 26 Jan 2016 14:17:40 +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 mx1.freebsd.org (Postfix) with ESMTPS id B2E8ADB6; Tue, 26 Jan 2016 14:17:40 +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 u0QEHd70042048; Tue, 26 Jan 2016 14:17:39 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEHdBG042047; Tue, 26 Jan 2016 14:17:39 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601261417.u0QEHdBG042047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Jan 2016 14:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294823 - head/secure/lib/libcrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:17:41 -0000 Author: br Date: Tue Jan 26 14:17:39 2016 New Revision: 294823 URL: https://svnweb.freebsd.org/changeset/base/294823 Log: Add the openssl header for RISC-V. Copied from aarch64 as we can't generate it yet. Added: head/secure/lib/libcrypto/opensslconf-riscv.h (contents, props changed) Added: head/secure/lib/libcrypto/opensslconf-riscv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/opensslconf-riscv.h Tue Jan 26 14:17:39 2016 (r294823) @@ -0,0 +1,254 @@ +/* $FreeBSD$ */ +/* opensslconf.h */ +/* RISCVTODO: generate from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_LIBUNBOUND +# define OPENSSL_NO_LIBUNBOUND +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_NO_ASM +# define OPENSSL_NO_ASM +#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) +# define NO_LIBUNBOUND +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) +# define NO_SSL_TRACE +# endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +#endif + +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/lib/engines" +#define OPENSSLDIR "/etc/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned int +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#undef RC4_CHUNK +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned int +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#undef BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#define RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#define DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#define DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ +#ifdef __cplusplus +} +#endif From owner-svn-src-head@freebsd.org Tue Jan 26 14:20:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76EF8A6EA0F; Tue, 26 Jan 2016 14:20: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 mx1.freebsd.org (Postfix) with ESMTPS id 49BCDF8E; Tue, 26 Jan 2016 14:20: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 u0QEKPC0042194; Tue, 26 Jan 2016 14:20:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEKPuw042192; Tue, 26 Jan 2016 14:20:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261420.u0QEKPuw042192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 14:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294824 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:20:26 -0000 Author: hselasky Date: Tue Jan 26 14:20:25 2016 New Revision: 294824 URL: https://svnweb.freebsd.org/changeset/base/294824 Log: Add more LinuxKPI PCI related functions and defines. Removed comments deriving from Linux. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Tue Jan 26 14:17:39 2016 (r294823) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Tue Jan 26 14:20:25 2016 (r294824) @@ -114,14 +114,29 @@ struct pci_device_id { #define PCI_EXP_TYPE_DOWNSTREAM PCIEM_TYPE_DOWNSTREAM_PORT /* Downstream Port */ #define PCI_EXP_FLAGS_SLOT PCIEM_FLAGS_SLOT /* Slot implemented */ #define PCI_EXP_TYPE_RC_EC PCIEM_TYPE_ROOT_EC /* Root Complex Event Collector */ - +#define PCI_EXP_LNKCAP_SLS_2_5GB 0x01 /* Supported Link Speed 2.5GT/s */ +#define PCI_EXP_LNKCAP_SLS_5_0GB 0x02 /* Supported Link Speed 5.0GT/s */ +#define PCI_EXP_LNKCAP_MLW 0x03f0 /* Maximum Link Width */ +#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ +#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ +#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ #define IORESOURCE_MEM SYS_RES_MEMORY #define IORESOURCE_IO SYS_RES_IOPORT #define IORESOURCE_IRQ SYS_RES_IRQ -struct pci_dev; +enum pci_bus_speed { + PCI_SPEED_UNKNOWN = -1, + PCIE_SPEED_2_5GT, + PCIE_SPEED_5_0GT, + PCIE_SPEED_8_0GT, +}; + +enum pcie_link_width { + PCIE_LNK_WIDTH_UNKNOWN = -1, +}; +struct pci_dev; struct pci_driver { struct list_head links; @@ -351,20 +366,6 @@ pci_find_capability(struct pci_dev *pdev return (reg); } - - - -/** - * pci_pcie_cap - get the saved PCIe capability offset - * @dev: PCI device - * - * PCIe capability offset is calculated at PCI device initialization - * time and saved in the data structure. This function returns saved - * PCIe capability offset. Using this instead of pci_find_capability() - * reduces unnecessary search in the PCI configuration space. If you - * need to calculate PCIe capability offset from raw device for some - * reasons, please use pci_find_capability() instead. - */ static inline int pci_pcie_cap(struct pci_dev *dev) { return pci_find_capability(dev, PCI_CAP_ID_EXP); @@ -505,13 +506,6 @@ static inline void pci_disable_sriov(str { } -/** - * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table - * @_table: device table name - * - * This macro is used to create a struct pci_device_id array (a device table) - * in a generic manner. - */ #define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[] __devinitdata @@ -569,54 +563,31 @@ typedef unsigned int __bitwise pci_chann typedef unsigned int __bitwise pci_ers_result_t; enum pci_channel_state { - /* I/O channel is in normal state */ - pci_channel_io_normal = (__force pci_channel_state_t) 1, - - /* I/O to channel is blocked */ - pci_channel_io_frozen = (__force pci_channel_state_t) 2, - - /* PCI card is dead */ - pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, + pci_channel_io_normal = 1, + pci_channel_io_frozen = 2, + pci_channel_io_perm_failure = 3, }; enum pci_ers_result { - /* no result/none/not supported in device driver */ - PCI_ERS_RESULT_NONE = (__force pci_ers_result_t) 1, - - /* Device driver can recover without slot reset */ - PCI_ERS_RESULT_CAN_RECOVER = (__force pci_ers_result_t) 2, - - /* Device driver wants slot to be reset. */ - PCI_ERS_RESULT_NEED_RESET = (__force pci_ers_result_t) 3, - - /* Device has completely failed, is unrecoverable */ - PCI_ERS_RESULT_DISCONNECT = (__force pci_ers_result_t) 4, - - /* Device driver is fully recovered and operational */ - PCI_ERS_RESULT_RECOVERED = (__force pci_ers_result_t) 5, + PCI_ERS_RESULT_NONE = 1, + PCI_ERS_RESULT_CAN_RECOVER = 2, + PCI_ERS_RESULT_NEED_RESET = 3, + PCI_ERS_RESULT_DISCONNECT = 4, + PCI_ERS_RESULT_RECOVERED = 5, }; /* PCI bus error event callbacks */ struct pci_error_handlers { - /* PCI bus error detected on this device */ pci_ers_result_t (*error_detected)(struct pci_dev *dev, enum pci_channel_state error); - - /* MMIO has been re-enabled, but not DMA */ pci_ers_result_t (*mmio_enabled)(struct pci_dev *dev); - - /* PCI Express link has been reset */ pci_ers_result_t (*link_reset)(struct pci_dev *dev); - - /* PCI slot has been reset */ pci_ers_result_t (*slot_reset)(struct pci_dev *dev); - - /* Device driver may resume normal operations */ void (*resume)(struct pci_dev *dev); }; -/* freeBSD does not support SRIOV - yet */ +/* FreeBSD does not support SRIOV - yet */ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) { return dev; @@ -721,7 +692,17 @@ static bool pcie_capability_reg_implemen } } - +static inline int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *dst) +{ + if (pos & 3) + return -EINVAL; + + if (!pcie_capability_reg_implemented(dev, pos)) + return -EINVAL; + + return pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, dst); +} + static inline int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val) { if (pos & 1) @@ -733,4 +714,18 @@ static inline int pcie_capability_write_ return pci_write_config_word(dev, pci_pcie_cap(dev) + pos, val); } +static inline int pcie_get_minimum_link(struct pci_dev *dev, + enum pci_bus_speed *speed, enum pcie_link_width *width) +{ + *speed = PCI_SPEED_UNKNOWN; + *width = PCIE_LNK_WIDTH_UNKNOWN; + return (0); +} + +static inline int +pci_num_vf(struct pci_dev *dev) +{ + return (0); +} + #endif /* _LINUX_PCI_H_ */ From owner-svn-src-head@freebsd.org Tue Jan 26 14:21:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CADBA6EB54; Tue, 26 Jan 2016 14:21: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 mx1.freebsd.org (Postfix) with ESMTPS id 38F8A1260; Tue, 26 Jan 2016 14:21: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 u0QELVea044214; Tue, 26 Jan 2016 14:21:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QELVcm044213; Tue, 26 Jan 2016 14:21:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261421.u0QELVcm044213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 14:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294825 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:21:32 -0000 Author: hselasky Date: Tue Jan 26 14:21:30 2016 New Revision: 294825 URL: https://svnweb.freebsd.org/changeset/base/294825 Log: Define __get_user() and __put_user() for the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/uaccess.h Tue Jan 26 14:20:25 2016 (r294824) +++ head/sys/compat/linuxkpi/common/include/linux/uaccess.h Tue Jan 26 14:21:30 2016 (r294825) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * Copyright (c) 2015 François Tigeot * All rights reserved. * @@ -34,6 +34,17 @@ #include +#define __get_user(_x, _p) ({ \ + int __err; \ + __typeof(*(_p)) __x; \ + __err = -copyin((_p), &(__x), sizeof(*(_p))); \ + (_x) = __x; \ + __err; \ +}) +#define __put_user(_x, _p) ({ \ + __typeof(*(_p)) __x = (_x); \ + -copyout(&(__x), (_p), sizeof(*(_p))); \ +}) #define get_user(_x, _p) -copyin((_p), &(_x), sizeof(*(_p))) #define put_user(_x, _p) -copyout(&(_x), (_p), sizeof(*(_p))) From owner-svn-src-head@freebsd.org Tue Jan 26 14:27:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A6ECA6ECFA; Tue, 26 Jan 2016 14:27:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3C7B31802; Tue, 26 Jan 2016 14:27:02 +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 u0QER1qH045193; Tue, 26 Jan 2016 14:27:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QER18e045192; Tue, 26 Jan 2016 14:27:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261427.u0QER18e045192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 14:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294826 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:27:02 -0000 Author: hselasky Date: Tue Jan 26 14:27:00 2016 New Revision: 294826 URL: https://svnweb.freebsd.org/changeset/base/294826 Log: Add definition for the NETDEV_CHANGE event and tidy up the LinuxKPI notifier header file a bit while at it. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/notifier.h Modified: head/sys/compat/linuxkpi/common/include/linux/notifier.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/notifier.h Tue Jan 26 14:21:30 2016 (r294825) +++ head/sys/compat/linuxkpi/common/include/linux/notifier.h Tue Jan 26 14:27:00 2016 (r294826) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,26 +34,24 @@ #include #include -/* - * Max number of FreeBSD events to map to Linux events per notify type. - */ #define NOTIFY_DONE 0 -#define _NOTIFY_COUNT 7 -struct notifier_block { - int (*notifier_call)(struct notifier_block *, unsigned long, void *); - struct notifier_block *next; - int priority; - eventhandler_tag tags[_NOTIFY_COUNT]; +enum { + NETDEV_CHANGE, + NETDEV_UP, + NETDEV_DOWN, + NETDEV_REGISTER, + NETDEV_UNREGISTER, + NETDEV_CHANGEADDR, + NETDEV_CHANGEIFADDR, + LINUX_NOTIFY_TAGS /* must be last */ }; -/* Values must be less than NOTIFY_COUNT */ -#define NETDEV_UP 0x0001 -#define NETDEV_DOWN 0x0002 -#define NETDEV_REGISTER 0x0003 -#define NETDEV_UNREGISTER 0x0004 -#define NETDEV_CHANGEADDR 0x0005 -#define NETDEV_CHANGEIFADDR 0x0006 - +struct notifier_block { + int (*notifier_call) (struct notifier_block *, unsigned long, void *); + struct notifier_block *next; + int priority; + eventhandler_tag tags[LINUX_NOTIFY_TAGS]; +}; -#endif /* _LINUX_NOTIFIER_H_ */ +#endif /* _LINUX_NOTIFIER_H_ */ From owner-svn-src-head@freebsd.org Tue Jan 26 14:29:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C285A6EE98; Tue, 26 Jan 2016 14:29: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 mx1.freebsd.org (Postfix) with ESMTPS id 28CC71AD7; Tue, 26 Jan 2016 14:29:52 +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 u0QETprJ045316; Tue, 26 Jan 2016 14:29:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QETpcj045315; Tue, 26 Jan 2016 14:29:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261429.u0QETpcj045315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 14:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294827 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:29:52 -0000 Author: hselasky Date: Tue Jan 26 14:29:50 2016 New Revision: 294827 URL: https://svnweb.freebsd.org/changeset/base/294827 Log: Add more network related macros and functions to the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/netdevice.h Modified: head/sys/compat/linuxkpi/common/include/linux/netdevice.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/netdevice.h Tue Jan 26 14:27:00 2016 (r294826) +++ head/sys/compat/linuxkpi/common/include/linux/netdevice.h Tue Jan 26 14:29:50 2016 (r294827) @@ -58,6 +58,9 @@ extern struct net init_net; #define dev_get_by_index(n, idx) ifnet_byindex_ref((idx)) #define dev_hold(d) if_ref((d)) #define dev_put(d) if_rele((d)) +#define dev_net(d) (&init_net) + +#define net_eq(a,b) ((a) == (b)) #define netif_running(dev) !!((dev)->if_drv_flags & IFF_DRV_RUNNING) #define netif_oper_up(dev) !!((dev)->if_flags & IFF_UP) @@ -69,6 +72,12 @@ netdev_priv(const struct net_device *dev return (dev->if_softc); } +static inline struct net_device * +netdev_notifier_info_to_dev(void *ifp) +{ + return (ifp); +} + int register_netdevice_notifier(struct notifier_block *); int register_inetaddr_notifier(struct notifier_block *); int unregister_netdevice_notifier(struct notifier_block *); @@ -94,6 +103,12 @@ dev_mc_delete(struct net_device *dev, vo } static inline int +dev_mc_del(struct net_device *dev, void *addr) +{ + return (dev_mc_delete(dev, addr, 6, 0)); +} + +static inline int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly) { struct sockaddr_dl sdl; From owner-svn-src-head@freebsd.org Tue Jan 26 14:31:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F138A46027; Tue, 26 Jan 2016 14:31:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id EF7331E33; Tue, 26 Jan 2016 14:31: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 u0QEVKab048030; Tue, 26 Jan 2016 14:31:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEVKhu048029; Tue, 26 Jan 2016 14:31:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261431.u0QEVKhu048029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 14:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294829 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:31:22 -0000 Author: hselasky Date: Tue Jan 26 14:31:20 2016 New Revision: 294829 URL: https://svnweb.freebsd.org/changeset/base/294829 Log: Implement bitmap_weight() and bitmap_equal() for the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Jan 26 14:30:03 2016 (r294828) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Jan 26 14:31:20 2016 (r294829) @@ -467,10 +467,40 @@ bitmap_release_region(unsigned long *bit __reg_op(bitmap, pos, order, REG_OP_RELEASE); } - #define for_each_set_bit(bit, addr, size) \ for ((bit) = find_first_bit((addr), (size)); \ (bit) < (size); \ (bit) = find_next_bit((addr), (size), (bit) + 1)) +static inline unsigned +bitmap_weight(unsigned long *bitmap, unsigned nbits) +{ + unsigned bit; + unsigned retval = 0; + + for_each_set_bit(bit, bitmap, nbits) + retval++; + return (retval); +} + +static inline int +bitmap_equal(const unsigned long *pa, + const unsigned long *pb, unsigned bits) +{ + unsigned x; + unsigned y = bits / BITS_PER_LONG; + + for (x = 0; x != y; x++) { + if (pa[x] != pb[x]) + return (0); + } + + y = bits % BITS_PER_LONG; + if (y != 0) { + if ((pa[x] ^ pb[x]) & BITMAP_LAST_WORD_MASK(y)) + return (0); + } + return (1); +} + #endif /* _LINUX_BITOPS_H_ */ From owner-svn-src-head@freebsd.org Tue Jan 26 14:33:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5175EA46115; Tue, 26 Jan 2016 14:33:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id 23BEF21D; Tue, 26 Jan 2016 14:33:22 +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 u0QEXLrP048156; Tue, 26 Jan 2016 14:33:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEXL8N048155; Tue, 26 Jan 2016 14:33:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261433.u0QEXL8N048155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 14:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294830 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:33:22 -0000 Author: hselasky Date: Tue Jan 26 14:33:20 2016 New Revision: 294830 URL: https://svnweb.freebsd.org/changeset/base/294830 Log: Implement is_vlan_dev() and vlan_dev_vlan_id() for the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/if_vlan.h Modified: head/sys/compat/linuxkpi/common/include/linux/if_vlan.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/if_vlan.h Tue Jan 26 14:31:20 2016 (r294829) +++ head/sys/compat/linuxkpi/common/include/linux/if_vlan.h Tue Jan 26 14:33:20 2016 (r294830) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,8 +35,25 @@ #include #include #include +#include #include +#include #define VLAN_N_VID 4096 +static inline int +is_vlan_dev(struct ifnet *ifp) +{ + return (ifp->if_type == IFT_L2VLAN); +} + +static inline uint16_t +vlan_dev_vlan_id(struct ifnet *ifp) +{ + uint16_t vtag; + if (VLAN_TAG(ifp, &vtag) == 0) + return (vtag); + return (0); +} + #endif /* _LINUX_IF_VLAN_H_ */ From owner-svn-src-head@freebsd.org Tue Jan 26 14:34:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EE60A461A3; Tue, 26 Jan 2016 14:34:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1EF763EC; Tue, 26 Jan 2016 14:34:42 +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 u0QEYfB1048241; Tue, 26 Jan 2016 14:34:41 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEYfHU048240; Tue, 26 Jan 2016 14:34:41 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601261434.u0QEYfHU048240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Jan 2016 14:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294831 - head/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:34:42 -0000 Author: br Date: Tue Jan 26 14:34:40 2016 New Revision: 294831 URL: https://svnweb.freebsd.org/changeset/base/294831 Log: Remove uathload from build due to issue with GCC 5.2.0: "ld: --relax and -r may not be used together." Requires fixing ld command line arguments and testing. Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Jan 26 14:33:20 2016 (r294830) +++ head/usr.sbin/Makefile Tue Jan 26 14:34:40 2016 (r294831) @@ -194,7 +194,9 @@ SUBDIR.${MK_TIMED}+= timed SUBDIR.${MK_TOOLCHAIN}+= config SUBDIR.${MK_TOOLCHAIN}+= crunch SUBDIR.${MK_UNBOUND}+= unbound +.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200) SUBDIR.${MK_USB}+= uathload +.endif SUBDIR.${MK_USB}+= uhsoctl SUBDIR.${MK_USB}+= usbconfig SUBDIR.${MK_USB}+= usbdump From owner-svn-src-head@freebsd.org Tue Jan 26 14:36:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCDBA46269; Tue, 26 Jan 2016 14:36: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 mx1.freebsd.org (Postfix) with ESMTPS id 1E6D77F8; Tue, 26 Jan 2016 14:36: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 u0QEaHsW048342; Tue, 26 Jan 2016 14:36:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEaHfF048341; Tue, 26 Jan 2016 14:36:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261436.u0QEaHfF048341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 14:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294832 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:36:18 -0000 Author: hselasky Date: Tue Jan 26 14:36:16 2016 New Revision: 294832 URL: https://svnweb.freebsd.org/changeset/base/294832 Log: Implement ether_addr_equal(), ether_addr_equal_64bits() and random_ether_addr() for the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/etherdevice.h Modified: head/sys/compat/linuxkpi/common/include/linux/etherdevice.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/etherdevice.h Tue Jan 26 14:34:40 2016 (r294831) +++ head/sys/compat/linuxkpi/common/include/linux/etherdevice.h Tue Jan 26 14:36:16 2016 (r294832) @@ -29,6 +29,9 @@ #include +#include +#include + #define ETH_MODULE_SFF_8079 1 #define ETH_MODULE_SFF_8079_LEN 256 #define ETH_MODULE_SFF_8472 2 @@ -78,4 +81,25 @@ ether_addr_copy(u8 * dst, const u8 * src memcpy(dst, src, 6); } +static inline bool +ether_addr_equal(const u8 *pa, const u8 *pb) +{ + return (memcmp(pa, pb, 6) == 0); +} + +static inline bool +ether_addr_equal_64bits(const u8 *pa, const u8 *pb) +{ + return (memcmp(pa, pb, 6) == 0); +} + +static inline void +random_ether_addr(u8 * dst) +{ + read_random(dst, 6); + + dst[0] &= 0xfe; + dst[0] |= 0x02; +} + #endif /* _LINUX_ETHERDEVICE */ From owner-svn-src-head@freebsd.org Tue Jan 26 14:40:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74BCCA463A1; Tue, 26 Jan 2016 14:40:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id 277DC9C8; Tue, 26 Jan 2016 14:40:43 +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 u0QEegfW049153; Tue, 26 Jan 2016 14:40:42 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEegdE049152; Tue, 26 Jan 2016 14:40:42 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601261440.u0QEegdE049152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Jan 2016 14:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294833 - head/lib/msun/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:40:43 -0000 Author: br Date: Tue Jan 26 14:40:41 2016 New Revision: 294833 URL: https://svnweb.freebsd.org/changeset/base/294833 Log: Add fenv.c for RISC-V. Copied from MIPS. Added: head/lib/msun/riscv/fenv.c (contents, props changed) Added: head/lib/msun/riscv/fenv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/riscv/fenv.c Tue Jan 26 14:40:41 2016 (r294833) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2004 David Schultz + * 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$ + */ + +#define __fenv_static +#include "fenv.h" + +#ifdef __GNUC_GNU_INLINE__ +#error "This file must be compiled with C99 'inline' semantics" +#endif + +/* + * Hopefully the system ID byte is immutable, so it's valid to use + * this as a default environment. + */ +const fenv_t __fe_dfl_env = 0; + +extern inline int feclearexcept(int __excepts); +extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts); +extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts); +extern inline int feraiseexcept(int __excepts); +extern inline int fetestexcept(int __excepts); +extern inline int fegetround(void); +extern inline int fesetround(int __round); +extern inline int fegetenv(fenv_t *__envp); +extern inline int feholdexcept(fenv_t *__envp); +extern inline int fesetenv(const fenv_t *__envp); +extern inline int feupdateenv(const fenv_t *__envp); From owner-svn-src-head@freebsd.org Tue Jan 26 14:45:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 368BEA465F3; Tue, 26 Jan 2016 14:45:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 07D1EDE2; Tue, 26 Jan 2016 14:45:22 +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 u0QEjMbb051305; Tue, 26 Jan 2016 14:45:22 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEjMOI051304; Tue, 26 Jan 2016 14:45:22 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601261445.u0QEjMOI051304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Jan 2016 14:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294834 - head/gnu/lib/libgcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:45:23 -0000 Author: br Date: Tue Jan 26 14:45:21 2016 New Revision: 294834 URL: https://svnweb.freebsd.org/changeset/base/294834 Log: Make libgcc compilable on RISC-V. Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Tue Jan 26 14:40:41 2016 (r294833) +++ head/gnu/lib/libgcc/Makefile Tue Jan 26 14:45:21 2016 (r294834) @@ -58,8 +58,10 @@ LIB2FUNCS+= _fixuns${mode}si .endfor # Likewise double-word routines. -.if ${TARGET_CPUARCH} != "aarch64" && ${TARGET_CPUARCH} != "arm" -# These are implemented in an ARM specific file but will not be filtered out +.if ${TARGET_CPUARCH} != "aarch64" && ${TARGET_CPUARCH} != "arm" && \ + ${TARGET_CPUARCH} != "riscv64" +# These are implemented in an ARM specific file but will not be filtered out. +# RISCVTODO: can't compile .for mode in sf df xf tf LIB2FUNCS+= _fix${mode}di _fixuns${mode}di LIB2FUNCS+= _floatdi${mode} _floatundi${mode} @@ -322,7 +324,10 @@ EH_OBJS_T = ${LIB2ADDEHSTATIC:R:S/$/.o/} EH_OBJS_P = ${LIB2ADDEHSTATIC:R:S/$/.po/} EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/} EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN +.if ${TARGET_CPUARCH} != "riscv64" +# RISCVTODO: unwinding support SOBJS += ${EH_OBJS_S} +.endif .for _src in ${LIB2ADDEHSTATIC:M*.c} ${_src:R:S/$/.o/}: ${_src} ${COMMONHDRS} From owner-svn-src-head@freebsd.org Tue Jan 26 14:46:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AC1AA466DE; Tue, 26 Jan 2016 14:46:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31ABB109; Tue, 26 Jan 2016 14:46:41 +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 u0QEkeCD051440; Tue, 26 Jan 2016 14:46:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QEkeGF051438; Tue, 26 Jan 2016 14:46:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601261446.u0QEkeGF051438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Jan 2016 14:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294836 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:46:41 -0000 Author: kib Date: Tue Jan 26 14:46:39 2016 New Revision: 294836 URL: https://svnweb.freebsd.org/changeset/base/294836 Log: Don't clear the software flow control flag before draining for last close or assert the bug that it is clear when leaving. Remove an unrelated rotted comment that was attached to the buggy clearing. Since draining is not done in more cases, flushing is needed in more cases, so start fixing flushing: - do a full flush in ttydisc_close(). State what POSIX requires more clearly. This was missing ttydevsw_pktnotify() calls to tell the devsw layer to flush. Hardware tty drivers don't actually flush since they don't understand this API. - fix 2 missing wakeups in tty_flush(). Most of the wakeups here are unnecessary for last close. But ttydisc_close() did one of the missing ones. This flow control bug ameliorated the design bug of requiring potentially unbounded waits in draining. Software flow control is the easiest way to get an unbounded wait, and a long wait is sometimes actually useful. Users can type the xoff character on the receiver and (if ixon is set on the sender) expect the output to be held until the user is ready for more. Hardware flow control can also give the unbounded wait, and this bug didn't affect hardware flow control. Unbounded waits from hardware flow control take a more unusual configuration. E.g., a terminal program that controls the modem status lines, or unplugging the cable in a configuration where this doesn't break the connection. The design bug is still ameliorated by a newer bug in draining for last close -- the 1 second timeout. E.g., if the user types the xoff character and the sender reaches last close, then output is not resumed and the wait times out after just 1 second. This is broken, but preferable to an unbounded wait. Before this change, the output was resumed immediately and usually completed. Submitted by: bde MFC after: 2 weeks Modified: head/sys/kern/tty.c head/sys/kern/tty_ttydisc.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Tue Jan 26 14:45:25 2016 (r294835) +++ head/sys/kern/tty.c Tue Jan 26 14:46:39 2016 (r294836) @@ -201,7 +201,6 @@ ttydev_leave(struct tty *tp) constty_clear(); /* Drain any output. */ - MPASS((tp->t_flags & TF_STOPPED) == 0); if (!tty_gone(tp)) tty_drain(tp, 1); @@ -352,11 +351,7 @@ ttydev_close(struct cdev *dev, int fflag if (fflag & FREVOKE) tty_flush(tp, FWRITE); - /* - * This can only be called once. The callin and the callout - * devices cannot be opened at the same time. - */ - tp->t_flags &= ~(TF_EXCLUDE|TF_STOPPED); + tp->t_flags &= ~TF_EXCLUDE; /* Properly wake up threads that are stuck - revoke(). */ tp->t_revokecnt++; @@ -1456,12 +1451,15 @@ tty_flush(struct tty *tp, int flags) tp->t_flags &= ~TF_HIWAT_OUT; ttyoutq_flush(&tp->t_outq); tty_wakeup(tp, FWRITE); - if (!tty_gone(tp)) + if (!tty_gone(tp)) { + ttydevsw_outwakeup(tp); ttydevsw_pktnotify(tp, TIOCPKT_FLUSHWRITE); + } } if (flags & FREAD) { tty_hiwat_in_unblock(tp); ttyinq_flush(&tp->t_inq); + tty_wakeup(tp, FREAD); if (!tty_gone(tp)) { ttydevsw_inwakeup(tp); ttydevsw_pktnotify(tp, TIOCPKT_FLUSHREAD); Modified: head/sys/kern/tty_ttydisc.c ============================================================================== --- head/sys/kern/tty_ttydisc.c Tue Jan 26 14:45:25 2016 (r294835) +++ head/sys/kern/tty_ttydisc.c Tue Jan 26 14:46:39 2016 (r294836) @@ -94,14 +94,11 @@ ttydisc_close(struct tty *tp) /* Clean up our flags when leaving the discipline. */ tp->t_flags &= ~(TF_STOPPED|TF_HIWAT|TF_ZOMBIE); - /* POSIX states we should flush when close() is called. */ - ttyinq_flush(&tp->t_inq); - ttyoutq_flush(&tp->t_outq); - - if (!tty_gone(tp)) { - ttydevsw_inwakeup(tp); - ttydevsw_outwakeup(tp); - } + /* + * POSIX states that we must drain output and flush input on + * last close. Draining has already been done if possible. + */ + tty_flush(tp, FREAD | FWRITE); if (ttyhook_hashook(tp, close)) ttyhook_close(tp); From owner-svn-src-head@freebsd.org Tue Jan 26 14:51:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D111A46863 for ; Tue, 26 Jan 2016 14:51:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (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 EB6C375F for ; Tue, 26 Jan 2016 14:51:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-oi0-x229.google.com with SMTP id r14so4055950oie.0 for ; Tue, 26 Jan 2016 06:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=date:subject:message-id:from:to:mime-version:content-type :content-transfer-encoding; bh=23Mqi0GHMZFfrddlHKQs7CB3aL82FE6ox1GIAYHo6K4=; b=uqdoRAN6YbVUcC+Lo5iIx1HI9kdjR8NskrYXVygl3SkBM3NPXxve3MSNhyYgfZXeI9 zwFfaornz8/kCn7cgD9cjyRPnyZ4S99pDldZWjZFPpBcq+A17C22tbWN3ctYj4yKtWnZ W/66zYv2vrGfCxlc1pzVDJrgHZGBgSlLQ1zuND8OkfqFjQRUvWi6lekQvG/GF1nDo05I L8NFRxDs3EY4BKDdC2ZBtG92RykXLY2Sd9unwFrFXWLYtpz/2c4xPSluId1X+MQpsjIY qfSCvZytzux/eqjoXHiyxqVHkbNHitz6oBerLrgcntiIm0MYCu4Hjy2KEbLzBkVk4Mz5 fALA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:subject:message-id:from:to:mime-version :content-type:content-transfer-encoding; bh=23Mqi0GHMZFfrddlHKQs7CB3aL82FE6ox1GIAYHo6K4=; b=fA5MnjoEa1+qvUqjFQAo6E8bKUX5lEWeDeT94rNMps/lHuGL8TqH5e3WtVIF6D/5bv d5JRJbQ8rDkKJXfbImQ6RiLVI2KjjNRoOj/y3+T16YTShJ37Ae1ZXBjDGbm1WXlap1pG IrHtLmBjeYSb8UXFqYYlX9Kc3RJ3QASeXynLeVBrTlv7FOsFaXIndwkniqFc1ggVW9Mp tg+WXC1yaLZgqj4pstNcudzz956Q2nZZNX3iWTk+/x7TC6Vzr5t/0CSQXmtjzeF0cNVG ++CBoGlmiw+kkXPxDs5QUCkjTpqsiV8ugE2YzlhCf5bnAbvUAuRxbC6NNIFYjYWc+/y/ 2wWw== X-Gm-Message-State: AG10YORVl/ZKTlokHKTyDIC4HAyEWedmsHobxgso8Ck1T5wN7kA1fP23DGtNIv8W6ahX4g== X-Received: by 10.202.213.215 with SMTP id m206mr17727956oig.26.1453819869133; Tue, 26 Jan 2016 06:51:09 -0800 (PST) Received: from [10.0.0.96] ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id mm4sm646056obb.1.2016.01.26.06.51.08 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Jan 2016 06:51:08 -0800 (PST) Date: Tue, 26 Jan 2016 07:51:06 -0700 Subject: Re: svn commit: r294767 - head/sys/boot/efi/loader Message-ID: <1an1nwlw2qoqyava2yucmdtb.1453819866096@email.android.com> From: Warner Losh To: Steven Hartland , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 14:51:10 -0000 SnVzdCBmb3Jnb3QgdG8gYWRkIE1hYyBhZnRlciAxd2Vlay4gQnV0IHdpdGggYWxsIHRoZSBjaHVy biBoZXJlLCBwcmVkaWN0aW5nIHdoZW4gbWF5IGJlIHRvdWdoLgoKV2FybmVyCgpPbiBKYW51YXJ5 IDI2LCAyMDE2LCBhdCAzOjI5IEFNLCBTdGV2ZW4gSGFydGxhbmQgPHN0ZXZlbi5oYXJ0bGFuZEBt dWx0aXBsYXkuY28udWs+IHdyb3RlOgoKTm8gcGxhbiB0byBNRkMgdGhlc2UgY2hhbmdlcz8NCg0K T24gMjYvMDEvMjAxNiAwNjoyNiwgV2FybmVyIExvc2ggd3JvdGU6DQo+IEF1dGhvcjogaW1wDQo+ IERhdGU6IFR1ZSBKYW4gMjYgMDY6MjY6NDYgMjAxNg0KPiBOZXcgUmV2aXNpb246IDI5NDc2Nw0K PiBVUkw6IGh0dHBzOi8vc3Zud2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzI5NDc2Nw0K Pg0KPiBMb2c6DQo+ICAgIFBhcnNlIHRoZSBjb21tYW5kIGxpbmUgYXJndW1lbnRzLCBhbmQgZG8g aXQgYmVmb3JlIHdlIGluaXRpYWxpemUgdGhlDQo+ICAgIGNvbnNvbGUgc28gaXQgY2FuIGJlIGNo YW5nZWQgYnkgdGhlIGNvbW1hbmQgbGluZSBhcmd1bWVudHMuDQo+ICAgIA0KPiAgICBEaWZmZXJl bnRpYWwgUmV2aXNpb246IGh0dHBzOi8vcmV2aWV3cy5mcmVlYnNkLm9yZy9ENTAzOA0KPg0KPiBN b2RpZmllZDoNCj4gICAgaGVhZC9zeXMvYm9vdC9lZmkvbG9hZGVyL21haW4uYw0KPg0KPiBNb2Rp ZmllZDogaGVhZC9zeXMvYm9vdC9lZmkvbG9hZGVyL21haW4uYw0KPiA9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT0NCj4gLS0tIGhlYWQvc3lzL2Jvb3QvZWZpL2xvYWRlci9tYWluLmMJVHVlIEphbiAyNiAw NjoyNjo0NCAyMDE2CShyMjk0NzY2KQ0KPiArKysgaGVhZC9zeXMvYm9vdC9lZmkvbG9hZGVyL21h aW4uYwlUdWUgSmFuIDI2IDA2OjI2OjQ2IDIwMTYJKHIyOTQ3NjcpDQo+IEBAIC0yOSw2ICsyOSw4 IEBADQo+ICAgX19GQlNESUQoIiRGcmVlQlNEJCIpOw0KPiAgIA0KPiAgICNpbmNsdWRlIDxzeXMv cGFyYW0uaD4NCj4gKyNpbmNsdWRlIDxzeXMvcmVib290Lmg+DQo+ICsjaW5jbHVkZSA8c3lzL2Jv b3QuaD4NCj4gICAjaW5jbHVkZSA8c3RhbmQuaD4NCj4gICAjaW5jbHVkZSA8c3RyaW5nLmg+DQo+ ICAgI2luY2x1ZGUgPHNldGptcC5oPg0KPiBAQCAtODMsMTMgKzg1LDIyIEBAIHByaW50X3N0cjE2 KGNvbnN0IENIQVIxNiAqc3RyKQ0KPiAgIAkJcHJpbnRmKCIlYyIsIChjaGFyKXN0cltpXSk7DQo+ ICAgfQ0KPiAgIA0KPiArc3RhdGljIHZvaWQNCj4gK2NwMTZ0bzgoY29uc3QgQ0hBUjE2ICpzcmMs IGNoYXIgKmRzdCwgc2l6ZV90IGxlbikNCj4gK3sNCj4gKwlzaXplX3QgaTsNCj4gKw0KPiArCWZv ciAoaSA9IDA7IGkgPCBsZW4gJiYgc3JjW2ldOyBpKyspDQo+ICsJCWRzdFtpXSA9IChjaGFyKXNy Y1tpXTsNCj4gK30NCj4gKw0KPiAgIEVGSV9TVEFUVVMNCj4gICBtYWluKGludCBhcmdjLCBDSEFS MTYgKmFyZ3ZbXSkNCj4gICB7DQo+ICAgCWNoYXIgdmFyWzEyOF07DQo+ICAgCUVGSV9MT0FERURf SU1BR0UgKmltZzsNCj4gICAJRUZJX0dVSUQgKmd1aWQ7DQo+IC0JaW50IGksIGosIHZhcmdvb2Qs IHVuaXQ7DQo+ICsJaW50IGksIGosIHZhcmdvb2QsIHVuaXQsIGhvd3RvOw0KPiAgIAlzdHJ1Y3Qg ZGV2c3cgKmRldjsNCj4gICAJdWludDY0X3QgcG9vbF9ndWlkOw0KPiAgIAlVSU5UTiBrOw0KPiBA QCAtMTEzLDI3ICsxMjQsOTcgQEAgbWFpbihpbnQgYXJnYywgQ0hBUjE2ICphcmd2W10pDQo+ICAg CWNvbnNfcHJvYmUoKTsNCj4gICANCj4gICAJLyoNCj4gKwkgKiBQYXJzZSB0aGUgYXJncyB0byBz ZXQgdGhlIGNvbnNvbGUgc2V0dGluZ3MsIGV0Yw0KPiArCSAqIGJvb3QxLmVmaSBwYXNzZXMgdGhl c2UgaW4sIGlmIGl0IGNhbiByZWFkIC9ib290LmNvbmZpZyBvciAvYm9vdC9jb25maWcNCj4gKwkg KiBvciBpUFhFIG1heSBiZSBzZXR1cCB0byBwYXNzIHRoZXNlIGluLg0KPiArCSAqDQo+ICAgCSAq IExvb3AgdGhyb3VnaCB0aGUgYXJncywgYW5kIGZvciBlYWNoIG9uZSB0aGF0IGNvbnRhaW5zIGFu ICc9JyB0aGF0IGlzDQo+ICAgCSAqIG5vdCB0aGUgZmlyc3QgY2hhcmFjdGVyLCBhZGQgaXQgdG8g dGhlIGVudmlyb25tZW50LiAgVGhpcyBhbGxvd3MNCj4gICAJICogbG9hZGVyIGFuZCBrZXJuZWwg ZW52IHZhcnMgdG8gYmUgcGFzc2VkIG9uIHRoZSBjb21tYW5kIGxpbmUuICBDb252ZXJ0DQo+ICAg CSAqIGFyZ3MgZnJvbSBVQ1MtMiB0byBBU0NJSSAoMTYgdG8gOCBiaXQpIGFzIHRoZXkgYXJlIGNv cGllZC4NCj4gICAJICovDQo+ICsJaG93dG8gPSAwOw0KPiAgIAlmb3IgKGkgPSAxOyBpIDwgYXJn YzsgaSsrKSB7DQo+IC0JCXZhcmdvb2QgPSAwOw0KPiAtCQlmb3IgKGogPSAwOyBhcmd2W2ldW2pd ICE9IDA7IGorKykgew0KPiAtCQkJaWYgKGogPT0gc2l6ZW9mKHZhcikpIHsNCj4gLQkJCQl2YXJn b29kID0gMDsNCj4gLQkJCQlicmVhazsNCj4gKwkJaWYgKGFyZ3ZbaV1bMF0gPT0gJy0nKSB7DQo+ ICsJCQlmb3IgKGogPSAxOyBhcmd2W2ldW2pdICE9IDA7IGorKykgew0KPiArCQkJCWludCBjaDsN Cj4gKw0KPiArCQkJCWNoID0gYXJndltpXVtqXTsNCj4gKwkJCQlzd2l0Y2ggKGNoKSB7DQo+ICsJ CQkJY2FzZSAnYSc6DQo+ICsJCQkJCWhvd3RvIHw9IFJCX0FTS05BTUU7DQo+ICsJCQkJCWJyZWFr Ow0KPiArCQkJCWNhc2UgJ2QnOg0KPiArCQkJCQlob3d0byB8PSBSQl9LREI7DQo+ICsJCQkJCWJy ZWFrOw0KPiArCQkJCWNhc2UgJ0QnOg0KPiArCQkJCQlob3d0byB8PSBSQl9NVUxUSVBMRTsNCj4g KwkJCQkJYnJlYWs7DQo+ICsJCQkJY2FzZSAnbSc6DQo+ICsJCQkJCWhvd3RvIHw9IFJCX01VVEU7 DQo+ICsJCQkJCWJyZWFrOw0KPiArCQkJCWNhc2UgJ2gnOg0KPiArCQkJCQlob3d0byB8PSBSQl9T RVJJQUw7DQo+ICsJCQkJCWJyZWFrOw0KPiArCQkJCWNhc2UgJ3AnOg0KPiArCQkJCQlob3d0byB8 PSBSQl9QQVVTRTsNCj4gKwkJCQkJYnJlYWs7DQo+ICsJCQkJY2FzZSAncic6DQo+ICsJCQkJCWhv d3RvIHw9IFJCX0RGTFRST09UOw0KPiArCQkJCQlicmVhazsNCj4gKwkJCQljYXNlICdzJzoNCj4g KwkJCQkJaG93dG8gfD0gUkJfU0lOR0xFOw0KPiArCQkJCQlicmVhazsNCj4gKwkJCQljYXNlICdT JzoNCj4gKwkJCQkJaWYgKGFyZ3ZbaV1baiArIDFdID09IDApIHsNCj4gKwkJCQkJCWlmIChpICsg MSA9PSBhcmdjKSB7DQo+ICsJCQkJCQkJc2V0ZW52KCJjb21jb25zb2xlX3NwZWVkIiwgIjExNTIw MCIsIDEpOw0KPiArCQkJCQkJfSBlbHNlIHsNCj4gKwkJCQkJCQljcDE2dG84KCZhcmd2W2kgKyAx XVswXSwgdmFyLA0KPiArCQkJCQkJCSAgICBzaXplb2YodmFyKSk7DQo+ICsJCQkJCQkJc2V0ZW52 KCJjb21jb25zb2xlX3NwZWVkc3BlZWQiLCB2YXIsIDEpOw0KPiArCQkJCQkJfQ0KPiArCQkJCQkJ aSsrOw0KPiArCQkJCQkJYnJlYWs7DQo+ICsJCQkJCX0gZWxzZSB7DQo+ICsJCQkJCQljcDE2dG84 KCZhcmd2W2ldW2ogKyAxXSwgdmFyLA0KPiArCQkJCQkJICAgIHNpemVvZih2YXIpKTsNCj4gKwkJ CQkJCXNldGVudigiY29tY29uc29sZV9zcGVlZCIsIHZhciwgMSk7DQo+ICsJCQkJCQlicmVhazsN Cj4gKwkJCQkJfQ0KPiArCQkJCWNhc2UgJ3YnOg0KPiArCQkJCQlob3d0byB8PSBSQl9WRVJCT1NF Ow0KPiArCQkJCQlicmVhazsNCj4gKwkJCQl9DQo+ICsJCQl9DQo+ICsJCX0gZWxzZSB7DQo+ICsJ CQl2YXJnb29kID0gMDsNCj4gKwkJCWZvciAoaiA9IDA7IGFyZ3ZbaV1bal0gIT0gMDsgaisrKSB7 DQo+ICsJCQkJaWYgKGogPT0gc2l6ZW9mKHZhcikpIHsNCj4gKwkJCQkJdmFyZ29vZCA9IDA7DQo+ ICsJCQkJCWJyZWFrOw0KPiArCQkJCX0NCj4gKwkJCQlpZiAoaiA+IDAgJiYgYXJndltpXVtqXSA9 PSAnPScpDQo+ICsJCQkJCXZhcmdvb2QgPSAxOw0KPiArCQkJCXZhcltqXSA9IChjaGFyKWFyZ3Zb aV1bal07DQo+ICsJCQl9DQo+ICsJCQlpZiAodmFyZ29vZCkgew0KPiArCQkJCXZhcltqXSA9IDA7 DQo+ICsJCQkJcHV0ZW52KHZhcik7DQo+ICAgCQkJfQ0KPiAtCQkJaWYgKGogPiAwICYmIGFyZ3Zb aV1bal0gPT0gJz0nKQ0KPiAtCQkJCXZhcmdvb2QgPSAxOw0KPiAtCQkJdmFyW2pdID0gKGNoYXIp YXJndltpXVtqXTsNCj4gLQkJfQ0KPiAtCQlpZiAodmFyZ29vZCkgew0KPiAtCQkJdmFyW2pdID0g MDsNCj4gLQkJCXB1dGVudih2YXIpOw0KPiAgIAkJfQ0KPiAgIAl9DQo+ICsJZm9yIChpID0gMDsg aG93dG9fbmFtZXNbaV0uZXYgIT0gTlVMTDsgaSsrKQ0KPiArCQlpZiAoaG93dG8gJiBob3d0b19u YW1lc1tpXS5tYXNrKQ0KPiArCQkJc2V0ZW52KGhvd3RvX25hbWVzW2ldLmV2LCAiWUVTIiwgMSk7 DQo+ICsJaWYgKGhvd3RvICYgUkJfTVVMVElQTEUpIHsNCj4gKwkJaWYgKGhvd3RvICYgUkJfU0VS SUFMKQ0KPiArCQkJc2V0ZW52KCJjb25zb2xlIiwgImNvbWNvbnNvbGUgZWZpIiAsIDEpOw0KPiAr CQllbHNlDQo+ICsJCQlzZXRlbnYoImNvbnNvbGUiLCAiZWZpIGNvbWNvbnNvbGUiICwgMSk7DQo+ ICsJfSBlbHNlIGlmIChob3d0byAmIFJCX1NFUklBTCkgew0KPiArCQlzZXRlbnYoImNvbnNvbGUi LCAiY29tY29uc29sZSIgLCAxKTsNCj4gKwl9DQo+ICAgDQo+ICAgCWlmIChlZmlfY29weV9pbml0 KCkpIHsNCj4gICAJCXByaW50ZigiZmFpbGVkIHRvIGFsbG9jYXRlIHN0YWdpbmcgYXJlYVxuIik7 DQo+DQoNCg== From owner-svn-src-head@freebsd.org Tue Jan 26 15:12:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 564D6A6E31F; Tue, 26 Jan 2016 15:12: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 mx1.freebsd.org (Postfix) with ESMTPS id 31A096F1; Tue, 26 Jan 2016 15:12: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 u0QFCWgM059975; Tue, 26 Jan 2016 15:12:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QFCWQT059972; Tue, 26 Jan 2016 15:12:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261512.u0QFCWQT059972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 15:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294837 - in head/sys: compat/linuxkpi/common/include/linux ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 15:12:33 -0000 Author: hselasky Date: Tue Jan 26 15:12:31 2016 New Revision: 294837 URL: https://svnweb.freebsd.org/changeset/base/294837 Log: LinuxKPI list updates: - Add some new hlist macros. - Update existing hlist macros removing the need for a temporary iteration variable. - Properly define the RCU hlist macros to be SMP safe with regard to RCU. - Safe list macro arguments by adding a pair of parentheses. - Prefix the _list_add() and _list_splice() functions with "linux" to reflect they are LinuxKPI internal functions. Obtained from: Linux MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/list.h head/sys/compat/linuxkpi/common/include/linux/rcupdate.h head/sys/ofed/drivers/net/mlx4/en_netdev.c Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Tue Jan 26 14:46:39 2016 (r294836) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Tue Jan 26 15:12:31 2016 (r294837) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -109,7 +109,7 @@ list_replace(struct list_head *old, stru } static inline void -_list_add(struct list_head *new, struct list_head *prev, +linux_list_add(struct list_head *new, struct list_head *prev, struct list_head *next) { @@ -136,47 +136,55 @@ list_del_init(struct list_head *entry) list_entry(((ptr)->member.next), typeof(*(ptr)), member) #define list_for_each(p, head) \ - for (p = (head)->next; p != (head); p = p->next) + for (p = (head)->next; p != (head); p = (p)->next) #define list_for_each_safe(p, n, head) \ - for (p = (head)->next, n = p->next; p != (head); p = n, n = p->next) + for (p = (head)->next, n = (p)->next; p != (head); p = n, n = (p)->next) #define list_for_each_entry(p, h, field) \ - for (p = list_entry((h)->next, typeof(*p), field); &p->field != (h); \ - p = list_entry(p->field.next, typeof(*p), field)) + for (p = list_entry((h)->next, typeof(*p), field); &(p)->field != (h); \ + p = list_entry((p)->field.next, typeof(*p), field)) #define list_for_each_entry_safe(p, n, h, field) \ for (p = list_entry((h)->next, typeof(*p), field), \ - n = list_entry(p->field.next, typeof(*p), field); &p->field != (h);\ + n = list_entry((p)->field.next, typeof(*p), field); &(p)->field != (h);\ p = n, n = list_entry(n->field.next, typeof(*n), field)) +#define list_for_each_entry_from(p, h, field) \ + for ( ; &(p)->field != (h); \ + p = list_entry((p)->field.next, typeof(*p), field)) + #define list_for_each_entry_continue(p, h, field) \ - for (p = list_next_entry((p), field); &p->field != (h); \ + for (p = list_next_entry((p), field); &(p)->field != (h); \ p = list_next_entry((p), field)) #define list_for_each_entry_safe_from(pos, n, head, member) \ - for (n = list_entry(pos->member.next, typeof(*pos), member); \ - &pos->member != (head); \ + for (n = list_entry((pos)->member.next, typeof(*pos), member); \ + &(pos)->member != (head); \ pos = n, n = list_entry(n->member.next, typeof(*n), member)) #define list_for_each_entry_reverse(p, h, field) \ - for (p = list_entry((h)->prev, typeof(*p), field); &p->field != (h); \ - p = list_entry(p->field.prev, typeof(*p), field)) + for (p = list_entry((h)->prev, typeof(*p), field); &(p)->field != (h); \ + p = list_entry((p)->field.prev, typeof(*p), field)) + +#define list_for_each_entry_continue_reverse(p, h, field) \ + for (p = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \ + p = list_entry((p)->field.prev, typeof(*p), field)) -#define list_for_each_prev(p, h) for (p = (h)->prev; p != (h); p = p->prev) +#define list_for_each_prev(p, h) for (p = (h)->prev; p != (h); p = (p)->prev) static inline void list_add(struct list_head *new, struct list_head *head) { - _list_add(new, head, head->next); + linux_list_add(new, head, head->next); } static inline void list_add_tail(struct list_head *new, struct list_head *head) { - _list_add(new, head->prev, head); + linux_list_add(new, head->prev, head); } static inline void @@ -196,7 +204,7 @@ list_move_tail(struct list_head *entry, } static inline void -_list_splice(const struct list_head *list, struct list_head *prev, +linux_list_splice(const struct list_head *list, struct list_head *prev, struct list_head *next) { struct list_head *first; @@ -216,21 +224,21 @@ static inline void list_splice(const struct list_head *list, struct list_head *head) { - _list_splice(list, head, head->next); + linux_list_splice(list, head, head->next); } static inline void list_splice_tail(struct list_head *list, struct list_head *head) { - _list_splice(list, head->prev, head); + linux_list_splice(list, head->prev, head); } static inline void list_splice_init(struct list_head *list, struct list_head *head) { - _list_splice(list, head, head->next); + linux_list_splice(list, head, head->next); INIT_LIST_HEAD(list); } @@ -238,7 +246,7 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_head *head) { - _list_splice(list, head->prev, head); + linux_list_splice(list, head->prev, head); INIT_LIST_HEAD(list); } @@ -401,10 +409,10 @@ static inline int list_is_last(const str #define hlist_entry(ptr, type, field) container_of(ptr, type, field) #define hlist_for_each(p, head) \ - for (p = (head)->first; p; p = p->next) + for (p = (head)->first; p; p = (p)->next) #define hlist_for_each_safe(p, n, head) \ - for (p = (head)->first; p && ({ n = p->next; 1; }); p = n) + for (p = (head)->first; p && ({ n = (p)->next; 1; }); p = n) #define hlist_entry_safe(ptr, type, member) \ ((ptr) ? hlist_entry(ptr, type, member) : NULL) @@ -414,21 +422,18 @@ static inline int list_is_last(const str pos; \ pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) -#define hlist_for_each_entry_continue(tp, p, field) \ - for (p = (p)->next; \ - p ? (tp = hlist_entry(p, typeof(*tp), field)): NULL; p = p->next) - -#define hlist_for_each_entry_from(tp, p, field) \ - for (; p ? (tp = hlist_entry(p, typeof(*tp), field)): NULL; p = p->next) - -#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \ - for (pos = (head)->first; \ - (pos) != 0 && ({ n = (pos)->next; \ - tpos = hlist_entry((pos), typeof(*(tpos)), member); 1;}); \ - pos = (n)) +#define hlist_for_each_entry_continue(pos, member) \ + for (pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member); \ + (pos); \ + pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) -#define hlist_add_head_rcu(n, h) hlist_add_head(n, h) +#define hlist_for_each_entry_from(pos, member) \ + for (; (pos); \ + pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) -#define hlist_del_init_rcu(n) hlist_del_init(n) +#define hlist_for_each_entry_safe(pos, n, head, member) \ + for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member); \ + (pos) && ({ n = (pos)->member.next; 1; }); \ + pos = hlist_entry_safe(n, typeof(*(pos)), member)) #endif /* _LINUX_LIST_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Tue Jan 26 14:46:39 2016 (r294836) +++ head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Tue Jan 26 15:12:31 2016 (r294837) @@ -73,4 +73,25 @@ synchronize_rcu(void) sx_xunlock(&linux_global_rcu_lock); } +#define hlist_add_head_rcu(n, h) \ +do { \ + sx_xlock(&linux_global_rcu_lock); \ + hlist_add_head(n, h); \ + sx_xunlock(&linux_global_rcu_lock); \ +} while (0) + +#define hlist_del_init_rcu(n) \ +do { \ + sx_xlock(&linux_global_rcu_lock); \ + hlist_del_init(n); \ + sx_xunlock(&linux_global_rcu_lock); \ +} while (0) + +#define hlist_del_rcu(n) \ +do { \ + sx_xlock(&linux_global_rcu_lock); \ + hlist_del(n); \ + sx_xunlock(&linux_global_rcu_lock); \ +} while (0) + #endif /* _LINUX_RCUPDATE_H_ */ Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Tue Jan 26 14:46:39 2016 (r294836) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Tue Jan 26 15:12:31 2016 (r294837) @@ -606,13 +606,13 @@ static void mlx4_en_put_qp(struct mlx4_e mlx4_unregister_mac(dev, priv->port, mac); } else { struct mlx4_mac_entry *entry; - struct hlist_node *n, *tmp; + struct hlist_node *tmp; struct hlist_head *bucket; unsigned int i; for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) { bucket = &priv->mac_hash[i]; - hlist_for_each_entry_safe(entry, n, tmp, bucket, hlist) { + hlist_for_each_entry_safe(entry, tmp, bucket, hlist) { mac = mlx4_mac_to_u64(entry->mac); en_dbg(DRV, priv, "Registering MAC: %pM for deleting\n", entry->mac); From owner-svn-src-head@freebsd.org Tue Jan 26 15:22:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14ED8A6E73F; Tue, 26 Jan 2016 15:22:06 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8DA2E72; Tue, 26 Jan 2016 15:22:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QFM49U062674; Tue, 26 Jan 2016 15:22:04 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QFM4IN062671; Tue, 26 Jan 2016 15:22:04 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601261522.u0QFM4IN062671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 26 Jan 2016 15:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294838 - in head/sys/contrib/alpine-hal: . eth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 15:22:06 -0000 Author: zbb Date: Tue Jan 26 15:22:04 2016 New Revision: 294838 URL: https://svnweb.freebsd.org/changeset/base/294838 Log: Import Annapurna Labs Alpine HAL for networking Files required for the NIC driver Import from vendor-sys/alpine-hal/2.7 SVN rev.: 294828 HAL version: 2.7 Obtained from: Semihalf Sponsored by: Annapurna Labs Added: head/sys/contrib/alpine-hal/al_hal_iofic.c (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes.c (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_internal_regs.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_regs.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_config.c (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_config.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_debug.c (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_debug.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_iofic.c (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_iofic.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_iofic_regs.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_main.c (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_regs.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_regs_gen.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_regs_m2s.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_udma_regs_s2m.h (contents, props changed) head/sys/contrib/alpine-hal/eth/ head/sys/contrib/alpine-hal/eth/al_hal_an_lt_wrapper_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_eth.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_eth_alu.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_eth_ec_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_eth_kr.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_eth_kr.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_eth_mac_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_eth_main.c (contents, props changed) Added: head/sys/contrib/alpine-hal/al_hal_iofic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/alpine-hal/al_hal_iofic.c Tue Jan 26 15:22:04 2016 (r294838) @@ -0,0 +1,291 @@ +/*- +******************************************************************************* +Copyright (C) 2015 Annapurna Labs Ltd. + +This file may be licensed under the terms of the Annapurna Labs Commercial +License Agreement. + +Alternatively, this file can be distributed under the terms of the GNU General +Public License V2 as published by the Free Software Foundation and can be +found at http://www.gnu.org/licenses/gpl-2.0.html + +Alternatively, redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + +*******************************************************************************/ + +/** + * @{ + * @file al_hal_iofic.c + * + * @brief interrupt controller hal + * + */ + +#include "al_hal_iofic.h" +#include "al_hal_iofic_regs.h" + +/* + * configure the interrupt registers, interrupts will are kept masked + */ +int al_iofic_config(void __iomem *regs_base, int group, uint32_t flags) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + al_reg_write32(®s->ctrl[group].int_control_grp, flags); + + return 0; +} + +/* + * configure the moderation timer resolution for a given group + */ +int al_iofic_moder_res_config(void __iomem *regs_base, int group, + uint8_t resolution) + +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->ctrl[group].int_control_grp); + AL_REG_FIELD_SET(reg, + INT_CONTROL_GRP_MOD_RES_MASK, + INT_CONTROL_GRP_MOD_RES_SHIFT, + resolution); + al_reg_write32(®s->ctrl[group].int_control_grp, reg); + + return 0; +} + +/* + * configure the moderation timer interval for a given legacy interrupt group + */ +int al_iofic_legacy_moder_interval_config(void __iomem *regs_base, int group, + uint8_t interval) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->ctrl[group].int_control_grp); + AL_REG_FIELD_SET(reg, + INT_CONTROL_GRP_MOD_INTV_MASK, + INT_CONTROL_GRP_MOD_INTV_SHIFT, + interval); + al_reg_write32(®s->ctrl[group].int_control_grp, reg); + + return 0; +} + + +/* + * configure the moderation timer interval for a given msix vector. + */ +int al_iofic_msix_moder_interval_config(void __iomem *regs_base, int group, + uint8_t vector, uint8_t interval) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->grp_int_mod[group][vector].grp_int_mod_reg); + AL_REG_FIELD_SET(reg, + INT_MOD_INTV_MASK, + INT_MOD_INTV_SHIFT, + interval); + al_reg_write32(®s->grp_int_mod[group][vector].grp_int_mod_reg, reg); + + return 0; +} + +/* + * configure the vmid attributes for a given msix vector. + */ +int al_iofic_msix_vmid_attributes_config(void __iomem *regs_base, int group, + uint8_t vector, uint32_t vmid, uint8_t vmid_en) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg = 0; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + AL_REG_FIELD_SET(reg, + INT_MSIX_VMID_MASK, + INT_MSIX_VMID_SHIFT, + vmid); + AL_REG_BIT_VAL_SET(reg, + INT_MSIX_VMID_EN_SHIFT, + vmid_en); + + al_reg_write32(®s->grp_int_mod[group][vector].grp_int_vmid_reg, reg); + + return 0; +} + +/* + * return the offset of the unmask register for a given group + */ +uint32_t __iomem * al_iofic_unmask_offset_get(void __iomem *regs_base, int group) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + return ®s->ctrl[group].int_mask_clear_grp; +} + + +/* + * unmask specific interrupts for a given group + */ +void al_iofic_unmask(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + /* + * use the mask clear register, no need to read the mask register + * itself. write 0 to unmask, 1 has no effect + */ + al_reg_write32_relaxed(®s->ctrl[group].int_mask_clear_grp, ~mask); +} + +/* + * mask specific interrupts for a given group + */ +void al_iofic_mask(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->ctrl[group].int_mask_grp); + + al_reg_write32(®s->ctrl[group].int_mask_grp, reg | mask); +} + +/* + * read the mask for a given group + */ +uint32_t al_iofic_read_mask(void __iomem *regs_base, int group) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + return al_reg_read32(®s->ctrl[group].int_mask_grp); +} + +/* + * read interrupt cause register for a given group + */ +uint32_t al_iofic_read_cause(void __iomem *regs_base, int group) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + return al_reg_read32(®s->ctrl[group].int_cause_grp); +} + +/* + * clear bits in the interrupt cause register for a given group + */ +void al_iofic_clear_cause(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + /* inverse mask, writing 1 has no effect */ + al_reg_write32(®s->ctrl[group].int_cause_grp, ~mask); +} + +/* + * Set the cause register for a given group + */ +void al_iofic_set_cause(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + al_reg_write32(®s->ctrl[group].int_cause_set_grp, mask); +} + + +/* + * unmask specific interrupts from aborting the udma a given group + */ +void al_iofic_abort_mask(void __iomem *regs_base, int group, uint32_t mask) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + al_reg_write32(®s->ctrl[group].int_abort_msk_grp, mask); + +} + +/* + * trigger all interrupts that are waiting for moderation timers to expire + */ +void al_iofic_interrupt_moderation_reset(void __iomem *regs_base, int group) +{ + struct al_iofic_regs __iomem *regs = (struct al_iofic_regs __iomem *)(regs_base); + uint32_t reg = 0; + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + al_assert(regs_base); + al_assert(group < AL_IOFIC_MAX_GROUPS); + + reg = al_reg_read32(®s->ctrl[group].int_control_grp); + reg |= INT_CONTROL_GRP_MOD_RST; + + al_reg_write32(®s->ctrl[group].int_control_grp, reg); +} + +/** @} end of interrupt controller group */ Added: head/sys/contrib/alpine-hal/al_hal_serdes.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/alpine-hal/al_hal_serdes.c Tue Jan 26 15:22:04 2016 (r294838) @@ -0,0 +1,3228 @@ +/*- +******************************************************************************* +Copyright (C) 2015 Annapurna Labs Ltd. + +This file may be licensed under the terms of the Annapurna Labs Commercial +License Agreement. + +Alternatively, this file can be distributed under the terms of the GNU General +Public License V2 as published by the Free Software Foundation and can be +found at http://www.gnu.org/licenses/gpl-2.0.html + +Alternatively, redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 "al_hal_serdes.h" +#include "al_hal_serdes_regs.h" +#include "al_hal_serdes_internal_regs.h" + +#define SRDS_CORE_REG_ADDR(page, type, offset)\ + (((page) << 13) | ((type) << 12) | (offset)) + +/* Link Training configuration */ +#define AL_SERDES_TX_DEEMPH_SUM_MAX 0x1b + +/* c configurations */ +#define AL_SERDES_TX_DEEMPH_C_ZERO_MAX_VAL 0x1b +#define AL_SERDES_TX_DEEMPH_C_ZERO_MIN_VAL 0 +#define AL_SERDES_TX_DEEMPH_C_ZERO_PRESET AL_SERDES_TX_DEEMPH_C_ZERO_MAX_VAL + +/* c(+1) configurations */ +#define AL_SERDES_TX_DEEMPH_C_PLUS_MAX_VAL 0x9 +#define AL_SERDES_TX_DEEMPH_C_PLUS_MIN_VAL 0 +#define AL_SERDES_TX_DEEMPH_C_PLUS_PRESET AL_SERDES_TX_DEEMPH_C_PLUS_MIN_VAL + +/* c(-1) configurations */ +#define AL_SERDES_TX_DEEMPH_C_MINUS_MAX_VAL 0x6 +#define AL_SERDES_TX_DEEMPH_C_MINUS_MIN_VAL 0 +#define AL_SERDES_TX_DEEMPH_C_MINUS_PRESET AL_SERDES_TX_DEEMPH_C_MINUS_MIN_VAL + +/* Rx equal total delay = MDELAY * TRIES */ +#define AL_SERDES_RX_EQUAL_MDELAY 10 +#define AL_SERDES_RX_EQUAL_TRIES 50 + +/* Rx eye calculation delay = MDELAY * TRIES */ +#define AL_SERDES_RX_EYE_CAL_MDELAY 50 +#define AL_SERDES_RX_EYE_CAL_TRIES 70 + + +/** + * Prototypes for _lane_ compatibility + */ +int al_serdes_lane_read( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t *data); + +int al_serdes_lane_write( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t data); + + +/** + * SERDES core reg/lane read + */ +static inline uint8_t al_serdes_grp_reg_read( + struct al_serdes_group_info *grp_info, + enum al_serdes_reg_page page, + enum al_serdes_reg_type type, + uint16_t offset); + +static inline uint8_t al_serdes_grp_lane_read( + struct al_serdes_group_info *grp_info, + enum al_serdes_lane page, + enum al_serdes_reg_type type, + uint16_t offset); + +/** + * SERDES core reg/lane write + */ +static inline void al_serdes_grp_reg_write( + struct al_serdes_group_info *grp_info, + enum al_serdes_reg_page page, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t data); + +static inline void al_serdes_grp_lane_write( + struct al_serdes_group_info *grp_info, + enum al_serdes_lane lane, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t data); + +/** + * SERDES core masked reg/lane write + */ +static inline void al_serdes_grp_reg_masked_write( + struct al_serdes_group_info *grp_info, + enum al_serdes_reg_page page, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t mask, + uint8_t data); + +/** + * Lane Rx rate change software flow disable + */ +static void _al_serdes_lane_rx_rate_change_sw_flow_dis( + struct al_serdes_group_info *grp_info, + enum al_serdes_lane lane); + +/** + * Group Rx rate change software flow enable if all conditions met + */ +static void al_serdes_group_rx_rate_change_sw_flow_dis( + struct al_serdes_group_info *grp_info); + +/** + * Lane Rx rate change software flow enable if all conditions met + */ +static void _al_serdes_lane_rx_rate_change_sw_flow_en_cond( + struct al_serdes_group_info *grp_info, + enum al_serdes_lane lane); + +/** + * Group Rx rate change software flow enable if all conditions met + */ +static void al_serdes_group_rx_rate_change_sw_flow_en_cond( + struct al_serdes_group_info *grp_info); + + +static inline void al_serdes_grp_lane_masked_write( + struct al_serdes_group_info *grp_info, + enum al_serdes_lane lane, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t mask, + uint8_t data); + +/******************************************************************************/ +/******************************************************************************/ +int al_serdes_handle_init( + void __iomem *serdes_regs_base, + struct al_serdes_obj *obj) +{ + int i; + + al_dbg( + "%s(%p, %p)\n", + __func__, + serdes_regs_base, + obj); + + al_assert(serdes_regs_base); + + for (i = 0; i < AL_SRDS_NUM_GROUPS; i++) { + obj->grp_info[i].pobj = obj; + + obj->grp_info[i].regs_base = + &((struct al_serdes_regs *)serdes_regs_base)[i]; + } + + return 0; +} + +/******************************************************************************/ +/******************************************************************************/ +int al_serdes_reg_read( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_reg_page page, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t *data) +{ + int status = 0; + + al_dbg( + "%s(%p, %d, %d, %d, %u)\n", + __func__, + obj, + grp, + page, + type, + offset); + + al_assert(obj); + al_assert(data); + al_assert(((int)grp) >= AL_SRDS_GRP_A); + al_assert(((int)grp) <= AL_SRDS_GRP_D); + al_assert(((int)page) >= AL_SRDS_REG_PAGE_0_LANE_0); + al_assert(((int)page) <= AL_SRDS_REG_PAGE_4_COMMON); + al_assert(((int)type) >= AL_SRDS_REG_TYPE_PMA); + al_assert(((int)type) <= AL_SRDS_REG_TYPE_PCS); + + *data = al_serdes_grp_reg_read( + &obj->grp_info[grp], + page, + type, + offset); + + al_dbg( + "%s: return(%u)\n", + __func__, + *data); + + return status; +} + +int al_serdes_lane_read( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t *data) +{ + return al_serdes_reg_read(obj, grp, (enum al_serdes_reg_page)lane, type, + offset, data); +} +/******************************************************************************/ +/******************************************************************************/ +int al_serdes_reg_write( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_reg_page page, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t data) +{ + int status = 0; + + al_dbg( + "%s(%p, %d, %d, %d, %u, %u)\n", + __func__, + obj, + grp, + page, + type, + offset, + data); + + al_assert(obj); + al_assert(((int)grp) >= AL_SRDS_GRP_A); + al_assert(((int)grp) <= AL_SRDS_GRP_D); + al_assert(((int)page) >= AL_SRDS_REG_PAGE_0_LANE_0); + al_assert(((int)page) <= AL_SRDS_REG_PAGE_0123_LANES_0123); + al_assert(((int)type) >= AL_SRDS_REG_TYPE_PMA); + al_assert(((int)type) <= AL_SRDS_REG_TYPE_PCS); + + al_serdes_grp_reg_write( + &obj->grp_info[grp], + page, + type, + offset, + data); + + return status; +} + +int al_serdes_lane_write( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane, + enum al_serdes_reg_type type, + uint16_t offset, + uint8_t data) +{ + return al_serdes_reg_write(obj, grp, (enum al_serdes_reg_page)lane, + type, offset, data); +} +/******************************************************************************/ +/******************************************************************************/ +#if (SERDES_IREG_FLD_PCSRX_DATAWIDTH_REG_NUM != SERDES_IREG_FLD_PCSTX_DATAWIDTH_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_PCSRX_DIVRATE_REG_NUM != SERDES_IREG_FLD_PCSTX_DIVRATE_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_CMNPCIEGEN3_LOCWREN_REG_NUM != SERDES_IREG_FLD_CMNPCS_LOCWREN_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_CMNPCIEGEN3_LOCWREN_REG_NUM != SERDES_IREG_FLD_CMNPCSBIST_LOCWREN_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_CMNPCIEGEN3_LOCWREN_REG_NUM != SERDES_IREG_FLD_CMNPCSPSTATE_LOCWREN_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_LANEPCSPSTATE_LOCWREN_REG_NUM != SERDES_IREG_FLD_LB_LOCWREN_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_LANEPCSPSTATE_LOCWREN_REG_NUM != SERDES_IREG_FLD_PCSRX_LOCWREN_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_LANEPCSPSTATE_LOCWREN_REG_NUM != SERDES_IREG_FLD_PCSRXBIST_LOCWREN_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_LANEPCSPSTATE_LOCWREN_REG_NUM != SERDES_IREG_FLD_PCSRXEQ_LOCWREN_REG_NUM) +#error "Wrong assumption!" +#endif +#if (SERDES_IREG_FLD_LANEPCSPSTATE_LOCWREN_REG_NUM != SERDES_IREG_FLD_PCSTX_LOCWREN_REG_NUM) +#error "Wrong assumption!" +#endif +void al_serdes_bist_overrides_enable( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_rate rate) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + int i; + + uint8_t rx_rate_val; + uint8_t tx_rate_val; + + switch (rate) { + case AL_SRDS_RATE_1_8: + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_8; + tx_rate_val = SERDES_IREG_FLD_PCSTX_DIVRATE_VAL_1_8; + break; + case AL_SRDS_RATE_1_4: + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_4; + tx_rate_val = SERDES_IREG_FLD_PCSTX_DIVRATE_VAL_1_4; + break; + case AL_SRDS_RATE_1_2: + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_2; + tx_rate_val = SERDES_IREG_FLD_PCSTX_DIVRATE_VAL_1_2; + break; + case AL_SRDS_RATE_FULL: + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_1; + tx_rate_val = SERDES_IREG_FLD_PCSTX_DIVRATE_VAL_1_1; + break; + default: + al_err("%s: invalid rate (%d)\n", __func__, rate); + al_assert(0); + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_1; + tx_rate_val = SERDES_IREG_FLD_PCSTX_DIVRATE_VAL_1_1; + } + + for (i = 0; i < AL_SRDS_NUM_LANES; i++) { + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_PCSRX_DATAWIDTH_REG_NUM, + SERDES_IREG_FLD_PCSRX_DATAWIDTH_MASK | + SERDES_IREG_FLD_PCSTX_DATAWIDTH_MASK, + SERDES_IREG_FLD_PCSRX_DATAWIDTH_VAL_20 | + SERDES_IREG_FLD_PCSTX_DATAWIDTH_VAL_20); + + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_PCSRX_DIVRATE_REG_NUM, + SERDES_IREG_FLD_PCSRX_DIVRATE_MASK | + SERDES_IREG_FLD_PCSTX_DIVRATE_MASK, + rx_rate_val | tx_rate_val); + } + + al_serdes_grp_reg_masked_write( + grp_info, + AL_SRDS_REG_PAGE_4_COMMON, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_CMNPCIEGEN3_LOCWREN_REG_NUM, + SERDES_IREG_FLD_CMNPCIEGEN3_LOCWREN | + SERDES_IREG_FLD_CMNPCS_LOCWREN | + SERDES_IREG_FLD_CMNPCSBIST_LOCWREN | + SERDES_IREG_FLD_CMNPCSPSTATE_LOCWREN, + 0); + + al_serdes_grp_reg_masked_write( + grp_info, + AL_SRDS_REG_PAGE_4_COMMON, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_CMNPCIEGEN3_LOCWREN_REG_NUM, + SERDES_IREG_FLD_CMNPCIEGEN3_LOCWREN | + SERDES_IREG_FLD_CMNPCS_LOCWREN | + SERDES_IREG_FLD_CMNPCSBIST_LOCWREN | + SERDES_IREG_FLD_CMNPCSPSTATE_LOCWREN, + 0); + + al_serdes_grp_reg_masked_write( + grp_info, + AL_SRDS_REG_PAGE_4_COMMON, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_PCS_LOCWREN_REG_NUM, + SERDES_IREG_FLD_PCS_LOCWREN, + 0); + + al_serdes_grp_reg_masked_write( + grp_info, + AL_SRDS_REG_PAGE_4_COMMON, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_CMNPCS_TXENABLE_REG_NUM, + SERDES_IREG_FLD_CMNPCS_TXENABLE, + SERDES_IREG_FLD_CMNPCS_TXENABLE); + + for (i = 0; i < AL_SRDS_NUM_LANES; i++) { + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_LANEPCSPSTATE_LOCWREN_REG_NUM, + SERDES_IREG_FLD_LANEPCSPSTATE_LOCWREN | + SERDES_IREG_FLD_LB_LOCWREN | + SERDES_IREG_FLD_PCSRX_LOCWREN | + SERDES_IREG_FLD_PCSRXBIST_LOCWREN | + SERDES_IREG_FLD_PCSRXEQ_LOCWREN | + SERDES_IREG_FLD_PCSTX_LOCWREN, + 0); + + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_PCSTXBIST_LOCWREN_REG_NUM, + SERDES_IREG_FLD_PCSTXBIST_LOCWREN, + 0); + + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_TX_DRV_OVERRIDE_EN_REG_NUM, + SERDES_IREG_FLD_TX_DRV_OVERRIDE_EN, + 0); + + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_RXLOCK2REF_OVREN_REG_NUM, + SERDES_IREG_FLD_RXLOCK2REF_OVREN, + SERDES_IREG_FLD_RXLOCK2REF_OVREN); + } +} + +/******************************************************************************/ +/******************************************************************************/ +void al_serdes_bist_overrides_disable( + struct al_serdes_obj *obj, + enum al_serdes_group grp) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + int i; + + al_serdes_grp_reg_masked_write( + grp_info, + AL_SRDS_REG_PAGE_4_COMMON, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_CMNPCIEGEN3_LOCWREN_REG_NUM, + SERDES_IREG_FLD_CMNPCSBIST_LOCWREN, + SERDES_IREG_FLD_CMNPCSBIST_LOCWREN); + + for (i = 0; i < AL_SRDS_NUM_LANES; i++) { + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_LANEPCSPSTATE_LOCWREN_REG_NUM, + SERDES_IREG_FLD_LB_LOCWREN | + SERDES_IREG_FLD_PCSRXBIST_LOCWREN, + SERDES_IREG_FLD_LB_LOCWREN | + SERDES_IREG_FLD_PCSRXBIST_LOCWREN); + + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_PCSTXBIST_LOCWREN_REG_NUM, + SERDES_IREG_FLD_PCSTXBIST_LOCWREN, + SERDES_IREG_FLD_PCSTXBIST_LOCWREN); + } +} + +/******************************************************************************/ +/******************************************************************************/ +void al_serdes_rx_rate_change( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_rate rate) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + int i; + + uint8_t rx_rate_val; + + switch (rate) { + case AL_SRDS_RATE_1_8: + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_8; + break; + case AL_SRDS_RATE_1_4: + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_4; + break; + case AL_SRDS_RATE_1_2: + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_2; + break; + case AL_SRDS_RATE_FULL: + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_1; + break; + default: + al_err("%s: invalid rate (%d)\n", __func__, rate); + rx_rate_val = SERDES_IREG_FLD_PCSRX_DIVRATE_VAL_1_1; + break; + } + + for (i = 0; i < AL_SRDS_NUM_LANES; i++) { + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)i, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_PCSRX_DIVRATE_REG_NUM, + SERDES_IREG_FLD_PCSRX_DIVRATE_MASK, + rx_rate_val); + } +} + +/******************************************************************************/ +/******************************************************************************/ +void al_serdes_group_pm_set( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_pm pm) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + + uint8_t pm_val; + + switch (pm) { + case AL_SRDS_PM_PD: + pm_val = SERDES_IREG_FLD_CMNPCSPSTATE_SYNTH_VAL_PD; + break; + case AL_SRDS_PM_P2: + pm_val = SERDES_IREG_FLD_CMNPCSPSTATE_SYNTH_VAL_P2; + break; + case AL_SRDS_PM_P1: + pm_val = SERDES_IREG_FLD_CMNPCSPSTATE_SYNTH_VAL_P1; + break; + case AL_SRDS_PM_P0S: + pm_val = SERDES_IREG_FLD_CMNPCSPSTATE_SYNTH_VAL_P0S; + break; + case AL_SRDS_PM_P0: + pm_val = SERDES_IREG_FLD_CMNPCSPSTATE_SYNTH_VAL_P0; + break; + default: + al_err("%s: invalid power mode (%d)\n", __func__, pm); + al_assert(0); + pm_val = SERDES_IREG_FLD_CMNPCSPSTATE_SYNTH_VAL_P0; + } + + if (pm == AL_SRDS_PM_PD) + al_serdes_group_rx_rate_change_sw_flow_dis(grp_info); + + al_serdes_grp_reg_masked_write( + grp_info, + AL_SRDS_REG_PAGE_4_COMMON, + AL_SRDS_REG_TYPE_PMA, + SERDES_IREG_FLD_CMNPCSPSTATE_SYNTH_REG_NUM, + SERDES_IREG_FLD_CMNPCSPSTATE_SYNTH_MASK, + pm_val); + + if (pm != AL_SRDS_PM_PD) + al_serdes_group_rx_rate_change_sw_flow_en_cond(grp_info); +} + +/******************************************************************************/ +/******************************************************************************/ +void al_serdes_lane_rx_rate_change_sw_flow_en( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane) +{ + al_serdes_lane_write(obj, grp, lane, AL_SRDS_REG_TYPE_PMA, 201, 0xfc); + al_serdes_lane_write(obj, grp, lane, AL_SRDS_REG_TYPE_PMA, 202, 0xff); + al_serdes_lane_write(obj, grp, lane, AL_SRDS_REG_TYPE_PMA, 203, 0xff); + al_serdes_lane_write(obj, grp, lane, AL_SRDS_REG_TYPE_PMA, 204, 0xff); + al_serdes_lane_write(obj, grp, lane, AL_SRDS_REG_TYPE_PMA, 205, 0x7f); + al_serdes_lane_write(obj, grp, lane, AL_SRDS_REG_TYPE_PMA, 205, 0xff); +} + +/******************************************************************************/ +/******************************************************************************/ +void al_serdes_lane_rx_rate_change_sw_flow_dis( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane) +{ + al_serdes_lane_write(obj, grp, lane, AL_SRDS_REG_TYPE_PMA, 205, 0x7f); +} + +/******************************************************************************/ +/******************************************************************************/ +void al_serdes_lane_pcie_rate_override_enable_set( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane, + al_bool en) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)lane, + AL_SRDS_REG_TYPE_PCS, + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_ENA_REG_NUM, + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_ENA, + en ? SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_ENA : 0); +} + +/******************************************************************************/ +/******************************************************************************/ +al_bool al_serdes_lane_pcie_rate_override_is_enabled( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + + return (al_serdes_grp_lane_read( + grp_info, + lane, + AL_SRDS_REG_TYPE_PCS, + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_ENA_REG_NUM) & + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_ENA) ? AL_TRUE : AL_FALSE; +} + +/******************************************************************************/ +/******************************************************************************/ +enum al_serdes_pcie_rate al_serdes_lane_pcie_rate_get( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + + return (al_serdes_grp_reg_read( + grp_info, + (enum al_serdes_reg_page)lane, + AL_SRDS_REG_TYPE_PCS, + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_REG_NUM) & + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_MASK) >> + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_SHIFT; +} + +/******************************************************************************/ +/******************************************************************************/ +void al_serdes_lane_pcie_rate_set( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane, + enum al_serdes_pcie_rate rate) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + + al_serdes_grp_reg_masked_write( + grp_info, + (enum al_serdes_reg_page)lane, + AL_SRDS_REG_TYPE_PCS, + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_REG_NUM, + SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_MASK, + rate << SERDES_IREG_FLD_PCS_VPCSIF_OVR_RATE_SHIFT); +} + +/******************************************************************************/ +/******************************************************************************/ +void al_serdes_lane_pm_set( + struct al_serdes_obj *obj, + enum al_serdes_group grp, + enum al_serdes_lane lane, + enum al_serdes_pm rx_pm, + enum al_serdes_pm tx_pm) +{ + struct al_serdes_group_info *grp_info = &obj->grp_info[grp]; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 26 15:26:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFC96A6E803; Tue, 26 Jan 2016 15:26: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 mx1.freebsd.org (Postfix) with ESMTPS id A68411065; Tue, 26 Jan 2016 15:26: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 u0QFQaeX063366; Tue, 26 Jan 2016 15:26:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QFQatQ063359; Tue, 26 Jan 2016 15:26:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601261526.u0QFQatQ063359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Jan 2016 15:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294839 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux dev/cxgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 15:26:38 -0000 Author: hselasky Date: Tue Jan 26 15:26:35 2016 New Revision: 294839 URL: https://svnweb.freebsd.org/changeset/base/294839 Log: Update and add various macros to the LinuxKPI and resolve a macro redefinition issue in the cxgb driver. MFC after: 1 week Sponsored by: Mellanox Technologies Reviewed by: np @ Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/linux/clocksource.h head/sys/compat/linuxkpi/common/include/linux/completion.h head/sys/compat/linuxkpi/common/include/linux/gfp.h head/sys/compat/linuxkpi/common/include/linux/kernel.h head/sys/dev/cxgb/cxgb_osdep.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Jan 26 15:26:35 2016 (r294839) @@ -35,6 +35,8 @@ #include #include +#define ATOMIC_INIT(x) { .counter = (x) } + typedef struct { volatile int counter; } atomic_t; Modified: head/sys/compat/linuxkpi/common/include/linux/clocksource.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/clocksource.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/linux/clocksource.h Tue Jan 26 15:26:35 2016 (r294839) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,12 +29,13 @@ * $FreeBSD$ */ #ifndef _LINUX_CLOCKSOURCE_H -#define _LINUX_CLOCKSOURCE_H +#define _LINUX_CLOCKSOURCE_H #include +#define CLOCKSOURCE_MASK(x) ((cycle_t)(-1ULL >> ((-(x)) & 63))) + /* clocksource cycle base type */ typedef u64 cycle_t; - -#endif /* _LINUX_CLOCKSOURCE_H */ +#endif /* _LINUX_CLOCKSOURCE_H */ Modified: head/sys/compat/linuxkpi/common/include/linux/completion.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/completion.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/linux/completion.h Tue Jan 26 15:26:35 2016 (r294839) @@ -40,7 +40,9 @@ struct completion { #define INIT_COMPLETION(c) \ ((c).done = 0) #define init_completion(c) \ - ((c)->done = 0) + do { (c)->done = 0; } while (0) +#define reinit_completion(c) \ + do { (c)->done = 0; } while (0) #define complete(c) \ linux_complete_common((c), 0) #define complete_all(c) \ Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Tue Jan 26 15:26:35 2016 (r294839) @@ -54,6 +54,7 @@ #define GFP_HIGHUSER M_WAITOK #define GFP_HIGHUSER_MOVABLE M_WAITOK #define GFP_IOFS M_NOWAIT +#define GFP_NOIO M_NOWAIT static inline void * page_address(struct page *page) Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Jan 26 15:26:35 2016 (r294839) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * Copyright (c) 2014-2015 François Tigeot * All rights reserved. * @@ -159,9 +159,10 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#define simple_strtoul strtoul -#define simple_strtol strtol -#define kstrtol(a,b,c) ({*(c) = strtol(a,0,b);}) +#define simple_strtoul(...) strtoul(__VA_ARGS__) +#define simple_strtol(...) strtol(__VA_ARGS__) +#define kstrtol(a,b,c) ({*(c) = strtol(a,0,b); 0;}) +#define kstrtoint(a,b,c) ({*(c) = strtol(a,0,b); 0;}) #define min(x, y) ((x) < (y) ? (x) : (y)) #define max(x, y) ((x) > (y) ? (x) : (y)) @@ -185,6 +186,7 @@ #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) #define round_down(x, y) ((x) & ~__round_mask(x, y)) +#define smp_processor_id() PCPU_GET(cpuid) #define num_possible_cpus() mp_ncpus #define num_online_cpus() mp_ncpus Modified: head/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- head/sys/dev/cxgb/cxgb_osdep.h Tue Jan 26 15:22:04 2016 (r294838) +++ head/sys/dev/cxgb/cxgb_osdep.h Tue Jan 26 15:26:35 2016 (r294839) @@ -231,7 +231,9 @@ static const int debug_flags = DBG_RX; #define le16_to_cpu(x) le16toh(x) #define cpu_to_le32(x) htole32(x) #define swab32(x) bswap32(x) -#define simple_strtoul strtoul +#ifndef simple_strtoul +#define simple_strtoul(...) strtoul(__VA_ARGS__) +#endif #ifndef LINUX_TYPES_DEFINED From owner-svn-src-head@freebsd.org Tue Jan 26 15:43:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D4C5A6EDB0; Tue, 26 Jan 2016 15:43:21 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::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 E29D01BDE; Tue, 26 Jan 2016 15:43:20 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id q63so103362937pfb.1; Tue, 26 Jan 2016 07:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=9Z0NOVw8oUXuI+x7j5OStC9FBM6IKtjgfN84F63dC6s=; b=SmjaZwIW+PPCuajXyDPfeaSryAIuQzs/MGv+ptxwix/glsBlTPaB2WkVYRF2nxfxxO 48muyfyhlAVWFIawm0u2YSMftW3cI5IvzDsmekWNdo6toYMyDAzsckYebxiJgwoKHuGi l57PfBQYsyxjSLwl8Bl4QcEFBPsUxU0r2jdcBKMLOAyfTOrX0TvVWBFLcJJIbJtUAVWk mDqMrlovJjHKXVkKzUxKGafNgy1w8PeY9vA8jCXphLbdzNR9v2FyeQDi9G9wb1EnNbik ubg/uk5nYLFpmlaBK5ScxMfeJNI5JB71PuctJpdc/Py7qKznXzX//XaBAP+PD0RlI1Dh G2wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=9Z0NOVw8oUXuI+x7j5OStC9FBM6IKtjgfN84F63dC6s=; b=QCigZvRplYj7yJLMdSzO1Rp56mKLAUE5qicF5Dej1LVQhd5CI8IRzUGWQ9x9xtiskJ DKUHdmV1UwwNS0U4CHT4ipzWk0eaqrFTNwaihmtUeIh46UOPuAGH1ZOYcc8/fhJiZA61 29eKASGvIajHM3uBspAD2wHlmarospiMOqfC9YZMHPSpzU65zlafsH+WwdlqEK+0DCgh 21cUnzdbQMJKKewEsQJVdltG1eBcQlvCn7TDyi69Gqt4yHe4yi1uXRA67QawM1oY/8eS OME3POuFvQXg7Wizmvbi+8BK9kAQCglFmeUy1aZb2wp4/Ffw+Ofem4gmeS1iLP86iryT UsTQ== X-Gm-Message-State: AG10YOQmwE2HYvqzkCxlspJx2djJPvv9tL0DQ/AUjAwGYJ6yyQilwU6U1Rh4YOZA1wqH1A== X-Received: by 10.98.89.139 with SMTP id k11mr35119513pfj.82.1453823000532; Tue, 26 Jan 2016 07:43:20 -0800 (PST) Received: from ox ([2601:641:c001:8a00:cd37:2eca:7ecc:734f]) by smtp.gmail.com with ESMTPSA id y26sm2638720pfi.88.2016.01.26.07.43.18 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 26 Jan 2016 07:43:19 -0800 (PST) Sender: Navdeep Parhar Date: Tue, 26 Jan 2016 07:43:12 -0800 From: Navdeep Parhar To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294839 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux dev/cxgb Message-ID: <20160126154312.GD2170@ox> Mail-Followup-To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601261526.u0QFQatQ063359@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601261526.u0QFQatQ063359@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 15:43:21 -0000 On Tue, Jan 26, 2016 at 03:26:36PM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Jan 26 15:26:35 2016 > New Revision: 294839 > URL: https://svnweb.freebsd.org/changeset/base/294839 > > Log: > Update and add various macros to the LinuxKPI and resolve a macro > redefinition issue in the cxgb driver. > > MFC after: 1 week > Sponsored by: Mellanox Technologies > Reviewed by: np @ ^^^^ only the cxgb_osdep.h part. Regards, Navdeep > > Modified: > head/sys/compat/linuxkpi/common/include/asm/atomic.h > head/sys/compat/linuxkpi/common/include/linux/clocksource.h > head/sys/compat/linuxkpi/common/include/linux/completion.h > head/sys/compat/linuxkpi/common/include/linux/gfp.h > head/sys/compat/linuxkpi/common/include/linux/kernel.h > head/sys/dev/cxgb/cxgb_osdep.h > > > > Modified: head/sys/dev/cxgb/cxgb_osdep.h > ============================================================================== > --- head/sys/dev/cxgb/cxgb_osdep.h Tue Jan 26 15:22:04 2016 (r294838) > +++ head/sys/dev/cxgb/cxgb_osdep.h Tue Jan 26 15:26:35 2016 (r294839) > @@ -231,7 +231,9 @@ static const int debug_flags = DBG_RX; > #define le16_to_cpu(x) le16toh(x) > #define cpu_to_le32(x) htole32(x) > #define swab32(x) bswap32(x) > -#define simple_strtoul strtoul > +#ifndef simple_strtoul > +#define simple_strtoul(...) strtoul(__VA_ARGS__) > +#endif > > > #ifndef LINUX_TYPES_DEFINED > From owner-svn-src-head@freebsd.org Tue Jan 26 16:33:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C721A6E26F; Tue, 26 Jan 2016 16:33:40 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC5761647; Tue, 26 Jan 2016 16:33:39 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QGXcqG083561; Tue, 26 Jan 2016 16:33:38 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QGXcdh083557; Tue, 26 Jan 2016 16:33:38 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201601261633.u0QGXcdh083557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Tue, 26 Jan 2016 16:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294840 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 16:33:40 -0000 Author: hiren Date: Tue Jan 26 16:33:38 2016 New Revision: 294840 URL: https://svnweb.freebsd.org/changeset/base/294840 Log: Persist timers TCPTV_PERSMIN and TCPTV_PERSMAX are hardcoded with 5 seconds and 60 seconds, respectively. Turn them into sysctls that can be tuned live. The default values of 5 seconds and 60 seconds have been retained. Submitted by: Jason Wolfe (j at nitrology dot com) Reviewed by: gnn, rrs, hiren, bz MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D5024 Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Jan 26 15:26:35 2016 (r294839) +++ head/sys/netinet/tcp_output.c Tue Jan 26 16:33:38 2016 (r294840) @@ -1626,7 +1626,7 @@ tcp_setpersist(struct tcpcb *tp) * Start/restart persistance timer. */ TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], - TCPTV_PERSMIN, TCPTV_PERSMAX); + tcp_persmin, tcp_persmax); tcp_timer_activate(tp, TT_PERSIST, tt); if (tp->t_rxtshift < TCP_MAXRXTSHIFT) tp->t_rxtshift++; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Jan 26 15:26:35 2016 (r294839) +++ head/sys/netinet/tcp_subr.c Tue Jan 26 16:33:38 2016 (r294840) @@ -675,6 +675,8 @@ tcp_init(void) tcp_rexmit_min = TCPTV_MIN; if (tcp_rexmit_min < 1) tcp_rexmit_min = 1; + tcp_persmin = TCPTV_PERSMIN; + tcp_persmax = TCPTV_PERSMAX; tcp_rexmit_slop = TCPTV_CPU_VAR; tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Jan 26 15:26:35 2016 (r294839) +++ head/sys/netinet/tcp_timer.c Tue Jan 26 16:33:38 2016 (r294840) @@ -77,6 +77,14 @@ __FBSDID("$FreeBSD$"); #include #endif +int tcp_persmin; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmin, CTLTYPE_INT|CTLFLAG_RW, + &tcp_persmin, 0, sysctl_msec_to_ticks, "I", "minimum persistence interval"); + +int tcp_persmax; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmax, CTLTYPE_INT|CTLFLAG_RW, + &tcp_persmax, 0, sysctl_msec_to_ticks, "I", "maximum persistence interval"); + int tcp_keepinit; SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLTYPE_INT|CTLFLAG_RW, &tcp_keepinit, 0, sysctl_msec_to_ticks, "I", "time to establish connection"); Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Tue Jan 26 15:26:35 2016 (r294839) +++ head/sys/netinet/tcp_timer.h Tue Jan 26 16:33:38 2016 (r294840) @@ -77,7 +77,7 @@ if 0, no idea yet */ #define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ -#define TCPTV_PERSMIN ( 5*hz) /* retransmit persistence */ +#define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ #define TCPTV_KEEP_INIT ( 75*hz) /* initial connect keepalive */ @@ -173,6 +173,8 @@ struct tcp_timer { #define TP_KEEPCNT(tp) ((tp)->t_keepcnt ? (tp)->t_keepcnt : tcp_keepcnt) #define TP_MAXIDLE(tp) (TP_KEEPCNT(tp) * TP_KEEPINTVL(tp)) +extern int tcp_persmin; /* minimum persist interval */ +extern int tcp_persmax; /* maximum persist interval */ extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */ From owner-svn-src-head@freebsd.org Tue Jan 26 16:34:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41FF0A6E2D3; Tue, 26 Jan 2016 16:34: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 mx1.freebsd.org (Postfix) with ESMTPS id 061E018D1; Tue, 26 Jan 2016 16:34:28 +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 u0QGYSjt083633; Tue, 26 Jan 2016 16:34:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QGYRon083631; Tue, 26 Jan 2016 16:34:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601261634.u0QGYRon083631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 26 Jan 2016 16:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294841 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 16:34:29 -0000 Author: avos Date: Tue Jan 26 16:34:27 2016 New Revision: 294841 URL: https://svnweb.freebsd.org/changeset/base/294841 Log: rtwn: use ieee80211_restart_all() for device reset Tested by: kevlo Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5057 Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwnreg.h Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Tue Jan 26 16:33:38 2016 (r294840) +++ head/sys/dev/rtwn/if_rtwn.c Tue Jan 26 16:34:27 2016 (r294841) @@ -186,11 +186,9 @@ static void rtwn_iq_calib(struct rtwn_so static void rtwn_lc_calib(struct rtwn_softc *); static void rtwn_temp_calib(struct rtwn_softc *); static void rtwn_init_locked(struct rtwn_softc *); -static void rtwn_init(struct rtwn_softc *); static void rtwn_stop_locked(struct rtwn_softc *); static void rtwn_stop(struct rtwn_softc *); static void rtwn_intr(void *); -static void rtwn_hw_reset(void *, int); /* Aliases. */ #define rtwn_bb_write rtwn_write_4 @@ -295,7 +293,6 @@ rtwn_attach(device_t dev) RTWN_LOCK_INIT(sc); callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0); callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0); - TASK_INIT(&sc->sc_reinit_task, 0, rtwn_hw_reset, sc); mbufq_init(&sc->sc_snd, ifqmaxlen); error = rtwn_read_chipid(sc); @@ -406,7 +403,6 @@ rtwn_detach(device_t dev) int i; if (sc->sc_ic.ic_softc != NULL) { - ieee80211_draintask(&sc->sc_ic, &sc->sc_reinit_task); rtwn_stop(sc); callout_drain(&sc->calib_to); @@ -1899,7 +1895,7 @@ rtwn_watchdog(void *arg) if (sc->sc_tx_timer != 0 && --sc->sc_tx_timer == 0) { ic_printf(ic, "device timeout\n"); - ieee80211_runtask(ic, &sc->sc_reinit_task); + ieee80211_restart_all(ic); return; } callout_reset(&sc->watchdog_to, hz, rtwn_watchdog, sc); @@ -3361,18 +3357,6 @@ fail: } static void -rtwn_init(struct rtwn_softc *sc) -{ - - RTWN_LOCK(sc); - rtwn_init_locked(sc); - RTWN_UNLOCK(sc); - - if (sc->sc_flags & RTWN_RUNNING) - ieee80211_start_all(&sc->sc_ic); -} - -static void rtwn_stop_locked(struct rtwn_softc *sc) { uint16_t reg; @@ -3481,14 +3465,3 @@ rtwn_intr(void *arg) RTWN_UNLOCK(sc); } - -static void -rtwn_hw_reset(void *arg0, int pending) -{ - struct rtwn_softc *sc = arg0; - struct ieee80211com *ic = &sc->sc_ic; - - rtwn_stop(sc); - rtwn_init(sc); - ieee80211_notify_radio(ic, 1); -} Modified: head/sys/dev/rtwn/if_rtwnreg.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnreg.h Tue Jan 26 16:33:38 2016 (r294840) +++ head/sys/dev/rtwn/if_rtwnreg.h Tue Jan 26 16:34:27 2016 (r294841) @@ -1295,7 +1295,6 @@ struct rtwn_softc { bus_size_t sc_mapsize; int sc_cap_off; - struct task sc_reinit_task; struct callout calib_to; struct callout watchdog_to; From owner-svn-src-head@freebsd.org Tue Jan 26 16:51:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16394A6EB97; Tue, 26 Jan 2016 16:51:01 +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 mx1.freebsd.org (Postfix) with ESMTPS id CD99D39E; Tue, 26 Jan 2016 16:51:00 +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 u0QGoxjf086768; Tue, 26 Jan 2016 16:50:59 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QGoxjx086767; Tue, 26 Jan 2016 16:50:59 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601261650.u0QGoxjx086767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 26 Jan 2016 16:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294842 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 16:51:01 -0000 Author: avos Date: Tue Jan 26 16:50:59 2016 New Revision: 294842 URL: https://svnweb.freebsd.org/changeset/base/294842 Log: rtwn: do not start vap when initialization fails - Start vap(s) (via ieee80211_start_all()) only when initialization succeeds; stop the first vap otherwise (via ieee80211_stop()); - Do not try to stop a device multiple times (move (sc->sc_flags & RTWN_RUNNING) check to urtwn_stop_locked()). Tested by: kevlo Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5058 Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Tue Jan 26 16:34:27 2016 (r294841) +++ head/sys/dev/rtwn/if_rtwn.c Tue Jan 26 16:50:59 2016 (r294842) @@ -185,7 +185,7 @@ static void rtwn_iq_calib_write_results( static void rtwn_iq_calib(struct rtwn_softc *); static void rtwn_lc_calib(struct rtwn_softc *); static void rtwn_temp_calib(struct rtwn_softc *); -static void rtwn_init_locked(struct rtwn_softc *); +static int rtwn_init(struct rtwn_softc *); static void rtwn_stop_locked(struct rtwn_softc *); static void rtwn_stop(struct rtwn_softc *); static void rtwn_intr(void *); @@ -1845,19 +1845,15 @@ static void rtwn_parent(struct ieee80211com *ic) { struct rtwn_softc *sc = ic->ic_softc; - int startall = 0; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - RTWN_LOCK(sc); - if (ic->ic_nrunning> 0) { - if (!(sc->sc_flags & RTWN_RUNNING)) { - rtwn_init_locked(sc); - startall = 1; - } - } else if (sc->sc_flags & RTWN_RUNNING) - rtwn_stop_locked(sc); - RTWN_UNLOCK(sc); - if (startall) - ieee80211_start_all(ic); + if (ic->ic_nrunning > 0) { + if (rtwn_init(sc) == 0) + ieee80211_start_all(ic); + else + ieee80211_stop(vap); + } else + rtwn_stop(sc); } static void @@ -3218,8 +3214,8 @@ rtwn_temp_calib(struct rtwn_softc *sc) } } -static void -rtwn_init_locked(struct rtwn_softc *sc) +static int +rtwn_init(struct rtwn_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); @@ -3227,7 +3223,13 @@ rtwn_init_locked(struct rtwn_softc *sc) uint8_t macaddr[IEEE80211_ADDR_LEN]; int i, error; - RTWN_LOCK_ASSERT(sc); + RTWN_LOCK(sc); + + if (sc->sc_flags & RTWN_RUNNING) { + RTWN_UNLOCK(sc); + return 0; + } + sc->sc_flags |= RTWN_RUNNING; /* Init firmware commands ring. */ sc->fwcur = 0; @@ -3347,13 +3349,15 @@ rtwn_init_locked(struct rtwn_softc *sc) /* Enable interrupts. */ rtwn_write_4(sc, R92C_HIMR, RTWN_INT_ENABLE); - sc->sc_flags |= RTWN_RUNNING; - callout_reset(&sc->watchdog_to, hz, rtwn_watchdog, sc); - return; fail: - rtwn_stop_locked(sc); + if (error != 0) + rtwn_stop_locked(sc); + + RTWN_UNLOCK(sc); + + return error; } static void @@ -3364,6 +3368,9 @@ rtwn_stop_locked(struct rtwn_softc *sc) RTWN_LOCK_ASSERT(sc); + if (!(sc->sc_flags & RTWN_RUNNING)) + return; + sc->sc_tx_timer = 0; callout_stop(&sc->watchdog_to); callout_stop(&sc->calib_to); From owner-svn-src-head@freebsd.org Tue Jan 26 18:20:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82EC3A462EE; Tue, 26 Jan 2016 18:20:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EA24199D; Tue, 26 Jan 2016 18:20:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QIKPYg013132; Tue, 26 Jan 2016 18:20:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QIKPaB013131; Tue, 26 Jan 2016 18:20:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601261820.u0QIKPaB013131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 Jan 2016 18:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294844 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 18:20:26 -0000 Author: emaste Date: Tue Jan 26 18:20:25 2016 New Revision: 294844 URL: https://svnweb.freebsd.org/changeset/base/294844 Log: Add STT_SPARC_REGISTER ELF definition MFC after: 1 week Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Tue Jan 26 17:00:31 2016 (r294843) +++ head/sys/sys/elf_common.h Tue Jan 26 18:20:25 2016 (r294844) @@ -771,8 +771,9 @@ typedef struct { #define STT_LOOS 10 /* Reserved range for operating system */ #define STT_GNU_IFUNC 10 #define STT_HIOS 12 /* specific semantics. */ -#define STT_LOPROC 13 /* reserved range for processor */ -#define STT_HIPROC 15 /* specific semantics. */ +#define STT_LOPROC 13 /* Start of processor reserved range. */ +#define STT_SPARC_REGISTER 13 /* SPARC register information. */ +#define STT_HIPROC 15 /* End of processor reserved range. */ /* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */ #define STV_DEFAULT 0x0 /* Default visibility (see binding). */ From owner-svn-src-head@freebsd.org Tue Jan 26 18:39:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B124A46A3E; Tue, 26 Jan 2016 18:39:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 487BDB5C; Tue, 26 Jan 2016 18:39:24 +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 u0QIdNuj019392; Tue, 26 Jan 2016 18:39:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QIdNKO019391; Tue, 26 Jan 2016 18:39:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601261839.u0QIdNKO019391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 18:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294846 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 18:39:24 -0000 Author: imp Date: Tue Jan 26 18:39:23 2016 New Revision: 294846 URL: https://svnweb.freebsd.org/changeset/base/294846 Log: Add a comment about why at is turned off in the exception handler. Only k0 and k1 may be touched until we save registers somewhere. MFC After: 2 days Modified: head/sys/mips/mips/exception.S Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Tue Jan 26 18:32:48 2016 (r294845) +++ head/sys/mips/mips/exception.S Tue Jan 26 18:39:23 2016 (r294846) @@ -177,6 +177,12 @@ MipsDoTLBMiss: VECTOR(MipsException, unknown) /* * Find out what mode we came from and jump to the proper handler. + * + * Note: at turned off here because we cannot trash the at register + * in this exception code. Only k0 and k1 may be modified before + * we save registers. This is true of all functions called through + * the pointer magic: Mips{User,Kern}Intr, Mips{User,Kern}GenException + * and MipsTLBInvalidException */ .set noat mfc0 k0, MIPS_COP_0_STATUS # Get the status register From owner-svn-src-head@freebsd.org Tue Jan 26 18:39:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E365A46A8E; Tue, 26 Jan 2016 18:39:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11CF9C93; Tue, 26 Jan 2016 18:39:32 +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 u0QIdVuI019439; Tue, 26 Jan 2016 18:39:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QIdUZ1019437; Tue, 26 Jan 2016 18:39:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601261839.u0QIdUZ1019437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 18:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294847 - in head/sys/boot: mips/beri/boot2 pc98/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 18:39:32 -0000 Author: imp Date: Tue Jan 26 18:39:30 2016 New Revision: 294847 URL: https://svnweb.freebsd.org/changeset/base/294847 Log: Remove static from these two. They slipped through the cracks. MFC After: 1 week Modified: head/sys/boot/mips/beri/boot2/boot2.c head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/mips/beri/boot2/boot2.c ============================================================================== --- head/sys/boot/mips/beri/boot2/boot2.c Tue Jan 26 18:39:23 2016 (r294846) +++ head/sys/boot/mips/beri/boot2/boot2.c Tue Jan 26 18:39:30 2016 (r294847) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; #if 0 static int comspeed = SIOSPD; #endif Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Tue Jan 26 18:39:23 2016 (r294846) +++ head/sys/boot/pc98/boot2/boot2.c Tue Jan 26 18:39:30 2016 (r294847) @@ -104,7 +104,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; -static uint32_t opts; +uint32_t opts; static struct bootinfo bootinfo; #if SERIAL static int comspeed = SIOSPD; From owner-svn-src-head@freebsd.org Tue Jan 26 18:39:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34CC5A46A98; Tue, 26 Jan 2016 18:39:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07200CA1; Tue, 26 Jan 2016 18:39:32 +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 u0QIdWXQ019482; Tue, 26 Jan 2016 18:39:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QIdW1U019481; Tue, 26 Jan 2016 18:39:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601261839.u0QIdW1U019481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 26 Jan 2016 18:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294848 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 18:39:33 -0000 Author: imp Date: Tue Jan 26 18:39:31 2016 New Revision: 294848 URL: https://svnweb.freebsd.org/changeset/base/294848 Log: Default NANO_DRIVE to ada0 not ad0. This shouldn't affect working configs (since they'd have to change NANO_DRIVE to be ada0 to work), but will fix old ones that used to work. MFC After: 1 week Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Tue Jan 26 18:39:30 2016 (r294847) +++ head/tools/tools/nanobsd/defaults.sh Tue Jan 26 18:39:31 2016 (r294848) @@ -93,7 +93,7 @@ NANO_LATE_CUSTOMIZE="" NANO_NEWFS="-b 4096 -f 512 -i 8192 -U" # The drive name of the media at runtime -NANO_DRIVE=ad0 +NANO_DRIVE=ada0 # Target media size in 512 bytes sectors NANO_MEDIASIZE=2000000 From owner-svn-src-head@freebsd.org Tue Jan 26 19:07:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA8F6A6E729; Tue, 26 Jan 2016 19:07:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7115E277; Tue, 26 Jan 2016 19:07:13 +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 u0QJ7CRa028514; Tue, 26 Jan 2016 19:07:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QJ7A4r028489; Tue, 26 Jan 2016 19:07:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601261907.u0QJ7A4r028489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 26 Jan 2016 19:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294849 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 19:07:14 -0000 Author: jhb Date: Tue Jan 26 19:07:09 2016 New Revision: 294849 URL: https://svnweb.freebsd.org/changeset/base/294849 Log: Add support to libsysdecode for decoding system call names. A new sysdecode_syscallname() function accepts a system call code and returns a string of the corresponding name (or NULL if the code is unknown). To support different process ABIs, the new function accepts a value from a new sysdecode_abi enum as its first argument to select the ABI in use. Current ABIs supported include FREEBSD (native binaries), FREEBSD32, LINUX, LINUX32, and CLOUDABI64. Note that not all ABIs are supported by all platforms. In general, a given ABI is only supported if a platform can execute binaries for that ABI. To simplify the implementation, libsysdecode's build reuses the existing pre-generated files from the kernel source tree rather than duplicating new copies of said files during the build. kdump(1) and truss(1) now use these functions to map system call identifiers to names. For kdump(1), a new 'syscallname()' function consolidates duplicated code from ktrsyscall() and ktrsyscallret(). The Linux ABI no longer requires custom handling for ktrsyscall() and linux_ktrsyscall() has been removed as a result. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4823 Added: head/lib/libsysdecode/syscallnames.c (contents, props changed) head/lib/libsysdecode/sysdecode_syscallnames.3 (contents, props changed) Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c head/usr.bin/truss/Makefile head/usr.bin/truss/aarch64-cloudabi64.c head/usr.bin/truss/aarch64-freebsd.c head/usr.bin/truss/amd64-cloudabi64.c head/usr.bin/truss/amd64-freebsd.c head/usr.bin/truss/amd64-freebsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-freebsd.c head/usr.bin/truss/i386-freebsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/main.c head/usr.bin/truss/mips-freebsd.c head/usr.bin/truss/powerpc-freebsd.c head/usr.bin/truss/powerpc64-freebsd.c head/usr.bin/truss/powerpc64-freebsd32.c head/usr.bin/truss/setup.c head/usr.bin/truss/sparc64-freebsd.c head/usr.bin/truss/truss.h Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Tue Jan 26 18:39:31 2016 (r294848) +++ head/lib/libsysdecode/Makefile Tue Jan 26 19:07:09 2016 (r294849) @@ -4,11 +4,14 @@ LIB= sysdecode -SRCS= ioctl.c utrace.c +SRCS= ioctl.c syscallnames.c utrace.c INCS= sysdecode.h +CFLAGS+= -I${.CURDIR}/../../sys + MAN+= sysdecode.3 \ sysdecode_ioctlname.3 \ + sysdecode_syscallnames.3 \ sysdecode_utrace.3 CLEANFILES= ioctl.c @@ -23,6 +26,10 @@ CFLAGS+=-DPF # Workaround duplicate declarations in CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls + +# Workaround warning for unused ssi_cables[] in +CFLAGS.gcc.ioctl.c+= -Wno-unused + CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} ioctl.c: mkioctls Added: head/lib/libsysdecode/syscallnames.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/syscallnames.c Tue Jan 26 19:07:09 2016 (r294849) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2015 John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Map system call codes to names for the supported ABIs on each + * platform. Rather than regnerating system call name tables locally + * during the build, use the generated tables in the kernel source + * tree. + */ + +#include +#include +#include + +static +#include + +#if defined(__amd64__) || defined(__powerpc64__) +static +#include +#endif + +#if defined(__amd64__) || defined(__i386__) +static +#ifdef __amd64__ +#include +#else +#include +#endif +#endif + +#ifdef __amd64__ +static +#include +#endif + +#if defined(__amd64__) || defined(__aarch64__) +static +#include +#endif + +const char * +sysdecode_syscallname(enum sysdecode_abi abi, unsigned int code) +{ + + switch (abi) { + case FREEBSD: + if (code < nitems(syscallnames)) + return (syscallnames[code]); + break; +#if defined(__amd64__) || defined(__powerpc64__) + case FREEBSD32: + if (code < nitems(freebsd32_syscallnames)) + return (freebsd32_syscallnames[code]); + break; +#endif +#if defined(__amd64__) || defined(__i386__) + case LINUX: + if (code < nitems(linux_syscallnames)) + return (linux_syscallnames[code]); + break; +#endif +#ifdef __amd64__ + case LINUX32: + if (code < nitems(linux32_syscallnames)) + return (linux32_syscallnames[code]); + break; +#endif +#if defined(__amd64__) || defined(__aarch64__) + case CLOUDABI64: + if (code < nitems(cloudabi64_syscallnames)) + return (cloudabi64_syscallnames[code]); + break; +#endif + default: + break; + } + return (NULL); +} Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Tue Jan 26 18:39:31 2016 (r294848) +++ head/lib/libsysdecode/sysdecode.3 Tue Jan 26 19:07:09 2016 (r294849) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2015 +.Dd January 24, 2016 .Dt SYSDECODE 3 .Os .Sh NAME @@ -38,8 +38,34 @@ The .Nm library includes several functions that provide descriptive names of values associated with system calls. +.Ss Supported ABIs +Some functions in this library provide ABI-specific descriptions. +The supported ABIs are named by the +.Vt enum sysdecode_abi +enumeration. +.Pp +.Bl -tag -width "Li UNKNOWN_ABI" -compact +.It Li FREEBSD +Native FreeBSD binaries. +Supported on all platforms. +.It Li FREEBSD32 +32-bit FreeBSD binaries. +Supported on amd64 and powerpc64. +.It Li LINUX +Linux binaries of the same platform. +Supported on amd64 and i386. +.It Li LINUX32 +32-bit Linux binaries. +Supported on amd64. +.It Li CLOUDABI64 +64-bit CloudABI binaries. +Supported on aarch64 and amd64. +.It Li UNKNOWN_ABI +A placeholder for use when the ABI is not known. +.El .Sh SEE ALSO .Xr sysdecode_ioctlname 3 , +.Xr sysdecode_syscallnames 3 , .Xr sysdecode_utrace 3 .Sh HISTORY The Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Tue Jan 26 18:39:31 2016 (r294848) +++ head/lib/libsysdecode/sysdecode.h Tue Jan 26 19:07:09 2016 (r294849) @@ -29,7 +29,17 @@ #ifndef __SYSDECODE_H__ #define __SYSDECODE_H__ +enum sysdecode_abi { + UNKNOWN_ABI = 0, + FREEBSD, + FREEBSD32, + LINUX, + LINUX32, + CLOUDABI64 +}; + const char *sysdecode_ioctlname(unsigned long _val); +const char *sysdecode_syscallname(enum sysdecode_abi _abi, unsigned int _code); int sysdecode_utrace(FILE *_fp, void *_buf, size_t _len); #endif /* !__SYSDECODE_H__ */ Added: head/lib/libsysdecode/sysdecode_syscallnames.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode_syscallnames.3 Tue Jan 26 19:07:09 2016 (r294849) @@ -0,0 +1,67 @@ +.\" +.\" Copyright (c) 2016 John Baldwin +.\" 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 January 24, 2016 +.Dt sysdecode_syscallnames 3 +.Os +.Sh NAME +.Nm sysdecode_syscallnames +.Nd lookup name of system calls +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.Ft const char * +.Fn sysdecode_syscallnames "enum sysdecode_abi abi" "unsigned int code" +.Sh DESCRIPTION +This function returns a pointer to the name of a system call identified by +.Fa code +for the process ABI +.Fa abi . +If +.Fa code +specifies an unknown system call or +.Fa abi +is an unsupported ABI, +.Nm +returns +.Dv NULL . +.Pp +For the list of supported ABIs, +see +.Xr sysdecode 3 . +.Sh RETURN VALUES +The +.Nm +function returns a pointer to a string on success or +.Dv NULL +if either +.Fa code +or +.Fa ABI +is invalid . +.Sh SEE ALSO +.Xr sysdecode 3 Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/kdump/Makefile Tue Jan 26 19:07:09 2016 (r294849) @@ -19,25 +19,6 @@ NO_WERROR?= YES CLEANFILES= kdump_subr.c kdump_subr.h -.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386") -beforedepend: linux_syscalls.c - -CLEANFILES+= linux_syscalls.c -kdump.o: linux_syscalls.c -linux_syscalls.c: linux_syscalls.conf - sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \ - ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux/syscalls.master ${.CURDIR}/linux_syscalls.conf -.endif -.if (${MACHINE_ARCH} == "amd64") -beforedepend: linux32_syscalls.c - -CLEANFILES+= linux32_syscalls.c -kdump.o: linux32_syscalls.c -linux32_syscalls.c: linux32_syscalls.conf - sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \ - ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux32/syscalls.master ${.CURDIR}/linux32_syscalls.conf -.endif - kdump_subr.h: mksubr sh ${.CURDIR}/mksubr ${DESTDIR}${INCLUDEDIR} | \ sed -n 's/^\([a-z].*)\)$$/void \1;/p' >${.TARGET} Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/kdump/kdump.c Tue Jan 26 19:07:09 2016 (r294849) @@ -122,8 +122,7 @@ void usage(void); #define TIMESTAMP_ELAPSED 0x2 #define TIMESTAMP_RELATIVE 0x4 -extern const char *signames[], *syscallnames[]; -extern int nsyscalls; +extern const char *signames[]; static int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, resolv = 0, abiflag = 0, syscallno = 0; @@ -145,11 +144,7 @@ static struct ktr_header ktr_header; #if defined(__amd64__) || defined(__i386__) -void linux_ktrsyscall(struct ktr_syscall *, u_int); void linux_ktrsysret(struct ktr_sysret *, u_int); -extern const char *linux_syscallnames[]; - -#include /* * from linux.h @@ -169,12 +164,6 @@ static int bsd_to_linux_errno[ELAST + 1] }; #endif -#if defined(__amd64__) -extern const char *linux32_syscallnames[]; - -#include -#endif - struct proc_info { TAILQ_ENTRY(proc_info) info; @@ -401,13 +390,7 @@ main(int argc, char *argv[]) drop_logged = 0; switch (ktr_header.ktr_type) { case KTR_SYSCALL: -#if defined(__amd64__) || defined(__i386__) - if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX) - linux_ktrsyscall((struct ktr_syscall *)m, - sv_flags); - else -#endif - ktrsyscall((struct ktr_syscall *)m, sv_flags); + ktrsyscall((struct ktr_syscall *)m, sv_flags); break; case KTR_SYSRET: #if defined(__amd64__) || defined(__i386__) @@ -687,10 +670,6 @@ dumpheader(struct ktr_header *kth) } #include -#define KTRACE -#include -#undef KTRACE -int nsyscalls = sizeof (syscallnames) / sizeof (syscallnames[0]); static void ioctlname(unsigned long val) @@ -706,26 +685,57 @@ ioctlname(unsigned long val) printf("%#lx", val); } +static enum sysdecode_abi +syscallabi(u_int sv_flags) +{ + + if (sv_flags == 0) + return (FREEBSD); + switch (sv_flags & SV_ABI_MASK) { + case SV_ABI_FREEBSD: + return (FREEBSD); +#if defined(__amd64__) || defined(__i386__) + case SV_ABI_LINUX: +#ifdef __amd64__ + if (sv_flags & SV_ILP32) + return (LINUX32); +#endif + return (LINUX); +#endif + default: + return (UNKNOWN_ABI); + } +} + +static void +syscallname(u_int code, u_int sv_flags) +{ + const char *name; + + name = sysdecode_syscallname(syscallabi(sv_flags), code); + if (name == NULL) + printf("[%d]", code); + else { + printf("%s", name); + if (syscallno) + printf("[%d]", code); + } +} + void -ktrsyscall(struct ktr_syscall *ktr, u_int flags) +ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) { int narg = ktr->ktr_narg; register_t *ip; intmax_t arg; - if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) || - (ktr->ktr_code >= nsyscalls || ktr->ktr_code < 0)) - printf("[%d]", ktr->ktr_code); - else { - printf("%s", syscallnames[ktr->ktr_code]); - if (syscallno) - printf("[%d]", ktr->ktr_code); - } + syscallname(ktr->ktr_code, sv_flags); ip = &ktr->ktr_args[0]; if (narg) { char c = '('; if (fancy && - (flags == 0 || (flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) { + (sv_flags == 0 || + (sv_flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) { switch (ktr->ktr_code) { case SYS_bindat: case SYS_connectat: @@ -1332,21 +1342,13 @@ ktrsyscall(struct ktr_syscall *ktr, u_in } void -ktrsysret(struct ktr_sysret *ktr, u_int flags) +ktrsysret(struct ktr_sysret *ktr, u_int sv_flags) { register_t ret = ktr->ktr_retval; int error = ktr->ktr_error; - int code = ktr->ktr_code; - if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) || - (code >= nsyscalls || code < 0)) - printf("[%d] ", code); - else { - printf("%s", syscallnames[code]); - if (syscallno) - printf("[%d]", code); - printf(" "); - } + syscallname(ktr->ktr_code, sv_flags); + printf(" "); if (error == 0) { if (fancy) { @@ -1851,56 +1853,14 @@ ktrfaultend(struct ktr_faultend *ktr) } #if defined(__amd64__) || defined(__i386__) - -#if defined(__amd64__) -#define NLINUX_SYSCALLS(v) ((v) & SV_ILP32 ? \ - nitems(linux32_syscallnames) : nitems(linux_syscallnames)) -#define LINUX_SYSCALLNAMES(v, i) ((v) & SV_ILP32 ? \ - linux32_syscallnames[i] : linux_syscallnames[i]) -#else -#define NLINUX_SYSCALLS(v) (nitems(linux_syscallnames)) -#define LINUX_SYSCALLNAMES(v, i) (linux_syscallnames[i]) -#endif - -void -linux_ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) -{ - int narg = ktr->ktr_narg; - unsigned code = ktr->ktr_code; - register_t *ip; - - if (ktr->ktr_code < 0 || code >= NLINUX_SYSCALLS(sv_flags)) - printf("[%d]", ktr->ktr_code); - else { - printf("%s", LINUX_SYSCALLNAMES(sv_flags, ktr->ktr_code)); - if (syscallno) - printf("[%d]", ktr->ktr_code); - } - ip = &ktr->ktr_args[0]; - if (narg) { - char c = '('; - while (narg > 0) - print_number(ip, narg, c); - putchar(')'); - } - putchar('\n'); -} - void linux_ktrsysret(struct ktr_sysret *ktr, u_int sv_flags) { register_t ret = ktr->ktr_retval; - unsigned code = ktr->ktr_code; int error = ktr->ktr_error; - if (ktr->ktr_code < 0 || code >= NLINUX_SYSCALLS(sv_flags)) - printf("[%d] ", ktr->ktr_code); - else { - printf("%s ", LINUX_SYSCALLNAMES(sv_flags, code)); - if (syscallno) - printf("[%d]", code); - printf(" "); - } + syscallname(ktr->ktr_code, sv_flags); + printf(" "); if (error == 0) { if (fancy) { Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/Makefile Tue Jan 26 19:07:09 2016 (r294849) @@ -8,13 +8,6 @@ LIBADD= sysdecode CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys -# Define where to generate syscalls for each ABI. -ABI_SYSPATH.freebsd= sys/kern -ABI_SYSPATH.freebsd32= sys/compat/freebsd32 -ABI_SYSPATH.cloudabi64= sys/compat/cloudabi64 -ABI_SYSPATH.i386-linux= sys/i386/linux -ABI_SYSPATH.amd64-linux32= sys/amd64/linux32 - ABIS+= freebsd # Each ABI is expected to have an ABI.c, MACHINE_ARCH-ABI.c or # MACHINE_CPUARCH-ABI.c file that will be used to map the syscall arguments. @@ -42,21 +35,7 @@ ABI_SRCS= ${abi}.c ${MACHINE_ARCH}-${abi abi_src= ${f} .endif .endfor -SRCS:= ${SRCS} ${abi_src} ${abi}_syscalls.h -CLEANFILES+= ${abi}_syscalls.conf ${abi}_syscalls.master ${abi}_syscalls.h -${abi}_syscalls.conf: ${.CURDIR}/makesyscallsconf.sh - /bin/sh ${.CURDIR}/makesyscallsconf.sh ${abi} ${.TARGET} - -${abi}_syscalls.master: ${.CURDIR:H:H}/${ABI_SYSPATH.${abi}}/syscalls.master - cp -f ${.ALLSRC} ${.TARGET} - -${abi}_syscalls.h: ${abi}_syscalls.master ${abi}_syscalls.conf \ - ${.CURDIR:H:H}/sys/kern/makesyscalls.sh - /bin/sh ${.CURDIR:H:H}/sys/kern/makesyscalls.sh \ - ${abi}_syscalls.master ${abi}_syscalls.conf -# Eliminate compiler warning about non-static global. - sed -i '' '/^const char \*/s/^/static /' ${.TARGET}.tmp - mv ${.TARGET}.tmp ${.TARGET} +SRCS:= ${SRCS} ${abi_src} .endfor .include Modified: head/usr.bin/truss/aarch64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/aarch64-cloudabi64.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/aarch64-cloudabi64.c Tue Jan 26 19:07:09 2016 (r294849) @@ -33,9 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "cloudabi.h" -#include "cloudabi64_syscalls.h" #include "truss.h" static int @@ -81,8 +81,7 @@ aarch64_cloudabi64_fetch_retval(struct t static struct procabi aarch64_cloudabi64 = { "CloudABI ELF64", - syscallnames, - nitems(syscallnames), + CLOUDABI64, aarch64_cloudabi64_fetch_args, aarch64_cloudabi64_fetch_retval }; Modified: head/usr.bin/truss/aarch64-freebsd.c ============================================================================== --- head/usr.bin/truss/aarch64-freebsd.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/aarch64-freebsd.c Tue Jan 26 19:07:09 2016 (r294849) @@ -39,11 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd_syscalls.h" - static int aarch64_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -100,8 +99,7 @@ aarch64_fetch_retval(struct trussinfo *t static struct procabi aarch64_freebsd = { "FreeBSD ELF64", - syscallnames, - nitems(syscallnames), + FREEBSD, aarch64_fetch_args, aarch64_fetch_retval }; Modified: head/usr.bin/truss/amd64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/amd64-cloudabi64.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/amd64-cloudabi64.c Tue Jan 26 19:07:09 2016 (r294849) @@ -33,9 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "cloudabi.h" -#include "cloudabi64_syscalls.h" #include "truss.h" static int @@ -90,8 +90,7 @@ amd64_cloudabi64_fetch_retval(struct tru static struct procabi amd64_cloudabi64 = { "CloudABI ELF64", - syscallnames, - nitems(syscallnames), + CLOUDABI64, amd64_cloudabi64_fetch_args, amd64_cloudabi64_fetch_retval }; Modified: head/usr.bin/truss/amd64-freebsd.c ============================================================================== --- head/usr.bin/truss/amd64-freebsd.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/amd64-freebsd.c Tue Jan 26 19:07:09 2016 (r294849) @@ -41,11 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd_syscalls.h" - static int amd64_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -122,8 +121,7 @@ amd64_fetch_retval(struct trussinfo *tru static struct procabi amd64_freebsd = { "FreeBSD ELF64", - syscallnames, - nitems(syscallnames), + FREEBSD, amd64_fetch_args, amd64_fetch_retval }; Modified: head/usr.bin/truss/amd64-freebsd32.c ============================================================================== --- head/usr.bin/truss/amd64-freebsd32.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/amd64-freebsd32.c Tue Jan 26 19:07:09 2016 (r294849) @@ -42,11 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd32_syscalls.h" - static int amd64_freebsd32_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -118,8 +117,7 @@ amd64_freebsd32_fetch_retval(struct trus static struct procabi amd64_freebsd32 = { "FreeBSD ELF32", - syscallnames, - nitems(syscallnames), + FREEBSD32, amd64_freebsd32_fetch_args, amd64_freebsd32_fetch_retval }; @@ -128,8 +126,7 @@ PROCABI(amd64_freebsd32); static struct procabi amd64_freebsd32_aout = { "FreeBSD a.out", - syscallnames, - nitems(syscallnames), + FREEBSD32, amd64_freebsd32_fetch_args, amd64_freebsd32_fetch_retval }; Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/amd64-linux32.c Tue Jan 26 19:07:09 2016 (r294849) @@ -40,11 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "amd64-linux32_syscalls.h" - static int amd64_linux32_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -132,8 +131,7 @@ amd64_linux32_fetch_retval(struct trussi static struct procabi amd64_linux32 = { "Linux ELF32", - syscallnames, - nitems(syscallnames), + LINUX32, amd64_linux32_fetch_args, amd64_linux32_fetch_retval }; Modified: head/usr.bin/truss/arm-freebsd.c ============================================================================== --- head/usr.bin/truss/arm-freebsd.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/arm-freebsd.c Tue Jan 26 19:07:09 2016 (r294849) @@ -42,11 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd_syscalls.h" - static int arm_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -129,8 +128,7 @@ arm_fetch_retval(struct trussinfo *truss static struct procabi arm_freebsd = { "FreeBSD ELF32", - syscallnames, - nitems(syscallnames), + FREEBSD, arm_fetch_args, arm_fetch_retval }; Modified: head/usr.bin/truss/i386-freebsd.c ============================================================================== --- head/usr.bin/truss/i386-freebsd.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/i386-freebsd.c Tue Jan 26 19:07:09 2016 (r294849) @@ -41,11 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd_syscalls.h" - static int i386_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -111,8 +110,7 @@ i386_fetch_retval(struct trussinfo *trus static struct procabi i386_freebsd = { "FreeBSD ELF32", - syscallnames, - nitems(syscallnames), + FREEBSD, i386_fetch_args, i386_fetch_retval }; @@ -121,8 +119,7 @@ PROCABI(i386_freebsd); static struct procabi i386_freebsd_aout = { "FreeBSD a.out", - syscallnames, - nitems(syscallnames), + FREEBSD, i386_fetch_args, i386_fetch_retval }; Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/i386-linux.c Tue Jan 26 19:07:09 2016 (r294849) @@ -40,11 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "i386-linux_syscalls.h" - static int i386_linux_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -131,8 +130,7 @@ i386_linux_fetch_retval(struct trussinfo static struct procabi i386_linux = { "Linux ELF32", - syscallnames, - nitems(syscallnames), + LINUX, i386_linux_fetch_args, i386_linux_fetch_retval }; Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/main.c Tue Jan 26 19:07:09 2016 (r294849) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/usr.bin/truss/mips-freebsd.c ============================================================================== --- head/usr.bin/truss/mips-freebsd.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/mips-freebsd.c Tue Jan 26 19:07:09 2016 (r294849) @@ -41,11 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd_syscalls.h" - static int mips_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -132,8 +131,7 @@ static struct procabi mips_freebsd = { #else "FreeBSD ELF32", #endif - syscallnames, - nitems(syscallnames), + FREEBSD, mips_fetch_args, mips_fetch_retval }; Modified: head/usr.bin/truss/powerpc-freebsd.c ============================================================================== --- head/usr.bin/truss/powerpc-freebsd.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/powerpc-freebsd.c Tue Jan 26 19:07:09 2016 (r294849) @@ -37,11 +37,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd_syscalls.h" - static int powerpc_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -113,8 +112,7 @@ powerpc_fetch_retval(struct trussinfo *t static struct procabi powerpc_freebsd = { "FreeBSD ELF32", - syscallnames, - nitems(syscallnames), + FREEBSD, powerpc_fetch_args, powerpc_fetch_retval }; Modified: head/usr.bin/truss/powerpc64-freebsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-freebsd.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/powerpc64-freebsd.c Tue Jan 26 19:07:09 2016 (r294849) @@ -37,11 +37,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd_syscalls.h" - static int powerpc64_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -109,8 +108,7 @@ powerpc64_fetch_retval(struct trussinfo static struct procabi powerpc64_freebsd = { "FreeBSD ELF64", - syscallnames, - nitems(syscallnames), + FREEBSD, powerpc64_fetch_args, powerpc64_fetch_retval }; Modified: head/usr.bin/truss/powerpc64-freebsd32.c ============================================================================== --- head/usr.bin/truss/powerpc64-freebsd32.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/powerpc64-freebsd32.c Tue Jan 26 19:07:09 2016 (r294849) @@ -37,11 +37,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd32_syscalls.h" - static int powerpc64_freebsd32_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -118,8 +117,7 @@ powerpc64_freebsd32_fetch_retval(struct static struct procabi powerpc64_freebsd32 = { "FreeBSD ELF32", - syscallnames, - nitems(syscallnames), + FREEBSD32, powerpc64_freebsd32_fetch_args, powerpc64_freebsd32_fetch_retval }; Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/setup.c Tue Jan 26 19:07:09 2016 (r294849) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -335,8 +336,7 @@ enter_syscall(struct trussinfo *info, st return; } - if (t->cs.number >= 0 && t->cs.number < t->proc->abi->nsyscalls) - t->cs.name = t->proc->abi->syscallnames[t->cs.number]; + t->cs.name = sysdecode_syscallname(t->proc->abi->abi, t->cs.number); if (t->cs.name == NULL) fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n", t->proc->abi->type, t->cs.number); Modified: head/usr.bin/truss/sparc64-freebsd.c ============================================================================== --- head/usr.bin/truss/sparc64-freebsd.c Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/sparc64-freebsd.c Tue Jan 26 19:07:09 2016 (r294849) @@ -43,11 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "truss.h" -#include "freebsd_syscalls.h" - static int sparc64_fetch_args(struct trussinfo *trussinfo, u_int narg) { @@ -116,8 +115,7 @@ sparc64_fetch_retval(struct trussinfo *t static struct procabi sparc64_freebsd = { "FreeBSD ELF64", - syscallnames, - nitems(syscallnames), + FREEBSD, sparc64_fetch_args, sparc64_fetch_retval }; Modified: head/usr.bin/truss/truss.h ============================================================================== --- head/usr.bin/truss/truss.h Tue Jan 26 18:39:31 2016 (r294848) +++ head/usr.bin/truss/truss.h Tue Jan 26 19:07:09 2016 (r294849) @@ -41,8 +41,7 @@ struct trussinfo; struct procabi { const char *type; - const char **syscallnames; - int nsyscalls; + enum sysdecode_abi abi; int (*fetch_args)(struct trussinfo *, u_int); int (*fetch_retval)(struct trussinfo *, long *, int *); }; From owner-svn-src-head@freebsd.org Tue Jan 26 21:24:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 121D9A6F915; Tue, 26 Jan 2016 21:24:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0E37FB0; Tue, 26 Jan 2016 21:24:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QLOneY071840; Tue, 26 Jan 2016 21:24:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QLOn5W071839; Tue, 26 Jan 2016 21:24:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601262124.u0QLOn5W071839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 26 Jan 2016 21:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294851 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 21:24:51 -0000 Author: jhb Date: Tue Jan 26 21:24:49 2016 New Revision: 294851 URL: https://svnweb.freebsd.org/changeset/base/294851 Log: Various style fixes. - Wrap long lines. - Fix indentation. - Remove excessive parens. - Whitespace fixes in struct definitions. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5025 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Tue Jan 26 20:45:41 2016 (r294850) +++ head/sys/kern/vfs_aio.c Tue Jan 26 21:24:49 2016 (r294851) @@ -125,17 +125,16 @@ FEATURE(aio, "Asynchronous I/O"); static MALLOC_DEFINE(M_LIO, "lio", "listio aio control block list"); -static SYSCTL_NODE(_vfs, OID_AUTO, aio, CTLFLAG_RW, 0, "Async IO management"); +static SYSCTL_NODE(_vfs, OID_AUTO, aio, CTLFLAG_RW, 0, + "Async IO management"); static int max_aio_procs = MAX_AIO_PROCS; -SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_procs, - CTLFLAG_RW, &max_aio_procs, 0, - "Maximum number of kernel processes to use for handling async IO "); +SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_procs, CTLFLAG_RW, &max_aio_procs, 0, + "Maximum number of kernel processes to use for handling async IO "); static int num_aio_procs = 0; -SYSCTL_INT(_vfs_aio, OID_AUTO, num_aio_procs, - CTLFLAG_RD, &num_aio_procs, 0, - "Number of presently active kernel processes for async IO"); +SYSCTL_INT(_vfs_aio, OID_AUTO, num_aio_procs, CTLFLAG_RD, &num_aio_procs, 0, + "Number of presently active kernel processes for async IO"); /* * The code will adjust the actual number of AIO processes towards this @@ -143,7 +142,8 @@ SYSCTL_INT(_vfs_aio, OID_AUTO, num_aio_p */ static int target_aio_procs = TARGET_AIO_PROCS; SYSCTL_INT(_vfs_aio, OID_AUTO, target_aio_procs, CTLFLAG_RW, &target_aio_procs, - 0, "Preferred number of ready kernel processes for async IO"); + 0, + "Preferred number of ready kernel processes for async IO"); static int max_queue_count = MAX_AIO_QUEUE; SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_queue, CTLFLAG_RW, &max_queue_count, 0, @@ -172,7 +172,8 @@ SYSCTL_INT(_vfs_aio, OID_AUTO, unloadabl static int max_aio_per_proc = MAX_AIO_PER_PROC; SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_per_proc, CTLFLAG_RW, &max_aio_per_proc, - 0, "Maximum active aio requests per process (stored in the process)"); + 0, + "Maximum active aio requests per process (stored in the process)"); static int max_aio_queue_per_proc = MAX_AIO_QUEUE_PER_PROC; SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_queue_per_proc, CTLFLAG_RW, @@ -231,7 +232,7 @@ struct aiocblist { struct vm_page *pages[btoc(MAXPHYS)+1]; /* BIO backend pages */ int npages; /* BIO backend number of pages */ struct proc *userproc; /* (*) user process */ - struct ucred *cred; /* (*) active credential when created */ + struct ucred *cred; /* (*) active credential when created */ struct file *fd_file; /* (*) pointer to file structure */ struct aioliojob *lio; /* (*) optional lio job */ struct aiocb *uuaiocb; /* (*) pointer in userspace of aiocb */ @@ -254,9 +255,9 @@ struct aiocblist { #define AIOP_FREE 0x1 /* proc on free queue */ struct aioproc { - int aioprocflags; /* (c) AIO proc flags */ + int aioprocflags; /* (c) AIO proc flags */ TAILQ_ENTRY(aioproc) list; /* (c) list of processes */ - struct proc *aioproc; /* (*) the AIO proc */ + struct proc *aioproc; /* (*) the AIO proc */ }; /* @@ -268,7 +269,7 @@ struct aioliojob { int lioj_finished_count; /* (a) listio flags */ struct sigevent lioj_signal; /* (a) signal on all I/O done */ TAILQ_ENTRY(aioliojob) lioj_list; /* (a) lio list */ - struct knlist klist; /* (a) list of knotes */ + struct knlist klist; /* (a) list of knotes */ ksiginfo_t lioj_ksi; /* (a) Realtime signal info */ }; @@ -280,7 +281,7 @@ struct aioliojob { * per process aio data structure */ struct kaioinfo { - struct mtx kaio_mtx; /* the lock to protect this struct */ + struct mtx kaio_mtx; /* the lock to protect this struct */ int kaio_flags; /* (a) per process kaio flags */ int kaio_maxactive_count; /* (*) maximum number of AIOs */ int kaio_active_count; /* (c) number of currently used AIOs */ @@ -288,13 +289,13 @@ struct kaioinfo { int kaio_count; /* (a) size of AIO queue */ int kaio_ballowed_count; /* (*) maximum number of buffers */ int kaio_buffer_count; /* (a) number of physio buffers */ - TAILQ_HEAD(,aiocblist) kaio_all; /* (a) all AIOs in the process */ + TAILQ_HEAD(,aiocblist) kaio_all; /* (a) all AIOs in a process */ TAILQ_HEAD(,aiocblist) kaio_done; /* (a) done queue for process */ TAILQ_HEAD(,aioliojob) kaio_liojoblist; /* (a) list of lio jobs */ TAILQ_HEAD(,aiocblist) kaio_jobqueue; /* (a) job queue for process */ - TAILQ_HEAD(,aiocblist) kaio_bufqueue; /* (a) buffer job queue for process */ + TAILQ_HEAD(,aiocblist) kaio_bufqueue; /* (a) buffer job queue */ TAILQ_HEAD(,aiocblist) kaio_syncqueue; /* (a) queue for aio_fsync */ - struct task kaio_task; /* (*) task to kick aio processes */ + struct task kaio_task; /* (*) task to kick aio processes */ }; #define AIO_LOCK(ki) mtx_lock(&(ki)->kaio_mtx) @@ -303,7 +304,7 @@ struct kaioinfo { #define AIO_MTX(ki) (&(ki)->kaio_mtx) #define KAIO_RUNDOWN 0x1 /* process is being run down */ -#define KAIO_WAKEUP 0x2 /* wakeup process when there is a significant event */ +#define KAIO_WAKEUP 0x2 /* wakeup process when AIO completes */ /* * Operations used to interact with userland aio control blocks. @@ -333,15 +334,17 @@ static void aio_process_sync(struct aioc static void aio_process_mlock(struct aiocblist *aiocbe); static int aio_newproc(int *); int aio_aqueue(struct thread *td, struct aiocb *job, - struct aioliojob *lio, int type, struct aiocb_ops *ops); + struct aioliojob *lio, int type, struct aiocb_ops *ops); static void aio_physwakeup(struct bio *bp); static void aio_proc_rundown(void *arg, struct proc *p); -static void aio_proc_rundown_exec(void *arg, struct proc *p, struct image_params *imgp); +static void aio_proc_rundown_exec(void *arg, struct proc *p, + struct image_params *imgp); static int aio_qphysio(struct proc *p, struct aiocblist *iocb); static void aio_daemon(void *param); static void aio_swake_cb(struct socket *, struct sockbuf *); static int aio_unload(void); -static void aio_bio_done_notify(struct proc *userp, struct aiocblist *aiocbe, int type); +static void aio_bio_done_notify(struct proc *userp, + struct aiocblist *aiocbe, int type); #define DONE_BUF 1 #define DONE_QUEUE 2 static int aio_kick(struct proc *userp); @@ -472,8 +475,8 @@ aio_onceonly(void) aio_swake = &aio_swake_cb; exit_tag = EVENTHANDLER_REGISTER(process_exit, aio_proc_rundown, NULL, EVENTHANDLER_PRI_ANY); - exec_tag = EVENTHANDLER_REGISTER(process_exec, aio_proc_rundown_exec, NULL, - EVENTHANDLER_PRI_ANY); + exec_tag = EVENTHANDLER_REGISTER(process_exec, aio_proc_rundown_exec, + NULL, EVENTHANDLER_PRI_ANY); kqueue_add_filteropts(EVFILT_AIO, &aio_filtops); kqueue_add_filteropts(EVFILT_LIO, &lio_filtops); TAILQ_INIT(&aio_freeproc); @@ -700,7 +703,8 @@ aio_free_entry(struct aiocblist *aiocbe) } static void -aio_proc_rundown_exec(void *arg, struct proc *p, struct image_params *imgp __unused) +aio_proc_rundown_exec(void *arg, struct proc *p, + struct image_params *imgp __unused) { aio_proc_rundown(arg, p); } @@ -819,8 +823,8 @@ aio_selectjob(struct aioproc *aiop) } /* - * Move all data to a permanent storage device, this code - * simulates fsync syscall. + * Move all data to a permanent storage device. This code + * simulates the fsync syscall. */ static int aio_fsync_vnode(struct thread *td, struct vnode *vp) @@ -1027,7 +1031,8 @@ notification_done: if (--scb->pending == 0) { mtx_lock(&aio_job_mtx); scb->jobstate = JOBST_JOBQGLOBAL; - TAILQ_REMOVE(&ki->kaio_syncqueue, scb, list); + TAILQ_REMOVE(&ki->kaio_syncqueue, scb, + list); TAILQ_INSERT_TAIL(&aio_jobs, scb, list); aio_kick_nowait(userp); mtx_unlock(&aio_job_mtx); @@ -1788,9 +1793,9 @@ aio_kick_nowait(struct proc *userp) TAILQ_REMOVE(&aio_freeproc, aiop, list); aiop->aioprocflags &= ~AIOP_FREE; wakeup(aiop->aioproc); - } else if (((num_aio_resv_start + num_aio_procs) < max_aio_procs) && - ((ki->kaio_active_count + num_aio_resv_start) < - ki->kaio_maxactive_count)) { + } else if (num_aio_resv_start + num_aio_procs < max_aio_procs && + ki->kaio_active_count + num_aio_resv_start < + ki->kaio_maxactive_count) { taskqueue_enqueue(taskqueue_aiod_kick, &ki->kaio_task); } } @@ -1808,9 +1813,9 @@ retryproc: TAILQ_REMOVE(&aio_freeproc, aiop, list); aiop->aioprocflags &= ~AIOP_FREE; wakeup(aiop->aioproc); - } else if (((num_aio_resv_start + num_aio_procs) < max_aio_procs) && - ((ki->kaio_active_count + num_aio_resv_start) < - ki->kaio_maxactive_count)) { + } else if (num_aio_resv_start + num_aio_procs < max_aio_procs && + ki->kaio_active_count + num_aio_resv_start < + ki->kaio_maxactive_count) { num_aio_resv_start++; mtx_unlock(&aio_job_mtx); error = aio_newproc(&num_aio_resv_start); @@ -2643,8 +2648,8 @@ typedef struct aiocb32 { uint32_t __spare2__; int aio_lio_opcode; /* LIO opcode */ int aio_reqprio; /* Request priority -- ignored */ - struct __aiocb_private32 _aiocb_private; - struct sigevent32 aio_sigevent; /* Signal to deliver */ + struct __aiocb_private32 _aiocb_private; + struct sigevent32 aio_sigevent; /* Signal to deliver */ } aiocb32_t; static int From owner-svn-src-head@freebsd.org Tue Jan 26 22:33:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5773FA6E1D4; Tue, 26 Jan 2016 22:33:00 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3C8AD6E; Tue, 26 Jan 2016 22:32:59 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QMWxlx092688; Tue, 26 Jan 2016 22:32:59 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QMWwTT092685; Tue, 26 Jan 2016 22:32:58 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201601262232.u0QMWwTT092685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 26 Jan 2016 22:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294854 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 22:33:00 -0000 Author: davidcs Date: Tue Jan 26 22:32:58 2016 New Revision: 294854 URL: https://svnweb.freebsd.org/changeset/base/294854 Log: Upgrade FW to 5.4.56 Update driver version to 3.10.26 Modified: head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_fw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_fw.c Tue Jan 26 22:14:55 2016 (r294853) +++ head/sys/dev/qlxgbe/ql_fw.c Tue Jan 26 22:32:58 2016 (r294854) @@ -35,31 +35,31 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 55; +unsigned int ql83xx_firmware_version_sub = 56; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xa4, 0x44, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xdf, 0xab, 0xb2, 0x6d, 0x14, 0xbc, 0xac, 0x79, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x44, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x65, 0x29, 0xa5, 0xc3, 0x36, 0x3d, 0x7d, 0x98, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xea, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xea, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x2c, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xf3, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x45, 0x8f, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf3, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf7, 0x8e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x9b, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x34, 0x83, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x82, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -69,117 +69,117 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xab, 0x8d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5e, 0x8d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x29, 0xa3, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, + 0xdc, 0xa2, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0xa7, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0xa7, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x8b, 0xba, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0xba, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc1, 0xd8, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0b, 0x00, 0x00, + 0x74, 0xd8, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xe4, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0xe4, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5e, 0xeb, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x11, 0xeb, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd5, 0x0e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0b, 0x00, 0x00, + 0x88, 0x0e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x19, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x19, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x6a, 0x36, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1d, 0x36, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x94, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x08, 0x00, 0x00, + 0x47, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x47, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x47, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfa, 0x4a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xad, 0x4a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x22, 0x4d, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x0a, 0x00, 0x00, + 0xd5, 0x4c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x57, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0x57, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xa2, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7b, 0x9e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x81, 0x9e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1d, 0x17, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, + 0xd6, 0x16, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xd7, 0x17, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x90, 0x17, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -189,7 +189,7 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1c, 0x3d, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd5, 0x3c, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x58, 0xe0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -232,8 +232,8 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x46, 0x1a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x21, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x46, 0x1a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x25, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xae, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -250,664 +250,664 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xda, 0xec, 0x3d, 0x6d, 0x70, 0x5c, 0xd5, 0x75, 0xf7, 0x7d, 0xec, 0xee, 0xd3, 0x6a, 0x57, - 0x5a, 0x1b, 0xd9, 0x11, 0x46, 0xae, 0x9f, 0x8d, 0xb1, 0xc5, 0x47, 0x98, - 0x67, 0x63, 0x1c, 0x63, 0xdc, 0xf0, 0x24, 0xcb, 0x8e, 0x6d, 0x24, 0x50, - 0x43, 0x03, 0xe6, 0x23, 0x20, 0xd2, 0x06, 0x04, 0x21, 0x58, 0x74, 0xa0, - 0x23, 0x83, 0x07, 0x3f, 0xd9, 0x92, 0x6c, 0x40, 0x4e, 0x64, 0xec, 0x38, - 0x0e, 0xa1, 0xb0, 0x92, 0x6d, 0x4a, 0x52, 0xda, 0x2e, 0x93, 0x8f, 0x32, - 0x6d, 0x67, 0x58, 0xdb, 0x99, 0xd8, 0x10, 0x3c, 0x71, 0x7e, 0xd0, 0x86, - 0x74, 0x68, 0xb6, 0x93, 0xa6, 0xa3, 0x12, 0xa0, 0x9b, 0x76, 0x4a, 0x64, - 0x52, 0x43, 0xef, 0xf7, 0x7b, 0xf7, 0xee, 0x7b, 0x6f, 0xf7, 0xca, 0xb2, - 0x33, 0xed, 0x58, 0x99, 0x09, 0x3a, 0xbe, 0xf7, 0x9c, 0x77, 0xee, 0xb9, - 0xe7, 0x9e, 0x73, 0xee, 0x39, 0xe7, 0x3d, 0x01, 0x0d, 0x90, 0x1f, 0x13, - 0x18, 0x40, 0x07, 0x77, 0x83, 0xf3, 0xf0, 0xff, 0x4d, 0x98, 0xfc, 0xf4, - 0x50, 0xf8, 0xe4, 0x3b, 0x6f, 0xe3, 0xff, 0x7d, 0xb9, 0x02, 0x16, 0x7f, + 0x5a, 0x1b, 0xd9, 0x11, 0x42, 0xd4, 0xcf, 0xc6, 0xd8, 0xe2, 0x23, 0xcc, + 0xb3, 0x31, 0x8e, 0x31, 0x6e, 0x78, 0x92, 0x65, 0xc7, 0x36, 0x12, 0xa8, + 0xa1, 0x01, 0xf3, 0x11, 0x10, 0x69, 0x43, 0x04, 0x21, 0x58, 0x74, 0xa0, + 0x23, 0x13, 0x0f, 0x7e, 0xb2, 0x25, 0xd9, 0x80, 0x9c, 0xc8, 0xd8, 0x71, + 0x1c, 0x42, 0x61, 0x25, 0xdb, 0x94, 0xb4, 0xb4, 0x5d, 0x26, 0x1f, 0x65, + 0xda, 0xce, 0xb0, 0xb6, 0x33, 0xb1, 0x21, 0x78, 0xe2, 0xfc, 0xa0, 0x0d, + 0xe9, 0xd0, 0x6c, 0x27, 0x4d, 0x47, 0x25, 0x40, 0x37, 0xed, 0x94, 0xc8, + 0xa4, 0x86, 0xde, 0xef, 0xf7, 0xee, 0xdd, 0xf7, 0xde, 0xee, 0x95, 0x65, + 0x67, 0xd2, 0xb1, 0x32, 0x13, 0x74, 0x7c, 0xef, 0x39, 0xef, 0xdc, 0x73, + 0xcf, 0x3d, 0xe7, 0xdc, 0x73, 0xce, 0x7b, 0x02, 0x1a, 0x20, 0x3f, 0x26, + 0x30, 0x80, 0x0e, 0xee, 0x01, 0xe7, 0xe1, 0xdf, 0x4d, 0x98, 0xfc, 0xf4, + 0x52, 0xf8, 0xe4, 0xdb, 0x6f, 0xe1, 0xff, 0x7d, 0xa9, 0x02, 0x16, 0x7f, 0x0a, 0x12, 0x9c, 0x57, 0x84, 0x3d, 0x1d, 0xd8, 0xf8, 0x97, 0x3d, 0x29, - 0xfc, 0x9f, 0xbe, 0x8a, 0xf9, 0x1a, 0xf0, 0xdc, 0x5c, 0x00, 0xa6, 0xbf, + 0xfc, 0x9f, 0xfe, 0x8a, 0xf9, 0x1a, 0xf0, 0xdc, 0x5c, 0x00, 0xa6, 0xbf, 0xdb, 0xf9, 0x0c, 0xe1, 0x17, 0x14, 0x0d, 0xc6, 0x3a, 0x00, 0x75, 0x79, - 0x93, 0x00, 0xdd, 0xb7, 0x91, 0x9f, 0xfb, 0xa3, 0x9e, 0xb7, 0x0e, 0x44, - 0x3c, 0x4f, 0x11, 0x66, 0xf4, 0x4e, 0x4c, 0x33, 0xbd, 0x85, 0xda, 0xf4, - 0xd2, 0x5b, 0x3a, 0xcd, 0xf4, 0x36, 0xe9, 0x53, 0xa3, 0xc7, 0xf0, 0x6f, - 0x37, 0xa7, 0x84, 0x1f, 0xa2, 0x6f, 0x8e, 0x87, 0x48, 0x5d, 0xba, 0xf4, - 0xce, 0xf5, 0x33, 0xc0, 0xe0, 0xd7, 0x20, 0x49, 0x04, 0x9f, 0x6c, 0x1d, - 0x7c, 0xf3, 0xf5, 0x4e, 0x2d, 0xb7, 0x1b, 0xa2, 0x20, 0x38, 0xff, 0xc0, - 0xdc, 0x55, 0x2b, 0x01, 0x1e, 0x2f, 0xb3, 0xf1, 0x77, 0x1f, 0xd4, 0xf2, - 0x70, 0xdc, 0x19, 0x40, 0xf8, 0xf7, 0xdf, 0x74, 0xec, 0xca, 0x8b, 0x09, - 0xfe, 0x00, 0x1d, 0x6f, 0xd8, 0xad, 0x39, 0x4f, 0x43, 0xfc, 0x01, 0x46, - 0xff, 0x27, 0x04, 0x7f, 0x40, 0xa4, 0xef, 0x6c, 0x83, 0x70, 0xf7, 0xfa, - 0x2b, 0x13, 0x97, 0x7e, 0x92, 0xe0, 0x6f, 0xa3, 0xe3, 0x9f, 0x7d, 0x53, - 0xeb, 0xde, 0x03, 0xf1, 0x11, 0xdc, 0xb3, 0xf2, 0xb6, 0x17, 0x1e, 0x48, - 0x12, 0x7c, 0x36, 0xfe, 0xf0, 0x6f, 0xb4, 0x9e, 0x51, 0x88, 0xbf, 0x9d, - 0xd3, 0xd7, 0x30, 0xfe, 0x76, 0x89, 0x7f, 0x04, 0xe7, 0x5f, 0xfd, 0xf5, - 0xc2, 0xe5, 0x16, 0xc1, 0x67, 0xe3, 0xaf, 0x5c, 0x0b, 0xba, 0xd1, 0xf3, - 0x07, 0x21, 0xdc, 0x97, 0x3b, 0xe6, 0x36, 0x91, 0xf5, 0xf5, 0x0d, 0xd2, - 0xf1, 0x9f, 0x7d, 0xfe, 0x71, 0x0b, 0xd2, 0x2f, 0x20, 0xb8, 0x27, 0x33, - 0xec, 0xe4, 0xe6, 0x10, 0x7c, 0x36, 0xbe, 0xea, 0x0b, 0x8f, 0xef, 0x44, - 0xcf, 0x1f, 0x42, 0xfc, 0x5b, 0x6b, 0xec, 0x0c, 0x5d, 0xff, 0x10, 0x1d, - 0x6f, 0x1f, 0x7c, 0xdc, 0x42, 0xcf, 0x47, 0xb0, 0x6b, 0x9a, 0x39, 0x2b, - 0x43, 0xf0, 0xd9, 0xf8, 0x1f, 0xbf, 0xf0, 0xf8, 0x4e, 0xf4, 0xfc, 0x61, - 0xd3, 0xdf, 0x0f, 0x48, 0xaf, 0x4f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, + 0x93, 0x00, 0x3d, 0xb7, 0x93, 0x9f, 0xfb, 0xa3, 0x9e, 0xb7, 0x0e, 0x44, + 0x3c, 0x4f, 0x11, 0x66, 0xf4, 0x4e, 0xcc, 0x30, 0xbd, 0x85, 0xda, 0xcc, + 0xd2, 0x5b, 0x3a, 0xc3, 0xf4, 0x36, 0xe9, 0xd3, 0xa3, 0xc7, 0xf0, 0xef, + 0x30, 0xa7, 0x85, 0x1f, 0xa2, 0x6f, 0x8e, 0x87, 0x48, 0x5d, 0xb6, 0xf4, + 0xae, 0xf5, 0xb3, 0xc0, 0xd0, 0xd7, 0x20, 0x49, 0x04, 0x9f, 0x6c, 0x1b, + 0x7a, 0xe3, 0xb5, 0x2e, 0x2d, 0xb7, 0x1b, 0xa2, 0x20, 0x38, 0xff, 0xc0, + 0xc5, 0xab, 0x56, 0x02, 0x3c, 0x5e, 0x66, 0xe3, 0xef, 0x3c, 0xa8, 0xe5, + 0xe1, 0xb8, 0x33, 0x88, 0xf0, 0xef, 0xbf, 0xf9, 0xd8, 0x55, 0x97, 0x10, + 0xfc, 0x41, 0x3a, 0xde, 0xb0, 0x5b, 0x73, 0x9e, 0x82, 0xf8, 0x83, 0x8c, + 0xfe, 0x8f, 0x09, 0xfe, 0xa0, 0x48, 0xdf, 0xd9, 0x06, 0xe1, 0x9e, 0xf5, + 0x57, 0x25, 0x2e, 0xfb, 0x38, 0xc1, 0xdf, 0x46, 0xc7, 0x3f, 0xfd, 0x86, + 0xd6, 0xb3, 0x07, 0xe2, 0x23, 0xb8, 0x77, 0xe5, 0xed, 0xcf, 0x3f, 0x90, + 0x24, 0xf8, 0x6c, 0xfc, 0xe1, 0x5f, 0x6b, 0xbd, 0x63, 0x10, 0x7f, 0x3b, + 0xa7, 0xaf, 0x61, 0xfc, 0xed, 0x12, 0xff, 0x08, 0xce, 0xbf, 0xf2, 0xab, + 0x85, 0xcb, 0x2d, 0x82, 0xcf, 0xc6, 0x5f, 0xbe, 0x0e, 0xf4, 0xa0, 0xe7, + 0x0f, 0x41, 0xb8, 0x3f, 0x77, 0xcc, 0x6d, 0x22, 0xeb, 0xeb, 0x1f, 0xa2, + 0xe3, 0x3f, 0xfd, 0xec, 0x63, 0x16, 0xa4, 0x5f, 0x40, 0x70, 0x6f, 0x66, + 0xc4, 0xc9, 0xb5, 0x10, 0x7c, 0x36, 0xbe, 0xea, 0x73, 0x8f, 0xed, 0x44, + 0xcf, 0x1f, 0x46, 0xfc, 0x5b, 0x6b, 0xec, 0x0c, 0x5d, 0xff, 0x30, 0x1d, + 0xef, 0x18, 0x7a, 0xcc, 0x42, 0xcf, 0x47, 0xb0, 0x6b, 0x9a, 0x39, 0x2b, + 0x43, 0xf0, 0xd9, 0xf8, 0x1f, 0x3f, 0xff, 0xd8, 0x4e, 0xf4, 0xfc, 0x11, + 0xd3, 0xdf, 0x0f, 0x48, 0xaf, 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, 0x67, 0x87, 0x84, 0x2f, 0xc1, 0x05, 0x09, 0x2e, 0x4b, 0xb0, 0xb3, 0x13, - 0xf1, 0xd7, 0xb4, 0xf6, 0xee, 0x16, 0x3b, 0x77, 0xf5, 0x33, 0x10, 0x1f, - 0xc1, 0x79, 0xe7, 0x0b, 0xe6, 0xe5, 0x9b, 0xb6, 0xa2, 0xf5, 0x15, 0x10, - 0xdc, 0xdd, 0xbc, 0xe3, 0xa1, 0xa6, 0x4b, 0xf1, 0x78, 0x99, 0x8d, 0x77, - 0xed, 0xde, 0x8a, 0xd6, 0xe7, 0x3c, 0x81, 0xe4, 0xd3, 0x72, 0x44, 0x33, - 0x97, 0x12, 0xfc, 0x27, 0xe8, 0xf8, 0xa6, 0xef, 0x6c, 0x45, 0xeb, 0x2b, - 0x20, 0xb8, 0xaf, 0x45, 0xcb, 0x59, 0xd7, 0x12, 0x7c, 0x36, 0xbe, 0xfb, - 0xcd, 0xad, 0x16, 0xd4, 0x0f, 0xe7, 0x49, 0xc2, 0xcf, 0xa2, 0x16, 0x9b, - 0xf0, 0x8f, 0xe1, 0xfa, 0x0c, 0xb0, 0xba, 0xee, 0xc6, 0xfc, 0xd3, 0xf1, - 0x65, 0x74, 0xbc, 0x8c, 0xe1, 0xa7, 0x34, 0x36, 0xee, 0x3c, 0x25, 0xad, - 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, 0x67, 0x44, 0xc2, 0x97, 0xe0, + 0xf1, 0xd7, 0xb4, 0xf6, 0x9e, 0x56, 0x3b, 0x77, 0xcd, 0xd3, 0x10, 0x1f, + 0xc1, 0x79, 0xe7, 0x73, 0xe6, 0x15, 0x9b, 0xb6, 0xa2, 0xf5, 0x15, 0x10, + 0xdc, 0xd3, 0xbc, 0xe3, 0xa1, 0xa6, 0xcb, 0xf0, 0x78, 0x99, 0x8d, 0x77, + 0xef, 0xde, 0x8a, 0xd6, 0xe7, 0x3c, 0x8e, 0xe4, 0xd3, 0x7a, 0x44, 0x33, + 0x97, 0x12, 0xfc, 0xc7, 0xe9, 0xf8, 0xa6, 0x6f, 0x6f, 0x45, 0xeb, 0x2b, + 0x20, 0xb8, 0xbf, 0x55, 0xcb, 0x59, 0xd7, 0x11, 0x7c, 0x36, 0xbe, 0xfb, + 0x8d, 0xad, 0x16, 0xd4, 0x0f, 0xe7, 0x09, 0xc2, 0xcf, 0xa2, 0x56, 0x9b, + 0xf0, 0x8f, 0xe1, 0xfa, 0x0c, 0xb0, 0xba, 0xef, 0xc1, 0xfc, 0xd3, 0xf1, + 0x65, 0x74, 0xbc, 0x8c, 0xe1, 0x27, 0x35, 0x36, 0xee, 0x3c, 0x29, 0xad, + 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, 0x67, 0x54, 0xc2, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0xd9, 0x25, 0xe1, 0x4b, 0x70, 0x41, 0x82, 0xcb, 0x12, 0xec, 0x7c, 0x45, 0xc2, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0xf9, 0xaa, 0x84, 0x2f, 0xc1, 0x05, 0x09, 0x2e, 0x4b, 0xb0, 0xe3, - 0x42, 0xd8, 0xeb, 0x7d, 0x37, 0xc9, 0xf0, 0x11, 0x5c, 0xba, 0xf8, 0x67, - 0x7f, 0xca, 0xf0, 0x11, 0x5c, 0xfc, 0xf0, 0xf8, 0xb0, 0x41, 0xf1, 0x11, - 0x9c, 0x7f, 0xf9, 0xa3, 0x0f, 0x28, 0xec, 0xb4, 0x41, 0x38, 0xb7, 0xeb, - 0xea, 0x3a, 0x97, 0xe2, 0x23, 0xb8, 0xaf, 0xe3, 0xe2, 0xcd, 0x14, 0x2e, - 0x20, 0xb8, 0x7b, 0xde, 0xee, 0x5d, 0xab, 0x29, 0x3e, 0x82, 0x9d, 0x7f, - 0xd8, 0x71, 0x9a, 0xc2, 0x4e, 0xbb, 0xc4, 0xbf, 0x04, 0x17, 0x24, 0xb8, + 0x42, 0xd8, 0xeb, 0x7b, 0x27, 0xc9, 0xf0, 0x11, 0x5c, 0xba, 0xe4, 0xa7, + 0x7f, 0xca, 0xf0, 0x11, 0x5c, 0xfc, 0xe0, 0xf8, 0x88, 0x41, 0xf1, 0x11, + 0x9c, 0x7f, 0xe9, 0xc3, 0xf7, 0x29, 0xec, 0xb4, 0x43, 0x38, 0xb7, 0xeb, + 0x9a, 0x3a, 0x97, 0xe2, 0x23, 0xb8, 0xbf, 0xf3, 0x92, 0xcd, 0x14, 0x2e, + 0x20, 0xb8, 0x67, 0xde, 0xee, 0x5d, 0xab, 0x29, 0x3e, 0x82, 0x9d, 0x7f, + 0xdc, 0x71, 0x9a, 0xc2, 0x4e, 0x87, 0xc4, 0xbf, 0x04, 0x17, 0x24, 0xb8, 0x2c, 0xc1, 0xce, 0x6a, 0x09, 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, - 0xa7, 0x43, 0xc2, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0x59, 0x23, + 0xa7, 0x53, 0xc2, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0x59, 0x23, 0xe1, 0x4b, 0x70, 0x41, 0x82, 0xcb, 0x12, 0xec, 0xac, 0x95, 0xf0, 0x25, - 0xb8, 0x20, 0xc1, 0x65, 0x09, 0x76, 0x3e, 0x23, 0xe1, 0x4b, 0x70, 0x41, - 0x82, 0xcb, 0x12, 0xec, 0xac, 0x43, 0xfb, 0xf3, 0xb9, 0x37, 0xd9, 0x7e, - 0xf6, 0x21, 0xf8, 0xe4, 0x23, 0x6f, 0x33, 0xb8, 0x80, 0xc7, 0xf7, 0xfd, - 0x92, 0xc1, 0x65, 0x3c, 0xfe, 0xfd, 0xf7, 0xf8, 0xfe, 0xaf, 0x47, 0xe7, - 0xff, 0xda, 0xbf, 0x38, 0xcd, 0xf0, 0x31, 0x7c, 0xfb, 0x77, 0x19, 0x5c, - 0xc0, 0xf0, 0x63, 0x43, 0x0c, 0x2e, 0x23, 0xb8, 0xfc, 0xfc, 0x57, 0x18, - 0xec, 0x6c, 0x40, 0xf0, 0xab, 0xa3, 0x1c, 0x1f, 0xc3, 0x3f, 0xff, 0x06, - 0xc7, 0x47, 0x30, 0x98, 0xb1, 0xe0, 0x14, 0xc3, 0x47, 0xf0, 0xe8, 0xd5, - 0x97, 0x33, 0xd8, 0xb9, 0x1e, 0xc2, 0x76, 0xbb, 0xc9, 0xe0, 0x3e, 0x04, - 0x17, 0xee, 0xc9, 0x32, 0xb8, 0x80, 0x60, 0x77, 0x67, 0x8e, 0xe3, 0x23, - 0xf8, 0xe4, 0x4b, 0x17, 0x72, 0xfc, 0x4e, 0x44, 0xbf, 0x78, 0x8c, 0xaf, - 0xbf, 0x93, 0xc8, 0xa7, 0xcc, 0xf0, 0x25, 0xb8, 0x2c, 0xc1, 0x4e, 0x97, - 0x08, 0xf7, 0x49, 0x70, 0x41, 0x82, 0xcb, 0x12, 0xec, 0xdc, 0x20, 0xe1, - 0x4b, 0x70, 0x41, 0x82, 0xcb, 0x12, 0xec, 0xdc, 0x28, 0xe1, 0x4b, 0x70, - 0x41, 0x82, 0xcb, 0x12, 0x2c, 0xc6, 0x77, 0x95, 0xf1, 0xc1, 0x8c, 0x20, - 0x5c, 0x35, 0xde, 0xb0, 0xd9, 0x6f, 0x1a, 0x0d, 0x2a, 0xe9, 0xc3, 0x1a, - 0x35, 0x1e, 0x64, 0x56, 0x89, 0x57, 0xfa, 0x34, 0x37, 0xa0, 0x9f, 0x84, - 0x5e, 0x22, 0x01, 0xed, 0x3f, 0x8a, 0xb9, 0xe1, 0xf8, 0x6d, 0x09, 0x3a, - 0xf6, 0xd1, 0x3c, 0x60, 0x77, 0x57, 0xa7, 0xa7, 0xc6, 0x3f, 0x3d, 0x1b, - 0xa5, 0x8f, 0xc9, 0xcf, 0x26, 0xf5, 0x78, 0x6a, 0x5a, 0xe1, 0x42, 0xf5, - 0xfd, 0x51, 0x83, 0xe9, 0xfa, 0xca, 0x11, 0xeb, 0xab, 0xfa, 0xbc, 0x2a, - 0xf8, 0x55, 0xef, 0x2b, 0x8a, 0xcf, 0xf3, 0xb8, 0xad, 0x72, 0x99, 0xfe, - 0x64, 0xe9, 0x7d, 0xa5, 0x17, 0x8e, 0x6a, 0xfc, 0x3e, 0x03, 0x80, 0x85, - 0xc7, 0x7d, 0xe3, 0x6c, 0x83, 0xfd, 0x47, 0xb5, 0x01, 0x90, 0x2b, 0x02, - 0xab, 0x99, 0xcc, 0xb7, 0xb7, 0xc1, 0xf9, 0xe0, 0x0a, 0x9d, 0x92, 0xfe, - 0x38, 0x5c, 0x7f, 0x32, 0x22, 0x7d, 0xf0, 0x06, 0x1d, 0x9a, 0xa0, 0xf0, - 0xef, 0x76, 0xff, 0xaa, 0xc9, 0xeb, 0x3c, 0x7c, 0x66, 0xe7, 0xff, 0xec, - 0xc3, 0xd3, 0xcb, 0x8f, 0x0d, 0xa4, 0xfc, 0x03, 0xfc, 0x87, 0x4f, 0xcf, - 0x09, 0xcc, 0xa7, 0xf6, 0x97, 0x8f, 0x83, 0x1f, 0x00, 0x51, 0xbf, 0x73, + 0xb8, 0x20, 0xc1, 0x65, 0x09, 0x76, 0x3e, 0x25, 0xe1, 0x4b, 0x70, 0x41, + 0x82, 0xcb, 0x12, 0xec, 0xac, 0x43, 0xfb, 0xf3, 0x99, 0x37, 0xd8, 0x7e, + 0xf6, 0x23, 0xf8, 0xe4, 0x23, 0x6f, 0x31, 0xb8, 0x80, 0xc7, 0xf7, 0xfd, + 0x82, 0xc1, 0x65, 0x3c, 0xfe, 0xbd, 0x77, 0xf9, 0xfe, 0xaf, 0x47, 0xe7, + 0xff, 0xba, 0xbf, 0x3c, 0xcd, 0xf0, 0x31, 0x7c, 0xc7, 0x77, 0x18, 0x5c, + 0xc0, 0xf0, 0x97, 0x87, 0x19, 0x5c, 0x46, 0x70, 0xf9, 0xb9, 0xaf, 0x30, + 0xd8, 0xd9, 0x80, 0xe0, 0x57, 0xc6, 0x38, 0x3e, 0x86, 0x7f, 0xf6, 0x0d, + 0x8e, 0x8f, 0x60, 0x30, 0x6b, 0xc1, 0x29, 0x86, 0x8f, 0xe0, 0xb1, 0x6b, + 0xae, 0x60, 0xb0, 0x73, 0x03, 0x84, 0xed, 0x0e, 0x93, 0xc1, 0xfd, 0x08, + 0x2e, 0xdc, 0x9b, 0x65, 0x70, 0x01, 0xc1, 0xee, 0xce, 0x1c, 0xc7, 0x47, + 0xf0, 0xc9, 0x17, 0x2f, 0xe4, 0xf8, 0x5d, 0x88, 0x7e, 0xf1, 0x18, 0x5f, + 0x7f, 0x17, 0x91, 0x4f, 0x99, 0xe1, 0x4b, 0x70, 0x59, 0x82, 0x9d, 0x6e, + 0x11, 0xee, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0xb9, 0x51, 0xc2, + 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0xb9, 0x49, 0xc2, 0x97, 0xe0, + 0x82, 0x04, 0x97, 0x25, 0x58, 0x8c, 0xef, 0x2a, 0xe3, 0x83, 0x59, 0x41, + 0xb8, 0x6a, 0xbc, 0x61, 0xb3, 0xdf, 0x34, 0x1a, 0x54, 0xd2, 0x87, 0x35, + 0x6a, 0x3c, 0xc8, 0xac, 0x12, 0xaf, 0xf4, 0x6b, 0x6e, 0x40, 0x3f, 0x09, + 0xbd, 0x44, 0x02, 0xda, 0x7f, 0x14, 0x73, 0xc3, 0xf1, 0xdb, 0x13, 0x74, + 0xec, 0xc3, 0x79, 0xc0, 0xee, 0xa9, 0x4e, 0x4f, 0x8d, 0x7f, 0x7a, 0x36, + 0x4a, 0x1f, 0x91, 0x9f, 0x4d, 0xea, 0xf1, 0xd4, 0x8c, 0xc2, 0x85, 0xea, + 0xfb, 0xa3, 0x06, 0xd3, 0xf5, 0x95, 0x23, 0xd6, 0x57, 0xf5, 0x79, 0x55, + 0xf0, 0xab, 0xde, 0x57, 0x14, 0x9f, 0xe7, 0x71, 0x5b, 0xe5, 0x32, 0xfd, + 0xc9, 0xd2, 0xfb, 0x4a, 0x1f, 0x1c, 0xd5, 0xf8, 0x7d, 0x06, 0x00, 0x0b, + 0x8f, 0xfb, 0xc6, 0xd9, 0x06, 0xfb, 0x8f, 0x6a, 0x83, 0x20, 0x57, 0x04, + 0x56, 0x33, 0x99, 0x6f, 0x6f, 0x83, 0xf3, 0xc1, 0x95, 0x3a, 0x25, 0xfd, + 0x51, 0xb8, 0xfe, 0x64, 0x44, 0xfa, 0xe0, 0x75, 0x3a, 0x34, 0x49, 0xe1, + 0xdf, 0xee, 0xfe, 0x55, 0x93, 0xd7, 0x79, 0xf8, 0xcc, 0xce, 0xff, 0xd9, + 0x87, 0x67, 0x96, 0x1f, 0x1b, 0x48, 0xf9, 0x07, 0xf8, 0x0f, 0x9f, 0x6c, + 0x09, 0xcc, 0xa7, 0xf6, 0x97, 0x8f, 0x83, 0xef, 0x03, 0x51, 0xbf, 0x73, 0x19, 0x11, 0x46, 0x27, 0x2a, 0x09, 0xfc, 0x73, 0x05, 0x91, 0xd2, 0xce, - 0x60, 0x7b, 0x5b, 0x2b, 0x91, 0x2f, 0xa4, 0x9f, 0x9e, 0x43, 0xce, 0x97, - 0xad, 0x07, 0xed, 0xb1, 0x77, 0xfa, 0x6c, 0xd8, 0xe3, 0xea, 0x70, 0x63, - 0x00, 0xac, 0xe5, 0xf9, 0x6c, 0xbe, 0xd7, 0xa0, 0x36, 0x1f, 0xcc, 0x55, - 0xa4, 0x7f, 0xb9, 0x22, 0xfd, 0x95, 0x8a, 0xf4, 0xd7, 0x29, 0xd2, 0xbf, - 0x45, 0x91, 0xfe, 0x17, 0x15, 0xe9, 0x3f, 0xac, 0x48, 0x7f, 0x9b, 0x22, - 0xfd, 0xdd, 0x8a, 0xf4, 0x9f, 0x57, 0xa4, 0xff, 0x57, 0x8a, 0xf4, 0xff, - 0x5e, 0x91, 0xfe, 0x8f, 0x14, 0xe9, 0xbf, 0xa5, 0x48, 0x7f, 0x42, 0x91, - 0xfe, 0x07, 0x8a, 0xf4, 0x13, 0x9a, 0x1a, 0xfd, 0x0b, 0xd4, 0xe6, 0x83, - 0x05, 0x8a, 0xf4, 0x1d, 0x45, 0xfa, 0xd7, 0x29, 0xd2, 0xef, 0x52, 0xa4, - 0x7f, 0x87, 0x22, 0xfd, 0xfb, 0x15, 0xe9, 0x6f, 0x56, 0xa4, 0xbf, 0x43, - 0x91, 0xfe, 0x3e, 0x45, 0xfa, 0x07, 0x15, 0xe9, 0x7f, 0x47, 0x91, 0xfe, - 0x61, 0x45, 0xfa, 0x27, 0x15, 0xe9, 0xff, 0xb3, 0x22, 0xfd, 0xf7, 0x14, - 0xe9, 0xff, 0x56, 0x91, 0x7e, 0x5a, 0x57, 0xa3, 0xdf, 0xac, 0x36, 0x1f, - 0x2c, 0x56, 0xa4, 0x7f, 0xb5, 0x22, 0xfd, 0x0e, 0x45, 0xfa, 0x9f, 0x55, - 0xa4, 0x7f, 0xb7, 0x22, 0xfd, 0x4d, 0x8a, 0xf4, 0x1f, 0x57, 0xa4, 0x3f, - 0xa2, 0x48, 0xff, 0x9b, 0x8a, 0xf4, 0xbf, 0xa5, 0x48, 0xff, 0x15, 0x45, - 0xfa, 0x3f, 0x54, 0xa4, 0xff, 0xa6, 0x22, 0xfd, 0x5f, 0x28, 0xd2, 0xff, - 0x4f, 0x45, 0xfa, 0xc0, 0x50, 0xa3, 0xdf, 0xa8, 0x36, 0xdf, 0x9b, 0xab, - 0x48, 0xff, 0x0a, 0x45, 0xfa, 0x2b, 0x15, 0xe9, 0xaf, 0x57, 0xa4, 0x7f, - 0x8b, 0x22, 0xfd, 0x7b, 0x14, 0xe9, 0x3f, 0xac, 0x48, 0x7f, 0xbb, 0x22, - 0xfd, 0xdd, 0x8a, 0xf4, 0xf3, 0xc6, 0xb9, 0xb8, 0x7f, 0x78, 0x5d, 0xe0, - 0xca, 0xdf, 0x43, 0xbf, 0xfe, 0xea, 0x3a, 0x80, 0xf3, 0x09, 0x27, 0x68, - 0x05, 0xb8, 0x37, 0x41, 0xee, 0x4f, 0x59, 0x9a, 0x5f, 0x98, 0x30, 0x11, - 0xcc, 0xea, 0x75, 0x07, 0xba, 0xd9, 0xf3, 0x76, 0xb1, 0xfc, 0x82, 0x49, - 0xe7, 0xb3, 0xfb, 0x98, 0x06, 0x06, 0xb4, 0x3c, 0xb9, 0x76, 0x3d, 0x03, - 0x6f, 0x6d, 0x8b, 0x40, 0xc9, 0xf4, 0xeb, 0xb5, 0x79, 0xf7, 0x1a, 0x7c, - 0x15, 0x83, 0xff, 0xd4, 0xd4, 0x6a, 0x80, 0x16, 0xc4, 0x4a, 0xfe, 0xa8, - 0x36, 0xc0, 0xeb, 0x81, 0x63, 0x84, 0xbe, 0x05, 0x34, 0xe0, 0xa2, 0x54, - 0xfe, 0xc6, 0x7e, 0x40, 0xf8, 0x13, 0xf9, 0x67, 0xf3, 0x0f, 0x3f, 0x1c, - 0xbe, 0x7e, 0xdb, 0x02, 0xc0, 0x4d, 0xdb, 0xf5, 0x60, 0xf2, 0x53, 0xa0, - 0x94, 0x02, 0x07, 0x80, 0x4e, 0xf3, 0x3d, 0x9f, 0xc2, 0x09, 0x98, 0x1e, - 0x7e, 0xc1, 0x6e, 0x75, 0x29, 0x3f, 0xee, 0x2c, 0xc8, 0xcf, 0xb3, 0x3f, - 0x5c, 0xd8, 0x9c, 0x5c, 0xd2, 0x34, 0xec, 0x59, 0x60, 0xd7, 0xc0, 0x1e, - 0x5c, 0x4a, 0x98, 0x30, 0x82, 0xeb, 0x67, 0xfc, 0x01, 0xad, 0xeb, 0x28, - 0xa9, 0x47, 0xf7, 0xea, 0x78, 0xfd, 0x2e, 0xbb, 0x63, 0x62, 0x39, 0xf4, - 0xa0, 0x2c, 0x0e, 0xe6, 0xdf, 0x72, 0x00, 0x7c, 0x36, 0xcb, 0x37, 0x81, - 0x9b, 0x69, 0xbd, 0xda, 0xda, 0x3e, 0x56, 0x8f, 0x94, 0x63, 0x3e, 0x55, - 0x92, 0x4a, 0xfa, 0x75, 0x47, 0x28, 0x7d, 0x21, 0x3f, 0x74, 0x37, 0xa5, - 0x8f, 0x96, 0xe3, 0xea, 0x95, 0xf4, 0x6f, 0xa1, 0xf4, 0xd3, 0x03, 0x63, - 0x88, 0x05, 0xef, 0xd2, 0x48, 0xfa, 0x9a, 0x48, 0xdf, 0xcd, 0x1e, 0x99, - 0xdf, 0x42, 0xf7, 0x0f, 0xc2, 0x56, 0x85, 0x7c, 0xc8, 0xcf, 0x46, 0x4a, - 0xbf, 0x82, 0x1e, 0xd7, 0x87, 0x09, 0x8a, 0xbf, 0xcb, 0xc0, 0xeb, 0xa7, - 0xf4, 0xd8, 0xfc, 0xbf, 0xa6, 0xf3, 0x4d, 0x89, 0x3e, 0x00, 0x23, 0x2c, - 0xfc, 0xc7, 0xf2, 0x76, 0xc1, 0x1b, 0x9a, 0x8b, 0x1e, 0xd5, 0xfc, 0x80, - 0x8e, 0xf2, 0x5d, 0x94, 0x1f, 0xef, 0x56, 0x56, 0xef, 0xc7, 0xfb, 0x39, - 0x5c, 0x87, 0xf2, 0xa9, 0x5e, 0x02, 0x2a, 0x51, 0x5b, 0xd7, 0x11, 0xad, - 0x05, 0xee, 0xfa, 0xe4, 0x26, 0xa3, 0x34, 0xa4, 0x8d, 0xdd, 0x71, 0x83, - 0x67, 0x96, 0xc0, 0x0a, 0x5d, 0x03, 0x2f, 0x26, 0x5e, 0x07, 0x60, 0x07, - 0xdc, 0xaf, 0x23, 0xd9, 0x9c, 0xcf, 0x5f, 0x25, 0xff, 0x4c, 0xdf, 0xd9, - 0xfa, 0x4f, 0x68, 0xab, 0x42, 0xf8, 0xbf, 0x5d, 0xe4, 0xdf, 0xfb, 0x3c, - 0xe3, 0x07, 0xe9, 0xdb, 0x6c, 0xc4, 0x2f, 0xd9, 0x0f, 0xc4, 0x6f, 0x12, - 0xf5, 0x32, 0x1c, 0x27, 0x30, 0x00, 0x2b, 0x52, 0x14, 0x25, 0x19, 0x7e, - 0x5f, 0xe1, 0xe7, 0x4f, 0x23, 0xe7, 0xa9, 0x93, 0x9d, 0x2f, 0x2c, 0x0f, - 0x26, 0xaf, 0xbb, 0x22, 0xe4, 0x6f, 0x81, 0x2e, 0x83, 0xf0, 0x4b, 0xd6, - 0xc7, 0xf8, 0x5b, 0x13, 0x39, 0x5f, 0x94, 0x27, 0xd7, 0x57, 0xe9, 0x7c, - 0xcd, 0x4c, 0x08, 0xeb, 0xed, 0xd6, 0x48, 0x22, 0xa6, 0xc7, 0xcf, 0x2f, - 0x4e, 0xe8, 0x61, 0xf9, 0x44, 0x24, 0x6a, 0x17, 0x11, 0xdd, 0xbf, 0x80, - 0xae, 0xbf, 0x93, 0xb1, 0x94, 0xa8, 0xe5, 0xbe, 0x16, 0x21, 0x6f, 0xf0, - 0x47, 0x94, 0xdf, 0xb3, 0xbd, 0x3e, 0x0b, 0xda, 0x33, 0x2c, 0xcf, 0xc9, - 0xcd, 0x71, 0xfb, 0x0f, 0xee, 0xe1, 0xfd, 0x27, 0xe1, 0xfc, 0x1f, 0x68, - 0x20, 0xf3, 0xd1, 0xac, 0x55, 0xa6, 0x6d, 0x20, 0x7d, 0x2d, 0x25, 0xc0, - 0x18, 0xb1, 0x17, 0xe3, 0x0d, 0xdc, 0x3e, 0x82, 0x06, 0xc0, 0x8f, 0xaa, - 0x82, 0x7c, 0xde, 0x06, 0x3e, 0x3f, 0xa8, 0xa0, 0x09, 0x5a, 0x99, 0xbe, - 0xf1, 0xf3, 0xa4, 0x07, 0xf9, 0xdf, 0x9c, 0xae, 0xcd, 0x5f, 0xb0, 0xf9, - 0x77, 0xd5, 0xab, 0xcd, 0x97, 0xcf, 0x47, 0x6f, 0x15, 0xf9, 0x2c, 0x3c, - 0x43, 0xfa, 0xf7, 0x71, 0xfa, 0x9d, 0x6c, 0xbd, 0x89, 0xf0, 0xfc, 0xf6, - 0x88, 0xe4, 0xaf, 0x3c, 0x13, 0x46, 0x52, 0xa8, 0xa4, 0xa6, 0xbd, 0x72, - 0x14, 0x0c, 0x54, 0xf8, 0x53, 0xe8, 0x20, 0x1a, 0xb0, 0x7f, 0xbc, 0x98, - 0xca, 0x53, 0xa6, 0x67, 0x06, 0xca, 0x8f, 0x15, 0xf5, 0xa7, 0x80, 0x7f, - 0x3d, 0x85, 0xfd, 0xab, 0x0d, 0x77, 0xd5, 0x9d, 0xb9, 0x37, 0x01, 0x6c, - 0x07, 0x14, 0x53, 0x70, 0xff, 0xc1, 0xad, 0x54, 0x1b, 0xbd, 0x26, 0xb4, - 0xdf, 0x1e, 0x38, 0xd1, 0xe6, 0x36, 0x04, 0xce, 0x3f, 0x55, 0xe0, 0x1f, - 0xff, 0x39, 0x5d, 0x1f, 0x7e, 0xda, 0x50, 0x1a, 0xe9, 0x8f, 0x1d, 0xf0, - 0xa7, 0x60, 0x3f, 0x32, 0xdf, 0x84, 0x3f, 0xa8, 0xb4, 0x66, 0xed, 0xf9, - 0xe4, 0x0b, 0x62, 0xe3, 0x07, 0x7e, 0x5e, 0x7e, 0xba, 0x28, 0x74, 0xfd, - 0x6c, 0x3f, 0xbc, 0xbb, 0x92, 0xc2, 0x79, 0xf0, 0x80, 0x6b, 0x04, 0xfd, - 0x85, 0xee, 0xad, 0x35, 0x82, 0xe7, 0x93, 0xcd, 0xa7, 0xcb, 0x2b, 0x7c, - 0xf9, 0x22, 0x10, 0xaa, 0x1f, 0xec, 0x97, 0x67, 0xf5, 0xda, 0xf8, 0x8b, - 0xe6, 0xa7, 0xcd, 0x38, 0xbb, 0xf4, 0xdb, 0xcf, 0x32, 0xfd, 0xd5, 0x67, - 0x99, 0xfe, 0xf5, 0x74, 0x7f, 0x40, 0xb1, 0x4d, 0x8f, 0x8b, 0x1f, 0xdf, - 0x90, 0xfc, 0x53, 0xd4, 0x79, 0x59, 0x12, 0x7e, 0x5e, 0xd8, 0x79, 0x70, - 0xdf, 0x95, 0xe2, 0xcd, 0x89, 0x14, 0xa2, 0x97, 0x83, 0xfe, 0x17, 0xfb, - 0x8b, 0xe6, 0x4d, 0xa9, 0xe2, 0x36, 0xdf, 0x5e, 0x1d, 0xbe, 0x89, 0xd9, - 0xcf, 0x5d, 0x46, 0x43, 0x72, 0x10, 0xda, 0xb2, 0xd3, 0xc9, 0xfc, 0x30, - 0xc4, 0xc7, 0xbc, 0x8e, 0xd7, 0xf9, 0xf6, 0xb3, 0x4e, 0x0b, 0xfa, 0x17, - 0x84, 0xbd, 0x34, 0x2d, 0x9c, 0x7f, 0xe6, 0xdf, 0x93, 0xa0, 0x44, 0xce, - 0x17, 0xf6, 0xd7, 0x93, 0x57, 0x11, 0x7e, 0xa1, 0x3d, 0x5e, 0x34, 0x17, - 0xa1, 0x53, 0xfe, 0x59, 0x3f, 0xe4, 0xa8, 0x81, 0x6a, 0xc0, 0xf0, 0xbc, - 0x6e, 0x8c, 0xb7, 0xcf, 0x34, 0xfe, 0x73, 0x57, 0x5f, 0x23, 0xe8, 0xf3, - 0xf7, 0xf9, 0xfe, 0x3c, 0xc1, 0xe2, 0xe9, 0x6c, 0x30, 0x5e, 0x64, 0xf3, - 0xe9, 0x79, 0xe8, 0x4b, 0x8d, 0x2d, 0xa4, 0xf8, 0xaf, 0x01, 0x61, 0x3e, - 0x38, 0xae, 0x05, 0x61, 0x66, 0xff, 0xbc, 0x87, 0x0c, 0xc1, 0xff, 0x31, - 0x79, 0x59, 0xe0, 0x35, 0xad, 0x01, 0x6d, 0xb5, 0x77, 0x8a, 0xc4, 0xcf, - 0xd8, 0x5e, 0x8c, 0x67, 0x7c, 0x79, 0x65, 0x04, 0x79, 0x21, 0xe6, 0x56, - 0x08, 0xfb, 0xcf, 0xe3, 0x0f, 0x22, 0x2f, 0x6c, 0xbf, 0x7c, 0x79, 0x21, - 0xf6, 0x17, 0x64, 0x03, 0xf2, 0x42, 0x0b, 0xc8, 0xdf, 0x50, 0xef, 0xe3, - 0x5f, 0xa4, 0xe4, 0xcf, 0xd8, 0x2f, 0xc7, 0xb9, 0xbc, 0xd6, 0xb3, 0xf8, - 0xa2, 0x01, 0xaf, 0x9f, 0xf6, 0x2d, 0xa6, 0x0e, 0x33, 0xf9, 0xd4, 0xe9, - 0xc1, 0x71, 0xf4, 0x78, 0xb2, 0xde, 0x25, 0x82, 0xbe, 0x33, 0x79, 0x50, - 0x79, 0xb9, 0x4c, 0x5e, 0xc4, 0x52, 0x8e, 0xa7, 0x7d, 0x79, 0xa4, 0x2b, - 0xf4, 0x67, 0x59, 0x3a, 0x54, 0xff, 0x89, 0x3c, 0xa0, 0x3c, 0xdd, 0x66, - 0x5f, 0x1e, 0x48, 0xbc, 0xad, 0x75, 0x01, 0x79, 0xd0, 0x75, 0xbc, 0x60, - 0x32, 0xfc, 0x5b, 0xa7, 0x24, 0x8f, 0xb7, 0xb8, 0x3c, 0x5e, 0x63, 0xcf, - 0x6f, 0x20, 0xf1, 0x31, 0x95, 0xc7, 0xcb, 0x4c, 0x1e, 0x4f, 0x08, 0xe3, - 0x35, 0xca, 0x03, 0x0c, 0x32, 0x79, 0x60, 0x05, 0x1c, 0xaf, 0xf7, 0xe5, - 0x51, 0x5f, 0xa1, 0x1f, 0xcb, 0xe3, 0xf4, 0x03, 0xce, 0xc6, 0xf7, 0x09, - 0x76, 0x9e, 0x50, 0x33, 0xcb, 0xac, 0x80, 0x3c, 0x98, 0xbf, 0x7a, 0x11, - 0x85, 0x23, 0xe8, 0x3c, 0xb5, 0x4c, 0x49, 0x1e, 0xbf, 0xaa, 0xd0, 0x8f, - 0xde, 0x46, 0x62, 0x3f, 0x68, 0xbc, 0xd9, 0x0c, 0xd7, 0x69, 0x30, 0xf9, - 0x0f, 0xc2, 0x1d, 0x71, 0x50, 0x5c, 0x04, 0xf1, 0xd7, 0xeb, 0xc1, 0xf9, - 0xb5, 0xea, 0x4b, 0xad, 0xf2, 0x41, 0xd8, 0xcb, 0x45, 0x7b, 0x23, 0xe8, - 0x0b, 0xb7, 0xc7, 0x4c, 0x3e, 0x78, 0x74, 0x8f, 0x85, 0xf8, 0x03, 0x28, - 0x1e, 0x84, 0x51, 0xc9, 0xee, 0xa6, 0x20, 0xfe, 0x6d, 0x53, 0x92, 0xcf, - 0xff, 0xf8, 0xf6, 0x86, 0x3d, 0x3f, 0x17, 0xb8, 0x3f, 0xda, 0x86, 0xc5, - 0xfc, 0x6d, 0x9d, 0x11, 0x1c, 0xaf, 0x51, 0x1e, 0x1e, 0x97, 0x07, 0x1e, - 0x1e, 0xcf, 0xfa, 0xf2, 0xc8, 0x56, 0xe8, 0xcb, 0x4a, 0x51, 0x5f, 0x62, - 0xed, 0x2f, 0x0a, 0x50, 0x16, 0x35, 0x4a, 0xf6, 0xd7, 0xbe, 0xd1, 0xf2, - 0xf1, 0x9b, 0xa7, 0x24, 0x0f, 0xda, 0x65, 0xd1, 0xe7, 0xef, 0xff, 0x44, - 0x63, 0xe0, 0x7e, 0x9b, 0xf3, 0xe5, 0xc1, 0xed, 0x6d, 0x63, 0x58, 0xfc, - 0xc8, 0xe4, 0x31, 0xfe, 0xb9, 0x88, 0x7c, 0x03, 0x19, 0x4d, 0x30, 0x79, - 0x50, 0x79, 0x15, 0x07, 0x22, 0xed, 0xf3, 0x7a, 0x62, 0x9f, 0x8b, 0x9b, - 0x69, 0x7e, 0x83, 0xe9, 0xcb, 0x44, 0xf0, 0xbe, 0xe7, 0x45, 0xe2, 0x6b, - 0x68, 0xbf, 0x86, 0x2d, 0x50, 0x5c, 0x82, 0xca, 0xdc, 0x63, 0x81, 0xfb, - 0x18, 0xc6, 0x47, 0xd3, 0xdd, 0x39, 0xa2, 0x7d, 0xba, 0xac, 0xce, 0xf7, - 0xcf, 0xfb, 0x68, 0xb8, 0x9c, 0x04, 0x2b, 0x96, 0xed, 0x35, 0xc0, 0x8e, - 0x3e, 0xd7, 0xe0, 0x8b, 0x71, 0x75, 0x0d, 0xc6, 0xc3, 0xa0, 0xc5, 0xce, - 0x6e, 0x8f, 0x8a, 0x27, 0xf3, 0xdb, 0xa0, 0x27, 0x71, 0x97, 0xdb, 0xa9, - 0x5c, 0x16, 0x55, 0xd0, 0xc1, 0x41, 0xfd, 0xf0, 0xd8, 0x56, 0xf8, 0xef, - 0x4d, 0x87, 0x1f, 0xc2, 0x02, 0x1d, 0x6a, 0xb2, 0x5f, 0x24, 0xca, 0x60, - 0x5d, 0x41, 0xf0, 0x6d, 0x16, 0xaf, 0xc2, 0x87, 0xe3, 0x78, 0x95, 0xe5, - 0x8b, 0xe0, 0x69, 0x0d, 0xdd, 0x4f, 0x3a, 0xee, 0xf6, 0x0b, 0xf7, 0xd9, - 0xd5, 0xd4, 0x5f, 0x32, 0x79, 0xec, 0x95, 0xee, 0x7b, 0x7a, 0xe0, 0xbe, - 0x17, 0xd4, 0x67, 0x66, 0x7f, 0x3a, 0x56, 0x5f, 0x13, 0xbc, 0x3f, 0xba, - 0x4c, 0xbe, 0x80, 0x3b, 0xfc, 0x7e, 0x10, 0xbc, 0x2f, 0x31, 0x79, 0xc3, - 0xf3, 0x42, 0x35, 0xa6, 0x7f, 0x86, 0xef, 0x8f, 0xc6, 0x2d, 0x5f, 0xff, - 0xad, 0x0a, 0x7b, 0xe0, 0xc4, 0xd8, 0x03, 0x6e, 0xaf, 0x98, 0x3d, 0xc0, - 0xda, 0xb9, 0xb7, 0x2e, 0x68, 0x0f, 0xf6, 0x4c, 0x83, 0x3d, 0x58, 0x65, - 0xc8, 0xf6, 0x60, 0x82, 0xf0, 0xcf, 0xd6, 0xb3, 0xff, 0xd4, 0x0c, 0x85, - 0xf3, 0x5f, 0xdc, 0x51, 0xdd, 0x1e, 0x26, 0x6b, 0xf2, 0x17, 0x55, 0xf9, - 0x9f, 0xcb, 0x7e, 0x37, 0xc3, 0xd6, 0xeb, 0x21, 0x7f, 0x53, 0xb0, 0x53, - 0xe8, 0x3e, 0x45, 0xe2, 0xcd, 0xfe, 0xe4, 0x54, 0xe4, 0x73, 0x83, 0x51, - 0xe1, 0x4f, 0x34, 0x41, 0x3e, 0xb9, 0x7e, 0x0a, 0x5b, 0x52, 0xfc, 0x2b, - 0xd1, 0x23, 0x6b, 0xf5, 0x0c, 0x96, 0x9f, 0xc0, 0xf1, 0x01, 0x8c, 0x57, - 0x2d, 0x07, 0xd8, 0x49, 0xe4, 0x0f, 0xb3, 0x9e, 0x85, 0xfc, 0xa1, 0xfd, - 0x1e, 0xd5, 0x67, 0x57, 0x43, 0xf9, 0xcf, 0x61, 0x30, 0x79, 0xdd, 0x65, - 0xf0, 0xfe, 0xe9, 0x82, 0x2e, 0x7d, 0x05, 0x56, 0xf9, 0x07, 0xb5, 0x12, - 0xb4, 0x07, 0xd0, 0xda, 0xed, 0xef, 0x34, 0xc1, 0xb3, 0x8f, 0xec, 0x21, - 0xf9, 0x51, 0x84, 0xd9, 0x63, 0x1d, 0x48, 0x20, 0xd2, 0x1b, 0x43, 0xf2, - 0xa5, 0x30, 0x9e, 0x66, 0xf6, 0x55, 0x0f, 0x9e, 0x97, 0xa7, 0x22, 0xed, - 0x8f, 0x74, 0x3e, 0x94, 0xed, 0x79, 0x26, 0xd6, 0xff, 0xa3, 0x5f, 0x6d, - 0x39, 0x1e, 0xf2, 0x3a, 0xeb, 0x7c, 0xfc, 0x0b, 0xa7, 0xa4, 0xcf, 0xf7, - 0xf1, 0xfd, 0xe2, 0xfe, 0xab, 0x49, 0xd8, 0xaf, 0xfe, 0xfe, 0x26, 0x15, - 0x7d, 0x7e, 0xaa, 0x6a, 0x3c, 0x18, 0x65, 0x9f, 0xc4, 0xf3, 0x1c, 0xc5, - 0xef, 0xc3, 0x95, 0xe7, 0x4f, 0xe4, 0x17, 0x4c, 0xaa, 0xf0, 0x0b, 0x46, - 0xaa, 0x9e, 0xbf, 0x28, 0x7e, 0x6b, 0x3b, 0x7f, 0x5b, 0x2b, 0xcf, 0xc3, - 0x2c, 0x91, 0xdf, 0xfe, 0x59, 0x71, 0xfe, 0xd1, 0xaf, 0x0f, 0x44, 0xd8, - 0x73, 0xf0, 0x3e, 0xd6, 0x7f, 0xe2, 0x50, 0xc6, 0x53, 0x8c, 0x7f, 0x66, - 0xbf, 0xd9, 0xf9, 0x99, 0x43, 0xf4, 0xbf, 0x45, 0x83, 0xf6, 0x18, 0xe7, - 0x6f, 0xa1, 0x81, 0xee, 0x69, 0x48, 0xa1, 0x16, 0xff, 0xc4, 0x0a, 0x72, - 0x1e, 0x4e, 0x92, 0xfe, 0x2e, 0xcb, 0x06, 0x49, 0x1b, 0x84, 0x9c, 0x07, - 0x2d, 0x78, 0x1e, 0x90, 0xfa, 0x35, 0xa0, 0xff, 0xcb, 0x2f, 0xe1, 0xf1, - 0x06, 0x32, 0xc1, 0x4c, 0x9e, 0x39, 0xd0, 0x05, 0x56, 0x59, 0x81, 0xfc, - 0x91, 0x96, 0xd5, 0x68, 0x7e, 0x3c, 0x29, 0xf5, 0x4f, 0x26, 0xc2, 0xfc, - 0x03, 0xd9, 0x9f, 0xe7, 0x75, 0x7f, 0x3f, 0x02, 0xf2, 0xf6, 0xe2, 0xee, - 0x5f, 0x6c, 0xbf, 0x58, 0x3b, 0xf0, 0xe4, 0x6c, 0xf2, 0x3c, 0x1e, 0x0f, - 0xd4, 0x68, 0x2f, 0x87, 0xd8, 0xfc, 0xd9, 0x2c, 0x7f, 0x94, 0x46, 0xf1, - 0x95, 0x4b, 0xec, 0x63, 0x0e, 0x8d, 0xe6, 0x6c, 0x13, 0x58, 0xcb, 0x88, - 0x3d, 0x02, 0xeb, 0x58, 0x3e, 0xfa, 0xd4, 0x3c, 0x92, 0x7f, 0x82, 0xbc, - 0xa7, 0x52, 0xc8, 0x8e, 0xba, 0x83, 0x48, 0x1f, 0x69, 0xfe, 0xd3, 0x7d, - 0x40, 0xb3, 0x63, 0xf6, 0x7b, 0xaf, 0x94, 0x0f, 0x3d, 0xca, 0xef, 0xbf, - 0x3b, 0x59, 0x3d, 0x08, 0x20, 0xfe, 0xd9, 0xfc, 0x4f, 0xdc, 0x2c, 0xfa, - 0xeb, 0x7f, 0xe2, 0xf3, 0x59, 0xfe, 0xae, 0xd7, 0x22, 0xeb, 0x0f, 0xe0, - 0x13, 0x79, 0x18, 0x5c, 0x1e, 0x84, 0x9f, 0x14, 0xc9, 0xdf, 0x95, 0xe2, - 0xf3, 0x77, 0xee, 0x42, 0x62, 0x7f, 0x58, 0xfe, 0xa1, 0x78, 0x8a, 0xe6, - 0x1f, 0xb2, 0x82, 0xbd, 0xf4, 0xf3, 0x6f, 0x62, 0xbe, 0xf4, 0x99, 0xee, - 0xf0, 0xfa, 0x86, 0xec, 0xff, 0xd9, 0x7a, 0xd2, 0x11, 0xf9, 0x68, 0x26, - 0x9f, 0x7a, 0x29, 0x7f, 0x9d, 0xa9, 0x92, 0xbf, 0xce, 0xd2, 0xf1, 0x1c, - 0x4b, 0x16, 0x4a, 0xf8, 0xb3, 0x02, 0xf1, 0x0e, 0x96, 0x6f, 0x64, 0x7d, - 0x26, 0xab, 0x89, 0xf5, 0x8d, 0xf0, 0x7c, 0xf8, 0xb1, 0x6e, 0x31, 0xde, - 0x4f, 0xeb, 0xb3, 0xcd, 0xb8, 0xfc, 0xb9, 0x34, 0xbf, 0xa8, 0x38, 0x1f, - 0xd4, 0xd3, 0xf9, 0xec, 0x79, 0x33, 0x29, 0x2c, 0xcf, 0xa7, 0xeb, 0x2b, - 0x3d, 0x3a, 0xf6, 0x7e, 0x22, 0x2e, 0x9f, 0xfc, 0x8f, 0xb7, 0xab, 0xe5, - 0x93, 0xbf, 0xf8, 0x27, 0xb5, 0xd6, 0x4f, 0x79, 0x7c, 0xa7, 0x94, 0x9f, - 0xdf, 0x68, 0xab, 0xf1, 0x33, 0xae, 0xab, 0xcd, 0x7f, 0x6f, 0x95, 0x2a, - 0xff, 0xe1, 0xf1, 0x14, 0xaf, 0x1f, 0x48, 0xf4, 0xef, 0xbd, 0x5d, 0x90, - 0x3f, 0x28, 0xda, 0xd9, 0xd8, 0x7c, 0xed, 0x2f, 0x8d, 0x70, 0x7e, 0x6a, - 0xa5, 0x9f, 0x9f, 0x97, 0x8d, 0xad, 0x17, 0xec, 0x79, 0x44, 0x79, 0xbd, - 0x29, 0x95, 0xfd, 0xfa, 0xf6, 0x6d, 0xa2, 0x7e, 0xda, 0x55, 0xf8, 0xf9, - 0xad, 0xa6, 0xb6, 0x5f, 0xff, 0xb2, 0x5f, 0xa4, 0x5f, 0x4d, 0x9e, 0x69, - 0x53, 0x8d, 0xfe, 0x75, 0x91, 0xf5, 0x9d, 0x7a, 0xa9, 0x5e, 0xc1, 0xfc, - 0x31, 0xa9, 0x6f, 0xb1, 0xfb, 0x51, 0xe9, 0xa3, 0x0b, 0x89, 0xff, 0xdd, - 0x63, 0xe3, 0x6c, 0xee, 0x67, 0xe6, 0xf7, 0x6a, 0x61, 0xf7, 0x3f, 0xb9, - 0x9e, 0x9b, 0x61, 0xe7, 0x1d, 0x5e, 0xee, 0x5c, 0x85, 0xf5, 0x57, 0xdb, - 0xef, 0xf6, 0x3f, 0x50, 0x5b, 0xff, 0x8d, 0xfb, 0xaa, 0xe4, 0xc3, 0xc1, - 0x92, 0xb8, 0x7c, 0x38, 0xbc, 0x56, 0x90, 0xfa, 0x45, 0xed, 0xf3, 0xdb, - 0xc4, 0xf9, 0x65, 0x27, 0x76, 0x3e, 0x00, 0xf3, 0x95, 0xec, 0xa3, 0x46, - 0xed, 0x61, 0xd4, 0x7a, 0xaf, 0x58, 0xa6, 0x26, 0x9f, 0xc5, 0x8d, 0x22, - 0xfd, 0xa6, 0x3b, 0xb4, 0x58, 0xf9, 0xff, 0x78, 0x49, 0x95, 0xf3, 0x9c, - 0x17, 0xd7, 0xbb, 0xb5, 0x5e, 0x3c, 0xcf, 0xb7, 0x6c, 0x01, 0xdc, 0x5f, - 0xe1, 0xf9, 0x3d, 0xe2, 0xfc, 0x51, 0x69, 0x7e, 0xc3, 0x31, 0x23, 0x96, - 0x9f, 0x27, 0xaf, 0x52, 0x5b, 0xef, 0xcd, 0x75, 0x6a, 0xf3, 0x3f, 0xb8, - 0x40, 0x6d, 0xfe, 0xf6, 0x55, 0x6a, 0xf3, 0xff, 0x4e, 0xb1, 0xde, 0x79, - 0x2a, 0xab, 0xe8, 0x3f, 0xd6, 0xa8, 0xcd, 0xdf, 0x70, 0xe3, 0xd4, 0xfa, - 0x87, 0x18, 0xfe, 0x5b, 0xd7, 0xab, 0x3d, 0xef, 0xde, 0x1f, 0x19, 0x6a, - 0xe7, 0xf9, 0x27, 0x6a, 0xf3, 0x8f, 0xbd, 0xae, 0x36, 0xff, 0x7b, 0x9f, - 0x56, 0xe3, 0xff, 0x5b, 0xcf, 0xa9, 0xd1, 0xdf, 0xa6, 0x68, 0xbf, 0xc7, - 0x93, 0xe1, 0xf3, 0x75, 0x30, 0x72, 0x94, 0xd4, 0xe7, 0x68, 0xfc, 0x09, - 0x32, 0x42, 0xfc, 0xea, 0xd7, 0x27, 0x58, 0x3f, 0x46, 0x44, 0x3c, 0x5c, - 0x5c, 0x22, 0xc6, 0xc3, 0x2e, 0x8b, 0x87, 0xc5, 0x7a, 0x76, 0x20, 0x1e, - 0xd6, 0xe2, 0xee, 0x7b, 0xff, 0x61, 0x51, 0xfa, 0x2e, 0x8a, 0x8f, 0xf7, - 0x42, 0x8c, 0x7e, 0xad, 0x38, 0xa4, 0x8d, 0x45, 0xcd, 0x6f, 0x54, 0x3c, - 0x8f, 0xff, 0x9a, 0x94, 0xfa, 0x1b, 0x54, 0xe7, 0x5b, 0x4e, 0x6c, 0xfd, - 0xfa, 0x70, 0xcd, 0xdf, 0x9f, 0x68, 0x98, 0x52, 0xfc, 0xf7, 0xed, 0x88, - 0x78, 0x88, 0x57, 0xea, 0x69, 0xbc, 0x8e, 0xea, 0x39, 0x19, 0x74, 0xd6, - 0x69, 0xff, 0x10, 0xf6, 0xc7, 0x6e, 0x32, 0x13, 0xa4, 0xaf, 0x52, 0xdf, - 0xd7, 0xc1, 0x55, 0xb1, 0xf5, 0xfd, 0xca, 0x7a, 0xef, 0x88, 0x94, 0xff, - 0xe2, 0xfa, 0x14, 0x9e, 0xef, 0x92, 0xf4, 0xcb, 0xa4, 0xfa, 0x95, 0x6b, - 0xab, 0x56, 0xff, 0xa5, 0xfa, 0x96, 0x63, 0x05, 0x39, 0xe6, 0xff, 0x77, - 0x09, 0xcf, 0xf7, 0xda, 0x4f, 0x68, 0x6e, 0xcb, 0x85, 0xa9, 0x51, 0x93, - 0x3c, 0xdf, 0x05, 0x2e, 0xe9, 0x07, 0x9b, 0xdc, 0x04, 0x4a, 0x07, 0x48, - 0x3d, 0x52, 0x9f, 0x89, 0x23, 0x34, 0xfa, 0xfe, 0xd6, 0x7d, 0x2c, 0x81, - 0x4d, 0xde, 0x87, 0xec, 0x86, 0x1a, 0x89, 0x4b, 0x4c, 0x9a, 0xe7, 0xcd, - 0xb0, 0xfd, 0x7a, 0x03, 0xda, 0x17, 0x1d, 0x8c, 0xb1, 0x7c, 0xb4, 0x3b, - 0xc0, 0xfa, 0xe9, 0x72, 0x16, 0xee, 0xa7, 0x43, 0xf4, 0xb7, 0xcf, 0x1f, - 0x43, 0xf3, 0x93, 0xb3, 0x83, 0xf4, 0x2f, 0x12, 0xe9, 0xf7, 0x00, 0x6f, - 0x04, 0xd1, 0x77, 0x35, 0x2f, 0x8f, 0xe8, 0x57, 0xeb, 0x07, 0x09, 0xcd, - 0x17, 0x76, 0xe2, 0x7c, 0xaf, 0x4d, 0xea, 0xd7, 0x6c, 0x2b, 0xeb, 0xc3, - 0xf4, 0x8b, 0xd6, 0xfb, 0xca, 0x1f, 0xeb, 0xac, 0x5e, 0xf1, 0x25, 0x16, - 0x52, 0x44, 0xe4, 0x7b, 0x90, 0x84, 0xd1, 0x17, 0x0d, 0x2c, 0x80, 0x9f, - 0x25, 0xad, 0x47, 0xaf, 0xa0, 0xc7, 0xd6, 0xe7, 0x7d, 0x14, 0xb6, 0x3e, - 0x39, 0x5f, 0x8d, 0xfa, 0x59, 0x96, 0xa3, 0x7e, 0x16, 0xc4, 0x7f, 0x02, - 0xf7, 0xb3, 0x30, 0x7e, 0xac, 0x28, 0xfe, 0xc9, 0xfe, 0x5d, 0xc5, 0xfb, - 0xe3, 0x00, 0xd8, 0x67, 0xf8, 0xf8, 0x28, 0x03, 0xef, 0x6a, 0x98, 0x5f, - 0xab, 0x92, 0x5f, 0x00, 0xae, 0x95, 0xe5, 0x4f, 0xde, 0xdf, 0x1b, 0x35, - 0xbc, 0xa2, 0x61, 0x47, 0xfa, 0xab, 0x97, 0xcd, 0xe8, 0xf8, 0x05, 0xfd, - 0xfc, 0x7c, 0x3c, 0xfe, 0xfe, 0xfd, 0x8b, 0xf1, 0xa9, 0xf5, 0x8f, 0x55, - 0x3b, 0x5f, 0x26, 0x3c, 0x5f, 0xab, 0xcc, 0xe0, 0xf9, 0x8a, 0xca, 0x5f, - 0x84, 0x9f, 0x27, 0xbe, 0x1f, 0xd6, 0x7c, 0xac, 0xcf, 0xe8, 0x81, 0x6e, - 0xda, 0xae, 0x6b, 0xaf, 0x5f, 0x06, 0x4a, 0x8d, 0xe0, 0x80, 0x9d, 0xc9, - 0x18, 0x7a, 0xfd, 0xd0, 0x97, 0xb4, 0xa1, 0x7e, 0xcd, 0x1e, 0xd6, 0xc6, - 0xe6, 0x3c, 0x63, 0x97, 0xb6, 0xff, 0xed, 0x42, 0xaf, 0x1d, 0xde, 0x86, - 0xf6, 0xcf, 0x48, 0x78, 0x69, 0x6f, 0x09, 0x59, 0x87, 0xd5, 0x9a, 0xc3, - 0x79, 0x88, 0xa1, 0xf9, 0x88, 0x3f, 0xef, 0xbb, 0xc4, 0x92, 0x78, 0xe6, - 0x37, 0xec, 0x92, 0x81, 0xee, 0xe3, 0x16, 0xb3, 0x2f, 0x37, 0x09, 0xef, - 0xb3, 0x57, 0xed, 0x3f, 0xe6, 0xfd, 0x4f, 0xef, 0xe0, 0xf3, 0xee, 0xbf, - 0x86, 0xb9, 0x82, 0xe8, 0x1b, 0xcd, 0x97, 0x27, 0x1e, 0xe4, 0xfd, 0x12, - 0x46, 0x09, 0xe7, 0xf7, 0xf2, 0xa0, 0x48, 0xf2, 0x7b, 0x7a, 0xb1, 0x31, - 0x35, 0x68, 0x10, 0x0d, 0xdf, 0x01, 0xc0, 0x7a, 0x76, 0x3e, 0x72, 0x58, - 0xbf, 0x34, 0x11, 0x1f, 0xed, 0x86, 0x9b, 0x16, 0xfb, 0x13, 0x00, 0xf8, - 0x5a, 0x12, 0xf5, 0x4b, 0x41, 0x61, 0x8f, 0x51, 0xcb, 0x59, 0x5a, 0x9c, - 0x60, 0xfb, 0x91, 0x06, 0x53, 0xb1, 0xe7, 0x72, 0x3e, 0xe7, 0xdf, 0x0e, - 0x4a, 0xfd, 0x9f, 0xac, 0x1f, 0x57, 0x03, 0xc5, 0xf9, 0x68, 0xd1, 0xc5, - 0xc1, 0xb4, 0x9b, 0x43, 0xfa, 0xd9, 0x9a, 0x0a, 0xe6, 0xd3, 0xe1, 0x25, - 0xc9, 0x73, 0x5b, 0x94, 0x9f, 0xe7, 0xbd, 0x73, 0x50, 0xc8, 0xff, 0x80, - 0x5f, 0x1f, 0x8c, 0xd7, 0xdf, 0xff, 0x3a, 0x38, 0xc5, 0xfe, 0x4e, 0xa9, - 0x7e, 0x68, 0x85, 0xec, 0x5f, 0x1a, 0xc5, 0xca, 0x2f, 0x8a, 0xf1, 0xfc, - 0xdf, 0x98, 0x8c, 0x5e, 0x97, 0x4e, 0xfc, 0x35, 0xf3, 0x27, 0xbb, 0x24, - 0xff, 0xc2, 0xfb, 0xcb, 0x85, 0xfa, 0xde, 0x7f, 0xc7, 0xaf, 0x87, 0x3f, - 0xdf, 0x77, 0x78, 0x2b, 0xd9, 0x79, 0x13, 0x60, 0xff, 0x7b, 0x66, 0x14, - 0xf6, 0xeb, 0xc7, 0x39, 0x2a, 0x7f, 0x61, 0xbc, 0xc2, 0xbe, 0x91, 0xec, - 0x66, 0x22, 0x50, 0x8f, 0x43, 0x3f, 0x27, 0xa7, 0x5b, 0x7f, 0x3e, 0x94, - 0xf7, 0x87, 0xe9, 0x8f, 0x0b, 0x8a, 0x9f, 0x6c, 0xd9, 0xae, 0xd3, 0xe7, - 0x43, 0x7a, 0x57, 0x8a, 0xfa, 0x23, 0x7f, 0x0f, 0xad, 0x46, 0xfd, 0xf9, - 0xe8, 0x5c, 0xe9, 0x8f, 0xd4, 0x1f, 0x63, 0xc9, 0xfb, 0x03, 0xd1, 0x2d, - 0xd4, 0x22, 0xe4, 0x45, 0xea, 0x8f, 0x41, 0xe2, 0xb7, 0x7e, 0x4d, 0xca, - 0xd7, 0x4a, 0xfa, 0x24, 0xe8, 0x0f, 0x48, 0x1c, 0xaa, 0xa6, 0x3f, 0x2b, - 0xa5, 0x7c, 0x33, 0xad, 0x97, 0x57, 0xd6, 0x77, 0x0c, 0x31, 0xbe, 0x86, - 0xfb, 0x8c, 0xf3, 0xcd, 0x45, 0x10, 0xdf, 0x2f, 0xba, 0x20, 0x3e, 0xfe, - 0xf1, 0xde, 0x89, 0x8a, 0xb7, 0x35, 0x1c, 0x6f, 0x4f, 0x3e, 0x66, 0xa2, - 0xf1, 0xf4, 0xd7, 0xe7, 0x23, 0x6b, 0xe2, 0xbd, 0xf4, 0x74, 0x11, 0x94, - 0xb1, 0x3d, 0xe4, 0xfd, 0x6d, 0x1a, 0xee, 0x17, 0x6d, 0xcb, 0x6e, 0x73, - 0x1b, 0xf6, 0xae, 0xc8, 0xa5, 0x26, 0x0d, 0x14, 0x6f, 0x93, 0xf3, 0x80, - 0xac, 0xfb, 0x32, 0xe0, 0x26, 0x82, 0xf5, 0x96, 0x7e, 0xa1, 0x7f, 0xf9, - 0xc5, 0x05, 0x81, 0x7c, 0x0d, 0xea, 0x47, 0x9e, 0x5c, 0x8c, 0xca, 0x28, - 0xfe, 0x7c, 0xab, 0xc6, 0xf9, 0x26, 0x9a, 0x6f, 0xc3, 0x43, 0xb0, 0x45, - 0x03, 0x83, 0xe1, 0xf3, 0x4d, 0xa8, 0x1b, 0xa3, 0x9b, 0x69, 0x3c, 0x6b, - 0x65, 0xa9, 0x7d, 0x24, 0xfb, 0x19, 0x36, 0x3f, 0x19, 0x9c, 0x1f, 0xa1, - 0xcf, 0x7f, 0x19, 0x91, 0x9f, 0xae, 0xe8, 0x9f, 0xcf, 0x21, 0xfd, 0x40, - 0xce, 0xfb, 0x7d, 0xad, 0x34, 0xe8, 0xeb, 0x47, 0x3a, 0x52, 0x3f, 0xb2, - 0x86, 0x93, 0x0c, 0xde, 0x9f, 0x3a, 0x63, 0xfb, 0xdb, 0x43, 0xea, 0x5b, - 0xcc, 0xe2, 0x64, 0x43, 0xeb, 0xd5, 0xf8, 0x3f, 0x3b, 0x52, 0xe8, 0x3c, - 0x7b, 0x7e, 0x7f, 0x08, 0xe7, 0x9f, 0x1c, 0x65, 0xfe, 0x49, 0xa3, 0x7c, - 0x78, 0xbf, 0xec, 0x41, 0x23, 0x50, 0x5f, 0xd2, 0xd4, 0xf8, 0xbb, 0x93, - 0xf1, 0x97, 0x88, 0xea, 0x5f, 0x6c, 0xc0, 0xf1, 0x1e, 0xd3, 0xdf, 0x9d, - 0x5a, 0xb0, 0xfe, 0x22, 0xe7, 0xf7, 0xc3, 0xf3, 0xf3, 0x2f, 0x04, 0xf8, - 0x0b, 0xe7, 0xa7, 0x2b, 0x11, 0x9d, 0x9f, 0xeb, 0xc4, 0x16, 0x0e, 0xe2, - 0xeb, 0xd5, 0xeb, 0x0b, 0xaa, 0xf4, 0x23, 0xef, 0x8b, 0xa0, 0xe6, 0x7c, - 0x72, 0xac, 0xbd, 0x97, 0xed, 0x77, 0x44, 0xfe, 0xaf, 0x68, 0x04, 0xfa, - 0xa3, 0xc5, 0xfb, 0x69, 0xeb, 0x34, 0xd1, 0x6f, 0x63, 0xfd, 0xbc, 0xe4, - 0xfd, 0xa0, 0x1c, 0xa3, 0xdf, 0x3c, 0x4d, 0xf4, 0x49, 0xbf, 0x33, 0xd2, - 0x67, 0x6c, 0xaf, 0x9a, 0x79, 0xff, 0xc5, 0x34, 0xd1, 0x27, 0xfd, 0xce, - 0xdc, 0x1f, 0xf3, 0xfe, 0x8e, 0x75, 0xd3, 0x44, 0x9f, 0xf4, 0x3b, 0x33, - 0xff, 0x5f, 0xe4, 0xf5, 0xc7, 0x75, 0xcc, 0xbf, 0x98, 0x31, 0xe7, 0xc9, - 0x5b, 0xbd, 0xc8, 0x9a, 0xec, 0xee, 0x41, 0xb7, 0xdd, 0x47, 0xd9, 0xf7, - 0x42, 0x4c, 0x16, 0x8f, 0xd6, 0xe2, 0x8f, 0x77, 0x7e, 0x2f, 0x90, 0x9f, - 0x48, 0xf8, 0xfa, 0x8e, 0xd9, 0xc9, 0x04, 0xf4, 0x01, 0x9f, 0xbe, 0xe7, - 0x02, 0xfd, 0x45, 0xfd, 0xec, 0x7b, 0x3f, 0x35, 0x7d, 0x9f, 0xa4, 0xba, - 0x7e, 0x73, 0xff, 0x67, 0x56, 0xf1, 0x7f, 0xd4, 0x3f, 0xc2, 0x28, 0x1c, - 0xfb, 0x3f, 0x10, 0x5f, 0x6f, 0xf5, 0x88, 0xfd, 0xc8, 0x61, 0x7f, 0x07, - 0x6f, 0xb6, 0xc5, 0xd3, 0xd7, 0xc1, 0xfb, 0x47, 0x9e, 0xc7, 0xe7, 0x16, - 0xb9, 0xcf, 0xb9, 0x26, 0xf2, 0xe7, 0x83, 0x4f, 0xb6, 0xad, 0xde, 0xa2, - 0x7b, 0x23, 0xda, 0x18, 0x48, 0x43, 0x7b, 0xed, 0xb6, 0x3f, 0x75, 0xe4, - 0x8a, 0x49, 0x0d, 0x9a, 0x9e, 0xfc, 0x95, 0x6b, 0x07, 0x74, 0x74, 0x1f, - 0xf8, 0x41, 0xdb, 0x3a, 0xf0, 0x53, 0x72, 0x1f, 0x08, 0x5d, 0xdf, 0xf3, - 0x29, 0x5f, 0x9e, 0x4e, 0x30, 0x3f, 0x84, 0xf7, 0x62, 0x43, 0xc6, 0xff, - 0xde, 0x16, 0xaf, 0xb7, 0x47, 0x7c, 0x6f, 0x8b, 0xd5, 0xf7, 0xc5, 0xf7, - 0xbd, 0x0e, 0xf9, 0xf4, 0x8b, 0x6d, 0x35, 0xe4, 0x9f, 0xd8, 0x7c, 0x52, - 0x0f, 0x49, 0xe9, 0xa8, 0xde, 0x4e, 0xfc, 0x2b, 0xaf, 0x6f, 0x57, 0x89, - 0x37, 0x78, 0xbe, 0x85, 0xc6, 0x1b, 0xf9, 0xf8, 0x78, 0x83, 0xe6, 0xf3, - 0x68, 0x36, 0x3a, 0xc1, 0xfc, 0x8b, 0x4b, 0xe4, 0x9f, 0x44, 0xf2, 0x77, - 0x87, 0x03, 0xfd, 0xf5, 0x56, 0x2f, 0x7e, 0x9f, 0xce, 0xd3, 0x91, 0xbf, - 0x1c, 0x4c, 0x1d, 0xed, 0x38, 0xad, 0xbb, 0x23, 0x10, 0x36, 0xa1, 0xfc, - 0xed, 0xf6, 0x0f, 0xc7, 0x0d, 0x56, 0xdf, 0xde, 0x85, 0xfa, 0x01, 0x2c, - 0x14, 0x3f, 0xd8, 0x83, 0xd1, 0xf9, 0xbf, 0x48, 0xf9, 0x63, 0x73, 0xb9, - 0xa1, 0xde, 0x97, 0x7f, 0xfd, 0xff, 0x6b, 0xf9, 0xcb, 0xfd, 0x05, 0x26, - 0x37, 0x56, 0x6b, 0x0c, 0x31, 0x3e, 0x61, 0xfe, 0x5a, 0xec, 0x3f, 0xa8, - 0xf4, 0xf7, 0xf4, 0xfd, 0xc9, 0xdc, 0x24, 0x8e, 0x97, 0xb8, 0x7d, 0xcb, - 0xc5, 0xdb, 0x37, 0xf6, 0x3c, 0x93, 0x37, 0x97, 0xac, 0x89, 0x7b, 0xff, - 0xc6, 0xc6, 0xf7, 0x8b, 0xa0, 0xbd, 0x65, 0xf6, 0x87, 0xcb, 0x9a, 0x7c, - 0x8f, 0xcc, 0x86, 0x06, 0xca, 0x6d, 0x19, 0x4c, 0x20, 0x7b, 0xef, 0xa5, - 0x84, 0x7e, 0xc4, 0x19, 0xd8, 0xfe, 0xe9, 0xe2, 0x7c, 0xee, 0x2e, 0x19, - 0xcc, 0xbe, 0xf4, 0x1b, 0x55, 0x8f, 0x65, 0xf7, 0x05, 0xf6, 0x7c, 0x5b, - 0xc4, 0xc7, 0xac, 0xa1, 0xbd, 0x2d, 0x30, 0x7f, 0xf0, 0xfb, 0xec, 0xf9, - 0x59, 0x76, 0x9f, 0xc3, 0xf7, 0xe9, 0xc0, 0xfb, 0xb0, 0x41, 0xff, 0x4a, - 0xd8, 0xdb, 0xa6, 0x21, 0x7d, 0xec, 0x49, 0x08, 0xfd, 0x67, 0xf5, 0x02, - 0x7e, 0xce, 0x89, 0x78, 0xdf, 0x8b, 0xfc, 0xbc, 0x15, 0x11, 0x5f, 0x70, - 0x7f, 0x28, 0xd8, 0x6f, 0x9f, 0x7f, 0xe2, 0x1a, 0xd0, 0x27, 0x6b, 0xe9, - 0xfb, 0xaa, 0xbe, 0x3f, 0x4b, 0x09, 0xcf, 0x67, 0xfe, 0x4e, 0x5a, 0x0f, - 0xcf, 0x0f, 0x9f, 0x64, 0xfc, 0xdd, 0x07, 0xa4, 0x7c, 0x02, 0x99, 0xdf, - 0x2a, 0xe1, 0x57, 0xb9, 0x7f, 0x66, 0x0f, 0x89, 0xf7, 0xc1, 0xc6, 0xf8, - 0xfb, 0x93, 0x37, 0xe3, 0xd0, 0x14, 0xef, 0x83, 0xf4, 0x1f, 0xee, 0x79, - 0x4c, 0x13, 0xfa, 0x57, 0xaa, 0xe8, 0x27, 0x7e, 0xff, 0xa6, 0x27, 0x90, - 0xaf, 0x6b, 0x8c, 0x9f, 0x9f, 0x07, 0x3b, 0x2d, 0x91, 0xbf, 0xe2, 0x62, - 0x9a, 0xef, 0x0c, 0x3f, 0x2f, 0x26, 0x3b, 0x9f, 0x8c, 0xc0, 0xa3, 0x59, - 0x81, 0xbf, 0x14, 0x1d, 0x47, 0xc3, 0x6b, 0x91, 0xfe, 0xb5, 0x8a, 0xf1, - 0x29, 0xa3, 0x07, 0xf7, 0xbb, 0x18, 0xf4, 0xff, 0x68, 0xbe, 0x13, 0x22, - 0x1f, 0xf9, 0xf9, 0x8c, 0x3e, 0xf7, 0x8f, 0xad, 0x0b, 0xd0, 0xe2, 0x2a, - 0xe6, 0x13, 0x7b, 0x36, 0x84, 0xf3, 0x01, 0xe8, 0x7e, 0x17, 0x25, 0x7f, - 0x89, 0x3e, 0xd4, 0x82, 0x35, 0x46, 0xdc, 0x7e, 0x55, 0xd6, 0xb3, 0xc3, - 0xe7, 0x47, 0xd9, 0x5b, 0x79, 0x3d, 0x0c, 0x5f, 0x8e, 0x87, 0x30, 0xbd, - 0x40, 0x7c, 0xef, 0xd7, 0xc3, 0xc3, 0xf7, 0x13, 0x72, 0x5e, 0x0c, 0xea, - 0x2f, 0xc2, 0x5f, 0x55, 0x9d, 0x7f, 0xa0, 0xcb, 0xfc, 0xc7, 0xc7, 0x83, - 0xae, 0x6f, 0x9f, 0xc3, 0xd7, 0xb7, 0x2f, 0x6a, 0xbe, 0x0d, 0x3c, 0x77, - 0x4e, 0xe8, 0xfd, 0x2f, 0xd4, 0xbf, 0xf1, 0x78, 0x1c, 0xde, 0x9f, 0x7b, - 0x98, 0x7d, 0xc8, 0x05, 0xe3, 0xff, 0x66, 0x96, 0xdf, 0xfe, 0xcd, 0xbc, - 0x88, 0xfe, 0x1c, 0x12, 0xbf, 0xc6, 0x9f, 0x97, 0xd2, 0xab, 0xf7, 0x8b, - 0xeb, 0xf7, 0x6a, 0xd3, 0x7f, 0x6e, 0xbf, 0x68, 0xbe, 0x86, 0xad, 0x37, - 0x59, 0x45, 0x3e, 0xe2, 0xf3, 0xbf, 0x8e, 0xf3, 0xf9, 0xc0, 0x04, 0x63, - 0x35, 0xca, 0x13, 0x86, 0xbc, 0x6b, 0x0c, 0xdf, 0x3e, 0xa2, 0x4f, 0x22, - 0x93, 0x7c, 0x97, 0x3c, 0x5e, 0xc3, 0x7d, 0xf8, 0x77, 0xe4, 0xdf, 0x3b, - 0xa6, 0xc5, 0xbf, 0xfb, 0xfe, 0xba, 0xe3, 0xbc, 0xbf, 0x9e, 0x46, 0x7f, - 0xfd, 0x87, 0x11, 0xf5, 0x74, 0x6e, 0x9f, 0x22, 0xe4, 0xe7, 0x11, 0x67, - 0x13, 0xf8, 0x7e, 0xc3, 0xa3, 0x4a, 0xfe, 0x1a, 0x91, 0xce, 0xd4, 0x05, - 0xfd, 0xf5, 0xfa, 0xe9, 0xf0, 0xd7, 0xde, 0x4c, 0x45, 0x7f, 0xdd, 0x34, - 0x45, 0x7f, 0xcd, 0xeb, 0x75, 0x3b, 0x85, 0xef, 0x8b, 0x78, 0x4c, 0x3f, - 0x89, 0x98, 0x86, 0xeb, 0xd9, 0x79, 0x8d, 0xf4, 0xdf, 0xfb, 0x89, 0xff, - 0xe6, 0xcf, 0x77, 0x2f, 0xae, 0x62, 0x8f, 0x3a, 0x54, 0xfc, 0x15, 0xf4, - 0x9f, 0x1d, 0xa2, 0xff, 0xdc, 0x19, 0xfe, 0xbe, 0x73, 0xd0, 0x7f, 0xf6, - 0x28, 0xf9, 0xcf, 0x0e, 0x45, 0xff, 0xa9, 0xc6, 0x3f, 0x9b, 0x5f, 0xbb, - 0xbf, 0xec, 0x98, 0x66, 0x7f, 0xd9, 0xa1, 0xe8, 0x2f, 0x3b, 0x14, 0xfd, - 0x65, 0xc7, 0x19, 0xfb, 0x4b, 0xfb, 0x8c, 0xfc, 0x65, 0x47, 0xbc, 0xbf, - 0x7c, 0x5e, 0xf2, 0x97, 0xa0, 0x36, 0xfd, 0x94, 0xdf, 0x77, 0xf1, 0xfd, - 0x65, 0xf4, 0xf3, 0x6c, 0xbc, 0x9f, 0xac, 0x9e, 0x7b, 0x8e, 0xfc, 0x15, - 0xfd, 0xfe, 0x84, 0xfc, 0x7d, 0x89, 0xa8, 0xfd, 0x02, 0x3c, 0xbf, 0x7b, - 0x66, 0xdf, 0x03, 0x20, 0xfd, 0x20, 0x1b, 0x20, 0x85, 0xab, 0xd1, 0xf7, - 0x97, 0x02, 0xf5, 0x8f, 0xf0, 0x7e, 0x23, 0x0e, 0xf8, 0xf9, 0x5d, 0x0d, - 0xd5, 0x7f, 0xeb, 0x2d, 0x0f, 0xae, 0xd7, 0x7f, 0xdf, 0x89, 0xf1, 0x0b, - 0xda, 0xb2, 0xba, 0xdb, 0xb2, 0x17, 0x8a, 0x75, 0x32, 0xb4, 0xdf, 0x08, - 0x1a, 0x56, 0x4d, 0xb0, 0xd7, 0x35, 0xe6, 0xcb, 0xa2, 0xe4, 0x61, 0x27, - 0xa1, 0xfe, 0xce, 0xdc, 0x90, 0x1e, 0xbd, 0x6c, 0x19, 0x28, 0x65, 0x41, - 0xde, 0x86, 0x7b, 0xbf, 0xb7, 0x39, 0x91, 0x40, 0xf9, 0x05, 0xfc, 0x7d, - 0x29, 0x80, 0x3f, 0x92, 0xed, 0x69, 0xa4, 0x63, 0xc1, 0x06, 0xad, 0xc0, - 0x6d, 0x83, 0xfa, 0x3e, 0x9a, 0xf0, 0xf3, 0x21, 0xb4, 0xb4, 0x0e, 0x7a, - 0x06, 0x4a, 0x5a, 0x85, 0xfe, 0x77, 0x00, 0xd0, 0x84, 0xde, 0x0f, 0xdb, - 0x3f, 0x00, 0x50, 0x3f, 0x03, 0xd2, 0x97, 0xa5, 0x35, 0xd8, 0x1b, 0xd6, - 0x4f, 0xea, 0xf7, 0x87, 0xf5, 0x4a, 0xfd, 0x61, 0x13, 0x52, 0xbf, 0x41, - 0x6f, 0x7c, 0x7f, 0x98, 0xb7, 0x24, 0xd6, 0x9f, 0x56, 0xd6, 0xf7, 0xe9, - 0xf7, 0x4d, 0xc8, 0xe6, 0x25, 0x50, 0xfd, 0x0b, 0x7d, 0xdc, 0x2b, 0x67, - 0x9e, 0xd0, 0x5c, 0x6b, 0x4e, 0x1a, 0xbf, 0x3f, 0x87, 0xf7, 0x7b, 0x83, - 0xc1, 0x4d, 0x0e, 0xaa, 0x5f, 0xa5, 0x47, 0xa0, 0x3e, 0x0e, 0x5d, 0x3b, - 0x6a, 0xf6, 0x1b, 0xee, 0x10, 0xeb, 0x07, 0xd2, 0x33, 0xa0, 0x74, 0x09, - 0xc6, 0x47, 0xf2, 0xb2, 0x3e, 0x01, 0x78, 0x7f, 0x69, 0x25, 0x3f, 0x62, - 0x3d, 0x0c, 0x89, 0x67, 0x18, 0xd9, 0x17, 0xdb, 0x7f, 0x9f, 0x0d, 0xc3, - 0x11, 0xdf, 0xa3, 0x08, 0xf3, 0x0f, 0x2b, 0x4d, 0xbf, 0x7e, 0x31, 0xdd, - 0xdf, 0xc3, 0xa8, 0x90, 0xcf, 0x36, 0x9c, 0x9f, 0x5b, 0x38, 0x6a, 0x9e, - 0xc2, 0xf9, 0x51, 0xff, 0x7d, 0x2b, 0x22, 0x9f, 0xa2, 0x89, 0xce, 0xeb, - 0xd0, 0xf2, 0x5c, 0xa2, 0x5f, 0xc3, 0xf2, 0xc1, 0x06, 0x4b, 0xaf, 0x67, - 0xf2, 0x41, 0xfe, 0x39, 0x99, 0x8d, 0x93, 0x4f, 0x5a, 0x94, 0x0f, 0x96, - 0xef, 0xda, 0x0c, 0xf2, 0x7f, 0x45, 0x14, 0x9f, 0x07, 0x60, 0xaf, 0xc6, - 0x78, 0x7d, 0x85, 0x19, 0xd7, 0x3f, 0x76, 0x66, 0xf2, 0xa9, 0xb4, 0x0f, - 0x62, 0x7f, 0x40, 0xc0, 0x7e, 0x09, 0xf1, 0x34, 0xcf, 0x3f, 0xb6, 0xc1, - 0x78, 0xba, 0xc5, 0xd6, 0x2f, 0xc9, 0x6c, 0xd1, 0x8a, 0x5f, 0x0d, 0xf4, - 0x9b, 0xc0, 0x70, 0xcb, 0xe3, 0xef, 0x67, 0x3f, 0x9b, 0xf0, 0xf7, 0x37, - 0x24, 0x5f, 0x68, 0x82, 0xee, 0xb1, 0x7f, 0x67, 0xfe, 0x2f, 0xfe, 0x3c, - 0x05, 0xd6, 0x57, 0xdb, 0x79, 0x3a, 0x27, 0xeb, 0x03, 0xee, 0x4b, 0x7a, - 0xb0, 0x5f, 0xec, 0xcf, 0x92, 0x55, 0xd6, 0xdb, 0x73, 0xe8, 0x6c, 0xaf, - 0x97, 0xf6, 0xfb, 0x8d, 0xe2, 0xf5, 0xcd, 0x31, 0xe5, 0xef, 0xaf, 0xf1, - 0xf5, 0xb9, 0x70, 0x7d, 0x66, 0x67, 0x03, 0x98, 0xd8, 0xa2, 0x81, 0x60, - 0xbd, 0xc0, 0xf6, 0xf3, 0x5f, 0xa0, 0x38, 0x94, 0x14, 0xfb, 0xe7, 0x9e, - 0xab, 0x8b, 0x5d, 0xdf, 0xc2, 0x76, 0x03, 0x4c, 0xf0, 0xfb, 0x84, 0x62, - 0xbf, 0x63, 0x95, 0x7e, 0x2c, 0x7c, 0x7e, 0xe7, 0xd4, 0x31, 0xfb, 0x17, - 0xe8, 0xdf, 0xc3, 0xe7, 0x2d, 0x8f, 0xd7, 0x6b, 0x27, 0x68, 0x3f, 0xac, - 0xbf, 0x9e, 0x72, 0x7c, 0x7d, 0x3b, 0x90, 0x4f, 0x77, 0xdb, 0xce, 0xe6, - 0x79, 0x03, 0x83, 0x29, 0xb1, 0x5f, 0x71, 0x38, 0xa5, 0xd2, 0xbf, 0x98, - 0xb4, 0xf3, 0xc7, 0xec, 0xfb, 0xe6, 0x83, 0x35, 0xad, 0xd6, 0x24, 0xf1, - 0x43, 0x2b, 0x53, 0xf1, 0xf9, 0xfd, 0xf8, 0xfe, 0xd1, 0xe8, 0x7e, 0x89, - 0x53, 0xf2, 0xf7, 0x29, 0x89, 0xfe, 0xe9, 0xd9, 0x6d, 0xf8, 0x7b, 0x34, - 0x7c, 0xbf, 0xea, 0xd8, 0xf3, 0x4d, 0xd2, 0x1f, 0x81, 0xce, 0xcb, 0x9c, - 0xe6, 0x51, 0xa3, 0x37, 0xb6, 0x7f, 0xf9, 0xa2, 0x88, 0xbf, 0x37, 0x88, - 0xee, 0xcf, 0x99, 0x16, 0xb8, 0x7f, 0x3c, 0xde, 0xbc, 0x33, 0x19, 0x1f, - 0xaf, 0x9e, 0xa5, 0xf3, 0x13, 0xf1, 0xbe, 0x62, 0x65, 0xbe, 0x41, 0xec, - 0x87, 0xa9, 0x78, 0x7f, 0x51, 0xdb, 0x45, 0xef, 0x17, 0x94, 0x3f, 0x1d, - 0xc5, 0x33, 0x61, 0xfe, 0x14, 0x15, 0xa2, 0xc9, 0xf7, 0x0b, 0xdc, 0x74, - 0xf5, 0xfa, 0x8c, 0x7c, 0x3f, 0x9d, 0x75, 0x28, 0xfe, 0x7b, 0x6f, 0xfb, - 0x22, 0xe2, 0x17, 0x7e, 0xdf, 0x14, 0xee, 0xe3, 0xc3, 0x69, 0xe4, 0x9f, - 0x4a, 0x09, 0x5a, 0x4f, 0x72, 0x37, 0x04, 0xbe, 0x2f, 0x54, 0x2f, 0xde, - 0xa7, 0xa7, 0xd8, 0x7f, 0x35, 0x5b, 0xf1, 0x3e, 0xdd, 0x7c, 0xe8, 0x4c, - 0xbf, 0x97, 0x48, 0xe5, 0x4f, 0x0c, 0xb4, 0x3b, 0xef, 0xb8, 0x21, 0x3c, - 0xdf, 0x04, 0x49, 0x2c, 0x8f, 0x39, 0x9d, 0x79, 0xfc, 0xde, 0x55, 0xc7, - 0x7c, 0x3c, 0xc1, 0x3b, 0x8e, 0xcb, 0xfa, 0x10, 0xf3, 0x5e, 0x72, 0xde, - 0xaa, 0xdd, 0xff, 0xfc, 0x7a, 0xab, 0xf8, 0x7d, 0x50, 0x46, 0x9f, 0xac, - 0x67, 0x08, 0xe7, 0xeb, 0x8a, 0xe1, 0xf7, 0xf7, 0xe2, 0x48, 0x32, 0xe4, - 0x3e, 0x46, 0xe9, 0x91, 0x58, 0x76, 0x80, 0xf4, 0xb3, 0x24, 0x6a, 0x8e, - 0xa7, 0xf9, 0xf3, 0xc9, 0xf2, 0xc7, 0xb9, 0x7f, 0xa2, 0xf9, 0x97, 0xbe, - 0x40, 0x7f, 0x1d, 0xd3, 0xc7, 0x7a, 0x95, 0xfd, 0xbd, 0x24, 0x50, 0x8f, - 0xc4, 0xf9, 0xa4, 0x6e, 0x87, 0xc7, 0x5f, 0x58, 0x1e, 0xf9, 0x88, 0xfb, - 0x24, 0x84, 0x9d, 0x19, 0xfe, 0x7d, 0x1b, 0x80, 0x8d, 0xac, 0x1f, 0xfa, - 0xd4, 0xbc, 0xa9, 0xeb, 0x97, 0x77, 0xe1, 0x39, 0xd3, 0xaf, 0x70, 0xfe, - 0x7a, 0xa2, 0xfe, 0x9e, 0xaa, 0xac, 0x8f, 0x51, 0xf5, 0xac, 0xc8, 0xfc, - 0xda, 0x16, 0xb1, 0x9f, 0x88, 0xf5, 0x8b, 0xca, 0xf9, 0x35, 0xc5, 0xfb, - 0x16, 0xd7, 0x4f, 0xa4, 0x20, 0x2d, 0xb6, 0x81, 0xee, 0x57, 0x3d, 0x49, - 0x42, 0xaf, 0x53, 0xd8, 0x1f, 0xfe, 0x3d, 0x55, 0xd2, 0x0f, 0x81, 0xc9, - 0xf9, 0xdf, 0xaf, 0xe0, 0xfa, 0xba, 0x22, 0x10, 0x3f, 0x80, 0x81, 0x24, - 0xd3, 0x77, 0x38, 0xdd, 0xfb, 0x66, 0x3a, 0xac, 0x1f, 0x62, 0x7a, 0xee, - 0xe3, 0xe4, 0xfe, 0x3b, 0x57, 0xe7, 0xf7, 0xf1, 0xca, 0xfb, 0x4b, 0x95, - 0xf7, 0x05, 0x24, 0x7a, 0x28, 0x3b, 0x8e, 0xf6, 0xbe, 0xb4, 0x78, 0xda, - 0xe8, 0x3d, 0x1d, 0xf3, 0x7e, 0x4c, 0x35, 0x18, 0xc9, 0x4f, 0xf4, 0x0f, - 0xf2, 0xfc, 0x76, 0xb5, 0x7e, 0x71, 0x65, 0xfa, 0x37, 0x9d, 0x11, 0x7d, - 0xf4, 0xb2, 0x41, 0xbc, 0x7e, 0x2e, 0x8d, 0xa5, 0x87, 0x54, 0xcb, 0xd1, - 0x6b, 0x97, 0xd7, 0x14, 0xff, 0x7e, 0x1b, 0xff, 0xfb, 0xc5, 0x96, 0x04, - 0xe7, 0x24, 0xd8, 0x96, 0x60, 0x57, 0x82, 0x69, 0xbe, 0xdf, 0x87, 0x4d, - 0x09, 0xb6, 0x24, 0x38, 0x27, 0xc1, 0xb6, 0x04, 0x9f, 0xdb, 0xbf, 0x47, - 0xe5, 0x49, 0x70, 0xd5, 0xbf, 0xb7, 0x36, 0xcd, 0xfc, 0x9d, 0xff, 0x39, - 0xff, 0x73, 0xfe, 0x27, 0xe6, 0xe7, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xec, 0x5d, 0x7b, 0x90, 0x1c, 0x47, 0x79, 0xef, 0xee, 0x79, 0xec, 0xec, - 0xde, 0xde, 0x6a, 0x75, 0x3e, 0x89, 0x95, 0xac, 0xc7, 0x9c, 0x74, 0x96, - 0x8e, 0x60, 0x54, 0x67, 0x21, 0x9b, 0x93, 0xa3, 0xe0, 0x39, 0xf9, 0x6c, - 0x4e, 0xb6, 0x44, 0x14, 0xf3, 0x92, 0x81, 0x72, 0x56, 0xb8, 0x5c, 0x25, - 0x1b, 0x47, 0x36, 0x89, 0x93, 0x9c, 0xb1, 0x53, 0xee, 0xbd, 0xdb, 0x7b, - 0x18, 0x74, 0xae, 0xb3, 0x10, 0x46, 0x18, 0x63, 0xf6, 0x24, 0x19, 0x2b, - 0x40, 0x02, 0x55, 0x4e, 0x52, 0x4e, 0xfe, 0x48, 0xd6, 0x7a, 0x10, 0x41, - 0x59, 0x55, 0x22, 0x4e, 0x5c, 0x24, 0x45, 0x25, 0x6b, 0x43, 0x11, 0x05, - 0x88, 0xa2, 0x14, 0x98, 0x9c, 0x41, 0x46, 0xe9, 0xf7, 0x4c, 0xf7, 0xce, - 0xcc, 0xee, 0xe9, 0x41, 0x91, 0xc0, 0xfe, 0x21, 0xdf, 0x78, 0x67, 0x7b, + 0x50, 0x47, 0x7b, 0x1b, 0x91, 0x2f, 0xa4, 0x9f, 0x6e, 0x21, 0xe7, 0xcb, + 0xd6, 0x83, 0xf6, 0xd8, 0x3b, 0x7d, 0x36, 0xec, 0x71, 0x75, 0xb8, 0x31, + 0x00, 0xd6, 0xf2, 0x7c, 0x36, 0xdf, 0x6b, 0x50, 0x9b, 0x0f, 0x2e, 0x56, + 0xa4, 0x7f, 0x85, 0x22, 0xfd, 0x95, 0x8a, 0xf4, 0xd7, 0x29, 0xd2, 0xbf, + 0x55, 0x91, 0xfe, 0xe7, 0x15, 0xe9, 0x3f, 0xac, 0x48, 0x7f, 0x9b, 0x22, + 0xfd, 0xdd, 0x8a, 0xf4, 0x9f, 0x53, 0xa4, 0xff, 0xd7, 0x8a, 0xf4, 0xff, + 0x41, 0x91, 0xfe, 0x0f, 0x15, 0xe9, 0xbf, 0xa9, 0x48, 0x7f, 0x52, 0x91, + 0xfe, 0xfb, 0x8a, 0xf4, 0x13, 0x9a, 0x1a, 0xfd, 0x0b, 0xd4, 0xe6, 0x83, + 0x05, 0x8a, 0xf4, 0x1d, 0x45, 0xfa, 0xd7, 0x2b, 0xd2, 0xef, 0x56, 0xa4, + 0x7f, 0xa7, 0x22, 0xfd, 0xfb, 0x15, 0xe9, 0x6f, 0x56, 0xa4, 0xbf, 0x43, + 0x91, 0xfe, 0x3e, 0x45, 0xfa, 0x07, 0x15, 0xe9, 0x7f, 0x5b, 0x91, 0xfe, + 0x61, 0x45, 0xfa, 0x27, 0x15, 0xe9, 0xff, 0x8b, 0x22, 0xfd, 0x77, 0x15, + 0xe9, 0xff, 0x46, 0x91, 0x7e, 0x5a, 0x57, 0xa3, 0xdf, 0xac, 0x36, 0x1f, + 0x2c, 0x56, 0xa4, 0x7f, 0x8d, 0x22, 0xfd, 0x4e, 0x45, 0xfa, 0x9f, 0x56, + 0xa4, 0x7f, 0x8f, 0x22, 0xfd, 0x4d, 0x8a, 0xf4, 0x1f, 0x53, 0xa4, 0x3f, + 0xaa, 0x48, 0xff, 0x9b, 0x8a, 0xf4, 0xbf, 0xa5, 0x48, 0xff, 0x65, 0x45, + 0xfa, 0x3f, 0x50, 0xa4, 0xff, 0x86, 0x22, 0xfd, 0x9f, 0x2b, 0xd2, 0xff, + 0x2f, 0x45, 0xfa, 0xc0, 0x50, 0xa3, 0xdf, 0xa8, 0x36, 0xdf, 0xbb, 0x58, + 0x91, 0xfe, 0x95, 0x8a, 0xf4, 0x57, 0x2a, 0xd2, 0x5f, 0xaf, 0x48, 0xff, + 0x56, 0x45, 0xfa, 0xf7, 0x2a, 0xd2, 0x7f, 0x58, 0x91, 0xfe, 0x76, 0x45, + 0xfa, 0xbb, 0x15, 0xe9, 0xe7, 0x8d, 0x73, 0x71, 0xff, 0xf0, 0xba, 0xc1, + 0x55, 0xbf, 0x87, 0x7e, 0xfd, 0xe5, 0xf5, 0x00, 0xe7, 0x13, 0x4e, 0xd0, + 0x0a, 0x70, 0x5f, 0x82, 0xdc, 0x9f, 0xb2, 0x34, 0xbf, 0x30, 0x69, 0x22, + 0x98, 0xd5, 0xeb, 0x0e, 0xf4, 0xb0, 0xe7, 0xed, 0x62, 0xf9, 0x05, 0x93, + 0xce, 0x67, 0xf7, 0x31, 0x0d, 0x0c, 0x6a, 0x79, 0x72, 0xed, 0x7a, 0x1a, + 0xde, 0xda, 0x16, 0x81, 0x92, 0xe9, 0xd7, 0x6b, 0xf3, 0xee, 0xb5, 0xf8, + 0x2a, 0x06, 0xff, 0xa9, 0xa9, 0xcd, 0x00, 0xad, 0x88, 0x95, 0xfc, 0x51, + 0x6d, 0x90, 0xd7, 0x03, 0xc7, 0x09, 0x7d, 0x0b, 0x68, 0xc0, 0x45, 0xa9, + 0xfc, 0x8d, 0x03, 0x80, 0xf0, 0x27, 0xf2, 0xcf, 0xe6, 0x1f, 0x7e, 0x38, + 0x7c, 0xfd, 0xb6, 0x05, 0x80, 0x9b, 0xb6, 0xeb, 0xc1, 0xd4, 0x27, 0x40, + 0x29, 0x05, 0x0e, 0x00, 0x9d, 0xe6, 0x7b, 0x3e, 0x81, 0x13, 0x30, 0xbd, + 0xfc, 0x82, 0xdd, 0xe6, 0x52, 0x7e, 0xdc, 0x39, 0x90, 0x9f, 0x67, 0x7e, + 0xb0, 0xb0, 0x39, 0xb9, 0xa4, 0x69, 0xc4, 0xb3, 0xc0, 0xae, 0xc1, 0x3d, + 0xb8, 0x94, 0x30, 0x69, 0x04, 0xd7, 0xcf, 0xf8, 0x03, 0x5a, 0xf7, 0x51, + 0x52, 0x8f, 0xee, 0xd3, 0xf1, 0xfa, 0x5d, 0x76, 0xc7, 0xc4, 0x72, 0xe8, + 0x45, 0x59, 0x1c, 0xcc, 0xbf, 0xe5, 0x00, 0xf8, 0x6c, 0x96, 0x6f, 0x02, + 0xb7, 0xd0, 0x7a, 0xb5, 0xb5, 0x7d, 0xbc, 0x1e, 0x29, 0xc7, 0x7c, 0xaa, + 0x24, 0x95, 0xf4, 0xeb, 0x8e, 0x50, 0xfa, 0x42, 0x7e, 0xe8, 0x1e, 0x4a, + 0x1f, 0x2d, 0xc7, 0xd5, 0x2b, 0xe9, 0xdf, 0x4a, 0xe9, 0xa7, 0x07, 0xc7, + 0x11, 0x0b, 0xde, 0x65, 0x91, 0xf4, 0x35, 0x91, 0xbe, 0x9b, 0x3d, 0x32, + 0xbf, 0x95, 0xee, 0x1f, 0x84, 0xad, 0x0a, 0xf9, 0x90, 0x9f, 0x8d, 0x94, + 0x7e, 0x05, 0x3d, 0xae, 0x0f, 0x93, 0x14, 0x7f, 0x97, 0x81, 0xd7, 0x4f, + 0xe9, 0xb1, 0xf9, 0x7f, 0x43, 0xe7, 0x9b, 0x12, 0x7d, 0x00, 0x46, 0x59, + 0xf8, 0x8f, 0xe5, 0xed, 0x82, 0xd7, 0x35, 0x17, 0x3d, 0xaa, 0xf9, 0x01, + 0x1d, 0xe5, 0xbb, 0x28, 0x3f, 0xde, 0x6d, 0xac, 0xde, 0x8f, 0xf7, 0x73, + 0xa4, 0x0e, 0xe5, 0x53, 0xbd, 0x04, 0x54, 0xa2, 0xf6, 0xee, 0x23, 0x5a, + 0x2b, 0xdc, 0xf5, 0xa9, 0x4d, 0x46, 0x69, 0x58, 0x1b, 0xbf, 0xf3, 0x46, + 0xcf, 0x2c, 0x81, 0x15, 0xba, 0x06, 0x5e, 0x48, 0xbc, 0x06, 0xc0, 0x0e, + 0xb8, 0x5f, 0x47, 0xb2, 0x39, 0x9f, 0xbf, 0x4a, 0xfe, 0x99, 0xbe, 0xb3, + 0xf5, 0x9f, 0xd0, 0x56, 0x85, 0xf0, 0x7f, 0x87, 0xc8, 0xbf, 0xf7, 0x59, + 0xc6, 0x0f, 0xd2, 0xb7, 0xb9, 0x88, 0x5f, 0xb2, 0x1f, 0x88, 0xdf, 0x24, + 0xea, 0x65, 0x38, 0x4e, 0x60, 0x00, 0x56, 0xa4, 0x28, 0x4a, 0x32, 0xfc, + 0xbe, 0xc2, 0xcf, 0x9f, 0x46, 0xce, 0x53, 0x17, 0x3b, 0x5f, 0x58, 0x1e, + 0x4c, 0x5e, 0x77, 0x47, 0xc8, 0xdf, 0x02, 0xdd, 0x06, 0xe1, 0x97, 0xac, + 0x8f, 0xf1, 0xb7, 0x26, 0x72, 0xbe, 0x28, 0x4f, 0xae, 0xaf, 0xd2, 0xf9, + 0x9a, 0x9d, 0x10, 0xd6, 0xdb, 0xa3, 0x91, 0x44, 0x4c, 0xaf, 0x9f, 0x5f, + 0x9c, 0xd4, 0xc3, 0xf2, 0x89, 0x48, 0xd4, 0x2e, 0x22, 0xba, 0x7f, 0x01, + 0x5d, 0x7f, 0x17, 0x63, 0x29, 0x51, 0xcb, 0x7d, 0x2d, 0x42, 0xde, 0xe0, + 0x8f, 0x28, 0xbf, 0x67, 0x7b, 0x7d, 0x16, 0xb4, 0x67, 0x58, 0x9e, 0x53, + 0x9b, 0xe3, 0xf6, 0x1f, 0xdc, 0xcb, 0xfb, 0x4f, 0xc2, 0xf9, 0x3f, 0xd0, + 0x40, 0xe6, 0xa3, 0x59, 0xab, 0x4c, 0xdb, 0x40, 0xfa, 0x5a, 0x4a, 0x80, + 0x71, 0x62, 0x2f, 0x26, 0x1a, 0xb8, 0x7d, 0x04, 0x0d, 0x80, 0x1f, 0x55, + 0x05, 0xf9, 0xbc, 0x05, 0x7c, 0x7e, 0x50, 0x41, 0x13, 0xb4, 0x31, 0x7d, + 0xe3, 0xe7, 0x49, 0x0f, 0xf2, 0xbf, 0x39, 0x5d, 0x9b, 0xbf, 0x60, 0xf3, + 0xef, 0xae, 0x57, 0x9b, 0x2f, 0x9f, 0x8f, 0xbe, 0x2a, 0xf2, 0x59, 0x78, + 0x86, 0xf4, 0xef, 0xe3, 0xf4, 0xbb, 0xd8, 0x7a, 0x13, 0xe1, 0xf9, 0xed, + 0x51, 0xc9, 0x5f, 0x79, 0x26, 0x8c, 0xa4, 0x50, 0x49, 0x4d, 0x7b, 0xf9, + 0x28, 0x18, 0xac, 0xf0, 0xa7, 0xd0, 0x41, 0x34, 0x60, 0xff, 0x78, 0x09, + 0x95, 0xa7, 0x4c, 0xcf, 0x0c, 0x94, 0x1f, 0x2b, 0xea, 0x4f, 0x01, 0xff, + 0x7a, 0x0a, 0xfb, 0x57, 0x1b, 0xee, 0xaa, 0x3b, 0x7b, 0x6f, 0x02, 0xd8, + 0x0e, 0x28, 0xa6, 0xe0, 0xfe, 0x83, 0xdb, 0xa8, 0x36, 0x7a, 0x4d, 0x68, + 0xbf, 0x3d, 0x70, 0xa2, 0xdd, 0x6d, 0x08, 0x9c, 0x7f, 0xaa, 0xc0, 0x3f, + 0xfa, 0x73, 0xba, 0x3e, 0xfc, 0xb4, 0xe1, 0x34, 0xd2, 0x1f, 0x3b, 0xe0, + 0x4f, 0xc1, 0x7e, 0x64, 0xbe, 0x09, 0x7f, 0x50, 0x69, 0xcd, 0xda, 0xf3, + 0xc9, 0x17, 0xc4, 0xc6, 0x0f, 0xfc, 0xbc, 0xfc, 0x64, 0x51, 0xe8, 0xfa, + 0xd9, 0x7e, 0x78, 0x77, 0x27, 0x85, 0xf3, 0xe0, 0x01, 0xd7, 0x08, 0xfa, + 0x0b, 0xdd, 0x5b, 0x6b, 0x04, 0xcf, 0x27, 0x9b, 0x4f, 0x97, 0x57, 0xf8, + 0xd2, 0x45, 0x20, 0x54, 0x3f, 0xd8, 0x2f, 0xcf, 0xe8, 0xb5, 0xf1, 0x17, + 0xcd, 0x4f, 0xbb, 0x71, 0x76, 0xe9, 0x77, 0x9c, 0x65, 0xfa, 0xab, 0xcf, + 0x32, 0xfd, 0x1b, 0xe8, 0xfe, 0x80, 0x62, 0xbb, 0x1e, 0x17, 0x3f, 0xbe, + 0x2e, 0xf9, 0xa7, 0xa8, 0xf3, 0xb2, 0x24, 0xfc, 0xbc, 0xb0, 0xf3, 0xe0, + 0xbe, 0x23, 0xc5, 0x9b, 0x93, 0x29, 0x44, 0x2f, 0x07, 0xfd, 0x2f, 0xf6, + 0x17, 0xcd, 0x9b, 0x52, 0xc5, 0x6d, 0xbe, 0xbd, 0x3a, 0x7c, 0x33, 0xb3, + 0x9f, 0xbb, 0x8c, 0x86, 0xe4, 0x10, 0xb4, 0x65, 0xa7, 0x93, 0xf9, 0x11, + 0x88, 0x8f, 0x79, 0x9d, 0xa8, 0xf3, 0xed, 0x67, 0x9d, 0x16, 0xf4, 0x2f, + 0x08, 0x7b, 0x69, 0x5a, 0x38, 0xff, 0xcc, 0xbf, 0x27, 0x41, 0x89, 0x9c, + 0x2f, 0xec, 0xaf, 0xa7, 0xae, 0x26, 0xfc, 0x42, 0x7b, 0xbc, 0xe8, 0x62, + 0x84, 0x4e, 0xf9, 0x67, 0xfd, 0x90, 0x63, 0x06, 0xaa, 0x01, 0xc3, 0xf3, + 0xba, 0x31, 0xde, 0x3e, 0xd3, 0xf8, 0xcf, 0x5d, 0x7d, 0xad, 0xa0, 0xcf, + 0xdf, 0xe3, 0xfb, 0xf3, 0x38, 0x8b, 0xa7, 0xb3, 0xc1, 0x78, 0x91, 0xcd, + 0xa7, 0xe7, 0xa1, 0x3f, 0x35, 0xbe, 0x90, 0xe2, 0xbf, 0x0a, 0x84, 0xf9, + 0xe0, 0xb8, 0x16, 0x84, 0x99, 0xfd, 0xf3, 0x1e, 0x32, 0x04, 0xff, 0xc7, + 0xe4, 0x65, 0x81, 0x57, 0xb5, 0x06, 0xb4, 0xd5, 0xde, 0x29, 0x12, 0x3f, + 0x63, 0x7b, 0x31, 0x91, 0xf1, 0xe5, 0x95, 0x11, 0xe4, 0x85, 0x98, 0x5b, + 0x21, 0xec, 0x3f, 0x8f, 0x3f, 0x88, 0xbc, 0xb0, 0xfd, 0xf2, 0xe5, 0x85, + 0xd8, 0x5f, 0x90, 0x0d, 0xc8, 0x0b, 0x2d, 0x20, 0x7f, 0x63, 0xbd, 0x8f, + 0x7f, 0x91, 0x92, 0x3f, 0x63, 0xbf, 0x1c, 0xe7, 0xf2, 0x5a, 0xcf, 0xe2, + 0x8b, 0x06, 0xbc, 0x7e, 0xda, 0xb7, 0x98, 0x3a, 0xcc, 0xe4, 0x53, 0xa7, + 0x07, 0xc7, 0xd1, 0xe3, 0xc9, 0x7a, 0x97, 0x08, 0xfa, 0xce, 0xe4, 0x41, + 0xe5, 0xe5, 0x32, 0x79, 0x11, 0x4b, 0x39, 0x91, 0xf6, 0xe5, 0x91, 0xae, + 0xd0, 0x9f, 0x65, 0xe9, 0x50, 0xfd, 0x27, 0xf2, 0x80, 0xf2, 0x74, 0x9b, + 0x7d, 0x79, 0x20, 0xf1, 0xb6, 0xd5, 0x05, 0xe4, 0x41, 0xd7, 0xf1, 0xbc, + 0xc9, 0xf0, 0x6f, 0x9b, 0x96, 0x3c, 0xde, 0xe4, 0xf2, 0x78, 0x95, 0x3d, + 0xbf, 0x81, 0xc4, 0xc7, 0x54, 0x1e, 0x2f, 0x31, 0x79, 0x3c, 0x2e, 0x8c, + 0xd7, 0x28, 0x0f, 0x30, 0xc4, 0xe4, 0x81, 0x15, 0x70, 0xa2, 0xde, 0x97, + 0x47, 0x7d, 0x85, 0x7e, 0x2c, 0x8f, 0xd3, 0x0f, 0x38, 0x1b, 0xdf, 0x27, + 0xd8, 0x79, 0x42, 0xcd, 0x2c, 0x73, 0x02, 0xf2, 0x60, 0xfe, 0xea, 0x05, + 0x14, 0x8e, 0xa0, 0xf3, 0xd4, 0x3a, 0x2d, 0x79, 0xfc, 0xb2, 0x42, 0x3f, + 0xfa, 0x1a, 0x89, 0xfd, 0xa0, 0xf1, 0x66, 0x33, 0x5c, 0xa7, 0xc1, 0xe4, + 0x3f, 0x04, 0x77, 0xc4, 0x41, 0x71, 0x11, 0xc4, 0x5f, 0xaf, 0x07, 0xe7, + 0xd7, 0xaa, 0x2f, 0xb5, 0xca, 0x07, 0x61, 0x2f, 0x17, 0xed, 0x8d, 0xa0, + 0x2f, 0xdc, 0x1e, 0x33, 0xf9, 0xe0, 0xd1, 0x3d, 0x16, 0xe2, 0x0f, 0xa0, + 0x78, 0x10, 0x46, 0x25, 0xbb, 0x9b, 0x82, 0xf8, 0xb7, 0x4f, 0x4b, 0x3e, + 0xff, 0xeb, 0xdb, 0x1b, 0xf6, 0xfc, 0x5c, 0xe0, 0xfe, 0x68, 0x1b, 0x16, + 0xf3, 0xb7, 0x75, 0x46, 0x70, 0xbc, 0x46, 0x79, 0x78, 0x5c, 0x1e, 0x78, + 0x78, 0x22, 0xeb, 0xcb, 0x23, 0x5b, 0xa1, 0x2f, 0x2b, 0x45, 0x7d, 0x89, + 0xb5, 0xbf, 0x28, 0x40, 0x59, 0xd4, 0x28, 0xd9, 0x5f, 0xfb, 0x26, 0xcb, + 0xc7, 0x6f, 0x9e, 0x96, 0x3c, 0x68, 0x97, 0x45, 0xbf, 0xbf, 0xff, 0x93, + 0x8d, 0x81, 0xfb, 0x6d, 0xce, 0x97, 0x07, 0xb7, 0xb7, 0x8d, 0x61, 0xf1, + 0x23, 0x93, 0xc7, 0xc4, 0x67, 0x22, 0xf2, 0x0d, 0x64, 0x34, 0xc1, 0xe4, + 0x41, 0xe5, 0x55, 0x1c, 0x8c, 0xb4, 0xcf, 0xeb, 0x89, 0x7d, 0x2e, 0x6e, + 0xa6, 0xf9, 0x0d, 0xa6, 0x2f, 0x93, 0xc1, 0xfb, 0x9e, 0x17, 0x89, 0xaf, + 0xa1, 0xfd, 0x1a, 0xb1, 0x40, 0x71, 0x09, 0x2a, 0x73, 0x8f, 0x07, 0xee, + 0x63, 0x18, 0x1f, 0x4d, 0x77, 0x5b, 0x44, 0xfb, 0x74, 0x79, 0x9d, 0xef, + 0x9f, 0xf7, 0xd1, 0x70, 0x39, 0x09, 0x56, 0x2c, 0xdb, 0x6b, 0x80, 0x1d, + 0xfd, 0xae, 0xc1, 0x17, 0xe3, 0xea, 0x1a, 0x8c, 0x87, 0x41, 0xab, 0x9d, + 0xdd, 0x1e, 0x15, 0x4f, 0xe6, 0xb7, 0x41, 0x4f, 0xe2, 0x2e, 0xb7, 0x53, + 0xb9, 0x2c, 0xaa, 0xa0, 0x83, 0x83, 0xfa, 0xe1, 0xf1, 0xad, 0xf0, 0xdf, + 0x9b, 0x0e, 0x3f, 0x84, 0x05, 0x3a, 0xdc, 0x64, 0xbf, 0x40, 0x94, 0xc1, + 0xba, 0x92, 0xe0, 0xdb, 0x2c, 0x5e, 0x85, 0x0f, 0xc7, 0xf1, 0x2a, 0xcb, + 0x17, 0xc1, 0xd3, 0x1a, 0xba, 0x9f, 0x74, 0xdc, 0x1d, 0x10, 0xee, 0xb3, + 0xab, 0xa9, 0xbf, 0x64, 0xf2, 0xd8, 0x2b, 0xdd, 0xf7, 0xf4, 0xc0, 0x7d, + 0x2f, 0xa8, 0xcf, 0xcc, 0xfe, 0x74, 0xae, 0xbe, 0x36, 0x78, 0x7f, 0x74, + 0x99, 0x7c, 0x01, 0x77, 0xf8, 0x03, 0x20, 0x78, 0x5f, 0x62, 0xf2, 0x86, + 0xe7, 0x85, 0x6a, 0xcc, 0xc0, 0x2c, 0xdf, 0x1f, 0x4d, 0x58, 0xbe, 0xfe, + 0x5b, 0x15, 0xf6, 0xc0, 0x89, 0xb1, 0x07, 0xdc, 0x5e, 0x31, 0x7b, 0x80, + 0xb5, 0x73, 0x6f, 0x5d, 0xd0, 0x1e, 0xec, 0x99, 0x01, 0x7b, 0xb0, 0xca, + 0x90, 0xed, 0xc1, 0x24, 0xe1, 0x9f, 0xad, 0x67, 0xff, 0xa9, 0x59, 0x0a, + 0xe7, 0xbf, 0xb8, 0xa3, 0xba, 0x3d, 0x4c, 0xd6, 0xe4, 0x2f, 0xaa, 0xf2, + 0x7f, 0x31, 0xfb, 0xdd, 0x0c, 0x5b, 0xaf, 0x87, 0xfc, 0x4d, 0xc1, 0x4e, + 0xa1, 0xfb, 0x14, 0x89, 0x37, 0x07, 0x92, 0xd3, 0x91, 0xcf, 0x8d, 0x46, + 0x85, 0x3f, 0xd1, 0x04, 0xf9, 0xe4, 0x06, 0x28, 0x6c, 0x49, 0xf1, 0xaf, + 0x44, 0x8f, 0xac, 0xd5, 0x33, 0x58, 0x7e, 0x02, 0xc7, 0x07, 0x30, 0x5e, + 0xb5, 0x1c, 0x60, 0x27, 0x91, 0x3f, 0xcc, 0x7a, 0x16, 0xf2, 0x87, 0xf6, + 0xbb, 0x54, 0x9f, 0x5d, 0x0d, 0xe5, 0x3f, 0x47, 0xc0, 0xd4, 0xf5, 0x97, + 0xc3, 0xfb, 0xa7, 0x0b, 0xba, 0xf5, 0x15, 0x58, 0xe5, 0x1f, 0xd4, 0x4a, + 0xd0, 0x1e, 0x40, 0x6b, 0xb7, 0xbf, 0xcb, 0x04, 0xcf, 0x3c, 0xb2, 0x87, + 0xe4, 0x47, 0x11, 0x66, 0xaf, 0x75, 0x20, 0x81, 0x48, 0x6f, 0x0c, 0xc9, + 0x97, 0xc2, 0x78, 0x9a, 0xd9, 0x57, 0x3d, 0x78, 0x5e, 0x9e, 0x8c, 0xb4, + 0x3f, 0xd2, 0xf9, 0x50, 0xb6, 0xe7, 0x99, 0x58, 0xff, 0x8f, 0x7e, 0xb5, + 0xe5, 0x78, 0xc8, 0xeb, 0xaa, 0xf3, 0xf1, 0x2f, 0x9c, 0x96, 0x3e, 0xdf, + 0xc7, 0xf7, 0x8b, 0xfb, 0xaf, 0x26, 0x61, 0xbf, 0x06, 0x06, 0x9a, 0x54, + 0xf4, 0xf9, 0xc9, 0xaa, 0xf1, 0x60, 0x94, 0x7d, 0x12, 0xcf, 0x73, 0x14, + 0xbf, 0x0f, 0x57, 0x9e, 0x3f, 0x91, 0x5f, 0x30, 0xa5, 0xc2, 0x2f, 0x18, + 0xad, 0x7a, 0xfe, 0xa2, 0xf8, 0xad, 0xed, 0xfc, 0x6d, 0xad, 0x3c, 0x0f, + 0x73, 0x44, 0x7e, 0x07, 0xe6, 0xc4, 0xf9, 0x47, 0xbf, 0x3e, 0x10, 0x61, + 0xcf, 0xc1, 0x7b, 0x58, 0xff, 0x89, 0x43, 0x99, 0x48, 0x31, 0xfe, 0x99, + 0xfd, 0x66, 0xe7, 0xa7, 0x85, 0xe8, 0x7f, 0xab, 0x06, 0xed, 0x31, 0xce, + 0xdf, 0x42, 0x03, 0xdd, 0xdb, 0x90, 0x42, 0x2d, 0xfe, 0x89, 0x15, 0xe4, + 0x3c, 0x9c, 0x24, 0xfd, 0x5d, 0x96, 0x0d, 0x92, 0x36, 0x08, 0x39, 0x0f, + 0x5a, 0xf0, 0x3c, 0x20, 0xf5, 0x6b, 0x40, 0xff, 0x97, 0x5f, 0xc2, 0xe3, + 0x0d, 0x64, 0x82, 0x99, 0x3c, 0x73, 0xa0, 0x1b, 0xac, 0xb2, 0x02, 0xf9, + 0x23, 0x2d, 0xab, 0xd1, 0xfc, 0x78, 0x52, 0xea, 0x9f, 0x4c, 0x84, 0xf9, + 0x07, 0xb2, 0x3f, 0xcf, 0xe9, 0xfe, 0x7e, 0x04, 0xe4, 0xed, 0xc5, 0xdd, + 0xbf, 0xd8, 0x7e, 0xb1, 0x76, 0xe0, 0xa9, 0xb9, 0xe4, 0x79, 0x3c, 0x1e, + 0xa8, 0xd1, 0x5e, 0x0e, 0xb3, 0xf9, 0x73, 0x59, 0xfe, 0x28, 0x8d, 0xe2, + 0x2b, 0x97, 0xd8, 0xc7, 0x1c, 0x1a, 0xcd, 0xd9, 0x26, 0xb0, 0x96, 0x11, + 0x7b, 0x04, 0xd6, 0xb1, 0x7c, 0xf4, 0xa9, 0x79, 0x24, 0xff, 0x04, 0x79, + 0x4f, 0xa5, 0x90, 0x1d, 0x75, 0x87, 0x90, 0x3e, 0xd2, 0xfc, 0xa7, 0xfb, + 0x80, 0x66, 0xc7, 0xec, 0xf7, 0x5e, 0x29, 0x1f, 0x7a, 0x94, 0xdf, 0x7f, + 0x77, 0xb2, 0x7a, 0x10, 0x40, 0xfc, 0xb3, 0xf9, 0x1f, 0xbb, 0x45, 0xf4, + 0xd7, 0xff, 0xcc, 0xe7, 0xb3, 0xfc, 0x5d, 0x9f, 0x45, 0xd6, 0x1f, 0xc0, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 26 22:44:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62C5CA6E57E; Tue, 26 Jan 2016 22:44:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF4B1442; Tue, 26 Jan 2016 22:44:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0QMidvs015682 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 26 Jan 2016 14:44:39 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0QMidUJ015681; Tue, 26 Jan 2016 14:44:39 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 26 Jan 2016 14:44:39 -0800 From: Gleb Smirnoff To: Sepherosa Ziehau , adrian@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294788 - head/sys/dev/hyperv/netvsc Message-ID: <20160126224439.GT6885@FreeBSD.org> References: <201601260942.u0Q9gD14062309@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601260942.u0Q9gD14062309@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 22:44:41 -0000 Sepherosa, On Tue, Jan 26, 2016 at 09:42:13AM +0000, Sepherosa Ziehau wrote: S> Author: sephe S> Date: Tue Jan 26 09:42:13 2016 S> New Revision: 294788 S> URL: https://svnweb.freebsd.org/changeset/base/294788 S> S> Log: S> hyperv/hn: Improve sending performance S> S> - Avoid main lock contention by trylock for if_start, if that fails, S> schedule TX taskqueue for if_start S> - Don't do direct sending if the packet to be sent is large, e.g. S> TSO packet. S> S> This change gives me stable 9.1Gbps TCP sending performance w/ TSO S> over a 10Gbe directly connected network (the performance fluctuated S> between 4Gbps and 9Gbps before this commit). It also improves non- S> TSO TCP sending performance a lot. S> S> Reviewed by: adrian, royger S> Approved by: adrian (mentor) S> Sponsored by: Microsoft OSTC S> Differential Revision: https://reviews.freebsd.org/D5074 Why do you actually use if_start, not if_transmit? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Jan 26 22:45:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B695A6E5E4; Tue, 26 Jan 2016 22:45:06 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D1BC15F1; Tue, 26 Jan 2016 22:45:06 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QMj5vj095915; Tue, 26 Jan 2016 22:45:05 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QMj5Pi095914; Tue, 26 Jan 2016 22:45:05 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601262245.u0QMj5Pi095914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 26 Jan 2016 22:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294855 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 22:45:06 -0000 Author: luigi Date: Tue Jan 26 22:45:05 2016 New Revision: 294855 URL: https://svnweb.freebsd.org/changeset/base/294855 Log: avoid warnings for signed/unsigned comparison and unused arguments Modified: head/sys/netpfil/ipfw/dn_heap.c Modified: head/sys/netpfil/ipfw/dn_heap.c ============================================================================== --- head/sys/netpfil/ipfw/dn_heap.c Tue Jan 26 22:32:58 2016 (r294854) +++ head/sys/netpfil/ipfw/dn_heap.c Tue Jan 26 22:45:05 2016 (r294855) @@ -81,7 +81,7 @@ heap_resize(struct dn_heap *h, unsigned { struct dn_heap_entry *p; - if (h->size >= new_size ) /* have enough room */ + if ((unsigned int)h->size >= new_size ) /* have enough room */ return 0; #if 1 /* round to the next power of 2 */ new_size |= new_size >> 1; @@ -419,6 +419,8 @@ dn_ht_init(struct dn_ht *ht, int buckets static int do_del(void *obj, void *arg) { + (void)obj; + (void)arg; return DNHT_SCAN_DEL; } From owner-svn-src-head@freebsd.org Tue Jan 26 22:45:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04384A6E63F; Tue, 26 Jan 2016 22:45:47 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB246184B; Tue, 26 Jan 2016 22:45:46 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QMjjC3095979; Tue, 26 Jan 2016 22:45:45 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QMjjCA095978; Tue, 26 Jan 2016 22:45:45 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601262245.u0QMjjCA095978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 26 Jan 2016 22:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294856 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 22:45:47 -0000 Author: luigi Date: Tue Jan 26 22:45:45 2016 New Revision: 294856 URL: https://svnweb.freebsd.org/changeset/base/294856 Log: prevent warning for unused argument Modified: head/sys/netpfil/ipfw/dn_sched_fifo.c Modified: head/sys/netpfil/ipfw/dn_sched_fifo.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_fifo.c Tue Jan 26 22:45:05 2016 (r294855) +++ head/sys/netpfil/ipfw/dn_sched_fifo.c Tue Jan 26 22:45:45 2016 (r294856) @@ -61,6 +61,7 @@ fifo_enqueue(struct dn_sch_inst *si, str * re-enqueue from an existing scheduler, which we should * handle. */ + (void)q; return dn_enqueue((struct dn_queue *)(si+1), m, 0); } From owner-svn-src-head@freebsd.org Tue Jan 26 22:46:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBA88A6E6B1; Tue, 26 Jan 2016 22:46:59 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1B4A19FB; Tue, 26 Jan 2016 22:46:59 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QMkwgF096058; Tue, 26 Jan 2016 22:46:58 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QMkwTM096057; Tue, 26 Jan 2016 22:46:58 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601262246.u0QMkwTM096057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 26 Jan 2016 22:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294857 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 22:47:00 -0000 Author: luigi Date: Tue Jan 26 22:46:58 2016 New Revision: 294857 URL: https://svnweb.freebsd.org/changeset/base/294857 Log: prevent warnings for signed/unsigned comparisons and unused arguments. Add checks for parameters overflowing 32 bit. Modified: head/sys/netpfil/ipfw/dn_sched_rr.c Modified: head/sys/netpfil/ipfw/dn_sched_rr.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_rr.c Tue Jan 26 22:45:45 2016 (r294856) +++ head/sys/netpfil/ipfw/dn_sched_rr.c Tue Jan 26 22:46:58 2016 (r294857) @@ -52,8 +52,8 @@ struct rr_queue { struct dn_queue q; /* Standard queue */ int status; /* 1: queue is in the list */ - int credit; /* Number of bytes to transmit */ - int quantum; /* quantum * C */ + uint32_t credit; /* max bytes we can transmit */ + uint32_t quantum; /* quantum * weight */ struct rr_queue *qnext; /* */ }; @@ -61,9 +61,9 @@ struct rr_queue { * and is right after dn_schk */ struct rr_schk { - int min_q; /* Min quantum */ - int max_q; /* Max quantum */ - int q_bytes; /* Bytes per quantum */ + uint32_t min_q; /* Min quantum */ + uint32_t max_q; /* Max quantum */ + uint32_t q_bytes; /* default quantum in bytes */ }; /* per-instance round robin list, right after dn_sch_inst */ @@ -227,6 +227,7 @@ rr_new_sched(struct dn_sch_inst *_si) static int rr_free_sched(struct dn_sch_inst *_si) { + (void)_si; ND("called"); /* Nothing to do? */ return 0; @@ -237,6 +238,7 @@ rr_new_fsk(struct dn_fsk *fs) { struct rr_schk *schk = (struct rr_schk *)(fs->sched + 1); /* par[0] is the weight, par[1] is the quantum step */ + /* make sure the product fits an uint32_t */ ipdn_bound_var(&fs->fs.par[0], 1, 1, 65536, "RR weight"); ipdn_bound_var(&fs->fs.par[1], schk->q_bytes, @@ -248,10 +250,16 @@ static int rr_new_queue(struct dn_queue *_q) { struct rr_queue *q = (struct rr_queue *)_q; + uint64_t quantum; _q->ni.oid.subtype = DN_SCHED_RR; - q->quantum = _q->fs->fs.par[0] * _q->fs->fs.par[1]; + quantum = (uint64_t)_q->fs->fs.par[0] * _q->fs->fs.par[1]; + if (quantum >= (1ULL<< 32)) { + D("quantum too large, truncating to 4G - 1"); + quantum = (1ULL<< 32) - 1; + } + q->quantum = quantum; ND("called, q->quantum %d", q->quantum); q->credit = q->quantum; q->status = 0; From owner-svn-src-head@freebsd.org Tue Jan 26 22:53:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A654CA6EA70; Tue, 26 Jan 2016 22:53:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 944201DB; Tue, 26 Jan 2016 22:53:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0QMrXDr015760 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 26 Jan 2016 14:53:33 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0QMrWrs015759; Tue, 26 Jan 2016 14:53:32 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 26 Jan 2016 14:53:32 -0800 From: Gleb Smirnoff To: Hiren Panchasara Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294840 - head/sys/netinet Message-ID: <20160126225332.GU6885@FreeBSD.org> References: <201601261633.u0QGXcdh083557@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601261633.u0QGXcdh083557@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 22:53:34 -0000 Hiren, On Tue, Jan 26, 2016 at 04:33:38PM +0000, Hiren Panchasara wrote: H> Author: hiren H> Date: Tue Jan 26 16:33:38 2016 H> New Revision: 294840 H> URL: https://svnweb.freebsd.org/changeset/base/294840 H> H> Log: H> Persist timers TCPTV_PERSMIN and TCPTV_PERSMAX are hardcoded with 5 seconds and H> 60 seconds, respectively. Turn them into sysctls that can be tuned live. The H> default values of 5 seconds and 60 seconds have been retained. H> H> Submitted by: Jason Wolfe (j at nitrology dot com) H> Reviewed by: gnn, rrs, hiren, bz H> MFC after: 1 week H> Sponsored by: Limelight Networks H> Differential Revision: https://reviews.freebsd.org/D5024 A theoretical question: could it be useful to make them socket options like the TCP_KEEP* timeouts? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Jan 26 22:58:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F109A6EB9F; Tue, 26 Jan 2016 22:58:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2233DF; Tue, 26 Jan 2016 22:58:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0QMw0j5015815 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 26 Jan 2016 14:58:01 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0QMw0jQ015814; Tue, 26 Jan 2016 14:58:00 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 26 Jan 2016 14:58:00 -0800 From: Gleb Smirnoff To: Luigi Rizzo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294855 - head/sys/netpfil/ipfw Message-ID: <20160126225800.GV6885@FreeBSD.org> References: <201601262245.u0QMj5Pi095914@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601262245.u0QMj5Pi095914@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 22:58:02 -0000 Luigi, On Tue, Jan 26, 2016 at 10:45:05PM +0000, Luigi Rizzo wrote: L> Modified: head/sys/netpfil/ipfw/dn_heap.c L> ============================================================================== L> --- head/sys/netpfil/ipfw/dn_heap.c Tue Jan 26 22:32:58 2016 (r294854) L> +++ head/sys/netpfil/ipfw/dn_heap.c Tue Jan 26 22:45:05 2016 (r294855) L> @@ -81,7 +81,7 @@ heap_resize(struct dn_heap *h, unsigned L> { L> struct dn_heap_entry *p; L> L> - if (h->size >= new_size ) /* have enough room */ L> + if ((unsigned int)h->size >= new_size ) /* have enough room */ L> return 0; L> #if 1 /* round to the next power of 2 */ L> new_size |= new_size >> 1; L> @@ -419,6 +419,8 @@ dn_ht_init(struct dn_ht *ht, int buckets L> static int L> do_del(void *obj, void *arg) L> { L> + (void)obj; L> + (void)arg; L> return DNHT_SCAN_DEL; L> } Are there any benefits of this syntax comparing to __unused macro that expands to proper attribute? The latter syntax is used in FreeBSD more often. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Jan 26 23:36:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B40A3A6F8EC; Tue, 26 Jan 2016 23:36:19 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78A951DE9; Tue, 26 Jan 2016 23:36:19 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QNaIEc011858; Tue, 26 Jan 2016 23:36:18 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QNaI8I011857; Tue, 26 Jan 2016 23:36:18 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601262336.u0QNaI8I011857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 26 Jan 2016 23:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294858 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 23:36:19 -0000 Author: luigi Date: Tue Jan 26 23:36:18 2016 New Revision: 294858 URL: https://svnweb.freebsd.org/changeset/base/294858 Log: fix various warnings (signed/unsigned, printf types, unused arguments) Modified: head/sys/netpfil/ipfw/dn_sched_qfq.c Modified: head/sys/netpfil/ipfw/dn_sched_qfq.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_qfq.c Tue Jan 26 22:46:58 2016 (r294857) +++ head/sys/netpfil/ipfw/dn_sched_qfq.c Tue Jan 26 23:36:18 2016 (r294858) @@ -48,6 +48,7 @@ #endif #ifdef QFQ_DEBUG +#define _P64 unsigned long long /* cast for printing uint64_t */ struct qfq_sched; static void dump_sched(struct qfq_sched *q, const char *msg); #define NO(x) x @@ -84,19 +85,19 @@ static inline unsigned long __fls(unsign #if !defined(_KERNEL) || !defined(__linux__) #ifdef QFQ_DEBUG -int test_bit(int ix, bitmap *p) +static int test_bit(int ix, bitmap *p) { if (ix < 0 || ix > 31) D("bad index %d", ix); return *p & (1< 31) D("bad index %d", ix); *p |= (1< 31) D("bad index %d", ix); @@ -230,9 +231,9 @@ struct qfq_sched { uint64_t V; /* Precise virtual time. */ uint32_t wsum; /* weight sum */ uint32_t iwsum; /* inverse weight sum */ - NO(uint32_t i_wsum; /* ONE_FP/w_sum */ - uint32_t _queued; /* debugging */ - uint32_t loops; /* debugging */) + NO(uint32_t i_wsum;) /* ONE_FP/w_sum */ + NO(uint32_t queued;) /* debugging */ + NO(uint32_t loops;) /* debugging */ bitmap bitmaps[QFQ_MAX_STATE]; /* Group bitmaps. */ struct qfq_group groups[QFQ_MAX_INDEX + 1]; /* The groups. */ }; @@ -486,6 +487,7 @@ qfq_slot_rotate(struct qfq_sched *q, str { unsigned int i = (grp->S - roundedS) >> grp->slot_shift; + (void)q; grp->full_slots <<= i; grp->front = (grp->front - i) % QFQ_MAX_SLOTS; } @@ -516,6 +518,7 @@ qfq_update_class(struct qfq_sched *q, st struct qfq_class *cl) { + (void)q; cl->S = cl->F; if (cl->_q.mq.head == NULL) { qfq_front_slot_remove(grp); @@ -853,9 +856,9 @@ dump_groups(struct qfq_sched *q, uint32_ if (g->slots[j]) D(" bucket %d %p", j, g->slots[j]); } - D("full_slots 0x%x", g->full_slots); + D("full_slots 0x%llx", (_P64)g->full_slots); D(" %2d S 0x%20llx F 0x%llx %c", i, - g->S, g->F, + (_P64)g->S, (_P64)g->F, mask & (1<loops, q->queued, q->V); - D(" ER 0x%08x", q->bitmaps[ER]); - D(" EB 0x%08x", q->bitmaps[EB]); - D(" IR 0x%08x", q->bitmaps[IR]); - D(" IB 0x%08x", q->bitmaps[IB]); + D("loops %d queued %d V 0x%llx", q->loops, q->queued, (_P64)q->V); + D(" ER 0x%08x", (unsigned)q->bitmaps[ER]); + D(" EB 0x%08x", (unsigned)q->bitmaps[EB]); + D(" IR 0x%08x", (unsigned)q->bitmaps[IR]); + D(" IB 0x%08x", (unsigned)q->bitmaps[IB]); dump_groups(q, 0xffffffff); }; #endif /* QFQ_DEBUG */ From owner-svn-src-head@freebsd.org Tue Jan 26 23:37:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ECBBA6F954; Tue, 26 Jan 2016 23:37:09 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D98A01F4E; Tue, 26 Jan 2016 23:37:08 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QNb7Ns011931; Tue, 26 Jan 2016 23:37:07 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QNb7eJ011928; Tue, 26 Jan 2016 23:37:07 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601262337.u0QNb7eJ011928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 26 Jan 2016 23:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294859 - head/sys/netpfil/ipfw/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 23:37:09 -0000 Author: luigi Date: Tue Jan 26 23:37:07 2016 New Revision: 294859 URL: https://svnweb.freebsd.org/changeset/base/294859 Log: fix various warnings to compile the test code with -Wextra Modified: head/sys/netpfil/ipfw/test/Makefile head/sys/netpfil/ipfw/test/main.c head/sys/netpfil/ipfw/test/test_dn_sched.c Modified: head/sys/netpfil/ipfw/test/Makefile ============================================================================== --- head/sys/netpfil/ipfw/test/Makefile Tue Jan 26 23:36:18 2016 (r294858) +++ head/sys/netpfil/ipfw/test/Makefile Tue Jan 26 23:37:07 2016 (r294859) @@ -20,7 +20,7 @@ HEAP_OBJS=$(HEAP_SRCS:.c=.o) VPATH= .:.. -CFLAGS = -I.. -I. -Wall -Werror -O3 -DIPFW +CFLAGS = -I.. -I. -Wall -Werror -O3 -DIPFW -Wextra TARGETS= test_sched # no test_heap by default all: $(TARGETS) Modified: head/sys/netpfil/ipfw/test/main.c ============================================================================== --- head/sys/netpfil/ipfw/test/main.c Tue Jan 26 23:36:18 2016 (r294858) +++ head/sys/netpfil/ipfw/test/main.c Tue Jan 26 23:37:07 2016 (r294859) @@ -594,9 +594,9 @@ controller(struct cfg_s *c) int flow_id; /* histeresis between max and min */ - if (c->state == 0 && c->pending >= c->th_max) + if (c->state == 0 && c->pending >= (uint32_t)c->th_max) c->state = 1; - else if (c->state == 1 && c->pending <= c->th_min) + else if (c->state == 1 && c->pending <= (uint32_t)c->th_min) c->state = 0; ND(1, "state %d pending %2d", c->state, c->pending); c->can_dequeue = c->state; Modified: head/sys/netpfil/ipfw/test/test_dn_sched.c ============================================================================== --- head/sys/netpfil/ipfw/test/test_dn_sched.c Tue Jan 26 23:36:18 2016 (r294858) +++ head/sys/netpfil/ipfw/test/test_dn_sched.c Tue Jan 26 23:37:07 2016 (r294859) @@ -15,6 +15,9 @@ m_freem(struct mbuf *m) int dn_sched_modevent(module_t mod, int cmd, void *arg) { + (void)mod; + (void)cmd; + (void)arg; return 0; } @@ -32,6 +35,8 @@ int dn_delete_queue(void *_q, void *do_free) { struct dn_queue *q = _q; + + (void)do_free; if (q->mq.head) dn_free_pkts(q->mq.head); free(q); @@ -66,6 +71,7 @@ drop: int ipdn_bound_var(int *v, int dflt, int lo, int hi, const char *msg) { + (void)msg; if (*v < lo) { *v = dflt; } else if (*v > hi) { From owner-svn-src-head@freebsd.org Tue Jan 26 23:56:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61F6DA6FE02; Tue, 26 Jan 2016 23:56:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4040CB68; Tue, 26 Jan 2016 23:56:29 +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 u0QNuS1l017906; Tue, 26 Jan 2016 23:56:28 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QNuR47017900; Tue, 26 Jan 2016 23:56:27 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601262356.u0QNuR47017900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 26 Jan 2016 23:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294860 - in head: lib/libdpv sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 23:56:29 -0000 Author: dteske Date: Tue Jan 26 23:56:27 2016 New Revision: 294860 URL: https://svnweb.freebsd.org/changeset/base/294860 Log: Add keep_tite configuration option Similar to dialog(3) keep_tite option used to prevent visually disturbing initialization or exit that could occur when run from a script using dpv(3) by way of dpv(1) in sequence with other dialog(1) invocations. Modified: head/lib/libdpv/dpv.3 head/lib/libdpv/dpv.c head/lib/libdpv/dpv.h head/lib/libdpv/dpv_private.h head/sys/sys/param.h Modified: head/lib/libdpv/dpv.3 ============================================================================== --- head/lib/libdpv/dpv.3 Tue Jan 26 23:37:07 2016 (r294859) +++ head/lib/libdpv/dpv.3 Tue Jan 26 23:56:27 2016 (r294860) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013-2015 Devin Teske +.\" Copyright (c) 2013-2016 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 22, 2015 +.Dd Jan 26, 2016 .Dt DPV 3 .Os .Sh NAME @@ -64,6 +64,7 @@ argument contains the following properti features: .Bd -literal -offset indent struct dpv_config { + uint8_t keep_tite; /* Cleaner exit for scripts */ enum dpv_display display_type; /* Def. DPV_DISPLAY_LIBDIALOG */ enum dpv_output output_type; /* Default DPV_OUTPUT_NONE */ int debug; /* Enable debug on stderr */ Modified: head/lib/libdpv/dpv.c ============================================================================== --- head/lib/libdpv/dpv.c Tue Jan 26 23:37:07 2016 (r294859) +++ head/lib/libdpv/dpv.c Tue Jan 26 23:56:27 2016 (r294860) @@ -69,6 +69,7 @@ long long dpv_overall_read = 0; static char pathbuf[PATH_MAX]; /* Extra display information */ +uint8_t keep_tite = FALSE; /* dpv_config.keep_tite */ uint8_t no_labels = FALSE; /* dpv_config.options & DPV_NO_LABELS */ uint8_t wide = FALSE; /* dpv_config.options & DPV_WIDE_MODE */ char *aprompt = NULL; /* dpv_config.aprompt */ @@ -150,6 +151,7 @@ dpv(struct dpv_config *config, struct dp dialog_updates_per_second = DIALOG_UPDATES_PER_SEC; display_limit = DISPLAY_LIMIT_DEFAULT; display_type = DPV_DISPLAY_LIBDIALOG; + keep_tite = FALSE; label_size = LABEL_SIZE_DEFAULT; msg_done = NULL; msg_fail = NULL; @@ -193,6 +195,7 @@ dpv(struct dpv_config *config, struct dp dialog_updates_per_second = config->dialog_updates_per_second; display_limit = config->display_limit; display_type = config->display_type; + keep_tite = config->keep_tite; label_size = config->label_size; msg_done = (char *)config->msg_done; msg_fail = (char *)config->msg_fail; @@ -695,7 +698,7 @@ dpv(struct dpv_config *config, struct dp close(dialog_out); waitpid(pid, (int *)NULL, 0); } - if (!dpv_interrupt) + if (!keep_tite && !dpv_interrupt) printf("\n"); } else warnx("%s: %lli overall read", __func__, dpv_overall_read); Modified: head/lib/libdpv/dpv.h ============================================================================== --- head/lib/libdpv/dpv.h Tue Jan 26 23:37:07 2016 (r294859) +++ head/lib/libdpv/dpv.h Tue Jan 26 23:56:27 2016 (r294860) @@ -97,6 +97,7 @@ struct dpv_file_node { * Anatomy of config option to pass as dpv() config argument */ struct dpv_config { + uint8_t keep_tite; /* Prevent visually distracting exit */ enum dpv_display display_type; /* Display (default TYPE_LIBDIALOG) */ enum dpv_output output_type; /* Output (default TYPE_NONE) */ int debug; /* Enable debugging output on stderr */ Modified: head/lib/libdpv/dpv_private.h ============================================================================== --- head/lib/libdpv/dpv_private.h Tue Jan 26 23:37:07 2016 (r294859) +++ head/lib/libdpv/dpv_private.h Tue Jan 26 23:56:27 2016 (r294860) @@ -38,6 +38,7 @@ extern uint8_t debug; extern unsigned int dpv_nfiles; /* Extra display information */ +extern uint8_t keep_tite; extern uint8_t no_labels; extern uint8_t wide; extern char *msg_done, *msg_fail, *msg_pending; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jan 26 23:37:07 2016 (r294859) +++ head/sys/sys/param.h Tue Jan 26 23:56:27 2016 (r294860) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100096 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100097 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue Jan 26 23:59:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE11A4606E; Tue, 26 Jan 2016 23:59: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 mx1.freebsd.org (Postfix) with ESMTPS id F3793D0F; Tue, 26 Jan 2016 23:59:31 +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 u0QNxUMl018043; Tue, 26 Jan 2016 23:59:30 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QNxUnM018041; Tue, 26 Jan 2016 23:59:30 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601262359.u0QNxUnM018041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 26 Jan 2016 23:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294861 - head/usr.bin/dpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 23:59:32 -0000 Author: dteske Date: Tue Jan 26 23:59:30 2016 New Revision: 294861 URL: https://svnweb.freebsd.org/changeset/base/294861 Log: Add `-k' for dpv(3) `keep_tite' config option For scripts using dialog(1) several times, it can be visually distracting running dpv(1) several times amidst other dialogs. The `-k' option, similar to dialog(1) `--keep-tite', enables the same functionality to smooth ti/te. Modified: head/usr.bin/dpv/dpv.1 head/usr.bin/dpv/dpv.c Modified: head/usr.bin/dpv/dpv.1 ============================================================================== --- head/usr.bin/dpv/dpv.1 Tue Jan 26 23:56:27 2016 (r294860) +++ head/usr.bin/dpv/dpv.1 Tue Jan 26 23:59:30 2016 (r294861) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013-2015 Devin Teske +.\" Copyright (c) 2013-2016 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 22, 2015 +.Dd Jan 26, 2016 .Dt DPV 1 .Os .Sh NAME @@ -138,6 +138,11 @@ Default value is .Dq Li %'10lli bytes read @ %'9.1f bytes/sec. [%i/%i busy/wait] . This format is used when handling more than one file. +.It Fl k +Keep tite. +Prevent visually distracting initialization/exit routines for scripts running +.Xr dialog 1 +several times. .It Fl l Line mode. Read lines from input instead of bytes. .It Fl L Ar size Modified: head/usr.bin/dpv/dpv.c ============================================================================== --- head/usr.bin/dpv/dpv.c Tue Jan 26 23:56:27 2016 (r294860) +++ head/usr.bin/dpv/dpv.c Tue Jan 26 23:59:30 2016 (r294861) @@ -271,7 +271,7 @@ main(int argc, char *argv[]) * Process command-line options */ while ((ch = getopt(argc, argv, - "a:b:dDhi:I:lL:mn:No:p:P:t:TU:wx:X")) != -1) { + "a:b:dDhi:I:klL:mn:No:p:P:t:TU:wx:X")) != -1) { switch(ch) { case 'a': /* additional message text to append */ if (config->aprompt == NULL) { @@ -307,6 +307,9 @@ main(int argc, char *argv[]) case 'I': /* status line format string for many-files */ config->status_many = optarg; break; + case 'k': /* keep tite */ + config->keep_tite = TRUE; + break; case 'l': /* Line mode */ line_mode = TRUE; break; @@ -467,7 +470,8 @@ main(int argc, char *argv[]) if (dpv(config, file_list) != 0 && debug) warnx("dpv(3) returned error!?"); - end_dialog(); + if (!config->keep_tite) + end_dialog(); dpv_free(); exit(EXIT_SUCCESS); From owner-svn-src-head@freebsd.org Wed Jan 27 00:02:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3158DA46262; Wed, 27 Jan 2016 00:02:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0059110C0; Wed, 27 Jan 2016 00:02: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 u0R02pxh020786; Wed, 27 Jan 2016 00:02:51 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R02pRo020783; Wed, 27 Jan 2016 00:02:51 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270002.u0R02pRo020783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 00:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294862 - head/lib/libdpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:02:53 -0000 Author: dteske Date: Wed Jan 27 00:02:51 2016 New Revision: 294862 URL: https://svnweb.freebsd.org/changeset/base/294862 Log: Bump copyrights Modified: head/lib/libdpv/dpv.c head/lib/libdpv/dpv.h head/lib/libdpv/dpv_private.h Modified: head/lib/libdpv/dpv.c ============================================================================== --- head/lib/libdpv/dpv.c Tue Jan 26 23:59:30 2016 (r294861) +++ head/lib/libdpv/dpv.c Wed Jan 27 00:02:51 2016 (r294862) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2016 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libdpv/dpv.h ============================================================================== --- head/lib/libdpv/dpv.h Tue Jan 26 23:59:30 2016 (r294861) +++ head/lib/libdpv/dpv.h Wed Jan 27 00:02:51 2016 (r294862) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2016 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libdpv/dpv_private.h ============================================================================== --- head/lib/libdpv/dpv_private.h Tue Jan 26 23:59:30 2016 (r294861) +++ head/lib/libdpv/dpv_private.h Wed Jan 27 00:02:51 2016 (r294862) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2016 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Wed Jan 27 00:03:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E2D8A462DA; Wed, 27 Jan 2016 00:03:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id D18BF1277; Wed, 27 Jan 2016 00:03: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 u0R03h52020868; Wed, 27 Jan 2016 00:03:43 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R03h83020867; Wed, 27 Jan 2016 00:03:43 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270003.u0R03h83020867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 00:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294863 - head/usr.bin/dpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:03:45 -0000 Author: dteske Date: Wed Jan 27 00:03:43 2016 New Revision: 294863 URL: https://svnweb.freebsd.org/changeset/base/294863 Log: Bump copyright Modified: head/usr.bin/dpv/dpv.c Modified: head/usr.bin/dpv/dpv.c ============================================================================== --- head/usr.bin/dpv/dpv.c Wed Jan 27 00:02:51 2016 (r294862) +++ head/usr.bin/dpv/dpv.c Wed Jan 27 00:03:43 2016 (r294863) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2016 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Wed Jan 27 00:08:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C08A4647E; Wed, 27 Jan 2016 00:08:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id EF5FD14BB; Wed, 27 Jan 2016 00:08:24 +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 u0R08ODk021060; Wed, 27 Jan 2016 00:08:24 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R08Oqf021059; Wed, 27 Jan 2016 00:08:24 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270008.u0R08Oqf021059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 00:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294864 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:08:25 -0000 Author: dteske Date: Wed Jan 27 00:08:23 2016 New Revision: 294864 URL: https://svnweb.freebsd.org/changeset/base/294864 Log: Change incorrect path Modified: head/usr.sbin/bsdconfig/share/packages/index.subr Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Wed Jan 27 00:03:43 2016 (r294863) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Wed Jan 27 00:08:23 2016 (r294864) @@ -1,6 +1,6 @@ if [ ! "$_PACKAGES_INDEX_SUBR" ]; then _PACKAGES_INDEX_SUBR=1 # -# Copyright (c) 2013 Devin Teske +# Copyright (c) 2013-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ _INDEX_INITTED= # # Default path to pkg(8) repo-packagesite.sqlite database # -SQLITE_REPO="/var/db/pkg/repo-packagesite.sqlite" +SQLITE_REPO="/var/db/pkg/repo-FreeBSD.sqlite" # # Default path to on-disk cache INDEX file From owner-svn-src-head@freebsd.org Wed Jan 27 00:09:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D47BAA4651D; Wed, 27 Jan 2016 00:09:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id A6CE1164C; Wed, 27 Jan 2016 00:09:54 +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 u0R09rNH021147; Wed, 27 Jan 2016 00:09:53 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R09rQF021146; Wed, 27 Jan 2016 00:09:53 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270009.u0R09rQF021146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 00:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294865 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:09:54 -0000 Author: dteske Date: Wed Jan 27 00:09:53 2016 New Revision: 294865 URL: https://svnweb.freebsd.org/changeset/base/294865 Log: Fix ABI parsing Modified: head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr Modified: head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr Wed Jan 27 00:08:23 2016 (r294864) +++ head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr Wed Jan 27 00:09:53 2016 (r294865) @@ -1,6 +1,6 @@ if [ ! "$_PACKAGES_MUSTHAVEPKG_SUBR" ]; then _PACKAGES_MUSTHAVEPKG_SUBR=1 # -# Copyright (c) 2014 Devin Teske +# Copyright (c) 2014-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -45,7 +45,11 @@ f_include $BSDCFG_SHARE/mustberoot.subr f_musthavepkg_init() { local funcname=f_musthavepkg_init - local pkg_abi_awk='$1~/^ABI/{print $NF; exit}' + local pkg_abi_awk=' # BEGIN-AWK + $1 ~ /^ABI/ && $0 = $NF, sub(/^"/, "") && sub(/".*/, "") { + print; found = 1; exit + } END { exit ! found } + ' # END-AWK if [ "$PKG_ABI" ]; then # Already set f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" From owner-svn-src-head@freebsd.org Wed Jan 27 00:13:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 175C3A466EB; Wed, 27 Jan 2016 00:13:00 +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 mx1.freebsd.org (Postfix) with ESMTPS id D03A31AFC; Wed, 27 Jan 2016 00:12:59 +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 u0R0Cw8L023871; Wed, 27 Jan 2016 00:12:58 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R0Cwcb023868; Wed, 27 Jan 2016 00:12:58 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270012.u0R0Cwcb023868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 00:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294866 - in head/usr.sbin/bsdconfig: include share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:13:00 -0000 Author: dteske Date: Wed Jan 27 00:12:58 2016 New Revision: 294866 URL: https://svnweb.freebsd.org/changeset/base/294866 Log: Use dpv(1) in `bsdconfig packages' Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Wed Jan 27 00:09:53 2016 (r294865) +++ head/usr.sbin/bsdconfig/include/messages.subr Wed Jan 27 00:12:58 2016 (r294866) @@ -1,5 +1,5 @@ # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,6 +60,7 @@ msg_biology_desc="Software related to bi msg_bootstrapping_pkg="Bootstrapping pkg(8)..." msg_brazil="Brazil" msg_building_package_menus="Building package menu(s)..." +msg_building_package_main_menu="Building package main menu..." msg_cad_desc="Computer Aided Design utilities." msg_canada="Canada" msg_cancel="Cancel" @@ -201,7 +202,6 @@ msg_linux_desc="Linux programs that can msg_lisp_desc="Software related to the Lisp language." msg_lithuania="Lithuania" msg_loading_of_dependent_package_failed="Loading of dependent package %s failed" -msg_located_index_now_reading_package_data_from_it="Located INDEX, now reading package data from it..." msg_logging_in_to_user_at_host="Logging in to %s@%s.." msg_looking_for_keymap_files="Looking for keymap files..." msg_looking_up_host="Looking up host %s" @@ -313,6 +313,7 @@ msg_proceed="Proceed" msg_processing_selection="Processing selection..." msg_python_desc="Software related to the Python language." msg_quick_start_how_to_use_this_menu_system="Quick start - How to use this menu system" +msg_reading_package_index_data="Reading package index data" msg_reinstall="Reinstall" msg_reinstall_desc="Mark this package for reinstall" msg_release_name="Release Name" Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Wed Jan 27 00:09:53 2016 (r294865) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Wed Jan 27 00:12:58 2016 (r294866) @@ -162,8 +162,6 @@ f_index_initialize() fi ) < "$PACKAGES_INDEX_CACHEFILE" 2> /dev/null )'; then - f_show_info \ - "$msg_located_index_now_reading_package_data_from_it" if ! f_index_read "$__var_to_set"; then f_show_err \ "$msg_io_or_format_error_on_index_file" @@ -179,8 +177,11 @@ f_index_initialize() # If we reach this point, we need to generate the data from scratch # - f_show_info "$msg_generating_index_from_pkg_database" - eval "$__var_to_set"='$( pkg rquery -I | sort )' + eval "$__var_to_set"='$( pkg rquery -I | ( + exec 2<&1; dpv -ko /dev/stderr >&$TERMINAL_STDOUT_PASSTHRU \ + -b "$DIALOG_BACKTITLE" \ + -- "$msg_generating_index_from_pkg_database" + ) | sort )' # # Attempt to create the persistant on-disk cache @@ -204,7 +205,6 @@ f_index_initialize() "$__tmpfile" "$PACKAGES_INDEX_CACHEFILE" fi - f_show_info "$msg_located_index_now_reading_package_data_from_it" if ! f_index_read "$__var_to_set"; then f_show_err "$msg_io_or_format_error_on_index_file" return $FAILURE @@ -329,7 +329,9 @@ f_index_read() sub(/^ /, "", category_list) print "PACKAGE_CATEGORIES=\"" category_list "\"" - }' )" # End-Quote + }' | ( exec 2<&1; dpv -ko /dev/stderr >&$TERMINAL_STDOUT_PASSTHRU \ + -b "$DIALOG_BACKTITLE" -- "$msg_reading_package_index_data" + ) )" # End-Quote } # f_index_extract_pages $var_to_get $var_basename $pagesize [$category] Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Wed Jan 27 00:09:53 2016 (r294865) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Wed Jan 27 00:12:58 2016 (r294866) @@ -1,6 +1,6 @@ if [ ! "$_PACKAGES_PACKAGES_SUBR" ]; then _PACKAGES_PACKAGES_SUBR=1 # -# Copyright (c) 2013 Devin Teske +# Copyright (c) 2013-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -668,6 +668,8 @@ f_package_config() # CATEGORY_MENU_LIST _categories_{varpkg} _rundeps_{varpkg} # PACKAGE_CATEGORIES _npkgs + f_show_info "$msg_building_package_main_menu" + # Detect installed packages (updates marks/SELECTED_PACKAGES) f_package_detect_installed export PACKAGES_DETECTED=1 # exported for awk(1) ENVIRON[] From owner-svn-src-head@freebsd.org Wed Jan 27 00:20:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B63A469FF; Wed, 27 Jan 2016 00:20:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id CC22F1E4C; Wed, 27 Jan 2016 00:20:08 +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 u0R0K7mQ024151; Wed, 27 Jan 2016 00:20:07 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R0K7Ed024149; Wed, 27 Jan 2016 00:20:07 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601270020.u0R0K7Ed024149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 27 Jan 2016 00:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294867 - in head/sys: net netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:20:09 -0000 Author: glebius Date: Wed Jan 27 00:20:07 2016 New Revision: 294867 URL: https://svnweb.freebsd.org/changeset/base/294867 Log: Provide TCPSTAT_DEC() and TCPSTAT_FETCH() macros. Modified: head/sys/net/vnet.h head/sys/netinet/tcp_var.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed Jan 27 00:12:58 2016 (r294866) +++ head/sys/net/vnet.h Wed Jan 27 00:20:07 2016 (r294867) @@ -101,6 +101,9 @@ struct vnet { #define VNET_PCPUSTAT_ADD(type, name, f, v) \ counter_u64_add(VNET(name)[offsetof(type, f) / sizeof(uint64_t)], (v)) +#define VNET_PCPUSTAT_FETCH(type, name, f) \ + counter_u64_fetch(VNET(name)[offsetof(type, f) / sizeof(uint64_t)]) + #define VNET_PCPUSTAT_SYSINIT(name) \ static void \ vnet_##name##_init(const void *unused) \ Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Jan 27 00:12:58 2016 (r294866) +++ head/sys/netinet/tcp_var.h Wed Jan 27 00:20:07 2016 (r294867) @@ -605,6 +605,9 @@ VNET_PCPUSTAT_DECLARE(struct tcpstat, tc #define TCPSTAT_ADD(name, val) \ VNET_PCPUSTAT_ADD(struct tcpstat, tcpstat, name, (val)) #define TCPSTAT_INC(name) TCPSTAT_ADD(name, 1) +#define TCPSTAT_DEC(name) TCPSTAT_ADD(name, -1) +#define TCPSTAT_FETCH(name) VNET_PCPUSTAT_FETCH(struct tcpstat, tcpstat, \ + name) /* * Kernel module consumers must use this accessor macro. From owner-svn-src-head@freebsd.org Wed Jan 27 00:24:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75BD8A46C6D; Wed, 27 Jan 2016 00:24:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id 46B602E9; Wed, 27 Jan 2016 00:24:25 +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 u0R0OO5j026887; Wed, 27 Jan 2016 00:24:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R0OODK026886; Wed, 27 Jan 2016 00:24:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601270024.u0R0OODK026886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 00:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294868 - head/lib/libc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:24:25 -0000 Author: bdrewery Date: Wed Jan 27 00:24:24 2016 New Revision: 294868 URL: https://svnweb.freebsd.org/changeset/base/294868 Log: Remove excess whitespace Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed Jan 27 00:20:07 2016 (r294867) +++ head/lib/libc/Makefile Wed Jan 27 00:24:24 2016 (r294868) @@ -173,7 +173,7 @@ CFLAGS+= -I${SRCTOP}/lib/libutil # Same issue with libm MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${SRCTOP}/lib/msun -V ARCH_SUBDIR # unfortunately msun/src contains both private and public headers -CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR} +CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR} .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -I${SRCTOP}/lib/msun/x86 .endif From owner-svn-src-head@freebsd.org Wed Jan 27 00:45:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 293E5A6E73C; Wed, 27 Jan 2016 00:45:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id 05112F75; Wed, 27 Jan 2016 00:45:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R0jlHW032754; Wed, 27 Jan 2016 00:45:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R0jkfl032745; Wed, 27 Jan 2016 00:45:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601270045.u0R0jkfl032745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 27 Jan 2016 00:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294869 - in head: sys/dev/cxgbe/tom sys/netinet usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:45:48 -0000 Author: glebius Date: Wed Jan 27 00:45:46 2016 New Revision: 294869 URL: https://svnweb.freebsd.org/changeset/base/294869 Log: Augment struct tcpstat with tcps_states[], which is used for book-keeping the amount of TCP connections by state. Provides a cheap way to get connection count without traversing the whole pcb list. Sponsored by: Netflix Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/netinet/tcp_offload.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/usr.bin/systat/netstat.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 27 00:24:24 2016 (r294868) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 27 00:45:46 2016 (r294869) @@ -45,10 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #define TCPSTATES #include #include +#include #include #include "common/common.h" Modified: head/sys/netinet/tcp_offload.c ============================================================================== --- head/sys/netinet/tcp_offload.c Wed Jan 27 00:24:24 2016 (r294868) +++ head/sys/netinet/tcp_offload.c Wed Jan 27 00:45:46 2016 (r294869) @@ -42,10 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #define TCPOUTFLAGS #include +#include #include int registered_toedevs; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jan 27 00:24:24 2016 (r294868) +++ head/sys/netinet/tcp_subr.c Wed Jan 27 00:45:46 2016 (r294869) @@ -1468,6 +1468,7 @@ tcp_close(struct tcpcb *tp) #endif in_pcbdrop(inp); TCPSTAT_INC(tcps_closed); + TCPSTAT_DEC(tcps_states[tp->t_state]); KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); so = inp->inp_socket; soisdisconnected(so); @@ -2910,6 +2911,8 @@ tcp_state_change(struct tcpcb *tp, int n int pstate = tp->t_state; #endif + TCPSTAT_DEC(tcps_states[tp->t_state]); + TCPSTAT_INC(tcps_states[newstate]); tp->t_state = newstate; TCP_PROBE6(state__change, NULL, tp, NULL, tp, NULL, pstate); } Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Jan 27 00:24:24 2016 (r294868) +++ head/sys/netinet/tcp_syncache.c Wed Jan 27 00:45:46 2016 (r294869) @@ -351,6 +351,7 @@ syncache_insert(struct syncache *sc, str SCH_UNLOCK(sch); + TCPSTAT_INC(tcps_states[TCPS_SYN_RECEIVED]); TCPSTAT_INC(tcps_sc_added); } @@ -364,6 +365,7 @@ syncache_drop(struct syncache *sc, struc SCH_LOCK_ASSERT(sch); + TCPSTAT_DEC(tcps_states[TCPS_SYN_RECEIVED]); TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); sch->sch_length--; @@ -992,7 +994,16 @@ syncache_expand(struct in_conninfo *inc, goto failed; } } else { - /* Pull out the entry to unlock the bucket row. */ + /* + * Pull out the entry to unlock the bucket row. + * + * NOTE: We must decrease TCPS_SYN_RECEIVED count here, not + * tcp_state_change(). The tcpcb is not existent at this + * moment. A new one will be allocated via syncache_socket-> + * sonewconn->tcp_usr_attach in TCPS_CLOSED state, then + * syncache_socket() will change it to TCPS_SYN_RECEIVED. + */ + TCPSTAT_DEC(tcps_states[TCPS_SYN_RECEIVED]); TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); sch->sch_length--; #ifdef TCP_OFFLOAD Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Wed Jan 27 00:24:24 2016 (r294868) +++ head/sys/netinet/tcp_timewait.c Wed Jan 27 00:45:46 2016 (r294869) @@ -660,6 +660,7 @@ tcp_tw_2msl_stop(struct tcptw *tw, int r if (!reuse) uma_zfree(V_tcptw_zone, tw); + TCPSTAT_DEC(tcps_states[TCPS_TIME_WAIT]); } struct tcptw * Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 27 00:24:24 2016 (r294868) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 27 00:45:46 2016 (r294869) @@ -1883,6 +1883,7 @@ tcp_attach(struct socket *so) tp->t_state = TCPS_CLOSED; INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); + TCPSTAT_INC(tcps_states[TCPS_CLOSED]); return (0); } Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Jan 27 00:24:24 2016 (r294868) +++ head/sys/netinet/tcp_var.h Wed Jan 27 00:45:46 2016 (r294869) @@ -34,6 +34,7 @@ #define _NETINET_TCP_VAR_H_ #include +#include #ifdef _KERNEL #include @@ -587,6 +588,9 @@ struct tcpstat { uint64_t tcps_sig_err_sigopt; /* No signature expected by socket */ uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ + /* Running connection count. */ + uint64_t tcps_states[TCP_NSTATES]; + uint64_t _pad[12]; /* 6 UTO, 6 TBD */ }; Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Wed Jan 27 00:24:24 2016 (r294868) +++ head/usr.bin/systat/netstat.c Wed Jan 27 00:45:46 2016 (r294869) @@ -59,10 +59,10 @@ static const char sccsid[] = "@(#)netsta #include #include #include -#include #define TCPSTATES #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Wed Jan 27 00:48:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BD7EA6E85C; Wed, 27 Jan 2016 00:48:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4491F1176; Wed, 27 Jan 2016 00:48:07 +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 u0R0m6UB032875; Wed, 27 Jan 2016 00:48:06 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R0m6ML032872; Wed, 27 Jan 2016 00:48:06 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601270048.u0R0m6ML032872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 27 Jan 2016 00:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294870 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:48:07 -0000 Author: glebius Date: Wed Jan 27 00:48:05 2016 New Revision: 294870 URL: https://svnweb.freebsd.org/changeset/base/294870 Log: Grab a snap amount of TCP connections in syncache from tcpstat. Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jan 27 00:45:46 2016 (r294869) +++ head/sys/netinet/tcp_subr.c Wed Jan 27 00:48:05 2016 (r294870) @@ -1590,7 +1590,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) * resource-intensive to repeat twice on every request. */ if (req->oldptr == NULL) { - n = V_tcbinfo.ipi_count + syncache_pcbcount(); + n = V_tcbinfo.ipi_count + + TCPSTAT_FETCH(tcps_states[TCPS_SYN_RECEIVED]); n += imax(n / 8, 10); req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb); return (0); @@ -1607,7 +1608,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); - m = syncache_pcbcount(); + m = TCPSTAT_FETCH(tcps_states[TCPS_SYN_RECEIVED]); error = sysctl_wire_old_buffer(req, 2 * (sizeof xig) + (n + m) * sizeof(struct xtcpcb)); Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Jan 27 00:45:46 2016 (r294869) +++ head/sys/netinet/tcp_syncache.c Wed Jan 27 00:48:05 2016 (r294870) @@ -2100,25 +2100,6 @@ syncookie_reseed(void *arg) } /* - * Returns the current number of syncache entries. This number - * will probably change before you get around to calling - * syncache_pcblist. - */ -int -syncache_pcbcount(void) -{ - struct syncache_head *sch; - int count, i; - - for (count = 0, i = 0; i < V_tcp_syncache.hashsize; i++) { - /* No need to lock for a read. */ - sch = &V_tcp_syncache.hashbase[i]; - count += sch->sch_length; - } - return count; -} - -/* * Exports the syncache entries to userland so that netstat can display * them alongside the other sockets. This function is intended to be * called only from tcp_pcblist. Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Wed Jan 27 00:45:46 2016 (r294869) +++ head/sys/netinet/tcp_syncache.h Wed Jan 27 00:48:05 2016 (r294870) @@ -46,7 +46,6 @@ int syncache_add(struct in_conninfo *, void *, void *); void syncache_chkrst(struct in_conninfo *, struct tcphdr *); void syncache_badack(struct in_conninfo *); -int syncache_pcbcount(void); int syncache_pcblist(struct sysctl_req *req, int max_pcbs, int *pcbs_exported); struct syncache { From owner-svn-src-head@freebsd.org Wed Jan 27 00:50:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B5BFA6E993; Wed, 27 Jan 2016 00:50:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id B821F1332; Wed, 27 Jan 2016 00:50:28 +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 u0R0oRGv033002; Wed, 27 Jan 2016 00:50:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R0oRDd033001; Wed, 27 Jan 2016 00:50:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601270050.u0R0oRDd033001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 27 Jan 2016 00:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294871 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 00:50:29 -0000 Author: glebius Date: Wed Jan 27 00:50:27 2016 New Revision: 294871 URL: https://svnweb.freebsd.org/changeset/base/294871 Log: Grab value for LEAF_tcpCurrEstab from net.inet.tcp.stats instead of net.inet.tcp.pcblist, which is much cheaper. Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Wed Jan 27 00:48:05 2016 (r294870) +++ head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Wed Jan 27 00:50:27 2016 (r294871) @@ -45,10 +45,10 @@ struct tcp_index { }; static uint64_t tcp_tick; +static uint64_t tcp_stats_tick; static struct tcpstat tcpstat; static struct xinpgen *xinpgen; static size_t xinpgen_len; -static u_int tcp_count; static u_int tcp_total; static u_int oidnum; @@ -64,13 +64,9 @@ tcp_compare(const void *p1, const void * } static int -fetch_tcp(void) +fetch_tcp_stats(void) { size_t len; - struct xinpgen *ptr; - struct xtcpcb *tp; - struct tcp_index *oid; - in_addr_t inaddr; len = sizeof(tcpstat); if (sysctlbyname("net.inet.tcp.stats", &tcpstat, &len, NULL, 0) == -1) { @@ -82,6 +78,20 @@ fetch_tcp(void) return (-1); } + tcp_stats_tick = get_ticks(); + + return (0); +} + +static int +fetch_tcp(void) +{ + size_t len; + struct xinpgen *ptr; + struct xtcpcb *tp; + struct tcp_index *oid; + in_addr_t inaddr; + len = 0; if (sysctlbyname("net.inet.tcp.pcblist", NULL, &len, NULL, 0) == -1) { syslog(LOG_ERR, "net.inet.tcp.pcblist: %m"); @@ -102,7 +112,6 @@ fetch_tcp(void) tcp_tick = get_ticks(); - tcp_count = 0; tcp_total = 0; for (ptr = (struct xinpgen *)(void *)((char *)xinpgen + xinpgen->xig_len); ptr->xig_len > sizeof(struct xinpgen); @@ -114,10 +123,6 @@ fetch_tcp(void) if (tp->xt_inp.inp_vflag & INP_IPV4) tcp_total++; - - if (tp->xt_tp.t_state == TCPS_ESTABLISHED || - tp->xt_tp.t_state == TCPS_CLOSE_WAIT) - tcp_count++; } if (oidnum < tcp_total) { @@ -184,8 +189,8 @@ op_tcp(struct snmp_context *ctx __unused abort(); } - if (tcp_tick < this_tick) - if (fetch_tcp() == -1) + if (tcp_stats_tick < this_tick) + if (fetch_tcp_stats() == -1) return (SNMP_ERR_GENERR); switch (value->var.subs[sub - 1]) { @@ -226,7 +231,8 @@ op_tcp(struct snmp_context *ctx __unused break; case LEAF_tcpCurrEstab: - value->v.uint32 = tcp_count; + value->v.uint32 = tcpstat.tcps_states[TCPS_ESTABLISHED] + + tcpstat.tcps_states[TCPS_CLOSE_WAIT]; break; case LEAF_tcpInSegs: From owner-svn-src-head@freebsd.org Wed Jan 27 01:24:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D6D8A6F463; Wed, 27 Jan 2016 01:24: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 mx1.freebsd.org (Postfix) with ESMTPS id 4B8DF660; Wed, 27 Jan 2016 01:24:06 +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 u0R1O5oQ044276; Wed, 27 Jan 2016 01:24:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R1O5t8044275; Wed, 27 Jan 2016 01:24:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601270124.u0R1O5t8044275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 01:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294872 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 01:24:06 -0000 Author: bdrewery Date: Wed Jan 27 01:24:05 2016 New Revision: 294872 URL: https://svnweb.freebsd.org/changeset/base/294872 Log: Fix DIRDEPS_BUILD after r294752. DIRDEPS_BUILD does not yet support PROGS having their own dependency file. Overriding .MAKE.DEPENDFILE here causes major problems with the meta mode logic since it creates the Makefile.depend as '.depend' resulting in infinite loops in make due to dirdeps.mk including .depend endlessly. X-MFC-With: r294752 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Jan 27 00:50:27 2016 (r294871) +++ head/share/mk/bsd.dep.mk Wed Jan 27 01:24:05 2016 (r294872) @@ -56,7 +56,9 @@ _MKDEPCC+= ${DEPFLAGS} .endif MKDEPCMD?= CC='${_MKDEPCC}' mkdep DEPENDFILE?= .depend +.if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= ${DEPENDFILE} +.endif DEPENDFILES= ${DEPENDFILE} # Keep `tags' here, before SRCS are mangled below for `depend'. From owner-svn-src-head@freebsd.org Wed Jan 27 01:24:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99226A6F480; Wed, 27 Jan 2016 01:24:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 68004678; Wed, 27 Jan 2016 01:24:09 +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 u0R1O82G044321; Wed, 27 Jan 2016 01:24:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R1O8rN044320; Wed, 27 Jan 2016 01:24:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601270124.u0R1O8rN044320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 01:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294873 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 01:24:09 -0000 Author: bdrewery Date: Wed Jan 27 01:24:08 2016 New Revision: 294873 URL: https://svnweb.freebsd.org/changeset/base/294873 Log: Set a value for _RECURSING_PROGS for debugging. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Wed Jan 27 01:24:05 2016 (r294872) +++ head/share/mk/bsd.progs.mk Wed Jan 27 01:24:08 2016 (r294873) @@ -119,7 +119,7 @@ x.$p= PROG_CXX=$p $p ${p}_p: .PHONY .MAKE (cd ${.CURDIR} && \ DEPENDFILE=.depend.$p \ - NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS=t \ PROG=$p ${x.$p}) # Pseudo targets for PROG, such as 'install'. @@ -127,7 +127,7 @@ $p ${p}_p: .PHONY .MAKE $p.$t: .PHONY .MAKE (cd ${.CURDIR} && \ DEPENDFILE=.depend.$p \ - NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS=t \ PROG=$p ${x.$p} ${@:E}) .endfor .endfor From owner-svn-src-head@freebsd.org Wed Jan 27 01:24:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C60BFA6F48C; Wed, 27 Jan 2016 01:24: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 mx1.freebsd.org (Postfix) with ESMTPS id 97F6B7F7; Wed, 27 Jan 2016 01:24: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 u0R1OBr7044370; Wed, 27 Jan 2016 01:24:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R1OBIr044369; Wed, 27 Jan 2016 01:24:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601270124.u0R1OBIr044369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 01:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294874 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 01:24:12 -0000 Author: bdrewery Date: Wed Jan 27 01:24:11 2016 New Revision: 294874 URL: https://svnweb.freebsd.org/changeset/base/294874 Log: FAST_DEPEND: Apply missed nofilemon fix from r294351. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Jan 27 01:24:08 2016 (r294873) +++ head/sys/conf/kern.post.mk Wed Jan 27 01:24:11 2016 (r294874) @@ -200,7 +200,8 @@ SRCS= assym.s vnode_if.h ${BEFORE_DEPEND ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} DEPENDFILES= .depend -.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" +.if ${MK_FAST_DEPEND} == "yes" && \ + (${.MAKE.MODE:Unormal:Mmeta} == "" || ${.MAKE.MODE:Unormal:Mnofilemon} != "") DEPENDFILES+= .depend.* DEPEND_CFLAGS+= -MD -MP -MF.depend.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} From owner-svn-src-head@freebsd.org Wed Jan 27 01:24:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0C17A6F4AA; Wed, 27 Jan 2016 01:24:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6AB9A897; Wed, 27 Jan 2016 01:24:15 +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 u0R1OE55044420; Wed, 27 Jan 2016 01:24:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R1OEgA044419; Wed, 27 Jan 2016 01:24:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601270124.u0R1OEgA044419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 01:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294875 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 01:24:15 -0000 Author: bdrewery Date: Wed Jan 27 01:24:14 2016 New Revision: 294875 URL: https://svnweb.freebsd.org/changeset/base/294875 Log: FAST_DEPEND: Mark some unneeded code for later removal. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Wed Jan 27 01:24:11 2016 (r294874) +++ head/sys/conf/kern.pre.mk Wed Jan 27 01:24:14 2016 (r294875) @@ -64,7 +64,7 @@ NOSTDINC= -nostdinc INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -.if make(depend) || make(kernel-depend) +.if ${MK_FAST_DEPEND} == "no" && (make(depend) || make(kernel-depend)) # This hack lets us use the ipfilter code without spamming a new # include path into contrib'ed source files. From owner-svn-src-head@freebsd.org Wed Jan 27 01:33:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C9AA6F830; Wed, 27 Jan 2016 01:33:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id 65E97F5F; Wed, 27 Jan 2016 01:33:20 +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 u0R1XJV0047431; Wed, 27 Jan 2016 01:33:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R1XJF6047430; Wed, 27 Jan 2016 01:33:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601270133.u0R1XJF6047430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 01:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294876 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 01:33:20 -0000 Author: bdrewery Date: Wed Jan 27 01:33:19 2016 New Revision: 294876 URL: https://svnweb.freebsd.org/changeset/base/294876 Log: nslexer.c does not depend on nsparser.h. nslexer.o depends on nsparser.h, which is already added by bsd.lib.mk and .depend. This reverts r237402. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/net/Makefile.inc Modified: head/lib/libc/net/Makefile.inc ============================================================================== --- head/lib/libc/net/Makefile.inc Wed Jan 27 01:24:14 2016 (r294875) +++ head/lib/libc/net/Makefile.inc Wed Jan 27 01:33:19 2016 (r294876) @@ -36,7 +36,7 @@ LFLAGS+=-P_nsyy CLEANFILES+=nslexer.c nslexer.c.* -nslexer.c: nslexer.l nsparser.h +nslexer.c: nslexer.l ${LEX} ${LFLAGS} -o${.TARGET}.tmp1 ${.IMPSRC} sed -e '/YY_BUF_SIZE/s/16384/1024/' ${.TARGET}.tmp1 >${.TARGET}.tmp2 rm -f ${.TARGET}.tmp1 From owner-svn-src-head@freebsd.org Wed Jan 27 01:33:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EA1AA6F852; Wed, 27 Jan 2016 01:33:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 40FAFFA9; Wed, 27 Jan 2016 01:33:24 +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 u0R1XNuZ047476; Wed, 27 Jan 2016 01:33:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R1XN9H047475; Wed, 27 Jan 2016 01:33:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601270133.u0R1XN9H047475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 01:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294877 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 01:33:24 -0000 Author: bdrewery Date: Wed Jan 27 01:33:23 2016 New Revision: 294877 URL: https://svnweb.freebsd.org/changeset/base/294877 Log: Replace nslexer.l->nslexer.c custom rule with a -D CFLAG. This avoids reproducing the lex logic which had dependencies set wrong and used an intermediate file for modifying the YY_BUF_SIZE. This has only been possible since flex 2.5.37 was imported in r250873, which uses #ifndef YY_BUF_SIZE. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/net/Makefile.inc Modified: head/lib/libc/net/Makefile.inc ============================================================================== --- head/lib/libc/net/Makefile.inc Wed Jan 27 01:33:19 2016 (r294876) +++ head/lib/libc/net/Makefile.inc Wed Jan 27 01:33:23 2016 (r294877) @@ -12,7 +12,7 @@ SRCS+= base64.c ether_addr.c eui64.c \ getproto.c getprotoent.c getprotoname.c getservent.c \ if_indextoname.c if_nameindex.c if_nametoindex.c \ ip6opt.c linkaddr.c map_v4v6.c name6.c ntoh.c \ - nsdispatch.c nslexer.c nsparser.y nss_compat.c \ + nsdispatch.c nslexer.l nsparser.y nss_compat.c \ rcmd.c rcmdsh.c recv.c rthdr.c sctp_sys_calls.c send.c \ sockatmark.c sourcefilter.c vars.c @@ -34,13 +34,8 @@ CFLAGS+=-I${LIBC_SRCTOP}/resolv YFLAGS+=-p_nsyy LFLAGS+=-P_nsyy -CLEANFILES+=nslexer.c nslexer.c.* - -nslexer.c: nslexer.l - ${LEX} ${LFLAGS} -o${.TARGET}.tmp1 ${.IMPSRC} - sed -e '/YY_BUF_SIZE/s/16384/1024/' ${.TARGET}.tmp1 >${.TARGET}.tmp2 - rm -f ${.TARGET}.tmp1 - mv -f ${.TARGET}.tmp2 ${.TARGET} +CFLAGS.nslexer.c= -DYY_BUF_SIZE=1024 +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} MAN+= byteorder.3 ethers.3 eui64.3 \ getaddrinfo.3 gai_strerror.3 gethostbyname.3 \ From owner-svn-src-head@freebsd.org Wed Jan 27 01:33:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC98CA6F870; Wed, 27 Jan 2016 01:33:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5CD371088; Wed, 27 Jan 2016 01:33:27 +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 u0R1XQNA047523; Wed, 27 Jan 2016 01:33:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R1XQge047522; Wed, 27 Jan 2016 01:33:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601270133.u0R1XQge047522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 01:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294878 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 01:33:27 -0000 Author: bdrewery Date: Wed Jan 27 01:33:26 2016 New Revision: 294878 URL: https://svnweb.freebsd.org/changeset/base/294878 Log: Revert yacc dependency back to pre-r241298. Several attempts to fix this logic was done after r241298, which were all reverted, yet this change was not. The .h file does not depend on the .c file, so do not impose such a dependency on it. They are generated by the same command but do not depend on each other. Restore the .ORDER which should handle parallel build issues. This fixes an actual bug where the .h file is not recreated when missing [1]. For example: cd lib/libc make cleanobj make nsparser.h rm nsparser.h make nsparser.h # will not rebuild nsparser.h I have been trying to track down a build problem where nsparser.h is missing when nslexer.o is built. It is possible this is related. Reported by: bde [1] https://lists.freebsd.org/pipermail/svn-src-all/2012-October/059481.html https://lists.freebsd.org/pipermail/svn-src-all/2012-October/060038.html MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Jan 27 01:33:23 2016 (r294877) +++ head/share/mk/bsd.dep.mk Wed Jan 27 01:33:26 2016 (r294878) @@ -110,8 +110,8 @@ ${_YC} y.tab.h: ${_YSRC} CLEANFILES+= y.tab.c y.tab.h .elif !empty(YFLAGS:M-d) .for _YH in ${_YC:R}.h -${_YH}: ${_YC} -${_YC}: ${_YSRC} +.ORDER: ${_YC} ${_YH} +${_YC} ${_YH}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} SRCS+= ${_YH} CLEANFILES+= ${_YH} From owner-svn-src-head@freebsd.org Wed Jan 27 02:08:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83256A6E477; Wed, 27 Jan 2016 02:08:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5516C677; Wed, 27 Jan 2016 02:08:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R28U07056478; Wed, 27 Jan 2016 02:08:30 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R28UdV056477; Wed, 27 Jan 2016 02:08:30 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601270208.u0R28UdV056477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Wed, 27 Jan 2016 02:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294879 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 02:08:31 -0000 Author: luigi Date: Wed Jan 27 02:08:30 2016 New Revision: 294879 URL: https://svnweb.freebsd.org/changeset/base/294879 Log: bugfix: the scheduler template (dn_schk) for the round robin scheduler is followed by another structure (rr_schk) whose size must be set in the schk_datalen field of the descriptor. Not allocating the memory may cause other memory to be overwritten (though dn_schk is 192 bytes and rr_schk only 12 so we may be lucky and end up in the padding after the dn_schk). This is a merge candidate for stable and 10.3 MFC after: 3 days Modified: head/sys/netpfil/ipfw/dn_sched_rr.c Modified: head/sys/netpfil/ipfw/dn_sched_rr.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_rr.c Wed Jan 27 01:33:26 2016 (r294878) +++ head/sys/netpfil/ipfw/dn_sched_rr.c Wed Jan 27 02:08:30 2016 (r294879) @@ -294,7 +294,7 @@ static struct dn_alg rr_desc = { _SI( .name = ) "RR", _SI( .flags = ) DN_MULTIQUEUE, - _SI( .schk_datalen = ) 0, + _SI( .schk_datalen = ) sizeof(struct rr_schk), _SI( .si_datalen = ) sizeof(struct rr_si), _SI( .q_datalen = ) sizeof(struct rr_queue) - sizeof(struct dn_queue), @@ -311,5 +311,6 @@ static struct dn_alg rr_desc = { _SI( .free_queue = ) rr_free_queue, }; +_Static_assert(sizeof(struct dn_schk) < 193, "a"); DECLARE_DNSCHED_MODULE(dn_rr, &rr_desc); From owner-svn-src-head@freebsd.org Wed Jan 27 02:11:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5FA1A6E629; Wed, 27 Jan 2016 02:11:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7B5D78F8; Wed, 27 Jan 2016 02:11:59 +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 u0R2BwAW059102; Wed, 27 Jan 2016 02:11:58 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R2Bwvl059101; Wed, 27 Jan 2016 02:11:58 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270211.u0R2Bwvl059101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 02:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294880 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 02:11:59 -0000 Author: dteske Date: Wed Jan 27 02:11:58 2016 New Revision: 294880 URL: https://svnweb.freebsd.org/changeset/base/294880 Log: Replace awk with more efficient builtins-only algo Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Wed Jan 27 02:08:30 2016 (r294879) +++ head/usr.sbin/bsdconfig/share/strings.subr Wed Jan 27 02:11:58 2016 (r294880) @@ -70,17 +70,63 @@ f_substr() # f_snprintf() { + local __funcname=f_snprintf local __var_to_set="$1" __size="$2" shift 2 # var_to_set size - eval "$__var_to_set"=\$\( printf -- \"\$@\" \| \ - awk -v max=\"\$__size\" \'' - { - len = length($0) - max -= len - print substr($0,0,(max > 0 ? len : max + len)) - if ( max < 0 ) exit - max-- - }'\' \) + + if [ "$__size" -eq 0 ] 2> /dev/null; then + setvar "$__var_to_set" "" + return ${SUCCESS:-0} + elif [ $? -ge 2 ] || [ $__size -lt 0 ]; then + setvar "$__var_to_set" "" + echo "$__funcname: invalid size argument \`__size'" >&2 + return ${FAILURE:-1} + fi + + local __f_snprintf_tmp + f_sprintf __f_snprintf_tmp "$@" + + local __tmp_size=${#__f_snprintf_tmp} + local __trim=$(( $__tmp_size - $__size )) __trimq + local __tbuf __tbuf_len + local __mask __mask_len + while [ $__trim -gt 0 ]; do + __tbuf="?" + __tbuf_len=1 + if [ $__trim -le $__size ]; then + while [ $__tbuf_len -lt $(( $__trim / $__tbuf_len )) ] + do + __tbuf="$__tbuf?" + __tbuf_len=$(( $__tbuf_len + 1 )) + done + __trimq=$(( $__trim / $__tbuf_len )) + __trim=$(( $__trim - $__tbuf_len * $__trimq )) + while [ $__trimq -gt 0 ]; do + __f_snprintf_tmp="${__f_snprintf_tmp%$__tbuf}" + __trimq=$(( $__trimq - 1 )) + done + else + __mask="$__f_snprintf_tmp" + while [ $__tbuf_len -lt $(( $__size / $__tbuf_len )) ] + do + __tbuf="$__tbuf?" + __tbuf_len=$(( $__tbuf_len + 1 )) + done + __trimq=$(( $__size / $__tbuf_len )) + if [ $(( $__trimq * $__tbuf_len )) -ne $__size ]; then + __tbuf="$__tbuf?" + __tbuf_len=$(( $__tbuf_len + 1 )) + fi + __mask_len=$(( $__tmp_size - $__tbuf_len * $__trimq )) + __trim=$(( $__tmp_size - $__mask_len - $__size )) + while [ $__trimq -gt 0 ]; do + __mask="${__mask#$__tbuf}" + __trimq=$(( $__trimq - 1 )) + done + __f_snprintf_tmp="${__f_snprintf_tmp%"$__mask"}" + fi + done + setvar "$__var_to_set" "$__f_snprintf_tmp" } # f_sprintf $var_to_set $format [$arguments ...] From owner-svn-src-head@freebsd.org Wed Jan 27 02:14:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FF86A6E6F4; Wed, 27 Jan 2016 02:14:10 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7CF3BC6; Wed, 27 Jan 2016 02:14:09 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R2E8iS059217; Wed, 27 Jan 2016 02:14:08 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R2E8N8059216; Wed, 27 Jan 2016 02:14:08 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601270214.u0R2E8N8059216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Wed, 27 Jan 2016 02:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294881 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 02:14:10 -0000 Author: luigi Date: Wed Jan 27 02:14:08 2016 New Revision: 294881 URL: https://svnweb.freebsd.org/changeset/base/294881 Log: the _Static_assert was not supposed to be in the commit. Modified: head/sys/netpfil/ipfw/dn_sched_rr.c Modified: head/sys/netpfil/ipfw/dn_sched_rr.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_rr.c Wed Jan 27 02:11:58 2016 (r294880) +++ head/sys/netpfil/ipfw/dn_sched_rr.c Wed Jan 27 02:14:08 2016 (r294881) @@ -311,6 +311,5 @@ static struct dn_alg rr_desc = { _SI( .free_queue = ) rr_free_queue, }; -_Static_assert(sizeof(struct dn_schk) < 193, "a"); DECLARE_DNSCHED_MODULE(dn_rr, &rr_desc); From owner-svn-src-head@freebsd.org Wed Jan 27 02:22:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC398A6E9F5; Wed, 27 Jan 2016 02:22:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95D8FFEA; Wed, 27 Jan 2016 02:22:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R2MVXo061992; Wed, 27 Jan 2016 02:22:31 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R2MVRg061986; Wed, 27 Jan 2016 02:22:31 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201601270222.u0R2MVRg061986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Wed, 27 Jan 2016 02:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294882 - head/sys/netpfil/ipfw/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 02:22:33 -0000 Author: luigi Date: Wed Jan 27 02:22:31 2016 New Revision: 294882 URL: https://svnweb.freebsd.org/changeset/base/294882 Log: cleanup and document in some detail the internals of the testing code for dummynet schedulers Modified: head/sys/netpfil/ipfw/test/Makefile head/sys/netpfil/ipfw/test/dn_test.h head/sys/netpfil/ipfw/test/main.c head/sys/netpfil/ipfw/test/mylist.h head/sys/netpfil/ipfw/test/test_dn_sched.c Modified: head/sys/netpfil/ipfw/test/Makefile ============================================================================== --- head/sys/netpfil/ipfw/test/Makefile Wed Jan 27 02:14:08 2016 (r294881) +++ head/sys/netpfil/ipfw/test/Makefile Wed Jan 27 02:22:31 2016 (r294882) @@ -20,7 +20,7 @@ HEAP_OBJS=$(HEAP_SRCS:.c=.o) VPATH= .:.. -CFLAGS = -I.. -I. -Wall -Werror -O3 -DIPFW -Wextra +CFLAGS = -I.. -I. -Wall -Werror -O3 -Wextra TARGETS= test_sched # no test_heap by default all: $(TARGETS) Modified: head/sys/netpfil/ipfw/test/dn_test.h ============================================================================== --- head/sys/netpfil/ipfw/test/dn_test.h Wed Jan 27 02:14:08 2016 (r294881) +++ head/sys/netpfil/ipfw/test/dn_test.h Wed Jan 27 02:22:31 2016 (r294882) @@ -23,8 +23,8 @@ extern "C" { extern int debug; #define ND(fmt, args...) do {} while (0) #define D1(fmt, args...) do {} while (0) -#define D(fmt, args...) fprintf(stderr, "%-8s " fmt "\n", \ - __FUNCTION__, ## args) +#define D(fmt, args...) fprintf(stderr, "%-10s %4d %-8s " fmt "\n", \ + __FILE__, __LINE__, __FUNCTION__, ## args) #define DX(lev, fmt, args...) do { \ if (debug > lev) D(fmt, ## args); } while (0) @@ -53,11 +53,24 @@ enum { DN_SCHED_WF2QP, }; +/* from ip_dummynet.h, fields used in ip_dn_private.h */ struct dn_id { - int type, subtype, len, id; + uint16_t len; /* total len inc. this header */ + uint8_t type; + uint8_t subtype; +// uint32_t id; /* generic id */ }; +/* (from ip_dummynet.h) + * A flowset, which is a template for flows. Contains parameters + * from the command line: id, target scheduler, queue sizes, plr, + * flow masks, buckets for the flow hash, and possibly scheduler- + * specific parameters (weight, quantum and so on). + */ struct dn_fs { + /* generic scheduler parameters. Leave them at -1 if unset. + * Now we use 0: weight, 1: lmax, 2: priority + */ int par[4]; /* flowset parameters */ /* simulation entries. @@ -78,16 +91,29 @@ struct dn_fs { int cur; }; +/* (ip_dummynet.h) + * scheduler template, indicating nam, number, mask and buckets + */ struct dn_sch { }; +/* (from ip_dummynet.h) + * dn_flow collects flow_id and stats for queues and scheduler + * instances, and is used to pass these info to userland. + * oid.type/oid.subtype describe the object, oid.id is number + * of the parent object. + */ struct dn_flow { struct dn_id oid; - int length; - int len_bytes; - int drops; + uint64_t tot_pkts; uint64_t tot_bytes; - uint32_t flow_id; + uint32_t length; /* Queue length, in packets */ + uint32_t len_bytes; /* Queue length, in bytes */ + uint32_t drops; + //uint32_t flow_id; + + /* the following fields are used by the traffic generator. + */ struct list_head h; /* used by the generator */ /* bytes served by the flow since the last backlog time */ @@ -96,6 +122,7 @@ struct dn_flow { uint64_t sch_bytes; }; +/* the link */ struct dn_link { }; @@ -107,9 +134,9 @@ struct mbuf { int len; } m_pkthdr; struct mbuf *m_nextpkt; - int flow_id; /* for testing, index of a flow */ + uint32_t flow_id; /* for testing, index of a flow */ //int flowset_id; /* for testing, index of a flowset */ - void *cfg; /* config args */ + //void *cfg; /* config args */ }; #define MALLOC_DECLARE(x) extern volatile int __dummy__ ## x @@ -131,36 +158,9 @@ typedef struct _md_t moduledata_t; moduledata_t *_g_##name = & b #define MODULE_DEPEND(a, b, c, d, e) -#ifdef IPFW #include #include #include -#else -struct dn_queue { - struct dn_fsk *fs; /* parent flowset. */ - struct dn_sch_inst *_si; /* parent sched instance. */ -}; -struct dn_schk { -}; -struct dn_fsk { - struct dn_fs fs; - struct dn_schk *sched; -}; -struct dn_sch_inst { - struct dn_schk *sched; -}; -struct dn_alg { - int type; - const char *name; - void *enqueue, *dequeue; - int q_datalen, si_datalen, schk_datalen; - int (*config)(struct dn_schk *); - int (*new_sched)(struct dn_sch_inst *); - int (*new_fsk)(struct dn_fsk *); - int (*new_queue)(struct dn_queue *q); -}; - -#endif #ifndef __FreeBSD__ int fls(int); Modified: head/sys/netpfil/ipfw/test/main.c ============================================================================== --- head/sys/netpfil/ipfw/test/main.c Wed Jan 27 02:14:08 2016 (r294881) +++ head/sys/netpfil/ipfw/test/main.c Wed Jan 27 02:22:31 2016 (r294882) @@ -9,11 +9,9 @@ * keeping track of statistics. */ -#include "dn_test.h" +// #define USE_BURST // what is this for ? -struct q_list { - struct list_head h; -}; +#include "dn_test.h" struct cfg_s { int ac; @@ -30,14 +28,19 @@ struct cfg_s { uint32_t dequeue; /* generator parameters */ - int th_min, th_max; + int32_t th_min, th_max; /* thresholds for hysteresis; negative means per flow */ +#ifdef USE_BURST int maxburst; +#endif /* USE_BURST */ int lmin, lmax; /* packet len */ int flows; /* number of flows */ int flowsets; /* number of flowsets */ int wsum; /* sum of weights of all flows */ +#ifdef USE_CUR int max_y; /* max random number in the generation */ - int cur_y, cur_fs; /* used in generation, between 0 and max_y - 1 */ + int cur_y + int cur_fs; /* used in generation, between 0 and max_y - 1 */ +#endif /* USE_CUR */ const char *fs_config; /* flowset config */ int can_dequeue; int burst; /* count of packets sent in a burst */ @@ -52,17 +55,26 @@ struct cfg_s { struct mbuf *); struct mbuf * (*deq)(struct dn_sch_inst *); /* size of the three fields including sched-specific areas */ - int schk_len; - int q_len; /* size of a queue including sched-fields */ - int si_len; /* size of a sch_inst including sched-fields */ + uint32_t schk_len; + uint32_t q_len; /* size of a queue including sched-fields */ + uint32_t si_len; /* size of a sch_inst including sched-fields */ char *q; /* array of flow queues */ /* use a char* because size is variable */ - struct dn_fsk *fs; /* array of flowsets */ - struct dn_sch_inst *si; + /* + * The scheduler template (one) followd by schk_datalen bytes + * for scheduler-specific parameters, total size is schk_len + */ struct dn_schk *sched; + /* + * one scheduler instance, followed by si_datalen bytes + * for scheduler specific parameters of this instance, + * total size is si_len. si->sched points to sched + */ + struct dn_sch_inst *si; + struct dn_fsk *fs; /* array of flowsets */ /* generator state */ - int state; /* 0 = going up, 1: going down */ + int state; /* 0 = going up (enqueue), 1: going down (dequeue) */ /* * We keep lists for each backlog level, and always serve @@ -72,17 +84,18 @@ struct cfg_s { * XXX to optimize things, entry i could contain queues with * 2^{i-1}+1 .. 2^i entries. */ -#define BACKLOG 30 - uint32_t llmask; +#define BACKLOG 30 /* this many backlogged classes, we only need BACKLOG+1 */ + uint64_t llmask; struct list_head ll[BACKLOG + 10]; double *q_wfi; /* (byte) Worst-case Fair Index of the flows */ double wfi; /* (byte) Worst-case Fair Index of the system */ }; -/* FI2Q and Q2FI converts from flow_id to dn_queue and back. - * We cannot easily use pointer arithmetic because it is variable size. - */ +/* FI2Q and Q2FI converts from flow_id (i.e. queue index) + * to dn_queue and back. We cannot simply use pointer arithmetic + * because the queu has variable size, q_len + */ #define FI2Q(c, i) ((struct dn_queue *)((c)->q + (c)->q_len * (i))) #define Q2FI(c, q) (((char *)(q) - (c)->q)/(c)->q_len) @@ -92,10 +105,11 @@ struct dn_parms dn_cfg; static void controller(struct cfg_s *c); -/* release a packet: put the mbuf in the freelist, and the queue in - * the bucket. +/* release a packet for a given flow_id. + * Put the mbuf in the freelist, and in case move the + * flow to the end of the bucket. */ -int +static int drop(struct cfg_s *c, struct mbuf *m) { struct dn_queue *q; @@ -118,31 +132,36 @@ drop(struct cfg_s *c, struct mbuf *m) return 0; } -/* dequeue returns NON-NULL when a packet is dropped */ + +/* + * dn_sch_inst does not have a queue, for the RR we + * allocate a mq right after si + */ static int -enqueue(struct cfg_s *c, void *_m) +default_enqueue(struct dn_sch_inst *si, struct dn_queue *q, struct mbuf *m) { - struct mbuf *m = _m; - if (c->enq) - return c->enq(c->si, FI2Q(c, m->flow_id), m); - if (c->head == NULL) - c->head = m; + struct mq *mq = (struct mq *)si; + + (void)q; + /* this is the default function if no scheduler is provided */ + if (mq->head == NULL) + mq->head = m; else - c->tail->m_nextpkt = m; - c->tail = m; + mq->tail->m_nextpkt = m; + mq->tail = m; return 0; /* default - success */ } -/* dequeue returns NON-NULL when a packet is available */ -static void * -dequeue(struct cfg_s *c) + +static struct mbuf * +default_dequeue(struct dn_sch_inst *si) { + struct mq *mq = (struct mq *)si; struct mbuf *m; - if (c->deq) - return c->deq(c->si); - if ((m = c->head)) { - m = c->head; - c->head = m->m_nextpkt; + /* this is the default function if no scheduler is provided */ + if ((m = mq->head)) { + m = mq->head; + mq->head = m->m_nextpkt; m->m_nextpkt = NULL; } return m; @@ -193,23 +212,34 @@ mainloop(struct cfg_s *c) DX(3, "loop %d enq %d send %p rx %d", i, c->_enqueue, c->tosend, c->can_dequeue); if ( (m = c->tosend) ) { + int ret; + struct dn_queue *q = FI2Q(c, m->flow_id); c->_enqueue++; - if (enqueue(c, m)) { + ret = c->enq(c->si, q, m); + if (ret) { drop(c, m); - ND("loop %d enqueue fail", i ); + D("loop %d enqueue fail", i ); + /* + * XXX do not insist; rather, try dequeue + */ + goto do_dequeue; } else { ND("enqueue ok"); c->pending++; gnet_stats_enq(c, m); } - } - if (c->can_dequeue) { + } else if (c->can_dequeue) { +do_dequeue: c->dequeue++; - if ((m = dequeue(c))) { + m = c->deq(c->si); + if (m) { c->pending--; drop(c, m); c->drop--; /* compensate */ gnet_stats_deq(c, m); + } else { + D("--- ouch, cannot operate on iteration %d, pending %d", i, c->pending); + break; } } } @@ -221,11 +251,10 @@ int dump(struct cfg_s *c) { int i; - struct dn_queue *q; for (i=0; i < c->flows; i++) { - q = FI2Q(c, i); - DX(1, "queue %4d tot %10llu", i, + //struct dn_queue *q = FI2Q(c, i); + ND(1, "queue %4d tot %10llu", i, (unsigned long long)q->ni.tot_bytes); } DX(1, "done %d loops\n", c->loops); @@ -284,20 +313,25 @@ getnum(const char *s, char **next, const * weight:maxlen:flows * indicating how many flows are hooked to that fs. * Both weight and range can be min-max-steps. - * In a first pass we just count the number of flowsets and flows, - * in a second pass we complete the setup. + * The first pass (fs != NULL) justs count the number of flowsets and flows, + * the second pass (fs == NULL) we complete the setup. */ static void -parse_flowsets(struct cfg_s *c, const char *fs, int pass) +parse_flowsets(struct cfg_s *c, const char *fs) { char *s, *cur, *next; int n_flows = 0, n_fs = 0, wsum = 0; int i, j; struct dn_fs *prev = NULL; + int pass = (fs == NULL); DX(3, "--- pass %d flows %d flowsets %d", pass, c->flows, c->flowsets); - if (pass == 0) + if (fs != NULL) { /* first pass */ + if (c->fs_config) + D("warning, overwriting fs %s with %s", + c->fs_config, fs); c->fs_config = fs; + } s = c->fs_config ? strdup(c->fs_config) : NULL; if (s == NULL) { if (pass == 0) @@ -327,7 +361,7 @@ parse_flowsets(struct cfg_s *c, const ch w, w_h, w_steps, len, len_h, l_steps, flows); if (w == 0 || w_h < w || len == 0 || len_h < len || flows == 0) { - DX(4,"wrong parameters %s", fs); + DX(4,"wrong parameters %s", s); return; } n_flows += flows * w_steps * l_steps; @@ -361,7 +395,6 @@ parse_flowsets(struct cfg_s *c, const ch } } } - c->max_y = prev ? prev->base_y + prev->y : 0; c->flows = n_flows; c->flowsets = n_fs; c->wsum = wsum; @@ -369,7 +402,11 @@ parse_flowsets(struct cfg_s *c, const ch return; /* now link all flows to their parent flowsets */ + DX(1,"%d flows on %d flowsets", c->flows, c->flowsets); +#ifdef USE_CUR + c->max_y = prev ? prev->base_y + prev->y : 0; DX(1,"%d flows on %d flowsets max_y %d", c->flows, c->flowsets, c->max_y); +#endif /* USE_CUR */ for (i=0; i < c->flowsets; i++) { struct dn_fs *fs = &c->fs[i].fs; DX(1, "fs %3d w %5d l %4d flow %5d .. %5d y %6d .. %6d", @@ -383,6 +420,18 @@ parse_flowsets(struct cfg_s *c, const ch } } +/* available schedulers */ +extern moduledata_t *_g_dn_fifo; +extern moduledata_t *_g_dn_wf2qp; +extern moduledata_t *_g_dn_rr; +extern moduledata_t *_g_dn_qfq; +#ifdef WITH_QFQP +extern moduledata_t *_g_dn_qfqp; +#endif +#ifdef WITH_KPS +extern moduledata_t *_g_dn_kps; +#endif + static int init(struct cfg_s *c) { @@ -395,7 +444,7 @@ init(struct cfg_s *c) moduledata_t *mod = NULL; struct dn_alg *p = NULL; - c->th_min = 0; + c->th_min = -1; /* 1 packet per flow */ c->th_max = -20;/* 20 packets per flow */ c->lmin = c->lmax = 1280; /* packet len */ c->flows = 1; @@ -408,16 +457,6 @@ init(struct cfg_s *c) } else if (!strcmp(*av, "-d")) { debug = atoi(av[1]); } else if (!strcmp(*av, "-alg")) { - extern moduledata_t *_g_dn_fifo; - extern moduledata_t *_g_dn_wf2qp; - extern moduledata_t *_g_dn_rr; - extern moduledata_t *_g_dn_qfq; -#ifdef WITH_QFQP - extern moduledata_t *_g_dn_qfqp; -#endif -#ifdef WITH_KPS - extern moduledata_t *_g_dn_kps; -#endif if (!strcmp(av[1], "rr")) mod = _g_dn_rr; else if (!strcmp(av[1], "wf2qp")) @@ -443,9 +482,11 @@ init(struct cfg_s *c) c->lmin = getnum(av[1], NULL, av[0]); c->lmax = c->lmin; DX(3, "setting max to %d", c->th_max); +#ifdef USE_BURST } else if (!strcmp(*av, "-burst")) { c->maxburst = getnum(av[1], NULL, av[0]); DX(3, "setting max to %d", c->th_max); +#endif /* USE_BURST */ } else if (!strcmp(*av, "-qmax")) { c->th_max = getnum(av[1], NULL, av[0]); DX(3, "setting max to %d", c->th_max); @@ -456,15 +497,17 @@ init(struct cfg_s *c) c->flows = getnum(av[1], NULL, av[0]); DX(3, "setting flows to %d", c->flows); } else if (!strcmp(*av, "-flowsets")) { - parse_flowsets(c, av[1], 0); + parse_flowsets(c, av[1]); /* first pass */ DX(3, "setting flowsets to %d", c->flowsets); } else { D("option %s not recognised, ignore", *av); } ac -= 2; av += 2; } +#ifdef USE_BURST if (c->maxburst <= 0) c->maxburst = 1; +#endif /* USE_BURST */ if (c->loops <= 0) c->loops = 1; if (c->flows <= 0) @@ -482,45 +525,61 @@ init(struct cfg_s *c) c->th_max = c->flows * -c->th_max; if (c->th_max <= c->th_min) c->th_max = c->th_min + 1; + + /* now load parameters from the module */ if (mod) { p = mod->p; DX(3, "using module %s f %p p %p", mod->name, mod->f, mod->p); DX(3, "modname %s ty %d", p->name, p->type); + // XXX check enq and deq not null c->enq = p->enqueue; c->deq = p->dequeue; c->si_len += p->si_datalen; c->q_len += p->q_datalen; c->schk_len += p->schk_datalen; + } else { + /* make sure c->si has room for a queue */ + c->enq = default_enqueue; + c->deq = default_dequeue; } + /* allocate queues, flowsets and one scheduler */ - c->q = calloc(c->flows, c->q_len); - c->q_wfi = (double *)calloc(c->flows, sizeof(double)); + D("using %d flows, %d flowsets", c->flows, c->flowsets); + D("q_len %d dn_fsk %d si %d sched %d", + c->q_len, (int)sizeof(struct dn_fsk), + c->si_len, c->schk_len); + c->sched = calloc(1, c->schk_len); /* one parent scheduler */ + c->si = calloc(1, c->si_len); /* one scheduler instance */ c->fs = calloc(c->flowsets, sizeof(struct dn_fsk)); - c->si = calloc(1, c->si_len); - c->sched = calloc(c->flows, c->schk_len); - if (c->q == NULL || c->fs == NULL || !c->q_wfi) { - D("error allocating memory for flows"); + c->q = calloc(c->flows, c->q_len); /* one queue per flow */ + c->q_wfi = calloc(c->flows, sizeof(double)); /* stats, one per flow */ + if (!c->sched || !c->si || !c->fs || !c->q || !c->q_wfi) { + D("error allocating memory"); exit(1); } - c->si->sched = c->sched; + c->si->sched = c->sched; /* link scheduler instance to template */ if (p) { + /* run initialization code if needed */ if (p->config) - p->config(c->sched); + p->config(c->si->sched); if (p->new_sched) p->new_sched(c->si); } /* parse_flowsets links queues to their flowsets */ - parse_flowsets(c, av[1], 1); + parse_flowsets(c, NULL); /* second pass */ /* complete the work calling new_fsk */ for (i = 0; i < c->flowsets; i++) { - if (c->fs[i].fs.par[1] == 0) - c->fs[i].fs.par[1] = 1000; /* default pkt len */ - c->fs[i].sched = c->sched; + struct dn_fsk *fsk = &c->fs[i]; + if (fsk->fs.par[1] == 0) + fsk->fs.par[1] = 1000; /* default pkt len */ + fsk->sched = c->si->sched; if (p && p->new_fsk) - p->new_fsk(&c->fs[i]); + p->new_fsk(fsk); } + /* --- now the scheduler is initialized --- */ - /* initialize the lists for the generator, and put + /* + * initialize the lists for the generator, and put * all flows in the list for backlog = 0 */ for (i=0; i <= BACKLOG+5; i++) @@ -536,7 +595,7 @@ init(struct cfg_s *c) INIT_LIST_HEAD(&q->ni.h); list_add_tail(&q->ni.h, &c->ll[0]); } - c->llmask = 1; + c->llmask = 1; /* all flows are in the first list */ return 0; } @@ -545,7 +604,6 @@ int main(int ac, char *av[]) { struct cfg_s c; - struct timeval end; double ll; int i; char msg[40]; @@ -555,16 +613,15 @@ main(int ac, char *av[]) c.av = av; init(&c); gettimeofday(&c.time, NULL); + D("th_min %d th_max %d", c.th_min, c.th_max); + mainloop(&c); - gettimeofday(&end, NULL); - end.tv_sec -= c.time.tv_sec; - end.tv_usec -= c.time.tv_usec; - if (end.tv_usec < 0) { - end.tv_usec += 1000000; - end.tv_sec--; + { + struct timeval end; + gettimeofday(&end, NULL); + timersub(&end, &c.time, &c.time); } - c.time = end; - ll = end.tv_sec*1000000 + end.tv_usec; + ll = c.time.tv_sec*1000000 + c.time.tv_usec; ll *= 1000; /* convert to nanoseconds */ ll /= c._enqueue; sprintf(msg, "1::%d", c.flows); @@ -572,8 +629,10 @@ main(int ac, char *av[]) if (c.wfi < c.q_wfi[i]) c.wfi = c.q_wfi[i]; } - D("sched=%-12s\ttime=%d.%03d sec (%.0f nsec)\twfi=%.02f\tflow=%-16s", - c.name, (int)c.time.tv_sec, (int)c.time.tv_usec / 1000, ll, c.wfi, + D("sched=%-12s\ttime=%d.%03d sec (%.0f nsec) enq %lu %lu deq\n" + "\twfi=%.02f\tflow=%-16s", + c.name, (int)c.time.tv_sec, (int)c.time.tv_usec / 1000, ll, + (unsigned long)c._enqueue, (unsigned long)c.dequeue, c.wfi, c.fs_config ? c.fs_config : msg); dump(&c); DX(1, "done ac %d av %p", ac, av); @@ -593,7 +652,7 @@ controller(struct cfg_s *c) struct dn_fs *fs; int flow_id; - /* histeresis between max and min */ + /* hysteresis between max and min */ if (c->state == 0 && c->pending >= (uint32_t)c->th_max) c->state = 1; else if (c->state == 1 && c->pending <= (uint32_t)c->th_min) @@ -601,9 +660,14 @@ controller(struct cfg_s *c) ND(1, "state %d pending %2d", c->state, c->pending); c->can_dequeue = c->state; c->tosend = NULL; - if (c->state) + if (c->can_dequeue) return; + /* + * locate the flow to use for enqueueing + * We take the queue with the lowest number of queued packets, + * generate a packet for it, and put the queue in the next highest. + */ if (1) { int i; struct dn_queue *q; @@ -611,7 +675,7 @@ controller(struct cfg_s *c) i = ffs(c->llmask) - 1; if (i < 0) { - DX(2, "no candidate"); + D("no candidate"); c->can_dequeue = 1; return; } @@ -633,8 +697,9 @@ controller(struct cfg_s *c) c->llmask |= 1<<(1+i); } fs = &q->fs->fs; - c->cur_fs = q->fs - c->fs; fs->cur = flow_id; +#ifdef USE_CUR + c->cur_fs = q->fs - c->fs; } else { /* XXX this does not work ? */ /* now decide whom to send the packet, and the length */ @@ -650,6 +715,7 @@ controller(struct cfg_s *c) c->cur_y++; if (c->cur_y >= fs->next_y) c->cur_fs++; +#endif /* USE_CUR */ } /* construct a packet */ @@ -662,7 +728,7 @@ controller(struct cfg_s *c) if (m == NULL) return; - m->cfg = c; + //m->cfg = c; m->m_nextpkt = NULL; m->m_pkthdr.len = fs->par[1]; // XXX maxlen m->flow_id = flow_id; @@ -672,15 +738,3 @@ controller(struct cfg_s *c) fs->par[0], m->m_pkthdr.len); } - -/* -Packet allocation: -to achieve a distribution that matches weights, for each X=w/lmax class -we should generate a number of packets proportional to Y = X times the number -of flows in the class. -So we construct an array with the cumulative distribution of Y's, -and use it to identify the flow via inverse mapping (if the Y's are -not too many we can use an array for the lookup). In practice, -each flow will have X entries [virtually] pointing to it. - -*/ Modified: head/sys/netpfil/ipfw/test/mylist.h ============================================================================== --- head/sys/netpfil/ipfw/test/mylist.h Wed Jan 27 02:14:08 2016 (r294881) +++ head/sys/netpfil/ipfw/test/mylist.h Wed Jan 27 02:22:31 2016 (r294882) @@ -6,6 +6,7 @@ #ifndef _MYLIST_H #define _MYLIST_H +/* not just a head, also the link field for a list entry */ struct list_head { struct list_head *prev, *next; }; Modified: head/sys/netpfil/ipfw/test/test_dn_sched.c ============================================================================== --- head/sys/netpfil/ipfw/test/test_dn_sched.c Wed Jan 27 02:14:08 2016 (r294881) +++ head/sys/netpfil/ipfw/test/test_dn_sched.c Wed Jan 27 02:22:31 2016 (r294882) @@ -61,6 +61,7 @@ dn_enqueue(struct dn_queue *q, struct mb mq_append(&q->mq, m); q->ni.length++; q->ni.tot_bytes += m->m_pkthdr.len; + q->ni.tot_pkts++; return 0; drop: From owner-svn-src-head@freebsd.org Wed Jan 27 02:24:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC468A6EAA7; Wed, 27 Jan 2016 02:24:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69615119A; Wed, 27 Jan 2016 02:24:00 +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 u0R2Nxaq062128; Wed, 27 Jan 2016 02:23:59 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R2NsQj062076; Wed, 27 Jan 2016 02:23:54 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601270223.u0R2NsQj062076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 27 Jan 2016 02:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294883 - in head: lib/libdevinfo share/man/man9 sys/arm/arm sys/arm/at91 sys/arm/cavium/cns11xx sys/arm/mv sys/arm/versatile sys/arm/xscale/i8134x sys/arm/xscale/ixp425 sys/arm/xscale/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 02:24:01 -0000 Author: jhibbits Date: Wed Jan 27 02:23:54 2016 New Revision: 294883 URL: https://svnweb.freebsd.org/changeset/base/294883 Log: Convert rman to use rman_res_t instead of u_long Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075 Modified: head/lib/libdevinfo/devinfo.3 head/lib/libdevinfo/devinfo.h head/share/man/man9/bus_adjust_resource.9 head/share/man/man9/bus_alloc_resource.9 head/share/man/man9/bus_get_resource.9 head/share/man/man9/bus_set_resource.9 head/share/man/man9/rman.9 head/sys/arm/arm/nexus.c head/sys/arm/at91/at91.c head/sys/arm/cavium/cns11xx/econa.c head/sys/arm/mv/mv_localbus.c head/sys/arm/mv/mv_pci.c head/sys/arm/versatile/versatile_pci.c head/sys/arm/xscale/i8134x/i81342.c head/sys/arm/xscale/i8134x/i81342_pci.c head/sys/arm/xscale/i8134x/obio.c head/sys/arm/xscale/ixp425/avila_ata.c head/sys/arm/xscale/ixp425/ixp425.c head/sys/arm/xscale/ixp425/ixp425_pci.c head/sys/arm/xscale/pxa/pxa_obio.c head/sys/arm/xscale/pxa/pxa_smi.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/nexus.c head/sys/arm64/cavium/thunder_pcie.c head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpi_timer.c head/sys/dev/acpica/acpivar.h head/sys/dev/advansys/adv_isa.c head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/ata/ata-cbus.c head/sys/dev/ata/ata-isa.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/atkbdc/atkbdc_ebus.c head/sys/dev/atkbdc/atkbdc_isa.c head/sys/dev/atkbdc/atkbdc_subr.c head/sys/dev/cs/if_cs.c head/sys/dev/ctau/if_ct.c head/sys/dev/cx/if_cx.c head/sys/dev/ed/if_ed_3c503.c head/sys/dev/ed/if_ed_cbus.c head/sys/dev/ed/if_ed_hpp.c head/sys/dev/ed/if_ed_wd80x3.c head/sys/dev/eisa/eisaconf.c head/sys/dev/fdt/simplebus.c head/sys/dev/fe/if_fe_cbus.c head/sys/dev/fe/if_fe_isa.c head/sys/dev/gpio/gpiobus.c head/sys/dev/mca/mca_bus.c head/sys/dev/mvs/mvs_pci.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/ncv/ncr53c500_pccard.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/ofw/ofwbus.c head/sys/dev/pccard/pccard.c head/sys/dev/pccard/pccardvarp.h head/sys/dev/pccbb/pccbb.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/pccbb/pccbbvar.h head/sys/dev/pcf/pcf_isa.c head/sys/dev/pci/hostb_pci.c head/sys/dev/pci/isa_pci.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_iov.c head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pci_private.h head/sys/dev/pci/pci_subr.c head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcivar.h head/sys/dev/pci/vga_pci.c head/sys/dev/ppc/ppc.c head/sys/dev/ppc/ppcvar.h head/sys/dev/puc/puc.c head/sys/dev/puc/puc_bfe.h head/sys/dev/quicc/quicc_bfe.h head/sys/dev/quicc/quicc_core.c head/sys/dev/scc/scc_bfe.h head/sys/dev/scc/scc_core.c head/sys/dev/siba/siba.c head/sys/dev/siba/siba_bwn.c head/sys/dev/siba/siba_pcib.c head/sys/dev/siis/siis.c head/sys/dev/snc/if_snc_cbus.c head/sys/dev/sound/isa/gusc.c head/sys/dev/sound/isa/sbc.c head/sys/dev/sound/pci/csa.c head/sys/dev/sound/pci/fm801.c head/sys/dev/sound/pci/vibes.c head/sys/dev/stg/tmc18c30_subr.c head/sys/dev/wl/if_wl.c head/sys/isa/isa_common.c head/sys/isa/isa_common.h head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/kern/subr_rman.c head/sys/mips/adm5120/admpci.c head/sys/mips/adm5120/obio.c head/sys/mips/alchemy/obio.c head/sys/mips/atheros/apb.c head/sys/mips/atheros/ar71xx_pci.c head/sys/mips/atheros/ar724x_pci.c head/sys/mips/atheros/qca955x_pci.c head/sys/mips/beri/beri_simplebus.c head/sys/mips/cavium/ciu.c head/sys/mips/cavium/obio.c head/sys/mips/cavium/octopci.c head/sys/mips/idt/idtpci.c head/sys/mips/idt/obio.c head/sys/mips/malta/gt.c head/sys/mips/malta/gt_pci.c head/sys/mips/malta/obio.c head/sys/mips/mips/cpu.c head/sys/mips/mips/nexus.c head/sys/mips/nlm/xlp_simplebus.c head/sys/mips/rmi/iodi.c head/sys/mips/rmi/xlr_pci.c head/sys/mips/rt305x/obio.c head/sys/mips/rt305x/rt305x_gpio.c head/sys/mips/rt305x/rt305x_pci.c head/sys/mips/sentry5/obio.c head/sys/mips/sibyte/sb_zbbus.c head/sys/mips/sibyte/sb_zbpci.c head/sys/pc98/pc98/canbus.c head/sys/powerpc/mpc85xx/lbc.c head/sys/powerpc/ofw/ofw_pci.c head/sys/powerpc/powermac/macgpio.c head/sys/powerpc/powermac/macio.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/psim/ata_iobus.c head/sys/powerpc/psim/iobus.c head/sys/sparc64/central/central.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/fhc/fhc.c head/sys/sparc64/isa/isa.c head/sys/sparc64/pci/apb.c head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/ofw_pci.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/sbbc.c head/sys/sparc64/pci/schizo.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/upa.c head/sys/sys/_types.h head/sys/sys/bus.h head/sys/sys/rman.h head/sys/sys/types.h head/sys/x86/include/legacyvar.h head/sys/x86/include/pci_cfgreg.h head/sys/x86/isa/atrtc.c head/sys/x86/isa/clock.c head/sys/x86/isa/isa.c head/sys/x86/pci/pci_bus.c head/sys/x86/pci/qpi.c head/sys/x86/x86/mptable_pci.c head/sys/x86/x86/nexus.c Modified: head/lib/libdevinfo/devinfo.3 ============================================================================== --- head/lib/libdevinfo/devinfo.3 Wed Jan 27 02:22:31 2016 (r294882) +++ head/lib/libdevinfo/devinfo.3 Wed Jan 27 02:23:54 2016 (r294883) @@ -110,8 +110,8 @@ struct devinfo_dev { struct devinfo_rman { devinfo_handle_t dm_handle; /* resource manager handle */ - u_long dm_start; /* resource start */ - u_long dm_size; /* resource size */ + rman_res_t dm_start; /* resource start */ + rman_res_t dm_size; /* resource size */ char *dm_desc; /* resource description */ }; @@ -119,8 +119,8 @@ struct devinfo_res { devinfo_handle_t dr_handle; /* resource handle */ devinfo_handle_t dr_rman; /* resource manager handle */ devinfo_handle_t dr_device; /* owning device */ - u_long dr_start; /* region start */ - u_long dr_size; /* region size */ + rman_res_t dr_start; /* region start */ + rman_res_t dr_size; /* region size */ }; .Ed .Pp Modified: head/lib/libdevinfo/devinfo.h ============================================================================== --- head/lib/libdevinfo/devinfo.h Wed Jan 27 02:22:31 2016 (r294882) +++ head/lib/libdevinfo/devinfo.h Wed Jan 27 02:23:54 2016 (r294883) @@ -56,8 +56,8 @@ struct devinfo_dev { struct devinfo_rman { devinfo_handle_t dm_handle; /* resource manager handle */ - unsigned long dm_start; /* resource start */ - unsigned long dm_size; /* resource size */ + rman_res_t dm_start; /* resource start */ + rman_res_t dm_size; /* resource size */ char *dm_desc; /* resource description */ }; @@ -67,8 +67,8 @@ struct devinfo_res { devinfo_handle_t dr_rman; /* resource manager handle */ devinfo_handle_t dr_device; /* owning device */ - unsigned long dr_start; /* region start */ - unsigned long dr_size; /* region size */ + rman_res_t dr_start; /* region start */ + rman_res_t dr_size; /* region size */ /* XXX add flags */ }; Modified: head/share/man/man9/bus_adjust_resource.9 ============================================================================== --- head/share/man/man9/bus_adjust_resource.9 Wed Jan 27 02:22:31 2016 (r294882) +++ head/share/man/man9/bus_adjust_resource.9 Wed Jan 27 02:23:54 2016 (r294883) @@ -41,7 +41,8 @@ .In sys/rman.h .In machine/resource.h .Ft int -.Fn bus_adjust_resource "device_t dev" "int type" "struct resource *r" "u_long start" "u_long end" +.Fo bus_adjust_resource +.Fa "device_t dev" "int type" "struct resource *r" "rman_res_t start" "rman_res_t end" .Sh DESCRIPTION This function is used to ask the parent bus to adjust the resource range assigned to an allocated resource. Modified: head/share/man/man9/bus_alloc_resource.9 ============================================================================== --- head/share/man/man9/bus_alloc_resource.9 Wed Jan 27 02:22:31 2016 (r294882) +++ head/share/man/man9/bus_alloc_resource.9 Wed Jan 27 02:23:54 2016 (r294883) @@ -43,7 +43,10 @@ .In sys/rman.h .In machine/resource.h .Ft struct resource * -.Fn bus_alloc_resource "device_t dev" "int type" "int *rid" "u_long start" "u_long end" "u_long count" "u_int flags" +.Fo bus_alloc_resource +.Fa "device_t dev" "int type" "int *rid" "rman_res_t start" "rman_res_t end" +.Fa "rman_res_t count" "u_int flags" +.Fc .Ft struct resource * .Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags" .Sh DESCRIPTION Modified: head/share/man/man9/bus_get_resource.9 ============================================================================== --- head/share/man/man9/bus_get_resource.9 Wed Jan 27 02:22:31 2016 (r294882) +++ head/share/man/man9/bus_get_resource.9 Wed Jan 27 02:23:54 2016 (r294883) @@ -44,7 +44,7 @@ .In sys/rman.h .Ft int .Fo bus_get_resource -.Fa "device_t dev" "int type" "int rid" "u_long *startp" "u_long *countp" +.Fa "device_t dev" "int type" "int rid" "rman_res_t *startp" "rman_res_t *countp" .Fc .Sh DESCRIPTION The Modified: head/share/man/man9/bus_set_resource.9 ============================================================================== --- head/share/man/man9/bus_set_resource.9 Wed Jan 27 02:22:31 2016 (r294882) +++ head/share/man/man9/bus_set_resource.9 Wed Jan 27 02:23:54 2016 (r294883) @@ -43,7 +43,7 @@ .In machine/resource.h .Ft int .Fo bus_set_resource -.Fa "device_t dev" "int type" "int rid" "u_long start" "u_long count" +.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t count" .Fc .Sh DESCRIPTION The Modified: head/share/man/man9/rman.9 ============================================================================== --- head/share/man/man9/rman.9 Wed Jan 27 02:22:31 2016 (r294882) +++ head/share/man/man9/rman.9 Wed Jan 27 02:23:54 2016 (r294883) @@ -65,7 +65,7 @@ .Ft int .Fn rman_activate_resource "struct resource *r" .Ft int -.Fn rman_adjust_resource "struct resource *r" "u_long start" "u_long end" +.Fn rman_adjust_resource "struct resource *r" "rman_res_t start" "rman_res_t end" .Ft int .Fn rman_await_resource "struct resource *r" "int pri2" "int timo" .Ft int @@ -79,32 +79,32 @@ .Ft int .Fn rman_is_region_manager "struct resource *r" "struct rman *rm" .Ft int -.Fn rman_manage_region "struct rman *rm" "u_long start" "u_long end" +.Fn rman_manage_region "struct rman *rm" "rman_res_t start" "rman_res_t end" .Ft int -.Fn rman_first_free_region "struct rman *rm" "u_long *start" "u_long *end" +.Fn rman_first_free_region "struct rman *rm" "rman_res_t *start" "rman_res_t *end" .Ft int -.Fn rman_last_free_region "struct rman *rm" "u_long *start" "u_long *end" +.Fn rman_last_free_region "struct rman *rm" "rman_res_t *start" "rman_res_t *end" .Ft int .Fn rman_release_resource "struct resource *r" .Ft "struct resource *" .Fo rman_reserve_resource -.Fa "struct rman *rm" "u_long start" "u_long end" "u_long count" +.Fa "struct rman *rm" "rman_res_t start" "rman_res_t end" "rman_res_t count" .Fa "u_int flags" "struct device *dev" .Fc .Ft "struct resource *" .Fo rman_reserve_resource_bound -.Fa "struct rman *rm" "u_long start" "u_long end" "u_long count" -.Fa "u_long bound" "u_int flags" "struct device *dev" +.Fa "struct rman *rm" "rman_res_t start" "rman_res_t end" "rman_res_t count" +.Fa "rman_res_t bound" "u_int flags" "struct device *dev" .Fc .Ft uint32_t .Fn rman_make_alignment_flags "uint32_t size" -.Ft u_long +.Ft rman_res_t .Fn rman_get_start "struct resource *r" -.Ft u_long +.Ft rman_res_t .Fn rman_get_end "struct resource *r" .Ft "struct device *" .Fn rman_get_device "struct resource *r" -.Ft u_long +.Ft rman_res_t .Fn rman_get_size "struct resource *r" .Ft u_int .Fn rman_get_flags "struct resource *r" Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/arm/nexus.c Wed Jan 27 02:23:54 2016 (r294883) @@ -82,7 +82,7 @@ static int nexus_attach(device_t); static int nexus_print_child(device_t, device_t); static device_t nexus_add_child(device_t, u_int, const char *, int); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); + rman_res_t, rman_res_t, rman_res_t, u_int); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); #ifdef ARM_INTRNG @@ -212,7 +212,7 @@ nexus_add_child(device_t bus, u_int orde */ static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct resource *rv; struct rman *rm; Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/at91/at91.c Wed Jan 27 02:23:54 2016 (r294883) @@ -147,7 +147,7 @@ at91_attach(device_t dev) static struct resource * at91_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct at91_softc *sc = device_get_softc(dev); struct resource_list_entry *rle; @@ -255,7 +255,7 @@ at91_activate_resource(device_t bus, dev struct resource *r) { #if 0 - u_long p; + rman_res_t p; int error; if (type == SYS_RES_MEMORY) { Modified: head/sys/arm/cavium/cns11xx/econa.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/cavium/cns11xx/econa.c Wed Jan 27 02:23:54 2016 (r294883) @@ -408,7 +408,7 @@ econa_attach(device_t dev) static struct resource * econa_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct econa_softc *sc = device_get_softc(dev); struct resource_list_entry *rle; Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/mv/mv_localbus.c Wed Jan 27 02:23:54 2016 (r294883) @@ -100,7 +100,7 @@ static int localbus_attach(device_t); static int localbus_print_child(device_t, device_t); static struct resource *localbus_alloc_resource(device_t, device_t, int, - int *, u_long, u_long, u_long, u_int); + int *, rman_res_t, rman_res_t, rman_res_t, u_int); static struct resource_list *localbus_get_resource_list(device_t, device_t); static ofw_bus_get_devinfo_t localbus_get_devinfo; @@ -332,7 +332,7 @@ localbus_print_child(device_t dev, devic static struct resource * localbus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct localbus_devinfo *di; struct resource_list_entry *rle; Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/mv/mv_pci.c Wed Jan 27 02:23:54 2016 (r294883) @@ -332,7 +332,7 @@ static int mv_pcib_probe(device_t); static int mv_pcib_attach(device_t); static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); + rman_res_t, rman_res_t, rman_res_t, u_int); static int mv_pcib_release_resource(device_t, device_t, int, int, struct resource *); static int mv_pcib_read_ivar(device_t, device_t, int, uintptr_t *); @@ -830,7 +830,7 @@ mv_pcib_init_all_bars(struct mv_pcib_sof static struct resource * mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct mv_pcib_softc *sc = device_get_softc(dev); struct rman *rm = NULL; Modified: head/sys/arm/versatile/versatile_pci.c ============================================================================== --- head/sys/arm/versatile/versatile_pci.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/versatile/versatile_pci.c Wed Jan 27 02:23:54 2016 (r294883) @@ -305,7 +305,7 @@ versatile_pci_write_ivar(device_t dev, d static struct resource * versatile_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct versatile_pci_softc *sc = device_get_softc(bus); Modified: head/sys/arm/xscale/i8134x/i81342.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/xscale/i8134x/i81342.c Wed Jan 27 02:23:54 2016 (r294883) @@ -409,7 +409,7 @@ i81342_attach(device_t dev) static struct resource * i81342_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct i81342_softc *sc = device_get_softc(dev); struct resource *rv; Modified: head/sys/arm/xscale/i8134x/i81342_pci.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_pci.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/xscale/i8134x/i81342_pci.c Wed Jan 27 02:23:54 2016 (r294883) @@ -328,7 +328,7 @@ i81342_pci_write_config(device_t dev, u_ static struct resource * i81342_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct i81342_pci_softc *sc = device_get_softc(bus); struct resource *rv; @@ -383,7 +383,7 @@ static int i81342_pci_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - u_long p; + bus_space_handle_t p; int error; if (type == SYS_RES_MEMORY) { Modified: head/sys/arm/xscale/i8134x/obio.c ============================================================================== --- head/sys/arm/xscale/i8134x/obio.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/xscale/i8134x/obio.c Wed Jan 27 02:23:54 2016 (r294883) @@ -91,7 +91,7 @@ obio_attach(device_t dev) static struct resource * obio_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct resource *rv; struct rman *rm; Modified: head/sys/arm/xscale/ixp425/avila_ata.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_ata.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/xscale/ixp425/avila_ata.c Wed Jan 27 02:23:54 2016 (r294883) @@ -282,7 +282,7 @@ ata_avila_intr(void *xsc) static struct resource * ata_avila_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct ata_avila_softc *sc = device_get_softc(dev); Modified: head/sys/arm/xscale/ixp425/ixp425.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/xscale/ixp425/ixp425.c Wed Jan 27 02:23:54 2016 (r294883) @@ -496,7 +496,7 @@ getvbase(uint32_t hwbase, uint32_t size, static struct resource * ixp425_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct ixp425_softc *sc = device_get_softc(dev); const struct hwvtrans *vtrans; Modified: head/sys/arm/xscale/ixp425/ixp425_pci.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_pci.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/xscale/ixp425/ixp425_pci.c Wed Jan 27 02:23:54 2016 (r294883) @@ -269,7 +269,7 @@ ixppcib_teardown_intr(device_t dev, devi static struct resource * ixppcib_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct ixppcib_softc *sc = device_get_softc(bus); struct rman *rmanp; Modified: head/sys/arm/xscale/pxa/pxa_obio.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_obio.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/xscale/pxa/pxa_obio.c Wed Jan 27 02:23:54 2016 (r294883) @@ -50,14 +50,14 @@ static int pxa_read_ivar(device_t, devic static struct resource_list * pxa_get_resource_list(device_t, device_t); static struct resource * pxa_alloc_resource(device_t, device_t, int, - int *, u_long, u_long, u_long, u_int); + int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int pxa_release_resource(device_t, device_t, int, int, struct resource *); static int pxa_activate_resource(device_t, device_t, int, int, struct resource *); static struct resource * pxa_alloc_gpio_irq(device_t, device_t, int, - int *, u_long, u_long, u_long, u_int); + int *, rman_res_t, rman_res_t, rman_res_t, u_int); struct obio_device { const char *od_name; @@ -224,7 +224,7 @@ pxa_get_resource_list(device_t dev, devi static struct resource * pxa_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct obio_softc *sc; struct obio_device *od; @@ -351,7 +351,7 @@ DRIVER_MODULE(pxa, nexus, pxa_driver, px static struct resource * pxa_alloc_gpio_irq(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct obio_softc *sc; struct obio_device *od; Modified: head/sys/arm/xscale/pxa/pxa_smi.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_smi.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm/xscale/pxa/pxa_smi.c Wed Jan 27 02:23:54 2016 (r294883) @@ -70,7 +70,7 @@ static int pxa_smi_print_child(device_t, static int pxa_smi_read_ivar(device_t, device_t, int, uintptr_t *); static struct resource * pxa_smi_alloc_resource(device_t, device_t, - int, int *, u_long, u_long, u_long, u_int); + int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int pxa_smi_release_resource(device_t, device_t, int, int, struct resource *); static int pxa_smi_activate_resource(device_t, device_t, @@ -176,7 +176,7 @@ pxa_smi_read_ivar(device_t dev, device_t static struct resource * pxa_smi_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct pxa_smi_softc *sc; struct smi_ivars *smid; Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm64/arm64/gic_v3_fdt.c Wed Jan 27 02:23:54 2016 (r294883) @@ -54,7 +54,7 @@ static int gic_v3_fdt_probe(device_t); static int gic_v3_fdt_attach(device_t); static struct resource *gic_v3_ofw_bus_alloc_res(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); + rman_res_t, rman_res_t, rman_res_t, u_int); static const struct ofw_bus_devinfo *gic_v3_ofw_get_devinfo(device_t, device_t); static device_method_t gic_v3_fdt_methods[] = { @@ -174,7 +174,7 @@ gic_v3_ofw_get_devinfo(device_t bus __un static struct resource * gic_v3_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct gic_v3_ofw_devinfo *di; struct resource_list_entry *rle; Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm64/arm64/nexus.c Wed Jan 27 02:23:54 2016 (r294883) @@ -99,13 +99,14 @@ static device_attach_t nexus_acpi_attach static int nexus_print_child(device_t, device_t); static device_t nexus_add_child(device_t, u_int, const char *, int); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); + rman_res_t, rman_res_t, rman_res_t, u_int); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol); static struct resource_list *nexus_get_reslist(device_t, device_t); -static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); +static int nexus_set_resource(device_t, device_t, int, int, + rman_res_t, rman_res_t); static int nexus_deactivate_resource(device_t, device_t, int, int, struct resource *); @@ -201,7 +202,7 @@ nexus_add_child(device_t bus, u_int orde */ static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct nexus_device *ndev = DEVTONX(child); struct resource *rv; @@ -332,7 +333,7 @@ nexus_get_reslist(device_t dev, device_t static int nexus_set_resource(device_t dev, device_t child, int type, int rid, - u_long start, u_long count) + rman_res_t start, rman_res_t count) { struct nexus_device *ndev = DEVTONX(child); struct resource_list *rl = &ndev->nx_resources; Modified: head/sys/arm64/cavium/thunder_pcie.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm64/cavium/thunder_pcie.c Wed Jan 27 02:23:54 2016 (r294883) @@ -110,7 +110,7 @@ SYSCTL_INT(_hw, OID_AUTO, thunder_pcie_m /* Forward prototypes */ static struct resource *thunder_pcie_alloc_resource(device_t, - device_t, int, int *, u_long, u_long, u_long, u_int); + device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int thunder_pcie_attach(device_t); static int thunder_pcie_identify_pcib(device_t); static int thunder_pcie_maxslots(device_t); @@ -431,7 +431,7 @@ thunder_pcie_release_resource(device_t d static struct resource * thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct thunder_pcie_softc *sc = device_get_softc(dev); struct rman *rm = NULL; @@ -519,7 +519,7 @@ static int thunder_pcie_identify_pcib(device_t dev) { struct thunder_pcie_softc *sc; - u_long start; + rman_res_t start; sc = device_get_softc(dev); start = bus_get_resource_start(dev, SYS_RES_MEMORY, 0); Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Wed Jan 27 02:23:54 2016 (r294883) @@ -126,7 +126,7 @@ struct thunder_pem_softc { }; static struct resource * thunder_pem_alloc_resource(device_t, device_t, int, - int *, u_long, u_long, u_long, u_int); + int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int thunder_pem_attach(device_t); static int thunder_pem_detach(device_t); static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int); @@ -230,7 +230,7 @@ static int thunder_pem_identify(device_t dev) { struct thunder_pem_softc *sc; - u_long start; + rman_res_t start; sc = device_get_softc(dev); start = rman_get_start(sc->reg); @@ -426,7 +426,7 @@ thunder_pem_write_config(device_t dev, u static struct resource * thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct thunder_pem_softc *sc = device_get_softc(dev); struct rman *rm = NULL; Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/acpica/acpi.c Wed Jan 27 02:23:54 2016 (r294883) @@ -121,12 +121,12 @@ static struct resource_list *acpi_get_rl static void acpi_reserve_resources(device_t dev); static int acpi_sysres_alloc(device_t dev); static int acpi_set_resource(device_t dev, device_t child, int type, - int rid, u_long start, u_long count); + int rid, rman_res_t start, rman_res_t count); static struct resource *acpi_alloc_resource(device_t bus, device_t child, - int type, int *rid, u_long start, u_long end, - u_long count, u_int flags); + int type, int *rid, rman_res_t start, rman_res_t end, + rman_res_t count, u_int flags); static int acpi_adjust_resource(device_t bus, device_t child, int type, - struct resource *r, u_long start, u_long end); + struct resource *r, rman_res_t start, rman_res_t end); static int acpi_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r); static void acpi_delete_resource(device_t bus, device_t child, int type, @@ -1247,13 +1247,13 @@ acpi_reserve_resources(device_t dev) static int acpi_set_resource(device_t dev, device_t child, int type, int rid, - u_long start, u_long count) + rman_res_t start, rman_res_t count) { struct acpi_softc *sc = device_get_softc(dev); struct acpi_device *ad = device_get_ivars(child); struct resource_list *rl = &ad->ad_rl; ACPI_DEVICE_INFO *devinfo; - u_long end; + rman_res_t end; /* Ignore IRQ resources for PCI link devices. */ if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids) != NULL) @@ -1323,7 +1323,7 @@ acpi_set_resource(device_t dev, device_t static struct resource * acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { ACPI_RESOURCE ares; struct acpi_device *ad; @@ -1399,8 +1399,8 @@ acpi_alloc_resource(device_t bus, device * system resources. */ struct resource * -acpi_alloc_sysres(device_t child, int type, int *rid, u_long start, u_long end, - u_long count, u_int flags) +acpi_alloc_sysres(device_t child, int type, int *rid, rman_res_t start, + rman_res_t end, rman_res_t count, u_int flags) { struct rman *rm; struct resource *res; @@ -1450,7 +1450,7 @@ acpi_is_resource_managed(int type, struc static int acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, - u_long start, u_long end) + rman_res_t start, rman_res_t end) { if (acpi_is_resource_managed(type, r)) Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/acpica/acpi_hpet.c Wed Jan 27 02:23:54 2016 (r294883) @@ -322,7 +322,7 @@ hpet_find(ACPI_HANDLE handle, UINT32 lev static int hpet_find_irq_rid(device_t dev, u_long start, u_long end) { - u_long irq; + rman_res_t irq; int error, rid; for (rid = 0;; rid++) { Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jan 27 02:23:54 2016 (r294883) @@ -91,12 +91,12 @@ static int acpi_pcib_alloc_msix(device_ int *irq); static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); #ifdef NEW_PCIB static int acpi_pcib_acpi_adjust_resource(device_t dev, device_t child, int type, struct resource *r, - u_long start, u_long end); + rman_res_t start, rman_res_t end); #ifdef PCI_RES_BUS static int acpi_pcib_acpi_release_resource(device_t dev, device_t child, int type, int rid, @@ -283,7 +283,7 @@ acpi_pcib_producer_handler(ACPI_RESOURCE #if defined(NEW_PCIB) && defined(PCI_RES_BUS) static int -first_decoded_bus(struct acpi_hpcib_softc *sc, u_long *startp) +first_decoded_bus(struct acpi_hpcib_softc *sc, rman_res_t *startp) { struct resource_list_entry *rle; @@ -304,7 +304,7 @@ acpi_pcib_acpi_attach(device_t dev) u_int slot, func, busok; #if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct resource *bus_res; - u_long start; + rman_res_t start; int rid; #endif uint8_t busno; @@ -584,7 +584,7 @@ acpi_pcib_map_msi(device_t pcib, device_ struct resource * acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { #ifdef NEW_PCIB struct acpi_hpcib_softc *sc; @@ -625,7 +625,7 @@ acpi_pcib_acpi_alloc_resource(device_t d #ifdef NEW_PCIB int acpi_pcib_acpi_adjust_resource(device_t dev, device_t child, int type, - struct resource *r, u_long start, u_long end) + struct resource *r, rman_res_t start, rman_res_t end) { struct acpi_hpcib_softc *sc; Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/acpica/acpi_resource.c Wed Jan 27 02:23:54 2016 (r294883) @@ -671,7 +671,7 @@ acpi_sysres_attach(device_t dev) struct resource_list_entry *bus_rle, *dev_rle; struct resource_list *bus_rl, *dev_rl; int done, type; - u_long start, end, count; + rman_res_t start, end, count; /* * Loop through all current resources to see if the new one overlaps Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/acpica/acpi_timer.c Wed Jan 27 02:23:54 2016 (r294883) @@ -122,7 +122,7 @@ static void acpi_timer_identify(driver_t *driver, device_t parent) { device_t dev; - u_long rlen, rstart; + rman_res_t rlen, rstart; int rid, rtype; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/acpica/acpivar.h Wed Jan 27 02:23:54 2016 (r294883) @@ -383,7 +383,8 @@ ACPI_STATUS acpi_lookup_irq_resource(dev ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resource_set *set, void *arg); struct resource *acpi_alloc_sysres(device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags); + rman_res_t start, rman_res_t end, rman_res_t count, + u_int flags); /* ACPI event handling */ UINT32 acpi_event_power_button_sleep(void *context); Modified: head/sys/dev/advansys/adv_isa.c ============================================================================== --- head/sys/dev/advansys/adv_isa.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/advansys/adv_isa.c Wed Jan 27 02:23:54 2016 (r294883) @@ -109,7 +109,7 @@ adv_isa_probe(device_t dev) { int port_index; int max_port_index; - u_long iobase, iocount, irq; + rman_res_t iobase, iocount, irq; int user_iobase = 0; int rid = 0; void *ih; Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ahci/ahci.c Wed Jan 27 02:23:54 2016 (r294883) @@ -523,7 +523,7 @@ ahci_intr_one_edge(void *data) struct resource * ahci_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct ahci_controller *ctlr = device_get_softc(dev); struct resource *res; Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ahci/ahci.h Wed Jan 27 02:23:54 2016 (r294883) @@ -626,7 +626,7 @@ int ahci_detach(device_t dev); int ahci_setup_interrupt(device_t dev); int ahci_print_child(device_t dev, device_t child); struct resource *ahci_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags); + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); int ahci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int ahci_setup_intr(device_t dev, device_t child, struct resource *irq, Modified: head/sys/dev/ata/ata-cbus.c ============================================================================== --- head/sys/dev/ata/ata-cbus.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ata/ata-cbus.c Wed Jan 27 02:23:54 2016 (r294883) @@ -67,7 +67,7 @@ ata_cbus_probe(device_t dev) { struct resource *io; int rid; - u_long tmp; + rman_res_t tmp; /* dont probe PnP devices */ if (isa_get_vendorid(dev)) @@ -168,7 +168,8 @@ ata_cbus_attach(device_t dev) static struct resource * ata_cbus_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, + u_int flags) { struct ata_cbus_controller *ctlr = device_get_softc(dev); Modified: head/sys/dev/ata/ata-isa.c ============================================================================== --- head/sys/dev/ata/ata-isa.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ata/ata-isa.c Wed Jan 27 02:23:54 2016 (r294883) @@ -60,7 +60,7 @@ static int ata_isa_probe(device_t dev) { struct resource *io = NULL, *ctlio = NULL; - u_long tmp; + rman_res_t tmp; int rid; /* check isapnp ids */ @@ -100,7 +100,7 @@ ata_isa_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); struct resource *io = NULL, *ctlio = NULL; - u_long tmp; + rman_res_t tmp; int i, rid; if (ch->attached) Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ata/ata-pci.c Wed Jan 27 02:23:54 2016 (r294883) @@ -217,7 +217,8 @@ ata_pci_write_config(device_t dev, devic struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, + u_int flags) { struct ata_pci_controller *controller = device_get_softc(dev); struct resource *res = NULL; Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ata/ata-pci.h Wed Jan 27 02:23:54 2016 (r294883) @@ -535,7 +535,7 @@ void ata_pci_write_config(device_t dev, int ata_pci_print_child(device_t dev, device_t child); int ata_pci_child_location_str(device_t dev, device_t child, char *buf, size_t buflen); -struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); +struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep); int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); Modified: head/sys/dev/atkbdc/atkbdc_ebus.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_ebus.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/atkbdc/atkbdc_ebus.c Wed Jan 27 02:23:54 2016 (r294883) @@ -91,7 +91,7 @@ static int atkbdc_ebus_probe(device_t dev) { struct resource *port0, *port1; - u_long count, start; + rman_res_t count, start; int error, rid; if (strcmp(ofw_bus_get_name(dev), "8042") != 0) @@ -176,7 +176,7 @@ atkbdc_ebus_attach(device_t dev) atkbdc_device_t *adi; device_t cdev; phandle_t child; - u_long count, intr, start; + rman_res_t count, intr, start; int children, error, rid, unit; char *cname, *dname; Modified: head/sys/dev/atkbdc/atkbdc_isa.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_isa.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/atkbdc/atkbdc_isa.c Wed Jan 27 02:23:54 2016 (r294883) @@ -50,8 +50,8 @@ static int atkbdc_isa_attach(device_t de static device_t atkbdc_isa_add_child(device_t bus, u_int order, const char *name, int unit); static struct resource *atkbdc_isa_alloc_resource(device_t dev, device_t child, - int type, int *rid, u_long start, u_long end, - u_long count, u_int flags); + int type, int *rid, rman_res_t start, rman_res_t end, + rman_res_t count, u_int flags); static int atkbdc_isa_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); @@ -97,8 +97,8 @@ atkbdc_isa_probe(device_t dev) { struct resource *port0; struct resource *port1; - u_long start; - u_long count; + rman_res_t start; + rman_res_t count; int error; int rid; #if defined(__i386__) || defined(__amd64__) @@ -295,7 +295,7 @@ atkbdc_isa_add_child(device_t bus, u_int struct resource * atkbdc_isa_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { atkbdc_softc_t *sc; Modified: head/sys/dev/atkbdc/atkbdc_subr.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_subr.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/atkbdc/atkbdc_subr.c Wed Jan 27 02:23:54 2016 (r294883) @@ -51,7 +51,7 @@ int atkbdc_print_child(device_t bus, device_t dev) { atkbdc_device_t *kbdcdev; - u_long irq; + rman_res_t irq; int flags; int retval = 0; Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/cs/if_cs.c Wed Jan 27 02:23:54 2016 (r294883) @@ -258,7 +258,7 @@ cs_cs89x0_probe(device_t dev) { int i; int error; - u_long irq, junk; + rman_res_t irq, junk; struct cs_softc *sc = device_get_softc(dev); unsigned rev_type = 0; uint16_t id; Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ctau/if_ct.c Wed Jan 27 02:23:54 2016 (r294883) @@ -317,8 +317,8 @@ static short porttab [] = { static char dmatab [] = { 7, 6, 5, 0 }; static char irqtab [] = { 5, 10, 11, 7, 3, 15, 12, 0 }; -static int ct_is_free_res (device_t dev, int rid, int type, u_long start, - u_long end, u_long count) +static int ct_is_free_res (device_t dev, int rid, int type, rman_res_t start, + rman_res_t end, rman_res_t count) { struct resource *res; @@ -332,7 +332,7 @@ static int ct_is_free_res (device_t dev, static void ct_identify (driver_t *driver, device_t dev) { - u_long iobase, rescount; + rman_res_t iobase, rescount; int devcount; device_t *devices; device_t child; @@ -440,7 +440,7 @@ static void ct_identify (driver_t *drive static int ct_probe (device_t dev) { int unit = device_get_unit (dev); - u_long iobase, rescount; + rman_res_t iobase, rescount; if (!device_get_desc (dev) || strcmp (device_get_desc (dev), "Cronyx Tau-ISA")) @@ -529,7 +529,7 @@ ct_bus_dma_mem_free (ct_dma_mem_t *dmem) static int ct_attach (device_t dev) { bdrv_t *bd = device_get_softc (dev); - u_long iobase, drq, irq, rescount; + rman_res_t iobase, drq, irq, rescount; int unit = device_get_unit (dev); char *ct_ln = CT_LOCK_NAME; ct_board_t *b; Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/cx/if_cx.c Wed Jan 27 02:23:54 2016 (r294883) @@ -405,8 +405,8 @@ static short porttab [] = { static char dmatab [] = { 7, 6, 5, 0 }; static char irqtab [] = { 5, 10, 11, 7, 3, 15, 12, 0 }; -static int cx_is_free_res (device_t dev, int rid, int type, u_long start, - u_long end, u_long count) +static int cx_is_free_res (device_t dev, int rid, int type, rman_res_t start, + rman_res_t end, rman_res_t count) { struct resource *res; @@ -420,7 +420,7 @@ static int cx_is_free_res (device_t dev, static void cx_identify (driver_t *driver, device_t dev) { - u_long iobase, rescount; + rman_res_t iobase, rescount; int devcount; device_t *devices; device_t child; @@ -530,7 +530,7 @@ static int cx_probe (device_t dev) { int unit = device_get_unit (dev); int i; - u_long iobase, rescount; + rman_res_t iobase, rescount; if (!device_get_desc (dev) || strcmp (device_get_desc (dev), "Cronyx Sigma")) @@ -629,7 +629,7 @@ cx_bus_dma_mem_free (cx_dma_mem_t *dmem) static int cx_attach (device_t dev) { bdrv_t *bd = device_get_softc (dev); - u_long iobase, drq, irq, rescount; + rman_res_t iobase, drq, irq, rescount; int unit = device_get_unit (dev); char *cx_ln = CX_LOCK_NAME; cx_board_t *b; Modified: head/sys/dev/ed/if_ed_3c503.c ============================================================================== --- head/sys/dev/ed/if_ed_3c503.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ed/if_ed_3c503.c Wed Jan 27 02:23:54 2016 (r294883) @@ -74,7 +74,7 @@ ed_probe_3Com(device_t dev, int port_rid int i; u_int memsize; u_char isa16bit; - u_long conf_maddr, conf_msize, irq, junk, pmem; + rman_res_t conf_maddr, conf_msize, irq, junk, pmem; error = ed_alloc_port(dev, 0, ED_3COM_IO_PORTS); if (error) Modified: head/sys/dev/ed/if_ed_cbus.c ============================================================================== --- head/sys/dev/ed/if_ed_cbus.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ed/if_ed_cbus.c Wed Jan 27 02:23:54 2016 (r294883) @@ -607,7 +607,7 @@ ed98_alloc_memory(dev, rid) { struct ed_softc *sc = device_get_softc(dev); int error; - u_long conf_maddr, conf_msize; + rman_res_t conf_maddr, conf_msize; error = bus_get_resource(dev, SYS_RES_MEMORY, 0, &conf_maddr, &conf_msize); @@ -1001,7 +1001,7 @@ ed_probe_CNET98(device_t dev, int port_r struct ed_softc *sc = device_get_softc(dev); int error; u_char tmp; - u_long conf_irq, junk; + rman_res_t conf_irq, junk; #ifdef DIAGNOSTIC u_char tmp_s; #endif @@ -1157,7 +1157,7 @@ ed_probe_CNET98EL(device_t dev, int port int error; int i; u_char romdata[ETHER_ADDR_LEN * 2], tmp; - u_long conf_irq, junk; + rman_res_t conf_irq, junk; error = ed98_alloc_port(dev, port_rid); if (error) @@ -1251,7 +1251,7 @@ ed_probe_NEC77(device_t dev, int port_ri struct ed_softc *sc = device_get_softc(dev); int error; u_char tmp; - u_long conf_irq, junk; + rman_res_t conf_irq, junk; error = ed98_probe_Novell(dev, port_rid, flags); if (error) @@ -1303,7 +1303,7 @@ ed_probe_NW98X(device_t dev, int port_ri struct ed_softc *sc = device_get_softc(dev); int error; u_char tmp; - u_long conf_irq, junk; + rman_res_t conf_irq, junk; error = ed98_probe_Novell(dev, port_rid, flags); if (error) @@ -1427,7 +1427,7 @@ ed_probe_SB98(device_t dev, int port_rid struct ed_softc *sc = device_get_softc(dev); int error; u_char tmp; - u_long conf_irq, junk; + rman_res_t conf_irq, junk; error = ed98_alloc_port(dev, port_rid); if (error) Modified: head/sys/dev/ed/if_ed_hpp.c ============================================================================== --- head/sys/dev/ed/if_ed_hpp.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ed/if_ed_hpp.c Wed Jan 27 02:23:54 2016 (r294883) @@ -126,7 +126,7 @@ ed_probe_HP_pclanp(device_t dev, int por u_char irq; /* board configured IRQ */ uint8_t test_pattern[ED_HPP_TEST_SIZE]; /* read/write areas for */ uint8_t test_buffer[ED_HPP_TEST_SIZE]; /* probing card */ - u_long conf_maddr, conf_msize, conf_irq, junk; + rman_res_t conf_maddr, conf_msize, conf_irq, junk; error = ed_alloc_port(dev, 0, ED_HPP_IO_PORTS); if (error) Modified: head/sys/dev/ed/if_ed_wd80x3.c ============================================================================== --- head/sys/dev/ed/if_ed_wd80x3.c Wed Jan 27 02:22:31 2016 (r294882) +++ head/sys/dev/ed/if_ed_wd80x3.c Wed Jan 27 02:23:54 2016 (r294883) @@ -97,7 +97,7 @@ ed_probe_WD80x3_generic(device_t dev, in int i; u_int memsize; u_char iptr, isa16bit, sum, totalsum; - u_long irq, junk, pmem; + rman_res_t irq, junk, pmem; sc->chip_type = ED_CHIP_TYPE_DP8390; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 27 02:25:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3171DA6EB6D; Wed, 27 Jan 2016 02:25:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id F38A6139C; Wed, 27 Jan 2016 02:25:26 +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 u0R2PP87062223; Wed, 27 Jan 2016 02:25:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R2PPah062221; Wed, 27 Jan 2016 02:25:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201601270225.u0R2PPah062221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Jan 2016 02:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294884 - in head/etc: defaults rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 02:25:27 -0000 Author: cy Date: Wed Jan 27 02:25:25 2016 New Revision: 294884 URL: https://svnweb.freebsd.org/changeset/base/294884 Log: Allow specification of fetch options for ntp leap-seconds fetch. MFC after: 1 week X-MFC with: r289421, r293037, r294773 Modified: head/etc/defaults/rc.conf head/etc/rc.d/ntpd Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Jan 27 02:23:54 2016 (r294883) +++ head/etc/defaults/rc.conf Wed Jan 27 02:25:25 2016 (r294884) @@ -368,6 +368,8 @@ ntp_db_leapfile="/var/db/ntpd.leap-secon # Working copy (updated weekly) leapfile ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" # Source from which to fetch leapfile +ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, + # e.g. --no-verify-peer ntp_leapfile_expiry_days=30 # Check for new leapfile 30 days prior to # expiry. ntp_leapfile_fetch_verbose="NO" # Be verbose during NTP leapfile fetch Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Wed Jan 27 02:23:54 2016 (r294883) +++ head/etc/rc.d/ntpd Wed Jan 27 02:25:25 2016 (r294884) @@ -105,7 +105,7 @@ ntpd_fetch_leapfile() { $verbose Within ntp leapfile expiry limit, initiating fetch for url in $ntp_leapfile_sources ; do $verbose fetching $url - fetch -mqo $ntp_tmp_leapfile $url && break + fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break done ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then From owner-svn-src-head@freebsd.org Wed Jan 27 02:55:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17B13A6F492; Wed, 27 Jan 2016 02:55:22 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD599D9; Wed, 27 Jan 2016 02:55:21 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qg0-x234.google.com with SMTP id o11so155205269qge.2; Tue, 26 Jan 2016 18:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=MTW/LVzav9ccVMOZwQ4M20t4+G/p6jeTUXFoBEJoyBo=; b=en/G3ti9SFjaosgdSTgJZV9KNrhDsgFcudesFnCzUzNnAbrulDhXKKEG1JAYQA63ez P/vEPSBY/3H7hhIwb5mOjExoRr8DNmO5UfDc4mvtsmjXOwhYQl17robfc4+BwIbp9d1H EIQqCK1xORmzN4j4IhxJLqv/PiBCXJoyQBV89HrByZHE7zjv/ERXyPrB/QZAYYXHX167 UKwg6pOT/TsYGFy2cILVeO4i05zwry2ZTxecR5DPw2wXv5xyTxo03fnYWk8Gpyx6bHJH yYKUg3X4bTc8p2zyR3MCMj4I7OFTy1X05ixq7a8ALHX3otb6PU28dTwbGpYh5JKKC5QS shWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type; bh=MTW/LVzav9ccVMOZwQ4M20t4+G/p6jeTUXFoBEJoyBo=; b=j9B2ed7MsUAAb+WDs9Zv7eWVJlwWIME1DibupCCLk33ulPRqrIW5G4BnSGc37v11pZ KyF+fC0d5Md5qgPadgt06eKslnIvhCNdiUz8zsMLcX3H7ZiZvodnu3P855eLlyBhS/Yp iYhhxq3J13hPxDfnM5S9uAVDajInCR/+aLbpt3Y5hKzysgGlibwXp2LRCcgUBoOQsNPt gnBg/su3VDnQq861Uhd5HMkM+U0j8Epybs3W64U3aHz5c6n3QKSRyxnlam5A3JhSvdLu 1dO0pwbaN9SFmE2xJUI62cdqsQPkDd6H14a3f/06xEaIuh0SPcWNUtb13zBQQCKeJDoH wVMA== X-Gm-Message-State: AG10YOTbEnMRNaEq9VNuDYsvTNMddOhD5mVP7UrTRyBBGgr44FrImf0akD3lfUe96ZInaQ== X-Received: by 10.140.18.172 with SMTP id 41mr32194218qgf.7.1453863320908; Tue, 26 Jan 2016 18:55:20 -0800 (PST) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id t103sm1831183qgd.37.2016.01.26.18.55.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Jan 2016 18:55:19 -0800 (PST) Date: Tue, 26 Jan 2016 21:55:14 -0500 From: Alexander Kabaev To: Antoine Brodin Cc: Alexander Kabaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294470 - head/libexec/rtld-elf Message-ID: <20160126215514.2da7b1a1@kan> In-Reply-To: References: <201601202326.u0KNQZwL066141@repo.freebsd.org> <20160121183646.6d964d54@kan> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/4V_Pg2IWxbYcm8f5NB.gQ1s"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 02:55:22 -0000 --Sig_/4V_Pg2IWxbYcm8f5NB.gQ1s Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 23 Jan 2016 12:00:23 +0000 Antoine Brodin wrote: > On Thu, Jan 21, 2016 at 11:36 PM, Alexander Kabaev > wrote: > > On Thu, 21 Jan 2016 22:20:12 +0100 > > Antoine Brodin wrote: > > =20 > >> On Thu, Jan 21, 2016 at 12:26 AM, Alexander Kabaev > >> wrote: =20 > >> > Author: kan > >> > Date: Wed Jan 20 23:26:35 2016 > >> > New Revision: 294470 > >> > URL: https://svnweb.freebsd.org/changeset/base/294470 > >> > > >> > Log: > >> > Fix initlist_add_object invocation parameters. > >> > > >> > The tail parameter should point to the last object for > >> > which dependencies should be processed. In most cases, > >> > this is the object itself. > >> > > >> > Modified: > >> > head/libexec/rtld-elf/rtld.c =20 > >> > >> Hi, > >> > >> It seems there are still some hangs after this fix (seen on the > >> -head package builders, tar -xf hanging for instance). > >> > >> Cheers, > >> > >> Antoine =20 > > > > I've seen hangs _before_ this fix but none after. You'd have to > > collect some backtraces and share with me and kib@. =20 >=20 > False alarm, for unknown reasons java/eclipse eats all CPU on head and > other ports were starving. >=20 > Cheers, >=20 > Antoine For the record, we have reitroduced the bug fixed once already eight years ago in r178807. The symptoms are exacty that: multi-threaded processed spinning in userland wasting CPU time. The fix is out for review to kib@ and if he does no object, I'll check it in tomorrow. --=20 Alexander Kabaev --Sig_/4V_Pg2IWxbYcm8f5NB.gQ1s Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWqDGSXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+KlgQAIKZNwU2Q0mKgIFBQyMbRt66 aLzgznKhoHmco7NScDtWCxnXa5hOscLtXrOsYixUMR1GqNw1cMVwEY/CmWNA3kfs seePSzbGhyg2qTa3i7Mgia6EAfA7TQoJ8JQA6mAE/N6I15PujXY2clqAabV00/CC iuHRsFMbBbCDK15omXZvvKIno4KgZO7LmLZkrLJIVKWpp9K8L7tfplz7fdcvVGrF sTGFE2pO8zN0tGj3/HQZa/ZoEn+Cb3fKzmyLmefEAFttOIjY3Mvd++s+1WrwxsjM gXxtDJ5zNMz3Tu9vDo0NF9zDF4apKnR+S9kiE7N2HOHrVRHPbk2Yw87ApzcN+dZc wWEoapa2vhvnvGHsV9et0AewI7Z0ZrRg8kaHzUdzAu2osM4Ra+7fDA0zpIrewwPU W3pvQK7rp2p1ANJ4DyjFjIM6SfTagYGpReERw7VfQ6XQ4DyEpQarFVUaT7rUJJyu cJKYT/++DHsvo0nqMZ97hzP0nZpJDjZeJHNkxtVsOz+rctazRc59L4eoIGGkxSXB BE1mGWBlDI1naP3QdroUOGhSRaCY5abZOrPJmGBedtjpyS9NRs+nZs+nkTSCT/kT x8Htr6TQ0IqcXv6MLWyfRyo5CIM+DwKLj4GcSVEcL7nzp26pAWsQ47QyD+jt3jh4 fkhK4mD7yOVWnyPNHc0H =Zjqr -----END PGP SIGNATURE----- --Sig_/4V_Pg2IWxbYcm8f5NB.gQ1s-- From owner-svn-src-head@freebsd.org Wed Jan 27 03:50:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F0B9A6E742; Wed, 27 Jan 2016 03:50:45 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (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 D47531B4; Wed, 27 Jan 2016 03:50:44 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-io0-x229.google.com with SMTP id 77so6238550ioc.2; Tue, 26 Jan 2016 19:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zteIN0lM7mKUT9CnhLGqxTw17t0meCcVZC3nfHZ/9co=; b=Xox1xB5ux6YsfIOJj42v5gmWQMHak2l9F0T2YE7u0enzAlavspDOoeveHWlCLxJxqH qcsKnIpOWrd36y2XywTYEOjkGAuJOxSB3vJTm5qUaIfNN4CpKnaZG06nRRqnjjnKZT32 +a4dLRKhLpehNAQeklHTBNA0cstllAgIijlB0EGPEkLV96rhznC0yP7yVBqpEs2XH1AB cvIWPN31WwWjAuHSuPVvIj8Dab1HSNoFwWxLcSOp22BGcRSp4oC4IU+C6yE1aT8ioLT8 3hbaXy+5QQFzZRuU77bmK8GUgeGLQQ/pjdo1XOJLiALWyzaJjA9l0dc4JdY35eaVLn+a CXQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zteIN0lM7mKUT9CnhLGqxTw17t0meCcVZC3nfHZ/9co=; b=mncBWPx1a97tzf1yx3KoWzwt23WPSeg5EFBaGAFsVVOiASs/RXPHvfSf9Hjvnz0QBi QeBhed64gs1JwtV7yJHZ5inFevpOuRWwbF/ONH0Bgzr13H3/9wDhLTXn9eo4QLbhqWq7 4SVrj+eEzNKHLV+k9fUvMsIT5IQTdWRMvclz01t6+xhV8z1i56mu8Fc1P3Oj8c1e8q1l meQCdSAMc6WL4SBKqmsykOZnJ39QeKj5uZh1B7JlGrOcvEtAry4h/eL9ljGLiNTAw+XF RPNQJmiSYYOhJMOY3Xmzq50bNly6Yn2X1jBrIeGO8MpH+5NYp5y5EZUe/AbZkg86YG0v 8HiQ== X-Gm-Message-State: AG10YORfK5Sin02OcJlWDz8nw7WAhqrJA2VbeyN3z+szkuUEg7RkZBMeYWKrdQB/A42YGhYlsBXiV5xpd5/cbw== MIME-Version: 1.0 X-Received: by 10.107.44.199 with SMTP id s190mr30771413ios.24.1453866643977; Tue, 26 Jan 2016 19:50:43 -0800 (PST) Received: by 10.107.166.3 with HTTP; Tue, 26 Jan 2016 19:50:43 -0800 (PST) In-Reply-To: <201601270045.u0R0jkfl032745@repo.freebsd.org> References: <201601270045.u0R0jkfl032745@repo.freebsd.org> Date: Wed, 27 Jan 2016 11:50:43 +0800 Message-ID: Subject: Re: svn commit: r294869 - in head: sys/dev/cxgbe/tom sys/netinet usr.bin/systat From: Sepherosa Ziehau To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 03:50:45 -0000 This seems to break i386 LINT: /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1021:20: error: use of undeclared identifier 'tcpstates'; did you mean 'tcpstat'? toep->tp_tid, tcpstates[tp->t_state], toep, inp); ^~~~~~~~~ tcpstat /usr/freebsd-svn/head/sys/sys/ktr.h:89:69: note: expanded from macro 'CTR5' #define CTR5(m, format, p1, p2, p3, p4, p5) CTR6(m, format, p1, p2, p3, p4, p5, 0) ^ /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' (u_long)(p1), (u_long)(p2), (u_long)(p3), \ ^ /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' declared here VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ ^ --- all_subdir_ctl --- --- ctl_error.o --- cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/i386.i386/usr/freebsd-svn/head/sys/LINT/opt_global.h -I. -I/usr/freebsd-svn/head/sys -fno-common -I/usr/obj/i386.i386/usr/freebsd-svn/head/sys/LINT -fno-builtin -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 -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -mno-aes -mno-avx -std=iso9899:1999 -c /usr/freebsd-svn/head/sys/modules/ctl/../../cam/ctl/ctl_error.c -o ctl_error.o --- all_subdir_cxgb --- /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro 'VNET_PCPUSTAT_DECLARE' VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) ^ /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro 'VNET_DECLARE' #define VNET_DECLARE(t, n) extern t n ^ /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1230:16: error: use of undeclared identifier 'tcpstates'; did you mean 'tcpstat'? tid, tp ? tcpstates[tp->t_state] : "no tp" , toep->tp_flags, inp); ^~~~~~~~~ tcpstat /usr/freebsd-svn/head/sys/sys/ktr.h:89:69: note: expanded from macro 'CTR5' #define CTR5(m, format, p1, p2, p3, p4, p5) CTR6(m, format, p1, p2, p3, p4, p5, 0) ^ /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' (u_long)(p1), (u_long)(p2), (u_long)(p3), \ ^ /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' declared here VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ ^ /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro 'VNET_PCPUSTAT_DECLARE' VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) ^ /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro 'VNET_DECLARE' #define VNET_DECLARE(t, n) extern t n ^ /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1230:14: error: pointer type mismatch ('counter_u64_t' (aka 'unsigned long long *') and 'char *') [-Werror,-Wpointer-type-mismatch] tid, tp ? tcpstates[tp->t_state] : "no tp" , toep->tp_flags, inp); ^ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ /usr/freebsd-svn/head/sys/sys/ktr.h:89:69: note: expanded from macro 'CTR5' #define CTR5(m, format, p1, p2, p3, p4, p5) CTR6(m, format, p1, p2, p3, p4, p5, 0) ^ /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' (u_long)(p1), (u_long)(p2), (u_long)(p3), \ ^ /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1293:11: error: use of undeclared identifier 'tcpstates'; did you mean 'tcpstat'? tp ? tcpstates[tp->t_state] : "no tp", toep->tp_flags); ^~~~~~~~~ tcpstat /usr/freebsd-svn/head/sys/sys/ktr.h:88:65: note: expanded from macro 'CTR4' #define CTR4(m, format, p1, p2, p3, p4) CTR6(m, format, p1, p2, p3, p4, 0, 0) ^ /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' (u_long)(p1), (u_long)(p2), (u_long)(p3), \ ^ /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' declared here VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ ^ /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro 'VNET_PCPUSTAT_DECLARE' VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) ^ /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro 'VNET_DECLARE' #define VNET_DECLARE(t, n) extern t n ^ /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1293:9: error: pointer type mismatch ('counter_u64_t' (aka 'unsigned long long *') and 'char *') [-Werror,-Wpointer-type-mismatch] tp ? tcpstates[tp->t_state] : "no tp", toep->tp_flags); ^ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ /usr/freebsd-svn/head/sys/sys/ktr.h:88:65: note: expanded from macro 'CTR4' #define CTR4(m, format, p1, p2, p3, p4) CTR6(m, format, p1, p2, p3, p4, 0, 0) ^ /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' (u_long)(p1), (u_long)(p2), (u_long)(p3), \ ^ /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1499:21: error: use of undeclared identifier 'tcpstates'; did you mean 'tcpstat'? __func__, tid, tcpstates[tp->t_state], toep, toep->tp_flags, ^~~~~~~~~ tcpstat /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' (u_long)(p1), (u_long)(p2), (u_long)(p3), \ ^ /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' declared here VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ ^ /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro 'VNET_PCPUSTAT_DECLARE' VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) ^ /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro 'VNET_DECLARE' #define VNET_DECLARE(t, n) extern t n ^ /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1585:47: error: use of undeclared identifier 'tcpstates'; did you mean 'tcpstat'? CTR4(KTR_CXGB, "%s tid %u, toep %p, inp %p", tcpstates[tp->t_state], ^~~~~~~~~ tcpstat /usr/freebsd-svn/head/sys/sys/ktr.h:88:57: note: expanded from macro 'CTR4' #define CTR4(m, format, p1, p2, p3, p4) CTR6(m, format, p1, p2, p3, p4, 0, 0) ^ /usr/freebsd-svn/head/sys/sys/ktr.h:81:16: note: expanded from macro 'CTR6' (u_long)(p1), (u_long)(p2), (u_long)(p3), \ ^ /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' declared here VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ ^ /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro 'VNET_PCPUSTAT_DECLARE' VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) ^ /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro 'VNET_DECLARE' #define VNET_DECLARE(t, n) extern t n On Wed, Jan 27, 2016 at 8:45 AM, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Jan 27 00:45:46 2016 > New Revision: 294869 > URL: https://svnweb.freebsd.org/changeset/base/294869 > > Log: > Augment struct tcpstat with tcps_states[], which is used for book-keeping > the amount of TCP connections by state. Provides a cheap way to get > connection count without traversing the whole pcb list. > > Sponsored by: Netflix > > Modified: > head/sys/dev/cxgbe/tom/t4_cpl_io.c > head/sys/netinet/tcp_offload.c > head/sys/netinet/tcp_subr.c > head/sys/netinet/tcp_syncache.c > head/sys/netinet/tcp_timewait.c > head/sys/netinet/tcp_usrreq.c > head/sys/netinet/tcp_var.h > head/usr.bin/systat/netstat.c > > Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 27 00:24:24 2016 (r294868) > +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 27 00:45:46 2016 (r294869) > @@ -45,10 +45,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #define TCPSTATES > #include > #include > +#include > #include > > #include "common/common.h" > > Modified: head/sys/netinet/tcp_offload.c > ============================================================================== > --- head/sys/netinet/tcp_offload.c Wed Jan 27 00:24:24 2016 (r294868) > +++ head/sys/netinet/tcp_offload.c Wed Jan 27 00:45:46 2016 (r294869) > @@ -42,10 +42,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #define TCPOUTFLAGS > #include > +#include > #include > > int registered_toedevs; > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Wed Jan 27 00:24:24 2016 (r294868) > +++ head/sys/netinet/tcp_subr.c Wed Jan 27 00:45:46 2016 (r294869) > @@ -1468,6 +1468,7 @@ tcp_close(struct tcpcb *tp) > #endif > in_pcbdrop(inp); > TCPSTAT_INC(tcps_closed); > + TCPSTAT_DEC(tcps_states[tp->t_state]); > KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); > so = inp->inp_socket; > soisdisconnected(so); > @@ -2910,6 +2911,8 @@ tcp_state_change(struct tcpcb *tp, int n > int pstate = tp->t_state; > #endif > > + TCPSTAT_DEC(tcps_states[tp->t_state]); > + TCPSTAT_INC(tcps_states[newstate]); > tp->t_state = newstate; > TCP_PROBE6(state__change, NULL, tp, NULL, tp, NULL, pstate); > } > > Modified: head/sys/netinet/tcp_syncache.c > ============================================================================== > --- head/sys/netinet/tcp_syncache.c Wed Jan 27 00:24:24 2016 (r294868) > +++ head/sys/netinet/tcp_syncache.c Wed Jan 27 00:45:46 2016 (r294869) > @@ -351,6 +351,7 @@ syncache_insert(struct syncache *sc, str > > SCH_UNLOCK(sch); > > + TCPSTAT_INC(tcps_states[TCPS_SYN_RECEIVED]); > TCPSTAT_INC(tcps_sc_added); > } > > @@ -364,6 +365,7 @@ syncache_drop(struct syncache *sc, struc > > SCH_LOCK_ASSERT(sch); > > + TCPSTAT_DEC(tcps_states[TCPS_SYN_RECEIVED]); > TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); > sch->sch_length--; > > @@ -992,7 +994,16 @@ syncache_expand(struct in_conninfo *inc, > goto failed; > } > } else { > - /* Pull out the entry to unlock the bucket row. */ > + /* > + * Pull out the entry to unlock the bucket row. > + * > + * NOTE: We must decrease TCPS_SYN_RECEIVED count here, not > + * tcp_state_change(). The tcpcb is not existent at this > + * moment. A new one will be allocated via syncache_socket-> > + * sonewconn->tcp_usr_attach in TCPS_CLOSED state, then > + * syncache_socket() will change it to TCPS_SYN_RECEIVED. > + */ > + TCPSTAT_DEC(tcps_states[TCPS_SYN_RECEIVED]); > TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); > sch->sch_length--; > #ifdef TCP_OFFLOAD > > Modified: head/sys/netinet/tcp_timewait.c > ============================================================================== > --- head/sys/netinet/tcp_timewait.c Wed Jan 27 00:24:24 2016 (r294868) > +++ head/sys/netinet/tcp_timewait.c Wed Jan 27 00:45:46 2016 (r294869) > @@ -660,6 +660,7 @@ tcp_tw_2msl_stop(struct tcptw *tw, int r > > if (!reuse) > uma_zfree(V_tcptw_zone, tw); > + TCPSTAT_DEC(tcps_states[TCPS_TIME_WAIT]); > } > > struct tcptw * > > Modified: head/sys/netinet/tcp_usrreq.c > ============================================================================== > --- head/sys/netinet/tcp_usrreq.c Wed Jan 27 00:24:24 2016 (r294868) > +++ head/sys/netinet/tcp_usrreq.c Wed Jan 27 00:45:46 2016 (r294869) > @@ -1883,6 +1883,7 @@ tcp_attach(struct socket *so) > tp->t_state = TCPS_CLOSED; > INP_WUNLOCK(inp); > INP_INFO_RUNLOCK(&V_tcbinfo); > + TCPSTAT_INC(tcps_states[TCPS_CLOSED]); > return (0); > } > > > Modified: head/sys/netinet/tcp_var.h > ============================================================================== > --- head/sys/netinet/tcp_var.h Wed Jan 27 00:24:24 2016 (r294868) > +++ head/sys/netinet/tcp_var.h Wed Jan 27 00:45:46 2016 (r294869) > @@ -34,6 +34,7 @@ > #define _NETINET_TCP_VAR_H_ > > #include > +#include > > #ifdef _KERNEL > #include > @@ -587,6 +588,9 @@ struct tcpstat { > uint64_t tcps_sig_err_sigopt; /* No signature expected by socket */ > uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ > > + /* Running connection count. */ > + uint64_t tcps_states[TCP_NSTATES]; > + > uint64_t _pad[12]; /* 6 UTO, 6 TBD */ > }; > > > Modified: head/usr.bin/systat/netstat.c > ============================================================================== > --- head/usr.bin/systat/netstat.c Wed Jan 27 00:24:24 2016 (r294868) > +++ head/usr.bin/systat/netstat.c Wed Jan 27 00:45:46 2016 (r294869) > @@ -59,10 +59,10 @@ static const char sccsid[] = "@(#)netsta > #include > #include > #include > -#include > #define TCPSTATES > #include > #include > +#include > #include > #include > #include > -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Wed Jan 27 03:51:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40122A6E788; Wed, 27 Jan 2016 03:51:04 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::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 0A28D359; Wed, 27 Jan 2016 03:51:04 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id f81so6328912iof.0; Tue, 26 Jan 2016 19:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bR557wykYVAMjgki9IttzTY08PcKLtkYBSdKg+nhSV8=; b=NAaIH8h6voQiA1CDDZAu7v0K4ldCq6Cx4wB+7tVWa5EKVtf1sAZ+oW7uEWsjqjdibe Phg15b4LV7h8BhhOMIP06A3MZZXPqCkIqzKoh00Aw++fImLHqGl2xz4rSdYLBKXe3tsi +Lvz64SjlENfTcllFqoI1bZTeTK5THCawZJSCOtxmM1rQckH59AdJVjtBkRCufsLIKTp mITfTrmYZGkCPJDjtnmlo13/b7JXDp/hm8v+V0dJKV186q5bOYTOHucIeoGEDKWsuSWZ FaEKgLrBdOOlyUhaPnFQd+JMDWRbeknlk9WJt/apl2ka3ADipx8otSxK7X2shHhH8Fgb 7Gpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=bR557wykYVAMjgki9IttzTY08PcKLtkYBSdKg+nhSV8=; b=bxA7+bDUn81PtOTDo3iqB29G9a+A0arAMqIyXfS4+JK/AN9uTpbxz9gK9Hin9UOlsT IfDpVX7K2s6SGp78BMY8fXKeHRaRiNI0fEvqsdBGJpW3CCV093htJoa9eHU45vybs2Hr uti1gdyCEwaKm/yVVRYAXVjM28Y2NGSPACOxT+zk0kwY+LtWJeC7Bl43vgcskDF1BmQV VVPKHCsaY/8IQazRrNvOj05bPj7RZplHCfsrAFazSMw3+0zNHpO0o3Cd3QehAwluocKL IXlw7sq2pR66+jbLiD4F3f49JDis8ZuAsR7TEieddgrCOzZ9cGwalTHLvRqrR72Bbwen sMWw== X-Gm-Message-State: AG10YOS1ytFivRCNhjkW73gYrER/eQda1XpKA85ZaVND99Rdgkiq8d4PfBVO7N/mxt4iqLcF4bAmMo1tKchS8A== MIME-Version: 1.0 X-Received: by 10.107.7.37 with SMTP id 37mr859443ioh.17.1453866663340; Tue, 26 Jan 2016 19:51:03 -0800 (PST) Received: by 10.107.166.3 with HTTP; Tue, 26 Jan 2016 19:51:03 -0800 (PST) In-Reply-To: References: <201601270045.u0R0jkfl032745@repo.freebsd.org> Date: Wed, 27 Jan 2016 11:51:03 +0800 Message-ID: Subject: Re: svn commit: r294869 - in head: sys/dev/cxgbe/tom sys/netinet usr.bin/systat From: Sepherosa Ziehau To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 03:51:04 -0000 BTW, amd64 LINT builds fine. On Wed, Jan 27, 2016 at 11:50 AM, Sepherosa Ziehau wrote: > This seems to break i386 LINT: > > /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1021:20: > error: use of undeclared identifier 'tcpstates'; did you mean > 'tcpstat'? > toep->tp_tid, tcpstates[tp->t_state], toep, inp); > ^~~~~~~~~ > tcpstat > /usr/freebsd-svn/head/sys/sys/ktr.h:89:69: note: expanded from macro 'CTR5' > #define CTR5(m, format, p1, p2, p3, p4, p5) CTR6(m, format, p1, > p2, p3, p4, p5, 0) > ^ > /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' > (u_long)(p1), (u_long)(p2), (u_long)(p3), \ > ^ > /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' > declared here > VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ > ^ > --- all_subdir_ctl --- > --- ctl_error.o --- > cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE > -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include > /usr/obj/i386.i386/usr/freebsd-svn/head/sys/LINT/opt_global.h -I. > -I/usr/freebsd-svn/head/sys -fno-common > -I/usr/obj/i386.i386/usr/freebsd-svn/head/sys/LINT -fno-builtin > -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 > -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs > -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-error-tautological-compare -Wno-error-empty-body > -Wno-error-parentheses-equality -Wno-error-unused-function > -Wno-error-pointer-sign -Wno-error-shift-negative-value -mno-aes > -mno-avx -std=iso9899:1999 -c > /usr/freebsd-svn/head/sys/modules/ctl/../../cam/ctl/ctl_error.c -o > ctl_error.o > --- all_subdir_cxgb --- > /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro > 'VNET_PCPUSTAT_DECLARE' > VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro > 'VNET_DECLARE' > #define VNET_DECLARE(t, n) extern t n > ^ > /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1230:16: > error: use of undeclared identifier 'tcpstates'; did you mean > 'tcpstat'? > tid, tp ? tcpstates[tp->t_state] : "no tp" , toep->tp_flags, inp); > ^~~~~~~~~ > tcpstat > /usr/freebsd-svn/head/sys/sys/ktr.h:89:69: note: expanded from macro 'CTR5' > #define CTR5(m, format, p1, p2, p3, p4, p5) CTR6(m, format, p1, > p2, p3, p4, p5, 0) > ^ > /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' > (u_long)(p1), (u_long)(p2), (u_long)(p3), \ > ^ > /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' > declared here > VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro > 'VNET_PCPUSTAT_DECLARE' > VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro > 'VNET_DECLARE' > #define VNET_DECLARE(t, n) extern t n > ^ > /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1230:14: > error: pointer type mismatch ('counter_u64_t' (aka 'unsigned long long > *') and 'char *') [-Werror,-Wpointer-type-mismatch] > tid, tp ? tcpstates[tp->t_state] : "no tp" , toep->tp_flags, inp); > ^ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ > /usr/freebsd-svn/head/sys/sys/ktr.h:89:69: note: expanded from macro 'CTR5' > #define CTR5(m, format, p1, p2, p3, p4, p5) CTR6(m, format, p1, > p2, p3, p4, p5, 0) > ^ > /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' > (u_long)(p1), (u_long)(p2), (u_long)(p3), \ > ^ > /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1293:11: > error: use of undeclared identifier 'tcpstates'; did you mean > 'tcpstat'? > tp ? tcpstates[tp->t_state] : "no tp", toep->tp_flags); > ^~~~~~~~~ > tcpstat > /usr/freebsd-svn/head/sys/sys/ktr.h:88:65: note: expanded from macro 'CTR4' > #define CTR4(m, format, p1, p2, p3, p4) CTR6(m, format, p1, p2, p3, p4, 0, 0) > ^ > /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' > (u_long)(p1), (u_long)(p2), (u_long)(p3), \ > ^ > /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' > declared here > VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro > 'VNET_PCPUSTAT_DECLARE' > VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro > 'VNET_DECLARE' > #define VNET_DECLARE(t, n) extern t n > ^ > /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1293:9: > error: pointer type mismatch ('counter_u64_t' (aka 'unsigned long long > *') and 'char *') [-Werror,-Wpointer-type-mismatch] > tp ? tcpstates[tp->t_state] : "no tp", toep->tp_flags); > ^ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ > /usr/freebsd-svn/head/sys/sys/ktr.h:88:65: note: expanded from macro 'CTR4' > #define CTR4(m, format, p1, p2, p3, p4) CTR6(m, format, p1, p2, p3, p4, 0, 0) > ^ > /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' > (u_long)(p1), (u_long)(p2), (u_long)(p3), \ > ^ > /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1499:21: > error: use of undeclared identifier 'tcpstates'; did you mean > 'tcpstat'? > __func__, tid, tcpstates[tp->t_state], toep, toep->tp_flags, > ^~~~~~~~~ > tcpstat > /usr/freebsd-svn/head/sys/sys/ktr.h:81:44: note: expanded from macro 'CTR6' > (u_long)(p1), (u_long)(p2), (u_long)(p3), \ > ^ > /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' > declared here > VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro > 'VNET_PCPUSTAT_DECLARE' > VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro > 'VNET_DECLARE' > #define VNET_DECLARE(t, n) extern t n > ^ > /usr/freebsd-svn/head/sys/modules/cxgb/tom/../../../dev/cxgb/ulp/tom/cxgb_cpl_io.c:1585:47: > error: use of undeclared identifier 'tcpstates'; did you mean > 'tcpstat'? > CTR4(KTR_CXGB, "%s tid %u, toep %p, inp %p", tcpstates[tp->t_state], > ^~~~~~~~~ > tcpstat > /usr/freebsd-svn/head/sys/sys/ktr.h:88:57: note: expanded from macro 'CTR4' > #define CTR4(m, format, p1, p2, p3, p4) CTR6(m, format, p1, p2, p3, p4, 0, 0) > ^ > /usr/freebsd-svn/head/sys/sys/ktr.h:81:16: note: expanded from macro 'CTR6' > (u_long)(p1), (u_long)(p2), (u_long)(p3), \ > ^ > /usr/freebsd-svn/head/sys/netinet/tcp_var.h:604:39: note: 'tcpstat' > declared here > VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:89:33: note: expanded from macro > 'VNET_PCPUSTAT_DECLARE' > VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)]) > ^ > /usr/freebsd-svn/head/sys/net/vnet.h:399:37: note: expanded from macro > 'VNET_DECLARE' > #define VNET_DECLARE(t, n) extern t n > > On Wed, Jan 27, 2016 at 8:45 AM, Gleb Smirnoff wrote: >> Author: glebius >> Date: Wed Jan 27 00:45:46 2016 >> New Revision: 294869 >> URL: https://svnweb.freebsd.org/changeset/base/294869 >> >> Log: >> Augment struct tcpstat with tcps_states[], which is used for book-keeping >> the amount of TCP connections by state. Provides a cheap way to get >> connection count without traversing the whole pcb list. >> >> Sponsored by: Netflix >> >> Modified: >> head/sys/dev/cxgbe/tom/t4_cpl_io.c >> head/sys/netinet/tcp_offload.c >> head/sys/netinet/tcp_subr.c >> head/sys/netinet/tcp_syncache.c >> head/sys/netinet/tcp_timewait.c >> head/sys/netinet/tcp_usrreq.c >> head/sys/netinet/tcp_var.h >> head/usr.bin/systat/netstat.c >> >> Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c >> ============================================================================== >> --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 27 00:24:24 2016 (r294868) >> +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 27 00:45:46 2016 (r294869) >> @@ -45,10 +45,10 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> #define TCPSTATES >> #include >> #include >> +#include >> #include >> >> #include "common/common.h" >> >> Modified: head/sys/netinet/tcp_offload.c >> ============================================================================== >> --- head/sys/netinet/tcp_offload.c Wed Jan 27 00:24:24 2016 (r294868) >> +++ head/sys/netinet/tcp_offload.c Wed Jan 27 00:45:46 2016 (r294869) >> @@ -42,10 +42,10 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> #include >> #define TCPOUTFLAGS >> #include >> +#include >> #include >> >> int registered_toedevs; >> >> Modified: head/sys/netinet/tcp_subr.c >> ============================================================================== >> --- head/sys/netinet/tcp_subr.c Wed Jan 27 00:24:24 2016 (r294868) >> +++ head/sys/netinet/tcp_subr.c Wed Jan 27 00:45:46 2016 (r294869) >> @@ -1468,6 +1468,7 @@ tcp_close(struct tcpcb *tp) >> #endif >> in_pcbdrop(inp); >> TCPSTAT_INC(tcps_closed); >> + TCPSTAT_DEC(tcps_states[tp->t_state]); >> KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); >> so = inp->inp_socket; >> soisdisconnected(so); >> @@ -2910,6 +2911,8 @@ tcp_state_change(struct tcpcb *tp, int n >> int pstate = tp->t_state; >> #endif >> >> + TCPSTAT_DEC(tcps_states[tp->t_state]); >> + TCPSTAT_INC(tcps_states[newstate]); >> tp->t_state = newstate; >> TCP_PROBE6(state__change, NULL, tp, NULL, tp, NULL, pstate); >> } >> >> Modified: head/sys/netinet/tcp_syncache.c >> ============================================================================== >> --- head/sys/netinet/tcp_syncache.c Wed Jan 27 00:24:24 2016 (r294868) >> +++ head/sys/netinet/tcp_syncache.c Wed Jan 27 00:45:46 2016 (r294869) >> @@ -351,6 +351,7 @@ syncache_insert(struct syncache *sc, str >> >> SCH_UNLOCK(sch); >> >> + TCPSTAT_INC(tcps_states[TCPS_SYN_RECEIVED]); >> TCPSTAT_INC(tcps_sc_added); >> } >> >> @@ -364,6 +365,7 @@ syncache_drop(struct syncache *sc, struc >> >> SCH_LOCK_ASSERT(sch); >> >> + TCPSTAT_DEC(tcps_states[TCPS_SYN_RECEIVED]); >> TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); >> sch->sch_length--; >> >> @@ -992,7 +994,16 @@ syncache_expand(struct in_conninfo *inc, >> goto failed; >> } >> } else { >> - /* Pull out the entry to unlock the bucket row. */ >> + /* >> + * Pull out the entry to unlock the bucket row. >> + * >> + * NOTE: We must decrease TCPS_SYN_RECEIVED count here, not >> + * tcp_state_change(). The tcpcb is not existent at this >> + * moment. A new one will be allocated via syncache_socket-> >> + * sonewconn->tcp_usr_attach in TCPS_CLOSED state, then >> + * syncache_socket() will change it to TCPS_SYN_RECEIVED. >> + */ >> + TCPSTAT_DEC(tcps_states[TCPS_SYN_RECEIVED]); >> TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); >> sch->sch_length--; >> #ifdef TCP_OFFLOAD >> >> Modified: head/sys/netinet/tcp_timewait.c >> ============================================================================== >> --- head/sys/netinet/tcp_timewait.c Wed Jan 27 00:24:24 2016 (r294868) >> +++ head/sys/netinet/tcp_timewait.c Wed Jan 27 00:45:46 2016 (r294869) >> @@ -660,6 +660,7 @@ tcp_tw_2msl_stop(struct tcptw *tw, int r >> >> if (!reuse) >> uma_zfree(V_tcptw_zone, tw); >> + TCPSTAT_DEC(tcps_states[TCPS_TIME_WAIT]); >> } >> >> struct tcptw * >> >> Modified: head/sys/netinet/tcp_usrreq.c >> ============================================================================== >> --- head/sys/netinet/tcp_usrreq.c Wed Jan 27 00:24:24 2016 (r294868) >> +++ head/sys/netinet/tcp_usrreq.c Wed Jan 27 00:45:46 2016 (r294869) >> @@ -1883,6 +1883,7 @@ tcp_attach(struct socket *so) >> tp->t_state = TCPS_CLOSED; >> INP_WUNLOCK(inp); >> INP_INFO_RUNLOCK(&V_tcbinfo); >> + TCPSTAT_INC(tcps_states[TCPS_CLOSED]); >> return (0); >> } >> >> >> Modified: head/sys/netinet/tcp_var.h >> ============================================================================== >> --- head/sys/netinet/tcp_var.h Wed Jan 27 00:24:24 2016 (r294868) >> +++ head/sys/netinet/tcp_var.h Wed Jan 27 00:45:46 2016 (r294869) >> @@ -34,6 +34,7 @@ >> #define _NETINET_TCP_VAR_H_ >> >> #include >> +#include >> >> #ifdef _KERNEL >> #include >> @@ -587,6 +588,9 @@ struct tcpstat { >> uint64_t tcps_sig_err_sigopt; /* No signature expected by socket */ >> uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ >> >> + /* Running connection count. */ >> + uint64_t tcps_states[TCP_NSTATES]; >> + >> uint64_t _pad[12]; /* 6 UTO, 6 TBD */ >> }; >> >> >> Modified: head/usr.bin/systat/netstat.c >> ============================================================================== >> --- head/usr.bin/systat/netstat.c Wed Jan 27 00:24:24 2016 (r294868) >> +++ head/usr.bin/systat/netstat.c Wed Jan 27 00:45:46 2016 (r294869) >> @@ -59,10 +59,10 @@ static const char sccsid[] = "@(#)netsta >> #include >> #include >> #include >> -#include >> #define TCPSTATES >> #include >> #include >> +#include >> #include >> #include >> #include >> > > > > -- > Tomorrow Will Never Die -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Wed Jan 27 03:51:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43D0DA6E7C6; Wed, 27 Jan 2016 03:51:26 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8D3771; Wed, 27 Jan 2016 03:51:25 +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 u0R3pPfQ088414; Wed, 27 Jan 2016 03:51:25 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R3pPh1088413; Wed, 27 Jan 2016 03:51:25 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601270351.u0R3pPh1088413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 27 Jan 2016 03:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294885 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 03:51:26 -0000 Author: jhibbits Date: Wed Jan 27 03:51:24 2016 New Revision: 294885 URL: https://svnweb.freebsd.org/changeset/base/294885 Log: Fix the build post-r294883. Pointy-hat to: jhibbits X-MFC with: r294883 Modified: head/sys/sys/rman.h Modified: head/sys/sys/rman.h ============================================================================== --- head/sys/sys/rman.h Wed Jan 27 02:25:25 2016 (r294884) +++ head/sys/sys/rman.h Wed Jan 27 03:51:24 2016 (r294885) @@ -82,7 +82,7 @@ struct u_rman { char rm_descr[RM_TEXTLEN]; /* rman description */ rman_res_t rm_start; /* base of managed region */ - bus_size_t rm_size; /* size of managed region */ + rman_res_t rm_size; /* size of managed region */ enum rman_type rm_type; /* region type */ }; From owner-svn-src-head@freebsd.org Wed Jan 27 03:53:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AEAFA6E9EB; Wed, 27 Jan 2016 03:53:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19D21B95; Wed, 27 Jan 2016 03:53:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R3rV2n088523; Wed, 27 Jan 2016 03:53:31 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R3rU6J088518; Wed, 27 Jan 2016 03:53:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601270353.u0R3rU6J088518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jan 2016 03:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294886 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 03:53:32 -0000 Author: sephe Date: Wed Jan 27 03:53:30 2016 New Revision: 294886 URL: https://svnweb.freebsd.org/changeset/base/294886 Log: hyperv/vmbus: Event handling code refactor. - Use taskqueue instead of swi for event handling. - Scan the interrupt flags in filter - Disable ringbuffer interrupt mask in filter to ensure no unnecessary interrupts. Submitted by: Jun Su Reviewed by: adrian, sephe, Dexuan Approved by: adrian (mentor) MFC after: 2 weeks Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4920 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Wed Jan 27 03:51:24 2016 (r294885) +++ head/sys/dev/hyperv/include/hyperv.h Wed Jan 27 03:53:30 2016 (r294886) @@ -755,6 +755,8 @@ typedef struct hv_vmbus_channel { struct mtx inbound_lock; + struct taskqueue * rxq; + struct task channel_task; hv_vmbus_pfn_channel_callback on_channel_callback; void* channel_callback_context; Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Wed Jan 27 03:51:24 2016 (r294885) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Wed Jan 27 03:53:30 2016 (r294886) @@ -51,6 +51,7 @@ static int vmbus_channel_create_gpadl_h uint32_t* message_count); static void vmbus_channel_set_event(hv_vmbus_channel* channel); +static void VmbusProcessChannelEvent(void* channel, int pending); /** * @brief Trigger an event notification on the specified channel @@ -114,6 +115,9 @@ hv_vmbus_channel_open( new_channel->on_channel_callback = pfn_on_channel_callback; new_channel->channel_callback_context = context; + new_channel->rxq = hv_vmbus_g_context.hv_event_queue[new_channel->target_cpu]; + TASK_INIT(&new_channel->channel_task, 0, VmbusProcessChannelEvent, new_channel); + /* Allocate the ring buffer */ out = contigmalloc((send_ring_buffer_size + recv_ring_buffer_size), M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); @@ -517,6 +521,7 @@ static void hv_vmbus_channel_close_internal(hv_vmbus_channel *channel) { int ret = 0; + struct taskqueue *rxq = channel->rxq; hv_vmbus_channel_close_channel* msg; hv_vmbus_channel_msg_info* info; @@ -524,6 +529,11 @@ hv_vmbus_channel_close_internal(hv_vmbus channel->sc_creation_callback = NULL; /* + * set rxq to NULL to avoid more requests be scheduled + */ + channel->rxq = NULL; + taskqueue_drain(rxq, &channel->channel_task); + /* * Grab the lock to prevent race condition when a packet received * and unloading driver is in the process. */ @@ -876,3 +886,67 @@ hv_vmbus_channel_recv_packet_raw( return (0); } + + +/** + * Process a channel event notification + */ +static void +VmbusProcessChannelEvent(void* context, int pending) +{ + void* arg; + uint32_t bytes_to_read; + hv_vmbus_channel* channel = (hv_vmbus_channel*)context; + boolean_t is_batched_reading; + + /** + * Find the channel based on this relid and invokes + * the channel callback to process the event + */ + + if (channel == NULL) { + return; + } + /** + * To deal with the race condition where we might + * receive a packet while the relevant driver is + * being unloaded, dispatch the callback while + * holding the channel lock. The unloading driver + * will acquire the same channel lock to set the + * callback to NULL. This closes the window. + */ + + /* + * Disable the lock due to newly added WITNESS check in r277723. + * Will seek other way to avoid race condition. + * -- whu + */ + // mtx_lock(&channel->inbound_lock); + if (channel->on_channel_callback != NULL) { + arg = channel->channel_callback_context; + is_batched_reading = channel->batched_reading; + /* + * Optimize host to guest signaling by ensuring: + * 1. While reading the channel, we disable interrupts from + * host. + * 2. Ensure that we process all posted messages from the host + * before returning from this callback. + * 3. Once we return, enable signaling from the host. Once this + * state is set we check to see if additional packets are + * available to read. In this case we repeat the process. + */ + do { + if (is_batched_reading) + hv_ring_buffer_read_begin(&channel->inbound); + + channel->on_channel_callback(arg); + + if (is_batched_reading) + bytes_to_read = + hv_ring_buffer_read_end(&channel->inbound); + else + bytes_to_read = 0; + } while (is_batched_reading && (bytes_to_read != 0)); + } + // mtx_unlock(&channel->inbound_lock); +} Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed Jan 27 03:51:24 2016 (r294885) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed Jan 27 03:53:30 2016 (r294886) @@ -335,78 +335,12 @@ hv_vmbus_disconnect(void) { } /** - * Process a channel event notification - */ -static void -VmbusProcessChannelEvent(uint32_t relid) -{ - void* arg; - uint32_t bytes_to_read; - hv_vmbus_channel* channel; - boolean_t is_batched_reading; - - /** - * Find the channel based on this relid and invokes - * the channel callback to process the event - */ - - channel = hv_vmbus_g_connection.channels[relid]; - - if (channel == NULL) { - return; - } - /** - * To deal with the race condition where we might - * receive a packet while the relevant driver is - * being unloaded, dispatch the callback while - * holding the channel lock. The unloading driver - * will acquire the same channel lock to set the - * callback to NULL. This closes the window. - */ - - /* - * Disable the lock due to newly added WITNESS check in r277723. - * Will seek other way to avoid race condition. - * -- whu - */ - // mtx_lock(&channel->inbound_lock); - if (channel->on_channel_callback != NULL) { - arg = channel->channel_callback_context; - is_batched_reading = channel->batched_reading; - /* - * Optimize host to guest signaling by ensuring: - * 1. While reading the channel, we disable interrupts from - * host. - * 2. Ensure that we process all posted messages from the host - * before returning from this callback. - * 3. Once we return, enable signaling from the host. Once this - * state is set we check to see if additional packets are - * available to read. In this case we repeat the process. - */ - do { - if (is_batched_reading) - hv_ring_buffer_read_begin(&channel->inbound); - - channel->on_channel_callback(arg); - - if (is_batched_reading) - bytes_to_read = - hv_ring_buffer_read_end(&channel->inbound); - else - bytes_to_read = 0; - } while (is_batched_reading && (bytes_to_read != 0)); - } - // mtx_unlock(&channel->inbound_lock); -} - -/** * Handler for events */ void -hv_vmbus_on_events(void *arg) +hv_vmbus_on_events(int cpu) { int bit; - int cpu; int dword; void *page_addr; uint32_t* recv_interrupt_page = NULL; @@ -415,7 +349,6 @@ hv_vmbus_on_events(void *arg) hv_vmbus_synic_event_flags *event; /* int maxdword = PAGE_SIZE >> 3; */ - cpu = (int)(long)arg; KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " "cpu out of range!")); @@ -457,8 +390,14 @@ hv_vmbus_on_events(void *arg) */ continue; } else { - VmbusProcessChannelEvent(rel_id); - + hv_vmbus_channel * channel = hv_vmbus_g_connection.channels[rel_id]; + /* if channel is closed or closing */ + if (channel == NULL || channel->rxq == NULL) + continue; + + if (channel->batched_reading) + hv_ring_buffer_read_begin(&channel->inbound); + taskqueue_enqueue_fast(channel->rxq, &channel->channel_task); } } } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jan 27 03:51:24 2016 (r294885) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jan 27 03:53:30 2016 (r294886) @@ -177,7 +177,7 @@ hv_vmbus_isr(struct trapframe *frame) (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { /* Since we are a child, we only need to check bit 0 */ if (synch_test_and_clear_bit(0, &event->flags32[0])) { - swi_sched(hv_vmbus_g_context.event_swintr[cpu], 0); + hv_vmbus_on_events(cpu); } } else { /* @@ -187,7 +187,7 @@ hv_vmbus_isr(struct trapframe *frame) * Directly schedule the event software interrupt on * current cpu. */ - swi_sched(hv_vmbus_g_context.event_swintr[cpu], 0); + hv_vmbus_on_events(cpu); } /* Check if there are actual msgs to be process */ @@ -225,7 +225,6 @@ hv_vmbus_isr(struct trapframe *frame) return (FILTER_HANDLED); } -uint32_t hv_vmbus_swintr_event_cpu[MAXCPU]; u_long *hv_vmbus_intr_cpu[MAXCPU]; void @@ -472,6 +471,7 @@ vmbus_bus_init(void) { int i, j, n, ret; char buf[MAXCOMLEN + 1]; + cpuset_t cpu_mask; if (vmbus_inited) return (0); @@ -508,10 +508,7 @@ vmbus_bus_init(void) setup_args.vector = hv_vmbus_g_context.hv_cb_vector; CPU_FOREACH(j) { - hv_vmbus_swintr_event_cpu[j] = 0; - hv_vmbus_g_context.hv_event_intr_event[j] = NULL; hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; - hv_vmbus_g_context.event_swintr[j] = NULL; hv_vmbus_g_context.msg_swintr[j] = NULL; snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); @@ -526,6 +523,20 @@ vmbus_bus_init(void) */ CPU_FOREACH(j) { /* + * Setup taskqueue to handle events + */ + hv_vmbus_g_context.hv_event_queue[j] = taskqueue_create_fast("hyperv event", M_WAITOK, + taskqueue_thread_enqueue, &hv_vmbus_g_context.hv_event_queue[j]); + if (hv_vmbus_g_context.hv_event_queue[j] == NULL) { + if (bootverbose) + printf("VMBUS: failed to setup taskqueue\n"); + goto cleanup1; + } + CPU_SETOF(j, &cpu_mask); + taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_event_queue[j], 1, PI_NET, &cpu_mask, + "hvevent%d", j); + + /* * Setup software interrupt thread and handler for msg handling. */ ret = swi_add(&hv_vmbus_g_context.hv_msg_intr_event[j], @@ -543,7 +554,7 @@ vmbus_bus_init(void) */ ret = intr_event_bind(hv_vmbus_g_context.hv_msg_intr_event[j], j); - if (ret) { + if (ret) { if(bootverbose) printf("VMBUS: failed to bind msg swi thread " "to cpu %d\n", j); @@ -551,20 +562,6 @@ vmbus_bus_init(void) } /* - * Setup software interrupt thread and handler for - * event handling. - */ - ret = swi_add(&hv_vmbus_g_context.hv_event_intr_event[j], - "hv_event", hv_vmbus_on_events, (void *)(long)j, - SWI_CLOCK, 0, &hv_vmbus_g_context.event_swintr[j]); - if (ret) { - if(bootverbose) - printf("VMBUS: failed to setup event swi for " - "cpu %d\n", j); - goto cleanup1; - } - - /* * Prepare the per cpu msg and event pages to be called on each cpu. */ for(i = 0; i < 2; i++) { @@ -607,12 +604,11 @@ vmbus_bus_init(void) * remove swi and vmbus callback vector; */ CPU_FOREACH(j) { + if (hv_vmbus_g_context.hv_event_queue[j] != NULL) + taskqueue_free(hv_vmbus_g_context.hv_event_queue[j]); if (hv_vmbus_g_context.msg_swintr[j] != NULL) swi_remove(hv_vmbus_g_context.msg_swintr[j]); - if (hv_vmbus_g_context.event_swintr[j] != NULL) - swi_remove(hv_vmbus_g_context.event_swintr[j]); hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; - hv_vmbus_g_context.hv_event_intr_event[j] = NULL; } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); @@ -677,12 +673,11 @@ vmbus_bus_exit(void) /* remove swi */ CPU_FOREACH(i) { + if (hv_vmbus_g_context.hv_event_queue[i] != NULL) + taskqueue_free(hv_vmbus_g_context.hv_event_queue[i]); if (hv_vmbus_g_context.msg_swintr[i] != NULL) swi_remove(hv_vmbus_g_context.msg_swintr[i]); - if (hv_vmbus_g_context.event_swintr[i] != NULL) - swi_remove(hv_vmbus_g_context.event_swintr[i]); hv_vmbus_g_context.hv_msg_intr_event[i] = NULL; - hv_vmbus_g_context.hv_event_intr_event[i] = NULL; } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jan 27 03:51:24 2016 (r294885) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jan 27 03:53:30 2016 (r294886) @@ -202,9 +202,8 @@ typedef struct { * Each cpu has its own software interrupt handler for channel * event and msg handling. */ - struct intr_event *hv_event_intr_event[MAXCPU]; + struct taskqueue *hv_event_queue[MAXCPU]; struct intr_event *hv_msg_intr_event[MAXCPU]; - void *event_swintr[MAXCPU]; void *msg_swintr[MAXCPU]; /* * Host use this vector to intrrupt guest for vmbus channel @@ -717,7 +716,7 @@ int hv_vmbus_connect(void); int hv_vmbus_disconnect(void); int hv_vmbus_post_message(void *buffer, size_t buf_size); int hv_vmbus_set_event(hv_vmbus_channel *channel); -void hv_vmbus_on_events(void *); +void hv_vmbus_on_events(int cpu); /** * Event Timer interfaces From owner-svn-src-head@freebsd.org Wed Jan 27 04:59:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C0AFA6FE7B; Wed, 27 Jan 2016 04:59:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4AAC67CF; Wed, 27 Jan 2016 04:59:29 +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 u0R4xSCE007240; Wed, 27 Jan 2016 04:59:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R4xSkX007238; Wed, 27 Jan 2016 04:59:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601270459.u0R4xSkX007238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 27 Jan 2016 04:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294887 - head/sys/dev/cxgb/ulp/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 04:59:29 -0000 Author: glebius Date: Wed Jan 27 04:59:28 2016 New Revision: 294887 URL: https://svnweb.freebsd.org/changeset/base/294887 Log: Fix build on i386. I can't yet understand why does it build on amd64. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Jan 27 03:53:30 2016 (r294886) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Jan 27 04:59:28 2016 (r294887) @@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #define TCPSTATES #include +#include #include #include #include From owner-svn-src-head@freebsd.org Wed Jan 27 05:15:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CBCFA6E44E; Wed, 27 Jan 2016 05:15:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4FE87F85; Wed, 27 Jan 2016 05:15:55 +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 u0R5FsJr012922; Wed, 27 Jan 2016 05:15:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R5FsoP012917; Wed, 27 Jan 2016 05:15:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601270515.u0R5FsoP012917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 27 Jan 2016 05:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294889 - in head/sys/dev: cxgb/ulp/tom cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 05:15:55 -0000 Author: glebius Date: Wed Jan 27 05:15:53 2016 New Revision: 294889 URL: https://svnweb.freebsd.org/changeset/base/294889 Log: More fixes to the build. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Wed Jan 27 05:04:17 2016 (r294888) +++ head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Wed Jan 27 05:15:53 2016 (r294889) @@ -44,9 +44,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #define TCPSTATES #include +#include #include #include "cxgb_include.h" Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Wed Jan 27 05:04:17 2016 (r294888) +++ head/sys/dev/cxgbe/tom/t4_connect.c Wed Jan 27 05:15:53 2016 (r294889) @@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #define TCPSTATES #include +#include #include #include "common/common.h" Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Jan 27 05:04:17 2016 (r294888) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Jan 27 05:15:53 2016 (r294889) @@ -56,9 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #define TCPSTATES #include +#include #include #include "common/common.h" Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Wed Jan 27 05:04:17 2016 (r294888) +++ head/sys/dev/cxgbe/tom/t4_tom.c Wed Jan 27 05:15:53 2016 (r294889) @@ -52,10 +52,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #define TCPSTATES #include +#include #include #ifdef TCP_OFFLOAD From owner-svn-src-head@freebsd.org Wed Jan 27 05:37:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EACECA6EBB0; Wed, 27 Jan 2016 05:37:58 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5A3E199B; Wed, 27 Jan 2016 05:37:58 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-io0-x236.google.com with SMTP id f81so8191653iof.0; Tue, 26 Jan 2016 21:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Y3i+YwtyEozYmh5KUc14q7GkFc5KKdUm/Io1rt5uLPQ=; b=TFJSogZ3ZhjCB9ieiqcTkAQ8uBp3rIowK0KSubdhkimY7HyVPXqx3WpDV8jQ8DUICH 7tls8nuU4tgq1gHztyYq+YfUMDAo1v49sHRYAkdev+/i8yIwqOAfYJL17gZH3JFtal3/ IXS+rF8QXYPFyEXf4zIGT+MBPp8aNFP95PATz69KBTLS7UqBHd6uFLhu5PDDPBeUo3n7 +6BQfjikSdZDJ4PjEjAimBrKTDdpIpHbWFEotGTl5Hd3shTnCJtTDjr6QxpKyETOKUqA WItzisC6tGYKcV1snt1GcOjWljIvXHV69GvbyARIo57cB6nnpZaZd51RtqRZBxlkmcp5 F8lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Y3i+YwtyEozYmh5KUc14q7GkFc5KKdUm/Io1rt5uLPQ=; b=j5MXq2r/MXxhusZR1x3aFeygAu0O8cTdeoTP2zVl9rKTgcTXoJpQKZiARJEinkO9eJ hjTZmH+oDNB1WPFiKrqAPhT4mit0TtY1wV3abSJjVcsQOmAxJjE9ck35iYAh0q/hRbyO zGACd11+x+0JvX00zNxnJ5Vx9HHH2lLwwnyXsBPQ6Gt5jdxpjoIQSkXfbvygo2g849cY Ys/4me4EOBNm8OV+rDOf94j9LdgVryEmjAG2ZuYSeYgoIgj/gEso4sx8pe0eUsFMpLQ/ yM+SA3Xy0t5nQMTl2D54cFhMp3aSqDyCIAB95LS5idmtr5BuUbgOrzZOHhLQNiiEyvnV F84g== X-Gm-Message-State: AG10YOT1Z25azWA/9TSqtEtaW8r2/Fbm2JwPyT2+oHIVfjBHWi37Q6DxYkpw0Bsag2nbm5W89HcRL+mDZKNpyA== MIME-Version: 1.0 X-Received: by 10.107.32.2 with SMTP id g2mr24263993iog.39.1453873078219; Tue, 26 Jan 2016 21:37:58 -0800 (PST) Received: by 10.107.166.3 with HTTP; Tue, 26 Jan 2016 21:37:58 -0800 (PST) In-Reply-To: <201601270515.u0R5FsoP012917@repo.freebsd.org> References: <201601270515.u0R5FsoP012917@repo.freebsd.org> Date: Wed, 27 Jan 2016 13:37:58 +0800 Message-ID: Subject: Re: svn commit: r294889 - in head/sys/dev: cxgb/ulp/tom cxgbe/tom From: Sepherosa Ziehau To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 05:37:59 -0000 Thanks! On Wed, Jan 27, 2016 at 1:15 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Jan 27 05:15:53 2016 > New Revision: 294889 > URL: https://svnweb.freebsd.org/changeset/base/294889 > > Log: > More fixes to the build. > > Modified: > head/sys/dev/cxgb/ulp/tom/cxgb_listen.c > head/sys/dev/cxgbe/tom/t4_connect.c > head/sys/dev/cxgbe/tom/t4_listen.c > head/sys/dev/cxgbe/tom/t4_tom.c > > Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c > ============================================================================== > --- head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Wed Jan 27 05:04:17 2016 (r294888) > +++ head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Wed Jan 27 05:15:53 2016 (r294889) > @@ -44,9 +44,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #define TCPSTATES > #include > +#include > #include > > #include "cxgb_include.h" > > Modified: head/sys/dev/cxgbe/tom/t4_connect.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_connect.c Wed Jan 27 05:04:17 2016 (r294888) > +++ head/sys/dev/cxgbe/tom/t4_connect.c Wed Jan 27 05:15:53 2016 (r294889) > @@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #define TCPSTATES > #include > +#include > #include > > #include "common/common.h" > > Modified: head/sys/dev/cxgbe/tom/t4_listen.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Jan 27 05:04:17 2016 (r294888) > +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Jan 27 05:15:53 2016 (r294889) > @@ -56,9 +56,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #define TCPSTATES > #include > +#include > #include > > #include "common/common.h" > > Modified: head/sys/dev/cxgbe/tom/t4_tom.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_tom.c Wed Jan 27 05:04:17 2016 (r294888) > +++ head/sys/dev/cxgbe/tom/t4_tom.c Wed Jan 27 05:15:53 2016 (r294889) > @@ -52,10 +52,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #define TCPSTATES > #include > +#include > #include > > #ifdef TCP_OFFLOAD > _______________________________________________ > 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" -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Wed Jan 27 06:12:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 678F1A6F4A7; Wed, 27 Jan 2016 06:12:24 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) (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 2DAAE869; Wed, 27 Jan 2016 06:12:23 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id F0EAD7E820; Wed, 27 Jan 2016 17:12:20 +1100 (EST) Subject: Re: svn commit: r294535 - in head/sys/netinet: . cc tcp_stacks To: Gleb Smirnoff References: <201601212234.u0LMYpKT009948@repo.freebsd.org> <56A1D6B2.1010406@freebsd.org> <20160122181816.GB1004@FreeBSD.org> <56A31B78.2090100@freebsd.org> <20160124080720.GE1004@FreeBSD.org> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Lawrence Stewart X-Enigmail-Draft-Status: N1110 Message-ID: <56A85FA3.50403@freebsd.org> Date: Wed, 27 Jan 2016 17:11:47 +1100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20160124080720.GE1004@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 06:12:24 -0000 On 01/24/16 19:07, Gleb Smirnoff wrote: > Lawrence, > > On Sat, Jan 23, 2016 at 05:19:36PM +1100, Lawrence Stewart wrote: > L> > The problem is that cc.h (or tcp_cc.h) is already depening on many > L> > TCP types. So, the structures defined inside are not agnostic, including > L> > tcp headers before cc.h is required. > L> > L> Not in any significant way that tightly couples the API to TCP from > L> consumers' perspective. > L> > L> > The old cc.h used to include tcp.h implicitly, which is a bad style. > L> > > L> > Since many developers sorted netinet/* includes in a .c file using > L> > sort(1), that lead to cc.h always come before actual tcp includes, > L> > hiding the real requirement for tcp.h in a .c file. > L> > L> To provide some more context, I considered that choice to be a lesser > L> evil at the time. Linux had set the defacto standard macro naming and > L> location so even though I would have put the CC related defines in cc.h > L> given the choice, I wanted third-party software which checked for > L> modular CC the Linux way to work on FreeBSD. The alphabetical ordering > L> of includes is what prompted me to include tcp.h in cc.h so that cc.h > L> could happily sit at the top of the list. I probably could have just > L> moved cc.h to the cc subdir, in which case it would always come > L> logically after the TCP includes as - perhaps that's > L> the right solution. > > Well, if the intent was to provide some sort of compatibility with Linux, > then my rename is even more valid! Look what left in the cc.h in the > Netflix source (which is kinda forward of FreeBSD): almost the whole > file is under _KERNEL. Only the tcp.h pollution left for userland. > > If Linux has cc.h and we want to put same definitions in cc.h, then > we should start new cc.h and keep this one renamed. Because if we > provided that one, we won't provide any compatibility, but would > just pollute with tcp.h. They do not have cc.h, they stuffed things into tcp.h. When I say I was trying to keep compat with Linux, I meant that I wanted to leave TCP_CA_NAME_MAX in tcp.h rather than move it to cc.h where it logically belongs and is required. This has no bearing on the naming of our cc.h file, but is the reason why I included tcp.h in cc.h, bad as that may be. > I am fine with netinet/cc/cc.h. If you agree I can run the rename. I think this is the right option. Please go ahead and move tcp_cc.h to netinet/cc/cc.h and update ifdef guard, src includes and man page accordingly. Cheers, Lawrence From owner-svn-src-head@freebsd.org Wed Jan 27 06:14:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA3EBA6F535; Wed, 27 Jan 2016 06:14:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC1BD9EE; Wed, 27 Jan 2016 06:14:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R6EKFY030176; Wed, 27 Jan 2016 06:14:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R6EKQk030175; Wed, 27 Jan 2016 06:14:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601270614.u0R6EKQk030175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 27 Jan 2016 06:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294891 - head/usr.sbin/makefs/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 06:14:22 -0000 Author: ngie Date: Wed Jan 27 06:14:20 2016 New Revision: 294891 URL: https://svnweb.freebsd.org/changeset/base/294891 Log: Require /sbin/mount_cd9660 when running the cd9660 tests In some cases the test system might not have mount_cd9660(8). Don't implicitly rely on it while testing cd9660 support; explicitly rely on it MFC after: 1 week Reported by: mjohnston Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/makefs/tests/Makefile Modified: head/usr.sbin/makefs/tests/Makefile ============================================================================== --- head/usr.sbin/makefs/tests/Makefile Wed Jan 27 05:19:05 2016 (r294890) +++ head/usr.sbin/makefs/tests/Makefile Wed Jan 27 06:14:20 2016 (r294891) @@ -8,6 +8,8 @@ BINDIR= ${TESTSDIR} SCRIPTS+= makefs_tests_common.sh SCRIPTSNAME_makefs_tests_common.sh= makefs_tests_common.sh +TEST_METADATA.makefs_cd9660_tests+= required_files="/sbin/mount_cd9660" + .for t in ${ATF_TESTS_SH} TEST_METADATA.$t+= required_user="root" .endfor From owner-svn-src-head@freebsd.org Wed Jan 27 06:16:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6050A6F5B6; Wed, 27 Jan 2016 06:16:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id A5DA3B8D; Wed, 27 Jan 2016 06:16:54 +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 u0R6GrFG030297; Wed, 27 Jan 2016 06:16:53 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R6GrsD030296; Wed, 27 Jan 2016 06:16:53 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270616.u0R6GrsD030296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 06:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294892 - head/lib/libdpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 06:16:54 -0000 Author: dteske Date: Wed Jan 27 06:16:53 2016 New Revision: 294892 URL: https://svnweb.freebsd.org/changeset/base/294892 Log: Remove unused function prototype MFC after: 3 days X-MFC-to: stable/10 Modified: head/lib/libdpv/dialog_util.h Modified: head/lib/libdpv/dialog_util.h ============================================================================== --- head/lib/libdpv/dialog_util.h Wed Jan 27 06:14:20 2016 (r294891) +++ head/lib/libdpv/dialog_util.h Wed Jan 27 06:16:53 2016 (r294892) @@ -55,7 +55,6 @@ extern int dheight, dwidth; __BEGIN_DECLS uint8_t dialog_prompt_nlstate(const char *_prompt); -void dialog_gauge_free(void); void dialog_maxsize_free(void); char *dialog_prompt_lastline(char *_prompt, uint8_t _nlstate); int dialog_maxcols(void); From owner-svn-src-head@freebsd.org Wed Jan 27 06:21:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D253EA6F799; Wed, 27 Jan 2016 06:21:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id A2C0FF47; Wed, 27 Jan 2016 06:21:36 +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 u0R6LZOD030495; Wed, 27 Jan 2016 06:21:35 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R6LZPd030494; Wed, 27 Jan 2016 06:21:35 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270621.u0R6LZPd030494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 06:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294893 - head/lib/libdpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 06:21:36 -0000 Author: dteske Date: Wed Jan 27 06:21:35 2016 New Revision: 294893 URL: https://svnweb.freebsd.org/changeset/base/294893 Log: Fix a crash if `-D' is used without `-t title' dialog(3)'s dlg_reallocate_gauge(), used both by dialog(3)'s dialog_gauge() and dialog(1)'s `--gauge', will segmentation fault in strlen(3) if no title is set for the widget. Reproducible with `dialog --gauge hi 6 20' (adding `--title ""' is enough to prevent segmentation fault). MFC after: 3 days X-MFC-to: stable/10 Modified: head/lib/libdpv/dialog_util.c Modified: head/lib/libdpv/dialog_util.c ============================================================================== --- head/lib/libdpv/dialog_util.c Wed Jan 27 06:16:53 2016 (r294892) +++ head/lib/libdpv/dialog_util.c Wed Jan 27 06:21:35 2016 (r294893) @@ -261,6 +261,13 @@ dialog_spawn_gauge(char *init_prompt, pi errx(EXIT_FAILURE, "Out of memory?!"); sprintf(dargv[n++], "--title"); dargv[n++] = title; + } else { + if ((dargv[n] = malloc(8)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + sprintf(dargv[n++], "--title"); + if ((dargv[n] = malloc(8)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + sprintf(dargv[n++], ""); } if (backtitle != NULL) { if ((dargv[n] = malloc(12)) == NULL) From owner-svn-src-head@freebsd.org Wed Jan 27 06:24:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 090DAA6F932; Wed, 27 Jan 2016 06:24:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D730912E5; Wed, 27 Jan 2016 06:24:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R6OJ79033209; Wed, 27 Jan 2016 06:24:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R6OJxf033208; Wed, 27 Jan 2016 06:24:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601270624.u0R6OJxf033208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 27 Jan 2016 06:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294894 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 06:24:21 -0000 Author: ngie Date: Wed Jan 27 06:24:19 2016 New Revision: 294894 URL: https://svnweb.freebsd.org/changeset/base/294894 Log: Adjust vm.max_wired in order to avoid hitting EAGAIN artificially Set vm.max_wired to INT_MAX in :mlock_err, :mlock_mmap, and :mlock_nested to avoid hitting EAGAIN artificially on the system when running the tests Require root privileges in order to set the sysctl Add allow_sysctl_side_effects to require.config as this test is now adjusting sysctls that can affect the global system state Unlike the version submitted by cem in OneFS, this version uses a scratch file to save/restore the previous value of the sysctl. I _really_, _really_ wish there were better hooks in atf/kyua for per test suite setup/teardown -- using a file is kludgy, but it's the best I can do to avoid situations where (for instance), sysctl(3) may fail and drop a core outside the kyua sandbox. Based on a patch submitted by cem, but modified to take business logic out of ATF_TP_ADD_TCS(3). Differential Revision: https://reviews.freebsd.org/D4779 MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Wed Jan 27 06:21:35 2016 (r294893) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Wed Jan 27 06:24:19 2016 (r294894) @@ -47,12 +47,89 @@ __RCSID("$NetBSD: t_mlock.c,v 1.5 2014/0 #include #ifdef __FreeBSD__ +#include #define _KMEMUSER #include #endif static long page = 0; +#ifdef __FreeBSD__ +#define VM_MAX_WIRED "vm.max_wired" + +static void +vm_max_wired_sysctl(int *old_value, int *new_value) +{ + size_t old_len; + size_t new_len = (new_value == NULL ? 0 : sizeof(int)); + + if (old_value == NULL) + printf("Setting the new value to %d\n", *new_value); + else { + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, + new_value, new_len) == 0, + "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); + } + + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len, + new_value, new_len) == 0, + "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); + + if (old_value != NULL) + printf("Saved the old value (%d)\n", *old_value); +} + +static void +set_vm_max_wired(int new_value) +{ + FILE *fp; + int old_value; + + fp = fopen(VM_MAX_WIRED, "w"); + if (fp == NULL) { + atf_tc_skip("could not open %s for writing: %s", + VM_MAX_WIRED, strerror(errno)); + return; + } + + vm_max_wired_sysctl(&old_value, NULL); + + ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, + "saving %s failed", VM_MAX_WIRED); + + fclose(fp); + + vm_max_wired_sysctl(NULL, &new_value); +} + +static void +restore_vm_max_wired(void) +{ + FILE *fp; + int saved_max_wired; + + fp = fopen(VM_MAX_WIRED, "r"); + if (fp == NULL) { + perror("fopen failed\n"); + return; + } + + if (fscanf(fp, "%d", &saved_max_wired) != 1) { + perror("fscanf failed\n"); + fclose(fp); + return; + } + + fclose(fp); + printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); + + if (saved_max_wired == 0) /* This will cripple the test host */ + return; + + vm_max_wired_sysctl(NULL, &saved_max_wired); +} +#endif + ATF_TC(mlock_clip); ATF_TC_HEAD(mlock_clip, tc) { @@ -78,11 +155,19 @@ ATF_TC_BODY(mlock_clip, tc) free(buf); } +#ifdef __FreeBSD__ +ATF_TC_WITH_CLEANUP(mlock_err); +#else ATF_TC(mlock_err); +#endif ATF_TC_HEAD(mlock_err, tc) { atf_tc_set_md_var(tc, "descr", "Test error conditions in mlock(2) and munlock(2)"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(mlock_err, tc) @@ -99,6 +184,8 @@ ATF_TC_BODY(mlock_err, tc) if ((uintptr_t)VM_MIN_ADDRESS > 0) null_errno = EINVAL; /* NULL is not inside user VM */ #endif + /* Set max_wired really really high to avoid EAGAIN */ + set_vm_max_wired(INT_MAX); #else if (sysctlbyname("vm.minaddress", &vmin, &len, NULL, 0) != 0) atf_tc_fail("failed to read vm.minaddress"); @@ -139,6 +226,14 @@ ATF_TC_BODY(mlock_err, tc) ATF_REQUIRE_ERRNO(ENOMEM, munlock(invalid_ptr, page) == -1); } +#ifdef __FreeBSD__ +ATF_TC_CLEANUP(mlock_err, tc) +{ + + restore_vm_max_wired(); +} +#endif + ATF_TC(mlock_limits); ATF_TC_HEAD(mlock_limits, tc) { @@ -200,10 +295,18 @@ ATF_TC_BODY(mlock_limits, tc) free(buf); } +#ifdef __FreeBSD__ +ATF_TC_WITH_CLEANUP(mlock_mmap); +#else ATF_TC(mlock_mmap); +#endif ATF_TC_HEAD(mlock_mmap, tc) { atf_tc_set_md_var(tc, "descr", "Test mlock(2)-mmap(2) interaction"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(mlock_mmap, tc) @@ -215,6 +318,11 @@ ATF_TC_BODY(mlock_mmap, tc) #endif void *buf; +#ifdef __FreeBSD__ + /* Set max_wired really really high to avoid EAGAIN */ + set_vm_max_wired(INT_MAX); +#endif + /* * Make a wired RW mapping and check that mlock(2) * does not fail for the (already locked) mapping. @@ -248,11 +356,27 @@ ATF_TC_BODY(mlock_mmap, tc) ATF_REQUIRE(munmap(buf, page) == 0); } +#ifdef __FreeBSD__ +ATF_TC_CLEANUP(mlock_mmap, tc) +{ + + restore_vm_max_wired(); +} +#endif + +#ifdef __FreeBSD__ +ATF_TC_WITH_CLEANUP(mlock_nested); +#else ATF_TC(mlock_nested); +#endif ATF_TC_HEAD(mlock_nested, tc) { atf_tc_set_md_var(tc, "descr", "Test that consecutive mlock(2) calls succeed"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(mlock_nested, tc) @@ -260,6 +384,11 @@ ATF_TC_BODY(mlock_nested, tc) const size_t maxiter = 100; void *buf; +#ifdef __FreeBSD__ + /* Set max_wired really really high to avoid EAGAIN */ + set_vm_max_wired(INT_MAX); +#endif + buf = malloc(page); ATF_REQUIRE(buf != NULL); @@ -270,6 +399,14 @@ ATF_TC_BODY(mlock_nested, tc) free(buf); } +#ifdef __FreeBSD__ +ATF_TC_CLEANUP(mlock_nested, tc) +{ + + restore_vm_max_wired(); +} +#endif + ATF_TP_ADD_TCS(tp) { From owner-svn-src-head@freebsd.org Wed Jan 27 06:28:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CCFAA6FA81; Wed, 27 Jan 2016 06:28:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29BD41730; Wed, 27 Jan 2016 06:28:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R6Sve4033463; Wed, 27 Jan 2016 06:28:57 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R6Sv4A033461; Wed, 27 Jan 2016 06:28:57 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601270628.u0R6Sv4A033461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 27 Jan 2016 06:28:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294896 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 06:28:58 -0000 Author: araujo Date: Wed Jan 27 06:28:56 2016 New Revision: 294896 URL: https://svnweb.freebsd.org/changeset/base/294896 Log: Fix regression introduced on r293801. The UID/GID 93 is in using by jaber on PORTS, we will use UID/GID 160 for ypldap(8). Reported by: antoine Approved by: bapt (mentor) Differential Revision: https://reviews.freebsd.org/D5062 Modified: head/etc/group head/etc/master.passwd Modified: head/etc/group ============================================================================== --- head/etc/group Wed Jan 27 06:25:59 2016 (r294895) +++ head/etc/group Wed Jan 27 06:28:56 2016 (r294896) @@ -29,6 +29,7 @@ dialer:*:68: network:*:69: audit:*:77: www:*:80: +_ypldap:*:160: hast:*:845: nogroup:*:65533: nobody:*:65534: Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Wed Jan 27 06:25:59 2016 (r294895) +++ head/etc/master.passwd Wed Jan 27 06:28:56 2016 (r294896) @@ -22,6 +22,6 @@ uucp:*:66:66::0:0:UUCP pseudo-user:/var/ pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin -_ypldap:*:93:93::0:0:YP Ldap unprivileged user:/var/empty:/usr/sbin/nologin +_ypldap:*:160:160::0:0:YP Ldap unprivileged user:/var/empty:/usr/sbin/nologin hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin From owner-svn-src-head@freebsd.org Wed Jan 27 07:06:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10375A6E878; Wed, 27 Jan 2016 07:06:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCA001CFD; Wed, 27 Jan 2016 07:06:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R76nFk045176; Wed, 27 Jan 2016 07:06:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R76nHu045175; Wed, 27 Jan 2016 07:06:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601270706.u0R76nHu045175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 27 Jan 2016 07:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294899 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 07:06:51 -0000 Author: ngie Date: Wed Jan 27 07:06:49 2016 New Revision: 294899 URL: https://svnweb.freebsd.org/changeset/base/294899 Log: Add debug output via ATF_REQUIRE_MSG when the first call to mlock(2) fails This helps identify the problem with running this test on my VM hosts (ENOMEM) MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Wed Jan 27 06:38:03 2016 (r294898) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Wed Jan 27 07:06:49 2016 (r294899) @@ -206,7 +206,8 @@ ATF_TC_BODY(mincore_resid, tc) "might be low on memory"); #ifdef __FreeBSD__ - ATF_REQUIRE(mlock(addr, npgs * page) == 0); + ATF_REQUIRE_MSG(mlock(addr, npgs * page) == 0, "mlock failed: %s", + strerror(errno)); #endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); ATF_REQUIRE(munmap(addr, npgs * page) == 0); From owner-svn-src-head@freebsd.org Wed Jan 27 07:20:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97071A6EF15; Wed, 27 Jan 2016 07:20:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6FCD01515; Wed, 27 Jan 2016 07:20:57 +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 u0R7KuPP048378; Wed, 27 Jan 2016 07:20:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R7KuA5048375; Wed, 27 Jan 2016 07:20:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601270720.u0R7KuA5048375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 27 Jan 2016 07:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294900 - in head/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 07:20:57 -0000 Author: delphij Date: Wed Jan 27 07:20:55 2016 New Revision: 294900 URL: https://svnweb.freebsd.org/changeset/base/294900 Log: Implement AT_SECURE properly. AT_SECURE auxv entry has been added to the Linux 2.5 kernel to pass a boolean flag indicating whether secure mode should be enabled. 1 means that the program has changes its credentials during the execution. Being exported AT_SECURE used by glibc issetugid() call. Submitted by: imp, dchagin Security: FreeBSD-SA-16:10.linux Security: CVE-2016-1883 Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Wed Jan 27 07:06:49 2016 (r294899) +++ head/sys/amd64/linux/linux_sysvec.c Wed Jan 27 07:20:55 2016 (r294900) @@ -271,6 +271,7 @@ elf_linux_fixup(register_t **stack_base, Elf_Addr *pos; struct ps_strings *arginfo; struct proc *p; + int issetugid; p = imgp->proc; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; @@ -281,6 +282,7 @@ elf_linux_fixup(register_t **stack_base, args = (Elf64_Auxargs *)imgp->auxargs; pos = base + (imgp->args->argc + imgp->args->envc + 2); + issetugid = p->p_flag & P_SUGID ? 1 : 0; AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR, imgp->proc->p_sysent->sv_shared_page_base); AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature); @@ -296,7 +298,7 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); - AUXARGS_ENTRY(pos, LINUX_AT_SECURE, 0); + AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid); AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform)); AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary); if (imgp->execpathp != 0) Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Wed Jan 27 07:06:49 2016 (r294899) +++ head/sys/amd64/linux32/linux32_sysvec.c Wed Jan 27 07:20:55 2016 (r294900) @@ -230,6 +230,7 @@ elf_linux_fixup(register_t **stack_base, Elf32_Addr *base; Elf32_Addr *pos; struct linux32_ps_strings *arginfo; + int issetugid; arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; @@ -239,6 +240,7 @@ elf_linux_fixup(register_t **stack_base, args = (Elf32_Auxargs *)imgp->auxargs; pos = base + (imgp->args->argc + imgp->args->envc + 2); + issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO_EHDR, imgp->proc->p_sysent->sv_shared_page_base); AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO, linux32_vsyscall); @@ -261,7 +263,7 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY_32(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY_32(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY_32(pos, AT_BASE, args->base); - AUXARGS_ENTRY_32(pos, LINUX_AT_SECURE, 0); + AUXARGS_ENTRY_32(pos, LINUX_AT_SECURE, issetugid); AUXARGS_ENTRY_32(pos, AT_UID, imgp->proc->p_ucred->cr_ruid); AUXARGS_ENTRY_32(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY_32(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Wed Jan 27 07:06:49 2016 (r294899) +++ head/sys/i386/linux/linux_sysvec.c Wed Jan 27 07:20:55 2016 (r294900) @@ -238,11 +238,13 @@ elf_linux_fixup(register_t **stack_base, Elf32_Addr *uplatform; struct ps_strings *arginfo; register_t *pos; + int issetugid; KASSERT(curthread->td_proc == imgp->proc, ("unsafe elf_linux_fixup(), should be curproc")); p = imgp->proc; + issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; uplatform = (Elf32_Addr *)((caddr_t)arginfo - linux_szplatform); args = (Elf32_Auxargs *)imgp->auxargs; @@ -270,7 +272,7 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY(pos, AT_BASE, args->base); - AUXARGS_ENTRY(pos, LINUX_AT_SECURE, 0); + AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid); AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_ucred->cr_ruid); AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); From owner-svn-src-head@freebsd.org Wed Jan 27 07:34:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92C09A6F4F6; Wed, 27 Jan 2016 07:34:01 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6F3F11276; Wed, 27 Jan 2016 07:34:01 +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 u0R7Y0SS053967; Wed, 27 Jan 2016 07:34:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R7Y0In053966; Wed, 27 Jan 2016 07:34:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601270734.u0R7Y0In053966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 27 Jan 2016 07:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294902 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 07:34:01 -0000 Author: glebius Date: Wed Jan 27 07:34:00 2016 New Revision: 294902 URL: https://svnweb.freebsd.org/changeset/base/294902 Log: Fix issues with TCP_CONGESTION handling after r294540: o Return back the buf[TCP_CA_NAME_MAX] for TCP_CONGESTION, for TCP_CCALGOOPT use dynamically allocated *pbuf. o For SOPT_SET TCP_CONGESTION do NULL terminating of string taking from userland. o For SOPT_SET TCP_CONGESTION do the search for the algorithm keeping the inpcb lock. o For SOPT_GET TCP_CONGESTION first strlcpy() the name holding the inpcb lock into temporary buffer, then copyout. Together with: lstewart Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 27 07:28:55 2016 (r294901) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 27 07:34:00 2016 (r294902) @@ -1479,7 +1479,8 @@ tcp_default_ctloutput(struct socket *so, u_int ui; struct tcp_info ti; struct cc_algo *algo; - char *buf; + char *pbuf, buf[TCP_CA_NAME_MAX]; + size_t len; /* * For TCP_CCALGOOPT forward the control to CC module, for both @@ -1488,22 +1489,22 @@ tcp_default_ctloutput(struct socket *so, switch (sopt->sopt_name) { case TCP_CCALGOOPT: INP_WUNLOCK(inp); - buf = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK | M_ZERO); - error = sooptcopyin(sopt, buf, sopt->sopt_valsize, + pbuf = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK | M_ZERO); + error = sooptcopyin(sopt, pbuf, sopt->sopt_valsize, sopt->sopt_valsize); if (error) { - free(buf, M_TEMP); + free(pbuf, M_TEMP); return (error); } INP_WLOCK_RECHECK(inp); if (CC_ALGO(tp)->ctl_output != NULL) - error = CC_ALGO(tp)->ctl_output(tp->ccv, sopt, buf); + error = CC_ALGO(tp)->ctl_output(tp->ccv, sopt, pbuf); else error = ENOENT; INP_WUNLOCK(inp); if (error == 0 && sopt->sopt_dir == SOPT_GET) - error = sooptcopyout(sopt, buf, sopt->sopt_valsize); - free(buf, M_TEMP); + error = sooptcopyout(sopt, pbuf, sopt->sopt_valsize); + free(pbuf, M_TEMP); return (error); } @@ -1600,24 +1601,22 @@ unlock_and_done: case TCP_CONGESTION: INP_WUNLOCK(inp); - buf = malloc(TCP_CA_NAME_MAX, M_TEMP, M_WAITOK|M_ZERO); - error = sooptcopyin(sopt, buf, TCP_CA_NAME_MAX, 1); - if (error) { - free(buf, M_TEMP); + error = sooptcopyin(sopt, buf, TCP_CA_NAME_MAX - 1, 1); + if (error) break; - } + buf[sopt->sopt_valsize] = '\0'; + INP_WLOCK_RECHECK(inp); CC_LIST_RLOCK(); STAILQ_FOREACH(algo, &cc_list, entries) if (strncmp(buf, algo->name, TCP_CA_NAME_MAX) == 0) break; CC_LIST_RUNLOCK(); - free(buf, M_TEMP); if (algo == NULL) { + INP_WUNLOCK(inp); error = EINVAL; break; } - INP_WLOCK_RECHECK(inp); /* * We hold a write lock over the tcb so it's safe to * do these things without ordering concerns. @@ -1786,9 +1785,9 @@ unlock_and_done: error = sooptcopyout(sopt, &ti, sizeof ti); break; case TCP_CONGESTION: + len = strlcpy(buf, CC_ALGO(tp)->name, TCP_CA_NAME_MAX); INP_WUNLOCK(inp); - error = sooptcopyout(sopt, CC_ALGO(tp)->name, - TCP_CA_NAME_MAX); + error = sooptcopyout(sopt, buf, len + 1); break; case TCP_KEEPIDLE: case TCP_KEEPINTVL: From owner-svn-src-head@freebsd.org Wed Jan 27 10:34:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3470A6F8F6; Wed, 27 Jan 2016 10:34:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 902A6197F; Wed, 27 Jan 2016 10:34:08 +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 u0RAY79H008062; Wed, 27 Jan 2016 10:34:07 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RAY7Ln008061; Wed, 27 Jan 2016 10:34:07 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601271034.u0RAY7Ln008061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 27 Jan 2016 10:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294908 - head/lib/libthread_db/arch/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 10:34:08 -0000 Author: br Date: Wed Jan 27 10:34:07 2016 New Revision: 294908 URL: https://svnweb.freebsd.org/changeset/base/294908 Log: Add the RISC-V MD parts of libthread_db. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5064 Added: head/lib/libthread_db/arch/riscv/ head/lib/libthread_db/arch/riscv/libpthread_md.c (contents, props changed) Added: head/lib/libthread_db/arch/riscv/libpthread_md.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthread_db/arch/riscv/libpthread_md.c Wed Jan 27 10:34:07 2016 (r294908) @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were 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. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "libpthread_db.h" + +void +pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc) +{ + mcontext_t *mc; + + mc = &uc->uc_mcontext; + + memcpy(mc->mc_gpregs.gp_t, r->t, sizeof(mc->mc_gpregs.gp_t)); + memcpy(mc->mc_gpregs.gp_s, r->s, sizeof(mc->mc_gpregs.gp_s)); + memcpy(mc->mc_gpregs.gp_a, r->a, sizeof(mc->mc_gpregs.gp_a)); + mc->mc_gpregs.gp_ra = r->ra; + mc->mc_gpregs.gp_sp = r->sp; + mc->mc_gpregs.gp_gp = r->gp; + mc->mc_gpregs.gp_tp = r->tp; + mc->mc_gpregs.gp_sepc = r->sepc; + mc->mc_gpregs.gp_sstatus = r->sstatus; +} + +void +pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r) +{ + const mcontext_t *mc; + + mc = &uc->uc_mcontext; + + memcpy(r->t, mc->mc_gpregs.gp_t, sizeof(mc->mc_gpregs.gp_t)); + memcpy(r->s, mc->mc_gpregs.gp_s, sizeof(mc->mc_gpregs.gp_s)); + memcpy(r->a, mc->mc_gpregs.gp_a, sizeof(mc->mc_gpregs.gp_a)); + r->ra = mc->mc_gpregs.gp_ra; + r->sp = mc->mc_gpregs.gp_sp; + r->gp = mc->mc_gpregs.gp_gp; + r->tp = mc->mc_gpregs.gp_tp; + r->sepc = mc->mc_gpregs.gp_sepc; + r->sstatus = mc->mc_gpregs.gp_sstatus; +} + +void +pt_fpreg_to_ucontext(const struct fpreg *r __unused, ucontext_t *uc __unused) +{ + + /* RISCVTODO */ +} + +void +pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused) +{ + + /* RISCVTODO */ +} + +void +pt_md_init(void) +{ +} + +int +pt_reg_sstep(struct reg *reg __unused, int step __unused) +{ + + return (0); +} From owner-svn-src-head@freebsd.org Wed Jan 27 11:16:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2EC7A6ECCF; Wed, 27 Jan 2016 11:16:12 +0000 (UTC) (envelope-from br@bsdpad.com) Received: from bsdpad.com (xc1.bsdpad.com [195.154.136.64]) (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 8E063104C; Wed, 27 Jan 2016 11:16:11 +0000 (UTC) (envelope-from br@bsdpad.com) Received: from localhost ([127.0.0.1] helo=bsdpad.com) by bsdpad.com with smtp (Exim 4.83 (FreeBSD)) (envelope-from ) id 1aONsQ-000NzO-CE; Wed, 27 Jan 2016 11:03:06 +0000 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Wed, 27 Jan 2016 11:03:06 +0000 (GMT) Date: Wed, 27 Jan 2016 11:03:06 +0000 From: Ruslan Bukin To: Devin Teske Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294893 - head/lib/libdpv Message-ID: <20160127110306.GA92213@bsdpad.com> References: <201601270621.u0R6LZPd030494@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201601270621.u0R6LZPd030494@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 11:16:12 -0000 I get this with GCC 5.2.0: /home/rb743/dev/freebsd-riscv/lib/libdpv/dialog_util.c:270:23: error: zero-length gnu_printf format string [-Werror=for mat-zero-length] sprintf(dargv[n++], ""); Ruslan On Wed, Jan 27, 2016 at 06:21:35AM +0000, Devin Teske wrote: > Author: dteske > Date: Wed Jan 27 06:21:35 2016 > New Revision: 294893 > URL: https://svnweb.freebsd.org/changeset/base/294893 > > Log: > Fix a crash if `-D' is used without `-t title' > > dialog(3)'s dlg_reallocate_gauge(), used both by dialog(3)'s dialog_gauge() > and dialog(1)'s `--gauge', will segmentation fault in strlen(3) if no title > is set for the widget. Reproducible with `dialog --gauge hi 6 20' (adding > `--title ""' is enough to prevent segmentation fault). > > MFC after: 3 days > X-MFC-to: stable/10 > > Modified: > head/lib/libdpv/dialog_util.c > > Modified: head/lib/libdpv/dialog_util.c > ============================================================================== > --- head/lib/libdpv/dialog_util.c Wed Jan 27 06:16:53 2016 (r294892) > +++ head/lib/libdpv/dialog_util.c Wed Jan 27 06:21:35 2016 (r294893) > @@ -261,6 +261,13 @@ dialog_spawn_gauge(char *init_prompt, pi > errx(EXIT_FAILURE, "Out of memory?!"); > sprintf(dargv[n++], "--title"); > dargv[n++] = title; > + } else { > + if ((dargv[n] = malloc(8)) == NULL) > + errx(EXIT_FAILURE, "Out of memory?!"); > + sprintf(dargv[n++], "--title"); > + if ((dargv[n] = malloc(8)) == NULL) > + errx(EXIT_FAILURE, "Out of memory?!"); > + sprintf(dargv[n++], ""); > } > if (backtitle != NULL) { > if ((dargv[n] = malloc(12)) == NULL) > From owner-svn-src-head@freebsd.org Wed Jan 27 13:40:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B0FEA6ECA1; Wed, 27 Jan 2016 13:40:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41DAE1FA5; Wed, 27 Jan 2016 13:40:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RDejEO060527; Wed, 27 Jan 2016 13:40:45 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RDeiU5060523; Wed, 27 Jan 2016 13:40:44 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601271340.u0RDeiU5060523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 27 Jan 2016 13:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294909 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 13:40:46 -0000 Author: des Date: Wed Jan 27 13:40:44 2016 New Revision: 294909 URL: https://svnweb.freebsd.org/changeset/base/294909 Log: Switch UseDNS back on Modified: head/crypto/openssh/FREEBSD-upgrade head/crypto/openssh/servconf.c head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 Modified: head/crypto/openssh/FREEBSD-upgrade ============================================================================== --- head/crypto/openssh/FREEBSD-upgrade Wed Jan 27 10:34:07 2016 (r294908) +++ head/crypto/openssh/FREEBSD-upgrade Wed Jan 27 13:40:44 2016 (r294909) @@ -117,6 +117,7 @@ - PasswordAuthentication defaults to "no". - VersionAddendum defaults to "FreeBSD-YYYYMMDD". - PrivilegeSeparation defaults to "sandbox". + - UseDNS defaults to "yes". 2) Modified client-side defaults Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Wed Jan 27 10:34:07 2016 (r294908) +++ head/crypto/openssh/servconf.c Wed Jan 27 13:40:44 2016 (r294909) @@ -320,7 +320,7 @@ fill_default_server_options(ServerOption if (options->max_sessions == -1) options->max_sessions = DEFAULT_SESSIONS_MAX; if (options->use_dns == -1) - options->use_dns = 0; + options->use_dns = 1; if (options->client_alive_interval == -1) options->client_alive_interval = 0; if (options->client_alive_count_max == -1) Modified: head/crypto/openssh/sshd_config ============================================================================== --- head/crypto/openssh/sshd_config Wed Jan 27 10:34:07 2016 (r294908) +++ head/crypto/openssh/sshd_config Wed Jan 27 13:40:44 2016 (r294909) @@ -115,7 +115,7 @@ #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 -#UseDNS no +#UseDNS yes #PidFile /var/run/sshd.pid #MaxStartups 10:30:100 #PermitTunnel no Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Wed Jan 27 10:34:07 2016 (r294908) +++ head/crypto/openssh/sshd_config.5 Wed Jan 27 13:40:44 2016 (r294909) @@ -1541,8 +1541,8 @@ the resolved host name for the remote IP very same IP address. .Pp If this option is set to -.Dq no -(the default) then only addresses and not host names may be used in +.Dq no , +then only addresses and not host names may be used in .Pa ~/.ssh/known_hosts .Cm from and @@ -1550,6 +1550,8 @@ and .Cm Match .Cm Host directives. +The default is +.Dq yes . .It Cm UseLogin Specifies whether .Xr login 1 From owner-svn-src-head@freebsd.org Wed Jan 27 13:56:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18899A6F218 for ; Wed, 27 Jan 2016 13:56:29 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::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 A3B491A5D for ; Wed, 27 Jan 2016 13:56:28 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id l65so145946297wmf.1 for ; Wed, 27 Jan 2016 05:56:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=zBC4TaPX6Slp6UY/Mfd2F3zezKlTRpuMYOfPLospE9Y=; b=t+NpV1aBMNksM7L+ypfWLbqsTm2njlMsci7p/4nJUGhNHNnboag80zobS5RmFSnvwq V1kiwxlkLcoEqZa015hEeTrxPqfOeCExVjwbgQY9Gcv8C2jiHHFNg1rAYdYUzCrU0yJN GL1Y5Q/EGwkDpFqgNiI1YkBs3+ntA5gl6Onz4SQPj8l0khejmfecJiWLnrDcq1J2AmtQ +o5ukr9cUwRgWpr+FrZq+3MF4JWApUoZ3Xa34vW9gkOh8U5hnDstd9qwm6Lg4L8qps2P XCTPVKzuVAppgIr3wxPC7wGG0zxkxHMnsHlhDXZVP/51fdFU2WrO4Ad2xTMJFtHm0BX4 8aQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=zBC4TaPX6Slp6UY/Mfd2F3zezKlTRpuMYOfPLospE9Y=; b=N0ZoriJrmW4hDR3O4pbyQ5l1ISyJ124gTUX9+vwi8wdfd3C22C0xeYn8JIRSKg55tC 5lppaeU+23z7RVDXL1nFsrF6VY+L8UU+lOecu2/X8pXs/vF0l4ZUMI2Uv89kZC/kOFmn h0xlCwF145J3rMz/s+nxQe4zAI3aNbh0JuEHNcH7vYPCPYAjgSUstJ22H0+ITicbGTBM Gc2R+g63oD7DGZ/fJO0CMKZd9010Ze5atz5sBiKri986goe3BfDFKUrzpT6RHZyuUhLP 2yYiJdXeQsp632QCl5aFfV8UCVk6MYo+kWcRYoaVUuZHZwZHtP1RMHAo1VL2DDqMmC9U /x8w== X-Gm-Message-State: AG10YOQ8e+JMHC+Vofm3AdCmv/PUXobdFM1mxddU/ww196erckuDYfMXDdPKiLOrQ+G8WFZM X-Received: by 10.194.216.100 with SMTP id op4mr27761732wjc.85.1453902987111; Wed, 27 Jan 2016 05:56:27 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id l7sm6397750wjx.14.2016.01.27.05.56.25 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jan 2016 05:56:25 -0800 (PST) Subject: Re: svn commit: r294909 - head/crypto/openssh To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601271340.u0RDeiU5060523@repo.freebsd.org> From: Steven Hartland Message-ID: <56A8CC97.6090000@multiplay.co.uk> Date: Wed, 27 Jan 2016 13:56:39 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601271340.u0RDeiU5060523@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 13:56:29 -0000 While I can guess the reason, it would be nice to document the reason on things like this :-) Regards Steve On 27/01/2016 13:40, Dag-Erling Smørgrav wrote: > Author: des > Date: Wed Jan 27 13:40:44 2016 > New Revision: 294909 > URL: https://svnweb.freebsd.org/changeset/base/294909 > > Log: > Switch UseDNS back on > > Modified: > head/crypto/openssh/FREEBSD-upgrade > head/crypto/openssh/servconf.c > head/crypto/openssh/sshd_config > head/crypto/openssh/sshd_config.5 > > Modified: head/crypto/openssh/FREEBSD-upgrade > ============================================================================== > --- head/crypto/openssh/FREEBSD-upgrade Wed Jan 27 10:34:07 2016 (r294908) > +++ head/crypto/openssh/FREEBSD-upgrade Wed Jan 27 13:40:44 2016 (r294909) > @@ -117,6 +117,7 @@ > - PasswordAuthentication defaults to "no". > - VersionAddendum defaults to "FreeBSD-YYYYMMDD". > - PrivilegeSeparation defaults to "sandbox". > + - UseDNS defaults to "yes". > > 2) Modified client-side defaults > > > Modified: head/crypto/openssh/servconf.c > ============================================================================== > --- head/crypto/openssh/servconf.c Wed Jan 27 10:34:07 2016 (r294908) > +++ head/crypto/openssh/servconf.c Wed Jan 27 13:40:44 2016 (r294909) > @@ -320,7 +320,7 @@ fill_default_server_options(ServerOption > if (options->max_sessions == -1) > options->max_sessions = DEFAULT_SESSIONS_MAX; > if (options->use_dns == -1) > - options->use_dns = 0; > + options->use_dns = 1; > if (options->client_alive_interval == -1) > options->client_alive_interval = 0; > if (options->client_alive_count_max == -1) > > Modified: head/crypto/openssh/sshd_config > ============================================================================== > --- head/crypto/openssh/sshd_config Wed Jan 27 10:34:07 2016 (r294908) > +++ head/crypto/openssh/sshd_config Wed Jan 27 13:40:44 2016 (r294909) > @@ -115,7 +115,7 @@ > #Compression delayed > #ClientAliveInterval 0 > #ClientAliveCountMax 3 > -#UseDNS no > +#UseDNS yes > #PidFile /var/run/sshd.pid > #MaxStartups 10:30:100 > #PermitTunnel no > > Modified: head/crypto/openssh/sshd_config.5 > ============================================================================== > --- head/crypto/openssh/sshd_config.5 Wed Jan 27 10:34:07 2016 (r294908) > +++ head/crypto/openssh/sshd_config.5 Wed Jan 27 13:40:44 2016 (r294909) > @@ -1541,8 +1541,8 @@ the resolved host name for the remote IP > very same IP address. > .Pp > If this option is set to > -.Dq no > -(the default) then only addresses and not host names may be used in > +.Dq no , > +then only addresses and not host names may be used in > .Pa ~/.ssh/known_hosts > .Cm from > and > @@ -1550,6 +1550,8 @@ and > .Cm Match > .Cm Host > directives. > +The default is > +.Dq yes . > .It Cm UseLogin > Specifies whether > .Xr login 1 > From owner-svn-src-head@freebsd.org Wed Jan 27 14:10:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FED0A6F81D; Wed, 27 Jan 2016 14:10:44 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 252151830; Wed, 27 Jan 2016 14:10:43 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aOQnv-0003Hs-DT; Wed, 27 Jan 2016 17:10:39 +0300 Date: Wed, 27 Jan 2016 17:10:39 +0300 From: Slawa Olhovchenkov To: Steven Hartland Cc: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294909 - head/crypto/openssh Message-ID: <20160127141039.GQ37895@zxy.spb.ru> References: <201601271340.u0RDeiU5060523@repo.freebsd.org> <56A8CC97.6090000@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56A8CC97.6090000@multiplay.co.uk> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 14:10:44 -0000 On Wed, Jan 27, 2016 at 01:56:39PM +0000, Steven Hartland wrote: > While I can guess the reason, it would be nice to document the reason on > things like this :-) Or use more clear commit message (on stable/10 UseDNS is on by default, but nothing about relation to host names in ~/.ssh/known_hosts). > On 27/01/2016 13:40, Dag-Erling Smørgrav wrote: > > Author: des > > Date: Wed Jan 27 13:40:44 2016 > > New Revision: 294909 > > URL: https://svnweb.freebsd.org/changeset/base/294909 > > > > Log: > > Switch UseDNS back on > > > > Modified: > > head/crypto/openssh/FREEBSD-upgrade > > head/crypto/openssh/servconf.c > > head/crypto/openssh/sshd_config > > head/crypto/openssh/sshd_config.5 > > > > Modified: head/crypto/openssh/FREEBSD-upgrade > > ============================================================================== > > --- head/crypto/openssh/FREEBSD-upgrade Wed Jan 27 10:34:07 2016 (r294908) > > +++ head/crypto/openssh/FREEBSD-upgrade Wed Jan 27 13:40:44 2016 (r294909) > > @@ -117,6 +117,7 @@ > > - PasswordAuthentication defaults to "no". > > - VersionAddendum defaults to "FreeBSD-YYYYMMDD". > > - PrivilegeSeparation defaults to "sandbox". > > + - UseDNS defaults to "yes". > > > > 2) Modified client-side defaults > > > > > > Modified: head/crypto/openssh/servconf.c > > ============================================================================== > > --- head/crypto/openssh/servconf.c Wed Jan 27 10:34:07 2016 (r294908) > > +++ head/crypto/openssh/servconf.c Wed Jan 27 13:40:44 2016 (r294909) > > @@ -320,7 +320,7 @@ fill_default_server_options(ServerOption > > if (options->max_sessions == -1) > > options->max_sessions = DEFAULT_SESSIONS_MAX; > > if (options->use_dns == -1) > > - options->use_dns = 0; > > + options->use_dns = 1; > > if (options->client_alive_interval == -1) > > options->client_alive_interval = 0; > > if (options->client_alive_count_max == -1) > > > > Modified: head/crypto/openssh/sshd_config > > ============================================================================== > > --- head/crypto/openssh/sshd_config Wed Jan 27 10:34:07 2016 (r294908) > > +++ head/crypto/openssh/sshd_config Wed Jan 27 13:40:44 2016 (r294909) > > @@ -115,7 +115,7 @@ > > #Compression delayed > > #ClientAliveInterval 0 > > #ClientAliveCountMax 3 > > -#UseDNS no > > +#UseDNS yes > > #PidFile /var/run/sshd.pid > > #MaxStartups 10:30:100 > > #PermitTunnel no > > > > Modified: head/crypto/openssh/sshd_config.5 > > ============================================================================== > > --- head/crypto/openssh/sshd_config.5 Wed Jan 27 10:34:07 2016 (r294908) > > +++ head/crypto/openssh/sshd_config.5 Wed Jan 27 13:40:44 2016 (r294909) > > @@ -1541,8 +1541,8 @@ the resolved host name for the remote IP > > very same IP address. > > .Pp > > If this option is set to > > -.Dq no > > -(the default) then only addresses and not host names may be used in > > +.Dq no , > > +then only addresses and not host names may be used in > > .Pa ~/.ssh/known_hosts > > .Cm from > > and > > @@ -1550,6 +1550,8 @@ and > > .Cm Match > > .Cm Host > > directives. > > +The default is > > +.Dq yes . > > .It Cm UseLogin > > Specifies whether > > .Xr login 1 > > > > _______________________________________________ > 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-head@freebsd.org Wed Jan 27 14:10:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA4DDA6F84C; Wed, 27 Jan 2016 14:10:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 99CED1984; Wed, 27 Jan 2016 14:10:51 +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 u0REAoh2069416; Wed, 27 Jan 2016 14:10:50 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0REAoD2069415; Wed, 27 Jan 2016 14:10:50 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601271410.u0REAoD2069415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 27 Jan 2016 14:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294912 - head/lib/libthr/arch/riscv/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 14:10:52 -0000 Author: br Date: Wed Jan 27 14:10:50 2016 New Revision: 294912 URL: https://svnweb.freebsd.org/changeset/base/294912 Log: Add pthread MD part for RISC-V. Reviewed by: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5063 Added: head/lib/libthr/arch/riscv/include/ head/lib/libthr/arch/riscv/include/pthread_md.h (contents, props changed) Added: head/lib/libthr/arch/riscv/include/pthread_md.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/riscv/include/pthread_md.h Wed Jan 27 14:10:50 2016 (r294912) @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 2005 David Xu + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were 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. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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$ + */ + +/* + * Machine-dependent thread prototypes/definitions. + */ +#ifndef _PTHREAD_MD_H_ +#define _PTHREAD_MD_H_ + +#include +#include + +#define CPU_SPINWAIT +#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) +#define TP_OFFSET 0x10 + +/* + * Variant I tcb. The structure layout is fixed, don't blindly + * change it! + */ +struct tcb { + void *tcb_dtv; + struct pthread *tcb_thread; +}; + +/* Called from the thread to set its private data. */ +static __inline void +_tcb_set(struct tcb *tcb) +{ + + __asm __volatile("mv tp, %0" :: "r"((uint8_t *)tcb + TP_OFFSET)); +} + +/* + * Get the current tcb. + */ +static __inline struct tcb * +_tcb_get(void) +{ + register uint8_t *_tp; + + __asm __volatile("mv %0, tp" : "=r"(_tp)); + + return ((struct tcb *)(_tp - TP_OFFSET)); +} + +extern struct pthread *_thr_initial; + +static __inline struct pthread * +_get_curthread(void) +{ + + if (_thr_initial) + return (_tcb_get()->tcb_thread); + return (NULL); +} + +#endif /* _PTHREAD_MD_H_ */ From owner-svn-src-head@freebsd.org Wed Jan 27 14:35:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 564C7A6F18D; Wed, 27 Jan 2016 14:35:22 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 22B8C1CC1; Wed, 27 Jan 2016 14:35:21 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 3B2B2AA78; Wed, 27 Jan 2016 14:35:20 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id CA58C48CED; Wed, 27 Jan 2016 15:35:22 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294909 - head/crypto/openssh References: <201601271340.u0RDeiU5060523@repo.freebsd.org> <56A8CC97.6090000@multiplay.co.uk> Date: Wed, 27 Jan 2016 15:35:22 +0100 In-Reply-To: <56A8CC97.6090000@multiplay.co.uk> (Steven Hartland's message of "Wed, 27 Jan 2016 13:56:39 +0000") Message-ID: <8660yfgket.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 14:35:22 -0000 Steven Hartland writes: > While I can guess the reason, it would be nice to document the reason > on things like this :-) Because it used to be on, and people who relied on it were locked out after upgrading. We can consider turning it back off before 11, with sufficient advance warning (and possibly code in /etc/rc.d/sshd that looks for and warns about host names in sshd_config and root's authorized_keys). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Wed Jan 27 14:46:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B725AA6F671; Wed, 27 Jan 2016 14:46:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id 87E81133D; Wed, 27 Jan 2016 14:46: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 u0REkULo081037; Wed, 27 Jan 2016 14:46:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0REkUOi081035; Wed, 27 Jan 2016 14:46:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601271446.u0REkUOi081035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 Jan 2016 14:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294915 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 14:46:31 -0000 Author: hselasky Date: Wed Jan 27 14:46:30 2016 New Revision: 294915 URL: https://svnweb.freebsd.org/changeset/base/294915 Log: Fix generation of dependency rules for the LinuxKPI, the MLX5 driver and all of OFED except MLX4[EN/IB]. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/conf/files head/sys/conf/kern.post.mk Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 27 14:16:13 2016 (r294914) +++ head/sys/conf/files Wed Jan 27 14:46:30 2016 (r294915) @@ -3821,133 +3821,96 @@ nlm/sm_inter_xdr.c optional nfslockd | # Linux Kernel Programming Interface compat/linuxkpi/common/src/linux_kmod.c optional compat_linuxkpi \ - no-depend compile-with "${LINUXKPI_C}" + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_compat.c optional compat_linuxkpi \ - no-depend compile-with "${LINUXKPI_C}" + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_pci.c optional compat_linuxkpi pci \ - no-depend compile-with "${LINUXKPI_C}" + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_idr.c optional compat_linuxkpi \ - no-depend compile-with "${LINUXKPI_C}" + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_radix.c optional compat_linuxkpi \ - no-depend compile-with "${LINUXKPI_C}" + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \ - no-depend compile-with "${LINUXKPI_C}" + compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) ofed/drivers/infiniband/core/addr.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/agent.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/cache.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" # XXX Mad.c must be ordered before cm.c for sysinit sets to occur in # the correct order. ofed/drivers/infiniband/core/mad.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/cm.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/ -Wno-unused-function" ofed/drivers/infiniband/core/cma.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/device.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/fmr_pool.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/iwcm.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/mad_rmpp.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/multicast.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/packer.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/peer_mem.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/sa_query.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/smi.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/sysfs.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/ucm.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/ucma.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/ud_header.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/umem.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/user_mad.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/uverbs_cmd.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/uverbs_main.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/uverbs_marshall.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/verbs.c optional ofed \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c optional ipoib \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" #ofed/drivers/infiniband/ulp/ipoib/ipoib_fs.c optional ipoib \ -# no-depend \ # compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c optional ipoib \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c optional ipoib \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c optional ipoib \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c optional ipoib \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" #ofed/drivers/infiniband/ulp/ipoib/ipoib_vlan.c optional ipoib \ -# no-depend \ # compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c optional sdp inet \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" ofed/drivers/infiniband/ulp/sdp/sdp_main.c optional sdp inet \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" ofed/drivers/infiniband/ulp/sdp/sdp_rx.c optional sdp inet \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp inet \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp inet \ - no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" ofed/drivers/infiniband/hw/mlx4/alias_GUID.c optional mlx4ib \ @@ -4077,95 +4040,95 @@ ofed/drivers/net/mlx4/en_tx.c optional compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" dev/mlx5/mlx5_core/mlx5_alloc.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_flow_table.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_fw.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_health.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_mad.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_main.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_mcg.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_mr.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_pagealloc.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_pd.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_port.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_qp.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_srq.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_transobj.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_uar.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_vport.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_wq.c optional mlx5 pci \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_ethtool.c optional mlx5en pci inet inet6 \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_main.c optional mlx5en pci inet inet6 \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_tx.c optional mlx5en pci inet inet6 \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_flow_table.c optional mlx5en pci inet inet6 \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_rx.c optional mlx5en pci inet inet6 \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_txrx.c optional mlx5en pci inet inet6 \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_allocator.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_av.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_catas.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_cmd.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_cq.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_eq.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_mad.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_main.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_mcg.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_memfree.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_mr.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_pd.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_profile.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_provider.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_qp.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_reset.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_srq.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" ofed/drivers/infiniband/hw/mthca/mthca_uar.c optional mthca \ - no-depend compile-with "${OFED_C}" + compile-with "${OFED_C}" # crypto support opencrypto/cast.c optional crypto | ipsec Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Jan 27 14:16:13 2016 (r294914) +++ head/sys/conf/kern.post.mk Wed Jan 27 14:46:30 2016 (r294915) @@ -186,12 +186,23 @@ genassym.o: $S/$M/$M/genassym.c ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h +# Normal files first +CFILES_NORMAL= ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*:N*/compat/linuxkpi/common/*:N*/ofed/*:N*/dev/mlx5/*} +SFILES_NORMAL= ${SFILES:N*/cddl/*} + # We have "special" -I include paths for zfs/dtrace files in 'depend'. -CFILES_NOCDDL= ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*} -SFILES_NOCDDL= ${SFILES:N*/cddl/*} CFILES_CDDL= ${CFILES:M*/cddl/*} SFILES_CDDL= ${SFILES:M*/cddl/*} +# We have "special" -I include paths for LinuxKPI. +CFILES_LINUXKPI=${CFILES:M*/compat/linuxkpi/common/*} + +# We have "special" -I include paths for OFED. +CFILES_OFED=${CFILES:M*/ofed/*} + +# We have "special" -I include paths for MLX5. +CFILES_MLX5=${CFILES:M*/dev/mlx5/*} + kernel-depend: .depend # The argument list can be very long, so use make -V and xargs to # pass it to mkdep. @@ -220,12 +231,20 @@ DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/. .depend: .PRECIOUS ${SRCS} .if ${MK_FAST_DEPEND} == "no" rm -f ${.TARGET}.tmp - ${MAKE} -V CFILES_NOCDDL -V SYSTEM_CFILES -V GEN_CFILES | \ +# C files + ${MAKE} -V CFILES_NORMAL -V SYSTEM_CFILES -V GEN_CFILES | \ CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${CFLAGS} ${MAKE} -V CFILES_CDDL | \ CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_CFLAGS} \ ${FBT_CFLAGS} ${DTRACE_CFLAGS} - ${MAKE} -V SFILES_NOCDDL | \ + ${MAKE} -V CFILES_LINUXKPI | \ + CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \ + ${CFLAGS} ${LINUXKPI_INCLUDES} + ${MAKE} -V CFILES_OFED -V CFILES_MLX5 | \ + CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \ + ${CFLAGS} ${OFEDINCLUDES} +# Assembly files + ${MAKE} -V SFILES_NORMAL | \ CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ASM_CFLAGS} ${MAKE} -V SFILES_CDDL | \ CC="${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFLAGS} From owner-svn-src-head@freebsd.org Wed Jan 27 14:47:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E7E1A6F6B7; Wed, 27 Jan 2016 14:47:01 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FC1114EE; Wed, 27 Jan 2016 14:47:01 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0REl0O3081104; Wed, 27 Jan 2016 14:47:00 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0REl0ek081103; Wed, 27 Jan 2016 14:47:00 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601271447.u0REl0ek081103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 27 Jan 2016 14:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294916 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 14:47:01 -0000 Author: skra Date: Wed Jan 27 14:47:00 2016 New Revision: 294916 URL: https://svnweb.freebsd.org/changeset/base/294916 Log: Fix my email. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Jan 27 14:46:30 2016 (r294915) +++ head/share/misc/committers-src.dot Wed Jan 27 14:47:00 2016 (r294916) @@ -288,7 +288,7 @@ sephe [label="Sepherosa Ziehau\nsephe@Fr sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] -skra [label="Svatopluk Kraus\nslm@FreeBSD.org\n2015/10/28"] +skra [label="Svatopluk Kraus\nskra@FreeBSD.org\n2015/10/28"] slm [label="Stephen McConnell\nslm@FreeBSD.org\n2014/05/07"] smh [label="Steven Hartland\nsmh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] From owner-svn-src-head@freebsd.org Wed Jan 27 15:22:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FD4EA7073D; Wed, 27 Jan 2016 15:22:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (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 D1D751840; Wed, 27 Jan 2016 15:22:00 +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 5F70925D386D; Wed, 27 Jan 2016 15:21:50 +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 12D90C77090; Wed, 27 Jan 2016 15:21:50 +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 KlImy-y46vux; Wed, 27 Jan 2016 15:21:49 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 94460C76FE5; Wed, 27 Jan 2016 15:21:48 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r294893 - head/lib/libdpv From: "Bjoern A. Zeeb" In-Reply-To: <201601270621.u0R6LZPd030494@repo.freebsd.org> Date: Wed, 27 Jan 2016 15:21:46 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1BF8A649-7E73-4F56-B2E7-D0F1C5D6E1C9@FreeBSD.org> References: <201601270621.u0R6LZPd030494@repo.freebsd.org> To: Devin Teske X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 15:22:02 -0000 > On 27 Jan 2016, at 06:21 , Devin Teske wrote: >=20 > Author: dteske > Date: Wed Jan 27 06:21:35 2016 > New Revision: 294893 > URL: https://svnweb.freebsd.org/changeset/base/294893 >=20 > Log: > Fix a crash if `-D' is used without `-t title' >=20 > dialog(3)'s dlg_reallocate_gauge(), used both by dialog(3)'s = dialog_gauge() > and dialog(1)'s `--gauge', will segmentation fault in strlen(3) if no = title > is set for the widget. Reproducible with `dialog --gauge hi 6 20' = (adding > `=E2=80=94title =E2=80=9C=E2=80=9D' is enough to prevent segmentation = fault). mips/sparc64/powerpc say: /scratch/tmp/bz/head.svn/lib/libdpv/dialog_util.c: In function = 'dialog_spawn_gauge': /scratch/tmp/bz/head.svn/lib/libdpv/dialog_util.c:270: warning: = zero-length printf format string From owner-svn-src-head@freebsd.org Wed Jan 27 15:28:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B240A70932; Wed, 27 Jan 2016 15:28:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id 28CA11BB8; Wed, 27 Jan 2016 15:28:25 +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 u0RFSOQT093573; Wed, 27 Jan 2016 15:28:24 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RFSONc093572; Wed, 27 Jan 2016 15:28:24 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601271528.u0RFSONc093572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 15:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294922 - head/lib/libdpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 15:28:25 -0000 Author: dteske Date: Wed Jan 27 15:28:23 2016 New Revision: 294922 URL: https://svnweb.freebsd.org/changeset/base/294922 Log: Fix fatal warn when compiling under GCC 5.2.0 GCC 5.2.0 generates the following [fatal] warning: dialog_util.c:270:23: error: zero-length gnu_printf format string [-Werror=format-zero-length] sprintf(dargv[n++], ""); Fix malloc argument while here, removing sprintf. Reported by: Ruslan Bukin Modified: head/lib/libdpv/dialog_util.c Modified: head/lib/libdpv/dialog_util.c ============================================================================== --- head/lib/libdpv/dialog_util.c Wed Jan 27 15:19:48 2016 (r294921) +++ head/lib/libdpv/dialog_util.c Wed Jan 27 15:28:23 2016 (r294922) @@ -265,9 +265,9 @@ dialog_spawn_gauge(char *init_prompt, pi if ((dargv[n] = malloc(8)) == NULL) errx(EXIT_FAILURE, "Out of memory?!"); sprintf(dargv[n++], "--title"); - if ((dargv[n] = malloc(8)) == NULL) + if ((dargv[n] = malloc(1)) == NULL) errx(EXIT_FAILURE, "Out of memory?!"); - sprintf(dargv[n++], ""); + *dargv[n++] = '\0'; } if (backtitle != NULL) { if ((dargv[n] = malloc(12)) == NULL) From owner-svn-src-head@freebsd.org Wed Jan 27 15:30:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 416E5A70AB6; Wed, 27 Jan 2016 15:30:42 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 34FAF1EFF; Wed, 27 Jan 2016 15:30:42 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=50709 helo=[10.0.0.113]) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aOS3G-000IjR-S6; Wed, 27 Jan 2016 07:30:35 -0800 Message-ID: <1453908634.4517.2.camel@FreeBSD.org> Subject: Re: svn commit: r294893 - head/lib/libdpv From: Devin Teske To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, dteske@FreeBSD.org Date: Wed, 27 Jan 2016 07:30:34 -0800 In-Reply-To: <20160127110306.GA92213@bsdpad.com> References: <201601270621.u0R6LZPd030494@repo.freebsd.org> <20160127110306.GA92213@bsdpad.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 15:30:42 -0000 On Wed, 2016-01-27 at 11:03 +0000, Ruslan Bukin wrote: > I get this with GCC 5.2.0: > > /home/rb743/dev/freebsd-riscv/lib/libdpv/dialog_util.c:270:23: error: > zero-length gnu_printf format string [-Werror=for > mat-zero-length] > sprintf(dargv[n++], ""); > > Ruslan > Fixed just now: https://svnweb.freebsd.org/base?view=revision&revision=294922 Thanks a bunch! -- Cheers,Devin > On Wed, Jan 27, 2016 at 06:21:35AM +0000, Devin Teske wrote: > > Author: dteske > > Date: Wed Jan 27 06:21:35 2016 > > New Revision: 294893 > > URL: https://svnweb.freebsd.org/changeset/base/294893 > > > > Log: > > Fix a crash if `-D' is used without `-t title' > > > > dialog(3)'s dlg_reallocate_gauge(), used both by dialog(3)'s > > dialog_gauge() > > and dialog(1)'s `--gauge', will segmentation fault in strlen(3) > > if no title > > is set for the widget. Reproducible with `dialog --gauge hi 6 20' > > (adding > > `--title ""' is enough to prevent segmentation fault). > > > > MFC after: 3 days > > X-MFC-to: stable/10 > > > > Modified: > > head/lib/libdpv/dialog_util.c > > > > Modified: head/lib/libdpv/dialog_util.c > > =================================================================== > > =========== > > --- head/lib/libdpv/dialog_util.c Wed Jan 27 06:16:53 2016 > > (r294892) > > +++ head/lib/libdpv/dialog_util.c Wed Jan 27 06:21:35 2016 > > (r294893) > > @@ -261,6 +261,13 @@ dialog_spawn_gauge(char *init_prompt, pi > > errx(EXIT_FAILURE, "Out of memory?!"); > > sprintf(dargv[n++], "--title"); > > dargv[n++] = title; > > + } else { > > + if ((dargv[n] = malloc(8)) == NULL) > > + errx(EXIT_FAILURE, "Out of memory?!"); > > + sprintf(dargv[n++], "--title"); > > + if ((dargv[n] = malloc(8)) == NULL) > > + errx(EXIT_FAILURE, "Out of memory?!"); > > + sprintf(dargv[n++], ""); > > } > > if (backtitle != NULL) { > > if ((dargv[n] = malloc(12)) == NULL) > > > > From owner-svn-src-head@freebsd.org Wed Jan 27 15:32:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4163A70C62; Wed, 27 Jan 2016 15:32:35 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 B749D1330; Wed, 27 Jan 2016 15:32:35 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=27860 helo=[10.0.0.113]) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aOS5D-000IkE-JZ; Wed, 27 Jan 2016 07:32:35 -0800 Message-ID: <1453908755.4517.4.camel@FreeBSD.org> Subject: Re: svn commit: r294893 - head/lib/libdpv From: Devin Teske To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, dteske@FreeBSD.org Date: Wed, 27 Jan 2016 07:32:35 -0800 In-Reply-To: <1BF8A649-7E73-4F56-B2E7-D0F1C5D6E1C9@FreeBSD.org> References: <201601270621.u0R6LZPd030494@repo.freebsd.org> <1BF8A649-7E73-4F56-B2E7-D0F1C5D6E1C9@FreeBSD.org> Content-Type: text/plain; charset="windows-1251" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 15:32:35 -0000 On Wed, 2016-01-27 at 15:21 +0000, Bjoern A. Zeeb wrote: > > On 27 Jan 2016, at 06:21 , Devin Teske wrote: > >=20 > > Author: dteske > > Date: Wed Jan 27 06:21:35 2016 > > New Revision: 294893 > > URL: https://svnweb.freebsd.org/changeset/base/294893 > >=20 > > Log: > > Fix a crash if `-D' is used without `-t title' > >=20 > > dialog(3)'s dlg_reallocate_gauge(), used both by dialog(3)'s > > dialog_gauge() > > and dialog(1)'s `--gauge', will segmentation fault in strlen(3) if > > no title > > is set for the widget. Reproducible with `dialog --gauge hi 6 20' > > (adding > > `=97title =93=94' is enough to prevent segmentation fault). >=20 >=20 > mips/sparc64/powerpc say: >=20 > /scratch/tmp/bz/head.svn/lib/libdpv/dialog_util.c: In function > 'dialog_spawn_gauge': > /scratch/tmp/bz/head.svn/lib/libdpv/dialog_util.c:270: warning: zero > -length printf format string >=20 >=20 Fixed before you could hit send ;D https://svnweb.freebsd.org/base?view=3Drevision&revision=3D294922 (someone else reported it last night) --=20 Devin From owner-svn-src-head@freebsd.org Wed Jan 27 16:13:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4784BA6FA44; Wed, 27 Jan 2016 16:13:12 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0FA13187B; Wed, 27 Jan 2016 16:13: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 u0RGDAZD007868; Wed, 27 Jan 2016 16:13:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RGDAXd007867; Wed, 27 Jan 2016 16:13:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601271613.u0RGDAXd007867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 27 Jan 2016 16:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294923 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 16:13:12 -0000 Author: asomers Date: Wed Jan 27 16:13:10 2016 New Revision: 294923 URL: https://svnweb.freebsd.org/changeset/base/294923 Log: Fix grep_test:recurse with ZFS and TMPFS tmpdirs contrib/netbsd-tests/usr.bin/grep/t_grep.sh Fix grep_test:recurse when /tmp is either zfs or tmpfs. The test was relying on an implicit ordering of directory recursion which happens to be true when using UFS. grep's specification requires no such ordering. The solution is to ignore the order of grep's results. Reviewed by: ngie MFC after: 32 days Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4925 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Wed Jan 27 15:28:23 2016 (r294922) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Wed Jan 27 16:13:10 2016 (r294923) @@ -70,7 +70,15 @@ recurse_body() echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish + # Begin FreeBSD + if true; then + atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort" + else + # End FreeBSD atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case recurse_symlink From owner-svn-src-head@freebsd.org Wed Jan 27 16:17:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 692E3A6FC95; Wed, 27 Jan 2016 16:17:17 +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 mx1.freebsd.org (Postfix) with ESMTPS id 380DC1CE9; Wed, 27 Jan 2016 16:17:17 +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 u0RGHGJ0008185; Wed, 27 Jan 2016 16:17:16 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RGHGu9008184; Wed, 27 Jan 2016 16:17:16 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601271617.u0RGHGu9008184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 27 Jan 2016 16:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294924 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 16:17:17 -0000 Author: asomers Date: Wed Jan 27 16:17:15 2016 New Revision: 294924 URL: https://svnweb.freebsd.org/changeset/base/294924 Log: syslogd: Enable repeated line compression for lines of any length. Enable repeated line compression for lines of any length, instead of only short lines. AFAICT repeated line compression was limited to short lines as a RAM optimization, which made sense when karels added it in 1988, but no longer. The penalty is a paltry 904B of RAM per file logged. Reviewed by: rpaulo MFC after: 32 days Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4475 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Wed Jan 27 16:13:10 2016 (r294923) +++ head/usr.sbin/syslogd/syslogd.c Wed Jan 27 16:17:15 2016 (r294924) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); */ #define MAXLINE 1024 /* maximum line length */ -#define MAXSVLINE 120 /* maximum saved line length */ +#define MAXSVLINE MAXLINE /* maximum saved line length */ #define DEFUPRI (LOG_USER|LOG_NOTICE) #define DEFSPRI (LOG_KERN|LOG_CRIT) #define TIMERINTVL 30 /* interval for checking flush, mark */ From owner-svn-src-head@freebsd.org Wed Jan 27 16:36:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E4FEA70393; Wed, 27 Jan 2016 16:36:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15C621877; Wed, 27 Jan 2016 16:36:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RGaJaX013980; Wed, 27 Jan 2016 16:36:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RGaI90013974; Wed, 27 Jan 2016 16:36:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601271636.u0RGaI90013974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 27 Jan 2016 16:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294925 - in head/sys/boot: common i386/boot2 i386/gptboot i386/zfsboot mips/beri/boot2 pc98/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 16:36:20 -0000 Author: imp Date: Wed Jan 27 16:36:18 2016 New Revision: 294925 URL: https://svnweb.freebsd.org/changeset/base/294925 Log: Fix mistake when transitioning to the new defines with ZFS loader. I hate adding yet another define, but it is the lessor of the evil choices available. Kill another evil by removing PATH_BOOT3 and replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate. PR: 206659 Modified: head/sys/boot/common/paths.h head/sys/boot/i386/boot2/boot2.c head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/mips/beri/boot2/boot2.c head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/common/paths.h ============================================================================== --- head/sys/boot/common/paths.h Wed Jan 27 16:17:15 2016 (r294924) +++ head/sys/boot/common/paths.h Wed Jan 27 16:36:18 2016 (r294925) @@ -31,9 +31,9 @@ #define PATH_DOTCONFIG "/boot.config" #define PATH_CONFIG "/boot/config" -#define PATH_BOOT3 "/boot/loader" #define PATH_LOADER "/boot/loader" #define PATH_LOADER_EFI "/boot/loader.efi" +#define PATH_LOADER_ZFS "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #endif /* _PATHS_H_ */ Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Wed Jan 27 16:17:15 2016 (r294924) +++ head/sys/boot/i386/boot2/boot2.c Wed Jan 27 16:36:18 2016 (r294925) @@ -235,7 +235,7 @@ main(void) */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Wed Jan 27 16:17:15 2016 (r294924) +++ head/sys/boot/i386/gptboot/gptboot.c Wed Jan 27 16:36:18 2016 (r294925) @@ -178,7 +178,7 @@ main(void) if (autoboot && keyhit(3)) { if (*kname == '\0') - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); break; } autoboot = 0; @@ -190,7 +190,7 @@ main(void) */ if (*kname != '\0') load(); - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); load(); Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Wed Jan 27 16:17:15 2016 (r294924) +++ head/sys/boot/i386/zfsboot/zfsboot.c Wed Jan 27 16:36:18 2016 (r294925) @@ -546,12 +546,12 @@ main(void) } /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, + * Try to exec /boot/loader. If interrupted by a keypress, * or in case of failure, try to load a kernel directly instead. */ if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + memcpy(kname, PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS)); if (!keyhit(3)) { load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); Modified: head/sys/boot/mips/beri/boot2/boot2.c ============================================================================== --- head/sys/boot/mips/beri/boot2/boot2.c Wed Jan 27 16:17:15 2016 (r294924) +++ head/sys/boot/mips/beri/boot2/boot2.c Wed Jan 27 16:36:18 2016 (r294925) @@ -248,7 +248,7 @@ main(u_int argc, const char *argv[], con */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { boot_fromfs(); kname = PATH_KERNEL; Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Wed Jan 27 16:17:15 2016 (r294924) +++ head/sys/boot/pc98/boot2/boot2.c Wed Jan 27 16:36:18 2016 (r294925) @@ -374,7 +374,7 @@ main(void) */ if (!kname) { - kname = PATH_BOOT3; + kname = PATH_LOADER; if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; From owner-svn-src-head@freebsd.org Wed Jan 27 16:39:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADE23A704F0 for ; Wed, 27 Jan 2016 16:39:38 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 4BDA41BF4 for ; Wed, 27 Jan 2016 16:39:38 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x229.google.com with SMTP id n5so37172902wmn.1 for ; Wed, 27 Jan 2016 08:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=hQIjJZuusLQMMjqGyS9zjag8Ufyv7BcKaJ7eQ/b1O9M=; b=vZpmJCHhvKs7wpfyTgKH28sqPvBkVE25Ep4enzsyEDBAlpjRs7Kqas9dnnbvyywjyF Vjm1/bQ3moWY0cfRD++YT6yObUhBPOXoWSl0rv6VaoDZLZp9GYIzjBANP9S7sFUkDcid FqD17bC4hs5fPfKcG0DQNTYUPf97GCY/qHpFR+l2maeu2bt3dLltXcNGe86dCQShsA8v Xm0Phv/OcxV8Mo94FcbenTTGiyStOMdM63UNnGggBPt29fnms3RJyjXDh6AEFlRWMPl3 RIa5lvzhTwMnb83VA+sDeKFTlsofi2AX/tyo/eF5tiBpGy5XfodUB1LTii8Ox78TDMPy QgAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=hQIjJZuusLQMMjqGyS9zjag8Ufyv7BcKaJ7eQ/b1O9M=; b=Yt81a605sA5X640SQIr/WKG0/X6G3Dd8roUp/b0WemNJ/5Xqxj0Ykp/NSQnsCTAdY6 DWEqN5suM4LVCgsCJH65gyVeNvcs64IujqBOpWCfIU0Kk220+WOaTZDmi0+8BEMetY1i mTuZ85yGuNuiFh/zWuAmu3zUKmz4IRP8eRGy5nbBUhVsaV5Ofs2ar2h3ZvgNAJjeU0Vc cItAbIlmjztmM7PYDsly22rI+UEexFWU80u4IaHSVMy08tGgoEUNaVLBCpzax9+dk7/7 5VXi8jso8RsygAHIXmQ6KTKLn7Vac6wqcnuo0+DXL6YUY0tZNnWYRIFrfjVNhjLVlYkJ /cBQ== X-Gm-Message-State: AG10YOT7jRsussgUvF68PEZ294geoNe9CfAbtOqFdX/YttPeLH3wW70nU8lmrBSPSsuRBzQX X-Received: by 10.194.240.234 with SMTP id wd10mr34185648wjc.129.1453912776613; Wed, 27 Jan 2016 08:39:36 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id e77sm9091694wma.18.2016.01.27.08.39.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jan 2016 08:39:35 -0800 (PST) Subject: Re: svn commit: r294925 - in head/sys/boot: common i386/boot2 i386/gptboot i386/zfsboot mips/beri/boot2 pc98/boot2 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601271636.u0RGaI90013974@repo.freebsd.org> From: Steven Hartland Message-ID: <56A8F2D5.5000302@multiplay.co.uk> Date: Wed, 27 Jan 2016 16:39:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601271636.u0RGaI90013974@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 16:39:38 -0000 On 27/01/2016 16:36, Warner Losh wrote: > Author: imp > Date: Wed Jan 27 16:36:18 2016 > New Revision: 294925 > URL: https://svnweb.freebsd.org/changeset/base/294925 > > Log: > Fix mistake when transitioning to the new defines with ZFS loader. I > hate adding yet another define, but it is the lessor of the evil > choices available. Kill another evil by removing PATH_BOOT3 and > replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate. > > PR: 206659 > > Modified: > head/sys/boot/common/paths.h > head/sys/boot/i386/boot2/boot2.c > head/sys/boot/i386/gptboot/gptboot.c > head/sys/boot/i386/zfsboot/zfsboot.c > head/sys/boot/mips/beri/boot2/boot2.c > head/sys/boot/pc98/boot2/boot2.c > > Modified: head/sys/boot/common/paths.h > ============================================================================== > --- head/sys/boot/common/paths.h Wed Jan 27 16:17:15 2016 (r294924) > +++ head/sys/boot/common/paths.h Wed Jan 27 16:36:18 2016 (r294925) > @@ -31,9 +31,9 @@ > > #define PATH_DOTCONFIG "/boot.config" > #define PATH_CONFIG "/boot/config" > -#define PATH_BOOT3 "/boot/loader" > #define PATH_LOADER "/boot/loader" > #define PATH_LOADER_EFI "/boot/loader.efi" > +#define PATH_LOADER_ZFS "/boot/zfsloader" > #define PATH_KERNEL "/boot/kernel/kernel" > > #endif /* _PATHS_H_ */ > > Modified: head/sys/boot/i386/boot2/boot2.c > ============================================================================== > --- head/sys/boot/i386/boot2/boot2.c Wed Jan 27 16:17:15 2016 (r294924) > +++ head/sys/boot/i386/boot2/boot2.c Wed Jan 27 16:36:18 2016 (r294925) > @@ -235,7 +235,7 @@ main(void) > */ > > if (!kname) { > - kname = PATH_BOOT3; > + kname = PATH_LOADER; > if (autoboot && !keyhit(3*SECOND)) { > load(); > kname = PATH_KERNEL; > > Modified: head/sys/boot/i386/gptboot/gptboot.c > ============================================================================== > --- head/sys/boot/i386/gptboot/gptboot.c Wed Jan 27 16:17:15 2016 (r294924) > +++ head/sys/boot/i386/gptboot/gptboot.c Wed Jan 27 16:36:18 2016 (r294925) > @@ -178,7 +178,7 @@ main(void) > > if (autoboot && keyhit(3)) { > if (*kname == '\0') > - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); > + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); > break; > } > autoboot = 0; > @@ -190,7 +190,7 @@ main(void) > */ > if (*kname != '\0') > load(); > - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); > + memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER)); > load(); > memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); > load(); > > Modified: head/sys/boot/i386/zfsboot/zfsboot.c > ============================================================================== > --- head/sys/boot/i386/zfsboot/zfsboot.c Wed Jan 27 16:17:15 2016 (r294924) > +++ head/sys/boot/i386/zfsboot/zfsboot.c Wed Jan 27 16:36:18 2016 (r294925) > @@ -546,12 +546,12 @@ main(void) > } > > /* > - * Try to exec stage 3 boot loader. If interrupted by a keypress, > + * Try to exec /boot/loader. If interrupted by a keypress, This comment should either refer the constant (so its always correct) or be /boot/zfsloader not /boot/loader From owner-svn-src-head@freebsd.org Wed Jan 27 16:45:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04904A70766; Wed, 27 Jan 2016 16:45:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id C966510E4; Wed, 27 Jan 2016 16:45:24 +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 u0RGjNeQ016892; Wed, 27 Jan 2016 16:45:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RGjN7M016891; Wed, 27 Jan 2016 16:45:23 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601271645.u0RGjN7M016891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 27 Jan 2016 16:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294926 - head/sys/boot/ficl/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 16:45:25 -0000 Author: allanjude Date: Wed Jan 27 16:45:23 2016 New Revision: 294926 URL: https://svnweb.freebsd.org/changeset/base/294926 Log: ficl on i386 should cast to unsigned char output to support efi i386 make it possible for efi_console to recognize and translate box characters on i386 build (unsigned versus signed char passed as int issue). Submitted by: Toomas Soome Reviewed by: emaste, smh, dteske MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D4993 Modified: head/sys/boot/ficl/i386/sysdep.c Modified: head/sys/boot/ficl/i386/sysdep.c ============================================================================== --- head/sys/boot/ficl/i386/sysdep.c Wed Jan 27 16:36:18 2016 (r294925) +++ head/sys/boot/ficl/i386/sysdep.c Wed Jan 27 16:45:23 2016 (r294926) @@ -58,7 +58,7 @@ void ficlTextOut(FICL_VM *pVM, char *ms IGNORE(pVM); while(*msg != 0) - putchar(*(msg++)); + putchar((unsigned char)*(msg++)); if (fNewline) putchar('\n'); From owner-svn-src-head@freebsd.org Wed Jan 27 17:25:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E072CA6F67C; Wed, 27 Jan 2016 17:25:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (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 B2D431FE1; Wed, 27 Jan 2016 17:25:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22e.google.com with SMTP id x125so8119216pfb.0; Wed, 27 Jan 2016 09:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1rn+yezHNRqDTYJCPDDCTPK9I8qzcB7ssM0AYBnbgzM=; b=LvwdBspTm5aq3DOGClyuP427X/CU+Xxw1DhupQfhxQ7+TgrbysLAPpvy9g/FqgkKgh NxjwgP7VnfeKjYdHTSWv65xLwRkcZL8Co6/FJqwzW7ei0n08kizSRrF9UhlgQGcvsC90 MGTXCmU2ehIDPqBI0OiKraCRRc53TydTqflDv6CFNAIaAVKfbZ7jdBN4q675xBbvuNFz wadlxpfH1C771ogwpdYp2h2PGmmYgU27SBBYtgG09HUSmlMRu/1Hkb1E9dY9QcVKFcud sUTOTNqb1SLlVIHaRiEEj1IiTW028PO6SkysvHd24GA9lN0uQMZZQzE3HMnzLC7YStt+ 65Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=1rn+yezHNRqDTYJCPDDCTPK9I8qzcB7ssM0AYBnbgzM=; b=CPSUde+vTD1AE0sUcwNf6iwLxKG3iJ+HHarQ28EICE882Ew+JY+/3V0NmdIn84jhcz C4RqMJNKFqZpc3XXDOYzPQ68Hgn7KHcQeI5NwVwc9p3VIKXwXOJfYQSSEv7C/RnDXJrH os8W4To3QAKKfzQ0jroVs5yj1fsvG2BdOYjVKju9UTWn9YyvoqKV5/V2EHe9VZIQ6L8Y qtOUkxB/BJIvib4mxUN/uQDbHZpbEnIwQBtVgCWaiVqu+buSZLnk6a3vd1/E1p4u9CiC Xos0qeUK0OnqHwNJVbDKlSfPyhVUTj8QcVE9ThAD2DsoksBNZybjNGQ2cHXVOXcAwseB Juxg== X-Gm-Message-State: AG10YOS17SIkFDRJXqnyRabEgko5dZ1AY0lnheZQaegp+gvK8opVU4e8X+gmqGGV1CWwsw== X-Received: by 10.98.89.145 with SMTP id k17mr9033054pfj.82.1453915508317; Wed, 27 Jan 2016 09:25:08 -0800 (PST) Received: from [192.168.20.11] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id qz9sm10370399pab.39.2016.01.27.09.25.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jan 2016 09:25:06 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r294909 - head/crypto/openssh From: NGie Cooper X-Mailer: iPhone Mail (13D15) In-Reply-To: <201601271340.u0RDeiU5060523@repo.freebsd.org> Date: Wed, 27 Jan 2016 09:25:06 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7BEC31CD-F7AF-44B5-BBB5-9F4CAF3487A7@gmail.com> References: <201601271340.u0RDeiU5060523@repo.freebsd.org> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 17:25:09 -0000 > On Jan 27, 2016, at 05:40, Dag-Erling Sm=C3=B8rgrav wrot= e: >=20 > Author: des > Date: Wed Jan 27 13:40:44 2016 > New Revision: 294909 > URL: https://svnweb.freebsd.org/changeset/base/294909 >=20 > Log: > Switch UseDNS back on Please add "Relnotes: yes" to the MFC commit, if this is MFCed. Speaking of w= hich, is there a plan for MFCing this? It wasn't noted in the commit message= .. Thanks! -NGie= From owner-svn-src-head@freebsd.org Wed Jan 27 17:33:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D0E8A6F90A; Wed, 27 Jan 2016 17:33:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0E54813D9; Wed, 27 Jan 2016 17:33:32 +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 u0RHXWgj032180; Wed, 27 Jan 2016 17:33:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RHXWUH032179; Wed, 27 Jan 2016 17:33:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601271733.u0RHXWUH032179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 27 Jan 2016 17:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294927 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 17:33:33 -0000 Author: andrew Date: Wed Jan 27 17:33:31 2016 New Revision: 294927 URL: https://svnweb.freebsd.org/changeset/base/294927 Log: When finding the physical address of a device allow intermediate addresses to be 64-bit on 32-bit architectures. It is not uncommon for device trees to use the upper 32-bits to store what effectively is an index into the parent ranges property. In this case, when running with a 32-bit bus_addr_t and bus_size_t, we would previously truncate the address, this may then incorrectly match the wrong range, and return the wrong address. Tested by: bz (earlier version) Modified: head/sys/dev/ofw/ofw_subr.c Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Wed Jan 27 16:45:23 2016 (r294926) +++ head/sys/dev/ofw/ofw_subr.c Wed Jan 27 17:33:31 2016 (r294927) @@ -75,8 +75,8 @@ ofw_reg_to_paddr(phandle_t dev, int regn bus_size_t *psize, pcell_t *ppci_hi) { pcell_t cell[32], pci_hi; - bus_addr_t addr, raddr, baddr; - bus_size_t size, rsize; + uint64_t addr, raddr, baddr; + uint64_t size, rsize; uint32_t c, nbridge, naddr, nsize; phandle_t bridge, parent; u_int spc, rspc; @@ -167,6 +167,11 @@ ofw_reg_to_paddr(phandle_t dev, int regn get_addr_props(bridge, &naddr, &nsize, &pci); } + KASSERT(addr <= BUS_SPACE_MAXADDR, + ("Bus sddress is too large: %jx", (intmax_t)addr)); + KASSERT(size <= BUS_SPACE_MAXSIZE, + ("Bus size is too large: %jx", (intmax_t)addr)); + *paddr = addr; *psize = size; if (ppci_hi != NULL) From owner-svn-src-head@freebsd.org Wed Jan 27 17:41:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B90A6FC7D for ; Wed, 27 Jan 2016 17:41:47 +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 334691A68 for ; Wed, 27 Jan 2016 17:41:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 27 Jan 2016 17:42:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0RHfhlR031573; Wed, 27 Jan 2016 10:41:43 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1453916503.42081.34.camel@freebsd.org> Subject: Re: svn commit: r294927 - head/sys/dev/ofw From: Ian Lepore To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 27 Jan 2016 10:41:43 -0700 In-Reply-To: <201601271733.u0RHXWUH032179@repo.freebsd.org> References: <201601271733.u0RHXWUH032179@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 17:41:47 -0000 On Wed, 2016-01-27 at 17:33 +0000, Andrew Turner wrote: > Author: andrew > Date: Wed Jan 27 17:33:31 2016 > New Revision: 294927 > URL: https://svnweb.freebsd.org/changeset/base/294927 ... > + KASSERT(size <= BUS_SPACE_MAXSIZE, > + ("Bus size is too large: %jx", (intmax_t)addr)); Oops, printing addr in the size assert. -- Ian From owner-svn-src-head@freebsd.org Wed Jan 27 17:47:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43647A6FF84; Wed, 27 Jan 2016 17:47:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 12DC51D91; Wed, 27 Jan 2016 17:47:09 +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 u0RHl825035454; Wed, 27 Jan 2016 17:47:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RHl8o6035453; Wed, 27 Jan 2016 17:47:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201601271747.u0RHl8o6035453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 27 Jan 2016 17:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294928 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 17:47:09 -0000 Author: andrew Date: Wed Jan 27 17:47:07 2016 New Revision: 294928 URL: https://svnweb.freebsd.org/changeset/base/294928 Log: Fix the value we print when the size is too large. While here fix the types we cast to to be unsigned as the data is unsigned. Reviewed by: ian Modified: head/sys/dev/ofw/ofw_subr.c Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Wed Jan 27 17:33:31 2016 (r294927) +++ head/sys/dev/ofw/ofw_subr.c Wed Jan 27 17:47:07 2016 (r294928) @@ -168,9 +168,9 @@ ofw_reg_to_paddr(phandle_t dev, int regn } KASSERT(addr <= BUS_SPACE_MAXADDR, - ("Bus sddress is too large: %jx", (intmax_t)addr)); + ("Bus sddress is too large: %jx", (uintmax_t)addr)); KASSERT(size <= BUS_SPACE_MAXSIZE, - ("Bus size is too large: %jx", (intmax_t)addr)); + ("Bus size is too large: %jx", (uintmax_t)size)); *paddr = addr; *psize = size; From owner-svn-src-head@freebsd.org Wed Jan 27 17:55:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55C73A70366; Wed, 27 Jan 2016 17:55:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 256FE15F2; Wed, 27 Jan 2016 17:55:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RHt3ro038268; Wed, 27 Jan 2016 17:55:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RHt1UJ038252; Wed, 27 Jan 2016 17:55:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601271755.u0RHt1UJ038252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Jan 2016 17:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294930 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux amd64/linux32 arm/arm arm64/arm64 i386/i386 i386/linux i386/svr4 mips/mips powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 17:55:04 -0000 Author: jhb Date: Wed Jan 27 17:55:01 2016 New Revision: 294930 URL: https://svnweb.freebsd.org/changeset/base/294930 Log: Convert ss_sp in stack_t and sigstack to void *. POSIX requires these members to be of type void * rather than the char * inherited from 4BSD. NetBSD and OpenBSD both changed their fields to void * back in 1998. No new build failures were reported via an exp-run. PR: 206503 (exp-run) Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5092 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/vm_machdep.c head/sys/i386/i386/machdep.c head/sys/i386/linux/linux_sysvec.c head/sys/i386/svr4/svr4_machdep.c head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/vm_machdep.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/sys/signal.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/amd64/amd64/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -389,7 +389,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size; + sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; #endif Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/amd64/ia32/ia32_signal.c Wed Jan 27 17:55:01 2016 (r294930) @@ -354,7 +354,7 @@ ia32_osendsig(sig_t catcher, ksiginfo_t /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct ia32_sigframe3 *)(td->td_sigstk.ss_sp + + fp = (struct ia32_sigframe3 *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(sf)); td->td_sigstk.ss_flags |= SS_ONSTACK; } else @@ -488,7 +488,7 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct ia32_sigframe4 *)(td->td_sigstk.ss_sp + + sfp = (struct ia32_sigframe4 *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(sf)); } else sfp = (struct ia32_sigframe4 *)regs->tf_rsp - 1; @@ -622,7 +622,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) - sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size; + sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; else sp = (char *)regs->tf_rsp; if (xfpusave != NULL) { Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/amd64/linux/linux_sysvec.c Wed Jan 27 17:55:01 2016 (r294930) @@ -630,7 +630,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size - + sp = (caddr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_rt_sigframe); } else sp = (caddr_t)regs->tf_rsp - sizeof(struct l_rt_sigframe) - 128; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/amd64/linux32/linux32_sysvec.c Wed Jan 27 17:55:01 2016 (r294930) @@ -315,7 +315,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct l_rt_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_rt_sigframe)); } else fp = (struct l_rt_sigframe *)regs->tf_rsp - 1; @@ -460,7 +460,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct l_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_sigframe)); } else fp = (struct l_sigframe *)regs->tf_rsp - 1; Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/arm/arm/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -296,7 +296,7 @@ sendsig(catcher, ksi, mask) /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)(td->td_sigstk.ss_sp + + fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/arm64/arm64/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -527,7 +527,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)(td->td_sigstk.ss_sp + + fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/arm64/arm64/vm_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -186,7 +186,7 @@ cpu_set_upcall_kse(struct thread *td, vo { struct trapframe *tf = td->td_frame; - tf->tf_sp = STACKALIGN(stack->ss_sp + stack->ss_size); + tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); tf->tf_elr = (register_t)entry; tf->tf_x[0] = (register_t)arg; } Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/i386/i386/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -368,7 +368,7 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct osigframe *)(td->td_sigstk.ss_sp + + fp = (struct osigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct osigframe)); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -515,7 +515,7 @@ freebsd4_sendsig(sig_t catcher, ksiginfo /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe4 *)(td->td_sigstk.ss_sp + + sfp = (struct sigframe4 *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct sigframe4)); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -675,7 +675,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size; + sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; #endif Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/i386/linux/linux_sysvec.c Wed Jan 27 17:55:01 2016 (r294930) @@ -451,7 +451,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct l_rt_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_rt_sigframe)); } else fp = (struct l_rt_sigframe *)regs->tf_esp - 1; @@ -591,7 +591,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct l_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct l_sigframe)); } else fp = (struct l_sigframe *)regs->tf_esp - 1; Modified: head/sys/i386/svr4/svr4_machdep.c ============================================================================== --- head/sys/i386/svr4/svr4_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/i386/svr4/svr4_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -441,7 +441,7 @@ svr4_sendsig(catcher, ksi, mask) */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct svr4_sigframe *)(td->td_sigstk.ss_sp + + fp = (struct svr4_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct svr4_sigframe)); td->td_sigstk.ss_flags |= SS_ONSTACK; } else { Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/mips/mips/freebsd32_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -410,7 +410,7 @@ freebsd32_sendsig(sig_t catcher, ksiginf /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe32 *)((vm_offset_t)(td->td_sigstk.ss_sp + + sfp = (struct sigframe32 *)(((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct sigframe32)) & ~(sizeof(__int64_t) - 1)); } else Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/mips/mips/pm_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -126,7 +126,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe *)((vm_offset_t)(td->td_sigstk.ss_sp + + sfp = (struct sigframe *)(((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct sigframe)) & ~(sizeof(__int64_t) - 1)); } else Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/mips/mips/vm_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -432,7 +432,7 @@ cpu_set_upcall_kse(struct thread *td, vo * in ``See MIPS Run'' by D. Sweetman, p. 269 * align stack */ - sp = ((register_t)(intptr_t)(stack->ss_sp + stack->ss_size) & ~0x7) - + sp = (((intptr_t)stack->ss_sp + stack->ss_size) & ~0x7) - CALLFRAME_SIZ; /* Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/powerpc/powerpc/exec_machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -219,7 +219,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - usfp = (void *)(td->td_sigstk.ss_sp + + usfp = (void *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - rndfsize); } else { usfp = (void *)(tf->fixreg[1] - rndfsize); Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/sparc64/sparc64/machdep.c Wed Jan 27 17:55:01 2016 (r294930) @@ -646,7 +646,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate and validate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe *)(td->td_sigstk.ss_sp + + sfp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size - sizeof(struct sigframe)); } else sfp = (struct sigframe *)sp - 1; Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Wed Jan 27 17:53:26 2016 (r294929) +++ head/sys/sys/signal.h Wed Jan 27 17:55:01 2016 (r294930) @@ -362,7 +362,7 @@ typedef struct sigaltstack { #else typedef struct { #endif - char *ss_sp; /* signal stack base */ + void *ss_sp; /* signal stack base */ __size_t ss_size; /* signal stack length */ int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ } stack_t; @@ -406,8 +406,7 @@ struct osigcontext { * Structure used in sigstack call. */ struct sigstack { - /* XXX ss_sp's type should be `void *'. */ - char *ss_sp; /* signal stack pointer */ + void *ss_sp; /* signal stack pointer */ int ss_onstack; /* current status */ }; #endif From owner-svn-src-head@freebsd.org Wed Jan 27 17:56:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2933DA703E3; Wed, 27 Jan 2016 17:56:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f171.google.com (mail-yk0-f171.google.com [209.85.160.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 E5CD11881; Wed, 27 Jan 2016 17:56:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f171.google.com with SMTP id k129so494037yke.0; Wed, 27 Jan 2016 09:56:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+CD8U1fdrR6W3hZ9TKlcYQ3WeuG0ob8IQddqKgHM8gM=; b=JHWkla7yDGmA73Hfx58AItTWNBwIwxMgD3tU+ShFvyP3GlMQbWjAsG2j8RgFgXMe0C IeWu2BK3q2gdOdAIBaouq4mguyJs5dWJyAwsie5Pih5sGtPPihizA3ulzXr7Yuww87yZ zH86POnYKeMH/25E7suL0A1OXIkwQ9bqWkE2paA5S5HkM4611fZQgYBuBuyBMTCwNFB7 X2ZYBXmzoS1utojS3LpkUfjxyS1ejBcfnj43YEetYpW6/Hpgnw7KjQHf05KTT8tA+SCW sYMY95jZBgiTei1lfj3eV7Qganpi1uxiCiSg8T1vKMwDThDeM76lWkpuvnIlvJMWCNDG mJkQ== X-Gm-Message-State: AG10YOSVpqanDjsP7EjheGnUE4rg66YYSPoz5VBqOKoM213ht7olXuLls2d0eLNCX8U+og== X-Received: by 10.13.199.132 with SMTP id j126mr14948645ywd.124.1453917076126; Wed, 27 Jan 2016 09:51:16 -0800 (PST) Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com. [209.85.160.175]) by smtp.gmail.com with ESMTPSA id l128sm5539183ywd.5.2016.01.27.09.51.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jan 2016 09:51:15 -0800 (PST) Received: by mail-yk0-f175.google.com with SMTP id a85so241972ykb.1; Wed, 27 Jan 2016 09:51:15 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.2.8 with SMTP id 8mr14953168ywc.73.1453917075475; Wed, 27 Jan 2016 09:51:15 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.69 with HTTP; Wed, 27 Jan 2016 09:51:15 -0800 (PST) In-Reply-To: <7BEC31CD-F7AF-44B5-BBB5-9F4CAF3487A7@gmail.com> References: <201601271340.u0RDeiU5060523@repo.freebsd.org> <7BEC31CD-F7AF-44B5-BBB5-9F4CAF3487A7@gmail.com> Date: Wed, 27 Jan 2016 09:51:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r294909 - head/crypto/openssh From: Conrad Meyer To: NGie Cooper Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 17:56:20 -0000 >From context in other emails: This commit will not be MFCed, because this configuration is already enabled in stable/10. For the same reason, it doesn't need Relnotes. Best, Conrad On Wed, Jan 27, 2016 at 9:25 AM, NGie Cooper wrote: > >> On Jan 27, 2016, at 05:40, Dag-Erling Sm=C3=B8rgrav wr= ote: >> >> Author: des >> Date: Wed Jan 27 13:40:44 2016 >> New Revision: 294909 >> URL: https://svnweb.freebsd.org/changeset/base/294909 >> >> Log: >> Switch UseDNS back on > > Please add "Relnotes: yes" to the MFC commit, if this is MFCed. Speaking = of which, is there a plan for MFCing this? It wasn't noted in the commit me= ssage.. > Thanks! > -NGie From owner-svn-src-head@freebsd.org Wed Jan 27 17:59:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D79A7046D; Wed, 27 Jan 2016 17:59:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2DCD01A75; Wed, 27 Jan 2016 17:59:42 +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 u0RHxft1038483; Wed, 27 Jan 2016 17:59:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RHxdP2038464; Wed, 27 Jan 2016 17:59:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601271759.u0RHxdP2038464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 27 Jan 2016 17:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294931 - in head: share/man/man9 sys/netinet sys/netinet/cc sys/netinet/tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 17:59:42 -0000 Author: glebius Date: Wed Jan 27 17:59:39 2016 New Revision: 294931 URL: https://svnweb.freebsd.org/changeset/base/294931 Log: Rename netinet/tcp_cc.h to netinet/cc/cc.h. Discussed with: lstewart Added: head/sys/netinet/cc/cc.h - copied, changed from r294930, head/sys/netinet/tcp_cc.h Deleted: head/sys/netinet/tcp_cc.h Modified: head/share/man/man9/mod_cc.9 head/sys/netinet/cc/cc.c head/sys/netinet/cc/cc_cdg.c head/sys/netinet/cc/cc_chd.c head/sys/netinet/cc/cc_cubic.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_hd.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c head/sys/netinet/cc/cc_vegas.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_usrreq.c Modified: head/share/man/man9/mod_cc.9 ============================================================================== --- head/share/man/man9/mod_cc.9 Wed Jan 27 17:55:01 2016 (r294930) +++ head/share/man/man9/mod_cc.9 Wed Jan 27 17:59:39 2016 (r294931) @@ -41,7 +41,7 @@ .Nd Modular Congestion Control .Sh SYNOPSIS .In netinet/tcp.h -.In netinet/tcp_cc.h +.In netinet/cc/cc.h .In netinet/cc/cc_module.h .Fn DECLARE_CC_MODULE "ccname" "ccalgo" .Fn CCV "ccv" "what" Modified: head/sys/netinet/cc/cc.c ============================================================================== --- head/sys/netinet/cc/cc.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc.c Wed Jan 27 17:59:39 2016 (r294931) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include Copied and modified: head/sys/netinet/cc/cc.h (from r294930, head/sys/netinet/tcp_cc.h) ============================================================================== --- head/sys/netinet/tcp_cc.h Wed Jan 27 17:55:01 2016 (r294930, copy source) +++ head/sys/netinet/cc/cc.h Wed Jan 27 17:59:39 2016 (r294931) @@ -48,8 +48,8 @@ * http://caia.swin.edu.au/urp/newtcp/ */ -#ifndef _NETINET_TCP_CC_H_ -#define _NETINET_TCP_CC_H_ +#ifndef _NETINET_CC_CC_H_ +#define _NETINET_CC_CC_H_ #if !defined(_KERNEL) #error "no user-servicable parts inside" @@ -175,4 +175,4 @@ extern struct rwlock cc_list_lock; #define CC_LIST_WUNLOCK() rw_wunlock(&cc_list_lock) #define CC_LIST_LOCK_ASSERT() rw_assert(&cc_list_lock, RA_LOCKED) -#endif /* _NETINET_TCP_CC_H_ */ +#endif /* _NETINET_CC_CC_H_ */ Modified: head/sys/netinet/cc/cc_cdg.c ============================================================================== --- head/sys/netinet/cc/cc_cdg.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc_cdg.c Wed Jan 27 17:59:39 2016 (r294931) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/netinet/cc/cc_chd.c ============================================================================== --- head/sys/netinet/cc/cc_chd.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc_chd.c Wed Jan 27 17:59:39 2016 (r294931) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc_cubic.c Wed Jan 27 17:59:39 2016 (r294931) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc_dctcp.c Wed Jan 27 17:59:39 2016 (r294931) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #define CAST_PTR_INT(X) (*((int*)(X))) Modified: head/sys/netinet/cc/cc_hd.c ============================================================================== --- head/sys/netinet/cc/cc_hd.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc_hd.c Wed Jan 27 17:59:39 2016 (r294931) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc_htcp.c Wed Jan 27 17:59:39 2016 (r294931) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include /* Fixed point math shifts. */ Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc_newreno.c Wed Jan 27 17:59:39 2016 (r294931) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include static void newreno_ack_received(struct cc_var *ccv, uint16_t type); Modified: head/sys/netinet/cc/cc_vegas.c ============================================================================== --- head/sys/netinet/cc/cc_vegas.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/cc/cc_vegas.c Wed Jan 27 17:59:39 2016 (r294931) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/tcp_input.c Wed Jan 27 17:59:39 2016 (r294931) @@ -107,7 +107,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef TCPPCAP #include #endif Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/tcp_output.c Wed Jan 27 17:59:39 2016 (r294931) @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef TCPPCAP #include #endif Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Jan 27 17:59:39 2016 (r294931) @@ -107,7 +107,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef TCPDEBUG #include #endif /* TCPDEBUG */ Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/tcp_subr.c Wed Jan 27 17:59:39 2016 (r294931) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef INET6 #include #endif Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/tcp_timer.c Wed Jan 27 17:59:39 2016 (r294931) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef INET6 #include #endif Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 27 17:55:01 2016 (r294930) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 27 17:59:39 2016 (r294931) @@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef TCPPCAP #include #endif From owner-svn-src-head@freebsd.org Wed Jan 27 18:12:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23FDBA70959; Wed, 27 Jan 2016 18:12:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id C54E0136B; Wed, 27 Jan 2016 18:12:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RICgma044186; Wed, 27 Jan 2016 18:12:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RICgO5044185; Wed, 27 Jan 2016 18:12:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201601271812.u0RICgO5044185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 27 Jan 2016 18:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294932 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 18:12:44 -0000 Author: trasz Date: Wed Jan 27 18:12:42 2016 New Revision: 294932 URL: https://svnweb.freebsd.org/changeset/base/294932 Log: Improve reporting of connection problems in iscsid(8). Obtained from: Mellanox Technologies MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/iscsid/pdu.c Modified: head/usr.sbin/iscsid/pdu.c ============================================================================== --- head/usr.sbin/iscsid/pdu.c Wed Jan 27 17:59:39 2016 (r294931) +++ head/usr.sbin/iscsid/pdu.c Wed Jan 27 18:12:42 2016 (r294932) @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include "iscsid.h" @@ -177,18 +179,23 @@ pdu_padding(const struct pdu *pdu) } static void -pdu_read(int fd, char *data, size_t len) +pdu_read(const struct connection *conn, char *data, size_t len) { ssize_t ret; while (len > 0) { - ret = read(fd, data, len); + ret = read(conn->conn_socket, data, len); if (ret < 0) { - if (timed_out()) + if (timed_out()) { + fail(conn, "Login Phase timeout"); log_errx(1, "exiting due to timeout"); + } + fail(conn, strerror(errno)); log_err(1, "read"); - } else if (ret == 0) + } else if (ret == 0) { + fail(conn, "connection lost"); log_errx(1, "read: connection lost"); + } len -= ret; data += ret; } @@ -207,7 +214,7 @@ pdu_receive(struct pdu *pdu) assert(pdu->pdu_connection->conn_conf.isc_iser == 0); - pdu_read(pdu->pdu_connection->conn_socket, + pdu_read(pdu->pdu_connection, (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs)); len = pdu_ahs_length(pdu); @@ -227,13 +234,13 @@ pdu_receive(struct pdu *pdu) if (pdu->pdu_data == NULL) log_err(1, "malloc"); - pdu_read(pdu->pdu_connection->conn_socket, + pdu_read(pdu->pdu_connection, (char *)pdu->pdu_data, pdu->pdu_data_len); padding = pdu_padding(pdu); if (padding != 0) { assert(padding < sizeof(dummy)); - pdu_read(pdu->pdu_connection->conn_socket, + pdu_read(pdu->pdu_connection, (char *)dummy, padding); } } From owner-svn-src-head@freebsd.org Wed Jan 27 19:11:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C3CCA6EF11; Wed, 27 Jan 2016 19:11: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 mx1.freebsd.org (Postfix) with ESMTPS id 0E4AC1374; Wed, 27 Jan 2016 19:11: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 u0RJBC95060975; Wed, 27 Jan 2016 19:11:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RJBC1s060974; Wed, 27 Jan 2016 19:11:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601271911.u0RJBC1s060974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 19:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294933 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 19:11:13 -0000 Author: bdrewery Date: Wed Jan 27 19:11:11 2016 New Revision: 294933 URL: https://svnweb.freebsd.org/changeset/base/294933 Log: Drop any previous fd when setting a new one. Reported by: mjg Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Wed Jan 27 18:12:42 2016 (r294932) +++ head/sys/dev/filemon/filemon.c Wed Jan 27 19:11:11 2016 (r294933) @@ -148,6 +148,9 @@ filemon_ioctl(struct cdev *dev, u_long c switch (cmd) { /* Set the output file descriptor. */ case FILEMON_SET_FD: + if (filemon->fp != NULL) + fdrop(filemon->fp, td); + error = fget_write(td, *(int *)data, #if __FreeBSD_version >= 900041 cap_rights_init(&rights, CAP_PWRITE), From owner-svn-src-head@freebsd.org Wed Jan 27 19:19:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32DAA6F1F3; Wed, 27 Jan 2016 19:19:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B0CC9185E; Wed, 27 Jan 2016 19:19:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A4B8B14DE; Wed, 27 Jan 2016 19:19:48 +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 6BEAA145F7; Wed, 27 Jan 2016 19:19:48 +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 EcrUHvg-DO2r; Wed, 27 Jan 2016 19:19:45 +0000 (UTC) Subject: Re: svn commit: r294915 - head/sys/conf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4B6B3145EF To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601271446.u0REkUOi081035@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56A91853.30103@FreeBSD.org> Date: Wed, 27 Jan 2016 11:19:47 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601271446.u0REkUOi081035@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PLX2CKJtVGdeHtcbJ3XXXkWLgeBOQATKL" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 19:19:49 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PLX2CKJtVGdeHtcbJ3XXXkWLgeBOQATKL Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 1/27/2016 6:46 AM, Hans Petter Selasky wrote: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/kern.post.mk Wed Jan 27 14:16:13 2016 (r294914) > +++ head/sys/conf/kern.post.mk Wed Jan 27 14:46:30 2016 (r294915) > @@ -186,12 +186,23 @@ genassym.o: $S/$M/$M/genassym.c > =20 > ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h > =20 > +# Normal files first > +CFILES_NORMAL=3D ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*:N*/c= ompat/linuxkpi/common/*:N*/ofed/*:N*/dev/mlx5/*} > +SFILES_NORMAL=3D ${SFILES:N*/cddl/*} > + > # We have "special" -I include paths for zfs/dtrace files in 'depend'.= > -CFILES_NOCDDL=3D ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*} > -SFILES_NOCDDL=3D ${SFILES:N*/cddl/*} > CFILES_CDDL=3D ${CFILES:M*/cddl/*} > SFILES_CDDL=3D ${SFILES:M*/cddl/*} > =20 > +# We have "special" -I include paths for LinuxKPI. > +CFILES_LINUXKPI=3D${CFILES:M*/compat/linuxkpi/common/*} > + > +# We have "special" -I include paths for OFED. > +CFILES_OFED=3D${CFILES:M*/ofed/*} > + > +# We have "special" -I include paths for MLX5. > +CFILES_MLX5=3D${CFILES:M*/dev/mlx5/*} > + > kernel-depend: .depend > # The argument list can be very long, so use make -V and xargs to > # pass it to mkdep. > @@ -220,12 +231,20 @@ DEPENDFILES_OBJS=3D ${DEPENDOBJS:O:u:C/^/. > .depend: .PRECIOUS ${SRCS} > .if ${MK_FAST_DEPEND} =3D=3D "no" > rm -f ${.TARGET}.tmp > - ${MAKE} -V CFILES_NOCDDL -V SYSTEM_CFILES -V GEN_CFILES | \ > +# C files > + ${MAKE} -V CFILES_NORMAL -V SYSTEM_CFILES -V GEN_CFILES | \ > CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${CFLAGS} > ${MAKE} -V CFILES_CDDL | \ > CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_CFLAGS}= \ > ${FBT_CFLAGS} ${DTRACE_CFLAGS} > - ${MAKE} -V SFILES_NOCDDL | \ > + ${MAKE} -V CFILES_LINUXKPI | \ > + CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \ > + ${CFLAGS} ${LINUXKPI_INCLUDES} > + ${MAKE} -V CFILES_OFED -V CFILES_MLX5 | \ > + CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \ > + ${CFLAGS} ${OFEDINCLUDES} > +# Assembly files > + ${MAKE} -V SFILES_NORMAL | \ > CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ASM_CFLAGS}= > ${MAKE} -V SFILES_CDDL | \ > CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_ASM_CFL= AGS} >=20 I plan to nuke this code quite soon in favor of FAST_DEPEND. None of this or related hacks will be needed anymore. --=20 Regards, Bryan Drewery --PLX2CKJtVGdeHtcbJ3XXXkWLgeBOQATKL 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 iQEcBAEBAgAGBQJWqRhTAAoJEDXXcbtuRpfPwbAIAKVqIlZdHb/CzFsvIINKl7AM q/lzXlEMKeMU0B2eQQOI9GaJGEBsBi2Var+poQszkCGX/fHchNgs4opW8Xg3rc/o xnQ6AlVlJavCpIfMDDL+bHkfAjL5mSY0G6NdbkzlIDhuQoWXnD5bCzYIHaAAC3C7 ubWwlESs+ldrkvxV/SGrJehBY0wCNvsBwC62ZaCMH3nNnM8blFi4nZ8f9z0KP/Wv e+E5h2gR+uXGW0neHm/AmgUalwzO2VuCLHLBQaFwza/oW0oLstp2wXv47dt40e7M lFsvkGDAxUFXIUZv7H4IMTfgsgQgJRfrdOyOzCpyqcyELlYcRmCLyt3NIc9g68w= =3kJ4 -----END PGP SIGNATURE----- --PLX2CKJtVGdeHtcbJ3XXXkWLgeBOQATKL-- From owner-svn-src-head@freebsd.org Wed Jan 27 19:55:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A55FA70285; Wed, 27 Jan 2016 19:55:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E59913E3; Wed, 27 Jan 2016 19:55:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RJt37e073846; Wed, 27 Jan 2016 19:55:03 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RJt3Jk073845; Wed, 27 Jan 2016 19:55:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201601271955.u0RJt3Jk073845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 27 Jan 2016 19:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294934 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 19:55:04 -0000 Author: mjg Date: Wed Jan 27 19:55:02 2016 New Revision: 294934 URL: https://svnweb.freebsd.org/changeset/base/294934 Log: ktrace: tidy up ktrstruct - minor style fixes - avoid doing strlen twice [1] PR: 206648 Submitted by: C Turt (original version) [1] Modified: head/sys/kern/kern_ktrace.c Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Wed Jan 27 19:11:11 2016 (r294933) +++ head/sys/kern/kern_ktrace.c Wed Jan 27 19:55:02 2016 (r294934) @@ -757,15 +757,16 @@ ktrstruct(name, data, datalen) size_t datalen; { struct ktr_request *req; - char *buf = NULL; - size_t buflen; + char *buf; + size_t buflen, namelen; - if (!data) + if (data == NULL) datalen = 0; - buflen = strlen(name) + 1 + datalen; + namelen = strlen(name) + 1; + buflen = namelen + datalen; buf = malloc(buflen, M_KTRACE, M_WAITOK); strcpy(buf, name); - bcopy(data, buf + strlen(name) + 1, datalen); + bcopy(data, buf + namelen, datalen); if ((req = ktr_getrequest(KTR_STRUCT)) == NULL) { free(buf, M_KTRACE); return; From owner-svn-src-head@freebsd.org Wed Jan 27 20:20:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67EB5A70990; Wed, 27 Jan 2016 20:20:36 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 394001101; Wed, 27 Jan 2016 20:20:36 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RKKZLW080081; Wed, 27 Jan 2016 20:20:35 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RKKZET080080; Wed, 27 Jan 2016 20:20:35 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201601272020.u0RKKZET080080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 27 Jan 2016 20:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294935 - head/gnu/lib/libgcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 20:20:36 -0000 Author: kan Date: Wed Jan 27 20:20:35 2016 New Revision: 294935 URL: https://svnweb.freebsd.org/changeset/base/294935 Log: Make .debug file for libgcc_s.so.1 more useful. The files compiled into libgcc_s.so.1 did not have -g on compiler command line, making generated .debug quite pointless. Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Wed Jan 27 19:55:02 2016 (r294934) +++ head/gnu/lib/libgcc/Makefile Wed Jan 27 20:20:35 2016 (r294935) @@ -211,7 +211,7 @@ COMMONHDRS+= unwind.h HIDE = -fvisibility=hidden -DHIDE_EXPORTS CC_T = ${CC} -c ${CFLAGS} ${HIDE} -fPIC CC_P = ${CC} -c ${CFLAGS} ${HIDE} -p -fPIC -CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DSHARED +CC_S = ${CC} -c ${CFLAGS} ${SHARED_CFLAGS} ${PICFLAG} -DSHARED #----------------------------------------------------------------------- # From owner-svn-src-head@freebsd.org Wed Jan 27 20:20:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92B60A709A6; Wed, 27 Jan 2016 20:20:38 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6674E1105; Wed, 27 Jan 2016 20:20:38 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RKKbNh080623; Wed, 27 Jan 2016 20:20:37 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RKKbwr080622; Wed, 27 Jan 2016 20:20:37 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201601272020.u0RKKbwr080622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 27 Jan 2016 20:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294936 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 20:20:38 -0000 Author: kan Date: Wed Jan 27 20:20:37 2016 New Revision: 294936 URL: https://svnweb.freebsd.org/changeset/base/294936 Log: Do not unlock rtld_phdr_lock over callback invocations. The dl_iterate_phdr consumer code in libgcc does not expect multiple callbacks running concurrently. This was fixed once already in r178807, but accidentally got reverted in r294373. Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Jan 27 20:20:35 2016 (r294935) +++ head/libexec/rtld-elf/rtld.c Wed Jan 27 20:20:37 2016 (r294936) @@ -3533,11 +3533,9 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac TAILQ_INSERT_AFTER(&obj_list, obj, &marker, next); rtld_fill_dl_phdr_info(obj, &phdr_info); lock_release(rtld_bind_lock, &bind_lockstate); - lock_release(rtld_phdr_lock, &phdr_lockstate); error = callback(&phdr_info, sizeof phdr_info, param); - wlock_acquire(rtld_phdr_lock, &phdr_lockstate); rlock_acquire(rtld_bind_lock, &bind_lockstate); obj = globallist_next(&marker); TAILQ_REMOVE(&obj_list, &marker, next); @@ -3551,9 +3549,9 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac if (error == 0) { rtld_fill_dl_phdr_info(&obj_rtld, &phdr_info); lock_release(rtld_bind_lock, &bind_lockstate); - lock_release(rtld_phdr_lock, &phdr_lockstate); error = callback(&phdr_info, sizeof(phdr_info), param); } + lock_release(rtld_phdr_lock, &phdr_lockstate); return (error); } From owner-svn-src-head@freebsd.org Wed Jan 27 20:23:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7BEDA70B73; Wed, 27 Jan 2016 20:23:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8115B1758; Wed, 27 Jan 2016 20:23:43 +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 u0RKNgEg082747; Wed, 27 Jan 2016 20:23:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RKNgZW082746; Wed, 27 Jan 2016 20:23:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601272023.u0RKNgZW082746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Jan 2016 20:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294937 - head/share/vt/fonts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 20:23:43 -0000 Author: emaste Date: Wed Jan 27 20:23:42 2016 New Revision: 294937 URL: https://svnweb.freebsd.org/changeset/base/294937 Log: Replace prebuilt uuencoded gallant.fnt with editable hex version Added: head/share/vt/fonts/gallant.hex (contents, props changed) Deleted: head/share/vt/fonts/gallant.fnt.uu Added: head/share/vt/fonts/gallant.hex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/gallant.hex Wed Jan 27 20:23:42 2016 (r294937) @@ -0,0 +1,226 @@ +# $FreeBSD$ +# Width: 12 +# Height: 22 +0000:000000007fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe000000000000000000000 +0001:000000000000000000000000000006000f001f803fc07fe07fe03fc01f800f00060000000000000000000000 +0002:00000000000000000000000055402aa055402aa055402aa055402aa055402aa0554000000000000000000000 +0003:000000000000000000004400440044007c0044004400440003e0008000800080008000800080000000000000 +0004:000000000000000000007c0040004000780040004000400003e00200020003c0020002000200000000000000 +0005:00000000000000000000380044004000400040004400380003c00220022003c0028002400220000000000000 +0006:000000000000000000004000400040004000400040007c0003e00200020003c0020002000200000000000000 +0007:000000000e00170023806180618071003a001c00000000000000000000000000000000000000000000000000 +0008:0000000000000000000006000600060006007fe07fe0060006000600060000007fe07fe00000000000000000 +0009:0000000000000000000044006400640054004c004c00440002000200020002000200020003e0000000000000 +000a:00000000000000000000440044004400280028001000100003e0008000800080008000800080000000000000 +000b:0600060006000600060006000600060006000600fe00fe000000000000000000000000000000000000000000 +000c:0000000000000000000000000000000000000000fe00fe000600060006000600060006000600060006000600 +000d:000000000000000000000000000000000000000007f007f00600060006000600060006000600060006000600 +000e:060006000600060006000600060006000600060007f007f00000000000000000000000000000000000000000 +000f:0600060006000600060006000600060006000600fff0fff00600060006000600060006000600060006000600 +0010:0000fff0fff00000000000000000000000000000000000000000000000000000000000000000000000000000 +0011:000000000000000000000000fff0fff000000000000000000000000000000000000000000000000000000000 +0012:0000000000000000000000000000000000000000fff0fff00000000000000000000000000000000000000000 +0013:00000000000000000000000000000000000000000000000000000000fff0fff0000000000000000000000000 +0014:0000000000000000000000000000000000000000000000000000000000000000000000000000fff0fff00000 +0015:060006000600060006000600060006000600060007f007f00600060006000600060006000600060006000600 +0016:0600060006000600060006000600060006000600fe00fe000600060006000600060006000600060006000600 +0017:0600060006000600060006000600060006000600fff0fff00000000000000000000000000000000000000000 +0018:0000000000000000000000000000000000000000fff0fff00600060006000600060006000600060006000600 +0019:0600060006000600060006000600060006000600060006000600060006000600060006000600060006000600 +001a:00000000000000000000000000e007801e00780078001e00078000e000007fe07fe000000000000000000000 +001b:00000000000000000000000070001e00078001e001e007801e00700000007fe07fe000000000000000000000 +001c:00000000000000000000000000003fe07fc019801980198019803180318031c060c000000000000000000000 +001d:000000000000000000000000004000c001807fc07fc006000c007fc07fc03000600040000000000000000000 +001e:000006000c00100010003000300030003e007c0018001800180018003f203fe031c000000000000000000000 +001f:0000000000000000000000000000000000000000000006000600000000000000000000000000000000000000 +0020:0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0021:0000000006000600060006000600060006000600060006000600000000000600060000000000000000000000 +0022:0000000019801980198019801980198000000000000000000000000000000000000000000000000000000000 +0023:0000000003300330033006601ff01ff00cc00cc0198019807fc07fc033006600660000000000000000000000 +0024:0000000006001f803fc066e0666066003e001f8007c00660066066607fc03f80060000000000000000000000 +0025:00000000386044c044c0458039800300030006000c000c0019c01a203220322061c000000000000000000000 +0026:0000000007000f8018c018c018c00f801e003e007700636061e061c061803fe01e6000000000000000000000 +0027:000000000c001e001e00060006000c0018001000000000000000000000000000000000000000000000000000 +0028:0000000000c0018003800300070006000600060006000600070003000380018000c000000000000000000000 +0029:00000000300018001c000c000e00060006000600060006000e000c001c001800300000000000000000000000 +002a:0000000000000000000000000f000600666076e019800000198076e0666006000f0000000000000000000000 +002b:000000000000000000000000000006000600060006007fe07fe0060006000600060000000000000000000000 +002c:000000000000000000000000000000000000000000000000000000000c001e001e00060006000c0018001000 +002d:000000000000000000000000000000000000000000007fe07fe0000000000000000000000000000000000000 +002e:00000000000000000000000000000000000000000000000000000c001e001e000c0000000000000000000000 +002f:00000000006000c000c0018001800300030006000c000c001800180030003000600000000000000000000000 +0030:0000000007000f80118010c030c030c030c030c030c030c030c0308018801f000e0000000000000000000000 +0031:00000000020006000e001e0036000600060006000600060006000600060006003fc000000000000000000000 +0032:000000001f003f8061c040c000c000c000c00180030006000c00180030207fe07fe000000000000000000000 +0033:000000000f801fc020e04060006000e007c00fc000e000600060406060403f801f0000000000000000000000 +0034:0000000001800380038005800580098009801180118021803fe07fe001800180018000000000000000000000 +0035:000000000fc00fc01000100020003f8031c000e00060006000604060606030c01f8000000000000000000000 +0036:0000000007000c00180030003000600067806fc070e060606060606070403f801f0000000000000000000000 +0037:000000001fe03fe06040004000c0008000800180010001000300020002000600040000000000000000000000 +0038:000000000f00118030c030c030c018800d0006000b00118030c030c030c018800f0000000000000000000000 +0039:000000000f8011c020e060606060606070e03f601e60006000c000c0018007003c0000000000000000000000 +003a:00000000000000000000000000000c001e001e000c00000000000c001e001e000c0000000000000000000000 +003b:000000000000000000000000000000000c001e001e000c00000000000c001e001e00060006000c0018001000 +003c:0000000000000000000000000000006001c007001e00780078001e00070001c0006000000000000000000000 +003d:0000000000000000000000000000000000007fc07fc0000000007fc07fc00000000000000000000000000000 +003e:0000000000000000000000000000600038001e00078001e001e007801e003800600000000000000000000000 +003f:000000000f001f8039c020c000c000c00180030006000c000c00000000000c000c0000000000000000000000 +0040:000000000000000000000f803fc03060606067206fa06ca06ca067e0600030003fe00fe00000000000000000 +0041:000000000000060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000 +0042:000000000000ff00608060c060c060c061807f8060c0606060606060606060c0ff8000000000000000000000 +0043:0000000000000fc01060202020006000600060006000600060002000302018400f8000000000000000000000 +0044:000000000000ff0061c060c06060606060606060606060606060606060406180fe0000000000000000000000 +0045:0000000000007fc0304030403000300030803f803080300030003000302030207fe000000000000000000000 +0046:0000000000007fc0304030403000300030803f80308030003000300030003000780000000000000000000000 +0047:0000000000000fc0106020202000600060006000600061f060602060306018600f8000000000000000000000 +0048:000000000000f0f0606060606060606060607fe0606060606060606060606060f0f000000000000000000000 +0049:0000000000001f800600060006000600060006000600060006000600060006001f8000000000000000000000 +004a:0000000000001f80060006000600060006000600060006000600060006000600060006000600040038003000 +004b:000000000000f0e06180630066006c00780078007c006e006700638061c060e0f07000000000000000000000 +004c:00000000000078003000300030003000300030003000300030003000302030207fe000000000000000000000 +004d:000000000000e07060e070e070e070e05960596059604d604e604e6044604460e4f000000000000000000000 +004e:000000000000c07060207020782058204c2046204720432041a040e040e04060e03000000000000000000000 +004f:0000000000000f0011c020c020606060606060606060606060602040304018800f0000000000000000000000 +0050:0000000000007f8030c030603060306030c03780300030003000300030003000780000000000000000000000 +0051:0000000000000f0011c020c02060606060606060606060606060304038401f800e001f00239001e000000000 +0052:000000000000ff00618060c060c060c060807f007c006e006700638061c060e0f07000000000000000000000 +0053:0000000000001fe030606020602070003c001e00078001c000e04060406060c07f8000000000000000000000 +0054:0000000000007fe04620060006000600060006000600060006000600060006001f8000000000000000000000 +0055:000000000000f070602060206020602060206020602060206020602070403fc01f8000000000000000000000 +0056:000000000000e0e060403080308030801900190019000c000e000e0004000400040000000000000000000000 +0057:000000000000fef066206620662076207740334037403bc03b80198019801980198000000000000000000000 +0058:000000000000f07060203040388018800d00060006000b00118011c020c04060e0f000000000000000000000 +0059:000000000000f07060203040188018800d0006000600060006000600060006000f0000000000000000000000 +005a:0000000000003fe020c000c00180018003000300060006000c000c00180018203fe000000000000000000000 +005b:0000000007c007c00600060006000600060006000600060006000600060007c007c000000000000000000000 +005c:000000006000600030003000180018000c000c000600030003000180018000c000c000000000000000000000 +005d:000000007c007c000c000c000c000c000c000c000c000c000c000c000c007c007c0000000000000000000000 +005e:0000000004000e001b00318060c0000000000000000000000000000000000000000000000000000000000000 +005f:000000000000000000000000000000000000000000000000000000000000000000000000ffe0ffe000000000 +0060:0000000001000300060006000780078003000000000000000000000000000000000000000000000000000000 +0061:00000000000000000000000000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000 +0062:0000000020006000e0006000600067806fc070e06060606060606060706078c04f8000000000000000000000 +0063:00000000000000000000000000001f8031c020c06000600060006000704030c01f8000000000000000000000 +0064:00000000006000e00060006000600f6031e020e0606060606060606070e039601e7000000000000000000000 +0065:00000000000000000000000000000f0030c0606060607fe060006000300018600f8000000000000000000000 +0066:00000000038004c004c00c000c000c000c001f800c000c000c000c000c000c001e0000000000000000000000 +0067:00000000000000000000000000001f2031e060c060c060c031803f0060007fc03fe02060402040207fc03f80 +0068:0000000010003000700030003000378039c030c030c030c030c030c030c030c079e000000000000000000000 +0069:00000000000006000600000000001e00060006000600060006000600060006001f8000000000000000000000 +006a:00000000000000c000c00000000003c000c000c000c000c000c000c000c000c000c020c030c038801f000e00 +006b:000000006000e00060006000600061c0630066007c0078007c006e0067006380f1e000000000000000000000 +006c:000000001e0006000600060006000600060006000600060006000600060006001f8000000000000000000000 +006d:0000000000000000000000000000ddc06ee06660666066606660666066606660ef7000000000000000000000 +006e:0000000000000000000000000000278079c030c030c030c030c030c030c030c079e000000000000000000000 +006f:00000000000000000000000000000f8011c020e06060606060606060704038801f0000000000000000000000 +0070:0000000000000000000000000000ef8071c060e06060606060606060604070807f006000600060006000f000 +0071:00000000000000000000000000000f2011e020e06060606060606060706038e01fe0006000600060006000f0 +0072:0000000000000000000000000000738034c038c0300030003000300030003000780000000000000000000000 +0073:00000000000000000000000000001fc030c0304038001e00078001c020c030c03f8000000000000000000000 +0074:0000000000000000040004000c007fc00c000c000c000c000c000c000c200e40078000000000000000000000 +0075:000000000000000000000000000079e030c030c030c030c030c030c030c039c01e6000000000000000000000 +0076:0000000000000000000000000000f070602030403040188018800d000d000600060000000000000000000000 +0077:0000000000000000000000000000ff7066206620662037403b403b4019801980198000000000000000000000 +0078:0000000000000000000000000000f8f0704038801d000e0007000b8011c020e0f1f000000000000000000000 +0079:0000000000000000000000000000f0f0602030403040188018800d000d000600060004000c00080078007000 +007a:00000000000000000000000000007fe060e041c0038007000e001c00382070607fe000000000000000000000 +007b:0000000001c0030003000180018001800300070003000180018001800300030001c000000000000000000000 +007c:0000000006000600060006000600060006000600060006000600060006000600060006000600060006000600 +007d:0000000038000c000c001800180018000c000e000c001800180018000c000c00380000000000000000000000 +007e:00000000000000000000000000000000000000001c203e6036c067c043800000000000000000000000000000 +007f:aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550 +00a1:0000000000000600060000000000060006000600060006000600060006000600060006000000000000000000 +00a2:00000000000001000100030002001f003780258064006c006800788039801f00100030002000200000000000 +00a3:000006000c00100010003000300030003e007c0018001800180018003f203fe031c000000000000000000000 +00a4:00000000000000000000602077403b8011c030c030c038801dc02ee040600000000000000000000000000000 +00a5:000000000000f07060203040188018800d0006003fc006003fc00600060006000f0000000000000000000000 +00a6:0000000006000600060006000600060006000600060000000000060006000600060006000600060006000600 +00a7:000000000fe01860302038201e001f8031c060e0706038c01f80078041c040c061807f000000000000000000 +00a8:1980198000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00a9:0000000000000f00108020402f4059a059a05820582059a059a02f40204010800f0000000000000000000000 +00aa:0000000000000e001f0013800f80198031803fc01ec0000000003fe07fc00000000000000000000000000000 +00ab:000000000000000000000000000000000220044008801100330019800cc00660000000000000000000000000 +00ac:0000000000000000000000000000000000007fe07fe000600060006000600000000000000000000000000000 +00ad:000000000000000000000000000000000000000000001f801f80000000000000000000000000000000000000 +00ae:0000000000000f00108020403f4059a059a05fa05b205b2059a039c0204010800f0000000000000000000000 +00af:3fc03fc000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00b0:000000000e00170023806180618071003a001c00000000000000000000000000000000000000000000000000 +00b1:0000000000000000000006000600060006007fe07fe0060006000600060000007fe07fe00000000000000000 +00b2:0000000000000e001f001300030006000c0018001f001f000000000000000000000000000000000000000000 +00b3:0000000000000e001f00130003000600030013001f000e000000000000000000000000000000000000000000 +00b4:03800f001c000000000000000000000000000000000000000000000000000000000000000000000000000000 +00b5:000000000000000000000000000079e030c030c030c030c030c030c030c039c03e6030003000300030006000 +00b6:0000000000001fc03ec07ec07ec07ec03ec01ec006c006c006c006c006c006c006c000000000000000000000 +00b7:000000000000000000000000000000000000000006000f000f00060000000000000000000000000000000000 +00b8:0000000000000000000000000000000000000000000000000000000000000000000002000300018009800700 +00b9:00000000000006000e000e00060006000600060006000f000000000000000000000000000000000000000000 +00ba:00000000000007000b8011c030c030c038801d000e00000000003fe07fc00000000000000000000000000000 +00bb:000000000000000000000000000000006600330019800cc00880110022004400000000000000000000000000 +00bc:000018003800380018001820186018c019803f4006c00dc019c032c064c047e000c000c00000000000000000 +00bd:000018003800380018001820186018c019803fc007e00f601a6030c06180430003e003e00000000000000000 +00be:000038007c004c000c0018200c604cc07d803b4006c00dc019c032c064c047e000c000c00000000000000000 +00bf:00000000000003000300000000000300030006000c00180030003000304039c01f800f000000000000000000 +00c0:1c000f000380060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000 +00c1:03800f001c00060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000 +00c2:06000f001980060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000 +00c3:0cc01f803300060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000 +00c4:198019800000060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000 +00c5:06000f0019800f0006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000 +00c6:0000000000000fe00e20162016001600164027c026403e002600460046104610e7f000000000000000000000 +00c7:0000000000000fc01060202020006000600060006000600060002000302018400f8002000300018009800700 +00c8:1c000f0003807fc0304030403000300030803f803080300030003000302030207fe000000000000000000000 +00c9:03800f001c007fc0304030403000300030803f803080300030003000302030207fe000000000000000000000 +00ca:06000f0019807fc0304030403000300030803f803080300030003000302030207fe000000000000000000000 +00cb:1980198000007fc0304030403000300030803f803080300030003000302030207fe000000000000000000000 +00cc:1c000f0003801f800600060006000600060006000600060006000600060006001f8000000000000000000000 +00cd:03800f001c001f800600060006000600060006000600060006000600060006001f8000000000000000000000 +00ce:06000f0019801f800600060006000600060006000600060006000600060006001f8000000000000000000000 +00cf:1980198000001f800600060006000600060006000600060006000600060006001f8000000000000000000000 +00d0:000000000000ff0061c060c0606060606060f860f86060606060606060406180fe0000000000000000000000 +00d1:0cc01f803300c07060207020782058204c2046204720432041a040e040e04060e03000000000000000000000 +00d2:1c000f0003800f0011c020c020606060606060606060606060602040304018800f0000000000000000000000 +00d3:03800f001c000f0011c020c020606060606060606060606060602040304018800f0000000000000000000000 +00d4:06000f0019800f0011c020c020606060606060606060606060602040304018800f0000000000000000000000 +00d5:0cc01f8033000f0011c020c020606060606060606060606060602040304018800f0000000000000000000000 +00d6:1980198000000f0011c020c020606060606060606060606060602040304018800f0000000000000000000000 +00d7:0000000000000000000000000000606030c019800f0006000f00198030c06060000000000000000000000000 +00d8:0000000000600fc011c021c021e06360636066606c606c6078603840304038806f0000000000000000000000 +00d9:1c000f000380f070602060206020602060206020602060206020602070403fc01f8000000000000000000000 +00da:03800f001c00f070602060206020602060206020602060206020602070403fc01f8000000000000000000000 +00db:06000f001980f070602060206020602060206020602060206020602070403fc01f8000000000000000000000 +00dc:198019800000f070602060206020602060206020602060206020602070403fc01f8000000000000000000000 +00dd:03800f001c00f07060203040188018800d0006000600060006000600060006000f0000000000000000000000 +00de:0000000000007800300030003f8030c0306030603060306030c03f8030003000780000000000000000000000 +00df:000000000f0019801980318031803380360036003600338031c030e03460366077c000000000000000000000 +00e0:0000000000001c000f00038000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000 +00e1:00000000000003800f001c0000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000 +00e2:00000000000006000f00198000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000 +00e3:0000000000000cc01f80330000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000 +00e4:00000000000019801980000000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000 +00e5:000006000f0019800f00060000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000 +00e6:00000000000000000000000000001f80364026600e603fe066006600660067603fc000000000000000000000 +00e7:00000000000000000000000000001f8031c020c06000600060006000704030c01f8002000300018009800700 +00e8:0000000000001c000f00038000000f0030c0606060607fe060006000300018600f8000000000000000000000 +00e9:00000000000003800f001c0000000f0030c0606060607fe060006000300018600f8000000000000000000000 +00ea:00000000000006000f00198000000f0030c0606060607fe060006000300018600f8000000000000000000000 +00eb:00000000000019801980000000000f0030c0606060607fe060006000300018600f8000000000000000000000 +00ec:0000000000001c000f00038000001e00060006000600060006000600060006001f8000000000000000000000 +00ed:00000000000003800f001c0000001e00060006000600060006000600060006001f8000000000000000000000 +00ee:00000000000006000f00198000001e00060006000600060006000600060006001f8000000000000000000000 +00ef:00000000000019801980000000001e00060006000600060006000600060006001f8000000000000000000000 +00f0:0000000030c01f8006001f00318001c00fc010e020e0606060606060704038801f0000000000000000000000 +00f1:0000000000000cc01f8033000000278079c030c030c030c030c030c030c030c079e000000000000000000000 +00f2:0000000000001c000f00038000000f8011c020e06060606060606060704038801f0000000000000000000000 +00f3:00000000000003800f001c0000000f8011c020e06060606060606060704038801f0000000000000000000000 +00f4:00000000000006000f00198000000f8011c020e06060606060606060704038801f0000000000000000000000 +00f5:0000000000000cc01f80330000000f8011c020e06060606060606060704038801f0000000000000000000000 +00f6:00000000000019801980000000000f8011c020e06060606060606060704038801f0000000000000000000000 +00f7:000000000000000000000000000006000600000000007fe07fe0000000000600060000000000000000000000 +00f8:00000000000000000000000000000fe011c021e06360666066606c60784038807f0000000000000000000000 +00f9:0000000000001c000f000380000079e030c030c030c030c030c030c030c039c01e6000000000000000000000 +00fa:00000000000003800f001c00000079e030c030c030c030c030c030c030c039c01e6000000000000000000000 +00fb:00000000000006000f001980000079e030c030c030c030c030c030c030c039c01e6000000000000000000000 +00fc:000000000000198019800000000079e030c030c030c030c030c030c030c039c01e6000000000000000000000 +00fd:00000000000003800f001c000000f0f0602030403040188018800d000d000600060004000c00080078007000 +00fe:00000000e00060006000600060006f8071c060e06060606060606060604070807f006000600060006000f000 +00ff:0000000000001980198000000000f0f0602030403040188018800d000d000600060004000c00080078007000 From owner-svn-src-head@freebsd.org Wed Jan 27 20:24:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18670A70BEE; Wed, 27 Jan 2016 20:24:58 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [IPv6:2607:f8b0:400d:c04::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 C423B18FB; Wed, 27 Jan 2016 20:24:57 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qg0-x230.google.com with SMTP id 6so16966948qgy.1; Wed, 27 Jan 2016 12:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=W05UFFYbf1M/1+Xifl4uKZPlOVsyatg6mJlCmp9sBnU=; b=0QZLZczXvh6uYsNSrPs222p0dbzhAdJuVRvu0eBQIpfDLYcBvXyjwkRAU1hwauL1m0 cgMdqJVbs57SZf9fGRW4f/txVCQqB6vIvJN6MlDflOGCRGjrLVPGHT23deln0X8bz5mw bj5ZX3G9y30m9L4wAcCUHBvUS9a7TWkWhS3+0M7jFRAPSk748k3GZ278IRqeVJ5QCiOb HOpUuGErOCZo94+Dn4ho2SRhCUS1VZwyewrbOdg/rF9uooDa5PY2QqoOqHVuhmVM6pIY IB4dqnsmZIybFL5p4AWCgZtLhEXr2II1J4NiZWLBkdXgNlNJHnubtfOTMwe+QFCVpfmV xpVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type; bh=W05UFFYbf1M/1+Xifl4uKZPlOVsyatg6mJlCmp9sBnU=; b=RqAifFWIlRvkc2ivpa0q2rDcb+XFdaxru2mFsXtj1qY1Qzn1bBCKr8/otLEtyfEE4W 9zxlhbwMeYBI2yii4VI8uoRriX3YflGCPVUQEFkribwdjAnK4HfTCUmVT00/p34si1+G TMSaKfjYmKMh9FSnY6LP/2lwffwWpYMoFwAiCSWAcJVIcVxk+vBbjmF1/OytO1P+AuMT bKaWs9jNuu8B8m0q0+4MDQCBKSJnK7huO9EcLjV2WENBBxf5Ol+0yW3gh66RWtvAjI59 man1lSicx8wKMadQRQdhFnS+R+aSCpQ6W2mQxZWhuNBq+SgCvQ+Nri5JeL2beUXxImH3 CdaA== X-Gm-Message-State: AG10YOR2DsZR84JnOICSlc8oHLesHHL12bgaVIAa6K+zdLbAtGtTdlU/05ZzcdtJ2neRUg== X-Received: by 10.140.86.243 with SMTP id p106mr38136132qgd.1.1453926296630; Wed, 27 Jan 2016 12:24:56 -0800 (PST) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id e187sm2381559qka.1.2016.01.27.12.24.55 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jan 2016 12:24:55 -0800 (PST) Date: Wed, 27 Jan 2016 15:24:34 -0500 From: Alexander Kabaev To: Alexander Kabaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294936 - head/libexec/rtld-elf Message-ID: <20160127152434.1c8a4d18@kan> In-Reply-To: <201601272020.u0RKKbwr080622@repo.freebsd.org> References: <201601272020.u0RKKbwr080622@repo.freebsd.org> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/3s2Kg5N=S344cG18g0e/Q6a"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 20:24:58 -0000 --Sig_/3s2Kg5N=S344cG18g0e/Q6a Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 27 Jan 2016 20:20:37 +0000 (UTC) Alexander Kabaev wrote: > Author: kan > Date: Wed Jan 27 20:20:37 2016 > New Revision: 294936 > URL: https://svnweb.freebsd.org/changeset/base/294936 >=20 > Log: > Do not unlock rtld_phdr_lock over callback invocations. > =20 > The dl_iterate_phdr consumer code in libgcc does not expect multiple > callbacks running concurrently. This was fixed once already in > r178807, but accidentally got reverted in r294373. >=20 > Modified: > head/libexec/rtld-elf/rtld.c >=20 I lost the commit message through wonders of svn dcommit somehow. This should have been: Reviewed by: kib Tested by: kib, davide --=20 Alexander Kabaev --Sig_/3s2Kg5N=S344cG18g0e/Q6a Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWqSeDXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+HTUP/3wSltogTXOn4aZXFgMxESsY oqUCupFi2tcj0NqDOol/XpMDH6mfRo8p+z7aT4SFmbvFcLkP9Sp14zGoOAFy7eVc pRTu0wrLBzcPYwLJo+shTkDo8bdVj+3jZefnZS9oCVaeJ4wjWKwncvO0pUwkZc/F eBpBHONv3tN+O8Vb4or5bS4+hWD9/1nbzs2ynvX289FjwL8UD/++eHmo+4pnn1vf +BcIiGhcye9hPEMIjhAtC2AnW31sR0l20LGUW4SUAJHznW0l+jTlojOf8aNKRC0D NhpjvcbGpJ7aDh7UCflAQQLJKsU8iet/xKgSBY5bILqeWsHnnI+/wWGPS1WFWoKG FcNHWihfYWeR1AnSuMJIjwWag+mq1qS2n79PoBTb8vEQsJqSjiVHYtww0PmGLRVF ubML2OCIERm6zZnVx6YxPVe1eIKozp6dn+zkXzcMaMF1ElsvUlebwXJiWygfeOTz pq+p10REhHrmJzB9u39+s/0Z+CyE4yDWd1EZyXNlPy7dnfjqWTBxKoncriDhcDqz m6G14AMaB7biLHS5306+B0k21A/zGJD+FU9FK7Mo1K8P+5FkW1Z3sCb65U98U/R2 6DsKDmlV6rI4GlaC+ZLqn3VXrsci3uC5fHrvaEzm9rO/6D/COD1ZGAE+Iy35GhHW CNzhNPFhf9AHvEAuXArO =94du -----END PGP SIGNATURE----- --Sig_/3s2Kg5N=S344cG18g0e/Q6a-- From owner-svn-src-head@freebsd.org Wed Jan 27 20:34:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92D2CA70FE8; Wed, 27 Jan 2016 20:34:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E327107C; Wed, 27 Jan 2016 20:34:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1FF3B1FE023; Wed, 27 Jan 2016 21:34:01 +0100 (CET) Subject: Re: svn commit: r294915 - head/sys/conf To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601271446.u0REkUOi081035@repo.freebsd.org> <56A91853.30103@FreeBSD.org> From: Hans Petter Selasky Message-ID: <56A92A43.40309@selasky.org> Date: Wed, 27 Jan 2016 21:36:19 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56A91853.30103@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 20:34:05 -0000 On 01/27/16 20:19, Bryan Drewery wrote: > On 1/27/2016 6:46 AM, Hans Petter Selasky wrote: >> ============================================================================== >> --- head/sys/conf/kern.post.mk Wed Jan 27 14:16:13 2016 (r294914) >> +++ head/sys/conf/kern.post.mk Wed Jan 27 14:46:30 2016 (r294915) >> @@ -186,12 +186,23 @@ genassym.o: $S/$M/$M/genassym.c >> >> ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h >> >> +# Normal files first >> +CFILES_NORMAL= ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*:N*/compat/linuxkpi/common/*:N*/ofed/*:N*/dev/mlx5/*} >> +SFILES_NORMAL= ${SFILES:N*/cddl/*} >> + > > I plan to nuke this code quite soon in favor of FAST_DEPEND. None of > this or related hacks will be needed anymore. > OK, I guess you know what you are doing :-) BTW: Have you thought about implementing -jX option for make depend, by splitting the source files which needs depend in to some kind of groups? --HPS From owner-svn-src-head@freebsd.org Wed Jan 27 20:36:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D08ACA6F1AB; Wed, 27 Jan 2016 20:36:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B5FC71507; Wed, 27 Jan 2016 20:36:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id AEA8915C9; Wed, 27 Jan 2016 20:36:14 +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 6D5F914866; Wed, 27 Jan 2016 20:36:14 +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 43l_p4QbiAV5; Wed, 27 Jan 2016 20:36:11 +0000 (UTC) Subject: Re: svn commit: r294915 - head/sys/conf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 5C62A1485E To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601271446.u0REkUOi081035@repo.freebsd.org> <56A91853.30103@FreeBSD.org> <56A92A43.40309@selasky.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56A92A3D.30903@FreeBSD.org> Date: Wed, 27 Jan 2016 12:36:13 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56A92A43.40309@selasky.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="skM5dBeGTFi73SLTHM6Sijco6AbFd7odK" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 20:36:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --skM5dBeGTFi73SLTHM6Sijco6AbFd7odK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 1/27/2016 12:36 PM, Hans Petter Selasky wrote: > On 01/27/16 20:19, Bryan Drewery wrote: >> On 1/27/2016 6:46 AM, Hans Petter Selasky wrote: >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> >>> --- head/sys/conf/kern.post.mk Wed Jan 27 14:16:13 2016 (r29491= 4) >>> +++ head/sys/conf/kern.post.mk Wed Jan 27 14:46:30 2016 (r29491= 5) >>> @@ -186,12 +186,23 @@ genassym.o: $S/$M/$M/genassym.c >>> >>> ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h >>> >>> +# Normal files first >>> +CFILES_NORMAL=3D =20 >>> ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*:N*/compat/linuxkpi/c= ommon/*:N*/ofed/*:N*/dev/mlx5/*} >>> >>> +SFILES_NORMAL=3D ${SFILES:N*/cddl/*} >>> + >=20 >> >> I plan to nuke this code quite soon in favor of FAST_DEPEND. None of >> this or related hacks will be needed anymore. >> >=20 > OK, I guess you know what you are doing :-) >=20 > BTW: Have you thought about implementing -jX option for make depend, by= > splitting the source files which needs depend in to some kind of groups= ? Yes, that was my first implementation. It made the overall build slower. Either way the pre-build dependency calculation isn't needed. It's explained in https://svnweb.freebsd.org/base?view=3Drevision&revision=3D2= 90433 Anyway I was just giving an FYI to anyone who cared. I wrote up an arch@ mail after the previous mail though as it is a more appropriate place. --=20 Regards, Bryan Drewery --skM5dBeGTFi73SLTHM6Sijco6AbFd7odK 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 iQEcBAEBAgAGBQJWqSo9AAoJEDXXcbtuRpfPaRAH/19Bw/u8BnJWnqVy2+ch3Py4 qJHqhv4YY4eYRSn6n24A11nckQnjswo1zf3EtvK+yAU8mrF3OvAanuUmEPMKQDLj s6BTQof/oPNTyjHhVyNIqbhtKw23j/f6qwilS/SXXXFAcm4m/yjzzVThBVi/Qnhj +cTlaFWuoqCoYWwe9rIPTqkLt2TLpmUqGsxbeI+RJlgTV61CJXcbr73AV+p9t4y/ lT6H//maaxSdbPG5o3J138yO6J/Z5dZr7wl3hSLjhF4mTxC1Wl501AQTsY5ixeCv /XFNg5UvTO2PBHdgkZ7IKTlSGr9RTplB5lKM+tmC1+XkdHnUcAjUeLYKV9OdGp0= =X3an -----END PGP SIGNATURE----- --skM5dBeGTFi73SLTHM6Sijco6AbFd7odK-- From owner-svn-src-head@freebsd.org Wed Jan 27 21:12:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBF2DA70114; Wed, 27 Jan 2016 21:12:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id BDB7719A9; Wed, 27 Jan 2016 21:12:19 +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 u0RLCIE7098471; Wed, 27 Jan 2016 21:12:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RLCIDu098470; Wed, 27 Jan 2016 21:12:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601272112.u0RLCIDu098470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 21:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294949 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 21:12:20 -0000 Author: bdrewery Date: Wed Jan 27 21:12:18 2016 New Revision: 294949 URL: https://svnweb.freebsd.org/changeset/base/294949 Log: filemon_ioctl: Handle error from devfs_get_cdevpriv(9). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Wed Jan 27 21:12:02 2016 (r294948) +++ head/sys/dev/filemon/filemon.c Wed Jan 27 21:12:18 2016 (r294949) @@ -143,7 +143,8 @@ filemon_ioctl(struct cdev *dev, u_long c cap_rights_t rights; #endif - devfs_get_cdevpriv((void **) &filemon); + if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) + return (error); switch (cmd) { /* Set the output file descriptor. */ From owner-svn-src-head@freebsd.org Wed Jan 27 21:14:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9422A701EA; Wed, 27 Jan 2016 21:14:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id A0BF61E04; Wed, 27 Jan 2016 21:14:10 +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 u0RLE9lp098690; Wed, 27 Jan 2016 21:14:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RLE919098688; Wed, 27 Jan 2016 21:14:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601272114.u0RLE919098688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 21:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294952 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 21:14:11 -0000 Author: bdrewery Date: Wed Jan 27 21:14:09 2016 New Revision: 294952 URL: https://svnweb.freebsd.org/changeset/base/294952 Log: filemon_ioctl: Lock the associated filemon handle before writing to it. Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Wed Jan 27 21:12:47 2016 (r294951) +++ head/sys/dev/filemon/filemon.c Wed Jan 27 21:14:09 2016 (r294952) @@ -146,6 +146,8 @@ filemon_ioctl(struct cdev *dev, u_long c if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) return (error); + filemon_filemon_lock(filemon); + switch (cmd) { /* Set the output file descriptor. */ case FILEMON_SET_FD: @@ -177,6 +179,7 @@ filemon_ioctl(struct cdev *dev, u_long c break; } + filemon_filemon_unlock(filemon); return (error); } Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Wed Jan 27 21:12:47 2016 (r294951) +++ head/sys/dev/filemon/filemon_wrapper.c Wed Jan 27 21:14:09 2016 (r294952) @@ -115,21 +115,14 @@ filemon_comment(struct filemon *filemon) int len; struct timeval now; - /* Load timestamp before locking. Less accurate but less contention. */ getmicrotime(&now); - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "# filemon version %d\n# Target pid %d\n# Start %ju.%06ju\nV %d\n", FILEMON_VERSION, curproc->p_pid, (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec, FILEMON_VERSION); filemon_output(filemon, filemon->msgbufr, len); - - /* Unlock the found filemon structure. */ - filemon_filemon_unlock(filemon); } static int From owner-svn-src-head@freebsd.org Wed Jan 27 21:17:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76A7BA70306; Wed, 27 Jan 2016 21:17:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2DD631FDA; Wed, 27 Jan 2016 21:17:45 +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 u0RLHiYF098848; Wed, 27 Jan 2016 21:17:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RLHiE6098846; Wed, 27 Jan 2016 21:17:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601272117.u0RLHiE6098846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 21:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294953 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 21:17:45 -0000 Author: bdrewery Date: Wed Jan 27 21:17:43 2016 New Revision: 294953 URL: https://svnweb.freebsd.org/changeset/base/294953 Log: filemon_comment has nothing to do with wrappers so move it out of filemon_wrapper.c. It only prints the header from filemon_ioctl. Keep the name though to stay closer to other implementations. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Wed Jan 27 21:14:09 2016 (r294952) +++ head/sys/dev/filemon/filemon.c Wed Jan 27 21:17:43 2016 (r294953) @@ -105,6 +105,22 @@ static struct cdev *filemon_dev; #include "filemon_wrapper.c" static void +filemon_comment(struct filemon *filemon) +{ + int len; + struct timeval now; + + getmicrotime(&now); + + len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), + "# filemon version %d\n# Target pid %d\n# Start %ju.%06ju\nV %d\n", + FILEMON_VERSION, curproc->p_pid, (uintmax_t)now.tv_sec, + (uintmax_t)now.tv_usec, FILEMON_VERSION); + + filemon_output(filemon, filemon->msgbufr, len); +} + +static void filemon_dtr(void *data) { struct filemon *filemon = data; Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Wed Jan 27 21:14:09 2016 (r294952) +++ head/sys/dev/filemon/filemon_wrapper.c Wed Jan 27 21:17:43 2016 (r294953) @@ -109,22 +109,6 @@ filemon_pid_check(struct proc *p) return (NULL); } -static void -filemon_comment(struct filemon *filemon) -{ - int len; - struct timeval now; - - getmicrotime(&now); - - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), - "# filemon version %d\n# Target pid %d\n# Start %ju.%06ju\nV %d\n", - FILEMON_VERSION, curproc->p_pid, (uintmax_t)now.tv_sec, - (uintmax_t)now.tv_usec, FILEMON_VERSION); - - filemon_output(filemon, filemon->msgbufr, len); -} - static int filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) { From owner-svn-src-head@freebsd.org Wed Jan 27 21:23:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61BABA704E5; Wed, 27 Jan 2016 21:23:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3929213DC; Wed, 27 Jan 2016 21:23:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RLN2LB001779; Wed, 27 Jan 2016 21:23:02 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RLN2Dc001776; Wed, 27 Jan 2016 21:23:02 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201601272123.u0RLN2Dc001776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 27 Jan 2016 21:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294954 - in head/sys: kern ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 21:23:03 -0000 Author: mckusick Date: Wed Jan 27 21:23:01 2016 New Revision: 294954 URL: https://svnweb.freebsd.org/changeset/base/294954 Log: The bread() function was inconsistent about whether it would return a buffer pointer in the event of an error (for some errors it would return a buffer pointer and for other errors it would not return a buffer pointer). The cluster_read() function was similarly inconsistent. Clients of these functions were inconsistent in handling errors. Some would assume that no buffer was returned after an error and would thus lose buffers under certain error conditions. Others would assume that brelse() should always be called after an error and would thus panic the system under certain error conditions. To correct both of these problems with minimal code churn, bread() and cluster_write() now always free the buffer when returning an error thus ensuring that buffers will never be lost. The brelse() routine checks for being passed a NULL buffer pointer and silently returns to avoid panics. Thus both approaches to handling error returns from bread() and cluster_read() will work correctly. Future code should be written assuming that bread() and cluster_read() will never return a buffer with an error, so should not attempt to brelse() the buffer when an error is returned. Reviewed by: kib Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Jan 27 21:17:43 2016 (r294953) +++ head/sys/kern/vfs_bio.c Wed Jan 27 21:23:01 2016 (r294954) @@ -1809,6 +1809,8 @@ breada(struct vnode * vp, daddr_t * rabl * must clear BIO_ERROR and B_INVAL prior to initiating I/O. If B_CACHE * is set, the buffer is valid and we do not have to do anything, see * getblk(). Also starts asynchronous I/O on read-ahead blocks. + * + * Always return a NULL buffer pointer (in bpp) when returning an error. */ int breadn_flags(struct vnode *vp, daddr_t blkno, int size, daddr_t *rablkno, @@ -1844,6 +1846,10 @@ breadn_flags(struct vnode *vp, daddr_t b if (readwait) { rv = bufwait(bp); + if (rv != 0) { + brelse(bp); + *bpp = NULL; + } } return (rv); } @@ -2238,6 +2244,12 @@ brelse(struct buf *bp) { int qindex; + /* + * Many function erroneously call brelse with a NULL bp under rare + * error conditions. Simply return when called with a NULL bp. + */ + if (bp == NULL) + return; CTR3(KTR_BUF, "brelse(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); KASSERT(!(bp->b_flags & (B_CLUSTER|B_PAGING)), Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Wed Jan 27 21:17:43 2016 (r294953) +++ head/sys/kern/vfs_cluster.c Wed Jan 27 21:23:01 2016 (r294954) @@ -119,6 +119,8 @@ cluster_read(struct vnode *vp, u_quad_t * get the requested block */ *bpp = reqbp = bp = getblk(vp, lblkno, size, 0, 0, gbflags); + if (bp == NULL) + return (EBUSY); origblkno = lblkno; /* @@ -295,10 +297,18 @@ cluster_read(struct vnode *vp, u_quad_t curthread->td_ru.ru_inblock++; } - if (reqbp) - return (bufwait(reqbp)); - else - return (error); + if (reqbp) { + /* + * Like bread, always brelse() the buffer when + * returning an error. + */ + error = bufwait(reqbp); + if (error != 0) { + brelse(reqbp); + *bpp = NULL; + } + } + return (error); } /* Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Wed Jan 27 21:17:43 2016 (r294953) +++ head/sys/ufs/ffs/ffs_inode.c Wed Jan 27 21:23:01 2016 (r294954) @@ -113,10 +113,8 @@ loop: fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int) fs->fs_bsize, 0, 0, 0, NOCRED, flags, &bp); if (error != 0) { - if (error != EBUSY) { - brelse(bp); + if (error != EBUSY) return (error); - } KASSERT((IS_SNAPSHOT(ip)), ("EBUSY from non-snapshot")); /* * Wait for our inode block to become available. From owner-svn-src-head@freebsd.org Wed Jan 27 21:27:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B1B0A705B1; Wed, 27 Jan 2016 21:27:07 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3ED117E8; Wed, 27 Jan 2016 21:27:06 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RLR5AA002053; Wed, 27 Jan 2016 21:27:05 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RLR5Ef002052; Wed, 27 Jan 2016 21:27:05 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201601272127.u0RLR5Ef002052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 27 Jan 2016 21:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294956 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 21:27:07 -0000 Author: mckusick Date: Wed Jan 27 21:27:05 2016 New Revision: 294956 URL: https://svnweb.freebsd.org/changeset/base/294956 Log: This fixes a bug in UFS2 exported NFS volumes. An NFS client can crash a server that has exported UFS2 by presenting a filehandle with an inode number that references an uninitialized inode in a cylinder group. The problem is that UFS2 only initializes blocks of inodes as they are first allocated and ffs_fhtovp() does not validate that the inode is in a range of inodes that have been initialized. Attempting to read an uninitialized inode gets random data from the disk. When the kernel tries to interpret it as an inode, panics often arise. Reported by: Christos Zoulas (from NetBSD) Reviewed by: kib Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Wed Jan 27 21:24:45 2016 (r294955) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Jan 27 21:27:05 2016 (r294956) @@ -1797,6 +1797,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags * * Have to be really careful about stale file handles: * - check that the inode number is valid + * - for UFS2 check that the inode number is initialized * - call ffs_vget() to get the locked inode * - check for an unallocated inode (i_mode == 0) * - check that the given client host has export rights and return @@ -1810,13 +1811,37 @@ ffs_fhtovp(mp, fhp, flags, vpp) struct vnode **vpp; { struct ufid *ufhp; + struct ufsmount *ump; struct fs *fs; + struct cg *cgp; + struct buf *bp; + ino_t ino; + u_int cg; + int error; ufhp = (struct ufid *)fhp; - fs = VFSTOUFS(mp)->um_fs; - if (ufhp->ufid_ino < ROOTINO || - ufhp->ufid_ino >= fs->fs_ncg * fs->fs_ipg) + ino = ufhp->ufid_ino; + ump = VFSTOUFS(mp); + fs = ump->um_fs; + if (ino < ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) + return (ESTALE); + /* + * Need to check if inode is initialized because UFS2 does lazy + * initialization and nfs_fhtovp can offer arbitrary inode numbers. + */ + if (fs->fs_magic != FS_UFS2_MAGIC) + return (ufs_fhtovp(mp, ufhp, flags, vpp)); + cg = ino_to_cg(fs, ino); + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), + (int)fs->fs_cgsize, NOCRED, &bp); + if (error) + return (error); + cgp = (struct cg *)bp->b_data; + if (!cg_chkmagic(cgp) || ino >= cg * fs->fs_ipg + cgp->cg_initediblk) { + brelse(bp); return (ESTALE); + } + brelse(bp); return (ufs_fhtovp(mp, ufhp, flags, vpp)); } From owner-svn-src-head@freebsd.org Wed Jan 27 21:37:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20279A7089A; Wed, 27 Jan 2016 21:37:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id E1C591CEC; Wed, 27 Jan 2016 21:37:44 +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 u0RLbhLF005005; Wed, 27 Jan 2016 21:37:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RLbhRW005004; Wed, 27 Jan 2016 21:37:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601272137.u0RLbhRW005004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jan 2016 21:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294957 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 21:37:45 -0000 Author: bdrewery Date: Wed Jan 27 21:37:43 2016 New Revision: 294957 URL: https://svnweb.freebsd.org/changeset/base/294957 Log: filemon_dtr: Lock the associated filemon handle before writing to it. Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Wed Jan 27 21:27:05 2016 (r294956) +++ head/sys/dev/filemon/filemon.c Wed Jan 27 21:37:43 2016 (r294957) @@ -126,14 +126,16 @@ filemon_dtr(void *data) struct filemon *filemon = data; if (filemon != NULL) { - struct file *fp = filemon->fp; + struct file *fp; - /* Get exclusive write access. */ + /* Follow same locking order as filemon_pid_check. */ filemon_lock_write(); + filemon_filemon_lock(filemon); /* Remove from the in-use list. */ TAILQ_REMOVE(&filemons_inuse, filemon, link); + fp = filemon->fp; filemon->fp = NULL; filemon->pid = -1; @@ -141,6 +143,7 @@ filemon_dtr(void *data) TAILQ_INSERT_TAIL(&filemons_free, filemon, link); /* Give up write access. */ + filemon_filemon_unlock(filemon); filemon_unlock_write(); if (fp != NULL) From owner-svn-src-head@freebsd.org Thu Jan 28 00:51:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73CE2A6F94A; Thu, 28 Jan 2016 00:51:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4C01A1DAF; Thu, 28 Jan 2016 00:51:18 +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 u0S0pHtf062033; Thu, 28 Jan 2016 00:51:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S0pHXh062032; Thu, 28 Jan 2016 00:51:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601280051.u0S0pHXh062032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 28 Jan 2016 00:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294965 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 00:51:18 -0000 Author: bdrewery Date: Thu Jan 28 00:51:17 2016 New Revision: 294965 URL: https://svnweb.freebsd.org/changeset/base/294965 Log: filemon: Use process_exit EVENTHANDLER to capture process exit. This fixes some cases where a process could exit without being untracked by filemon. Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 00:41:07 2016 (r294964) +++ head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 00:51:17 2016 (r294965) @@ -29,6 +29,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include "opt_compat.h" @@ -52,12 +53,13 @@ __FBSDID("$FreeBSD$"); #define sys_symlink symlink #define sys_unlink unlink #define sys_vfork vfork -#define sys_sys_exit sys_exit #ifdef FILEMON_HAS_LINKAT #define sys_linkat linkat #endif #endif /* __FreeBSD_version */ +static eventhandler_tag filemon_exit_tag; + static void filemon_output(struct filemon *filemon, char *msg, size_t len) { @@ -485,7 +487,7 @@ filemon_wrapper_freebsd32_stat(struct th #endif static void -filemon_wrapper_sys_exit(struct thread *td, struct sys_exit_args *uap) +filemon_event_process_exit(void *arg __unused, struct proc *p) { size_t len; struct filemon *filemon; @@ -494,14 +496,14 @@ filemon_wrapper_sys_exit(struct thread * /* Get timestamp before locking. */ getmicrotime(&now); - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_pid_check(p)) != NULL) { len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), - "X %d %d\n", curproc->p_pid, uap->rval); + "X %d %d %d\n", p->p_pid, p->p_xexit, p->p_xsig); filemon_output(filemon, filemon->msgbufr, len); /* Check if the monitored process is about to exit. */ - if (filemon->pid == curproc->p_pid) { + if (filemon->pid == p->p_pid) { len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "# Stop %ju.%06ju\n# Bye bye\n", @@ -514,8 +516,6 @@ filemon_wrapper_sys_exit(struct thread * /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - sys_sys_exit(td, uap); } static int @@ -578,7 +578,6 @@ filemon_wrapper_install(void) #endif sv_table[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; - sv_table[SYS_exit].sy_call = (sy_call_t *) filemon_wrapper_sys_exit; sv_table[SYS_execve].sy_call = (sy_call_t *) filemon_wrapper_execve; sv_table[SYS_fork].sy_call = (sy_call_t *) filemon_wrapper_fork; sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; @@ -597,7 +596,6 @@ filemon_wrapper_install(void) sv_table = ia32_freebsd_sysvec.sv_table; sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; - sv_table[FREEBSD32_SYS_exit].sy_call = (sy_call_t *) filemon_wrapper_sys_exit; sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_execve; sv_table[FREEBSD32_SYS_fork].sy_call = (sy_call_t *) filemon_wrapper_fork; sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; @@ -612,6 +610,9 @@ filemon_wrapper_install(void) sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; #endif #endif /* COMPAT_ARCH32 */ + + filemon_exit_tag = EVENTHANDLER_REGISTER(process_exit, + filemon_event_process_exit, NULL, EVENTHANDLER_PRI_LAST); } static void @@ -624,7 +625,6 @@ filemon_wrapper_deinstall(void) #endif sv_table[SYS_chdir].sy_call = (sy_call_t *)sys_chdir; - sv_table[SYS_exit].sy_call = (sy_call_t *)sys_sys_exit; sv_table[SYS_execve].sy_call = (sy_call_t *)sys_execve; sv_table[SYS_fork].sy_call = (sy_call_t *)sys_fork; sv_table[SYS_open].sy_call = (sy_call_t *)sys_open; @@ -643,7 +643,6 @@ filemon_wrapper_deinstall(void) sv_table = ia32_freebsd_sysvec.sv_table; sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *)sys_chdir; - sv_table[FREEBSD32_SYS_exit].sy_call = (sy_call_t *)sys_sys_exit; sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *)freebsd32_execve; sv_table[FREEBSD32_SYS_fork].sy_call = (sy_call_t *)sys_fork; sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open; @@ -658,4 +657,6 @@ filemon_wrapper_deinstall(void) sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *)sys_linkat; #endif #endif /* COMPAT_ARCH32 */ + + EVENTHANDLER_DEREGISTER(process_exit, filemon_exit_tag); } From owner-svn-src-head@freebsd.org Thu Jan 28 01:17:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B89A3A70558; Thu, 28 Jan 2016 01:17: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 mx1.freebsd.org (Postfix) with ESMTPS id 950CA1BF8; Thu, 28 Jan 2016 01:17: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 u0S1HtLx068729; Thu, 28 Jan 2016 01:17:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S1HttT068728; Thu, 28 Jan 2016 01:17:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601280117.u0S1HttT068728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 28 Jan 2016 01:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294967 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 01:17:56 -0000 Author: bdrewery Date: Thu Jan 28 01:17:55 2016 New Revision: 294967 URL: https://svnweb.freebsd.org/changeset/base/294967 Log: filemon: Trace fork via process_fork event. This avoids needing ugly hooks and needing both a vfork and fork handler. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 01:15:57 2016 (r294966) +++ head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 01:17:55 2016 (r294967) @@ -45,20 +45,19 @@ __FBSDID("$FreeBSD$"); 9-CURRENT September 10th-16th. */ #define sys_chdir chdir #define sys_execve execve -#define sys_fork fork #define sys_link link #define sys_open open #define sys_rename rename #define sys_stat stat #define sys_symlink symlink #define sys_unlink unlink -#define sys_vfork vfork #ifdef FILEMON_HAS_LINKAT #define sys_linkat linkat #endif #endif /* __FreeBSD_version */ static eventhandler_tag filemon_exit_tag; +static eventhandler_tag filemon_fork_tag; static void filemon_output(struct filemon *filemon, char *msg, size_t len) @@ -196,29 +195,6 @@ filemon_wrapper_freebsd32_execve(struct #endif static int -filemon_wrapper_fork(struct thread *td, struct fork_args *uap) -{ - int ret; - size_t len; - struct filemon *filemon; - - if ((ret = sys_fork(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "F %d %ld\n", - curproc->p_pid, (long)curthread->td_retval[0]); - - filemon_output(filemon, filemon->msgbufr, len); - - /* Unlock the found filemon structure. */ - filemon_filemon_unlock(filemon); - } - } - - return (ret); -} - -static int filemon_wrapper_open(struct thread *td, struct open_args *uap) { int ret; @@ -545,27 +521,23 @@ filemon_wrapper_unlink(struct thread *td return (ret); } -static int -filemon_wrapper_vfork(struct thread *td, struct vfork_args *uap) +static void +filemon_event_process_fork(void *arg __unused, struct proc *p1, + struct proc *p2, int flags) { - int ret; size_t len; struct filemon *filemon; - if ((ret = sys_vfork(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "F %d %ld\n", - curproc->p_pid, (long)curthread->td_retval[0]); + if ((filemon = filemon_pid_check(p1)) != NULL) { + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "F %d %d\n", + p1->p_pid, p2->p_pid); - filemon_output(filemon, filemon->msgbufr, len); + filemon_output(filemon, filemon->msgbufr, len); - /* Unlock the found filemon structure. */ - filemon_filemon_unlock(filemon); - } + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); } - - return (ret); } static void @@ -579,13 +551,11 @@ filemon_wrapper_install(void) sv_table[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; sv_table[SYS_execve].sy_call = (sy_call_t *) filemon_wrapper_execve; - sv_table[SYS_fork].sy_call = (sy_call_t *) filemon_wrapper_fork; sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; sv_table[SYS_stat].sy_call = (sy_call_t *) filemon_wrapper_stat; sv_table[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; - sv_table[SYS_vfork].sy_call = (sy_call_t *) filemon_wrapper_vfork; sv_table[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; sv_table[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; #ifdef FILEMON_HAS_LINKAT @@ -597,13 +567,11 @@ filemon_wrapper_install(void) sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_execve; - sv_table[FREEBSD32_SYS_fork].sy_call = (sy_call_t *) filemon_wrapper_fork; sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_stat; sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; - sv_table[FREEBSD32_SYS_vfork].sy_call = (sy_call_t *) filemon_wrapper_vfork; sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; #ifdef FILEMON_HAS_LINKAT @@ -613,6 +581,8 @@ filemon_wrapper_install(void) filemon_exit_tag = EVENTHANDLER_REGISTER(process_exit, filemon_event_process_exit, NULL, EVENTHANDLER_PRI_LAST); + filemon_fork_tag = EVENTHANDLER_REGISTER(process_fork, + filemon_event_process_fork, NULL, EVENTHANDLER_PRI_LAST); } static void @@ -626,13 +596,11 @@ filemon_wrapper_deinstall(void) sv_table[SYS_chdir].sy_call = (sy_call_t *)sys_chdir; sv_table[SYS_execve].sy_call = (sy_call_t *)sys_execve; - sv_table[SYS_fork].sy_call = (sy_call_t *)sys_fork; sv_table[SYS_open].sy_call = (sy_call_t *)sys_open; sv_table[SYS_openat].sy_call = (sy_call_t *)sys_openat; sv_table[SYS_rename].sy_call = (sy_call_t *)sys_rename; sv_table[SYS_stat].sy_call = (sy_call_t *)sys_stat; sv_table[SYS_unlink].sy_call = (sy_call_t *)sys_unlink; - sv_table[SYS_vfork].sy_call = (sy_call_t *)sys_vfork; sv_table[SYS_link].sy_call = (sy_call_t *)sys_link; sv_table[SYS_symlink].sy_call = (sy_call_t *)sys_symlink; #ifdef FILEMON_HAS_LINKAT @@ -644,13 +612,11 @@ filemon_wrapper_deinstall(void) sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *)sys_chdir; sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *)freebsd32_execve; - sv_table[FREEBSD32_SYS_fork].sy_call = (sy_call_t *)sys_fork; sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *)sys_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *)sys_rename; sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *)freebsd32_stat; sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *)sys_unlink; - sv_table[FREEBSD32_SYS_vfork].sy_call = (sy_call_t *)sys_vfork; sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *)sys_link; sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *)sys_symlink; #ifdef FILEMON_HAS_LINKAT @@ -659,4 +625,5 @@ filemon_wrapper_deinstall(void) #endif /* COMPAT_ARCH32 */ EVENTHANDLER_DEREGISTER(process_exit, filemon_exit_tag); + EVENTHANDLER_DEREGISTER(process_fork, filemon_fork_tag); } From owner-svn-src-head@freebsd.org Thu Jan 28 01:19:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D45A7064C; Thu, 28 Jan 2016 01:19:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id D56C01DCE; Thu, 28 Jan 2016 01:19:20 +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 u0S1JJCI068816; Thu, 28 Jan 2016 01:19:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S1JJbs068815; Thu, 28 Jan 2016 01:19:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601280119.u0S1JJbs068815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 28 Jan 2016 01:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294968 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 01:19:21 -0000 Author: bdrewery Date: Thu Jan 28 01:19:19 2016 New Revision: 294968 URL: https://svnweb.freebsd.org/changeset/base/294968 Log: Follow-up r294967: Mark flags unused. X-MFC-With: r294967 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 01:17:55 2016 (r294967) +++ head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 01:19:19 2016 (r294968) @@ -523,7 +523,7 @@ filemon_wrapper_unlink(struct thread *td static void filemon_event_process_fork(void *arg __unused, struct proc *p1, - struct proc *p2, int flags) + struct proc *p2, int flags __unused) { size_t len; struct filemon *filemon; From owner-svn-src-head@freebsd.org Thu Jan 28 03:24:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20E8BA70FE5; Thu, 28 Jan 2016 03:24:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7F451CCC; Thu, 28 Jan 2016 03:24:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S3O6Kk007133; Thu, 28 Jan 2016 03:24:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S3O6Zv007130; Thu, 28 Jan 2016 03:24:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601280324.u0S3O6Zv007130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 28 Jan 2016 03:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294973 - head/sbin/ggate/ggated X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 03:24:08 -0000 Author: ngie Date: Thu Jan 28 03:24:06 2016 New Revision: 294973 URL: https://svnweb.freebsd.org/changeset/base/294973 Log: Add pidfile support to ggated(8) The tests will manipulate the system daemon today, which can cause undesired service interruption when the tests are run. This change allows the geom_gate tests to be run with an arbitrary ggated(8) daemon / geom_gate(4) device pairing. Other changes: - Sort #includes - Use a more common idiom for parsing options with getopt(3) Differential Revision: https://reviews.freebsd.org/D4836 MFC after: 2 weeks Reviewed by: bjk (manpages), pjd (maintainer timeout) Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/ggate/ggated/Makefile head/sbin/ggate/ggated/ggated.8 head/sbin/ggate/ggated/ggated.c Modified: head/sbin/ggate/ggated/Makefile ============================================================================== --- head/sbin/ggate/ggated/Makefile Thu Jan 28 02:56:30 2016 (r294972) +++ head/sbin/ggate/ggated/Makefile Thu Jan 28 03:24:06 2016 (r294973) @@ -6,7 +6,7 @@ PROG= ggated MAN= ggated.8 SRCS= ggated.c ggate.c -LIBADD= pthread +LIBADD= pthread util CFLAGS+= -I${.CURDIR}/../shared Modified: head/sbin/ggate/ggated/ggated.8 ============================================================================== --- head/sbin/ggate/ggated/ggated.8 Thu Jan 28 02:56:30 2016 (r294972) +++ head/sbin/ggate/ggated/ggated.8 Thu Jan 28 03:24:06 2016 (r294973) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2015 +.Dd January 27, 2016 .Dt GGATED 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Op Fl v .Op Fl a Ar address .Op Fl p Ar port +.Op Fl F Ar pidfile .Op Fl R Ar rcvbuf .Op Fl S Ar sndbuf .Op Ar "exports file" @@ -67,6 +68,10 @@ Port on which .Nm listens for connections. Default is 3080. +.It Fl F Ar pidfile +PID file that +.Nm +uses. .It Fl R Ar rcvbuf Size of receive buffer to use. Default is 131072 (128kB). @@ -86,6 +91,13 @@ The format of an exports file is as foll 1.2.3.0/24 RW /tmp/test.img hostname WO /tmp/image .Ed +.Sh FILES +.Bl -tag -width ".Pa /var/run/ggated.pid" -compact +.It Pa /var/run/ggated.pid +The default location of the +.Nm +PID file. +.El .Sh EXIT STATUS Exit status is 0 on success, or 1 if the command fails. To get details about the failure, Modified: head/sbin/ggate/ggated/ggated.c ============================================================================== --- head/sbin/ggate/ggated/ggated.c Thu Jan 28 02:56:30 2016 (r294972) +++ head/sbin/ggate/ggated/ggated.c Thu Jan 28 03:24:06 2016 (r294973) @@ -26,32 +26,34 @@ * $FreeBSD$ */ -#include -#include -#include -#include -#include -#include #include -#include +#include +#include #include -#include #include +#include +#include #include #include -#include -#include +#include #include #include -#include -#include #include #include #include -#include +#include #include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include "ggate.h" @@ -110,8 +112,8 @@ static void usage(void) { - fprintf(stderr, "usage: %s [-nv] [-a address] [-p port] [-R rcvbuf] " - "[-S sndbuf] [exports file]\n", getprogname()); + fprintf(stderr, "usage: %s [-nv] [-a address] [-F pidfile] [-p port] " + "[-R rcvbuf] [-S sndbuf] [exports file]\n", getprogname()); exit(EXIT_FAILURE); } @@ -946,20 +948,18 @@ huphandler(int sig __unused) int main(int argc, char *argv[]) { + const char *ggated_pidfile = _PATH_VARRUN "/ggated.pid"; + struct pidfh *pfh; struct sockaddr_in serv; struct sockaddr from; socklen_t fromlen; - int sfd, tmpsfd; + pid_t otherpid; + int ch, sfd, tmpsfd; unsigned port; bindaddr = htonl(INADDR_ANY); port = G_GATE_PORT; - for (;;) { - int ch; - - ch = getopt(argc, argv, "a:hnp:R:S:v"); - if (ch == -1) - break; + while ((ch = getopt(argc, argv, "a:hnp:F:R:S:v")) != -1) { switch (ch) { case 'a': bindaddr = g_gate_str2ip(optarg); @@ -968,6 +968,9 @@ main(int argc, char *argv[]) "Invalid IP/host name to bind to."); } break; + case 'F': + ggated_pidfile = optarg; + break; case 'n': nagle = 0; break; @@ -1004,12 +1007,23 @@ main(int argc, char *argv[]) exports_file = argv[0]; exports_get(); + pfh = pidfile_open(ggated_pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(EXIT_FAILURE, "Daemon already running, pid: %jd.", + (intmax_t)otherpid); + } + err(EXIT_FAILURE, "Cannot open/create pidfile"); + } + if (!g_gate_verbose) { /* Run in daemon mode. */ if (daemon(0, 0) == -1) g_gate_xlog("Cannot daemonize: %s", strerror(errno)); } + pidfile_write(pfh); + signal(SIGCHLD, SIG_IGN); sfd = socket(AF_INET, SOCK_STREAM, 0); @@ -1046,5 +1060,6 @@ main(int argc, char *argv[]) close(tmpsfd); } close(sfd); + pidfile_remove(pfh); exit(EXIT_SUCCESS); } From owner-svn-src-head@freebsd.org Thu Jan 28 09:07:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7C9A70707; Thu, 28 Jan 2016 09:07:12 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 77FB315D0; Thu, 28 Jan 2016 09:07:12 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 9FFA35FAE; Thu, 28 Jan 2016 09:07:11 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 1459448D80; Thu, 28 Jan 2016 10:07:13 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: NGie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294909 - head/crypto/openssh References: <201601271340.u0RDeiU5060523@repo.freebsd.org> <7BEC31CD-F7AF-44B5-BBB5-9F4CAF3487A7@gmail.com> Date: Thu, 28 Jan 2016 10:07:13 +0100 In-Reply-To: <7BEC31CD-F7AF-44B5-BBB5-9F4CAF3487A7@gmail.com> (NGie Cooper's message of "Wed, 27 Jan 2016 09:25:06 -0800") Message-ID: <86oac6f4xq.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 09:07:12 -0000 NGie Cooper writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Log: > > Switch UseDNS back on > Please add "Relnotes: yes" to the MFC commit, if this is MFCed. Why? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Thu Jan 28 09:12:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E325AA70A3D for ; Thu, 28 Jan 2016 09:12:51 +0000 (UTC) (envelope-from 0000015287819949-ec71040b-3968-4e60-9cc2-313e6e0b9e7e-000000@amazonses.com) Received: from a9-40.smtp-out.amazonses.com (a9-40.smtp-out.amazonses.com [54.240.9.40]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACDED1B3A for ; Thu, 28 Jan 2016 09:12:51 +0000 (UTC) (envelope-from 0000015287819949-ec71040b-3968-4e60-9cc2-313e6e0b9e7e-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1453972363; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=MqRXH4DhB0TmpAI/vAcfnxJfxctjm8EVwR09enCxB1k=; b=iE+uIztDA3x3Rhe2cpGbTMlQlHu3LX2ltTqYprqekTc7jAb6FmWglXq4ppH7Ms3n Rj7rHUkDJ+QH41Lt71q/8LzH6weagXo5tO7hA+7azXHUMQWwPqr/VLf8Gp+wp07RD/P ur8zZ3qPYJzZo9moMeB6mawIyj0zhHVVoXvY/Bfc= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1453972363; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=MqRXH4DhB0TmpAI/vAcfnxJfxctjm8EVwR09enCxB1k=; b=lnzkXHdPEG4/V47dh1ULSTDC3h0WwaPNOmnPansT8t6XWBuTW3r9xBGX1hGjiKvP kSxINhExdrq4vaGLdilU2lMjF/lqD7QGTYKl6BDrmMn7sfOwk5IKcV9XoPFzIfLsAB/ jB7rv8ERo6xQx2eGp4KmwB5N3LuBpOQ8cL2/Wc28= Subject: Re: svn commit: r294909 - head/crypto/openssh To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , NGie Cooper References: <201601271340.u0RDeiU5060523@repo.freebsd.org> <7BEC31CD-F7AF-44B5-BBB5-9F4CAF3487A7@gmail.com> <86oac6f4xq.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Colin Percival Message-ID: <0000015287819949-ec71040b-3968-4e60-9cc2-313e6e0b9e7e-000000@email.amazonses.com> Date: Thu, 28 Jan 2016 09:12:43 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <86oac6f4xq.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SES-Outgoing: 2016.01.28-54.240.9.40 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 09:12:52 -0000 On 01/28/16 01:07, Dag-Erling Smørgrav wrote: > NGie Cooper writes: >> Dag-Erling Smørgrav writes: >>> Log: >>> Switch UseDNS back on >> Please add "Relnotes: yes" to the MFC commit, if this is MFCed. > > Why? At a guess, because NGie thinks that this is something which is important enough to be worth mentioning in the FreeBSD release notes, and "Relnotes: yes" flags the commit to the release engineering team for that purpose? -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Thu Jan 28 10:05:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4FE9A702C1; Thu, 28 Jan 2016 10:05:35 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7A01735; Thu, 28 Jan 2016 10:05:35 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 7953B53B1; Thu, 28 Jan 2016 10:05:34 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 5BF7D48D8B; Thu, 28 Jan 2016 11:05:34 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Colin Percival Cc: NGie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294909 - head/crypto/openssh References: <201601271340.u0RDeiU5060523@repo.freebsd.org> <7BEC31CD-F7AF-44B5-BBB5-9F4CAF3487A7@gmail.com> <86oac6f4xq.fsf@desk.des.no> <000001528781a663-adcfe209-147a-4fb4-83e4-e0911293f7f3-000000@email.amazonses.com> Date: Thu, 28 Jan 2016 11:05:34 +0100 In-Reply-To: <000001528781a663-adcfe209-147a-4fb4-83e4-e0911293f7f3-000000@email.amazonses.com> (Colin Percival's message of "Thu, 28 Jan 2016 09:12:47 +0000") Message-ID: <86fuxif28h.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 10:05:35 -0000 Colin Percival writes: > At a guess, because NGie thinks that this is something which is important > enough to be worth mentioning in the FreeBSD release notes, and "Relnotes: > yes" flags the commit to the release engineering team for that purpose? UseDNS was (unintentionally) turned off in head last week, I just turned it back on. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Thu Jan 28 12:00:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94929A706D7; Thu, 28 Jan 2016 12:00:18 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 669AA18B6; Thu, 28 Jan 2016 12:00:18 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SC0Hij054522; Thu, 28 Jan 2016 12:00:17 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SC0HLw054521; Thu, 28 Jan 2016 12:00:17 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201601281200.u0SC0HLw054521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 28 Jan 2016 12:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294979 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 12:00:18 -0000 Author: wma Date: Thu Jan 28 12:00:17 2016 New Revision: 294979 URL: https://svnweb.freebsd.org/changeset/base/294979 Log: Fix mutex releasing in ARM64 cpu_switch The code should be comparing pointers, not any data gathered from a blocked_lock. Spotted by: cognet Approved by: zbb, cognet (mentor) Differential revision: https://reviews.freebsd.org/D5100 Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Thu Jan 28 09:25:15 2016 (r294978) +++ head/sys/arm64/arm64/swtch.S Thu Jan 28 12:00:17 2016 (r294979) @@ -166,9 +166,8 @@ ENTRY(cpu_switch) */ str x2, [x0, #TD_LOCK] #if defined(SCHED_ULE) && defined(SMP) - /* Read the value in blocked_lock */ - ldr x0, =_C_LABEL(blocked_lock) - ldr x2, [x0] + /* Spin if TD_LOCK points to a blocked_lock */ + ldr x2, =_C_LABEL(blocked_lock) 1: ldar x3, [x1, #TD_LOCK] cmp x3, x2 From owner-svn-src-head@freebsd.org Thu Jan 28 12:21:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3C65A711C6; Thu, 28 Jan 2016 12:21:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id AE4C91A8B; Thu, 28 Jan 2016 12:21:24 +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 u0SCLNF7062536; Thu, 28 Jan 2016 12:21:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SCLNtv062535; Thu, 28 Jan 2016 12:21:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201601281221.u0SCLNtv062535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 28 Jan 2016 12:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294983 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 12:21:25 -0000 Author: trasz Date: Thu Jan 28 12:21:23 2016 New Revision: 294983 URL: https://svnweb.freebsd.org/changeset/base/294983 Log: Remove ffs_mountroot() prototype; seems to be long gone. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_extern.h Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Thu Jan 28 12:15:50 2016 (r294982) +++ head/sys/ufs/ffs/ffs_extern.h Thu Jan 28 12:21:23 2016 (r294983) @@ -77,7 +77,6 @@ void ffs_fserr(struct fs *, ino_t, char int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t); -int ffs_mountroot(void); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); int ffs_own_mount(const struct mount *mp); int ffs_reallocblks(struct vop_reallocblks_args *); From owner-svn-src-head@freebsd.org Thu Jan 28 12:44:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E127A71B99; Thu, 28 Jan 2016 12:44:00 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2092F1BE4; Thu, 28 Jan 2016 12:44:00 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SChx4f069220; Thu, 28 Jan 2016 12:43:59 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SChwn4069214; Thu, 28 Jan 2016 12:43:58 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601281243.u0SChwn4069214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 28 Jan 2016 12:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294987 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 12:44:00 -0000 Author: zbb Date: Thu Jan 28 12:43:58 2016 New Revision: 294987 URL: https://svnweb.freebsd.org/changeset/base/294987 Log: SMP support for ARMv6/v7 HW watchpoints Use per-CPU structure to store HW watchpoints registers state for each CPU present in the system. Those registers will be restored upon wake up from the STOP state if requested by the debug_monitor code. The method is similar to the one introduced to AMD64. We store all possible 16 registers for HW watchpoints (maximum allowed by the architecture). HW breakpoints are not maintained since they are used for single stepping only. Pointed out by: kib Reviewed by: wma No strong objections from: kib Submitted by: Zbigniew Bodek Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4338 Modified: head/sys/arm/arm/debug_monitor.c head/sys/arm/arm/mp_machdep.c head/sys/arm/include/debug_monitor.h head/sys/arm/include/pcpu.h head/sys/arm/include/reg.h Modified: head/sys/arm/arm/debug_monitor.c ============================================================================== --- head/sys/arm/arm/debug_monitor.c Thu Jan 28 12:25:27 2016 (r294986) +++ head/sys/arm/arm/debug_monitor.c Thu Jan 28 12:43:58 2016 (r294987) @@ -35,14 +35,17 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include #include #include +#include #include #include @@ -80,7 +83,7 @@ static boolean_t dbg_ossr; /* OS Save an static uint32_t dbg_watchpoint_num; static uint32_t dbg_breakpoint_num; -static int dbg_ref_count_mme[MAXCPU]; /* Times monitor mode was enabled */ +static int dbg_ref_count_mme; /* Times monitor mode was enabled */ /* ID_DFR0 - Debug Feature Register 0 */ #define ID_DFR0_CP_DEBUG_M_SHIFT 0 @@ -542,11 +545,9 @@ dbg_enable_monitor(void) { uint32_t dbg_dscr; - /* Already enabled? Just increment reference counter and return */ - if (dbg_monitor_is_enabled()) { - dbg_ref_count_mme[PCPU_GET(cpuid)]++; + /* Already enabled? Just return */ + if (dbg_monitor_is_enabled()) return (0); - } dbg_dscr = cp14_dbgdscrint_get(); @@ -565,10 +566,8 @@ dbg_enable_monitor(void) isb(); /* Verify that Monitor mode is set */ - if (dbg_monitor_is_enabled()) { - dbg_ref_count_mme[PCPU_GET(cpuid)]++; + if (dbg_monitor_is_enabled()) return (0); - } return (ENXIO); } @@ -581,9 +580,6 @@ dbg_disable_monitor(void) if (!dbg_monitor_is_enabled()) return (0); - if (--dbg_ref_count_mme[PCPU_GET(cpuid)] > 0) - return (0); - dbg_dscr = cp14_dbgdscrint_get(); switch (dbg_model) { case ID_DFR0_CP_DEBUG_M_V6: @@ -607,11 +603,13 @@ dbg_disable_monitor(void) static int dbg_setup_xpoint(struct dbg_wb_conf *conf) { + struct pcpu *pcpu; + struct dbreg *d; const char *typestr; uint32_t cr_size, cr_priv, cr_access; uint32_t reg_ctrl, reg_addr, ctrl, addr; boolean_t is_bkpt; - u_int cpuid; + u_int cpuid, cpu; u_int i; int err; @@ -705,20 +703,52 @@ dbg_setup_xpoint(struct dbg_wb_conf *con dbg_wb_write_reg(reg_addr, i, addr); dbg_wb_write_reg(reg_ctrl, i, ctrl); - return (dbg_enable_monitor()); + err = dbg_enable_monitor(); + if (err != 0) + return (err); + + /* Increment monitor enable counter */ + dbg_ref_count_mme++; + + /* + * Save watchpoint settings for all CPUs. + * We don't need to do the same with breakpoints since HW breakpoints + * are only used to perform single stepping. + */ + if (!is_bkpt) { + CPU_FOREACH(cpu) { + pcpu = pcpu_find(cpu); + /* Fill out the settings for watchpoint */ + d = (struct dbreg *)pcpu->pc_dbreg; + d->dbg_wvr[i] = addr; + d->dbg_wcr[i] = ctrl; + /* Skip update command for the current CPU */ + if (cpu != cpuid) + pcpu->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } + } + /* Ensure all data is written before waking other CPUs */ + atomic_thread_fence_rel(); + + return (0); } static int dbg_remove_xpoint(struct dbg_wb_conf *conf) { + struct pcpu *pcpu; + struct dbreg *d; uint32_t reg_ctrl, reg_addr, addr; - u_int cpuid; + boolean_t is_bkpt; + u_int cpuid, cpu; u_int i; int err; if (!dbg_capable) return (ENXIO); + is_bkpt = (conf->type == DBG_TYPE_BREAKPOINT); + cpuid = PCPU_GET(cpuid); if (!dbg_ready[cpuid]) { err = dbg_reset_state(); @@ -729,7 +759,7 @@ dbg_remove_xpoint(struct dbg_wb_conf *co addr = conf->address; - if (conf->type == DBG_TYPE_BREAKPOINT) { + if (is_bkpt) { i = conf->slot; reg_ctrl = DBG_REG_BASE_BCR; reg_addr = DBG_REG_BASE_BVR; @@ -746,7 +776,40 @@ dbg_remove_xpoint(struct dbg_wb_conf *co dbg_wb_write_reg(reg_ctrl, i, 0); dbg_wb_write_reg(reg_addr, i, 0); - return (dbg_disable_monitor()); + /* Decrement monitor enable counter */ + dbg_ref_count_mme--; + if (dbg_ref_count_mme < 0) + dbg_ref_count_mme = 0; + + atomic_thread_fence_rel(); + + if (dbg_ref_count_mme == 0) { + err = dbg_disable_monitor(); + if (err != 0) + return (err); + } + + /* + * Save watchpoint settings for all CPUs. + * We don't need to do the same with breakpoints since HW breakpoints + * are only used to perform single stepping. + */ + if (!is_bkpt) { + CPU_FOREACH(cpu) { + pcpu = pcpu_find(cpu); + /* Fill out the settings for watchpoint */ + d = (struct dbreg *)pcpu->pc_dbreg; + d->dbg_wvr[i] = 0; + d->dbg_wcr[i] = 0; + /* Skip update command for the current CPU */ + if (cpu != cpuid) + pcpu->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } + /* Ensure all data is written before waking other CPUs */ + atomic_thread_fence_rel(); + } + + return (0); } static __inline uint32_t @@ -941,3 +1004,67 @@ dbg_monitor_init(void) db_printf("HW Breakpoints/Watchpoints not enabled on CPU%d\n", PCPU_GET(cpuid)); } + +CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); + +void +dbg_resume_dbreg(void) +{ + struct dbreg *d; + u_int cpuid; + u_int i; + int err; + + /* + * This flag is set on the primary CPU + * and its meaning is valid for other CPUs too. + */ + if (!dbg_capable) + return; + + atomic_thread_fence_acq(); + + switch (PCPU_GET(dbreg_cmd)) { + case PC_DBREG_CMD_LOAD: + d = (struct dbreg *)PCPU_PTR(dbreg); + cpuid = PCPU_GET(cpuid); + + /* Reset Debug Architecture State if not done earlier */ + if (!dbg_ready[cpuid]) { + err = dbg_reset_state(); + if (err != 0) { + /* + * Something is very wrong. + * WPs/BPs will not work correctly in this CPU. + */ + panic("%s: Failed to reset Debug Architecture " + "state on CPU%d", __func__, cpuid); + } + dbg_ready[cpuid] = TRUE; + } + + /* Restore watchpoints */ + for (i = 0; i < dbg_watchpoint_num; i++) { + dbg_wb_write_reg(DBG_REG_BASE_WVR, i, d->dbg_wvr[i]); + dbg_wb_write_reg(DBG_REG_BASE_WCR, i, d->dbg_wcr[i]); + } + + if ((dbg_ref_count_mme > 0) && !dbg_monitor_is_enabled()) { + err = dbg_enable_monitor(); + if (err != 0) { + panic("%s: Failed to enable Debug Monitor " + "on CPU%d", __func__, cpuid); + } + } + if ((dbg_ref_count_mme == 0) && dbg_monitor_is_enabled()) { + err = dbg_disable_monitor(); + if (err != 0) { + panic("%s: Failed to disable Debug Monitor " + "on CPU%d", __func__, cpuid); + } + } + + PCPU_SET(dbreg_cmd, PC_DBREG_CMD_NONE); + break; + } +} Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Thu Jan 28 12:25:27 2016 (r294986) +++ head/sys/arm/arm/mp_machdep.c Thu Jan 28 12:43:58 2016 (r294987) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -303,6 +304,9 @@ ipi_stop(void *dummy __unused) CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); +#ifdef DDB + dbg_resume_dbreg(); +#endif CTR0(KTR_SMP, "IPI_STOP (restart)"); } @@ -405,6 +409,9 @@ ipi_handler(void *arg) CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); +#ifdef DDB + dbg_resume_dbreg(); +#endif CTR0(KTR_SMP, "IPI_STOP (restart)"); break; case IPI_PREEMPT: Modified: head/sys/arm/include/debug_monitor.h ============================================================================== --- head/sys/arm/include/debug_monitor.h Thu Jan 28 12:25:27 2016 (r294986) +++ head/sys/arm/include/debug_monitor.h Thu Jan 28 12:43:58 2016 (r294987) @@ -48,6 +48,7 @@ void dbg_monitor_init(void); void dbg_show_watchpoint(void); int dbg_setup_watchpoint(db_expr_t, db_expr_t, enum dbg_access_t); int dbg_remove_watchpoint(db_expr_t, db_expr_t); +void dbg_resume_dbreg(void); #else /* __ARM_ARCH >= 6 */ static __inline void dbg_show_watchpoint(void) @@ -68,6 +69,11 @@ static __inline void dbg_monitor_init(void) { } + +static __inline void +dbg_resume_dbreg(void) +{ +} #endif /* __ARM_ARCH < 6 */ #else /* DDB */ Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Thu Jan 28 12:25:27 2016 (r294986) +++ head/sys/arm/include/pcpu.h Thu Jan 28 12:43:58 2016 (r294987) @@ -49,7 +49,9 @@ struct vmspace; struct pmap *pc_curpmap; \ vm_offset_t pc_qmap_addr; \ void *pc_qmap_pte; \ - char __pad[133] + unsigned int pc_dbreg[32]; \ + int pc_dbreg_cmd; \ + char __pad[1] #else #define PCPU_MD_FIELDS \ vm_offset_t qmap_addr; \ @@ -59,6 +61,9 @@ struct vmspace; #ifdef _KERNEL +#define PC_DBREG_CMD_NONE 0 +#define PC_DBREG_CMD_LOAD 1 + struct pcb; struct pcpu; Modified: head/sys/arm/include/reg.h ============================================================================== --- head/sys/arm/include/reg.h Thu Jan 28 12:25:27 2016 (r294986) +++ head/sys/arm/include/reg.h Thu Jan 28 12:43:58 2016 (r294987) @@ -19,7 +19,9 @@ struct fpreg { }; struct dbreg { - unsigned int dr[8]; /* debug registers */ +#define ARM_WR_MAX 16 /* Maximum number of watchpoint registers */ + unsigned int dbg_wcr[ARM_WR_MAX]; /* Watchpoint Control Registers */ + unsigned int dbg_wvr[ARM_WR_MAX]; /* Watchpoint Value Registers */ }; #ifdef _KERNEL From owner-svn-src-head@freebsd.org Thu Jan 28 14:12:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26D7CA6FE90; Thu, 28 Jan 2016 14:12:01 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA5E718DE; Thu, 28 Jan 2016 14:12:00 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SEC0vX094647; Thu, 28 Jan 2016 14:12:00 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SEBxeV094637; Thu, 28 Jan 2016 14:11:59 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601281411.u0SEBxeV094637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 28 Jan 2016 14:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294989 - in head/sys: arm/freescale/vybrid arm/xilinx dev/usb/controller mips/atheros powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 14:12:01 -0000 Author: mmel Date: Thu Jan 28 14:11:59 2016 New Revision: 294989 URL: https://svnweb.freebsd.org/changeset/base/294989 Log: EHCI: Make core reset and port speed reading more generic. Use driver settable callbacks for handling of: - core post reset - reading actual port speed Typically, OTG enabled EHCI cores wants setting of USBMODE register, but this register is not defined in EHCI specification and different cores can have it on different offset. Also, for cores with TT extension, actual port speed must be determinable. But again, EHCI specification not covers this so this patch provides function for two most common variant of speed bits layout. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D5088 Modified: head/sys/arm/freescale/vybrid/vf_ehci.c head/sys/arm/xilinx/zy7_ehci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h head/sys/dev/usb/controller/ehci_ixp4xx.c head/sys/dev/usb/controller/ehci_mv.c head/sys/dev/usb/controller/ehcireg.h head/sys/mips/atheros/ar71xx_ehci.c head/sys/powerpc/ps3/ehci_ps3.c Modified: head/sys/arm/freescale/vybrid/vf_ehci.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ehci.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/arm/freescale/vybrid/vf_ehci.c Thu Jan 28 14:11:59 2016 (r294989) @@ -169,6 +169,18 @@ static devclass_t ehci_devclass; DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); MODULE_DEPEND(ehci, usb, 1, 1, 1); +static void +vybrid_ehci_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Force HOST mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode &= ~EHCI_UM_CM; + usbmode |= EHCI_UM_CM_HOST; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + /* * Public methods */ @@ -343,8 +355,10 @@ vybrid_ehci_attach(device_t dev) reg |= 0x3; bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, 0xA8, reg); - /* Set flags */ - sc->sc_flags |= EHCI_SCFLG_SETMODE | EHCI_SCFLG_NORESTERM; + /* Set flags and callbacks*/ + sc->sc_flags |= EHCI_SCFLG_TT | EHCI_SCFLG_NORESTERM; + sc->sc_vendor_post_reset = vybrid_ehci_post_reset; + sc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; err = ehci_init(sc); if (!err) { Modified: head/sys/arm/xilinx/zy7_ehci.c ============================================================================== --- head/sys/arm/xilinx/zy7_ehci.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/arm/xilinx/zy7_ehci.c Thu Jan 28 14:11:59 2016 (r294989) @@ -138,6 +138,18 @@ __FBSDID("$FreeBSD$"); #define EHCI_REG_OFFSET ZY7_USB_CAPLENGTH_HCIVERSION #define EHCI_REG_SIZE 0x100 +static void +zy7_ehci_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Force HOST mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode &= ~EHCI_UM_CM; + usbmode |= EHCI_UM_CM_HOST; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + static int zy7_phy_config(device_t dev, bus_space_tag_t io_tag, bus_space_handle_t bsh) { @@ -275,8 +287,9 @@ zy7_ehci_attach(device_t dev) } /* Customization. */ - sc->sc_flags |= EHCI_SCFLG_SETMODE | EHCI_SCFLG_TT | - EHCI_SCFLG_NORESTERM; + sc->sc_flags |= EHCI_SCFLG_TT | EHCI_SCFLG_NORESTERM; + sc->sc_vendor_post_reset = zy7_ehci_post_reset; + sc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; /* Modify FIFO burst threshold from 2 to 8. */ bus_space_write_4(sc->sc_io_tag, bsh, Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/dev/usb/controller/ehci.c Thu Jan 28 14:11:59 2016 (r294989) @@ -189,24 +189,8 @@ ehci_reset(ehci_softc_t *sc) usb_pause_mtx(NULL, hz / 128); hcr = EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_HCRESET; if (!hcr) { - if (sc->sc_flags & (EHCI_SCFLG_SETMODE | EHCI_SCFLG_BIGEMMIO)) { - /* - * Force USBMODE as requested. Controllers - * may have multiple operating modes. - */ - uint32_t usbmode = EOREAD4(sc, EHCI_USBMODE); - if (sc->sc_flags & EHCI_SCFLG_SETMODE) { - usbmode = (usbmode &~ EHCI_UM_CM) | EHCI_UM_CM_HOST; - device_printf(sc->sc_bus.bdev, - "set host controller mode\n"); - } - if (sc->sc_flags & EHCI_SCFLG_BIGEMMIO) { - usbmode = (usbmode &~ EHCI_UM_ES) | EHCI_UM_ES_BE; - device_printf(sc->sc_bus.bdev, - "set big-endian mode\n"); - } - EOWRITE4(sc, EHCI_USBMODE, usbmode); - } + if (sc->sc_vendor_post_reset != NULL) + sc->sc_vendor_post_reset(sc); return (0); } } @@ -3066,6 +3050,36 @@ struct usb_hub_descriptor ehci_hubd = .bDescriptorType = UDESC_HUB, }; +uint16_t +ehci_get_port_speed_portsc(struct ehci_softc *sc, uint16_t index) +{ + uint32_t v; + + v = EOREAD4(sc, EHCI_PORTSC(index)); + v = (v >> EHCI_PORTSC_PSPD_SHIFT) & EHCI_PORTSC_PSPD_MASK; + + if (v == EHCI_PORT_SPEED_HIGH) + return (UPS_HIGH_SPEED); + if (v == EHCI_PORT_SPEED_LOW) + return (UPS_LOW_SPEED); + return (0); +} + +uint16_t +ehci_get_port_speed_hostc(struct ehci_softc *sc, uint16_t index) +{ + uint32_t v; + + v = EOREAD4(sc, EHCI_HOSTC(index)); + v = (v >> EHCI_HOSTC_PSPD_SHIFT) & EHCI_HOSTC_PSPD_MASK; + + if (v == EHCI_PORT_SPEED_HIGH) + return (UPS_HIGH_SPEED); + if (v == EHCI_PORT_SPEED_LOW) + return (UPS_LOW_SPEED); + return (0); +} + static void ehci_disown(ehci_softc_t *sc, uint16_t index, uint8_t lowspeed) { @@ -3330,13 +3344,15 @@ ehci_roothub_exec(struct usb_device *ude } v = EOREAD4(sc, EHCI_PORTSC(index)); DPRINTFN(9, "port status=0x%04x\n", v); - if (sc->sc_flags & (EHCI_SCFLG_FORCESPEED | EHCI_SCFLG_TT)) { - if ((v & 0xc000000) == 0x8000000) + if (sc->sc_flags & EHCI_SCFLG_TT) { + if (sc->sc_vendor_get_port_speed != NULL) { + i = sc->sc_vendor_get_port_speed(sc, index); + } else { + device_printf(sc->sc_bus.bdev, + "EHCI_SCFLG_TT quirk is set but " + "sc_vendor_get_hub_speed() is NULL\n"); i = UPS_HIGH_SPEED; - else if ((v & 0xc000000) == 0x4000000) - i = UPS_LOW_SPEED; - else - i = 0; + } } else { i = UPS_HIGH_SPEED; } Modified: head/sys/dev/usb/controller/ehci.h ============================================================================== --- head/sys/dev/usb/controller/ehci.h Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/dev/usb/controller/ehci.h Thu Jan 28 14:11:59 2016 (r294989) @@ -337,11 +337,8 @@ typedef struct ehci_softc { uint16_t sc_intr_stat[EHCI_VIRTUAL_FRAMELIST_COUNT]; uint16_t sc_id_vendor; /* vendor ID for root hub */ uint16_t sc_flags; /* chip specific flags */ -#define EHCI_SCFLG_SETMODE 0x0001 /* set bridge mode again after init */ -#define EHCI_SCFLG_FORCESPEED 0x0002 /* force speed */ #define EHCI_SCFLG_NORESTERM 0x0004 /* don't terminate reset sequence */ #define EHCI_SCFLG_BIGEDESC 0x0008 /* big-endian byte order descriptors */ -#define EHCI_SCFLG_BIGEMMIO 0x0010 /* big-endian byte order MMIO */ #define EHCI_SCFLG_TT 0x0020 /* transaction translator present */ #define EHCI_SCFLG_LOSTINTRBUG 0x0040 /* workaround for VIA / ATI chipsets */ #define EHCI_SCFLG_IAADBUG 0x0080 /* workaround for nVidia chipsets */ @@ -358,6 +355,10 @@ typedef struct ehci_softc { char sc_vendor[16]; /* vendor string for root hub */ + void (*sc_vendor_post_reset)(struct ehci_softc *sc); + uint16_t (*sc_vendor_get_port_speed)(struct ehci_softc *sc, + uint16_t index); + } ehci_softc_t; #define EREAD1(sc, a) bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (a)) @@ -446,5 +447,7 @@ usb_error_t ehci_reset(ehci_softc_t *sc) usb_error_t ehci_init(ehci_softc_t *sc); void ehci_detach(struct ehci_softc *sc); void ehci_interrupt(ehci_softc_t *sc); +uint16_t ehci_get_port_speed_portsc(struct ehci_softc *sc, uint16_t index); +uint16_t ehci_get_port_speed_hostc(struct ehci_softc *sc, uint16_t index); #endif /* _EHCI_H_ */ Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_ixp4xx.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/dev/usb/controller/ehci_ixp4xx.c Thu Jan 28 14:11:59 2016 (r294989) @@ -86,6 +86,19 @@ static void ehci_bs_w_2(bus_space_tag_t static uint32_t ehci_bs_r_4(bus_space_tag_t tag, bus_space_handle_t, bus_size_t); static void ehci_bs_w_4(bus_space_tag_t tag, bus_space_handle_t, bus_size_t, uint32_t); +static void +ehci_ixp_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Force HOST mode, select big-endian mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode &= ~EHCI_UM_CM; + usbmode |= EHCI_UM_CM_HOST; + usbmode |= EHCI_UM_ES_BE; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + static int ehci_ixp_probe(device_t self) { @@ -173,20 +186,21 @@ ehci_ixp_attach(device_t self) } /* - * Arrange to force Host mode, select big-endian byte alignment, - * and arrange to not terminate reset operations (the adapter - * will ignore it if we do but might as well save a reg write). - * Also, the controller has an embedded Transaction Translator - * which means port speed must be read from the Port Status - * register following a port enable. + * Select big-endian byte alignment and arrange to not terminate + * reset operations (the adapter will ignore it if we do but might + * as well save a reg write). Also, the controller has an embedded + * Transaction Translator which means port speed must be read from + * the Port Status register following a port enable. */ sc->sc_flags |= EHCI_SCFLG_TT - | EHCI_SCFLG_SETMODE | EHCI_SCFLG_BIGEDESC - | EHCI_SCFLG_BIGEMMIO | EHCI_SCFLG_NORESTERM ; + /* Setup callbacks. */ + sc->sc_vendor_post_reset = ehci_ixp_post_reset; + sc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; + err = ehci_init(sc); if (!err) { err = device_probe_and_attach(sc->sc_bus.bdev); Modified: head/sys/dev/usb/controller/ehci_mv.c ============================================================================== --- head/sys/dev/usb/controller/ehci_mv.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/dev/usb/controller/ehci_mv.c Thu Jan 28 14:11:59 2016 (r294989) @@ -105,6 +105,18 @@ static struct ofw_compat_data compat_dat {NULL, false} }; +static void +mv_ehci_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Force HOST mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode &= ~EHCI_UM_CM; + usbmode |= EHCI_UM_CM_HOST; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + static int mv_ehci_probe(device_t self) { @@ -226,13 +238,13 @@ mv_ehci_attach(device_t self) * Refer to errata document MV-S500832-00D.pdf (p. 5.24 GL USB-2) for * details. */ - sc->sc_flags |= EHCI_SCFLG_SETMODE; + sc->sc_vendor_post_reset = mv_ehci_post_reset; if (bootverbose) device_printf(self, "5.24 GL USB-2 workaround enabled\n"); /* XXX all MV chips need it? */ - sc->sc_flags |= EHCI_SCFLG_FORCESPEED | EHCI_SCFLG_NORESTERM; - + sc->sc_flags |= EHCI_SCFLG_TT | EHCI_SCFLG_NORESTERM; + sc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; err = ehci_init(sc); if (!err) { err = device_probe_and_attach(sc->sc_bus.bdev); Modified: head/sys/dev/usb/controller/ehcireg.h ============================================================================== --- head/sys/dev/usb/controller/ehcireg.h Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/dev/usb/controller/ehcireg.h Thu Jan 28 14:11:59 2016 (r294989) @@ -157,7 +157,17 @@ #define EHCI_PS_CS 0x00000001 /* RO connect status */ #define EHCI_PS_CLEAR (EHCI_PS_OCC | EHCI_PS_PEC | EHCI_PS_CSC) -#define EHCI_USBMODE 0x68 /* RW USB Device mode register */ +#define EHCI_PORT_RESET_COMPLETE 2 /* ms */ + +/* + * Registers not covered by EHCI specification + * + * + * EHCI_USBMODE register offset is different for cores with LPM support, + * bits are equal + */ +#define EHCI_USBMODE_NOLPM 0x68 /* RW USB Device mode reg (no LPM) */ +#define EHCI_USBMODE_LPM 0xA8 /* RW USB Device mode reg (LPM) */ #define EHCI_UM_CM 0x00000003 /* R/WO Controller Mode */ #define EHCI_UM_CM_IDLE 0x0 /* Idle */ #define EHCI_UM_CM_HOST 0x3 /* Host Controller */ @@ -166,6 +176,18 @@ #define EHCI_UM_ES_BE 0x4 /* Big-endian byte alignment */ #define EHCI_UM_SDIS 0x00000010 /* R/WO Stream Disable Mode */ -#define EHCI_PORT_RESET_COMPLETE 2 /* ms */ +/* + * Actual port speed bits depends on EHCI_HOSTC(n) registers presence, + * speed encoding is equal + */ +#define EHCI_HOSTC(n) (0x80+(4*(n))) /* RO, RW Host mode control reg */ +#define EHCI_HOSTC_PSPD_SHIFT 25 +#define EHCI_HOSTC_PSPD_MASK 0x3 + +#define EHCI_PORTSC_PSPD_SHIFT 26 +#define EHCI_PORTSC_PSPD_MASK 0x3 +#define EHCI_PORT_SPEED_FULL 0 +#define EHCI_PORT_SPEED_LOW 1 +#define EHCI_PORT_SPEED_HIGH 2 #endif /* _EHCIREG_H_ */ Modified: head/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ehci.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/mips/atheros/ar71xx_ehci.c Thu Jan 28 14:11:59 2016 (r294989) @@ -61,6 +61,10 @@ __FBSDID("$FreeBSD$"); #define EHCI_HC_DEVSTR "AR71XX Integrated USB 2.0 controller" +#define EHCI_USBMODE 0x68 /* USB Device mode register */ +#define EHCI_UM_CM 0x00000003 /* R/WO Controller Mode */ +#define EHCI_UM_CM_HOST 0x3 /* Host Controller */ + struct ar71xx_ehci_softc { ehci_softc_t base; /* storage for EHCI code */ }; @@ -71,6 +75,18 @@ static device_detach_t ar71xx_ehci_detac bs_r_1_proto(reversed); bs_w_1_proto(reversed); +static void +ar71xx_ehci_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Force HOST mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode &= ~EHCI_UM_CM; + usbmode |= EHCI_UM_CM_HOST; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + static int ar71xx_ehci_probe(device_t self) { @@ -161,7 +177,8 @@ ar71xx_ehci_attach(device_t self) * which means port speed must be read from the Port Status * register following a port enable. */ - sc->sc_flags = EHCI_SCFLG_SETMODE; + sc->sc_flags = 0; + sc->sc_vendor_post_reset = ar71xx_ehci_post_reset; switch (ar71xx_soc) { case AR71XX_SOC_AR7241: @@ -178,6 +195,8 @@ ar71xx_ehci_attach(device_t self) case AR71XX_SOC_QCA9556: case AR71XX_SOC_QCA9558: sc->sc_flags |= EHCI_SCFLG_TT | EHCI_SCFLG_NORESTERM; + sc->sc_vendor_get_port_speed = + ehci_get_port_speed_portsc; break; default: /* fallthrough */ Modified: head/sys/powerpc/ps3/ehci_ps3.c ============================================================================== --- head/sys/powerpc/ps3/ehci_ps3.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/powerpc/ps3/ehci_ps3.c Thu Jan 28 14:11:59 2016 (r294989) @@ -69,6 +69,17 @@ struct ps3_ehci_softc { struct bus_space tag; }; +static void +ehci_ps3_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Select big-endian mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode |= EHCI_UM_ES_BE; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + static int ehci_ps3_probe(device_t dev) { @@ -135,7 +146,7 @@ ehci_ps3_attach(device_t dev) goto error; } - sc->sc_flags |= EHCI_SCFLG_BIGEMMIO; + sc->sc_vendor_post_reset = ehci_ps3_post_reset; err = ehci_init(sc); if (err) { device_printf(dev, "USB init failed err=%d\n", err); From owner-svn-src-head@freebsd.org Thu Jan 28 15:31:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B89A71A5C; Thu, 28 Jan 2016 15:31:00 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41E941F07; Thu, 28 Jan 2016 15:31:00 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SFUxDm015508; Thu, 28 Jan 2016 15:30:59 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SFUxjO015505; Thu, 28 Jan 2016 15:30:59 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601281530.u0SFUxjO015505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 28 Jan 2016 15:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294990 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 15:31:00 -0000 Author: zbb Date: Thu Jan 28 15:30:58 2016 New Revision: 294990 URL: https://svnweb.freebsd.org/changeset/base/294990 Log: Fix finding appropriate BGX node in DTB and move it to a separate function Search for BGX node in DTS in two ways: 1. Try to find it uder root node first 2. If not found under root, find the top level PCI bridge node and search all nodes below it until appropriate BGX node is found. Move search code to another function to make the code more clear. Remove unused variable by the way. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5066 Modified: head/sys/dev/vnic/thunder_bgx.c head/sys/dev/vnic/thunder_bgx_fdt.c head/sys/dev/vnic/thunder_bgx_var.h Modified: head/sys/dev/vnic/thunder_bgx.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx.c Thu Jan 28 14:11:59 2016 (r294989) +++ head/sys/dev/vnic/thunder_bgx.c Thu Jan 28 15:30:58 2016 (r294990) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #define THUNDER_BGX_DEVSTR "ThunderX BGX Ethernet I/O Interface" -static MALLOC_DEFINE(M_BGX, "thunder_bgx", "ThunderX BGX dynamic memory"); +MALLOC_DEFINE(M_BGX, "thunder_bgx", "ThunderX BGX dynamic memory"); #define BGX_NODE_ID_MASK 0x1 #define BGX_NODE_ID_SHIFT 24 Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 14:11:59 2016 (r294989) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 15:30:58 2016 (r294990) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "thunder_bgx.h" @@ -61,6 +62,11 @@ __FBSDID("$FreeBSD$"); #define CONN_TYPE_MAXLEN 16 #define CONN_TYPE_OFFSET 2 +#define BGX_NODE_NAME "bgx" +#define BGX_MAXID 9 + +#define FDT_NAME_MAXLEN 31 + int bgx_fdt_init_phy(struct bgx *); static void @@ -119,28 +125,152 @@ bgx_fdt_phy_mode_match(struct bgx *bgx, return (FALSE); } +static phandle_t +bgx_fdt_traverse_nodes(phandle_t start, char *name, size_t len) +{ + phandle_t node, ret; + size_t buf_size; + char *node_name; + int err; + + buf_size = sizeof(*node_name) * FDT_NAME_MAXLEN; + if (len > buf_size) { + /* + * This is an erroneous situation since the string + * to compare cannot be longer than FDT_NAME_MAXLEN. + */ + return (0); + } + + node_name = malloc(buf_size, M_BGX, M_WAITOK); + for (node = OF_child(start); node != 0; node = OF_peer(node)) { + /* Clean-up the buffer */ + memset(node_name, 0, buf_size); + /* Recurse to children */ + if (OF_child(node) != 0) { + ret = bgx_fdt_traverse_nodes(node, name, len); + if (ret != 0) { + free(node_name, M_BGX); + return (ret); + } + } + err = OF_getprop(node, "name", node_name, FDT_NAME_MAXLEN); + if ((err > 0) && (strncmp(node_name, name, len) == 0)) { + free(node_name, M_BGX); + return (node); + } + } + free(node_name, M_BGX); + + return (0); +} + +/* + * Similar functionality to pci_find_pcie_root_port() + * but this one works for ThunderX. + */ +static device_t +bgx_find_root_pcib(device_t dev) +{ + devclass_t pci_class; + device_t pcib, bus; + + pci_class = devclass_find("pci"); + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); + + /* Walk the bridge hierarchy until we find a non-PCI device */ + for (;;) { + bus = device_get_parent(dev); + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, + device_get_nameunit(dev))); + + if (device_get_devclass(bus) != pci_class) + return (NULL); + + pcib = device_get_parent(bus); + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, + device_get_nameunit(bus))); + + /* + * If the parent of this PCIB is not PCI + * then we found our root PCIB. + */ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + return (pcib); + + dev = pcib; + } +} + +static __inline phandle_t +bgx_fdt_find_node(struct bgx *bgx) +{ + device_t root_pcib; + phandle_t node; + char *bgx_sel; + size_t len; + + KASSERT(bgx->bgx_id <= BGX_MAXID, + ("Invalid BGX ID: %d, max: %d", bgx->bgx_id, BGX_MAXID)); + + len = sizeof(BGX_NODE_NAME) + 1; /* ++<\0> */ + /* Allocate memory for BGX node name + "/" character */ + bgx_sel = malloc(sizeof(*bgx_sel) * (len + 1), M_BGX, + M_ZERO | M_WAITOK); + + /* Prepare node's name */ + snprintf(bgx_sel, len + 1, "/"BGX_NODE_NAME"%d", bgx->bgx_id); + /* First try the root node */ + node = OF_finddevice(bgx_sel); + if ((int)node > 0) { + /* Found relevant node */ + goto out; + } + /* + * Clean-up and try to find BGX in DT + * starting from the parent PCI bridge node. + */ + memset(bgx_sel, 0, sizeof(*bgx_sel) * (len + 1)); + snprintf(bgx_sel, len, BGX_NODE_NAME"%d", bgx->bgx_id); + + /* Find PCI bridge that we are connected to */ + + root_pcib = bgx_find_root_pcib(bgx->dev); + if (root_pcib == NULL) { + device_printf(bgx->dev, "Unable to find BGX root bridge\n"); + node = 0; + goto out; + } + + node = ofw_bus_get_node(root_pcib); + if (node == 0) { + device_printf(bgx->dev, "No parent FDT node for BGX\n"); + goto out; + } + + node = bgx_fdt_traverse_nodes(node, bgx_sel, len); +out: + free(bgx_sel, M_BGX); + return (node); +} + int bgx_fdt_init_phy(struct bgx *bgx) { phandle_t node, child; phandle_t phy, mdio; uint8_t lmac; - char bgx_sel[6]; char qlm_mode[CONN_TYPE_MAXLEN]; - const char *mac; - - (void)mac; - lmac = 0; - /* Get BGX node from DT */ - snprintf(bgx_sel, 6, "/bgx%d", bgx->bgx_id); - node = OF_finddevice(bgx_sel); - if (node == 0 || node == -1) { + node = bgx_fdt_find_node(bgx); + if (node == 0) { device_printf(bgx->dev, - "Could not find %s node in FDT\n", bgx_sel); + "Could not find bgx%d node in FDT\n", bgx->bgx_id); return (ENXIO); } + lmac = 0; for (child = OF_child(node); child > 0; child = OF_peer(child)) { if (OF_getprop(child, "qlm-mode", qlm_mode, sizeof(qlm_mode)) <= 0) { Modified: head/sys/dev/vnic/thunder_bgx_var.h ============================================================================== --- head/sys/dev/vnic/thunder_bgx_var.h Thu Jan 28 14:11:59 2016 (r294989) +++ head/sys/dev/vnic/thunder_bgx_var.h Thu Jan 28 15:30:58 2016 (r294990) @@ -30,6 +30,8 @@ #ifndef __THUNDER_BGX_VAR_H__ #define __THUNDER_BGX_VAR_H__ +MALLOC_DECLARE(M_BGX); + struct lmac { struct bgx *bgx; int dmac; From owner-svn-src-head@freebsd.org Thu Jan 28 15:34:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E2AEA71BE4; Thu, 28 Jan 2016 15:34:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7D2212BA; Thu, 28 Jan 2016 15:34:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SFYDEO018128; Thu, 28 Jan 2016 15:34:13 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SFYDcT018123; Thu, 28 Jan 2016 15:34:13 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601281534.u0SFYDcT018123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 28 Jan 2016 15:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294991 - in head/sys: arm64/cavium conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 15:34:15 -0000 Author: zbb Date: Thu Jan 28 15:34:13 2016 New Revision: 294991 URL: https://svnweb.freebsd.org/changeset/base/294991 Log: Divide ThunderX PCIe driver to general and FDT part - Separate FDT and general PCIe driver parts - Drop some irrelevant printfs that cannot be displayed in FDT attach - Move ranges parsing to FDT portion of PCIe code Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5067 Added: head/sys/arm64/cavium/thunder_pcie_fdt.c (contents, props changed) Modified: head/sys/arm64/cavium/thunder_pcie.c head/sys/arm64/cavium/thunder_pcie_common.c head/sys/arm64/cavium/thunder_pcie_common.h head/sys/conf/files.arm64 Modified: head/sys/arm64/cavium/thunder_pcie.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie.c Thu Jan 28 15:30:58 2016 (r294990) +++ head/sys/arm64/cavium/thunder_pcie.c Thu Jan 28 15:34:13 2016 (r294991) @@ -43,9 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include #include #include @@ -82,23 +79,6 @@ __FBSDID("$FreeBSD$"); #define THUNDER_ECAM6_CFG_BASE 0x94a000000000UL #define THUNDER_ECAM7_CFG_BASE 0x94b000000000UL -#define OFW_CELL_TO_UINT64(cell) \ - (((uint64_t)(*(cell)) << 32) | (uint64_t)(*((cell) + 1))) - -#define SPACE_CODE_SHIFT 24 -#define SPACE_CODE_MASK 0x3 -#define SPACE_CODE_IO_SPACE 0x1 -#define PROPS_CELL_SIZE 1 -#define PCI_ADDR_CELL_SIZE 2 - -struct thunder_pcie_softc { - struct pcie_range ranges[RANGES_TUPLES_MAX]; - struct rman mem_rman; - struct resource *res; - int ecam; - device_t dev; -}; - /* * ThunderX supports up to 4 ethernet interfaces, so it's good * value to use as default for numbers of VFs, since each eth @@ -111,11 +91,8 @@ SYSCTL_INT(_hw, OID_AUTO, thunder_pcie_m /* Forward prototypes */ static struct resource *thunder_pcie_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); -static int thunder_pcie_attach(device_t); static int thunder_pcie_identify_pcib(device_t); static int thunder_pcie_maxslots(device_t); -static int parse_pci_mem_ranges(struct thunder_pcie_softc *); -static int thunder_pcie_probe(device_t); static uint32_t thunder_pcie_read_config(device_t, u_int, u_int, u_int, u_int, int); static int thunder_pcie_read_ivar(device_t, device_t, int, uintptr_t *); @@ -125,23 +102,7 @@ static void thunder_pcie_write_config(de u_int, u_int, uint32_t, int); static int thunder_pcie_write_ivar(device_t, device_t, int, uintptr_t); -static int -thunder_pcie_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (ofw_bus_is_compatible(dev, "cavium,thunder-pcie") || - ofw_bus_is_compatible(dev, "cavium,pci-host-thunder-ecam")) { - device_set_desc(dev, "Cavium Integrated PCI/PCI-E Controller"); - return (BUS_PROBE_DEFAULT); - } - - return (ENXIO); -} - -static int +int thunder_pcie_attach(device_t dev) { int rid; @@ -167,13 +128,6 @@ thunder_pcie_attach(device_t dev) sc->mem_rman.rm_type = RMAN_ARRAY; sc->mem_rman.rm_descr = "PCIe Memory"; - /* Retrieve 'ranges' property from FDT */ - if (bootverbose) - device_printf(dev, "parsing FDT for ECAM%d:\n", - sc->ecam); - if (parse_pci_mem_ranges(sc)) - return (ENXIO); - /* Initialize rman and allocate memory regions */ error = rman_init(&sc->mem_rman); if (error) { @@ -199,115 +153,6 @@ thunder_pcie_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -parse_pci_mem_ranges(struct thunder_pcie_softc *sc) -{ - phandle_t node; - pcell_t pci_addr_cells, parent_addr_cells, size_cells; - pcell_t attributes; - pcell_t *ranges_buf, *cell_ptr; - int cells_count, tuples_count; - int tuple; - int rv; - - node = ofw_bus_get_node(sc->dev); - - /* Find address cells if present */ - if (OF_getencprop(node, "#address-cells", &pci_addr_cells, - sizeof(pci_addr_cells)) < sizeof(pci_addr_cells)) - pci_addr_cells = 2; - - /* Find size cells if present */ - if (OF_getencprop(node, "#size-cells", &size_cells, - sizeof(size_cells)) < sizeof(size_cells)) - size_cells = 1; - - /* Find parent address cells if present */ - if (OF_getencprop(OF_parent(node), "#address-cells", - &parent_addr_cells, sizeof(parent_addr_cells)) < sizeof(parent_addr_cells)) - parent_addr_cells = 2; - - /* Check if FDT format matches driver requirements */ - if ((parent_addr_cells != 2) || (pci_addr_cells != 3) || - (size_cells != 2)) { - device_printf(sc->dev, - "Unexpected number of address or size cells in FDT " - " %d:%d:%d\n", - parent_addr_cells, pci_addr_cells, size_cells); - return (ENXIO); - } - - cells_count = OF_getencprop_alloc(node, "ranges", - sizeof(pcell_t), (void **)&ranges_buf); - if (cells_count == -1) { - device_printf(sc->dev, "Error parsing FDT 'ranges' property\n"); - return (ENXIO); - } - - tuples_count = cells_count / - (pci_addr_cells + parent_addr_cells + size_cells); - if (tuples_count > RANGES_TUPLES_MAX) { - device_printf(sc->dev, - "Unexpected number of 'ranges' tuples in FDT\n"); - rv = ENXIO; - goto out; - } - - cell_ptr = ranges_buf; - - for (tuple = 0; tuple < tuples_count; tuple++) { - /* - * TUPLE FORMAT: - * attributes - 32-bit attributes field - * PCI address - bus address combined of two cells in - * a following format: - * - * PA address - physical address combined of two cells in - * a following format: - * - * size - range size combined of two cells in - * a following format: - * - */ - attributes = *cell_ptr; - attributes = (attributes >> SPACE_CODE_SHIFT) & SPACE_CODE_MASK; - if (attributes == SPACE_CODE_IO_SPACE) { - /* Internal PCIe does not support IO space, ignore. */ - sc->ranges[tuple].phys_base = 0; - sc->ranges[tuple].size = 0; - cell_ptr += - (pci_addr_cells + parent_addr_cells + size_cells); - continue; - } - cell_ptr += PROPS_CELL_SIZE; - sc->ranges[tuple].pci_base = OFW_CELL_TO_UINT64(cell_ptr); - cell_ptr += PCI_ADDR_CELL_SIZE; - sc->ranges[tuple].phys_base = OFW_CELL_TO_UINT64(cell_ptr); - cell_ptr += parent_addr_cells; - sc->ranges[tuple].size = OFW_CELL_TO_UINT64(cell_ptr); - cell_ptr += size_cells; - - if (bootverbose) { - device_printf(sc->dev, - "\tPCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx\n", - sc->ranges[tuple].pci_base, - sc->ranges[tuple].phys_base, - sc->ranges[tuple].size); - } - - } - for (; tuple < RANGES_TUPLES_MAX; tuple++) { - /* zero-fill remaining tuples to mark empty elements in array */ - sc->ranges[tuple].phys_base = 0; - sc->ranges[tuple].size = 0; - } - - rv = 0; -out: - free(ranges_buf, M_OFWPROP); - return (rv); -} - static uint32_t thunder_pcie_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int bytes) @@ -558,8 +403,6 @@ thunder_pcie_identify_pcib(device_t dev) } static device_method_t thunder_pcie_methods[] = { - DEVMETHOD(device_probe, thunder_pcie_probe), - DEVMETHOD(device_attach, thunder_pcie_attach), DEVMETHOD(pcib_maxslots, thunder_pcie_maxslots), DEVMETHOD(pcib_read_config, thunder_pcie_read_config), DEVMETHOD(pcib_write_config, thunder_pcie_write_config), @@ -581,15 +424,5 @@ static device_method_t thunder_pcie_meth DEVMETHOD_END }; -static driver_t thunder_pcie_driver = { - "pcib", - thunder_pcie_methods, - sizeof(struct thunder_pcie_softc), -}; - -static devclass_t thunder_pcie_devclass; - -DRIVER_MODULE(thunder_pcib, simplebus, thunder_pcie_driver, -thunder_pcie_devclass, 0, 0); -DRIVER_MODULE(thunder_pcib, ofwbus, thunder_pcie_driver, -thunder_pcie_devclass, 0, 0); +DEFINE_CLASS_0(pcib, thunder_pcie_driver, thunder_pcie_methods, + sizeof(struct thunder_pcie_softc)); Modified: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.c Thu Jan 28 15:30:58 2016 (r294990) +++ head/sys/arm64/cavium/thunder_pcie_common.c Thu Jan 28 15:34:13 2016 (r294991) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + #include #include #include Modified: head/sys/arm64/cavium/thunder_pcie_common.h ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.h Thu Jan 28 15:30:58 2016 (r294990) +++ head/sys/arm64/cavium/thunder_pcie_common.h Thu Jan 28 15:34:13 2016 (r294991) @@ -32,6 +32,8 @@ #define RANGES_TUPLES_MAX 6 #define RANGES_TUPLES_INVALID (RANGES_TUPLES_MAX + 1) +DECLARE_CLASS(thunder_pcie_driver); + struct pcie_range { uint64_t pci_base; uint64_t phys_base; @@ -39,6 +41,14 @@ struct pcie_range { uint64_t flags; }; +struct thunder_pcie_softc { + struct pcie_range ranges[RANGES_TUPLES_MAX]; + struct rman mem_rman; + struct resource *res; + int ecam; + device_t dev; +}; + uint32_t range_addr_is_pci(struct pcie_range *, uint64_t, uint64_t); uint32_t range_addr_is_phys(struct pcie_range *, uint64_t, uint64_t); uint64_t range_addr_pci_to_phys(struct pcie_range *, uint64_t); @@ -48,4 +58,6 @@ int thunder_common_map_msi(device_t, dev int thunder_common_release_msi(device_t, device_t, int, int *); int thunder_common_release_msix(device_t, device_t, int); +int thunder_pcie_attach(device_t); + #endif /* _CAVIUM_THUNDER_PCIE_COMMON_H_ */ Added: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Thu Jan 28 15:34:13 2016 (r294991) @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2016 Cavium Inc. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "thunder_pcie_common.h" + +#define OFW_CELL_TO_UINT64(cell) \ + (((uint64_t)(*(cell)) << 32) | (uint64_t)(*((cell) + 1))) + +#define SPACE_CODE_SHIFT 24 +#define SPACE_CODE_MASK 0x3 +#define SPACE_CODE_IO_SPACE 0x1 +#define PROPS_CELL_SIZE 1 +#define PCI_ADDR_CELL_SIZE 2 + +static int thunder_pcie_fdt_probe(device_t); +static int thunder_pcie_fdt_attach(device_t); + +static device_method_t thunder_pcie_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, thunder_pcie_fdt_probe), + DEVMETHOD(device_attach, thunder_pcie_fdt_attach), + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_1(pcib, thunder_pcie_fdt_driver, thunder_pcie_fdt_methods, + sizeof(struct thunder_pcie_softc), thunder_pcie_driver); + +static devclass_t thunder_pcie_fdt_devclass; + +DRIVER_MODULE(thunder_pcib, simplebus, thunder_pcie_fdt_driver, + thunder_pcie_fdt_devclass, 0, 0); +DRIVER_MODULE(thunder_pcib, ofwbus, thunder_pcie_fdt_driver, + thunder_pcie_fdt_devclass, 0, 0); + +static int thunder_pcie_fdt_ranges(device_t); + +static int +thunder_pcie_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "cavium,thunder-pcie") || + ofw_bus_is_compatible(dev, "cavium,pci-host-thunder-ecam")) { + device_set_desc(dev, "Cavium Integrated PCI/PCI-E Controller"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +thunder_pcie_fdt_attach(device_t dev) +{ + + /* Retrieve 'ranges' property from FDT */ + if (thunder_pcie_fdt_ranges(dev) != 0) + return (ENXIO); + + return (thunder_pcie_attach(dev)); +} + +static int +thunder_pcie_fdt_ranges(device_t dev) +{ + struct thunder_pcie_softc *sc; + phandle_t node; + pcell_t pci_addr_cells, parent_addr_cells, size_cells; + pcell_t attributes; + pcell_t *ranges_buf, *cell_ptr; + int cells_count, tuples_count; + int tuple; + int rv; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + /* Find address cells if present */ + if (OF_getencprop(node, "#address-cells", &pci_addr_cells, + sizeof(pci_addr_cells)) < sizeof(pci_addr_cells)) + pci_addr_cells = 2; + + /* Find size cells if present */ + if (OF_getencprop(node, "#size-cells", &size_cells, + sizeof(size_cells)) < sizeof(size_cells)) + size_cells = 1; + + /* Find parent address cells if present */ + if (OF_getencprop(OF_parent(node), "#address-cells", + &parent_addr_cells, sizeof(parent_addr_cells)) < sizeof(parent_addr_cells)) + parent_addr_cells = 2; + + /* Check if FDT format matches driver requirements */ + if ((parent_addr_cells != 2) || (pci_addr_cells != 3) || + (size_cells != 2)) { + device_printf(dev, + "Unexpected number of address or size cells in FDT " + " %d:%d:%d\n", + parent_addr_cells, pci_addr_cells, size_cells); + return (ENXIO); + } + + cells_count = OF_getencprop_alloc(node, "ranges", + sizeof(pcell_t), (void **)&ranges_buf); + if (cells_count == -1) { + device_printf(dev, "Error parsing FDT 'ranges' property\n"); + return (ENXIO); + } + + tuples_count = cells_count / + (pci_addr_cells + parent_addr_cells + size_cells); + if (tuples_count > RANGES_TUPLES_MAX) { + device_printf(dev, + "Unexpected number of 'ranges' tuples in FDT\n"); + rv = ENXIO; + goto out; + } + + cell_ptr = ranges_buf; + + for (tuple = 0; tuple < tuples_count; tuple++) { + /* + * TUPLE FORMAT: + * attributes - 32-bit attributes field + * PCI address - bus address combined of two cells in + * a following format: + * + * PA address - physical address combined of two cells in + * a following format: + * + * size - range size combined of two cells in + * a following format: + * + */ + attributes = *cell_ptr; + attributes = (attributes >> SPACE_CODE_SHIFT) & SPACE_CODE_MASK; + if (attributes == SPACE_CODE_IO_SPACE) { + /* Internal PCIe does not support IO space, ignore. */ + sc->ranges[tuple].phys_base = 0; + sc->ranges[tuple].size = 0; + cell_ptr += + (pci_addr_cells + parent_addr_cells + size_cells); + continue; + } + cell_ptr += PROPS_CELL_SIZE; + sc->ranges[tuple].pci_base = OFW_CELL_TO_UINT64(cell_ptr); + cell_ptr += PCI_ADDR_CELL_SIZE; + sc->ranges[tuple].phys_base = OFW_CELL_TO_UINT64(cell_ptr); + cell_ptr += parent_addr_cells; + sc->ranges[tuple].size = OFW_CELL_TO_UINT64(cell_ptr); + cell_ptr += size_cells; + + if (bootverbose) { + device_printf(dev, + "\tPCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx\n", + sc->ranges[tuple].pci_base, + sc->ranges[tuple].phys_base, + sc->ranges[tuple].size); + } + + } + for (; tuple < RANGES_TUPLES_MAX; tuple++) { + /* zero-fill remaining tuples to mark empty elements in array */ + sc->ranges[tuple].phys_base = 0; + sc->ranges[tuple].size = 0; + } + + rv = 0; +out: + free(ranges_buf, M_OFWPROP); + return (rv); +} Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Jan 28 15:30:58 2016 (r294990) +++ head/sys/conf/files.arm64 Thu Jan 28 15:34:13 2016 (r294991) @@ -51,7 +51,8 @@ arm64/arm64/uma_machdep.c standard arm64/arm64/unwind.c optional ddb | kdtrace_hooks | stack arm64/arm64/vfp.c standard arm64/arm64/vm_machdep.c standard -arm64/cavium/thunder_pcie.c optional soc_cavm_thunderx pci fdt +arm64/cavium/thunder_pcie.c optional soc_cavm_thunderx pci +arm64/cavium/thunder_pcie_fdt.c optional soc_cavm_thunderx pci fdt arm64/cavium/thunder_pcie_pem.c optional soc_cavm_thunderx pci arm64/cavium/thunder_pcie_common.c optional soc_cavm_thunderx pci arm64/cloudabi64/cloudabi64_sysvec.c optional compat_cloudabi64 From owner-svn-src-head@freebsd.org Thu Jan 28 15:38:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C3FFA71CBB; Thu, 28 Jan 2016 15:38:04 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F277414D6; Thu, 28 Jan 2016 15:38:03 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SFc3El018300; Thu, 28 Jan 2016 15:38:03 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SFc3M6018299; Thu, 28 Jan 2016 15:38:03 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601281538.u0SFc3M6018299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 28 Jan 2016 15:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294992 - head/sys/arm64/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 15:38:04 -0000 Author: zbb Date: Thu Jan 28 15:38:02 2016 New Revision: 294992 URL: https://svnweb.freebsd.org/changeset/base/294992 Log: Correct alloc_ and release_resource methods in thunder_pcie driver - Avoid using BUS_ macros as bus_generic_ functions should be used instead. - Fix mistaken device_t pointers in thunder_pcie_alloc_resource. Should use dev->parent method and allocate resource for child device Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5068 Modified: head/sys/arm64/cavium/thunder_pcie.c Modified: head/sys/arm64/cavium/thunder_pcie.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie.c Thu Jan 28 15:34:13 2016 (r294991) +++ head/sys/arm64/cavium/thunder_pcie.c Thu Jan 28 15:38:02 2016 (r294992) @@ -268,7 +268,7 @@ thunder_pcie_release_resource(device_t d { if (type != SYS_RES_MEMORY) - return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + return (bus_generic_release_resource(dev, child, type, rid, res)); return (rman_release_resource(res)); @@ -291,7 +291,7 @@ thunder_pcie_alloc_resource(device_t dev rm = &sc->mem_rman; break; default: - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, + return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); }; From owner-svn-src-head@freebsd.org Thu Jan 28 15:40:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD77EA71D9C; Thu, 28 Jan 2016 15:40:57 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DBFC186A; Thu, 28 Jan 2016 15:40:57 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SFeuSC018447; Thu, 28 Jan 2016 15:40:56 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SFeuTb018443; Thu, 28 Jan 2016 15:40:56 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601281540.u0SFeuTb018443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 28 Jan 2016 15:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294993 - head/sys/arm64/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 15:40:57 -0000 Author: zbb Date: Thu Jan 28 15:40:56 2016 New Revision: 294993 URL: https://svnweb.freebsd.org/changeset/base/294993 Log: Add FDT bus capabilities to ThunderX PCI driver New ThunderX firmware incorporates modified DTB that presents different device hierarchy. In the new device tree, MDIO devices are below two additional buses that oddly hang on PCI bridge. Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5069 Modified: head/sys/arm64/cavium/thunder_pcie.c head/sys/arm64/cavium/thunder_pcie_common.c head/sys/arm64/cavium/thunder_pcie_common.h head/sys/arm64/cavium/thunder_pcie_fdt.c Modified: head/sys/arm64/cavium/thunder_pcie.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie.c Thu Jan 28 15:38:02 2016 (r294992) +++ head/sys/arm64/cavium/thunder_pcie.c Thu Jan 28 15:40:56 2016 (r294993) @@ -28,6 +28,7 @@ */ /* PCIe root complex driver for Cavium Thunder SOC */ +#include "opt_platform.h" #include __FBSDID("$FreeBSD$"); @@ -89,15 +90,11 @@ SYSCTL_INT(_hw, OID_AUTO, thunder_pcie_m &thunder_pcie_max_vfs, 0, "Max VFs supported by ThunderX internal PCIe"); /* Forward prototypes */ -static struct resource *thunder_pcie_alloc_resource(device_t, - device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int thunder_pcie_identify_pcib(device_t); static int thunder_pcie_maxslots(device_t); static uint32_t thunder_pcie_read_config(device_t, u_int, u_int, u_int, u_int, int); static int thunder_pcie_read_ivar(device_t, device_t, int, uintptr_t *); -static int thunder_pcie_release_resource(device_t, device_t, int, int, - struct resource *); static void thunder_pcie_write_config(device_t, u_int, u_int, u_int, u_int, uint32_t, int); static int thunder_pcie_write_ivar(device_t, device_t, int, uintptr_t); @@ -262,7 +259,7 @@ thunder_pcie_write_ivar(device_t dev, de return (ENOENT); } -static int +int thunder_pcie_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { @@ -274,7 +271,7 @@ thunder_pcie_release_resource(device_t d return (rman_release_resource(res)); } -static struct resource * +struct resource * thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { Modified: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.c Thu Jan 28 15:38:02 2016 (r294992) +++ head/sys/arm64/cavium/thunder_pcie_common.c Thu Jan 28 15:40:56 2016 (r294993) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -44,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "thunder_pcie_common.h" +MALLOC_DEFINE(M_THUNDER_PCIE, "Thunder PCIe driver", "Thunder PCIe driver memory"); + uint32_t range_addr_is_pci(struct pcie_range *ranges, uint64_t addr, uint64_t size) { Modified: head/sys/arm64/cavium/thunder_pcie_common.h ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.h Thu Jan 28 15:38:02 2016 (r294992) +++ head/sys/arm64/cavium/thunder_pcie_common.h Thu Jan 28 15:40:56 2016 (r294993) @@ -34,6 +34,8 @@ DECLARE_CLASS(thunder_pcie_driver); +MALLOC_DECLARE(M_THUNDER_PCIE); + struct pcie_range { uint64_t pci_base; uint64_t phys_base; @@ -58,6 +60,11 @@ int thunder_common_map_msi(device_t, dev int thunder_common_release_msi(device_t, device_t, int, int *); int thunder_common_release_msix(device_t, device_t, int); +struct resource *thunder_pcie_alloc_resource(device_t, + device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +int thunder_pcie_release_resource(device_t, device_t, int, int, + struct resource *); + int thunder_pcie_attach(device_t); #endif /* _CAVIUM_THUNDER_PCIE_COMMON_H_ */ Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Thu Jan 28 15:38:02 2016 (r294992) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Thu Jan 28 15:40:56 2016 (r294993) @@ -60,10 +60,32 @@ __FBSDID("$FreeBSD$"); static int thunder_pcie_fdt_probe(device_t); static int thunder_pcie_fdt_attach(device_t); +static struct resource * thunder_pcie_ofw_bus_alloc_res(device_t, device_t, + int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int thunder_pcie_ofw_bus_rel_res(device_t, device_t, int, int, + struct resource *); + +static const struct ofw_bus_devinfo *thunder_pcie_ofw_get_devinfo(device_t, + device_t); + static device_method_t thunder_pcie_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, thunder_pcie_fdt_probe), DEVMETHOD(device_attach, thunder_pcie_fdt_attach), + + /* Bus interface */ + DEVMETHOD(bus_alloc_resource, thunder_pcie_ofw_bus_alloc_res), + DEVMETHOD(bus_release_resource, thunder_pcie_ofw_bus_rel_res), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, thunder_pcie_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + /* End */ DEVMETHOD_END }; @@ -79,6 +101,7 @@ DRIVER_MODULE(thunder_pcib, ofwbus, thun thunder_pcie_fdt_devclass, 0, 0); static int thunder_pcie_fdt_ranges(device_t); +static int thunder_pcie_ofw_bus_attach(device_t); static int thunder_pcie_fdt_probe(device_t dev) @@ -99,14 +122,32 @@ thunder_pcie_fdt_probe(device_t dev) static int thunder_pcie_fdt_attach(device_t dev) { + int err; /* Retrieve 'ranges' property from FDT */ if (thunder_pcie_fdt_ranges(dev) != 0) return (ENXIO); + err = thunder_pcie_ofw_bus_attach(dev); + if (err != 0) + return (err); + return (thunder_pcie_attach(dev)); } +static __inline void +get_addr_size_cells(phandle_t node, pcell_t *addr_cells, pcell_t *size_cells) +{ + + *addr_cells = 2; + /* Find address cells if present */ + OF_getencprop(node, "#address-cells", addr_cells, sizeof(*addr_cells)); + + *size_cells = 2; + /* Find size cells if present */ + OF_getencprop(node, "#size-cells", size_cells, sizeof(*size_cells)); +} + static int thunder_pcie_fdt_ranges(device_t dev) { @@ -122,15 +163,7 @@ thunder_pcie_fdt_ranges(device_t dev) sc = device_get_softc(dev); node = ofw_bus_get_node(dev); - /* Find address cells if present */ - if (OF_getencprop(node, "#address-cells", &pci_addr_cells, - sizeof(pci_addr_cells)) < sizeof(pci_addr_cells)) - pci_addr_cells = 2; - - /* Find size cells if present */ - if (OF_getencprop(node, "#size-cells", &size_cells, - sizeof(size_cells)) < sizeof(size_cells)) - size_cells = 1; + get_addr_size_cells(node, &pci_addr_cells, &size_cells); /* Find parent address cells if present */ if (OF_getencprop(OF_parent(node), "#address-cells", @@ -217,3 +250,133 @@ out: free(ranges_buf, M_OFWPROP); return (rv); } + +/* OFW bus interface */ +struct thunder_pcie_ofw_devinfo { + struct ofw_bus_devinfo di_dinfo; + struct resource_list di_rl; +}; + +static const struct ofw_bus_devinfo * +thunder_pcie_ofw_get_devinfo(device_t bus __unused, device_t child) +{ + struct thunder_pcie_ofw_devinfo *di; + + di = device_get_ivars(child); + return (&di->di_dinfo); +} + +static struct resource * +thunder_pcie_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct thunder_pcie_softc *sc; + struct thunder_pcie_ofw_devinfo *di; + struct resource_list_entry *rle; + int i; + + /* For PCIe devices that do not have FDT nodes, use PCIB method */ + if (ofw_bus_get_node(child) == 0) { + return (thunder_pcie_alloc_resource(bus, child, type, rid, + start, end, count, flags)); + } + + sc = device_get_softc(bus); + + if ((start == 0UL) && (end == ~0UL)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + + /* Find defaults for this rid */ + rle = resource_list_find(&di->di_rl, type, *rid); + if (rle == NULL) + return (NULL); + + start = rle->start; + end = rle->end; + count = rle->count; + } + + if (type == SYS_RES_MEMORY) { + /* Remap through ranges property */ + for (i = 0; i < RANGES_TUPLES_MAX; i++) { + if (start >= sc->ranges[i].phys_base && end < + sc->ranges[i].pci_base + sc->ranges[i].size) { + start -= sc->ranges[i].phys_base; + start += sc->ranges[i].pci_base; + end -= sc->ranges[i].phys_base; + end += sc->ranges[i].pci_base; + break; + } + } + + if (i == RANGES_TUPLES_MAX) { + device_printf(bus, "Could not map resource " + "%#lx-%#lx\n", start, end); + return (NULL); + } + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} + +static int +thunder_pcie_ofw_bus_rel_res(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + /* For PCIe devices that do not have FDT nodes, use PCIB method */ + if (ofw_bus_get_node(child) == 0) { + return (thunder_pcie_release_resource(bus, + child, type, rid, res)); + } + + return (bus_generic_release_resource(bus, child, type, rid, res)); +} + +/* Helper functions */ + +static int +thunder_pcie_ofw_bus_attach(device_t dev) +{ + struct thunder_pcie_ofw_devinfo *di; + device_t child; + phandle_t parent, node; + pcell_t addr_cells, size_cells; + + parent = ofw_bus_get_node(dev); + if (parent > 0) { + get_addr_size_cells(parent, &addr_cells, &size_cells); + /* Iterate through all bus subordinates */ + for (node = OF_child(parent); node > 0; node = OF_peer(node)) { + /* Allocate and populate devinfo. */ + di = malloc(sizeof(*di), M_THUNDER_PCIE, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node) != 0) { + free(di, M_THUNDER_PCIE); + continue; + } + + /* Initialize and populate resource list. */ + resource_list_init(&di->di_rl); + ofw_bus_reg_to_rl(dev, node, addr_cells, size_cells, + &di->di_rl); + ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); + + /* Add newbus device for this FDT node */ + child = device_add_child(dev, NULL, -1); + if (child == NULL) { + resource_list_free(&di->di_rl); + ofw_bus_gen_destroy_devinfo(&di->di_dinfo); + free(di, M_THUNDER_PCIE); + continue; + } + + device_set_ivars(child, di); + } + } + + return (0); +} From owner-svn-src-head@freebsd.org Thu Jan 28 15:41:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7691A71DF9; Thu, 28 Jan 2016 15:41:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x22b.google.com (mail-oi0-x22b.google.com [IPv6:2607:f8b0:4003:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3A61AA3; Thu, 28 Jan 2016 15:41:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-oi0-x22b.google.com with SMTP id r14so28825500oie.0; Thu, 28 Jan 2016 07:41:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=STLt4Fh0ocHeX8rF3dZ1///4tWZxeHG5LpefF9YcCxk=; b=ay4Il746PNdQWP1PK3qgAjA5TuXe6G9b3AsQEn//9kFgoXQwY9Uysh23NMG2oMmC36 YrMgOSCqfsM5qPKufjfvabY2eAAEbUP5htgkts9/2uxtU/+PAHLa37RpBxk0lOUP1sv5 xY926Sf9enPgX4gjUuYNPcVssHq2e9DIL7My1EOefvwrq3m1MnbYu1998t6AkHwptpcl LSM51ENbMvwnYpNGf+Ppl2Af2likUIl/iRxgM6JSAtbn6Dm2yIm9l4IlevFUPC+8fobl 0r6ZpTyN5gxKyRyP2nyoZSJhGFwgWFx9wCnQ//9Ql+sfNGFLShKl6vkO1ZFP7XA9RDs9 kLZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=STLt4Fh0ocHeX8rF3dZ1///4tWZxeHG5LpefF9YcCxk=; b=YOgtsRRtmu1huiXYne+MFMbRvfyDvxYDX8ewGtxHYa9EaGgHxsnuW6W7CA3ZFGYc2B gdi573ck+EJDgJO8ipyJb+mnjBnUWJI8ADuGENkWNcpvkVvKk6cw+aF9RIhtJwvqlWHi S7ZRcNMRcYsWWLf4B5IEFnFtOW/Qkqn1Q6x/Jm6dn6510MzKZfFKdcVSR6EFWrYGpy1v vHt3qtbol8TyXgC7ma9AGRUynZu+6WY2ITwmDPJLRzWWBqVrPhYj2On8HY2Kah0mGGp7 XOv5J4QkLWBuLOFNHi/UhuonEoMgjmwvwlzi38Csk52PscRa4xfZ4vgzib5J0+plewq0 TivA== X-Gm-Message-State: AG10YOSoIjeWQF/kDgc4RLR3CHzC1vz++21ne0hmhumaXEVYG2TO+bJbkFEAmC82fZKS9Q== X-Received: by 10.202.214.144 with SMTP id n138mr2630723oig.69.1453995713763; Thu, 28 Jan 2016 07:41:53 -0800 (PST) Received: from [192.168.20.11] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id o8sm4615064obm.28.2016.01.28.07.41.51 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jan 2016 07:41:52 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r294909 - head/crypto/openssh From: NGie Cooper X-Mailer: iPhone Mail (13D15) In-Reply-To: <86fuxif28h.fsf@desk.des.no> Date: Thu, 28 Jan 2016 07:41:50 -0800 Cc: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <987A875E-45F0-4C3C-B6E2-42C619228ADA@gmail.com> References: <201601271340.u0RDeiU5060523@repo.freebsd.org> <7BEC31CD-F7AF-44B5-BBB5-9F4CAF3487A7@gmail.com> <86oac6f4xq.fsf@desk.des.no> <000001528781a663-adcfe209-147a-4fb4-83e4-e0911293f7f3-000000@email.amazonses.com> <86fuxif28h.fsf@desk.des.no> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 15:41:54 -0000 > On Jan 28, 2016, at 02:05, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > Colin Percival writes: >> At a guess, because NGie thinks that this is something which is important= >> enough to be worth mentioning in the FreeBSD release notes, and "Relnotes= : >> yes" flags the commit to the release engineering team for that purpose? >=20 > UseDNS was (unintentionally) turned off in head last week, I just turned > it back on. As Conrad said earlier, I incorrectly assumed that this needed to be MFCed: I= didn't look at the commit history for openssh, and the message stated the w= hat, not the why behind the change, so I assumed incorrectly that this was a= new feature. I apologize for the confusion. -NGie= From owner-svn-src-head@freebsd.org Thu Jan 28 15:44:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1658AA71F8B; Thu, 28 Jan 2016 15:44:16 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCDFF1DE0; Thu, 28 Jan 2016 15:44:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SFiEAO021164; Thu, 28 Jan 2016 15:44:14 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SFiEML021160; Thu, 28 Jan 2016 15:44:14 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601281544.u0SFiEML021160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 28 Jan 2016 15:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294994 - in head/sys: conf dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 15:44:16 -0000 Author: zbb Date: Thu Jan 28 15:44:14 2016 New Revision: 294994 URL: https://svnweb.freebsd.org/changeset/base/294994 Log: Support new MDIO hierarchy in ThunderX DTB Some firmware revisions provide different DTB tree that include odd MDIO placement in the tree. This commit adds support for 2 new buses: - MRML bridge (PCIB subordinate) - MDIO nexus (MRML subordinate) This allows for the correct MDIO attachment with both - new and old firmware. Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5070 Added: head/sys/dev/vnic/mrml_bridge.c (contents, props changed) Modified: head/sys/conf/files.arm64 head/sys/dev/vnic/thunder_mdio_fdt.c head/sys/dev/vnic/thunder_mdio_var.h Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Jan 28 15:40:56 2016 (r294993) +++ head/sys/conf/files.arm64 Thu Jan 28 15:44:14 2016 (r294994) @@ -71,6 +71,7 @@ dev/psci/psci_arm64.S optional psci dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg soc_hisi_hi6220 +dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov dev/vnic/nicvf_queues.c optional vnic pci pci_iov Added: head/sys/dev/vnic/mrml_bridge.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vnic/mrml_bridge.c Thu Jan 28 15:44:14 2016 (r294994) @@ -0,0 +1,280 @@ +/* + * Copyright (C) 2016 Cavium Inc. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +static MALLOC_DEFINE(M_MRMLB, "MRML bridge", "Cavium MRML bridge"); + +static device_probe_t mrmlb_fdt_probe; +static device_attach_t mrmlb_fdt_attach; + +static struct resource * mrmlb_ofw_bus_alloc_res(device_t, device_t, int, int *, + rman_res_t, rman_res_t, rman_res_t, u_int); + +static const struct ofw_bus_devinfo * mrmlb_ofw_get_devinfo(device_t, device_t); + +static device_method_t mrmlbus_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mrmlb_fdt_probe), + DEVMETHOD(device_attach, mrmlb_fdt_attach), + + /* Bus interface */ + DEVMETHOD(bus_alloc_resource, mrmlb_ofw_bus_alloc_res), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, mrmlb_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(mrmlbus, mrmlbus_fdt_driver, mrmlbus_fdt_methods, + sizeof(struct simplebus_softc)); + +static devclass_t mrmlbus_fdt_devclass; + +EARLY_DRIVER_MODULE(mrmlbus, pcib, mrmlbus_fdt_driver, mrmlbus_fdt_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + +static int mrmlb_ofw_fill_ranges(phandle_t, struct simplebus_softc *); +static int mrmlb_ofw_bus_attach(device_t); + +static int +mrmlb_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "cavium,thunder-8890-mrml-bridge")) + return (ENXIO); + + device_set_desc(dev, "Cavium ThunderX MRML bridge"); + return (BUS_PROBE_SPECIFIC); +} + +static int +mrmlb_fdt_attach(device_t dev) +{ + int err; + + err = mrmlb_ofw_bus_attach(dev); + if (err != 0) + return (err); + + return (bus_generic_attach(dev)); +} + +/* OFW bus interface */ +struct mrmlb_ofw_devinfo { + struct ofw_bus_devinfo di_dinfo; + struct resource_list di_rl; +}; + +static const struct ofw_bus_devinfo * +mrmlb_ofw_get_devinfo(device_t bus __unused, device_t child) +{ + struct mrmlb_ofw_devinfo *di; + + di = device_get_ivars(child); + return (&di->di_dinfo); +} + +static struct resource * +mrmlb_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct simplebus_softc *sc; + struct mrmlb_ofw_devinfo *di; + struct resource_list_entry *rle; + int i; + + if ((start == 0UL) && (end == ~0UL)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + + /* Find defaults for this rid */ + rle = resource_list_find(&di->di_rl, type, *rid); + if (rle == NULL) + return (NULL); + + start = rle->start; + end = rle->end; + count = rle->count; + } + + sc = device_get_softc(bus); + + if (type == SYS_RES_MEMORY) { + /* Remap through ranges property */ + for (i = 0; i < sc->nranges; i++) { + if (start >= sc->ranges[i].bus && end < + sc->ranges[i].bus + sc->ranges[i].size) { + start -= sc->ranges[i].bus; + start += sc->ranges[i].host; + end -= sc->ranges[i].bus; + end += sc->ranges[i].host; + break; + } + } + + if (i == sc->nranges && sc->nranges != 0) { + device_printf(bus, "Could not map resource " + "%#lx-%#lx\n", start, end); + return (NULL); + } + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} + +/* Helper functions */ + +static int +mrmlb_ofw_fill_ranges(phandle_t node, struct simplebus_softc *sc) +{ + int host_address_cells; + cell_t *base_ranges; + ssize_t nbase_ranges; + int err; + int i, j, k; + + err = OF_searchencprop(OF_parent(node), "#address-cells", + &host_address_cells, sizeof(host_address_cells)); + if (err <= 0) + return (-1); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges < 0) + return (-1); + sc->nranges = nbase_ranges / sizeof(cell_t) / + (sc->acells + host_address_cells + sc->scells); + if (sc->nranges == 0) + return (0); + + sc->ranges = malloc(sc->nranges * sizeof(sc->ranges[0]), + M_MRMLB, M_WAITOK); + base_ranges = malloc(nbase_ranges, M_MRMLB, M_WAITOK); + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < sc->nranges; i++) { + sc->ranges[i].bus = 0; + for (k = 0; k < sc->acells; k++) { + sc->ranges[i].bus <<= 32; + sc->ranges[i].bus |= base_ranges[j++]; + } + sc->ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + sc->ranges[i].host <<= 32; + sc->ranges[i].host |= base_ranges[j++]; + } + sc->ranges[i].size = 0; + for (k = 0; k < sc->scells; k++) { + sc->ranges[i].size <<= 32; + sc->ranges[i].size |= base_ranges[j++]; + } + } + + free(base_ranges, M_MRMLB); + return (sc->nranges); +} + +static int +mrmlb_ofw_bus_attach(device_t dev) +{ + struct simplebus_softc *sc; + struct mrmlb_ofw_devinfo *di; + device_t child; + phandle_t parent, node; + + parent = ofw_bus_get_node(dev); + simplebus_init(dev, parent); + + sc = device_get_softc(dev); + + if (mrmlb_ofw_fill_ranges(parent, sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + /* Iterate through all bus subordinates */ + for (node = OF_child(parent); node > 0; node = OF_peer(node)) { + /* Allocate and populate devinfo. */ + di = malloc(sizeof(*di), M_MRMLB, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node) != 0) { + free(di, M_MRMLB); + continue; + } + + /* Initialize and populate resource list. */ + resource_list_init(&di->di_rl); + ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, + &di->di_rl); + ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); + + /* Add newbus device for this FDT node */ + child = device_add_child(dev, NULL, -1); + if (child == NULL) { + resource_list_free(&di->di_rl); + ofw_bus_gen_destroy_devinfo(&di->di_dinfo); + free(di, M_MRMLB); + continue; + } + + device_set_ivars(child, di); + } + + return (0); +} Modified: head/sys/dev/vnic/thunder_mdio_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_mdio_fdt.c Thu Jan 28 15:40:56 2016 (r294993) +++ head/sys/dev/vnic/thunder_mdio_fdt.c Thu Jan 28 15:44:14 2016 (r294994) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include #include "thunder_mdio_var.h" @@ -60,17 +64,26 @@ static devclass_t thunder_mdio_fdt_devcl EARLY_DRIVER_MODULE(thunder_mdio, ofwbus, thunder_mdio_fdt_driver, thunder_mdio_fdt_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(thunder_mdio, mdionexus, thunder_mdio_fdt_driver, + thunder_mdio_fdt_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + +static struct ofw_compat_data mdio_compat_data[] = { + {"cavium,octeon-3860-mdio", true}, + {"cavium,thunder-8890-mdio", true}, + {NULL, false} +}; static int thunder_mdio_fdt_probe(device_t dev) { - if (ofw_bus_is_compatible(dev, "cavium,octeon-3860-mdio")) { - device_set_desc(dev, THUNDER_MDIO_DEVSTR); - return (BUS_PROBE_DEFAULT); - } + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_search_compatible(dev, mdio_compat_data)->ocd_data) + return (ENXIO); - return (ENXIO); + device_set_desc(dev, THUNDER_MDIO_DEVSTR); + return (BUS_PROBE_DEFAULT); } static int @@ -93,3 +106,184 @@ thunder_mdio_fdt_attach(device_t dev) return (0); } + +struct mdionexus_softc { + struct simplebus_softc simplebus_sc; +}; + +static device_probe_t mdionexus_fdt_probe; +static device_attach_t mdionexus_fdt_attach; + +static const struct ofw_bus_devinfo * mdionexus_ofw_get_devinfo(device_t, + device_t); + +static device_method_t mdionexus_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mdionexus_fdt_probe), + DEVMETHOD(device_attach, mdionexus_fdt_attach), + + /* Bus interface */ + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, mdionexus_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(mdionexus, mdionexus_fdt_driver, mdionexus_fdt_methods, + sizeof(struct mdionexus_softc)); + +static devclass_t mdionexus_fdt_devclass; + +EARLY_DRIVER_MODULE(mdionexus, mrmlbus, mdionexus_fdt_driver, + mdionexus_fdt_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + +static int mdionexus_ofw_fill_ranges(phandle_t, struct simplebus_softc *); +static int mdionexus_ofw_bus_attach(device_t); + +static int +mdionexus_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "cavium,thunder-8890-mdio-nexus")) + return (ENXIO); + + device_set_desc(dev, "Cavium ThunderX MDIO nexus"); + return (BUS_PROBE_SPECIFIC); +} + +static int +mdionexus_fdt_attach(device_t dev) +{ + int err; + + err = mdionexus_ofw_bus_attach(dev); + if (err != 0) + return (err); + + return (bus_generic_attach(dev)); +} + +/* OFW bus interface */ +struct mdionexus_ofw_devinfo { + struct ofw_bus_devinfo di_dinfo; + struct resource_list di_rl; +}; + +static const struct ofw_bus_devinfo * +mdionexus_ofw_get_devinfo(device_t bus __unused, device_t child) +{ + struct mdionexus_ofw_devinfo *di; + + di = device_get_ivars(child); + return (&di->di_dinfo); +} + +/* Helper functions */ + +static int +mdionexus_ofw_fill_ranges(phandle_t node, struct simplebus_softc *sc) +{ + int host_address_cells; + cell_t *base_ranges; + ssize_t nbase_ranges; + int err; + int i, j, k; + + err = OF_searchencprop(OF_parent(node), "#address-cells", + &host_address_cells, sizeof(host_address_cells)); + if (err <= 0) + return (-1); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges < 0) + return (-1); + sc->nranges = nbase_ranges / sizeof(cell_t) / + (sc->acells + host_address_cells + sc->scells); + if (sc->nranges == 0) + return (0); + + sc->ranges = malloc(sc->nranges * sizeof(sc->ranges[0]), + M_THUNDER_MDIO, M_WAITOK); + base_ranges = malloc(nbase_ranges, M_THUNDER_MDIO, M_WAITOK); + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < sc->nranges; i++) { + sc->ranges[i].bus = 0; + for (k = 0; k < sc->acells; k++) { + sc->ranges[i].bus <<= 32; + sc->ranges[i].bus |= base_ranges[j++]; + } + sc->ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + sc->ranges[i].host <<= 32; + sc->ranges[i].host |= base_ranges[j++]; + } + sc->ranges[i].size = 0; + for (k = 0; k < sc->scells; k++) { + sc->ranges[i].size <<= 32; + sc->ranges[i].size |= base_ranges[j++]; + } + } + + free(base_ranges, M_THUNDER_MDIO); + return (sc->nranges); +} + +static int +mdionexus_ofw_bus_attach(device_t dev) +{ + struct simplebus_softc *sc; + struct mdionexus_ofw_devinfo *di; + device_t child; + phandle_t parent, node; + + parent = ofw_bus_get_node(dev); + simplebus_init(dev, parent); + + sc = (struct simplebus_softc *)device_get_softc(dev); + + if (mdionexus_ofw_fill_ranges(parent, sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + /* Iterate through all bus subordinates */ + for (node = OF_child(parent); node > 0; node = OF_peer(node)) { + /* Allocate and populate devinfo. */ + di = malloc(sizeof(*di), M_THUNDER_MDIO, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node) != 0) { + free(di, M_THUNDER_MDIO); + continue; + } + + /* Initialize and populate resource list. */ + resource_list_init(&di->di_rl); + ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, + &di->di_rl); + ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); + + /* Add newbus device for this FDT node */ + child = device_add_child(dev, NULL, -1); + if (child == NULL) { + resource_list_free(&di->di_rl); + ofw_bus_gen_destroy_devinfo(&di->di_dinfo); + free(di, M_THUNDER_MDIO); + continue; + } + + device_set_ivars(child, di); + } + + return (0); +} Modified: head/sys/dev/vnic/thunder_mdio_var.h ============================================================================== --- head/sys/dev/vnic/thunder_mdio_var.h Thu Jan 28 15:40:56 2016 (r294993) +++ head/sys/dev/vnic/thunder_mdio_var.h Thu Jan 28 15:44:14 2016 (r294994) @@ -34,6 +34,7 @@ #define __THUNDER_MDIO_VAR_H__ #define THUNDER_MDIO_DEVSTR "Cavium ThunderX SMI/MDIO driver" +MALLOC_DECLARE(M_THUNDER_MDIO); DECLARE_CLASS(thunder_mdio_driver); enum thunder_mdio_mode { From owner-svn-src-head@freebsd.org Thu Jan 28 16:05:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4D7FA708BE; Thu, 28 Jan 2016 16:05:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 65635199E; Thu, 28 Jan 2016 16:05:47 +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 u0SG5k0v027053; Thu, 28 Jan 2016 16:05:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SG5kYU027051; Thu, 28 Jan 2016 16:05:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601281605.u0SG5kYU027051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 28 Jan 2016 16:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294995 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 16:05:47 -0000 Author: tuexen Date: Thu Jan 28 16:05:46 2016 New Revision: 294995 URL: https://svnweb.freebsd.org/changeset/base/294995 Log: Always look in the TCP pool. This fixes issues with a restarting peer when the listening 1-to-1 style socket is closed. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Jan 28 15:44:14 2016 (r294994) +++ head/sys/netinet/sctp_input.c Thu Jan 28 16:05:46 2016 (r294995) @@ -5688,6 +5688,7 @@ sctp_common_input_processing(struct mbuf if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif @@ -5719,6 +5720,7 @@ sctp_common_input_processing(struct mbuf if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif @@ -5831,6 +5833,7 @@ sctp_common_input_processing(struct mbuf if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Thu Jan 28 15:44:14 2016 (r294994) +++ head/sys/netinet/sctp_pcb.c Thu Jan 28 16:05:46 2016 (r294995) @@ -2256,7 +2256,6 @@ sctp_findassociation_addr(struct mbuf *m struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) { - int find_tcp_pool; struct sctp_tcb *stcb; struct sctp_inpcb *inp; @@ -2268,25 +2267,13 @@ sctp_findassociation_addr(struct mbuf *m return (stcb); } } - find_tcp_pool = 0; - /* - * Don't consider INIT chunks since that breaks 1-to-1 sockets: When - * a server closes the listener, incoming INIT chunks are not - * responsed by an INIT-ACK chunk. - */ - if ((ch->chunk_type != SCTP_INITIATION_ACK) && - (ch->chunk_type != SCTP_COOKIE_ACK) && - (ch->chunk_type != SCTP_COOKIE_ECHO)) { - /* Other chunk types go to the tcp pool. */ - find_tcp_pool = 1; - } if (inp_p) { stcb = sctp_findassociation_addr_sa(src, dst, inp_p, netp, - find_tcp_pool, vrf_id); + 1, vrf_id); inp = *inp_p; } else { stcb = sctp_findassociation_addr_sa(src, dst, &inp, netp, - find_tcp_pool, vrf_id); + 1, vrf_id); } SCTPDBG(SCTP_DEBUG_PCB1, "stcb:%p inp:%p\n", (void *)stcb, (void *)inp); if (stcb == NULL && inp) { From owner-svn-src-head@freebsd.org Thu Jan 28 16:51:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C96DA7199E; Thu, 28 Jan 2016 16:51:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id B87D71272; Thu, 28 Jan 2016 16:51:57 +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 u0SGpu5F039440; Thu, 28 Jan 2016 16:51:56 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SGpujK039438; Thu, 28 Jan 2016 16:51:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601281651.u0SGpujK039438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 28 Jan 2016 16:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294996 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 16:51:58 -0000 Author: glebius Date: Thu Jan 28 16:51:56 2016 New Revision: 294996 URL: https://svnweb.freebsd.org/changeset/base/294996 Log: Use m_getjcl() instead of manually selecting zone. Reviewed by: arybchik Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Thu Jan 28 16:05:46 2016 (r294995) +++ head/sys/dev/sfxge/sfxge.h Thu Jan 28 16:51:56 2016 (r294996) @@ -273,7 +273,7 @@ struct sfxge_softc { size_t rx_prefix_size; size_t rx_buffer_size; size_t rx_buffer_align; - uma_zone_t rx_buffer_zone; + int rx_cluster_size; unsigned int evq_max; unsigned int evq_count; Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Thu Jan 28 16:05:46 2016 (r294995) +++ head/sys/dev/sfxge/sfxge_rx.c Thu Jan 28 16:51:56 2016 (r294996) @@ -205,25 +205,6 @@ sfxge_rx_schedule_refill(struct sfxge_rx sfxge_rx_post_refill, rxq); } -static struct mbuf *sfxge_rx_alloc_mbuf(struct sfxge_softc *sc) -{ - struct mb_args args; - struct mbuf *m; - - /* Allocate mbuf structure */ - args.flags = M_PKTHDR; - args.type = MT_DATA; - m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, M_NOWAIT); - - /* Allocate (and attach) packet buffer */ - if (m != NULL && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) { - uma_zfree(zone_mbuf, m); - m = NULL; - } - - return (m); -} - #define SFXGE_REFILL_BATCH 64 static void @@ -273,7 +254,8 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, un KASSERT(rx_desc->mbuf == NULL, ("rx_desc->mbuf != NULL")); rx_desc->flags = EFX_DISCARD; - m = rx_desc->mbuf = sfxge_rx_alloc_mbuf(sc); + m = rx_desc->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + sc->rx_cluster_size); if (m == NULL) break; @@ -1125,13 +1107,13 @@ sfxge_rx_start(struct sfxge_softc *sc) /* Select zone for packet buffers */ if (reserved <= MCLBYTES) - sc->rx_buffer_zone = zone_clust; + sc->rx_cluster_size = MCLBYTES; else if (reserved <= MJUMPAGESIZE) - sc->rx_buffer_zone = zone_jumbop; + sc->rx_cluster_size = MJUMPAGESIZE; else if (reserved <= MJUM9BYTES) - sc->rx_buffer_zone = zone_jumbo9; + sc->rx_cluster_size = MJUM9BYTES; else - sc->rx_buffer_zone = zone_jumbo16; + sc->rx_cluster_size = MJUM16BYTES; /* * Set up the scale table. Enable all hash types and hash insertion. From owner-svn-src-head@freebsd.org Thu Jan 28 16:58:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F13B5A71BE4; Thu, 28 Jan 2016 16:58:50 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5117181C; Thu, 28 Jan 2016 16:58:50 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SGwn0v041903; Thu, 28 Jan 2016 16:58:49 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SGwnLa041899; Thu, 28 Jan 2016 16:58:49 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601281658.u0SGwnLa041899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 28 Jan 2016 16:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294998 - in head/sys: arm64/cavium dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 16:58:51 -0000 Author: zbb Date: Thu Jan 28 16:58:49 2016 New Revision: 294998 URL: https://svnweb.freebsd.org/changeset/base/294998 Log: Fix VNIC enumeration after r294993 and r294990 ofw_bus_get_node() must be tested against negative values since missing parent bus method will result in calling the default method which simply returns (-1): sys/dev/ofw/ofw_bus_if.m This was lost in the review process. Obtained from: Semihalf Sponsored by: Cavium Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/dev/vnic/thunder_bgx_fdt.c Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Thu Jan 28 16:52:02 2016 (r294997) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Thu Jan 28 16:58:49 2016 (r294998) @@ -276,7 +276,7 @@ thunder_pcie_ofw_bus_alloc_res(device_t int i; /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if (ofw_bus_get_node(child) == 0) { + if ((int)ofw_bus_get_node(child) <= 0) { return (thunder_pcie_alloc_resource(bus, child, type, rid, start, end, count, flags)); } @@ -329,7 +329,7 @@ thunder_pcie_ofw_bus_rel_res(device_t bu { /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if (ofw_bus_get_node(child) == 0) { + if ((int)ofw_bus_get_node(child) <= 0) { return (thunder_pcie_release_resource(bus, child, type, rid, res)); } Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 16:52:02 2016 (r294997) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 16:58:49 2016 (r294998) @@ -244,7 +244,7 @@ bgx_fdt_find_node(struct bgx *bgx) } node = ofw_bus_get_node(root_pcib); - if (node == 0) { + if ((int)node <= 0) { device_printf(bgx->dev, "No parent FDT node for BGX\n"); goto out; } From owner-svn-src-head@freebsd.org Thu Jan 28 18:57:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6BFAA70D9F; Thu, 28 Jan 2016 18:57:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9686318F2; Thu, 28 Jan 2016 18:57:48 +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 u0SIvlvm076794; Thu, 28 Jan 2016 18:57:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SIvlnk076793; Thu, 28 Jan 2016 18:57:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601281857.u0SIvlnk076793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 28 Jan 2016 18:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295006 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 18:57:48 -0000 Author: bdrewery Date: Thu Jan 28 18:57:47 2016 New Revision: 295006 URL: https://svnweb.freebsd.org/changeset/base/295006 Log: Fix -include .depend hack from r294370 for headers not in .PATH. This hack will be removed in a few weeks. It is here to fix incremental builds of SSH between r291941 and r294370. Reported by: jmallett MFC after: 1 day Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Thu Jan 28 18:45:09 2016 (r295005) +++ head/share/mk/bsd.dep.mk Thu Jan 28 18:57:47 2016 (r295006) @@ -206,12 +206,13 @@ depend: beforedepend ${DEPENDFILE} after _CFLAGS_INCLUDES= ${CFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} _CXXFLAGS_INCLUDES= ${CXXFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} # XXX: Temporary hack to workaround .depend files not tracking -include -.if !empty(_CFLAGS_INCLUDES) -${OBJS} ${POBJS} ${SOBJS}: ${_CFLAGS_INCLUDES:M*.h} -.endif -.if !empty(_CXXFLAGS_INCLUDES) -${OBJS} ${POBJS} ${SOBJS}: ${_CXXFLAGS_INCLUDES:M*.h} +_hdrincludes=${_CFLAGS_INCLUDES:M*.h} ${_CXXFLAGS_INCLUDES:M*.h} +.for _hdr in ${_hdrincludes:O:u} +.if exists(${_hdr}) +${OBJS} ${POBJS} ${SOBJS}: ${_hdr} .endif +.endfor +.undef _hdrincludes # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. From owner-svn-src-head@freebsd.org Thu Jan 28 19:34:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EE58A71A85; Thu, 28 Jan 2016 19:34:24 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.strugglingcoder.info", Issuer "mail.strugglingcoder.info" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 20A101E0D; Thu, 28 Jan 2016 19:34:23 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 924A6BCC7; Thu, 28 Jan 2016 11:34:16 -0800 (PST) Date: Thu, 28 Jan 2016 11:34:16 -0800 From: Hiren Panchasara To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294840 - head/sys/netinet Message-ID: <20160128193416.GG33155@strugglingcoder.info> References: <201601261633.u0QGXcdh083557@repo.freebsd.org> <20160126225332.GU6885@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5L6AZ1aJH5mDrqCQ" Content-Disposition: inline In-Reply-To: <20160126225332.GU6885@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 19:34:24 -0000 --5L6AZ1aJH5mDrqCQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Somehow I totally missed this email. On 01/26/16 at 02:53P, Gleb Smirnoff wrote: > Hiren, >=20 > On Tue, Jan 26, 2016 at 04:33:38PM +0000, Hiren Panchasara wrote: > H> Author: hiren > H> Date: Tue Jan 26 16:33:38 2016 > H> New Revision: 294840 > H> URL: https://svnweb.freebsd.org/changeset/base/294840 > H>=20 > H> Log: > H> Persist timers TCPTV_PERSMIN and TCPTV_PERSMAX are hardcoded with 5 = seconds and > H> 60 seconds, respectively. Turn them into sysctls that can be tuned l= ive. The > H> default values of 5 seconds and 60 seconds have been retained. > H> =20 > H> Submitted by: Jason Wolfe (j at nitrology dot com) > H> Reviewed by: gnn, rrs, hiren, bz > H> MFC after: 1 week > H> Sponsored by: Limelight Networks > H> Differential Revision: https://reviews.freebsd.org/D5024 >=20 > A theoretical question: could it be useful to make them socket options > like the TCP_KEEP* timeouts? Hum, unsure. I do not have a use-case for that currently. Cheers, Hiren --5L6AZ1aJH5mDrqCQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJWqm01XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l8/oIAIn06TbeEmqnvUL0PSNRP0ge 0yX9AtrEyvJJ/c5i2Sux2U09ojPcGxJrhtd3XsfeSK4npgNrEV/87IeYO+V4s4Gd hjfGh+0BkTgOaVH4APAF3oQIsbKM4ziLDpBi+dayCqVsnVRQQ2AHQ1qxOJaSPoKl ehOjcq0zMI+uP+CIEVyBcmG0YrbUYLWG8Rlypk8QLq6PCq+ui2r6jOqwQ09PnRVO LwNyrk7qq2Yaktsrkp/W48R8Xq/I2CHfMblEz15/AaRJmuigv0GIWylq3qEgWzue jbkKelqza43ddduVS6DyOeFRWYkb3xFe6dAnmYKluvfTsqfSr4k7i/NgJNYV2aE= =jJHi -----END PGP SIGNATURE----- --5L6AZ1aJH5mDrqCQ-- From owner-svn-src-head@freebsd.org Thu Jan 28 20:15:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FB86A3CA8D; Thu, 28 Jan 2016 20:15:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D06CD145A; Thu, 28 Jan 2016 20:15:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SKFQ36001907; Thu, 28 Jan 2016 20:15:26 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SKFMeF001864; Thu, 28 Jan 2016 20:15:22 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201601282015.u0SKFMeF001864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 28 Jan 2016 20:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295009 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/aes/asm crypto/openssl/crypto/bio crypto/openssl/crypto/bn cr... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 20:15:28 -0000 Author: jkim Date: Thu Jan 28 20:15:22 2016 New Revision: 295009 URL: https://svnweb.freebsd.org/changeset/base/295009 Log: Merge OpenSSL 1.0.2f. Relnotes: yes Added: head/crypto/openssl/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod - copied unchanged from r295001, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod head/crypto/openssl/util/pod2mantest - copied unchanged from r295001, vendor-crypto/openssl/dist/util/pod2mantest head/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 (contents, props changed) Modified: head/crypto/openssl/ACKNOWLEDGMENTS head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/INSTALL head/crypto/openssl/LICENSE head/crypto/openssl/Makefile head/crypto/openssl/Makefile.org head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/engine.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/pkcs12.c head/crypto/openssl/apps/pkeyutl.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/x509.c head/crypto/openssl/crypto/aes/aes.h head/crypto/openssl/crypto/aes/aes_cbc.c head/crypto/openssl/crypto/aes/aes_cfb.c head/crypto/openssl/crypto/aes/aes_core.c head/crypto/openssl/crypto/aes/aes_ctr.c head/crypto/openssl/crypto/aes/aes_ecb.c head/crypto/openssl/crypto/aes/aes_ige.c head/crypto/openssl/crypto/aes/aes_locl.h head/crypto/openssl/crypto/aes/aes_misc.c head/crypto/openssl/crypto/aes/aes_ofb.c head/crypto/openssl/crypto/aes/aes_x86core.c head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl head/crypto/openssl/crypto/bio/bio.h head/crypto/openssl/crypto/bio/bss_bio.c head/crypto/openssl/crypto/bio/bss_conn.c head/crypto/openssl/crypto/bio/bss_dgram.c head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/exptest.c head/crypto/openssl/crypto/camellia/camellia.c head/crypto/openssl/crypto/camellia/camellia.h head/crypto/openssl/crypto/camellia/cmll_cbc.c head/crypto/openssl/crypto/camellia/cmll_cfb.c head/crypto/openssl/crypto/camellia/cmll_ctr.c head/crypto/openssl/crypto/camellia/cmll_ecb.c head/crypto/openssl/crypto/camellia/cmll_locl.h head/crypto/openssl/crypto/camellia/cmll_misc.c head/crypto/openssl/crypto/camellia/cmll_ofb.c head/crypto/openssl/crypto/camellia/cmll_utl.c head/crypto/openssl/crypto/des/des_old.c head/crypto/openssl/crypto/des/des_old.h head/crypto/openssl/crypto/des/des_old2.c head/crypto/openssl/crypto/dh/dh.h head/crypto/openssl/crypto/dh/dh_check.c head/crypto/openssl/crypto/dh/dhtest.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/dso/dso.h head/crypto/openssl/crypto/dso/dso_dl.c head/crypto/openssl/crypto/dso/dso_dlfcn.c head/crypto/openssl/crypto/dso/dso_lib.c head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl head/crypto/openssl/crypto/ec/ec2_smpl.c head/crypto/openssl/crypto/ec/ec_key.c head/crypto/openssl/crypto/ec/ecp_nistz256_table.c head/crypto/openssl/crypto/ec/ectest.c head/crypto/openssl/crypto/engine/eng_all.c head/crypto/openssl/crypto/evp/e_camellia.c head/crypto/openssl/crypto/evp/e_old.c head/crypto/openssl/crypto/evp/e_seed.c head/crypto/openssl/crypto/mem_clr.c head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl head/crypto/openssl/crypto/o_dir.c head/crypto/openssl/crypto/o_dir.h head/crypto/openssl/crypto/o_dir_test.c head/crypto/openssl/crypto/o_str.c head/crypto/openssl/crypto/o_str.h head/crypto/openssl/crypto/o_time.c head/crypto/openssl/crypto/o_time.h head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/rc4/rc4_utl.c head/crypto/openssl/crypto/rsa/rsa_chk.c head/crypto/openssl/crypto/rsa/rsa_sign.c head/crypto/openssl/crypto/seed/seed_cbc.c head/crypto/openssl/crypto/seed/seed_cfb.c head/crypto/openssl/crypto/seed/seed_ecb.c head/crypto/openssl/crypto/seed/seed_ofb.c head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl head/crypto/openssl/crypto/sha/sha1test.c head/crypto/openssl/crypto/store/store.h head/crypto/openssl/crypto/store/str_lib.c head/crypto/openssl/crypto/store/str_locl.h head/crypto/openssl/crypto/store/str_mem.c head/crypto/openssl/crypto/store/str_meth.c head/crypto/openssl/crypto/ts/ts_rsp_verify.c head/crypto/openssl/crypto/ui/ui.h head/crypto/openssl/crypto/ui/ui_compat.c head/crypto/openssl/crypto/ui/ui_compat.h head/crypto/openssl/crypto/ui/ui_lib.c head/crypto/openssl/crypto/ui/ui_locl.h head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/ui/ui_util.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/crypto/x509/x509_vfy.h head/crypto/openssl/crypto/x509/x509_vpm.c head/crypto/openssl/crypto/x509v3/v3_pci.c head/crypto/openssl/crypto/x509v3/v3_pcia.c head/crypto/openssl/crypto/x509v3/v3_utl.c head/crypto/openssl/crypto/x509v3/v3nametest.c head/crypto/openssl/doc/apps/s_time.pod head/crypto/openssl/doc/crypto/BIO_s_connect.pod head/crypto/openssl/doc/ssl/SSL_CTX_set1_verify_cert_store.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod head/crypto/openssl/engines/e_chil.c head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/kssl.c head/crypto/openssl/ssl/kssl.h head/crypto/openssl/ssl/kssl_lcl.h head/crypto/openssl/ssl/s2_srvr.c head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl_err.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_sess.c head/crypto/openssl/ssl/t1_enc.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/util/domd head/crypto/openssl/util/pl/VC-32.pl head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_ECPKParameters.3 head/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ec.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/Makefile.man head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CONF_CTX_new.3 head/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libssl/man/SSL_CONF_cmd.3 head/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 head/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get0_param.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set1_curves.3 head/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_check_chain.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_psk_identity.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/c_rehash.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/ACKNOWLEDGMENTS ============================================================================== --- head/crypto/openssl/ACKNOWLEDGMENTS Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/ACKNOWLEDGMENTS Thu Jan 28 20:15:22 2016 (r295009) @@ -1,30 +1,2 @@ -The OpenSSL project depends on volunteer efforts and financial support from -the end user community. That support comes in the form of donations and paid -sponsorships, software support contracts, paid consulting services -and commissioned software development. - -Since all these activities support the continued development and improvement -of OpenSSL we consider all these clients and customers as sponsors of the -OpenSSL project. - -We would like to identify and thank the following such sponsors for their past -or current significant support of the OpenSSL project: - -Major support: - - Qualys http://www.qualys.com/ - -Very significant support: - - OpenGear: http://www.opengear.com/ - -Significant support: - - PSW Group: http://www.psw.net/ - Acano Ltd. http://acano.com/ - -Please note that we ask permission to identify sponsors and that some sponsors -we consider eligible for inclusion here have requested to remain anonymous. - -Additional sponsorship or financial support is always welcome: for more -information please contact the OpenSSL Software Foundation. +Please https://www.openssl.org/community/thanks.html for the current +acknowledgements. Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/CHANGES Thu Jan 28 20:15:22 2016 (r295009) @@ -2,6 +2,54 @@ OpenSSL CHANGES _______________ + Changes between 1.0.2e and 1.0.2f [28 Jan 2016] + + *) DH small subgroups + + Historically OpenSSL only ever generated DH parameters based on "safe" + primes. More recently (in version 1.0.2) support was provided for + generating X9.42 style parameter files such as those required for RFC 5114 + support. The primes used in such files may not be "safe". Where an + application is using DH configured with parameters based on primes that are + not "safe" then an attacker could use this fact to find a peer's private + DH exponent. This attack requires that the attacker complete multiple + handshakes in which the peer uses the same private DH exponent. For example + this could be used to discover a TLS server's private DH exponent if it's + reusing the private DH exponent or it's using a static DH ciphersuite. + + OpenSSL provides the option SSL_OP_SINGLE_DH_USE for ephemeral DH (DHE) in + TLS. It is not on by default. If the option is not set then the server + reuses the same private DH exponent for the life of the server process and + would be vulnerable to this attack. It is believed that many popular + applications do set this option and would therefore not be at risk. + + The fix for this issue adds an additional check where a "q" parameter is + available (as is the case in X9.42 based parameters). This detects the + only known attack, and is the only possible defense for static DH + ciphersuites. This could have some performance impact. + + Additionally the SSL_OP_SINGLE_DH_USE option has been switched on by + default and cannot be disabled. This could have some performance impact. + + This issue was reported to OpenSSL by Antonio Sanso (Adobe). + (CVE-2016-0701) + [Matt Caswell] + + *) SSLv2 doesn't block disabled ciphers + + A malicious client can negotiate SSLv2 ciphers that have been disabled on + the server and complete SSLv2 handshakes even if all SSLv2 ciphers have + been disabled, provided that the SSLv2 protocol was not also disabled via + SSL_OP_NO_SSLv2. + + This issue was reported to OpenSSL on 26th December 2015 by Nimrod Aviram + and Sebastian Schinzel. + (CVE-2015-3197) + [Viktor Dukhovni] + + *) Reject DH handshakes with parameters shorter than 1024 bits. + [Kurt Roeckx] + Changes between 1.0.2d and 1.0.2e [3 Dec 2015] *) BN_mod_exp may produce incorrect results on x86_64 Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/Configure Thu Jan 28 20:15:22 2016 (r295009) @@ -124,6 +124,9 @@ my $clang_disabled_warnings = "-Wno-unus # -Wextended-offsetof my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments"; +# Warn that "make depend" should be run? +my $warn_make_depend = 0; + my $strict_warnings = 0; my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; @@ -1513,7 +1516,7 @@ if ($target =~ /\-icc$/) # Intel C compi # linker only when --prefix is not /usr. if ($target =~ /^BSD\-/) { - $shared_ldflag.=" -Wl,-rpath,\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|); + $shared_ldflag.=" -Wl,-rpath,\$\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|); } if ($sys_id ne "") @@ -2028,14 +2031,8 @@ EOF &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); } if ($depflags ne $default_depflags && !$make_depend) { - print < (note that your message will be recorded in the request tracker publicly readable - via http://www.openssl.org/support/rt.html and will be forwarded to a - public mailing list). Include the output of "make report" in your message. - Please check out the request tracker. Maybe the bug was already - reported or has already been fixed. + at https://www.openssl.org/community/index.html#bugs and will be + forwarded to a public mailing list). Include the output of "make + report" in your message. Please check out the request tracker. Maybe + the bug was already reported or has already been fixed. [If you encounter assembler error messages, try the "no-asm" configuration option as an immediate fix.] Modified: head/crypto/openssl/LICENSE ============================================================================== --- head/crypto/openssl/LICENSE Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/LICENSE Thu Jan 28 20:15:22 2016 (r295009) @@ -12,7 +12,7 @@ --------------- /* ==================================================================== - * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/crypto/openssl/Makefile ============================================================================== --- head/crypto/openssl/Makefile Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/Makefile Thu Jan 28 20:15:22 2016 (r295009) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2e +VERSION=1.0.2f MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 @@ -182,8 +182,7 @@ SHARED_LDFLAGS= GENERAL= Makefile BASENAME= openssl NAME= $(BASENAME)-$(VERSION) -TARFILE= $(NAME).tar -WTARFILE= $(NAME)-win.tar +TARFILE= ../$(NAME).tar EXHEADER= e_os2.h HEADER= e_os.h @@ -501,38 +500,35 @@ TABLE: Configure # would occur. Therefore the list of files is temporarily stored into a file # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # tar does not support the --files-from option. -TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \ - --owner openssl:0 --group openssl:0 \ - --transform 's|^|openssl-$(VERSION)/|' \ +TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \ + --owner 0 --group 0 \ + --transform 's|^|$(NAME)/|' \ -cvf - -../$(TARFILE).list: +$(TARFILE).list: find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \ \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \ - \! -name '*test' \! -name '.#*' \! -name '*~' \ - | sort > ../$(TARFILE).list + \( \! -name '*test' -o -name bctest -o -name pod2mantest \) \ + \! -name '.#*' \! -name '*~' \! -type l \ + | sort > $(TARFILE).list -tar: ../$(TARFILE).list +tar: $(TARFILE).list find . -type d -print | xargs chmod 755 find . -type f -print | xargs chmod a+r find . -type f -perm -0100 -print | xargs chmod a+x - $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz - rm -f ../$(TARFILE).list - ls -l ../$(TARFILE).gz - -tar-snap: ../$(TARFILE).list - $(TAR_COMMAND) > ../$(TARFILE) - rm -f ../$(TARFILE).list - ls -l ../$(TARFILE) + $(TAR_COMMAND) | gzip --best > $(TARFILE).gz + rm -f $(TARFILE).list + ls -l $(TARFILE).gz + +tar-snap: $(TARFILE).list + $(TAR_COMMAND) > $(TARFILE) + rm -f $(TARFILE).list + ls -l $(TARFILE) dist: $(PERL) Configure dist - @$(MAKE) dist_pem_h @$(MAKE) SDIRS='$(SDIRS)' clean - @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar - -dist_pem_h: - (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) + @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar install: all install_docs install_sw Modified: head/crypto/openssl/Makefile.org ============================================================================== --- head/crypto/openssl/Makefile.org Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/Makefile.org Thu Jan 28 20:15:22 2016 (r295009) @@ -180,8 +180,7 @@ SHARED_LDFLAGS= GENERAL= Makefile BASENAME= openssl NAME= $(BASENAME)-$(VERSION) -TARFILE= $(NAME).tar -WTARFILE= $(NAME)-win.tar +TARFILE= ../$(NAME).tar EXHEADER= e_os2.h HEADER= e_os.h @@ -499,38 +498,35 @@ TABLE: Configure # would occur. Therefore the list of files is temporarily stored into a file # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # tar does not support the --files-from option. -TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \ - --owner openssl:0 --group openssl:0 \ - --transform 's|^|openssl-$(VERSION)/|' \ +TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \ + --owner 0 --group 0 \ + --transform 's|^|$(NAME)/|' \ -cvf - -../$(TARFILE).list: +$(TARFILE).list: find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \ \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \ - \! -name '*test' \! -name '.#*' \! -name '*~' \ - | sort > ../$(TARFILE).list + \( \! -name '*test' -o -name bctest -o -name pod2mantest \) \ + \! -name '.#*' \! -name '*~' \! -type l \ + | sort > $(TARFILE).list -tar: ../$(TARFILE).list +tar: $(TARFILE).list find . -type d -print | xargs chmod 755 find . -type f -print | xargs chmod a+r find . -type f -perm -0100 -print | xargs chmod a+x - $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz - rm -f ../$(TARFILE).list - ls -l ../$(TARFILE).gz - -tar-snap: ../$(TARFILE).list - $(TAR_COMMAND) > ../$(TARFILE) - rm -f ../$(TARFILE).list - ls -l ../$(TARFILE) + $(TAR_COMMAND) | gzip --best > $(TARFILE).gz + rm -f $(TARFILE).list + ls -l $(TARFILE).gz + +tar-snap: $(TARFILE).list + $(TAR_COMMAND) > $(TARFILE) + rm -f $(TARFILE).list + ls -l $(TARFILE) dist: $(PERL) Configure dist - @$(MAKE) dist_pem_h @$(MAKE) SDIRS='$(SDIRS)' clean - @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar - -dist_pem_h: - (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) + @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar install: all install_docs install_sw Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/NEWS Thu Jan 28 20:15:22 2016 (r295009) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2e and OpenSSL 1.0.2f [28 Jan 2016] + + o DH small subgroups (CVE-2016-0701) + o SSLv2 doesn't block disabled ciphers (CVE-2015-3197) + Major changes between OpenSSL 1.0.2d and OpenSSL 1.0.2e [3 Dec 2015] o BN_mod_exp may produce incorrect results on x86_64 (CVE-2015-3193) Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/README Thu Jan 28 20:15:22 2016 (r295009) @@ -1,5 +1,5 @@ - OpenSSL 1.0.2e 3 Dec 2015 + OpenSSL 1.0.2f 28 Jan 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson @@ -90,11 +90,12 @@ In order to avoid spam, this is a moderated mailing list, and it might take a day for the ticket to show up. (We also scan posts to make sure - that security disclosures aren't publically posted by mistake.) Mail to - this address is recorded in the public RT (request tracker) database (see - https://www.openssl.org/support/rt.html for details) and also forwarded - the public openssl-dev mailing list. Confidential mail may be sent to - openssl-security@openssl.org (PGP key available from the key servers). + that security disclosures aren't publically posted by mistake.) Mail + to this address is recorded in the public RT (request tracker) database + (see https://www.openssl.org/community/index.html#bugs for details) and + also forwarded the public openssl-dev mailing list. Confidential mail + may be sent to openssl-security@openssl.org (PGP key available from the + key servers). Please do NOT use this for general assistance or support queries. Just because something doesn't work the way you expect does not mean it Modified: head/crypto/openssl/apps/engine.c ============================================================================== --- head/crypto/openssl/apps/engine.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/apps/engine.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* apps/engine.c -*- mode: C; c-file-style: "eay" -*- */ +/* apps/engine.c */ /* * Written by Richard Levitte for the OpenSSL project * 2000. Modified: head/crypto/openssl/apps/ocsp.c ============================================================================== --- head/crypto/openssl/apps/ocsp.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/apps/ocsp.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1041,7 +1041,7 @@ static int make_ocsp_response(OCSP_RESPO bs = OCSP_BASICRESP_new(); thisupd = X509_gmtime_adj(NULL, 0); if (ndays != -1) - nextupd = X509_gmtime_adj(NULL, nmin * 60 + ndays * 3600 * 24); + nextupd = X509_time_adj_ex(NULL, ndays, nmin * 60, NULL); /* Examine each certificate id in the request */ for (i = 0; i < id_count; i++) { Modified: head/crypto/openssl/apps/pkcs12.c ============================================================================== --- head/crypto/openssl/apps/pkcs12.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/apps/pkcs12.c Thu Jan 28 20:15:22 2016 (r295009) @@ -79,7 +79,8 @@ const EVP_CIPHER *enc; # define CLCERTS 0x8 # define CACERTS 0x10 -int get_cert_chain(X509 *cert, X509_STORE *store, STACK_OF(X509) **chain); +static int get_cert_chain(X509 *cert, X509_STORE *store, + STACK_OF(X509) **chain); int dump_certs_keys_p12(BIO *out, PKCS12 *p12, char *pass, int passlen, int options, char *pempass); int dump_certs_pkeys_bags(BIO *out, STACK_OF(PKCS12_SAFEBAG) *bags, @@ -594,7 +595,7 @@ int MAIN(int argc, char **argv) vret = get_cert_chain(ucert, store, &chain2); X509_STORE_free(store); - if (!vret) { + if (vret == X509_V_OK) { /* Exclude verified certificate */ for (i = 1; i < sk_X509_num(chain2); i++) sk_X509_push(certs, sk_X509_value(chain2, i)); @@ -602,7 +603,7 @@ int MAIN(int argc, char **argv) X509_free(sk_X509_value(chain2, 0)); sk_X509_free(chain2); } else { - if (vret >= 0) + if (vret != X509_V_ERR_UNSPECIFIED) BIO_printf(bio_err, "Error %s getting chain.\n", X509_verify_cert_error_string(vret)); else @@ -906,36 +907,25 @@ int dump_certs_pkeys_bag(BIO *out, PKCS1 /* Given a single certificate return a verified chain or NULL if error */ -/* Hope this is OK .... */ - -int get_cert_chain(X509 *cert, X509_STORE *store, STACK_OF(X509) **chain) +static int get_cert_chain(X509 *cert, X509_STORE *store, + STACK_OF(X509) **chain) { X509_STORE_CTX store_ctx; - STACK_OF(X509) *chn; + STACK_OF(X509) *chn = NULL; int i = 0; - /* - * FIXME: Should really check the return status of X509_STORE_CTX_init - * for an error, but how that fits into the return value of this function - * is less obvious. - */ - X509_STORE_CTX_init(&store_ctx, store, cert, NULL); - if (X509_verify_cert(&store_ctx) <= 0) { - i = X509_STORE_CTX_get_error(&store_ctx); - if (i == 0) - /* - * avoid returning 0 if X509_verify_cert() did not set an - * appropriate error value in the context - */ - i = -1; - chn = NULL; - goto err; - } else + if (!X509_STORE_CTX_init(&store_ctx, store, cert, NULL)) { + *chain = NULL; + return X509_V_ERR_UNSPECIFIED; + } + + if (X509_verify_cert(&store_ctx) > 0) chn = X509_STORE_CTX_get1_chain(&store_ctx); - err: + else if ((i = X509_STORE_CTX_get_error(&store_ctx)) == 0) + i = X509_V_ERR_UNSPECIFIED; + X509_STORE_CTX_cleanup(&store_ctx); *chain = chn; - return i; } Modified: head/crypto/openssl/apps/pkeyutl.c ============================================================================== --- head/crypto/openssl/apps/pkeyutl.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/apps/pkeyutl.c Thu Jan 28 20:15:22 2016 (r295009) @@ -74,10 +74,11 @@ static void usage(void); static EVP_PKEY_CTX *init_ctx(int *pkeysize, char *keyfile, int keyform, int key_type, - char *passargin, int pkey_op, ENGINE *e); + char *passargin, int pkey_op, ENGINE *e, + int impl); static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform, - const char *file); + const char *file, ENGINE* e); static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op, unsigned char *out, size_t *poutlen, @@ -97,6 +98,7 @@ int MAIN(int argc, char **argv) EVP_PKEY_CTX *ctx = NULL; char *passargin = NULL; int keysize = -1; + int engine_impl = 0; unsigned char *buf_in = NULL, *buf_out = NULL, *sig = NULL; size_t buf_outlen; @@ -137,7 +139,7 @@ int MAIN(int argc, char **argv) else { ctx = init_ctx(&keysize, *(++argv), keyform, key_type, - passargin, pkey_op, e); + passargin, pkey_op, e, engine_impl); if (!ctx) { BIO_puts(bio_err, "Error initializing context\n"); ERR_print_errors(bio_err); @@ -147,7 +149,7 @@ int MAIN(int argc, char **argv) } else if (!strcmp(*argv, "-peerkey")) { if (--argc < 1) badarg = 1; - else if (!setup_peer(bio_err, ctx, peerform, *(++argv))) + else if (!setup_peer(bio_err, ctx, peerform, *(++argv), e)) badarg = 1; } else if (!strcmp(*argv, "-passin")) { if (--argc < 1) @@ -171,6 +173,8 @@ int MAIN(int argc, char **argv) badarg = 1; else e = setup_engine(bio_err, *(++argv), 0); + } else if (!strcmp(*argv, "-engine_impl")) { + engine_impl = 1; } #endif else if (!strcmp(*argv, "-pubin")) @@ -368,7 +372,8 @@ static void usage() BIO_printf(bio_err, "-hexdump hex dump output\n"); #ifndef OPENSSL_NO_ENGINE BIO_printf(bio_err, - "-engine e use engine e, possibly a hardware device.\n"); + "-engine e use engine e, maybe a hardware device, for loading keys.\n"); + BIO_printf(bio_err, "-engine_impl also use engine given by -engine for crypto operations\n"); #endif BIO_printf(bio_err, "-passin arg pass phrase source\n"); @@ -376,10 +381,12 @@ static void usage() static EVP_PKEY_CTX *init_ctx(int *pkeysize, char *keyfile, int keyform, int key_type, - char *passargin, int pkey_op, ENGINE *e) + char *passargin, int pkey_op, ENGINE *e, + int engine_impl) { EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *ctx = NULL; + ENGINE *impl = NULL; char *passin = NULL; int rv = -1; X509 *x; @@ -418,9 +425,14 @@ static EVP_PKEY_CTX *init_ctx(int *pkeys if (!pkey) goto end; - - ctx = EVP_PKEY_CTX_new(pkey, e); - + +#ifndef OPENSSL_NO_ENGINE + if (engine_impl) + impl = e; +#endif + + ctx = EVP_PKEY_CTX_new(pkey, impl); + EVP_PKEY_free(pkey); if (!ctx) @@ -467,16 +479,20 @@ static EVP_PKEY_CTX *init_ctx(int *pkeys } static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform, - const char *file) + const char *file, ENGINE* e) { EVP_PKEY *peer = NULL; + ENGINE* engine = NULL; int ret; if (!ctx) { BIO_puts(err, "-peerkey command before -inkey\n"); return 0; } - peer = load_pubkey(bio_err, file, peerform, 0, NULL, NULL, "Peer Key"); + if (peerform == FORMAT_ENGINE) + engine = e; + + peer = load_pubkey(bio_err, file, peerform, 0, NULL, engine, "Peer Key"); if (!peer) { BIO_printf(bio_err, "Error reading peer key %s\n", file); Modified: head/crypto/openssl/apps/s_client.c ============================================================================== --- head/crypto/openssl/apps/s_client.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/apps/s_client.c Thu Jan 28 20:15:22 2016 (r295009) @@ -308,7 +308,7 @@ static void sc_usage(void) " -connect host:port - who to connect to (default is %s:%s)\n", SSL_HOST_NAME, PORT_STR); BIO_printf(bio_err, - " -verify_host host - check peer certificate matches \"host\"\n"); + " -verify_hostname host - check peer certificate matches \"host\"\n"); BIO_printf(bio_err, " -verify_email email - check peer certificate matches \"email\"\n"); BIO_printf(bio_err, Modified: head/crypto/openssl/apps/s_server.c ============================================================================== --- head/crypto/openssl/apps/s_server.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/apps/s_server.c Thu Jan 28 20:15:22 2016 (r295009) @@ -498,7 +498,7 @@ static void sv_usage(void) BIO_printf(bio_err, " -accept arg - port to accept on (default is %d)\n", PORT); BIO_printf(bio_err, - " -verify_host host - check peer certificate matches \"host\"\n"); + " -verify_hostname host - check peer certificate matches \"host\"\n"); BIO_printf(bio_err, " -verify_email email - check peer certificate matches \"email\"\n"); BIO_printf(bio_err, Modified: head/crypto/openssl/apps/speed.c ============================================================================== --- head/crypto/openssl/apps/speed.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/apps/speed.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* apps/speed.c -*- mode:C; c-file-style: "eay" -*- */ +/* apps/speed.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * Modified: head/crypto/openssl/apps/x509.c ============================================================================== --- head/crypto/openssl/apps/x509.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/apps/x509.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1226,12 +1226,7 @@ static int sign(X509 *x, EVP_PKEY *pkey, if (X509_gmtime_adj(X509_get_notBefore(x), 0) == NULL) goto err; - /* Lets just make it 12:00am GMT, Jan 1 1970 */ - /* memcpy(x->cert_info->validity->notBefore,"700101120000Z",13); */ - /* 28 days to be certified */ - - if (X509_gmtime_adj(X509_get_notAfter(x), (long)60 * 60 * 24 * days) == - NULL) + if (X509_time_adj_ex(X509_get_notAfter(x), days, 0, NULL) == NULL) goto err; if (!X509_set_pubkey(x, pkey)) Modified: head/crypto/openssl/crypto/aes/aes.h ============================================================================== --- head/crypto/openssl/crypto/aes/aes.h Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes.h Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes.h */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_cbc.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_cbc.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_cbc.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_cbc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_cbc.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_cfb.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_cfb.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_cfb.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_cfb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_cfb.c */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_core.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_core.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_core.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_core.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_core.c */ /** * rijndael-alg-fst.c * Modified: head/crypto/openssl/crypto/aes/aes_ctr.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_ctr.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_ctr.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ctr.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ctr.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_ecb.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_ecb.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_ecb.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ecb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ecb.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_ige.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_ige.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_ige.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ige.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ige.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_locl.h ============================================================================== --- head/crypto/openssl/crypto/aes/aes_locl.h Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_locl.h Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes.h */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_misc.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_misc.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_misc.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_misc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_misc.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_ofb.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_ofb.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_ofb.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ofb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ofb.c */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/aes/aes_x86core.c ============================================================================== --- head/crypto/openssl/crypto/aes/aes_x86core.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/aes_x86core.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_core.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_core.c */ /** * rijndael-alg-fst.c * Modified: head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl Thu Jan 28 20:15:22 2016 (r295009) @@ -63,7 +63,7 @@ if (!$avx && $win64 && ($flavour =~ /mas $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Thu Jan 28 20:15:22 2016 (r295009) @@ -94,7 +94,7 @@ $avx=1 if (!$avx && $win64 && ($flavour $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && `ml64 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); -$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); +$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); $shaext=1; ### set to zero if compiling for 1.0.1 Modified: head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl Thu Jan 28 20:15:22 2016 (r295009) @@ -59,7 +59,7 @@ if (!$avx && $win64 && ($flavour =~ /mas $avx = ($1>=10) + ($1>=12); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/bio/bio.h ============================================================================== --- head/crypto/openssl/crypto/bio/bio.h Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bio/bio.h Thu Jan 28 20:15:22 2016 (r295009) @@ -479,11 +479,11 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) # define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) # define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) -# define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0) +# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,0,NULL) # define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) -/* BIO_s_accept_socket() */ +/* BIO_s_accept() */ # define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) # define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) /* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ @@ -496,6 +496,7 @@ struct bio_dgram_sctp_prinfo { # define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) # define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) +/* BIO_s_accept() and BIO_s_connect() */ # define BIO_do_connect(b) BIO_do_handshake(b) # define BIO_do_accept(b) BIO_do_handshake(b) # define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) @@ -515,12 +516,15 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) # define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) +/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */ # define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) # define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) +/* BIO_s_file() */ # define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) # define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) +/* BIO_s_fd() and BIO_s_file() */ # define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) # define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) Modified: head/crypto/openssl/crypto/bio/bss_bio.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_bio.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bio/bss_bio.c Thu Jan 28 20:15:22 2016 (r295009) @@ -1,4 +1,4 @@ -/* crypto/bio/bss_bio.c -*- Mode: C; c-file-style: "eay" -*- */ +/* crypto/bio/bss_bio.c */ /* ==================================================================== * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. * Modified: head/crypto/openssl/crypto/bio/bss_conn.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_conn.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bio/bss_conn.c Thu Jan 28 20:15:22 2016 (r295009) @@ -419,7 +419,7 @@ static long conn_ctrl(BIO *b, int cmd, l { BIO *dbio; int *ip; - const char **pptr; + const char **pptr = NULL; long ret = 1; BIO_CONNECT *data; @@ -442,19 +442,28 @@ static long conn_ctrl(BIO *b, int cmd, l case BIO_C_GET_CONNECT: if (ptr != NULL) { pptr = (const char **)ptr; - if (num == 0) { - *pptr = data->param_hostname; + } - } else if (num == 1) { - *pptr = data->param_port; - } else if (num == 2) { - *pptr = (char *)&(data->ip[0]); - } else if (num == 3) { - *((int *)ptr) = data->port; + if (b->init) { + if (pptr != NULL) { + ret = 1; + if (num == 0) { + *pptr = data->param_hostname; + } else if (num == 1) { + *pptr = data->param_port; + } else if (num == 2) { + *pptr = (char *)&(data->ip[0]); + } else { + ret = 0; + } + } + if (num == 3) { + ret = data->port; } - if ((!b->init) || (ptr == NULL)) + } else { + if (pptr != NULL) *pptr = "not initialized"; - ret = 1; + ret = 0; } break; case BIO_C_SET_CONNECT: Modified: head/crypto/openssl/crypto/bio/bss_dgram.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_dgram.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bio/bss_dgram.c Thu Jan 28 20:15:22 2016 (r295009) @@ -519,10 +519,8 @@ static long dgram_ctrl(BIO *b, int cmd, switch (cmd) { case BIO_CTRL_RESET: num = 0; - case BIO_C_FILE_SEEK: ret = 0; break; - case BIO_C_FILE_TELL: case BIO_CTRL_INFO: ret = 0; break; Modified: head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl Thu Jan 28 20:15:22 2016 (r295009) @@ -113,7 +113,7 @@ if (!$addx && $win64 && ($flavour =~ /ma $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $addx = ($ver>=3.03); } Modified: head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Thu Jan 28 20:15:22 2016 (r295009) @@ -68,7 +68,7 @@ if (!$addx && $win64 && ($flavour =~ /ma $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $addx = ($ver>=3.03); } Modified: head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Thu Jan 28 20:15:22 2016 (r295009) @@ -53,7 +53,7 @@ if (!$addx && $win64 && ($flavour =~ /ma $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $addx = ($ver>=3.03); } Modified: head/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_exp.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bn/bn_exp.c Thu Jan 28 20:15:22 2016 (r295009) @@ -282,9 +282,14 @@ int BN_mod_exp_recp(BIGNUM *r, const BIG } bits = BN_num_bits(p); - if (bits == 0) { - ret = BN_one(r); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(r); + } else { + ret = BN_one(r); + } return ret; } @@ -418,7 +423,13 @@ int BN_mod_exp_mont(BIGNUM *rr, const BI } bits = BN_num_bits(p); if (bits == 0) { - ret = BN_one(rr); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(rr); + } else { + ret = BN_one(rr); + } return ret; } @@ -639,7 +650,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBU * precomputation memory layout to limit data-dependency to a minimum to * protect secret exponents (cf. the hyper-threading timing attacks pointed * out by Colin Percival, - * http://www.daemong-consideredperthreading-considered-harmful/) + * http://www.daemonology.net/hyperthreading-considered-harmful/) */ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, @@ -671,7 +682,13 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr bits = BN_num_bits(p); if (bits == 0) { - ret = BN_one(rr); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(rr); + } else { + ret = BN_one(rr); + } return ret; } @@ -1182,8 +1199,9 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ if (BN_is_one(m)) { ret = 1; BN_zero(rr); - } else + } else { ret = BN_one(rr); + } return ret; } if (a == 0) { @@ -1297,9 +1315,14 @@ int BN_mod_exp_simple(BIGNUM *r, const B } bits = BN_num_bits(p); - - if (bits == 0) { - ret = BN_one(r); + if (bits == 0) { + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(r); + } else { + ret = BN_one(r); + } return ret; } Modified: head/crypto/openssl/crypto/bn/exptest.c ============================================================================== --- head/crypto/openssl/crypto/bn/exptest.c Thu Jan 28 19:21:01 2016 (r295008) +++ head/crypto/openssl/crypto/bn/exptest.c Thu Jan 28 20:15:22 2016 (r295009) @@ -73,14 +73,34 @@ static const char rnd_seed[] = "string to make the random number generator think it has entropy"; /* + * Test that r == 0 in test_exp_mod_zero(). Returns one on success, + * returns zero and prints debug output otherwise. + */ +static int a_is_zero_mod_one(const char *method, const BIGNUM *r, + const BIGNUM *a) { + if (!BN_is_zero(r)) { + fprintf(stderr, "%s failed:\n", method); + fprintf(stderr, "a ** 0 mod 1 = r (should be 0)\n"); + fprintf(stderr, "a = "); + BN_print_fp(stderr, a); + fprintf(stderr, "\nr = "); + BN_print_fp(stderr, r); + fprintf(stderr, "\n"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jan 28 20:24:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FDAAA3CE6B; Thu, 28 Jan 2016 20:24:17 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D078B1CF6; Thu, 28 Jan 2016 20:24:16 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SKOFwH004855; Thu, 28 Jan 2016 20:24:15 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SKOFlb004850; Thu, 28 Jan 2016 20:24:15 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201601282024.u0SKOFlb004850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 28 Jan 2016 20:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295012 - in head: sys/kern sys/sys tests/sys/kqueue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 20:24:17 -0000 Author: vangyzen Date: Thu Jan 28 20:24:15 2016 New Revision: 295012 URL: https://svnweb.freebsd.org/changeset/base/295012 Log: kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT NOTE_CHILD and NOTE_EXIT return something in kevent.data: the parent pid (ppid) for NOTE_CHILD and the exit status for NOTE_EXIT. Do not let the two events be combined, since one would overwrite the other's data. PR: 180385 Submitted by: David A. Bright Reviewed by: jhb MFC after: 1 month Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D4900 Modified: head/sys/kern/kern_event.c head/sys/sys/event.h head/tests/sys/kqueue/common.h head/tests/sys/kqueue/main.c head/tests/sys/kqueue/proc.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Jan 28 20:21:15 2016 (r295011) +++ head/sys/kern/kern_event.c Thu Jan 28 20:24:15 2016 (r295012) @@ -373,11 +373,21 @@ filt_procattach(struct knote *kn) kn->kn_flags |= EV_CLEAR; /* automatically set */ /* - * internal flag indicating registration done by kernel + * Internal flag indicating registration done by kernel for the + * purposes of getting a NOTE_CHILD notification. */ - if (kn->kn_flags & EV_FLAG1) { + if (kn->kn_flags & EV_FLAG2) { + kn->kn_flags &= ~EV_FLAG2; kn->kn_data = kn->kn_sdata; /* ppid */ kn->kn_fflags = NOTE_CHILD; + kn->kn_sfflags &= ~NOTE_EXIT; + immediate = 1; /* Force immediate activation of child note. */ + } + /* + * Internal flag indicating registration done by kernel (for other than + * NOTE_CHILD). + */ + if (kn->kn_flags & EV_FLAG1) { kn->kn_flags &= ~EV_FLAG1; } @@ -385,9 +395,10 @@ filt_procattach(struct knote *kn) knlist_add(&p->p_klist, kn, 1); /* - * Immediately activate any exit notes if the target process is a - * zombie. This is necessary to handle the case where the target - * process, e.g. a child, dies before the kevent is registered. + * Immediately activate any child notes or, in the case of a zombie + * target process, exit notes. The latter is necessary to handle the + * case where the target process, e.g. a child, dies before the kevent + * is registered. */ if (immediate && filt_proc(kn, NOTE_EXIT)) KNOTE_ACTIVATE(kn, 0); @@ -495,7 +506,7 @@ knote_fork(struct knlist *list, int pid) /* * The NOTE_TRACK case. In addition to the activation - * of the event, we need to register new event to + * of the event, we need to register new events to * track the child. Drop the locks in preparation for * the call to kqueue_register(). */ @@ -504,8 +515,27 @@ knote_fork(struct knlist *list, int pid) list->kl_unlock(list->kl_lockarg); /* - * Activate existing knote and register a knote with + * Activate existing knote and register tracking knotes with * new process. + * + * First register a knote to get just the child notice. This + * must be a separate note from a potential NOTE_EXIT + * notification since both NOTE_CHILD and NOTE_EXIT are defined + * to use the data field (in conflicting ways). + */ + kev.ident = pid; + kev.filter = kn->kn_filter; + kev.flags = kn->kn_flags | EV_ADD | EV_ENABLE | EV_ONESHOT | EV_FLAG2; + kev.fflags = kn->kn_sfflags; + kev.data = kn->kn_id; /* parent */ + kev.udata = kn->kn_kevent.udata;/* preserve udata */ + error = kqueue_register(kq, &kev, NULL, 0); + if (error) + kn->kn_fflags |= NOTE_TRACKERR; + + /* + * Then register another knote to track other potential events + * from the new process. */ kev.ident = pid; kev.filter = kn->kn_filter; @@ -1129,7 +1159,7 @@ findkn: if (fp->f_type == DTYPE_KQUEUE) { /* - * if we add some inteligence about what we are doing, + * If we add some intelligence about what we are doing, * we should be able to support events on ourselves. * We need to know when we are doing this to prevent * getting both the knlist lock and the kq lock since @@ -1161,7 +1191,18 @@ findkn: kqueue_expand(kq, fops, kev->ident, waitok); KQ_LOCK(kq); - if (kq->kq_knhashmask != 0) { + + /* + * If possible, find an existing knote to use for this kevent. + */ + if (kev->filter == EVFILT_PROC && + (kev->flags & (EV_FLAG1 | EV_FLAG2)) != 0) { + /* This is an internal creation of a process tracking + * note. Don't attempt to coalesce this with an + * existing note. + */ + ; + } else if (kq->kq_knhashmask != 0) { struct klist *list; list = &kq->kq_knhash[ @@ -1173,7 +1214,7 @@ findkn: } } - /* knote is in the process of changing, wait for it to stablize. */ + /* knote is in the process of changing, wait for it to stabilize. */ if (kn != NULL && (kn->kn_status & KN_INFLUX) == KN_INFLUX) { KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); if (filedesc_unlock) { Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Thu Jan 28 20:21:15 2016 (r295011) +++ head/sys/sys/event.h Thu Jan 28 20:24:15 2016 (r295012) @@ -80,6 +80,7 @@ struct kevent { #define EV_SYSFLAGS 0xF000 /* reserved by system */ #define EV_DROP 0x1000 /* note should be dropped */ #define EV_FLAG1 0x2000 /* filter-specific flag */ +#define EV_FLAG2 0x4000 /* filter-specific flag */ /* returned values */ #define EV_EOF 0x8000 /* EOF detected */ Modified: head/tests/sys/kqueue/common.h ============================================================================== --- head/tests/sys/kqueue/common.h Thu Jan 28 20:21:15 2016 (r295011) +++ head/tests/sys/kqueue/common.h Thu Jan 28 20:24:15 2016 (r295012) @@ -46,6 +46,7 @@ int vnode_fd; extern const char * kevent_to_str(struct kevent *); struct kevent * kevent_get(int); +struct kevent * kevent_get_timeout(int, int); void kevent_cmp(struct kevent *, struct kevent *); Modified: head/tests/sys/kqueue/main.c ============================================================================== --- head/tests/sys/kqueue/main.c Thu Jan 28 20:21:15 2016 (r295011) +++ head/tests/sys/kqueue/main.c Thu Jan 28 20:24:15 2016 (r295012) @@ -69,6 +69,28 @@ kevent_get(int kqfd) return (kev); } +/* Retrieve a single kevent, specifying a maximum time to wait for it. */ +struct kevent * +kevent_get_timeout(int kqfd, int seconds) +{ + int nfds; + struct kevent *kev; + struct timespec timeout = {seconds, 0}; + + if ((kev = calloc(1, sizeof(*kev))) == NULL) + err(1, "out of memory"); + + nfds = kevent(kqfd, NULL, 0, kev, 1, &timeout); + if (nfds < 0) { + err(1, "kevent(2)"); + } else if (nfds == 0) { + free(kev); + kev = NULL; + } + + return (kev); +} + char * kevent_fflags_dump(struct kevent *kev) { @@ -82,25 +104,39 @@ kevent_fflags_dump(struct kevent *kev) abort(); /* Not every filter has meaningful fflags */ - if (kev->filter != EVFILT_VNODE) { - snprintf(buf, 1024, "fflags = %d", kev->fflags); - return (buf); - } - - snprintf(buf, 1024, "fflags = %d (", kev->fflags); - KEVFFL_DUMP(NOTE_DELETE); - KEVFFL_DUMP(NOTE_WRITE); - KEVFFL_DUMP(NOTE_EXTEND); + if (kev->filter == EVFILT_PROC) { + snprintf(buf, 1024, "fflags = %x (", kev->fflags); + KEVFFL_DUMP(NOTE_EXIT); + KEVFFL_DUMP(NOTE_FORK); + KEVFFL_DUMP(NOTE_EXEC); + KEVFFL_DUMP(NOTE_CHILD); + KEVFFL_DUMP(NOTE_TRACKERR); + KEVFFL_DUMP(NOTE_TRACK); + buf[strlen(buf) - 1] = ')'; + } else if (kev->filter == EVFILT_PROCDESC) { + snprintf(buf, 1024, "fflags = %x (", kev->fflags); + KEVFFL_DUMP(NOTE_EXIT); + KEVFFL_DUMP(NOTE_FORK); + KEVFFL_DUMP(NOTE_EXEC); + buf[strlen(buf) - 1] = ')'; + } else if (kev->filter == EVFILT_VNODE) { + snprintf(buf, 1024, "fflags = %x (", kev->fflags); + KEVFFL_DUMP(NOTE_DELETE); + KEVFFL_DUMP(NOTE_WRITE); + KEVFFL_DUMP(NOTE_EXTEND); #if HAVE_NOTE_TRUNCATE - KEVFFL_DUMP(NOTE_TRUNCATE); + KEVFFL_DUMP(NOTE_TRUNCATE); #endif - KEVFFL_DUMP(NOTE_ATTRIB); - KEVFFL_DUMP(NOTE_LINK); - KEVFFL_DUMP(NOTE_RENAME); + KEVFFL_DUMP(NOTE_ATTRIB); + KEVFFL_DUMP(NOTE_LINK); + KEVFFL_DUMP(NOTE_RENAME); #if HAVE_NOTE_REVOKE - KEVFFL_DUMP(NOTE_REVOKE); + KEVFFL_DUMP(NOTE_REVOKE); #endif - buf[strlen(buf) - 1] = ')'; + buf[strlen(buf) - 1] = ')'; + } else { + snprintf(buf, 1024, "fflags = %x", kev->fflags); + } return (buf); } @@ -260,6 +296,15 @@ main(int argc, char **argv) argc--; } + /* + * Some tests fork. If output is fully buffered, + * the children inherit some buffered data and flush + * it when they exit, causing some data to be printed twice. + * Use line buffering to avoid this problem. + */ + setlinebuf(stdout); + setlinebuf(stderr); + test_kqueue(); test_kqueue_close(); Modified: head/tests/sys/kqueue/proc.c ============================================================================== --- head/tests/sys/kqueue/proc.c Thu Jan 28 20:21:15 2016 (r295011) +++ head/tests/sys/kqueue/proc.c Thu Jan 28 20:24:15 2016 (r295012) @@ -74,6 +74,172 @@ add_and_delete(void) } +static void +proc_track(int sleep_time) +{ + char test_id[64]; + struct kevent kev; + pid_t pid; + int pipe_fd[2]; + ssize_t result; + + snprintf(test_id, sizeof(test_id), + "kevent(EVFILT_PROC, NOTE_TRACK); sleep %d", sleep_time); + test_begin(test_id); + test_no_kevents(); + + if (pipe(pipe_fd)) { + err(1, "pipe (parent) failed! (%s() at %s:%d)", + __func__, __FILE__, __LINE__); + } + + /* Create a child to track. */ + pid = fork(); + if (pid == 0) { /* Child */ + pid_t grandchild = -1; + + /* + * Give the parent a chance to start tracking us. + */ + result = read(pipe_fd[1], test_id, 1); + if (result != 1) { + err(1, "read from pipe in child failed! (ret %zd) (%s() at %s:%d)", + result, __func__, __FILE__, __LINE__); + } + + /* + * Spawn a grandchild that will immediately exit. If the kernel has bug + * 180385, the parent will see a kevent with both NOTE_CHILD and + * NOTE_EXIT. If that bug is fixed, it will see two separate kevents + * for those notes. Note that this triggers the conditions for + * detecting the bug quite reliably on a 1 CPU system (or if the test + * process is restricted to a single CPU), but may not trigger it on a + * multi-CPU system. + */ + grandchild = fork(); + if (grandchild == 0) { /* Grandchild */ + if (sleep_time) sleep(sleep_time); + exit(1); + } else if (grandchild == -1) { /* Error */ + err(1, "fork (grandchild) failed! (%s() at %s:%d)", + __func__, __FILE__, __LINE__); + } else { /* Child (Grandchild Parent) */ + printf(" -- grandchild created (pid %d)\n", (int) grandchild); + } + if (sleep_time) sleep(sleep_time); + exit(0); + } else if (pid == -1) { /* Error */ + err(1, "fork (child) failed! (%s() at %s:%d)", + __func__, __FILE__, __LINE__); + } + + printf(" -- child created (pid %d)\n", (int) pid); + + kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_ADD | EV_ENABLE, + NOTE_TRACK | NOTE_EXEC | NOTE_EXIT | NOTE_FORK, + 0, NULL); + + printf(" -- tracking child (pid %d)\n", (int) pid); + + /* Now that we're tracking the child, tell it to proceed. */ + result = write(pipe_fd[0], test_id, 1); + if (result != 1) { + err(1, "write to pipe in parent failed! (ret %zd) (%s() at %s:%d)", + result, __func__, __FILE__, __LINE__); + } + + /* + * Several events should be received: + * - NOTE_FORK (from child) + * - NOTE_CHILD (from grandchild) + * - NOTE_EXIT (from grandchild) + * - NOTE_EXIT (from child) + * + * The NOTE_FORK and NOTE_EXIT from the child could be combined into a + * single event, but the NOTE_CHILD and NOTE_EXIT from the grandchild must + * not be combined. + * + * The loop continues until no events are received within a 5 second + * period, at which point it is assumed that no more will be coming. The + * loop is deliberately designed to attempt to get events even after all + * the expected ones are received in case some spurious events are + * generated as well as the expected ones. + */ + { + int child_exit = 0; + int child_fork = 0; + int gchild_exit = 0; + int gchild_note = 0; + pid_t gchild_pid = -1; + int done = 0; + + while (!done) + { + int handled = 0; + struct kevent *kevp; + + kevp = kevent_get_timeout(kqfd, 5); + if (kevp == NULL) { + done = 1; + } else { + printf(" -- Received kevent: %s\n", kevent_to_str(kevp)); + + if ((kevp->fflags & NOTE_CHILD) && (kevp->fflags & NOTE_EXIT)) { + errx(1, "NOTE_CHILD and NOTE_EXIT in same kevent: %s", kevent_to_str(kevp)); + } + + if (kevp->fflags & NOTE_CHILD) { + if (kevp->data == pid) { + if (!gchild_note) { + ++gchild_note; + gchild_pid = kevp->ident; + ++handled; + } else { + errx(1, "Spurious NOTE_CHILD: %s", kevent_to_str(kevp)); + } + } + } + + if (kevp->fflags & NOTE_EXIT) { + if ((kevp->ident == pid) && (!child_exit)) { + ++child_exit; + ++handled; + } else if ((kevp->ident == gchild_pid) && (!gchild_exit)) { + ++gchild_exit; + ++handled; + } else { + errx(1, "Spurious NOTE_EXIT: %s", kevent_to_str(kevp)); + } + } + + if (kevp->fflags & NOTE_FORK) { + if ((kevp->ident == pid) && (!child_fork)) { + ++child_fork; + ++handled; + } else { + errx(1, "Spurious NOTE_FORK: %s", kevent_to_str(kevp)); + } + } + + if (!handled) { + errx(1, "Spurious kevent: %s", kevent_to_str(kevp)); + } + + free(kevp); + } + } + + /* Make sure all expected events were received. */ + if (child_exit && child_fork && gchild_exit && gchild_note) { + printf(" -- Received all expected events.\n"); + } else { + errx(1, "Did not receive all expected events."); + } + } + + success(); +} + #ifdef TODO static void event_trigger(void) @@ -236,6 +402,8 @@ test_evfilt_proc() signal(SIGUSR1, sig_handler); add_and_delete(); + proc_track(0); /* Run without sleeping before children exit. */ + proc_track(1); /* Sleep a bit in the children before exiting. */ #if TODO event_trigger(); From owner-svn-src-head@freebsd.org Thu Jan 28 21:45:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B399FA6E4FF; Thu, 28 Jan 2016 21:45:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 90938D50; Thu, 28 Jan 2016 21:45:26 +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 u0SLjPsE028983; Thu, 28 Jan 2016 21:45:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SLjPk5028981; Thu, 28 Jan 2016 21:45:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601282145.u0SLjPk5028981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 28 Jan 2016 21:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295017 - in head/sys: dev/filemon modules/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 21:45:26 -0000 Author: bdrewery Date: Thu Jan 28 21:45:25 2016 New Revision: 295017 URL: https://svnweb.freebsd.org/changeset/base/295017 Log: filemon: Use process_exec EVENTHANDLER to capture sys_execve. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c head/sys/modules/filemon/Makefile Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 21:42:10 2016 (r295016) +++ head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 21:45:25 2016 (r295017) @@ -29,8 +29,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include "opt_compat.h" @@ -44,7 +46,6 @@ __FBSDID("$FreeBSD$"); (2011-09-10) so this code is broken for 9-CURRENT September 10th-16th. */ #define sys_chdir chdir -#define sys_execve execve #define sys_link link #define sys_open open #define sys_rename rename @@ -56,6 +57,7 @@ __FBSDID("$FreeBSD$"); #endif #endif /* __FreeBSD_version */ +static eventhandler_tag filemon_exec_tag; static eventhandler_tag filemon_exit_tag; static eventhandler_tag filemon_fork_tag; @@ -137,62 +139,33 @@ filemon_wrapper_chdir(struct thread *td, return (ret); } -static int -filemon_wrapper_execve(struct thread *td, struct execve_args *uap) +static void +filemon_event_process_exec(void *arg __unused, struct proc *p, + struct image_params *imgp) { - char fname[MAXPATHLEN]; - int ret; - size_t done; - size_t len; struct filemon *filemon; + char *fullpath, *freepath; + size_t len; - copyinstr(uap->fname, fname, sizeof(fname), &done); - - if ((ret = sys_execve(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "E %d %s\n", - curproc->p_pid, fname); - - filemon_output(filemon, filemon->msgbufr, len); - - /* Unlock the found filemon structure. */ - filemon_filemon_unlock(filemon); - } - } - - return (ret); -} + if ((filemon = filemon_pid_check(p)) != NULL) { + fullpath = ""; + freepath = NULL; -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) -static int -filemon_wrapper_freebsd32_execve(struct thread *td, - struct freebsd32_execve_args *uap) -{ - char fname[MAXPATHLEN]; - int ret; - size_t done; - size_t len; - struct filemon *filemon; + vn_fullpath(FIRST_THREAD_IN_PROC(p), imgp->vp, &fullpath, + &freepath); - copyinstr(uap->fname, fname, sizeof(fname), &done); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "E %d %s\n", + p->p_pid, fullpath); - if ((ret = freebsd32_execve(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "E %d %s\n", - curproc->p_pid, fname); + filemon_output(filemon, filemon->msgbufr, len); - filemon_output(filemon, filemon->msgbufr, len); + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); - /* Unlock the found filemon structure. */ - filemon_filemon_unlock(filemon); - } + free(freepath, M_TEMP); } - - return (ret); } -#endif static int filemon_wrapper_open(struct thread *td, struct open_args *uap) @@ -550,7 +523,6 @@ filemon_wrapper_install(void) #endif sv_table[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; - sv_table[SYS_execve].sy_call = (sy_call_t *) filemon_wrapper_execve; sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; @@ -566,7 +538,6 @@ filemon_wrapper_install(void) sv_table = ia32_freebsd_sysvec.sv_table; sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; - sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_execve; sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; @@ -579,6 +550,8 @@ filemon_wrapper_install(void) #endif #endif /* COMPAT_ARCH32 */ + filemon_exec_tag = EVENTHANDLER_REGISTER(process_exec, + filemon_event_process_exec, NULL, EVENTHANDLER_PRI_LAST); filemon_exit_tag = EVENTHANDLER_REGISTER(process_exit, filemon_event_process_exit, NULL, EVENTHANDLER_PRI_LAST); filemon_fork_tag = EVENTHANDLER_REGISTER(process_fork, @@ -595,7 +568,6 @@ filemon_wrapper_deinstall(void) #endif sv_table[SYS_chdir].sy_call = (sy_call_t *)sys_chdir; - sv_table[SYS_execve].sy_call = (sy_call_t *)sys_execve; sv_table[SYS_open].sy_call = (sy_call_t *)sys_open; sv_table[SYS_openat].sy_call = (sy_call_t *)sys_openat; sv_table[SYS_rename].sy_call = (sy_call_t *)sys_rename; @@ -611,7 +583,6 @@ filemon_wrapper_deinstall(void) sv_table = ia32_freebsd_sysvec.sv_table; sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *)sys_chdir; - sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *)freebsd32_execve; sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *)sys_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *)sys_rename; @@ -624,6 +595,7 @@ filemon_wrapper_deinstall(void) #endif #endif /* COMPAT_ARCH32 */ + EVENTHANDLER_DEREGISTER(process_exec, filemon_exec_tag); EVENTHANDLER_DEREGISTER(process_exit, filemon_exit_tag); EVENTHANDLER_DEREGISTER(process_fork, filemon_fork_tag); } Modified: head/sys/modules/filemon/Makefile ============================================================================== --- head/sys/modules/filemon/Makefile Thu Jan 28 21:42:10 2016 (r295016) +++ head/sys/modules/filemon/Makefile Thu Jan 28 21:45:25 2016 (r295017) @@ -4,6 +4,6 @@ KMOD= filemon SRCS= ${KMOD}.c -SRCS+= opt_compat.h +SRCS+= opt_compat.h vnode_if.h .include From owner-svn-src-head@freebsd.org Thu Jan 28 22:24:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A84EA70D38 for ; Thu, 28 Jan 2016 22:24:27 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::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 14F6BA81 for ; Thu, 28 Jan 2016 22:24:27 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x236.google.com with SMTP id l66so30940679wml.0 for ; Thu, 28 Jan 2016 14:24:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gS/QTpnEgSs+3Jk2xS9m5T3AAu9tVXAUuBVz2GWHOyc=; b=SkgmcXVkfIfzF9Dg6XwDcQlia4nObx9GJadRkjOpsqIkXRgf+eRiNLfrRBCedWf8zZ UTTtztxS73PwcRogArhpCKMmyZVBX+Wz1LzYFbUuNMnyUMdnPNpMv6ysgukEgaWsnPrc LYtPV3UjnVXmSmBOWo0biPZO/sDRg6NEXNlDc0mUc3Ud62DOUEn5yo/e2Miw7zWQsHuk ejyjbccqQVbugP1nBCfMgUBgbpH7sQq/aCdr+pPo1OheFwicMu0gcbPrWviysQuY1MZ7 Pl6MF+UGM3sWyusWlu/MH2qv+Y4oGgcClpfbqJ38Y+rc625NMuwSNHKjSIWGBd1JRIvM 24HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=gS/QTpnEgSs+3Jk2xS9m5T3AAu9tVXAUuBVz2GWHOyc=; b=XEfs9G4M+6wkHIk/1KOda0qhAl1vXR+OYoB4nXch/Qlo1/FJmUO05ggUzhAONc9r5a SPn/MrbA13/6ROLGnVg+FA6WR+Rkl+I9ikLTf0CdV54iGma0eDViX5ClTdqcUSQkpQbd F2Aed8n6f0/xk6cOHrkTg0BRzRthFRhuE8bSDuc5tOYgiCmyJm4cDO3InLYzAG0Z0hLw 1AhLYEBuu1nAkAR0OAQR88JNVtx9rWXmcZ6nJifmd1HhXG7pchoMJlBgreYAjsLaNgTU W3ZS+sGbFU7mhpdhsyd6uUdk6sWgjC9qdPOhzFhwnxnaAYWUCVbBbTxEBRWzsnt8+2/b R3mQ== X-Gm-Message-State: AG10YORtHOsMMEetIo88aoVhPpy7+kUPN74gVlgUEV4Pkw3HZ7WCDj6DbkNXyIxqYPZ9QyqZ8nWTzm2ou5skIfPO MIME-Version: 1.0 X-Received: by 10.28.184.78 with SMTP id i75mr5718202wmf.22.1454019865372; Thu, 28 Jan 2016 14:24:25 -0800 (PST) Received: by 10.194.82.6 with HTTP; Thu, 28 Jan 2016 14:24:25 -0800 (PST) In-Reply-To: <201601281605.u0SG5kYU027051@repo.freebsd.org> References: <201601281605.u0SG5kYU027051@repo.freebsd.org> Date: Thu, 28 Jan 2016 23:24:25 +0100 Message-ID: Subject: Re: svn commit: r294995 - head/sys/netinet From: Oliver Pinter To: Michael Tuexen Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 22:24:27 -0000 On Thu, Jan 28, 2016 at 5:05 PM, Michael Tuexen wrote: > Author: tuexen > Date: Thu Jan 28 16:05:46 2016 > New Revision: 294995 > URL: https://svnweb.freebsd.org/changeset/base/294995 > > Log: > Always look in the TCP pool. > This fixes issues with a restarting peer when the listening > 1-to-1 style socket is closed. > > MFC after: 3 days > > Modified: > head/sys/netinet/sctp_input.c > head/sys/netinet/sctp_pcb.c > > Modified: head/sys/netinet/sctp_input.c > ============================================================================== > --- head/sys/netinet/sctp_input.c Thu Jan 28 15:44:14 2016 (r294994) > +++ head/sys/netinet/sctp_input.c Thu Jan 28 16:05:46 2016 (r294995) > @@ -5688,6 +5688,7 @@ sctp_common_input_processing(struct mbuf > if (net->port == 0) { > sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); > } > +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); Are these debug printf intended? > net->port = port; > } > #endif > @@ -5719,6 +5720,7 @@ sctp_common_input_processing(struct mbuf > if (net->port == 0) { > sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); > } > +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); > net->port = port; > } > #endif > @@ -5831,6 +5833,7 @@ sctp_common_input_processing(struct mbuf > if (net->port == 0) { > sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); > } > +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); > net->port = port; > } > #endif > > Modified: head/sys/netinet/sctp_pcb.c > ============================================================================== > --- head/sys/netinet/sctp_pcb.c Thu Jan 28 15:44:14 2016 (r294994) > +++ head/sys/netinet/sctp_pcb.c Thu Jan 28 16:05:46 2016 (r294995) > @@ -2256,7 +2256,6 @@ sctp_findassociation_addr(struct mbuf *m > struct sctphdr *sh, struct sctp_chunkhdr *ch, > struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) > { > - int find_tcp_pool; > struct sctp_tcb *stcb; > struct sctp_inpcb *inp; > > @@ -2268,25 +2267,13 @@ sctp_findassociation_addr(struct mbuf *m > return (stcb); > } > } > - find_tcp_pool = 0; > - /* > - * Don't consider INIT chunks since that breaks 1-to-1 sockets: When > - * a server closes the listener, incoming INIT chunks are not > - * responsed by an INIT-ACK chunk. > - */ > - if ((ch->chunk_type != SCTP_INITIATION_ACK) && > - (ch->chunk_type != SCTP_COOKIE_ACK) && > - (ch->chunk_type != SCTP_COOKIE_ECHO)) { > - /* Other chunk types go to the tcp pool. */ > - find_tcp_pool = 1; > - } > if (inp_p) { > stcb = sctp_findassociation_addr_sa(src, dst, inp_p, netp, > - find_tcp_pool, vrf_id); > + 1, vrf_id); > inp = *inp_p; > } else { > stcb = sctp_findassociation_addr_sa(src, dst, &inp, netp, > - find_tcp_pool, vrf_id); > + 1, vrf_id); > } > SCTPDBG(SCTP_DEBUG_PCB1, "stcb:%p inp:%p\n", (void *)stcb, (void *)inp); > if (stcb == NULL && inp) { > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Thu Jan 28 23:12:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D899D94CE; Thu, 28 Jan 2016 23:12:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 95AD0C57; Thu, 28 Jan 2016 23:12:13 +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 u0SNCC9I056910; Thu, 28 Jan 2016 23:12:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SNCCZJ056909; Thu, 28 Jan 2016 23:12:12 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601282312.u0SNCCZJ056909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 28 Jan 2016 23:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295021 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 23:12:13 -0000 Author: tuexen Date: Thu Jan 28 23:12:12 2016 New Revision: 295021 URL: https://svnweb.freebsd.org/changeset/base/295021 Log: Remove debug output which was committed by accident. Thanks to Oliver Pinter for reporting. MFC after: 3 days X-MFC with: r294995 Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Jan 28 22:57:09 2016 (r295020) +++ head/sys/netinet/sctp_input.c Thu Jan 28 23:12:12 2016 (r295021) @@ -5688,7 +5688,6 @@ sctp_common_input_processing(struct mbuf if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } -printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif @@ -5720,7 +5719,6 @@ printf("Changing remote encaps port from if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } -printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif @@ -5833,7 +5831,6 @@ printf("Changing remote encaps port from if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } -printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif From owner-svn-src-head@freebsd.org Thu Jan 28 23:13:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A086A9D9538; Thu, 28 Jan 2016 23:13:13 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54395DE9; Thu, 28 Jan 2016 23:13:13 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.200] (p4FE315DD.dip0.t-ipconnect.de [79.227.21.221]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 5B8971C0B462F; Fri, 29 Jan 2016 00:13:09 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r294995 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Fri, 29 Jan 2016 00:13:08 +0100 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7FF45A03-6FC8-4FFF-94E5-BC6212F5EF02@freebsd.org> References: <201601281605.u0SG5kYU027051@repo.freebsd.org> To: Oliver Pinter X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 23:13:13 -0000 > On 28 Jan 2016, at 23:24, Oliver Pinter = wrote: >=20 > On Thu, Jan 28, 2016 at 5:05 PM, Michael Tuexen = wrote: >> Author: tuexen >> Date: Thu Jan 28 16:05:46 2016 >> New Revision: 294995 >> URL: https://svnweb.freebsd.org/changeset/base/294995 >>=20 >> Log: >> Always look in the TCP pool. >> This fixes issues with a restarting peer when the listening >> 1-to-1 style socket is closed. >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/sys/netinet/sctp_input.c >> head/sys/netinet/sctp_pcb.c >>=20 >> Modified: head/sys/netinet/sctp_input.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_input.c Thu Jan 28 15:44:14 2016 = (r294994) >> +++ head/sys/netinet/sctp_input.c Thu Jan 28 16:05:46 2016 = (r294995) >> @@ -5688,6 +5688,7 @@ sctp_common_input_processing(struct mbuf >> if (net->port =3D=3D 0) { >> sctp_pathmtu_adjustment(stcb, = net->mtu - sizeof(struct udphdr)); >> } >> +printf("Changing remote encaps port from %u to %u.\n", = ntohs(net->port), ntohs(port)); >=20 > Are these debug printf intended? No. Fixed in https://svnweb.freebsd.org/changeset/base/295021 Thanks for reporting! Best regards Michael >=20 >> net->port =3D port; >> } >> #endif >> @@ -5719,6 +5720,7 @@ sctp_common_input_processing(struct mbuf >> if (net->port =3D=3D 0) { >> sctp_pathmtu_adjustment(stcb, net->mtu - = sizeof(struct udphdr)); >> } >> +printf("Changing remote encaps port from %u to %u.\n", = ntohs(net->port), ntohs(port)); >> net->port =3D port; >> } >> #endif >> @@ -5831,6 +5833,7 @@ sctp_common_input_processing(struct mbuf >> if (net->port =3D=3D 0) { >> sctp_pathmtu_adjustment(stcb, = net->mtu - sizeof(struct udphdr)); >> } >> +printf("Changing remote encaps port from %u to %u.\n", = ntohs(net->port), ntohs(port)); >> net->port =3D port; >> } >> #endif >>=20 >> Modified: head/sys/netinet/sctp_pcb.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_pcb.c Thu Jan 28 15:44:14 2016 = (r294994) >> +++ head/sys/netinet/sctp_pcb.c Thu Jan 28 16:05:46 2016 = (r294995) >> @@ -2256,7 +2256,6 @@ sctp_findassociation_addr(struct mbuf *m >> struct sctphdr *sh, struct sctp_chunkhdr *ch, >> struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t = vrf_id) >> { >> - int find_tcp_pool; >> struct sctp_tcb *stcb; >> struct sctp_inpcb *inp; >>=20 >> @@ -2268,25 +2267,13 @@ sctp_findassociation_addr(struct mbuf *m >> return (stcb); >> } >> } >> - find_tcp_pool =3D 0; >> - /* >> - * Don't consider INIT chunks since that breaks 1-to-1 = sockets: When >> - * a server closes the listener, incoming INIT chunks are not >> - * responsed by an INIT-ACK chunk. >> - */ >> - if ((ch->chunk_type !=3D SCTP_INITIATION_ACK) && >> - (ch->chunk_type !=3D SCTP_COOKIE_ACK) && >> - (ch->chunk_type !=3D SCTP_COOKIE_ECHO)) { >> - /* Other chunk types go to the tcp pool. */ >> - find_tcp_pool =3D 1; >> - } >> if (inp_p) { >> stcb =3D sctp_findassociation_addr_sa(src, dst, inp_p, = netp, >> - find_tcp_pool, vrf_id); >> + 1, vrf_id); >> inp =3D *inp_p; >> } else { >> stcb =3D sctp_findassociation_addr_sa(src, dst, &inp, = netp, >> - find_tcp_pool, vrf_id); >> + 1, vrf_id); >> } >> SCTPDBG(SCTP_DEBUG_PCB1, "stcb:%p inp:%p\n", (void *)stcb, = (void *)inp); >> if (stcb =3D=3D NULL && inp) { >> _______________________________________________ >> 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" >=20 From owner-svn-src-head@freebsd.org Thu Jan 28 23:15:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E91E9D95D0; Thu, 28 Jan 2016 23:15:16 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5600BF84; Thu, 28 Jan 2016 23:15:16 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SNFFkm057141; Thu, 28 Jan 2016 23:15:15 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SNFFuX057139; Thu, 28 Jan 2016 23:15:15 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601282315.u0SNFFuX057139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 28 Jan 2016 23:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295022 - in head: share/man/man4 sys/dev/nvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 23:15:16 -0000 Author: jimharris Date: Thu Jan 28 23:15:14 2016 New Revision: 295022 URL: https://svnweb.freebsd.org/changeset/base/295022 Log: nvd: add hw.nvd.delete_max tunable The NVMe specification does not define a maximum or optimal delete size, so technically max delete size is min(full size of namespace, 2^32 - 1 LBAs). A single delete operation for a multi-TB NVMe namespace though may take much longer to complete than the nvme(4) I/O timeout period. So choose a sensible default here that is still suitably large to minimize the number of overall delete operations. This also fixes possible uint32_t overflow on initial TRIM operation for zpool create operations for NVMe namespaces with >4G LBAs. MFC after: 3 days Sponsored by: Intel Modified: head/share/man/man4/nvd.4 head/sys/dev/nvd/nvd.c Modified: head/share/man/man4/nvd.4 ============================================================================== --- head/share/man/man4/nvd.4 Thu Jan 28 23:12:12 2016 (r295021) +++ head/share/man/man4/nvd.4 Thu Jan 28 23:15:14 2016 (r295022) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2012-2014 Intel Corporation +.\" Copyright (c) 2012-2016 Intel Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2014 +.Dd January 28, 2016 .Dt NVD 4 .Os .Sh NAME @@ -74,6 +74,15 @@ Note that device nodes from the driver are not .Xr GEOM 4 disks and cannot be partitioned. +.Sh CONFIGURATION +The +.Nm +driver defines a system-wide maximum delete size for NVMe devices. The +default is 1GB. To select a different value, set the following tunable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.nvd.delete_max= +.Ed .Sh SEE ALSO .Xr GEOM 4 , .Xr nvme 4 , Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Jan 28 23:12:12 2016 (r295021) +++ head/sys/dev/nvd/nvd.c Thu Jan 28 23:15:14 2016 (r295022) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2016 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -88,6 +89,19 @@ struct nvd_controller { static TAILQ_HEAD(, nvd_controller) ctrlr_head; static TAILQ_HEAD(disk_list, nvd_disk) disk_head; +static SYSCTL_NODE(_hw, OID_AUTO, nvd, CTLFLAG_RD, 0, "nvd driver parameters"); +/* + * The NVMe specification does not define a maximum or optimal delete size, so + * technically max delete size is min(full size of the namespace, 2^32 - 1 + * LBAs). A single delete for a multi-TB NVMe namespace though may take much + * longer to complete than the nvme(4) I/O timeout period. So choose a sensible + * default here that is still suitably large to minimize the number of overall + * delete operations. + */ +static uint64_t nvd_delete_max = (1024 * 1024 * 1024); /* 1GB */ +SYSCTL_UQUAD(_hw_nvd, OID_AUTO, delete_max, CTLFLAG_RDTUN, &nvd_delete_max, 0, + "nvd maximum BIO_DELETE size in bytes"); + static int nvd_modevent(module_t mod, int type, void *arg) { int error = 0; @@ -295,6 +309,8 @@ nvd_new_disk(struct nvme_namespace *ns, disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); + if (disk->d_delmaxsize > nvd_delete_max) + disk->d_delmaxsize = nvd_delete_max; disk->d_stripesize = nvme_ns_get_optimal_sector_size(ns); if (TAILQ_EMPTY(&disk_head)) From owner-svn-src-head@freebsd.org Fri Jan 29 00:44:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9524A712D2; Fri, 29 Jan 2016 00:44:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id BC6AA1DFF; Fri, 29 Jan 2016 00:44:29 +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 u0T0iSTk084576; Fri, 29 Jan 2016 00:44:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0T0iSiH084575; Fri, 29 Jan 2016 00:44:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601290044.u0T0iSiH084575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 29 Jan 2016 00:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295026 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 00:44:30 -0000 Author: bdrewery Date: Fri Jan 29 00:44:28 2016 New Revision: 295026 URL: https://svnweb.freebsd.org/changeset/base/295026 Log: filemon_open: Don't record a process to trace here. Only ioctl(FILEMON_SET_PID) should be setting the process-to-be-traced. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Fri Jan 29 00:29:32 2016 (r295025) +++ head/sys/dev/filemon/filemon.c Fri Jan 29 00:44:28 2016 (r295026) @@ -221,10 +221,9 @@ filemon_open(struct cdev *dev, int oflag filemon = malloc(sizeof(struct filemon), M_FILEMON, M_WAITOK | M_ZERO); sx_init(&filemon->lock, "filemon"); + filemon->pid = -1; } - filemon->pid = curproc->p_pid; - devfs_set_cdevpriv(filemon, filemon_dtr); /* Get exclusive write access. */ From owner-svn-src-head@freebsd.org Fri Jan 29 00:44:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C73FDA712F4; Fri, 29 Jan 2016 00:44:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8980B1E2E; Fri, 29 Jan 2016 00:44:33 +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 u0T0iW0l084624; Fri, 29 Jan 2016 00:44:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0T0iWqC084622; Fri, 29 Jan 2016 00:44:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601290044.u0T0iWqC084622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 29 Jan 2016 00:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295027 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 00:44:34 -0000 Author: bdrewery Date: Fri Jan 29 00:44:32 2016 New Revision: 295027 URL: https://svnweb.freebsd.org/changeset/base/295027 Log: filemon: Track the process pointer rather than a pid. The process is not held since the process_exit hook is called after the exithold. There is no need to hold the process since the hook will always see it exiting via the process_exit event. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Fri Jan 29 00:44:28 2016 (r295026) +++ head/sys/dev/filemon/filemon.c Fri Jan 29 00:44:32 2016 (r295027) @@ -89,7 +89,7 @@ struct filemon { TAILQ_ENTRY(filemon) link; /* Link into the in-use list. */ struct sx lock; /* Lock mutex for this filemon. */ struct file *fp; /* Output file pointer. */ - pid_t pid; /* The process ID being monitored. */ + struct proc *p; /* The process being monitored. */ char fname1[MAXPATHLEN]; /* Temporary filename buffer. */ char fname2[MAXPATHLEN]; /* Temporary filename buffer. */ char msgbufr[1024]; /* Output message buffer. */ @@ -137,7 +137,7 @@ filemon_dtr(void *data) fp = filemon->fp; filemon->fp = NULL; - filemon->pid = -1; + filemon->p = NULL; /* Add to the free list. */ TAILQ_INSERT_TAIL(&filemons_free, filemon, link); @@ -188,7 +188,7 @@ filemon_ioctl(struct cdev *dev, u_long c error = pget(*((pid_t *)data), PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error == 0) { - filemon->pid = p->p_pid; + filemon->p = p; PROC_UNLOCK(p); } break; @@ -221,7 +221,6 @@ filemon_open(struct cdev *dev, int oflag filemon = malloc(sizeof(struct filemon), M_FILEMON, M_WAITOK | M_ZERO); sx_init(&filemon->lock, "filemon"); - filemon->pid = -1; } devfs_set_cdevpriv(filemon, filemon_dtr); Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Fri Jan 29 00:44:28 2016 (r295026) +++ head/sys/dev/filemon/filemon_wrapper.c Fri Jan 29 00:44:32 2016 (r295027) @@ -98,7 +98,7 @@ filemon_pid_check(struct proc *p) sx_slock(&proctree_lock); while (p != initproc) { TAILQ_FOREACH(filemon, &filemons_inuse, link) { - if (p->p_pid == filemon->pid) { + if (p == filemon->p) { sx_sunlock(&proctree_lock); filemon_filemon_lock(filemon); filemon_unlock_read(); @@ -452,14 +452,14 @@ filemon_event_process_exit(void *arg __u filemon_output(filemon, filemon->msgbufr, len); /* Check if the monitored process is about to exit. */ - if (filemon->pid == p->p_pid) { + if (filemon->p == p) { len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "# Stop %ju.%06ju\n# Bye bye\n", (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); filemon_output(filemon, filemon->msgbufr, len); - filemon->pid = -1; + filemon->p = NULL; } /* Unlock the found filemon structure. */ From owner-svn-src-head@freebsd.org Fri Jan 29 00:59:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47771A71816; Fri, 29 Jan 2016 00:59:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1866F1439; Fri, 29 Jan 2016 00:59:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0T0xn0B087587; Fri, 29 Jan 2016 00:59:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0T0xn8W087586; Fri, 29 Jan 2016 00:59:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601290059.u0T0xn8W087586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 29 Jan 2016 00:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295028 - head/lib/libbluetooth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 00:59:50 -0000 Author: brooks Date: Fri Jan 29 00:59:48 2016 New Revision: 295028 URL: https://svnweb.freebsd.org/changeset/base/295028 Log: Declare bt_devenum() to match the definition. Obtained from: CheriBSD (1c1dad87ef9983a4ca0c7d6eb0792d489436bcd1) MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/lib/libbluetooth/bluetooth.h Modified: head/lib/libbluetooth/bluetooth.h ============================================================================== --- head/lib/libbluetooth/bluetooth.h Fri Jan 29 00:44:32 2016 (r295027) +++ head/lib/libbluetooth/bluetooth.h Fri Jan 29 00:59:48 2016 (r295028) @@ -178,7 +178,7 @@ int bt_devfilter_evt_tst(struct bt_devf int bt_devinquiry(char const *devname, time_t length, int num_rsp, struct bt_devinquiry **ii); int bt_devinfo (struct bt_devinfo *di); -int bt_devenum (bt_devenum_cb_t *cb, void *arg); +int bt_devenum (bt_devenum_cb_t cb, void *arg); /* * bdaddr utility functions (from NetBSD) From owner-svn-src-head@freebsd.org Fri Jan 29 01:00:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FE2A71878; Fri, 29 Jan 2016 01:00:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id DA5AD161E; Fri, 29 Jan 2016 01:00:13 +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 u0T10C3B087677; Fri, 29 Jan 2016 01:00:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0T10CeP087676; Fri, 29 Jan 2016 01:00:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601290100.u0T10CeP087676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 29 Jan 2016 01:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295029 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 01:00:14 -0000 Author: bdrewery Date: Fri Jan 29 01:00:12 2016 New Revision: 295029 URL: https://svnweb.freebsd.org/changeset/base/295029 Log: Document the purpose and non-purpose of filemon(4). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Fri Jan 29 00:59:48 2016 (r295028) +++ head/share/man/man4/filemon.4 Fri Jan 29 01:00:12 2016 (r295029) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2013 +.Dd January 28, 2016 .Dt FILEMON 4 .Os .Sh NAME @@ -49,6 +49,18 @@ responds to two .Xr ioctl 2 calls. .Pp +.Nm +is not intended to be a security auditing tool. +Many syscalls are not tracked and binaries of foreign ABI will not be fully +audited. +It is intended for auditing of processes for the purpose of determining its +dependencies in an efficient and easily parsable format. +An example of this is +.Xr make 1 +which uses this module with +.Sy .MAKE.MODE=meta +to handle incremental builds more smartly. +.Pp System calls are denoted using the following single letters: .Pp .Bl -tag -width indent -compact @@ -173,3 +185,7 @@ A .Nm device appeared in .Fx 9.1 . +.Sh BUGS +Loading +.Nm +may reduce system performance for the noted syscalls. From owner-svn-src-head@freebsd.org Fri Jan 29 01:09:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92AFEA71B93; Fri, 29 Jan 2016 01:09: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 mx1.freebsd.org (Postfix) with ESMTPS id 5FA901B58; Fri, 29 Jan 2016 01:09: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 u0T194cr090540; Fri, 29 Jan 2016 01:09:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0T194n0090539; Fri, 29 Jan 2016 01:09:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601290109.u0T194n0090539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 29 Jan 2016 01:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295030 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 01:09:05 -0000 Author: bdrewery Date: Fri Jan 29 01:09:04 2016 New Revision: 295030 URL: https://svnweb.freebsd.org/changeset/base/295030 Log: Note the double fork behavior with filemon. X-MFC-With: r295029 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Fri Jan 29 01:00:12 2016 (r295029) +++ head/share/man/man4/filemon.4 Fri Jan 29 01:09:04 2016 (r295030) @@ -189,3 +189,8 @@ device appeared in Loading .Nm may reduce system performance for the noted syscalls. +.Pp +Only children of the set process are logged. +Processes can escape being traced by double forking. +This is not seen as a problem as the intended use is build monitoring, which +does not make sense to have daemons for. From owner-svn-src-head@freebsd.org Fri Jan 29 01:22:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ED1DA720F3; Fri, 29 Jan 2016 01:22:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D04A811AF; Fri, 29 Jan 2016 01:22:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0T1MCpx095929; Fri, 29 Jan 2016 01:22:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0T1MCGo095927; Fri, 29 Jan 2016 01:22:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601290122.u0T1MCGo095927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 29 Jan 2016 01:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295031 - head/lib/libc/db/hash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 01:22:14 -0000 Author: brooks Date: Fri Jan 29 01:22:12 2016 New Revision: 295031 URL: https://svnweb.freebsd.org/changeset/base/295031 Log: Use intptr_t note ptrdiff_t when storing flags in the bottom bits of pointers. Obtained from: CheriBSD (e3a69027cc5a384431156d61c90d4304387a9b9d) Sponsored by: DARPA, AFRL Modified: head/lib/libc/db/hash/hash.h head/lib/libc/db/hash/hash_buf.c Modified: head/lib/libc/db/hash/hash.h ============================================================================== --- head/lib/libc/db/hash/hash.h Fri Jan 29 01:09:04 2016 (r295030) +++ head/lib/libc/db/hash/hash.h Fri Jan 29 01:22:12 2016 (r295031) @@ -138,11 +138,11 @@ typedef struct htab { /* Memory reside #define ALL_SET ((u_int32_t)0xFFFFFFFF) #define ALL_CLEAR 0 -#define PTROF(X) ((BUFHEAD *)((ptrdiff_t)(X)&~0x3)) -#define ISMOD(X) ((u_int32_t)(ptrdiff_t)(X)&0x1) -#define DOMOD(X) ((X) = (char *)((ptrdiff_t)(X)|0x1)) -#define ISDISK(X) ((u_int32_t)(ptrdiff_t)(X)&0x2) -#define DODISK(X) ((X) = (char *)((ptrdiff_t)(X)|0x2)) +#define PTROF(X) ((BUFHEAD *)((intptr_t)(X)&~0x3)) +#define ISMOD(X) ((u_int32_t)(intptr_t)(X)&0x1) +#define DOMOD(X) ((X) = (char *)((intptr_t)(X)|0x1)) +#define ISDISK(X) ((u_int32_t)(intptr_t)(X)&0x2) +#define DODISK(X) ((X) = (char *)((intptr_t)(X)|0x2)) #define BITS_PER_MAP 32 Modified: head/lib/libc/db/hash/hash_buf.c ============================================================================== --- head/lib/libc/db/hash/hash_buf.c Fri Jan 29 01:09:04 2016 (r295030) +++ head/lib/libc/db/hash/hash_buf.c Fri Jan 29 01:22:12 2016 (r295031) @@ -138,7 +138,7 @@ __get_buf(HTAB *hashp, u_int32_t addr, return (NULL); if (!prev_bp) segp[segment_ndx] = - (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask); + (BUFHEAD *)((intptr_t)bp | is_disk_mask); } else { BUF_REMOVE(bp); MRU_INSERT(bp); From owner-svn-src-head@freebsd.org Fri Jan 29 01:54:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73FF6A729E7; Fri, 29 Jan 2016 01:54:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 450C810D1; Fri, 29 Jan 2016 01:54:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0T1sWsm004835; Fri, 29 Jan 2016 01:54:32 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0T1sW3U004834; Fri, 29 Jan 2016 01:54:32 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201601290154.u0T1sW3U004834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 29 Jan 2016 01:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295032 - head/etc/periodic/security X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 01:54:33 -0000 Author: marius Date: Fri Jan 29 01:54:32 2016 New Revision: 295032 URL: https://svnweb.freebsd.org/changeset/base/295032 Log: Use '^[>+][^+]' instead of '^[>+]' with grep(1) when filtering the diff(1) output between two files in "new_only"-mode. Otherwise, with the default of using unified format a remnant of the header in the output is the result. This is especially irritating when the two files differ but the second one is empty, amounting to the vestige of the header being the only readout. Reported by: Stefan Haemmerl MFC after: 3 days Modified: head/etc/periodic/security/security.functions Modified: head/etc/periodic/security/security.functions ============================================================================== --- head/etc/periodic/security/security.functions Fri Jan 29 01:22:12 2016 (r295031) +++ head/etc/periodic/security/security.functions Fri Jan 29 01:54:32 2016 (r295032) @@ -51,7 +51,7 @@ check_diff() { rc=0 if [ "$1" = "new_only" ]; then shift - filter="grep '^[>+]'" + filter="grep '^[>+][^+]'" else filter="cat" fi From owner-svn-src-head@freebsd.org Fri Jan 29 10:31:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1355FA72CC6; Fri, 29 Jan 2016 10:31:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFA7B1063; Fri, 29 Jan 2016 10:31:56 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0TAVtFW054565; Fri, 29 Jan 2016 10:31:55 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TAVsKM054548; Fri, 29 Jan 2016 10:31:54 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601291031.u0TAVsKM054548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 29 Jan 2016 10:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295036 - in head/sys: arm/arm arm/conf arm/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 10:31:57 -0000 Author: mmel Date: Fri Jan 29 10:31:54 2016 New Revision: 295036 URL: https://svnweb.freebsd.org/changeset/base/295036 Log: ARM: remove old pmap-v6 code. The new pmap-v6 is mature enough, and dual implementation is showstopper for major cleanup. This patch only removes old code from tree. Cleanups will follow asap. Deleted: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/locore-v6.S head/sys/arm/arm/machdep.c head/sys/arm/arm/mem.c head/sys/arm/arm/mp_machdep.c head/sys/arm/arm/swtch.S head/sys/arm/arm/trap-v6.c head/sys/arm/conf/std.armv6 head/sys/arm/include/machdep.h head/sys/arm/include/pmap.h head/sys/arm/include/pte.h head/sys/arm/include/sf_buf.h head/sys/arm/include/vm.h head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/arm/genassym.c Fri Jan 29 10:31:54 2016 (r295036) @@ -61,16 +61,16 @@ __FBSDID("$FreeBSD$"); ASSYM(KERNBASE, KERNBASE); ASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT); -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL); #endif ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 ASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr)); #endif ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir)); -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 ASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec)); ASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec)); #endif Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/arm/locore-v6.S Fri Jan 29 10:31:54 2016 (r295036) @@ -30,6 +30,7 @@ #include "assym.s" #include +#include #include #include #include @@ -39,11 +40,6 @@ __FBSDID("$FreeBSD$"); -#ifndef ARM_NEW_PMAP -#define PTE1_OFFSET L1_S_OFFSET -#define PTE1_SHIFT L1_S_SHIFT -#define PTE1_SIZE L1_S_SIZE -#endif #if __ARM_ARCH >= 7 #if defined(__ARM_ARCH_7VE__) || defined(__clang__) @@ -287,7 +283,6 @@ ASENTRY_NP(init_mmu) mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr CP15_DACR(r0) -#ifdef ARM_NEW_PMAP /* * Set TEX remap registers * - All is set to uncacheable memory @@ -296,7 +291,6 @@ ASENTRY_NP(init_mmu) mcr CP15_PRRR(r0) mov r0, #0 mcr CP15_NMRR(r0) -#endif mcr CP15_TLBIALL /* Flush TLB */ DSB ISB @@ -305,9 +299,7 @@ ASENTRY_NP(init_mmu) mrc CP15_SCTLR(r0) orr r0, r0, #CPU_CONTROL_MMU_ENABLE orr r0, r0, #CPU_CONTROL_V6_EXTPAGE -#ifdef ARM_NEW_PMAP orr r0, r0, #CPU_CONTROL_TR_ENABLE -#endif orr r0, r0, #CPU_CONTROL_AF_ENABLE mcr CP15_SCTLR(r0) DSB @@ -398,23 +390,11 @@ END(reinit_mmu) * Addresses must be 1MiB aligned */ build_device_pagetables: -#if defined(ARM_NEW_PMAP) ldr r4, =PTE1_V|PTE1_A|PTE1_AP_KRW|TEX1_CLASS_0 -#elif defined(SMP) - ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)|L1_SHARED) -#else - ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)) -#endif b 1f build_pagetables: /* Set the required page attributed */ -#if defined(ARM_NEW_PMAP) ldr r4, =PTE1_V|PTE1_A|PTE1_AP_KRW|TEX1_CLASS_0 -#elif defined(SMP) - ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)|L1_SHARED) -#else - ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#endif 1: orr r1, r4 Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/arm/machdep.c Fri Jan 29 10:31:54 2016 (r295036) @@ -199,7 +199,7 @@ static char *loader_envp; vm_paddr_t pmap_pa; -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 vm_offset_t systempage; vm_offset_t irqstack; vm_offset_t undstack; @@ -456,7 +456,7 @@ cpu_startup(void *dummy) pcb->pcb_regs.sf_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; pmap_set_pcb_pagedir(pmap_kernel(), pcb); -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 vector_page_setprot(VM_PROT_READ); pmap_postinit(); #endif @@ -1283,7 +1283,7 @@ arm_predict_branch(void *cookie, u_int i } } -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 void set_stackptrs(int cpu) { @@ -1447,7 +1447,7 @@ print_kenv(void) debugf(" %x %s\n", (uint32_t)cp, cp); } -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 void * initarm(struct arm_boot_params *abp) { @@ -1717,7 +1717,7 @@ initarm(struct arm_boot_params *abp) return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } -#else /* !ARM_NEW_PMAP */ +#else /* __ARM_ARCH < 6 */ void * initarm(struct arm_boot_params *abp) { @@ -1905,7 +1905,7 @@ initarm(struct arm_boot_params *abp) } -#endif /* !ARM_NEW_PMAP */ +#endif /* __ARM_ARCH < 6 */ #endif /* FDT */ uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/arm/mem.c Fri Jan 29 10:31:54 2016 (r295036) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -113,7 +114,7 @@ memrw(struct cdev *dev, struct uio *uio, return (EINVAL); sx_xlock(&tmppt_lock); pmap_kenter((vm_offset_t)_tmppt, v); -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 pmap_tlb_flush(kernel_pmap, (vm_offset_t)_tmppt); #endif o = (int)uio->uio_offset & PAGE_MASK; Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/arm/mp_machdep.c Fri Jan 29 10:31:54 2016 (r295036) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -155,7 +156,7 @@ init_secondary(int cpu) #ifndef ARM_INTRNG int start = 0, end = 0; #endif -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 uint32_t actlr_mask, actlr_set; pmap_set_tex(); @@ -167,11 +168,11 @@ init_secondary(int cpu) set_stackptrs(cpu); enable_interrupts(PSR_A); -#else /* ARM_NEW_PMAP */ +#else /* __ARM_ARCH >= 6 */ cpu_setup(); setttb(pmap_pa); cpu_tlb_flushID(); -#endif /* ARM_NEW_PMAP */ +#endif /* __ARM_ARCH >= 6 */ pc = &__pcpu[cpu]; /* @@ -183,7 +184,7 @@ init_secondary(int cpu) pcpu_init(pc, cpu, sizeof(struct pcpu)); dpcpu_init(dpcpu[cpu - 1], cpu); -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 /* Provide stack pointers for other processor modes. */ set_stackptrs(cpu); #endif Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/arm/swtch.S Fri Jan 29 10:31:54 2016 (r295036) @@ -114,7 +114,7 @@ __FBSDID("$FreeBSD$"); .word _C_LABEL(blocked_lock) -#ifndef ARM_NEW_PMAP +#if __ARM_ARCH < 6 #define DOMAIN_CLIENT 0x01 @@ -418,7 +418,7 @@ ENTRY(cpu_switch) END(cpu_switch) -#else /* !ARM_NEW_PMAP */ +#else /* __ARM_ARCH < 6 */ #include ENTRY(cpu_context_switch) /* QQQ: What about macro instead of function? */ @@ -789,7 +789,7 @@ sw4_panic_str: END(cpu_switch) -#endif /* !ARM_NEW_PMAP */ +#endif /* __ARM_ARCH < 6 */ ENTRY(savectx) stmfd sp!, {lr} Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/arm/trap-v6.c Fri Jan 29 10:31:54 2016 (r295036) @@ -334,13 +334,11 @@ abort_handler(struct trapframe *tf, int * they are not from KVA space. Thus, no action is needed here. */ -#ifdef ARM_NEW_PMAP rv = pmap_fault(PCPU_GET(curpmap), far, fsr, idx, usermode); if (rv == KERN_SUCCESS) return; if (rv == KERN_INVALID_ADDRESS) goto nogo; -#endif /* * Now, when we handled imprecise and debug aborts, the rest of * aborts should be really related to mapping. @@ -488,13 +486,6 @@ abort_handler(struct trapframe *tf, int last_fault_code = fsr; #endif -#ifndef ARM_NEW_PMAP - if (pmap_fault_fixup(vmspace_pmap(td->td_proc->p_vmspace), va, ftype, - usermode)) { - goto out; - } -#endif - #ifdef INVARIANTS onfault = pcb->pcb_onfault; pcb->pcb_onfault = NULL; Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/conf/std.armv6 Fri Jan 29 10:31:54 2016 (r295036) @@ -37,8 +37,6 @@ options KBD_INSTALL_CDEV # install a CD options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Use new pmap code. - # DTrace support options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # all architectures - kernel ELF linker loads CTF data Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/include/machdep.h Fri Jan 29 10:31:54 2016 (r295036) @@ -4,8 +4,10 @@ #ifndef _MACHDEP_BOOT_MACHDEP_H_ #define _MACHDEP_BOOT_MACHDEP_H_ +#include + /* Structs that need to be initialised by initarm */ -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 extern vm_offset_t irqstack; extern vm_offset_t undstack; extern vm_offset_t abtstack; Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/include/pmap.h Fri Jan 29 10:31:54 2016 (r295036) @@ -46,9 +46,11 @@ * * $FreeBSD$ */ -#ifdef ARM_NEW_PMAP + #include + +#if __ARM_ARCH >= 6 #include -#else /* ARM_NEW_PMAP */ +#else /* __ARM_ARCH >= 6 */ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ @@ -704,4 +706,4 @@ extern vm_paddr_t dump_avail[]; #endif /* !LOCORE */ #endif /* !_MACHINE_PMAP_H_ */ -#endif /* !ARM_NEW_PMAP */ +#endif /* __ARM_ARCH >= 6 */ Modified: head/sys/arm/include/pte.h ============================================================================== --- head/sys/arm/include/pte.h Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/include/pte.h Fri Jan 29 10:31:54 2016 (r295036) @@ -33,9 +33,11 @@ * * $FreeBSD$ */ -#ifdef ARM_NEW_PMAP +#include + +#if __ARM_ARCH >= 6 #include -#else /* ARM_NEW_PMAP */ +#else /* __ARM_ARCH >= 6 */ #ifndef _MACHINE_PTE_H_ #define _MACHINE_PTE_H_ @@ -356,6 +358,6 @@ typedef pt_entry_t pt2_entry_t; /* comp * 1 X 1 1 1 Y Y WT Y Y */ #endif /* !_MACHINE_PTE_H_ */ -#endif /* !ARM_NEW_PMAP */ +#endif /* __ARM_ARCH >= 6 */ /* End of pte.h */ Modified: head/sys/arm/include/sf_buf.h ============================================================================== --- head/sys/arm/include/sf_buf.h Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/include/sf_buf.h Fri Jan 29 10:31:54 2016 (r295036) @@ -29,11 +29,13 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ +#include + static inline void sf_buf_map(struct sf_buf *sf, int flags) { -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 pmap_qenter(sf->kva, &(sf->m), 1); #else pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); @@ -44,7 +46,7 @@ static inline int sf_buf_unmap(struct sf_buf *sf) { -#ifdef ARM_NEW_PMAP +#if __ARM_ARCH >= 6 pmap_qremove(sf->kva, 1); #else pmap_kremove(sf->kva); Modified: head/sys/arm/include/vm.h ============================================================================== --- head/sys/arm/include/vm.h Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/arm/include/vm.h Fri Jan 29 10:31:54 2016 (r295036) @@ -29,7 +29,9 @@ #ifndef _MACHINE_VM_H_ #define _MACHINE_VM_H_ -#ifdef ARM_NEW_PMAP +#include + +#if __ARM_ARCH >= 6 #include #define VM_MEMATTR_WB_WA ((vm_memattr_t)PTE2_ATTR_WB_WA) @@ -40,9 +42,11 @@ #define VM_MEMATTR_DEFAULT VM_MEMATTR_WB_WA #define VM_MEMATTR_UNCACHEABLE VM_MEMATTR_SO /* misused by DMA */ +#ifdef _KERNEL +/* Don't export aliased VM_MEMATTR to userland */ #define VM_MEMATTR_WRITE_COMBINING VM_MEMATTR_WT /* for DRM */ #define VM_MEMATTR_WRITE_BACK VM_MEMATTR_WB_WA /* for DRM */ - +#endif #else /* Memory attribute configuration. */ #define VM_MEMATTR_DEFAULT 0 Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/conf/files.arm Fri Jan 29 10:31:54 2016 (r295036) @@ -64,8 +64,7 @@ arm/arm/pl310.c optional pl310 arm/arm/platform.c optional platform arm/arm/platform_if.m optional platform arm/arm/pmap.c optional !armv6 -arm/arm/pmap-v6.c optional armv6 !arm_new_pmap -arm/arm/pmap-v6-new.c optional armv6 arm_new_pmap +arm/arm/pmap-v6-new.c optional armv6 arm/arm/pmu.c optional pmu | fdt hwpmc arm/arm/sc_machdep.c optional sc arm/arm/setcpsr.S standard Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Fri Jan 29 09:16:08 2016 (r295035) +++ head/sys/conf/options.arm Fri Jan 29 10:31:54 2016 (r295036) @@ -5,7 +5,6 @@ ARM_INTRNG opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h -ARM_NEW_PMAP opt_global.h NKPT2PG opt_pmap.h ARM_WANT_TP_ADDRESS opt_global.h COUNTS_PER_SEC opt_timer.h From owner-svn-src-head@freebsd.org Fri Jan 29 11:00:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1309A71459; Fri, 29 Jan 2016 11:00:34 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B0F11B00; Fri, 29 Jan 2016 11:00:34 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0TB0XTx063108; Fri, 29 Jan 2016 11:00:33 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TB0X6Q063106; Fri, 29 Jan 2016 11:00:33 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601291100.u0TB0X6Q063106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 29 Jan 2016 11:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295037 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 11:00:34 -0000 Author: mmel Date: Fri Jan 29 11:00:33 2016 New Revision: 295037 URL: https://svnweb.freebsd.org/changeset/base/295037 Log: ARM: After removal of old pmap-v6 code, rename pmap-v6-new.c to pmap-v6.c. Added: head/sys/arm/arm/pmap-v6.c - copied unchanged from r295036, head/sys/arm/arm/pmap-v6-new.c Deleted: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/conf/files.arm Copied: head/sys/arm/arm/pmap-v6.c (from r295036, head/sys/arm/arm/pmap-v6-new.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/pmap-v6.c Fri Jan 29 11:00:33 2016 (r295037, copy of r295036, head/sys/arm/arm/pmap-v6-new.c) @@ -0,0 +1,6634 @@ +/*- + * Copyright (c) 1991 Regents of the University of California. + * Copyright (c) 1994 John S. Dyson + * Copyright (c) 1994 David Greenman + * Copyright (c) 2005-2010 Alan L. Cox + * Copyright (c) 2014 Svatopluk Kraus + * Copyright (c) 2014 Michal Meloun + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department and William Jolitz of UUNET Technologies 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. + * 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. + * + * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 + */ +/*- + * Copyright (c) 2003 Networks Associates Technology, Inc. + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Jake Burkholder, + * Safeport Network Services, and Network Associates Laboratories, the + * Security Research Division of Network Associates, Inc. under + * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA + * CHATS research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Manages physical address maps. + * + * Since the information managed by this module is + * also stored by the logical address mapping module, + * this module may throw away valid virtual-to-physical + * mappings at almost any time. However, invalidations + * of virtual-to-physical mappings must be done as + * requested. + * + * In order to cope with hardware architectures which + * make virtual-to-physical map invalidates expensive, + * this module may delay invalidate or reduced protection + * operations until such time as they are actually + * necessary. This module is given full information as + * to which processors are currently using which maps, + * and to when physical maps must be made correct. + */ + +#include "opt_vm.h" +#include "opt_pmap.h" +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SMP +#include +#else +#include +#endif + +#ifdef DDB +#include +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#ifdef SMP +#include +#endif + +#ifndef PMAP_SHPGPERPROC +#define PMAP_SHPGPERPROC 200 +#endif + +#ifndef DIAGNOSTIC +#define PMAP_INLINE __inline +#else +#define PMAP_INLINE +#endif + +#ifdef PMAP_DEBUG +static void pmap_zero_page_check(vm_page_t m); +void pmap_debug(int level); +int pmap_pid_dump(int pid); + +#define PDEBUG(_lev_,_stat_) \ + if (pmap_debug_level >= (_lev_)) \ + ((_stat_)) +#define dprintf printf +int pmap_debug_level = 1; +#else /* PMAP_DEBUG */ +#define PDEBUG(_lev_,_stat_) /* Nothing */ +#define dprintf(x, arg...) +#endif /* PMAP_DEBUG */ + +/* + * Level 2 page tables map definion ('max' is excluded). + */ + +#define PT2V_MIN_ADDRESS ((vm_offset_t)PT2MAP) +#define PT2V_MAX_ADDRESS ((vm_offset_t)PT2MAP + PT2MAP_SIZE) + +#define UPT2V_MIN_ADDRESS ((vm_offset_t)PT2MAP) +#define UPT2V_MAX_ADDRESS \ + ((vm_offset_t)(PT2MAP + (KERNBASE >> PT2MAP_SHIFT))) + +/* + * Promotion to a 1MB (PTE1) page mapping requires that the corresponding + * 4KB (PTE2) page mappings have identical settings for the following fields: + */ +#define PTE2_PROMOTE (PTE2_V | PTE2_A | PTE2_NM | PTE2_S | PTE2_NG | \ + PTE2_NX | PTE2_RO | PTE2_U | PTE2_W | \ + PTE2_ATTR_MASK) + +#define PTE1_PROMOTE (PTE1_V | PTE1_A | PTE1_NM | PTE1_S | PTE1_NG | \ + PTE1_NX | PTE1_RO | PTE1_U | PTE1_W | \ + PTE1_ATTR_MASK) + +#define ATTR_TO_L1(l2_attr) ((((l2_attr) & L2_TEX0) ? L1_S_TEX0 : 0) | \ + (((l2_attr) & L2_C) ? L1_S_C : 0) | \ + (((l2_attr) & L2_B) ? L1_S_B : 0) | \ + (((l2_attr) & PTE2_A) ? PTE1_A : 0) | \ + (((l2_attr) & PTE2_NM) ? PTE1_NM : 0) | \ + (((l2_attr) & PTE2_S) ? PTE1_S : 0) | \ + (((l2_attr) & PTE2_NG) ? PTE1_NG : 0) | \ + (((l2_attr) & PTE2_NX) ? PTE1_NX : 0) | \ + (((l2_attr) & PTE2_RO) ? PTE1_RO : 0) | \ + (((l2_attr) & PTE2_U) ? PTE1_U : 0) | \ + (((l2_attr) & PTE2_W) ? PTE1_W : 0)) + +#define ATTR_TO_L2(l1_attr) ((((l1_attr) & L1_S_TEX0) ? L2_TEX0 : 0) | \ + (((l1_attr) & L1_S_C) ? L2_C : 0) | \ + (((l1_attr) & L1_S_B) ? L2_B : 0) | \ + (((l1_attr) & PTE1_A) ? PTE2_A : 0) | \ + (((l1_attr) & PTE1_NM) ? PTE2_NM : 0) | \ + (((l1_attr) & PTE1_S) ? PTE2_S : 0) | \ + (((l1_attr) & PTE1_NG) ? PTE2_NG : 0) | \ + (((l1_attr) & PTE1_NX) ? PTE2_NX : 0) | \ + (((l1_attr) & PTE1_RO) ? PTE2_RO : 0) | \ + (((l1_attr) & PTE1_U) ? PTE2_U : 0) | \ + (((l1_attr) & PTE1_W) ? PTE2_W : 0)) + +/* + * PTE2 descriptors creation macros. + */ +#define PTE2_KPT(pa) PTE2_KERN(pa, PTE2_AP_KRW, pt_memattr) +#define PTE2_KPT_NG(pa) PTE2_KERN_NG(pa, PTE2_AP_KRW, pt_memattr) + +#define PTE2_KRW(pa) PTE2_KERN(pa, PTE2_AP_KRW, PTE2_ATTR_NORMAL) +#define PTE2_KRO(pa) PTE2_KERN(pa, PTE2_AP_KR, PTE2_ATTR_NORMAL) + +#define PV_STATS +#ifdef PV_STATS +#define PV_STAT(x) do { x ; } while (0) +#else +#define PV_STAT(x) do { } while (0) +#endif + +/* + * The boot_pt1 is used temporary in very early boot stage as L1 page table. + * We can init many things with no memory allocation thanks to its static + * allocation and this brings two main advantages: + * (1) other cores can be started very simply, + * (2) various boot loaders can be supported as its arguments can be processed + * in virtual address space and can be moved to safe location before + * first allocation happened. + * Only disadvantage is that boot_pt1 is used only in very early boot stage. + * However, the table is uninitialized and so lays in bss. Therefore kernel + * image size is not influenced. + * + * QQQ: In the future, maybe, boot_pt1 can be used for soft reset and + * CPU suspend/resume game. + */ +extern pt1_entry_t boot_pt1[]; + +vm_paddr_t base_pt1; +pt1_entry_t *kern_pt1; +pt2_entry_t *kern_pt2tab; +pt2_entry_t *PT2MAP; + +static uint32_t ttb_flags; +static vm_memattr_t pt_memattr; +ttb_entry_t pmap_kern_ttb; + +/* XXX use converion function*/ +#define PTE2_ATTR_NORMAL VM_MEMATTR_DEFAULT +#define PTE1_ATTR_NORMAL ATTR_TO_L1(PTE2_ATTR_NORMAL) + +struct pmap kernel_pmap_store; +LIST_HEAD(pmaplist, pmap); +static struct pmaplist allpmaps; +static struct mtx allpmaps_lock; + +vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ +vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ + +static vm_offset_t kernel_vm_end_new; +vm_offset_t kernel_vm_end = KERNBASE + NKPT2PG * NPT2_IN_PG * PTE1_SIZE; +vm_offset_t vm_max_kernel_address; +vm_paddr_t kernel_l1pa; + +static struct rwlock __aligned(CACHE_LINE_SIZE) pvh_global_lock; + +/* + * Data for the pv entry allocation mechanism + */ +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); +static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; +static struct md_page *pv_table; /* XXX: Is it used only the list in md_page? */ +static int shpgperproc = PMAP_SHPGPERPROC; + +struct pv_chunk *pv_chunkbase; /* KVA block for pv_chunks */ +int pv_maxchunks; /* How many chunks we have KVA for */ +vm_offset_t pv_vafree; /* freelist stored in the PTE */ + +vm_paddr_t first_managed_pa; +#define pa_to_pvh(pa) (&pv_table[pte1_index(pa - first_managed_pa)]) + +/* + * All those kernel PT submaps that BSD is so fond of + */ +struct sysmaps { + struct mtx lock; + pt2_entry_t *CMAP1; + pt2_entry_t *CMAP2; + pt2_entry_t *CMAP3; + caddr_t CADDR1; + caddr_t CADDR2; + caddr_t CADDR3; +}; +static struct sysmaps sysmaps_pcpu[MAXCPU]; +static pt2_entry_t *CMAP3; +static caddr_t CADDR3; +caddr_t _tmppt = 0; + +struct msgbuf *msgbufp = 0; /* XXX move it to machdep.c */ + +/* + * Crashdump maps. + */ +static caddr_t crashdumpmap; + +static pt2_entry_t *PMAP1 = 0, *PMAP2; +static pt2_entry_t *PADDR1 = 0, *PADDR2; +#ifdef DDB +static pt2_entry_t *PMAP3; +static pt2_entry_t *PADDR3; +static int PMAP3cpu __unused; /* for SMP only */ +#endif +#ifdef SMP +static int PMAP1cpu; +static int PMAP1changedcpu; +SYSCTL_INT(_debug, OID_AUTO, PMAP1changedcpu, CTLFLAG_RD, + &PMAP1changedcpu, 0, + "Number of times pmap_pte2_quick changed CPU with same PMAP1"); +#endif +static int PMAP1changed; +SYSCTL_INT(_debug, OID_AUTO, PMAP1changed, CTLFLAG_RD, + &PMAP1changed, 0, + "Number of times pmap_pte2_quick changed PMAP1"); +static int PMAP1unchanged; +SYSCTL_INT(_debug, OID_AUTO, PMAP1unchanged, CTLFLAG_RD, + &PMAP1unchanged, 0, + "Number of times pmap_pte2_quick didn't change PMAP1"); +static struct mtx PMAP2mutex; + +static __inline void pt2_wirecount_init(vm_page_t m); +static boolean_t pmap_demote_pte1(pmap_t pmap, pt1_entry_t *pte1p, + vm_offset_t va); +void cache_icache_sync_fresh(vm_offset_t va, vm_paddr_t pa, vm_size_t size); + +/* + * Function to set the debug level of the pmap code. + */ +#ifdef PMAP_DEBUG +void +pmap_debug(int level) +{ + + pmap_debug_level = level; + dprintf("pmap_debug: level=%d\n", pmap_debug_level); +} +#endif /* PMAP_DEBUG */ + +/* + * This table must corespond with memory attribute configuration in vm.h. + * First entry is used for normal system mapping. + * + * Device memory is always marked as shared. + * Normal memory is shared only in SMP . + * Not outer shareable bits are not used yet. + * Class 6 cannot be used on ARM11. + */ +#define TEXDEF_TYPE_SHIFT 0 +#define TEXDEF_TYPE_MASK 0x3 +#define TEXDEF_INNER_SHIFT 2 +#define TEXDEF_INNER_MASK 0x3 +#define TEXDEF_OUTER_SHIFT 4 +#define TEXDEF_OUTER_MASK 0x3 +#define TEXDEF_NOS_SHIFT 6 +#define TEXDEF_NOS_MASK 0x1 + +#define TEX(t, i, o, s) \ + ((t) << TEXDEF_TYPE_SHIFT) | \ + ((i) << TEXDEF_INNER_SHIFT) | \ + ((o) << TEXDEF_OUTER_SHIFT | \ + ((s) << TEXDEF_NOS_SHIFT)) + +static uint32_t tex_class[8] = { +/* type inner cache outer cache */ + TEX(PRRR_MEM, NMRR_WB_WA, NMRR_WB_WA, 0), /* 0 - ATTR_WB_WA */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 1 - ATTR_NOCACHE */ + TEX(PRRR_DEV, NMRR_NC, NMRR_NC, 0), /* 2 - ATTR_DEVICE */ + TEX(PRRR_SO, NMRR_NC, NMRR_NC, 0), /* 3 - ATTR_SO */ + TEX(PRRR_MEM, NMRR_WT, NMRR_WT, 0), /* 4 - ATTR_WT */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 5 - NOT USED YET */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 6 - NOT USED YET */ + TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 7 - NOT USED YET */ +}; +#undef TEX + +/* + * Convert TEX definition entry to TTB flags. + */ +static uint32_t +encode_ttb_flags(int idx) +{ + uint32_t inner, outer, nos, reg; + + inner = (tex_class[idx] >> TEXDEF_INNER_SHIFT) & + TEXDEF_INNER_MASK; + outer = (tex_class[idx] >> TEXDEF_OUTER_SHIFT) & + TEXDEF_OUTER_MASK; + nos = (tex_class[idx] >> TEXDEF_NOS_SHIFT) & + TEXDEF_NOS_MASK; + + reg = nos << 5; + reg |= outer << 3; + if (cpuinfo.coherent_walk) + reg |= (inner & 0x1) << 6; + reg |= (inner & 0x2) >> 1; +#ifdef SMP + reg |= 1 << 1; +#endif + return reg; +} + +/* + * Set TEX remapping registers in current CPU. + */ +void +pmap_set_tex(void) +{ + uint32_t prrr, nmrr; + uint32_t type, inner, outer, nos; + int i; + +#ifdef PMAP_PTE_NOCACHE + /* XXX fixme */ + if (cpuinfo.coherent_walk) { + pt_memattr = VM_MEMATTR_WB_WA; + ttb_flags = encode_ttb_flags(0); + } + else { + pt_memattr = VM_MEMATTR_NOCACHE; + ttb_flags = encode_ttb_flags(1); + } +#else + pt_memattr = VM_MEMATTR_WB_WA; + ttb_flags = encode_ttb_flags(0); +#endif + + prrr = 0; + nmrr = 0; + + /* Build remapping register from TEX classes. */ + for (i = 0; i < 8; i++) { + type = (tex_class[i] >> TEXDEF_TYPE_SHIFT) & + TEXDEF_TYPE_MASK; + inner = (tex_class[i] >> TEXDEF_INNER_SHIFT) & + TEXDEF_INNER_MASK; + outer = (tex_class[i] >> TEXDEF_OUTER_SHIFT) & + TEXDEF_OUTER_MASK; + nos = (tex_class[i] >> TEXDEF_NOS_SHIFT) & + TEXDEF_NOS_MASK; + + prrr |= type << (i * 2); + prrr |= nos << (i + 24); + nmrr |= inner << (i * 2); + nmrr |= outer << (i * 2 + 16); + } + /* Add shareable bits for device memory. */ + prrr |= PRRR_DS0 | PRRR_DS1; + + /* Add shareable bits for normal memory in SMP case. */ +#ifdef SMP + prrr |= PRRR_NS1; +#endif + cp15_prrr_set(prrr); + cp15_nmrr_set(nmrr); + + /* Caches are disabled, so full TLB flush should be enough. */ + tlb_flush_all_local(); +} + +/* + * KERNBASE must be multiple of NPT2_IN_PG * PTE1_SIZE. In other words, + * KERNBASE is mapped by first L2 page table in L2 page table page. It + * meets same constrain due to PT2MAP being placed just under KERNBASE. + */ +CTASSERT((KERNBASE & (NPT2_IN_PG * PTE1_SIZE - 1)) == 0); +CTASSERT((KERNBASE - VM_MAXUSER_ADDRESS) >= PT2MAP_SIZE); + +/* + * In crazy dreams, PAGE_SIZE could be a multiple of PTE2_SIZE in general. + * For now, anyhow, the following check must be fulfilled. + */ +CTASSERT(PAGE_SIZE == PTE2_SIZE); +/* + * We don't want to mess up MI code with all MMU and PMAP definitions, + * so some things, which depend on other ones, are defined independently. + * Now, it is time to check that we don't screw up something. + */ +CTASSERT(PDRSHIFT == PTE1_SHIFT); +/* + * Check L1 and L2 page table entries definitions consistency. + */ +CTASSERT(NB_IN_PT1 == (sizeof(pt1_entry_t) * NPTE1_IN_PT1)); +CTASSERT(NB_IN_PT2 == (sizeof(pt2_entry_t) * NPTE2_IN_PT2)); +/* + * Check L2 page tables page consistency. + */ +CTASSERT(PAGE_SIZE == (NPT2_IN_PG * NB_IN_PT2)); +CTASSERT((1 << PT2PG_SHIFT) == NPT2_IN_PG); +/* + * Check PT2TAB consistency. + * PT2TAB_ENTRIES is defined as a division of NPTE1_IN_PT1 by NPT2_IN_PG. + * This should be done without remainder. + */ +CTASSERT(NPTE1_IN_PT1 == (PT2TAB_ENTRIES * NPT2_IN_PG)); + +/* + * A PT2MAP magic. + * + * All level 2 page tables (PT2s) are mapped continuously and accordingly + * into PT2MAP address space. As PT2 size is less than PAGE_SIZE, this can + * be done only if PAGE_SIZE is a multiple of PT2 size. All PT2s in one page + * must be used together, but not necessary at once. The first PT2 in a page + * must map things on correctly aligned address and the others must follow + * in right order. + */ +#define NB_IN_PT2TAB (PT2TAB_ENTRIES * sizeof(pt2_entry_t)) +#define NPT2_IN_PT2TAB (NB_IN_PT2TAB / NB_IN_PT2) +#define NPG_IN_PT2TAB (NB_IN_PT2TAB / PAGE_SIZE) + +/* + * Check PT2TAB consistency. + * NPT2_IN_PT2TAB is defined as a division of NB_IN_PT2TAB by NB_IN_PT2. + * NPG_IN_PT2TAB is defined as a division of NB_IN_PT2TAB by PAGE_SIZE. + * The both should be done without remainder. + */ +CTASSERT(NB_IN_PT2TAB == (NPT2_IN_PT2TAB * NB_IN_PT2)); +CTASSERT(NB_IN_PT2TAB == (NPG_IN_PT2TAB * PAGE_SIZE)); +/* + * The implementation was made general, however, with the assumption + * bellow in mind. In case of another value of NPG_IN_PT2TAB, + * the code should be once more rechecked. + */ +CTASSERT(NPG_IN_PT2TAB == 1); + +/* + * Get offset of PT2 in a page + * associated with given PT1 index. + */ +static __inline u_int +page_pt2off(u_int pt1_idx) +{ + + return ((pt1_idx & PT2PG_MASK) * NB_IN_PT2); +} + +/* + * Get physical address of PT2 + * associated with given PT2s page and PT1 index. + */ +static __inline vm_paddr_t +page_pt2pa(vm_paddr_t pgpa, u_int pt1_idx) +{ + + return (pgpa + page_pt2off(pt1_idx)); +} + +/* + * Get first entry of PT2 + * associated with given PT2s page and PT1 index. + */ +static __inline pt2_entry_t * +page_pt2(vm_offset_t pgva, u_int pt1_idx) +{ + + return ((pt2_entry_t *)(pgva + page_pt2off(pt1_idx))); +} + +/* + * Get virtual address of PT2s page (mapped in PT2MAP) + * which holds PT2 which holds entry which maps given virtual address. + */ +static __inline vm_offset_t +pt2map_pt2pg(vm_offset_t va) +{ + + va &= ~(NPT2_IN_PG * PTE1_SIZE - 1); + return ((vm_offset_t)pt2map_entry(va)); +} + +/***************************************************************************** + * + * THREE pmap initialization milestones exist: + * + * locore.S + * -> fundamental init (including MMU) in ASM + * + * initarm() + * -> fundamental init continues in C + * -> first available physical address is known + * + * pmap_bootstrap_prepare() -> FIRST PMAP MILESTONE (first epoch begins) + * -> basic (safe) interface for physical address allocation is made + * -> basic (safe) interface for virtual mapping is made + * -> limited not SMP coherent work is possible + * + * -> more fundamental init continues in C + * -> locks and some more things are available + * -> all fundamental allocations and mappings are done + * + * pmap_bootstrap() -> SECOND PMAP MILESTONE (second epoch begins) + * -> phys_avail[] and virtual_avail is set + * -> control is passed to vm subsystem + * -> physical and virtual address allocation are off limit + * -> low level mapping functions, some SMP coherent, + * are available, which cannot be used before vm subsystem + * is being inited + * + * mi_startup() + * -> vm subsystem is being inited + * + * pmap_init() -> THIRD PMAP MILESTONE (third epoch begins) + * -> pmap is fully inited + * + *****************************************************************************/ + +/***************************************************************************** + * + * PMAP first stage initialization and utility functions + * for pre-bootstrap epoch. + * + * After pmap_bootstrap_prepare() is called, the following functions + * can be used: + * + * (1) strictly only for this stage functions for physical page allocations, + * virtual space allocations, and mappings: + * + * vm_paddr_t pmap_preboot_get_pages(u_int num); + * void pmap_preboot_map_pages(vm_paddr_t pa, vm_offset_t va, u_int num); + * vm_offset_t pmap_preboot_reserve_pages(u_int num); + * vm_offset_t pmap_preboot_get_vpages(u_int num); + * void pmap_preboot_map_attr(vm_paddr_t pa, vm_offset_t va, vm_size_t size, + * int prot, int attr); + * + * (2) for all stages: + * + * vm_paddr_t pmap_kextract(vm_offset_t va); + * + * NOTE: This is not SMP coherent stage. + * + *****************************************************************************/ + +#define KERNEL_P2V(pa) \ + ((vm_offset_t)((pa) - arm_physmem_kernaddr + KERNVIRTADDR)) +#define KERNEL_V2P(va) \ + ((vm_paddr_t)((va) - KERNVIRTADDR + arm_physmem_kernaddr)) + +static vm_paddr_t last_paddr; + +/* + * Pre-bootstrap epoch page allocator. + */ +vm_paddr_t +pmap_preboot_get_pages(u_int num) +{ + vm_paddr_t ret; + + ret = last_paddr; + last_paddr += num * PAGE_SIZE; + + return (ret); +} + +/* + * The fundamental initalization of PMAP stuff. + * + * Some things already happened in locore.S and some things could happen + * before pmap_bootstrap_prepare() is called, so let's recall what is done: + * 1. Caches are disabled. + * 2. We are running on virtual addresses already with 'boot_pt1' + * as L1 page table. + * 3. So far, all virtual addresses can be converted to physical ones and + * vice versa by the following macros: + * KERNEL_P2V(pa) .... physical to virtual ones, + * KERNEL_V2P(va) .... virtual to physical ones. + * + * What is done herein: + * 1. The 'boot_pt1' is replaced by real kernel L1 page table 'kern_pt1'. + * 2. PT2MAP magic is brought to live. + * 3. Basic preboot functions for page allocations and mappings can be used. + * 4. Everything is prepared for L1 cache enabling. + * + * Variations: + * 1. To use second TTB register, so kernel and users page tables will be + * separated. This way process forking - pmap_pinit() - could be faster, + * it saves physical pages and KVA per a process, and it's simple change. + * However, it will lead, due to hardware matter, to the following: + * (a) 2G space for kernel and 2G space for users. + * (b) 1G space for kernel in low addresses and 3G for users above it. + * A question is: Is the case (b) really an option? Note that case (b) + * does save neither physical memory and KVA. + */ +void +pmap_bootstrap_prepare(vm_paddr_t last) +{ + vm_paddr_t pt2pg_pa, pt2tab_pa, pa, size; + vm_offset_t pt2pg_va; + pt1_entry_t *pte1p; + pt2_entry_t *pte2p; + u_int i; + uint32_t actlr_mask, actlr_set; + + /* + * Now, we are going to make real kernel mapping. Note that we are + * already running on some mapping made in locore.S and we expect + * that it's large enough to ensure nofault access to physical memory + * allocated herein before switch. + * + * As kernel image and everything needed before are and will be mapped + * by section mappings, we align last physical address to PTE1_SIZE. + */ + last_paddr = pte1_roundup(last); + + /* + * Allocate and zero page(s) for kernel L1 page table. + * + * Note that it's first allocation on space which was PTE1_SIZE + * aligned and as such base_pt1 is aligned to NB_IN_PT1 too. + */ + base_pt1 = pmap_preboot_get_pages(NPG_IN_PT1); + kern_pt1 = (pt1_entry_t *)KERNEL_P2V(base_pt1); + bzero((void*)kern_pt1, NB_IN_PT1); + pte1_sync_range(kern_pt1, NB_IN_PT1); + + /* Allocate and zero page(s) for kernel PT2TAB. */ + pt2tab_pa = pmap_preboot_get_pages(NPG_IN_PT2TAB); + kern_pt2tab = (pt2_entry_t *)KERNEL_P2V(pt2tab_pa); + bzero(kern_pt2tab, NB_IN_PT2TAB); + pte2_sync_range(kern_pt2tab, NB_IN_PT2TAB); + + /* Allocate and zero page(s) for kernel L2 page tables. */ + pt2pg_pa = pmap_preboot_get_pages(NKPT2PG); + pt2pg_va = KERNEL_P2V(pt2pg_pa); + size = NKPT2PG * PAGE_SIZE; + bzero((void*)pt2pg_va, size); + pte2_sync_range((pt2_entry_t *)pt2pg_va, size); + + /* + * Add a physical memory segment (vm_phys_seg) corresponding to the + * preallocated pages for kernel L2 page tables so that vm_page + * structures representing these pages will be created. The vm_page + * structures are required for promotion of the corresponding kernel + * virtual addresses to section mappings. + */ + vm_phys_add_seg(pt2tab_pa, pmap_preboot_get_pages(0)); + + /* + * Insert allocated L2 page table pages to PT2TAB and make + * link to all PT2s in L1 page table. See how kernel_vm_end + * is initialized. + * + * We play simple and safe. So every KVA will have underlaying + * L2 page table, even kernel image mapped by sections. + */ + pte2p = kern_pt2tab_entry(KERNBASE); + for (pa = pt2pg_pa; pa < pt2pg_pa + size; pa += PTE2_SIZE) + pt2tab_store(pte2p++, PTE2_KPT(pa)); + + pte1p = kern_pte1(KERNBASE); + for (pa = pt2pg_pa; pa < pt2pg_pa + size; pa += NB_IN_PT2) + pte1_store(pte1p++, PTE1_LINK(pa)); + + /* Make section mappings for kernel. */ + pte1p = kern_pte1(KERNBASE); + for (pa = KERNEL_V2P(KERNBASE); pa < last; pa += PTE1_SIZE) + pte1_store(pte1p++, PTE1_KERN(pa, PTE1_AP_KRW, + ATTR_TO_L1(PTE2_ATTR_WB_WA))); + + /* + * Get free and aligned space for PT2MAP and make L1 page table links + * to L2 page tables held in PT2TAB. + * + * Note that pages holding PT2s are stored in PT2TAB as pt2_entry_t + * descriptors and PT2TAB page(s) itself is(are) used as PT2s. Thus + * each entry in PT2TAB maps all PT2s in a page. This implies that + * virtual address of PT2MAP must be aligned to NPT2_IN_PG * PTE1_SIZE. + */ + PT2MAP = (pt2_entry_t *)(KERNBASE - PT2MAP_SIZE); + pte1p = kern_pte1((vm_offset_t)PT2MAP); + for (pa = pt2tab_pa, i = 0; i < NPT2_IN_PT2TAB; i++, pa += NB_IN_PT2) { + pte1_store(pte1p++, PTE1_LINK(pa)); + } + + /* + * Store PT2TAB in PT2TAB itself, i.e. self reference mapping. + * Each pmap will hold own PT2TAB, so the mapping should be not global. + */ + pte2p = kern_pt2tab_entry((vm_offset_t)PT2MAP); + for (pa = pt2tab_pa, i = 0; i < NPG_IN_PT2TAB; i++, pa += PTE2_SIZE) { + pt2tab_store(pte2p++, PTE2_KPT_NG(pa)); + } + + /* + * Choose correct L2 page table and make mappings for allocations + * made herein which replaces temporary locore.S mappings after a while. + * Note that PT2MAP cannot be used until we switch to kern_pt1. + * + * Note, that these allocations started aligned on 1M section and + * kernel PT1 was allocated first. Making of mappings must follow + * order of physical allocations as we've used KERNEL_P2V() macro + * for virtual addresses resolution. + */ + pte2p = kern_pt2tab_entry((vm_offset_t)kern_pt1); + pt2pg_va = KERNEL_P2V(pte2_pa(pte2_load(pte2p))); + + pte2p = page_pt2(pt2pg_va, pte1_index((vm_offset_t)kern_pt1)); + + /* Make mapping for kernel L1 page table. */ + for (pa = base_pt1, i = 0; i < NPG_IN_PT1; i++, pa += PTE2_SIZE) + pte2_store(pte2p++, PTE2_KPT(pa)); + + /* Make mapping for kernel PT2TAB. */ + for (pa = pt2tab_pa, i = 0; i < NPG_IN_PT2TAB; i++, pa += PTE2_SIZE) + pte2_store(pte2p++, PTE2_KPT(pa)); + + /* Finally, switch from 'boot_pt1' to 'kern_pt1'. */ + pmap_kern_ttb = base_pt1 | ttb_flags; + cpuinfo_get_actlr_modifier(&actlr_mask, &actlr_set); + reinit_mmu(pmap_kern_ttb, actlr_mask, actlr_set); + /* + * Initialize the first available KVA. As kernel image is mapped by + * sections, we are leaving some gap behind. + */ + virtual_avail = (vm_offset_t)kern_pt2tab + NPG_IN_PT2TAB * PAGE_SIZE; +} + +/* + * Setup L2 page table page for given KVA. + * Used in pre-bootstrap epoch. + * + * Note that we have allocated NKPT2PG pages for L2 page tables in advance + * and used them for mapping KVA starting from KERNBASE. However, this is not + * enough. Vectors and devices need L2 page tables too. Note that they are + * even above VM_MAX_KERNEL_ADDRESS. + */ +static __inline vm_paddr_t +pmap_preboot_pt2pg_setup(vm_offset_t va) +{ + pt2_entry_t *pte2p, pte2; + vm_paddr_t pt2pg_pa; + + /* Get associated entry in PT2TAB. */ + pte2p = kern_pt2tab_entry(va); + + /* Just return, if PT2s page exists already. */ + pte2 = pt2tab_load(pte2p); + if (pte2_is_valid(pte2)) + return (pte2_pa(pte2)); + + KASSERT(va >= VM_MAX_KERNEL_ADDRESS, + ("%s: NKPT2PG too small", __func__)); + + /* + * Allocate page for PT2s and insert it to PT2TAB. + * In other words, map it into PT2MAP space. + */ + pt2pg_pa = pmap_preboot_get_pages(1); + pt2tab_store(pte2p, PTE2_KPT(pt2pg_pa)); + + /* Zero all PT2s in allocated page. */ + bzero((void*)pt2map_pt2pg(va), PAGE_SIZE); + pte2_sync_range((pt2_entry_t *)pt2map_pt2pg(va), PAGE_SIZE); + + return (pt2pg_pa); +} + +/* + * Setup L2 page table for given KVA. + * Used in pre-bootstrap epoch. + */ +static void +pmap_preboot_pt2_setup(vm_offset_t va) +{ + pt1_entry_t *pte1p; + vm_paddr_t pt2pg_pa, pt2_pa; + + /* Setup PT2's page. */ + pt2pg_pa = pmap_preboot_pt2pg_setup(va); + pt2_pa = page_pt2pa(pt2pg_pa, pte1_index(va)); + + /* Insert PT2 to PT1. */ + pte1p = kern_pte1(va); + pte1_store(pte1p, PTE1_LINK(pt2_pa)); +} + +/* + * Get L2 page entry associated with given KVA. + * Used in pre-bootstrap epoch. + */ +static __inline pt2_entry_t* +pmap_preboot_vtopte2(vm_offset_t va) +{ + pt1_entry_t *pte1p; + + /* Setup PT2 if needed. */ + pte1p = kern_pte1(va); + if (!pte1_is_valid(pte1_load(pte1p))) /* XXX - sections ?! */ + pmap_preboot_pt2_setup(va); + + return (pt2map_entry(va)); +} + +/* + * Pre-bootstrap epoch page(s) mapping(s). + */ +void +pmap_preboot_map_pages(vm_paddr_t pa, vm_offset_t va, u_int num) +{ + u_int i; + pt2_entry_t *pte2p; + + /* Map all the pages. */ + for (i = 0; i < num; i++) { + pte2p = pmap_preboot_vtopte2(va); + pte2_store(pte2p, PTE2_KRW(pa)); + va += PAGE_SIZE; + pa += PAGE_SIZE; + } +} + +/* + * Pre-bootstrap epoch virtual space alocator. + */ +vm_offset_t +pmap_preboot_reserve_pages(u_int num) +{ + u_int i; + vm_offset_t start, va; + pt2_entry_t *pte2p; + + /* Allocate virtual space. */ + start = va = virtual_avail; + virtual_avail += num * PAGE_SIZE; + + /* Zero the mapping. */ + for (i = 0; i < num; i++) { + pte2p = pmap_preboot_vtopte2(va); + pte2_store(pte2p, 0); + va += PAGE_SIZE; + } + + return (start); +} + +/* + * Pre-bootstrap epoch page(s) allocation and mapping(s). + */ +vm_offset_t +pmap_preboot_get_vpages(u_int num) +{ + vm_paddr_t pa; + vm_offset_t va; + + /* Allocate physical page(s). */ + pa = pmap_preboot_get_pages(num); + + /* Allocate virtual space. */ + va = virtual_avail; + virtual_avail += num * PAGE_SIZE; + + /* Map and zero all. */ + pmap_preboot_map_pages(pa, va, num); + bzero((void *)va, num * PAGE_SIZE); + + return (va); +} + +/* + * Pre-bootstrap epoch page mapping(s) with attributes. + */ +void +pmap_preboot_map_attr(vm_paddr_t pa, vm_offset_t va, vm_size_t size, int prot, + int attr) +{ + u_int num; + u_int l1_attr, l1_prot; + pt1_entry_t *pte1p; + pt2_entry_t *pte2p; + + l1_prot = ATTR_TO_L1(prot); + l1_attr = ATTR_TO_L1(attr); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jan 29 13:06:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBEF2A7117D; Fri, 29 Jan 2016 13:06:31 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94069105C; Fri, 29 Jan 2016 13:06:31 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0TD6U69000576; Fri, 29 Jan 2016 13:06:30 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TD6UoB000571; Fri, 29 Jan 2016 13:06:30 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201601291306.u0TD6UoB000571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 29 Jan 2016 13:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295038 - in head/sys: arm64/arm64 arm64/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 13:06:32 -0000 Author: wma Date: Fri Jan 29 13:06:30 2016 New Revision: 295038 URL: https://svnweb.freebsd.org/changeset/base/295038 Log: Framework for ARM64 instruction disassembler Provide an easy to use framework for ARM64 DDB disassembler. This commit does not contain full list of instruction opcodes. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb, andrew, cognet Differential revision: https://reviews.freebsd.org/D5114 Added: head/sys/arm64/arm64/disassem.c (contents, props changed) head/sys/arm64/include/disassem.h (contents, props changed) Modified: head/sys/arm64/arm64/db_disasm.c head/sys/arm64/include/armreg.h head/sys/conf/files.arm64 Modified: head/sys/arm64/arm64/db_disasm.c ============================================================================== --- head/sys/arm64/arm64/db_disasm.c Fri Jan 29 11:00:33 2016 (r295037) +++ head/sys/arm64/arm64/db_disasm.c Fri Jan 29 13:06:30 2016 (r295038) @@ -31,11 +31,40 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +#include + +static u_int db_disasm_read_word(vm_offset_t); +static void db_disasm_printaddr(vm_offset_t); + +/* Glue code to interface db_disasm to the generic ARM disassembler */ +static const struct disasm_interface db_disasm_interface = { + db_disasm_read_word, + db_disasm_printaddr, + db_printf +}; + +static u_int +db_disasm_read_word(vm_offset_t address) +{ + + return (db_get_value(address, INSN_SIZE, 0)); +} + +static void +db_disasm_printaddr(vm_offset_t address) +{ + + db_printsym((db_addr_t)address, DB_STGY_ANY); +} vm_offset_t db_disasm(vm_offset_t loc, bool altfmt) { - return 0; + + return (disasm(&db_disasm_interface, loc, altfmt)); } /* End of db_disasm.c */ Added: head/sys/arm64/arm64/disassem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/disassem.c Fri Jan 29 13:06:30 2016 (r295038) @@ -0,0 +1,330 @@ +/*- + * Copyright (c) 2016 Cavium + * All rights reserved. + * + * This software was developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include + +#include +#include +#include +#include + +#define ARM64_MAX_TOKEN_LEN 8 +#define ARM64_MAX_TOKEN_CNT 10 + +static const char *w_reg[] = { + "w0", "w1", "w2", "w3", "w4", "w5", "w6", "w7", + "w8", "w9", "w10", "w11", "w12", "w13", "w14", "w15", + "w16", "w17", "w18", "w19", "w20", "w21", "w22", "w23", + "w24", "w25", "w26", "w27", "w28", "w29", "w30", "wSP", +}; + +static const char *x_reg[] = { + "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", + "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", + "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", + "x24", "x25", "x26", "x27", "x28", "x29", "LR", "SP", +}; + +static const char *shift_2[] = { + "LSL", "LSR", "ASR", "RSV" +}; + +/* + * Structure representing single token (operand) inside instruction. + * name - name of operand + * pos - position within the instruction (in bits) + * len - operand length (in bits) + */ +struct arm64_insn_token { + char name[ARM64_MAX_TOKEN_LEN]; + int pos; + int len; +}; + +/* + * Define generic types for instruction printing. + */ +enum arm64_format_type { + TYPE_01, /* OP , , {, #} SF32/64 + OP , , #{, } SF32/64 */ +}; + +/* + * Structure representing single parsed instruction format. + * name - opcode name + * format - opcode format in a human-readable way + * type - syntax type for printing + * special_ops - special options passed to a printer (if any) + * mask - bitmask for instruction matching + * pattern - pattern to look for + * tokens - array of tokens (operands) inside instruction + */ +struct arm64_insn { + char* name; + char* format; + enum arm64_format_type type; + uint64_t special_ops; + uint32_t mask; + uint32_t pattern; + struct arm64_insn_token tokens[ARM64_MAX_TOKEN_CNT]; +}; + +/* + * Specify instruction opcode format in a human-readable way. Use notation + * obtained from ARM Architecture Reference Manual for ARMv8-A. + * + * Format string description: + * Each group must be separated by "|". Group made of 0/1 is used to + * generate mask and pattern for instruction matching. Groups containing + * an operand token (in format NAME(length_bits)) are used to retrieve any + * operand data from the instruction. Names here must be meaningful + * and match the one described in the Manual. + * + * Token description: + * SF - "0" represents 32-bit access, "1" represents 64-bit access + * SHIFT - type of shift (instruction dependent) + * IMM - immediate value + * Rx - register number + */ +static struct arm64_insn arm64_i[] = { + { "add", "SF(1)|0001011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", TYPE_01, 0 }, + { "mov", "SF(1)|001000100000000000000|RN(5)|RD(5)", TYPE_01, 0 }, + { "add", "SF(1)|0010001|SHIFT(2)|IMM(12)|RN(5)|RD(5)", TYPE_01, 0 }, + { NULL, NULL } +}; + +static void +arm64_disasm_generate_masks(struct arm64_insn *tab) +{ + uint32_t mask, val; + int a, i; + int len, ret; + int token = 0; + char *format; + int error; + + while (tab->name != NULL) { + mask = 0; + val = 0; + format = tab->format; + token = 0; + error = 0; + + /* + * For each entry analyze format strings from the + * left (i.e. from the MSB). + */ + a = (INSN_SIZE * NBBY) - 1; + while (*format != '\0' && (a >= 0)) { + switch(*format) { + case '0': + /* Bit is 0, add to mask and pattern */ + mask |= (1 << a); + a--; + format++; + break; + case '1': + /* Bit is 1, add to mask and pattern */ + mask |= (1 << a); + val |= (1 << a); + a--; + format++; + break; + case '|': + /* skip */ + format++; + break; + default: + /* Token found, copy the name */ + memset(tab->tokens[token].name, 0, + sizeof(tab->tokens[token].name)); + i = 0; + while (*format != '(') { + tab->tokens[token].name[i] = *format; + i++; + format++; + if (i >= ARM64_MAX_TOKEN_LEN) { + printf("ERROR: token too long in op %s\n", + tab->name); + error = 1; + break; + } + } + if (error != 0) + break; + + /* Read the length value */ + ret = sscanf(format, "(%d)", &len); + if (ret == 1) { + if (token >= ARM64_MAX_TOKEN_CNT) { + printf("ERROR: to many tokens in op %s\n", + tab->name); + error = 1; + break; + } + + a -= len; + tab->tokens[token].pos = a + 1; + tab->tokens[token].len = len; + token++; + } + + /* Skip to the end of the token */ + while (*format != 0 && *format != '|') + format++; + } + } + + /* Write mask and pattern to the instruction array */ + tab->mask = mask; + tab->pattern = val; + + /* + * If we got here, format string must be parsed and "a" + * should point to -1. If it's not, wrong number of bits + * in format string. Mark this as invalid and prevent + * from being matched. + */ + if (*format != 0 || (a != -1) || (error != 0)) { + tab->mask = 0; + tab->pattern = 0xffffffff; + printf("ERROR: skipping instruction op %s\n", + tab->name); + } + + tab++; + } +} + +static int +arm64_disasm_read_token(struct arm64_insn *insn, u_int opcode, + const char *token, int *val) +{ + int i; + + for (i = 0; i < ARM64_MAX_TOKEN_CNT; i++) { + if (strcmp(insn->tokens[i].name, token) == 0) { + *val = (opcode >> insn->tokens[i].pos & + ((1 << insn->tokens[i].len) - 1)); + return (0); + } + } + + return (EINVAL); +} + +static const char * +arm64_reg(int b64, int num) +{ + + if (b64 != 0) + return (x_reg[num]); + + return (w_reg[num]); +} + +vm_offset_t +disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) +{ + struct arm64_insn *i_ptr = arm64_i; + uint32_t insn; + int matchp; + int ret; + int shift, rm, rd, rn, imm, sf; + int rm_absent; + + /* Initialize defaults, all are 0 except SF indicating 64bit access */ + shift = rd = rm = rn = imm = 0; + sf = 1; + + matchp = 0; + insn = di->di_readword(loc); + while (i_ptr->name) { + /* If mask is 0 then the parser was not initialized yet */ + if ((i_ptr->mask != 0) && + ((insn & i_ptr->mask) == i_ptr->pattern)) { + matchp = 1; + break; + } + i_ptr++; + } + if (matchp == 0) + goto undefined; + + switch (i_ptr->type) { + case TYPE_01: + /* OP , , {, #} SF32/64 + OP , , #{, } SF32/64 */ + + /* Mandatory tokens */ + ret = arm64_disasm_read_token(i_ptr, insn, "SF", &sf); + ret |= arm64_disasm_read_token(i_ptr, insn, "RD", &rd); + ret |= arm64_disasm_read_token(i_ptr, insn, "RN", &rn); + if (ret != 0) { + printf("ERROR: Missing mandatory token for op %s type %d\n", + i_ptr->name, i_ptr->type); + goto undefined; + } + + /* Optional tokens */ + arm64_disasm_read_token(i_ptr, insn, "IMM", &imm); + arm64_disasm_read_token(i_ptr, insn, "SHIFT", &shift); + rm_absent = arm64_disasm_read_token(i_ptr, insn, "RM", &rm); + + di->di_printf("%s\t%s, %s", i_ptr->name, arm64_reg(sf, rd), + arm64_reg(sf, rn)); + + /* If RM is present use it, otherwise use immediate notation */ + if (rm_absent == 0) { + di->di_printf(", %s", arm64_reg(sf, rm)); + if (imm != 0) + di->di_printf(", %s #%d", shift_2[shift], imm); + } else { + if (imm != 0 || shift != 0) + di->di_printf(", #0x%x", imm); + if (shift != 0) + di->di_printf(" LSL #12"); + } + break; + default: + goto undefined; + } + + di->di_printf("\n"); + return(loc + INSN_SIZE); + +undefined: + di->di_printf("undefined\t%08x\n", insn); + return(loc + INSN_SIZE); +} + +/* Parse format strings at the very beginning */ +SYSINIT(arm64_disasm_generate_masks, SI_SUB_DDB_SERVICES, + SI_ORDER_FIRST, arm64_disasm_generate_masks, arm64_i); Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Fri Jan 29 11:00:33 2016 (r295037) +++ head/sys/arm64/include/armreg.h Fri Jan 29 13:06:30 2016 (r295038) @@ -33,6 +33,8 @@ #ifndef _MACHINE_ARMREG_H_ #define _MACHINE_ARMREG_H_ +#define INSN_SIZE 4 + #define READ_SPECIALREG(reg) \ ({ uint64_t val; \ __asm __volatile("mrs %0, " __STRING(reg) : "=&r" (val)); \ Added: head/sys/arm64/include/disassem.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/disassem.h Fri Jan 29 13:06:30 2016 (r295038) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2016 Cavium + * All rights reserved. + * + * This software was developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __DISASSEM_H_ +#define __DISASSEM_H_ + +struct disasm_interface { + u_int (*di_readword)(vm_offset_t); + void (*di_printaddr)(vm_offset_t); + int (*di_printf)(const char *, ...) __printflike(1, 2); +}; + +vm_offset_t disasm(const struct disasm_interface *, vm_offset_t, int); + +#endif /* __DISASSEM_H_ */ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Jan 29 11:00:33 2016 (r295037) +++ head/sys/conf/files.arm64 Fri Jan 29 13:06:30 2016 (r295038) @@ -20,6 +20,7 @@ arm64/arm64/db_disasm.c optional ddb arm64/arm64/db_interface.c optional ddb arm64/arm64/db_trace.c optional ddb arm64/arm64/debug_monitor.c optional kdb +arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard arm64/arm64/elf_machdep.c standard arm64/arm64/exception.S standard From owner-svn-src-head@freebsd.org Fri Jan 29 14:12:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16633A727C4; Fri, 29 Jan 2016 14:12:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D45EF1DB0; Fri, 29 Jan 2016 14:12:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0TECD8N019196; Fri, 29 Jan 2016 14:12:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TECDdp019186; Fri, 29 Jan 2016 14:12:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601291412.u0TECDdp019186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 29 Jan 2016 14:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295039 - in head: lib/libc/gen lib/libc/include lib/libc/sys sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 14:12:15 -0000 Author: kib Date: Fri Jan 29 14:12:12 2016 New Revision: 295039 URL: https://svnweb.freebsd.org/changeset/base/295039 Log: Add implementations of sendmmsg(3) and recvmmsg(3) functions which wraps sendmsg(2) and recvmsg(2) into batch send and receive operation. The goal of this implementation is only to provide API compatibility with Linux. The cancellation behaviour of the functions is not quite right, but due to relative rare use of cancellation it is considered acceptable comparing with the complexity of the correct implementation. If functions are reimplemented as syscalls, the fix would come almost trivial. The direct use of the syscall trampolines instead of libc wrappers for sendmsg(2) and recvmsg(2) is to avoid data loss on cancellation. Submitted by: Boris Astardzhiev Discussed with: jilles (cancellation behaviour) MFC after: 1 month Added: head/lib/libc/gen/recvmmsg.c (contents, props changed) head/lib/libc/gen/sendmmsg.c (contents, props changed) Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/include/namespace.h head/lib/libc/include/un-namespace.h head/lib/libc/sys/Symbol.map head/lib/libc/sys/recv.2 head/lib/libc/sys/send.2 head/sys/sys/socket.h Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Jan 29 13:06:30 2016 (r295038) +++ head/lib/libc/gen/Makefile.inc Fri Jan 29 14:12:12 2016 (r295039) @@ -99,11 +99,13 @@ SRCS+= __getosreldate.c \ raise.c \ readdir.c \ readpassphrase.c \ + recvmmsg.c \ rewinddir.c \ scandir.c \ seed48.c \ seekdir.c \ semctl.c \ + sendmmsg.c \ setdomainname.c \ sethostname.c \ setjmperr.c \ @@ -451,10 +453,12 @@ MLINKS+=rand48.3 _rand48.3 \ rand48.3 nrand48.3 \ rand48.3 seed48.3 \ rand48.3 srand48.3 +MLINKS+=recv.2 recvmmsg.2 MLINKS+=scandir.3 alphasort.3 MLINKS+=sem_open.3 sem_close.3 \ sem_open.3 sem_unlink.3 MLINKS+=sem_wait.3 sem_trywait.3 +MLINKS+=send.2 sendmmsg.2 MLINKS+=setjmp.3 _longjmp.3 \ setjmp.3 _setjmp.3 \ setjmp.3 longjmp.3 \ Added: head/lib/libc/gen/recvmmsg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/recvmmsg.c Fri Jan 29 14:12:12 2016 (r295039) @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2016 Boris Astardzhiev, Smartcom-Bulgaria AD + * 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(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(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 COPYRIGHT HOLDER(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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include "libc_private.h" + +ssize_t +recvmmsg(int s, struct mmsghdr *__restrict msgvec, size_t vlen, int flags, + const struct timespec *__restrict timeout) +{ + struct pollfd pfd[1]; + size_t i, rcvd; + ssize_t ret; + int res; + short ev; + + if (timeout != NULL) { + pfd[0].fd = s; + pfd[0].revents = 0; + pfd[0].events = ev = POLLIN | POLLRDNORM | POLLRDBAND | + POLLPRI; + res = ppoll(&pfd[0], 1, timeout, NULL); + if (res == -1 || res == 0) + return (res); + if (pfd[0].revents & POLLNVAL) { + errno = EBADF; + return (-1); + } + if ((pfd[0].revents & ev) == 0) { + errno = ETIMEDOUT; + return (-1); + } + } + + ret = __sys_recvmsg(s, &msgvec[0].msg_hdr, flags); + if (ret == -1) + return (ret); + + /* + * Do non-blocking receive for second and later messages if + * WAITFORONE is set. + */ + if (flags & MSG_WAITFORONE) + flags |= MSG_DONTWAIT; + + rcvd = 1; + for (i = rcvd; i < vlen; i++, rcvd++) { + ret = __sys_recvmsg(s, &msgvec[i].msg_hdr, flags); + if (ret == -1) { + /* We have received messages. Let caller know + * about the data received, socket + * error is returned on next + * invocation. + */ + return (rcvd); + } + + /* Save received bytes. */ + msgvec[i].msg_len = ret; + } + + return (rcvd); +} Added: head/lib/libc/gen/sendmmsg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/sendmmsg.c Fri Jan 29 14:12:12 2016 (r295039) @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016 Boris Astardzhiev, Smartcom-Bulgaria AD + * 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(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(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 COPYRIGHT HOLDER(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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "libc_private.h" + +ssize_t +sendmmsg(int s, struct mmsghdr *__restrict msgvec, size_t vlen, int flags) +{ + size_t i, sent; + ssize_t ret; + + sent = 0; + for (i = 0; i < vlen; i++, sent++) { + ret = __sys_sendmsg(s, &msgvec[i].msg_hdr, flags); + if (ret == -1) { + if (sent != 0) { + /* + * We have sent messages. Let caller + * know about the data sent, socket + * error is returned on next + * invocation. + */ + return (sent); + } + return (ret); + } + + /* Save sent bytes. */ + msgvec[i].msg_len = ret; + } + + return (sent); +} Modified: head/lib/libc/include/namespace.h ============================================================================== --- head/lib/libc/include/namespace.h Fri Jan 29 13:06:30 2016 (r295038) +++ head/lib/libc/include/namespace.h Fri Jan 29 14:12:12 2016 (r295039) @@ -208,6 +208,7 @@ #define readv _readv #define recvfrom _recvfrom #define recvmsg _recvmsg +#define recvmmsg _recvmmsg #define select _select #define sem_close _sem_close #define sem_destroy _sem_destroy @@ -220,6 +221,7 @@ #define sem_unlink _sem_unlink #define sem_wait _sem_wait #define sendmsg _sendmsg +#define sendmmsg _sendmmsg #define sendto _sendto #define setsockopt _setsockopt /*#define sigaction _sigaction*/ Modified: head/lib/libc/include/un-namespace.h ============================================================================== --- head/lib/libc/include/un-namespace.h Fri Jan 29 13:06:30 2016 (r295038) +++ head/lib/libc/include/un-namespace.h Fri Jan 29 14:12:12 2016 (r295039) @@ -189,6 +189,7 @@ #undef readv #undef recvfrom #undef recvmsg +#undef recvmmsg #undef select #undef sem_close #undef sem_destroy @@ -201,6 +202,7 @@ #undef sem_unlink #undef sem_wait #undef sendmsg +#undef sendmmsg #undef sendto #undef setsockopt #undef sigaction Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Fri Jan 29 13:06:30 2016 (r295038) +++ head/lib/libc/sys/Symbol.map Fri Jan 29 14:12:12 2016 (r295039) @@ -399,6 +399,8 @@ FBSD_1.4 { utimensat; numa_setaffinity; numa_getaffinity; + sendmmsg; + recvmmsg; }; FBSDprivate_1.0 { Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Fri Jan 29 13:06:30 2016 (r295038) +++ head/lib/libc/sys/recv.2 Fri Jan 29 14:12:12 2016 (r295039) @@ -28,14 +28,15 @@ .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd October 15, 2014 +.Dd January 29, 2016 .Dt RECV 2 .Os .Sh NAME .Nm recv , .Nm recvfrom , -.Nm recvmsg -.Nd receive a message from a socket +.Nm recvmsg , +.Nm recvmmsg +.Nd receive message(s) from a socket .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -47,11 +48,14 @@ .Fn recvfrom "int s" "void *buf" "size_t len" "int flags" "struct sockaddr * restrict from" "socklen_t * restrict fromlen" .Ft ssize_t .Fn recvmsg "int s" "struct msghdr *msg" "int flags" +.Ft ssize_t +.Fn recvmmsg "int s" "struct mmsghdr * restrict msgvec" "size_t vlen" "int flags" "const struct timespec * restrict timeout" .Sh DESCRIPTION The -.Fn recvfrom +.Fn recvfrom , +.Fn recvmsg , and -.Fn recvmsg +.Fn recvmmsg system calls are used to receive messages from a socket, and may be used to receive data on a socket whether or not @@ -84,8 +88,39 @@ null pointer passed as its .Fa from argument. .Pp -All three routines return the length of the message on successful -completion. +The +.Fn recvmmsg +function is used to receive multiple +messages at a call. +Their number is supplied by +.Fa vlen . +The messages are placed in the buffers described by +.Fa msgvec +vector, after reception. +The size of each received message is placed in the +.Fa msg_len +field of each element of the vector. +If +.Fa timeout +is NULL the call blocks until the data is available for each +supplied message buffer. +Otherwise it waits for data for the specified amount of time. +If the timeout expired and there is no data received, +a value 0 is returned. +The +.Xr ppoll 2 +system call is used to implement the timeout mechanism, +before first receive is performed. +.Pp +The +.Fn recv , +.Fn recvfrom +and +.Fn recvmsg +return the length of the message on successful +completion, whereas +.Fn recvmmsg +returns the number of received messages. If a message is too long to fit in the supplied buffer, excess bytes may be discarded depending on the type of socket the message is received from (see @@ -100,7 +135,9 @@ in which case the value .Va errno is set to .Er EAGAIN . -The receive calls normally return any data available, +The receive calls except +.Fn recvmmsg +normally return any data available, up to the requested amount, rather than waiting for receipt of the full amount requested; this behavior is affected by the socket-level options @@ -109,6 +146,9 @@ and .Dv SO_RCVTIMEO described in .Xr getsockopt 2 . +The +.Fn recvmmsg +function implements this behaviour for each message in the vector. .Pp The .Xr select 2 @@ -127,6 +167,10 @@ one or more of the values: .It Dv MSG_WAITALL Ta wait for full request or error .It Dv MSG_DONTWAIT Ta do not block .It Dv MSG_CMSG_CLOEXEC Ta set received fds close-on-exec +.It Dv MSG_WAITFORONE Ta do not block after receiving the first message +(only for +.Fn recvmmsg +) .El .Pp The @@ -158,6 +202,11 @@ is set to This flag is not available in strict .Tn ANSI or C99 compilation mode. +The +.Dv MSG_WAITFORONE +flag sets MSG_DONTWAIT after the first message has been received. +This flag is only relevant for +.Fn recvmmsg . .Pp The .Fn recvmsg @@ -290,9 +339,31 @@ control data were discarded due to lack for ancillary data. .Dv MSG_OOB is returned to indicate that expedited or out-of-band data were received. +.Pp +The +.Fn recvmmsg +system call uses the +.Fa mmsghdr +structure, defined as follows in the +.In sys/socket.h +header : +.Bd -literal +struct mmsghdr { + struct msghdr msg_hdr; /* message header */ + ssize_t msg_len; /* message length */ +}; +.Ed +.Pp +On data reception the +.Fa msg_len +field is updated to the length of the received message. .Sh RETURN VALUES -These calls return the number of bytes received, or -1 -if an error occurred. +These calls except +.Fn recvmmsg +return the number of bytes received. +.Fn recvmmsg +returns the number of messages received. +A value of -1 is returned if an error occurred. .Sh ERRORS The calls fail if: .Bl -tag -width Er @@ -347,3 +418,7 @@ The .Fn recv function appeared in .Bx 4.2 . +The +.Fn recvmmsg +function appeared in +.Fx 11.0 . Modified: head/lib/libc/sys/send.2 ============================================================================== --- head/lib/libc/sys/send.2 Fri Jan 29 13:06:30 2016 (r295038) +++ head/lib/libc/sys/send.2 Fri Jan 29 14:12:12 2016 (r295039) @@ -28,14 +28,15 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd February 5, 2009 +.Dd January 29, 2016 .Dt SEND 2 .Os .Sh NAME .Nm send , .Nm sendto , -.Nm sendmsg -.Nd send a message from a socket +.Nm sendmsg , +.Nm sendmmsg +.Nd send message(s) from a socket .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -47,25 +48,33 @@ .Fn sendto "int s" "const void *msg" "size_t len" "int flags" "const struct sockaddr *to" "socklen_t tolen" .Ft ssize_t .Fn sendmsg "int s" "const struct msghdr *msg" "int flags" +.Ft ssize_t +.Fn sendmmsg "int s" "struct mmsghdr * restrict msgvec" "size_t vlen" "int flags" .Sh DESCRIPTION The .Fn send -function, +and +.Fn sendmmsg +functions, and .Fn sendto and .Fn sendmsg system calls -are used to transmit a message to another socket. +are used to transmit one or more messages (with the +.Fn sendmmsg +call) to +another socket. The .Fn send function may be used only when the socket is in a .Em connected state, while -.Fn sendto -and +.Fn sendto , .Fn sendmsg +and +.Fn sendmmsg may be used at any time. .Pp The address of the target is given by @@ -81,6 +90,18 @@ underlying protocol, the error is returned, and the message is not transmitted. .Pp +The +.Fn sendmmsg +function sends multiple messages at a call. +They are given by the +.Fa msgvec +vector along with +.Fa vlen +specifying the vector size. +The number of octets sent per each message is placed in the +.Fa msg_len +field of each processed element of the vector after transmission. +.Pp No indication of failure to deliver is implicit in a .Fn send . Locally detected errors are indicated by a return value of -1. @@ -138,14 +159,27 @@ See .Xr recv 2 for a description of the .Fa msghdr +structure and the +.Fa mmsghdr structure. .Sh RETURN VALUES -The call returns the number of characters sent, or -1 -if an error occurred. +The +.Fn send , +.Fn sendto +and +.Fn sendmsg +calls +return the number of octets sent. +The +.Fn sendmmsg +call returns the number of messages sent. +If an error occurred a value of -1 is returned. .Sh ERRORS The .Fn send -function and +and +.Fn sendmmsg +functions and .Fn sendto and .Fn sendmsg @@ -215,6 +249,10 @@ The .Fn send function appeared in .Bx 4.2 . +The +.Fn sendmmsg +function appeared in +.Fx 11.0 . .Sh BUGS Because .Fn sendmsg Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Fri Jan 29 13:06:30 2016 (r295038) +++ head/sys/sys/socket.h Fri Jan 29 14:12:12 2016 (r295039) @@ -431,6 +431,7 @@ struct msghdr { #define MSG_NBIO 0x4000 /* FIONBIO mode, used by fifofs */ #define MSG_COMPAT 0x8000 /* used in sendit() */ #define MSG_CMSG_CLOEXEC 0x40000 /* make received fds close-on-exec */ +#define MSG_WAITFORONE 0x80000 /* for recvmmsg() */ #endif #ifdef _KERNEL #define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */ @@ -596,6 +597,14 @@ struct sf_hdtr { #define SFK_COMPAT 0x00000001 #define SF_READAHEAD(flags) ((flags) >> 16) #endif /* _KERNEL */ + +/* + * Sendmmsg/recvmmsg specific structure(s) + */ +struct mmsghdr { + struct msghdr msg_hdr; /* message header */ + ssize_t msg_len; /* message length */ +}; #endif /* __BSD_VISIBLE */ #ifndef _KERNEL @@ -618,12 +627,18 @@ int listen(int, int); ssize_t recv(int, void *, size_t, int); ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); ssize_t recvmsg(int, struct msghdr *, int); +#if __BSD_VISIBLE +struct timespec; +ssize_t recvmmsg(int, struct mmsghdr * __restrict, size_t, int, + const struct timespec * __restrict); +#endif ssize_t send(int, const void *, size_t, int); ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); ssize_t sendmsg(int, const struct msghdr *, int); #if __BSD_VISIBLE int sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int); +ssize_t sendmmsg(int, struct mmsghdr * __restrict, size_t, int); int setfib(int); #endif int setsockopt(int, int, int, const void *, socklen_t); From owner-svn-src-head@freebsd.org Fri Jan 29 15:12:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8665A72D20; Fri, 29 Jan 2016 15:12:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 81D231A24; Fri, 29 Jan 2016 15:12:33 +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 u0TFCWUd038613; Fri, 29 Jan 2016 15:12:32 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TFCVuc038598; Fri, 29 Jan 2016 15:12:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601291512.u0TFCVuc038598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 29 Jan 2016 15:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295041 - in head/sys: boot/fdt/dts/riscv boot/ficl/riscv cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/sys conf dev/hwpmc riscv/conf riscv/htif riscv/riscv sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 15:12:33 -0000 Author: br Date: Fri Jan 29 15:12:31 2016 New Revision: 295041 URL: https://svnweb.freebsd.org/changeset/base/295041 Log: Welcome the RISC-V 64-bit kernel. This is the final step required allowing to compile and to run RISC-V kernel and userland from HEAD. RISC-V is a completely open ISA that is freely available to academia and industry. Thanks to all the people involved! Special thanks to Andrew Turner, David Chisnall, Ed Maste, Konstantin Belousov, John Baldwin and Arun Thomas for their help. Thanks to Robert Watson for organizing this project. This project sponsored by UK Higher Education Innovation Fund (HEIF5) and DARPA CTSRD project at the University of Cambridge Computer Laboratory. FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv Reviewed by: andrew, emaste, kib Relnotes: Yes Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4982 Added: head/sys/boot/fdt/dts/riscv/ head/sys/boot/fdt/dts/riscv/spike.dts (contents, props changed) head/sys/boot/ficl/riscv/ head/sys/boot/ficl/riscv/sysdep.c (contents, props changed) head/sys/boot/ficl/riscv/sysdep.h (contents, props changed) head/sys/conf/Makefile.riscv (contents, props changed) head/sys/conf/files.riscv (contents, props changed) head/sys/conf/ldscript.riscv (contents, props changed) head/sys/conf/options.riscv (contents, props changed) head/sys/dev/hwpmc/hwpmc_riscv.h (contents, props changed) head/sys/riscv/conf/ head/sys/riscv/conf/DEFAULTS (contents, props changed) head/sys/riscv/conf/GENERIC (contents, props changed) head/sys/riscv/htif/ head/sys/riscv/htif/htif.c (contents, props changed) head/sys/riscv/htif/htif.h (contents, props changed) head/sys/riscv/htif/htif_block.c (contents, props changed) head/sys/riscv/htif/htif_console.c (contents, props changed) head/sys/riscv/riscv/ head/sys/riscv/riscv/autoconf.c (contents, props changed) head/sys/riscv/riscv/bcopy.c (contents, props changed) head/sys/riscv/riscv/bus_machdep.c (contents, props changed) head/sys/riscv/riscv/busdma_machdep.c (contents, props changed) head/sys/riscv/riscv/clock.c (contents, props changed) head/sys/riscv/riscv/copyinout.S (contents, props changed) head/sys/riscv/riscv/copystr.c (contents, props changed) head/sys/riscv/riscv/cpufunc_asm.S (contents, props changed) head/sys/riscv/riscv/devmap.c (contents, props changed) head/sys/riscv/riscv/dump_machdep.c (contents, props changed) head/sys/riscv/riscv/elf_machdep.c (contents, props changed) head/sys/riscv/riscv/exception.S (contents, props changed) head/sys/riscv/riscv/genassym.c (contents, props changed) head/sys/riscv/riscv/identcpu.c (contents, props changed) head/sys/riscv/riscv/in_cksum.c (contents, props changed) head/sys/riscv/riscv/intr_machdep.c (contents, props changed) head/sys/riscv/riscv/locore.S (contents, props changed) head/sys/riscv/riscv/machdep.c (contents, props changed) head/sys/riscv/riscv/mem.c (contents, props changed) head/sys/riscv/riscv/minidump_machdep.c (contents, props changed) head/sys/riscv/riscv/nexus.c (contents, props changed) head/sys/riscv/riscv/pmap.c (contents, props changed) head/sys/riscv/riscv/support.S (contents, props changed) head/sys/riscv/riscv/swtch.S (contents, props changed) head/sys/riscv/riscv/sys_machdep.c (contents, props changed) head/sys/riscv/riscv/timer.c (contents, props changed) head/sys/riscv/riscv/trap.c (contents, props changed) head/sys/riscv/riscv/uio_machdep.c (contents, props changed) head/sys/riscv/riscv/uma_machdep.c (contents, props changed) head/sys/riscv/riscv/vm_machdep.c (contents, props changed) Modified: head/sys/cddl/compat/opensolaris/sys/atomic.h head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h head/sys/conf/kern.mk head/sys/conf/kern.pre.mk head/sys/sys/cdefs.h head/sys/sys/kerneldump.h Added: head/sys/boot/fdt/dts/riscv/spike.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/riscv/spike.dts Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were 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. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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$ + */ + +/dts-v1/; + +/ { + model = "UC Berkeley Spike Simulator RV64I"; + compatible = "riscv,rv64i"; + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + aliases { + console0 = &console0; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x8000000>; /* 128MB at 0x0 */ + }; + + soc { + #address-cells = <2>; + #size-cells = <2>; + #interrupt-cells = <1>; + + compatible = "simple-bus"; + ranges; + + pic0: pic@0 { + compatible = "riscv,pic"; + interrupt-controller; + }; + + timer0: timer@0 { + compatible = "riscv,timer"; + interrupts = < 1 >; + interrupt-parent = < &pic0 >; + clock-frequency = < 1000000 >; + }; + + htif0: htif@0 { + compatible = "riscv,htif"; + interrupts = < 0 >; + interrupt-parent = < &pic0 >; + + console0: console@0 { + compatible = "htif,console"; + status = "okay"; + }; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "console0"; + stdout = "console0"; + }; +}; Added: head/sys/boot/ficl/riscv/sysdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/ficl/riscv/sysdep.c Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,99 @@ +/******************************************************************* +** s y s d e p . c +** Forth Inspired Command Language +** Author: John Sadler (john_sadler@alum.mit.edu) +** Created: 16 Oct 1997 +** Implementations of FICL external interface functions... +** +*******************************************************************/ + +/* $FreeBSD$ */ + +#ifdef TESTMAIN +#include +#include +#else +#include +#endif +#include "ficl.h" + +/* +******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith +*/ + +#if PORTABLE_LONGMULDIV == 0 +DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) +{ + DPUNS q; + u_int64_t qx; + + qx = (u_int64_t)x * (u_int64_t) y; + + q.hi = (u_int32_t)( qx >> 32 ); + q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + + return q; +} + +UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) +{ + UNSQR result; + u_int64_t qx, qh; + + qh = q.hi; + qx = (qh << 32) | q.lo; + + result.quot = qx / y; + result.rem = qx % y; + + return result; +} +#endif + +void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline) +{ + IGNORE(pVM); + + while(*msg != 0) + putchar(*(msg++)); + if (fNewline) + putchar('\n'); + + return; +} + +void *ficlMalloc (size_t size) +{ + return malloc(size); +} + +void *ficlRealloc (void *p, size_t size) +{ + return realloc(p, size); +} + +void ficlFree (void *p) +{ + free(p); +} + + +/* +** Stub function for dictionary access control - does nothing +** by default, user can redefine to guarantee exclusive dict +** access to a single thread for updates. All dict update code +** is guaranteed to be bracketed as follows: +** ficlLockDictionary(TRUE); +** +** ficlLockDictionary(FALSE); +** +** Returns zero if successful, nonzero if unable to acquire lock +** befor timeout (optional - could also block forever) +*/ +#if FICL_MULTITHREAD +int ficlLockDictionary(short fLock) +{ + IGNORE(fLock); + return 0; +} +#endif /* FICL_MULTITHREAD */ Added: head/sys/boot/ficl/riscv/sysdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/ficl/riscv/sysdep.h Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,411 @@ +/******************************************************************* + s y s d e p . h +** Forth Inspired Command Language +** Author: John Sadler (john_sadler@alum.mit.edu) +** Created: 16 Oct 1997 +** Ficl system dependent types and prototypes... +** +** Note: Ficl also depends on the use of "assert" when +** FICL_ROBUST is enabled. This may require some consideration +** in firmware systems since assert often +** assumes stderr/stdout. +** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $ +*******************************************************************/ +/* +** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu) +** All rights reserved. +** +** Get the latest Ficl release at http://ficl.sourceforge.net +** +** L I C E N S E and D I S C L A I M E R +** +** 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. +** +** I am interested in hearing from anyone who uses ficl. If you have +** a problem, a success story, a defect, an enhancement request, or +** if you would like to contribute to the ficl release, please send +** contact me by email at the address above. +** +** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $ +** $FreeBSD$ +*/ + +#if !defined (__SYSDEP_H__) +#define __SYSDEP_H__ + +#include + +#include /* size_t, NULL */ +#include +#include + +#if !defined IGNORE /* Macro to silence unused param warnings */ +#define IGNORE(x) (void)(x) +#endif + +/* +** TRUE and FALSE for C boolean operations, and +** portable 32 bit types for CELLs +** +*/ +#if !defined TRUE +#define TRUE 1 +#endif +#if !defined FALSE +#define FALSE 0 +#endif + + +/* +** System dependent data type declarations... +*/ +#if !defined INT32 +#define INT32 int +#endif + +#if !defined UNS32 +#define UNS32 unsigned int +#endif + +#if !defined UNS16 +#define UNS16 unsigned short +#endif + +#if !defined UNS8 +#define UNS8 unsigned char +#endif + +#if !defined NULL +#define NULL ((void *)0) +#endif + +/* +** FICL_UNS and FICL_INT must have the same size as a void* on +** the target system. A CELL is a union of void*, FICL_UNS, and +** FICL_INT. +** (11/2000: same for FICL_FLOAT) +*/ +#if !defined FICL_INT +#define FICL_INT long +#endif + +#if !defined FICL_UNS +#define FICL_UNS unsigned long +#endif + +#if !defined FICL_FLOAT +#define FICL_FLOAT float +#endif + +/* +** Ficl presently supports values of 32 and 64 for BITS_PER_CELL +*/ +#if !defined BITS_PER_CELL +#define BITS_PER_CELL 64 +#endif + +#if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64)) + Error! +#endif + +typedef struct +{ + FICL_UNS hi; + FICL_UNS lo; +} DPUNS; + +typedef struct +{ + FICL_UNS quot; + FICL_UNS rem; +} UNSQR; + +typedef struct +{ + FICL_INT hi; + FICL_INT lo; +} DPINT; + +typedef struct +{ + FICL_INT quot; + FICL_INT rem; +} INTQR; + + +/* +** B U I L D C O N T R O L S +*/ + +#if !defined (FICL_MINIMAL) +#define FICL_MINIMAL 0 +#endif +#if (FICL_MINIMAL) +#define FICL_WANT_SOFTWORDS 0 +#define FICL_WANT_FLOAT 0 +#define FICL_WANT_USER 0 +#define FICL_WANT_LOCALS 0 +#define FICL_WANT_DEBUGGER 0 +#define FICL_WANT_OOP 0 +#define FICL_PLATFORM_EXTEND 0 +#define FICL_MULTITHREAD 0 +#define FICL_ROBUST 0 +#define FICL_EXTENDED_PREFIX 0 +#endif + +/* +** FICL_PLATFORM_EXTEND +** Includes words defined in ficlCompilePlatform +*/ +#if !defined (FICL_PLATFORM_EXTEND) +#define FICL_PLATFORM_EXTEND 1 +#endif + +/* +** FICL_WANT_FLOAT +** Includes a floating point stack for the VM, and words to do float operations. +** Contributed by Guy Carver +*/ +#if !defined (FICL_WANT_FLOAT) +#define FICL_WANT_FLOAT 0 +#endif + +/* +** FICL_WANT_DEBUGGER +** Inludes a simple source level debugger +*/ +#if !defined (FICL_WANT_DEBUGGER) +#define FICL_WANT_DEBUGGER 1 +#endif + +/* +** User variables: per-instance variables bound to the VM. +** Kinda like thread-local storage. Could be implemented in a +** VM private dictionary, but I've chosen the lower overhead +** approach of an array of CELLs instead. +*/ +#if !defined FICL_WANT_USER +#define FICL_WANT_USER 1 +#endif + +#if !defined FICL_USER_CELLS +#define FICL_USER_CELLS 16 +#endif + +/* +** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and +** a private dictionary for local variable compilation. +*/ +#if !defined FICL_WANT_LOCALS +#define FICL_WANT_LOCALS 1 +#endif + +/* Max number of local variables per definition */ +#if !defined FICL_MAX_LOCALS +#define FICL_MAX_LOCALS 16 +#endif + +/* +** FICL_WANT_OOP +** Inludes object oriented programming support (in softwords) +** OOP support requires locals and user variables! +*/ +#if !(FICL_WANT_LOCALS) || !(FICL_WANT_USER) +#if !defined (FICL_WANT_OOP) +#define FICL_WANT_OOP 0 +#endif +#endif + +#if !defined (FICL_WANT_OOP) +#define FICL_WANT_OOP 1 +#endif + +/* +** FICL_WANT_SOFTWORDS +** Controls inclusion of all softwords in softcore.c +*/ +#if !defined (FICL_WANT_SOFTWORDS) +#define FICL_WANT_SOFTWORDS 1 +#endif + +/* +** FICL_MULTITHREAD enables dictionary mutual exclusion +** wia the ficlLockDictionary system dependent function. +** Note: this implementation is experimental and poorly +** tested. Further, it's unnecessary unless you really +** intend to have multiple SESSIONS (poor choice of name +** on my part) - that is, threads that modify the dictionary +** at the same time. +*/ +#if !defined FICL_MULTITHREAD +#define FICL_MULTITHREAD 0 +#endif + +/* +** PORTABLE_LONGMULDIV causes ficlLongMul and ficlLongDiv to be +** defined in C in sysdep.c. Use this if you cannot easily +** generate an inline asm definition +*/ +#if !defined (PORTABLE_LONGMULDIV) +#define PORTABLE_LONGMULDIV 0 +#endif + +/* +** INLINE_INNER_LOOP causes the inner interpreter to be inline code +** instead of a function call. This is mainly because MS VC++ 5 +** chokes with an internal compiler error on the function version. +** in release mode. Sheesh. +*/ +#if !defined INLINE_INNER_LOOP +#if defined _DEBUG +#define INLINE_INNER_LOOP 0 +#else +#define INLINE_INNER_LOOP 1 +#endif +#endif + +/* +** FICL_ROBUST enables bounds checking of stacks and the dictionary. +** This will detect stack over and underflows and dictionary overflows. +** Any exceptional condition will result in an assertion failure. +** (As generated by the ANSI assert macro) +** FICL_ROBUST == 1 --> stack checking in the outer interpreter +** FICL_ROBUST == 2 also enables checking in many primitives +*/ + +#if !defined FICL_ROBUST +#define FICL_ROBUST 2 +#endif + +/* +** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of +** a new virtual machine's stacks, unless overridden at +** create time. +*/ +#if !defined FICL_DEFAULT_STACK +#define FICL_DEFAULT_STACK 128 +#endif + +/* +** FICL_DEFAULT_DICT specifies the number of CELLs to allocate +** for the system dictionary by default. The value +** can be overridden at startup time as well. +** FICL_DEFAULT_ENV specifies the number of cells to allot +** for the environment-query dictionary. +*/ +#if !defined FICL_DEFAULT_DICT +#define FICL_DEFAULT_DICT 12288 +#endif + +#if !defined FICL_DEFAULT_ENV +#define FICL_DEFAULT_ENV 260 +#endif + +/* +** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in +** the dictionary search order. See Forth DPANS sec 16.3.3 +** (file://dpans16.htm#16.3.3) +*/ +#if !defined FICL_DEFAULT_VOCS +#define FICL_DEFAULT_VOCS 16 +#endif + +/* +** FICL_MAX_PARSE_STEPS controls the size of an array in the FICL_SYSTEM structure +** that stores pointers to parser extension functions. I would never expect to have +** more than 8 of these, so that's the default limit. Too many of these functions +** will probably exact a nasty performance penalty. +*/ +#if !defined FICL_MAX_PARSE_STEPS +#define FICL_MAX_PARSE_STEPS 8 +#endif + +/* +** FICL_EXTENDED_PREFIX enables a bunch of extra prefixes in prefix.c and prefix.fr (if +** included as part of softcore.c) +*/ +#if !defined FICL_EXTENDED_PREFIX +#define FICL_EXTENDED_PREFIX 0 +#endif + +/* +** FICL_ALIGN is the power of two to which the dictionary +** pointer address must be aligned. This value is usually +** either 1 or 2, depending on the memory architecture +** of the target system; 2 is safe on any 16 or 32 bit +** machine. 3 would be appropriate for a 64 bit machine. +*/ +#if !defined FICL_ALIGN +#define FICL_ALIGN 3 +#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1) +#endif + +/* +** System dependent routines -- +** edit the implementations in sysdep.c to be compatible +** with your runtime environment... +** ficlTextOut sends a NULL terminated string to the +** default output device - used for system error messages +** ficlMalloc and ficlFree have the same semantics as malloc and free +** in standard C +** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned +** product +** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient +** and remainder +*/ +struct vm; +void ficlTextOut(struct vm *pVM, char *msg, int fNewline); +void *ficlMalloc (size_t size); +void ficlFree (void *p); +void *ficlRealloc(void *p, size_t size); +/* +** Stub function for dictionary access control - does nothing +** by default, user can redefine to guarantee exclusive dict +** access to a single thread for updates. All dict update code +** must be bracketed as follows: +** ficlLockDictionary(TRUE); +** +** ficlLockDictionary(FALSE); +** +** Returns zero if successful, nonzero if unable to acquire lock +** before timeout (optional - could also block forever) +** +** NOTE: this function must be implemented with lock counting +** semantics: nested calls must behave properly. +*/ +#if FICL_MULTITHREAD +int ficlLockDictionary(short fLock); +#else +#define ficlLockDictionary(x) 0 /* ignore */ +#endif + +/* +** 64 bit integer math support routines: multiply two UNS32s +** to get a 64 bit product, & divide the product by an UNS32 +** to get an UNS32 quotient and remainder. Much easier in asm +** on a 32 bit CPU than in C, which usually doesn't support +** the double length result (but it should). +*/ +DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y); +UNSQR ficlLongDiv(DPUNS q, FICL_UNS y); + +#endif /*__SYSDEP_H__*/ Modified: head/sys/cddl/compat/opensolaris/sys/atomic.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/atomic.h Fri Jan 29 14:52:54 2016 (r295040) +++ head/sys/cddl/compat/opensolaris/sys/atomic.h Fri Jan 29 15:12:31 2016 (r295041) @@ -51,7 +51,7 @@ extern uint8_t atomic_or_8_nv(volatile u extern void membar_producer(void); #if defined(__sparc64__) || defined(__powerpc__) || defined(__arm__) || \ - defined(__mips__) || defined(__aarch64__) + defined(__mips__) || defined(__aarch64__) || defined(__riscv__) extern void atomic_or_8(volatile uint8_t *target, uint8_t value); #else static __inline void Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Fri Jan 29 14:52:54 2016 (r295040) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Fri Jan 29 15:12:31 2016 (r295041) @@ -388,6 +388,48 @@ extern "C" { #define _DONT_USE_1275_GENERIC_NAMES #define _HAVE_CPUID_INSN +#elif defined(__riscv__) + +/* + * Define the appropriate "processor characteristics" + */ +#define _STACK_GROWS_DOWNWARD +#define _LONG_LONG_LTOH +#define _BIT_FIELDS_LTOH +#define _IEEE_754 +#define _CHAR_IS_UNSIGNED +#define _BOOL_ALIGNMENT 1 +#define _CHAR_ALIGNMENT 1 +#define _SHORT_ALIGNMENT 2 +#define _INT_ALIGNMENT 4 +#define _FLOAT_ALIGNMENT 4 +#define _FLOAT_COMPLEX_ALIGNMENT 4 +#define _LONG_ALIGNMENT 8 +#define _LONG_LONG_ALIGNMENT 8 +#define _DOUBLE_ALIGNMENT 8 +#define _DOUBLE_COMPLEX_ALIGNMENT 8 +#define _LONG_DOUBLE_ALIGNMENT 16 +#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 16 +#define _POINTER_ALIGNMENT 8 +#define _MAX_ALIGNMENT 16 +#define _ALIGNMENT_REQUIRED 1 + +#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT + +/* + * Define the appropriate "implementation choices" + */ +#if !defined(_LP64) +#define _LP64 +#endif +#define _SUNOS_VTOC_16 +#define _DMA_USES_PHYSADDR +#define _FIRMWARE_NEEDS_FDISK +#define _PSM_MODULES +#define _RTC_CONFIG +#define _DONT_USE_1275_GENERIC_NAMES +#define _HAVE_CPUID_INSN + #elif defined(__arm__) /* Added: head/sys/conf/Makefile.riscv ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/Makefile.riscv Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,49 @@ +# Makefile.riscv -- with config changes. +# Copyright 1990 W. Jolitz +# from: @(#)Makefile.i386 7.1 5/10/91 +# from FreeBSD: src/sys/conf/Makefile.i386,v 1.255 2002/02/20 23:35:49 +# $FreeBSD$ +# +# Makefile for FreeBSD +# +# RISCVTODO: copy pasted from aarch64, needs to be +# constructed from a machine description: +# config machineid +# Most changes should be made in the machine description +# /sys/riscv/conf/``machineid'' +# after which you should do +# config machineid +# Generic makefile changes should be made in +# /sys/conf/Makefile.riscv +# after which config should be rerun for all machines. +# + +# Which version of config(8) is required. +%VERSREQ= 600012 + +.if !defined(S) +S= ../../.. +.endif +.include "$S/conf/kern.pre.mk" + +INCLUDES+= -I$S/contrib/libfdt + +.if !empty(DDB_ENABLED) +CFLAGS += -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer +.endif + +%BEFORE_DEPEND + +%OBJS + +%FILES.c + +%FILES.s + +%FILES.m + +%CLEAN + +%RULES + +.include "$S/conf/kern.post.mk" Added: head/sys/conf/files.riscv ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/files.riscv Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,44 @@ +# $FreeBSD$ +crypto/blowfish/bf_enc.c optional crypto | ipsec +crypto/des/des_enc.c optional crypto | ipsec | netsmb +kern/kern_clocksource.c standard +kern/subr_dummy_vdso_tc.c standard +libkern/bcmp.c standard +libkern/ffs.c standard +libkern/ffsl.c standard +libkern/fls.c standard +libkern/flsl.c standard +libkern/flsll.c standard +libkern/memmove.c standard +libkern/memset.c standard +riscv/htif/htif.c standard +riscv/htif/htif_block.c standard +riscv/htif/htif_console.c standard +riscv/riscv/autoconf.c standard +riscv/riscv/bcopy.c standard +riscv/riscv/bus_machdep.c standard +riscv/riscv/busdma_machdep.c standard +riscv/riscv/clock.c standard +riscv/riscv/copyinout.S standard +riscv/riscv/copystr.c standard +riscv/riscv/cpufunc_asm.S standard +riscv/riscv/devmap.c standard +riscv/riscv/dump_machdep.c standard +riscv/riscv/elf_machdep.c standard +riscv/riscv/intr_machdep.c standard +riscv/riscv/in_cksum.c optional inet | inet6 +riscv/riscv/identcpu.c standard +riscv/riscv/locore.S standard no-obj +riscv/riscv/minidump_machdep.c standard +riscv/riscv/machdep.c standard +riscv/riscv/mem.c standard +riscv/riscv/nexus.c standard +riscv/riscv/pmap.c standard +riscv/riscv/sys_machdep.c standard +riscv/riscv/support.S standard +riscv/riscv/swtch.S standard +riscv/riscv/trap.c standard +riscv/riscv/timer.c standard +riscv/riscv/uio_machdep.c standard +riscv/riscv/uma_machdep.c standard +riscv/riscv/vm_machdep.c standard Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri Jan 29 14:52:54 2016 (r295040) +++ head/sys/conf/kern.mk Fri Jan 29 15:12:31 2016 (r295041) @@ -104,6 +104,10 @@ CFLAGS += -mgeneral-regs-only CFLAGS += -ffixed-x18 .endif +.if ${MACHINE_CPUARCH} == "riscv" +INLINE_LIMIT?= 8000 +.endif + # # For sparc64 we want the medany code model so modules may be located # anywhere in the 64-bit address space. We also tell GCC to use floating Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Jan 29 14:52:54 2016 (r295040) +++ head/sys/conf/kern.pre.mk Fri Jan 29 15:12:31 2016 (r295041) @@ -252,6 +252,7 @@ EMBEDFS_FORMAT.mips?= elf32-tradbigmips EMBEDFS_FORMAT.mipsel?= elf32-tradlittlemips EMBEDFS_FORMAT.mips64?= elf64-tradbigmips EMBEDFS_FORMAT.mips64el?= elf64-tradlittlemips +EMBEDFS_FORMAT.riscv?= elf64-littleriscv .endif # Detect kernel config options that force stack frames to be turned on. Added: head/sys/conf/ldscript.riscv ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.riscv Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,136 @@ +/* $FreeBSD$ */ +OUTPUT_ARCH(riscv) +ENTRY(_start) + +SEARCH_DIR(/usr/lib); +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = kernbase + 0x100; + .text : AT(ADDR(.text) - kernbase) + { + *(.text) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0x9090 + _etext = .; + PROVIDE (etext = .); + .fini : { *(.fini) } =0x9090 + .rodata : { *(.rodata) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.text : + { *(.rel.text) *(.rel.gnu.linkonce.t*) } + .rela.text : + { *(.rela.text) *(.rela.gnu.linkonce.t*) } + .rel.data : + { *(.rel.data) *(.rel.gnu.linkonce.d*) } + .rela.data : + { *(.rela.data) *(.rela.gnu.linkonce.d*) } + .rel.rodata : + { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } + .rela.rodata : + { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : { *(.init) } =0x9090 + .plt : { *(.plt) } + + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + . = ALIGN(0x1000) + (. & (0x1000 - 1)) ; + .data : + { + *(.data) + *(.gnu.linkonce.d*) + CONSTRUCTORS + } + .data1 : { *(.data1) } + . = ALIGN(32 / 8); + _start_ctors = .; + PROVIDE (start_ctors = .); + .ctors : + { + *(.ctors) + } + _stop_ctors = .; + PROVIDE (stop_ctors = .); + .dtors : + { + *(.dtors) + } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + . = ALIGN(8); + .sdata : { *(.sdata) } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : { *(.sbss) *(.scommon) } + .bss : + { + *(.dynbss) + *(.bss) + *(COMMON) + } + . = ALIGN(8); + _end = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} Added: head/sys/conf/options.riscv ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/options.riscv Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +RISCV opt_global.h +VFP opt_global.h Added: head/sys/dev/hwpmc/hwpmc_riscv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hwpmc/hwpmc_riscv.h Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * This software was developed by the University of Cambridge Computer + * Laboratory with support from ARM Ltd. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_HWPMC_RISCV_H_ +#define _DEV_HWPMC_RISCV_H_ + +#define RISCV_PMC_CAPS (PMC_CAP_INTERRUPT | PMC_CAP_USER | \ + PMC_CAP_SYSTEM | PMC_CAP_EDGE | \ + PMC_CAP_THRESHOLD | PMC_CAP_READ | \ + PMC_CAP_WRITE | PMC_CAP_INVERT | \ + PMC_CAP_QUALIFIER) + +#define RISCV_RELOAD_COUNT_TO_PERFCTR_VALUE(R) (-(R)) +#define RISCV_PERFCTR_VALUE_TO_RELOAD_COUNT(P) (-(P)) +#define EVENT_ID_MASK 0xFF + +#ifdef _KERNEL +/* MD extension for 'struct pmc' */ +struct pmc_md_riscv_pmc { + uint32_t pm_riscv_evsel; +}; +#endif /* _KERNEL */ +#endif /* _DEV_HWPMC_RISCV_H_ */ Added: head/sys/riscv/conf/DEFAULTS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/conf/DEFAULTS Fri Jan 29 15:12:31 2016 (r295041) @@ -0,0 +1,13 @@ +# +# DEFAULTS -- Default kernel configuration file for FreeBSD/RISC-V *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jan 29 16:01:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C93A3A70E1D; Fri, 29 Jan 2016 16:01:38 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A8B7144B; Fri, 29 Jan 2016 16:01:38 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0TG1bkU051494; Fri, 29 Jan 2016 16:01:37 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TG1bTe051489; Fri, 29 Jan 2016 16:01:37 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601291601.u0TG1bTe051489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 29 Jan 2016 16:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295042 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 16:01:38 -0000 Author: skra Date: Fri Jan 29 16:01:37 2016 New Revision: 295042 URL: https://svnweb.freebsd.org/changeset/base/295042 Log: Use kernel_pmap directly instead of pmap_kernel(). The kernel_pmap is already used for __ARM_ARCH >= 6 and so even for __ARM_ARCH < 6 on some common places. Modified: head/sys/arm/arm/db_interface.c head/sys/arm/arm/machdep.c head/sys/arm/arm/pmap.c head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/db_interface.c ============================================================================== --- head/sys/arm/arm/db_interface.c Fri Jan 29 15:12:31 2016 (r295041) +++ head/sys/arm/arm/db_interface.c Fri Jan 29 16:01:37 2016 (r295042) @@ -170,7 +170,7 @@ db_validate_address(vm_offset_t addr) addr >= VM_MIN_KERNEL_ADDRESS #endif ) - pmap = pmap_kernel(); + pmap = kernel_pmap; else pmap = p->p_vmspace->vm_map.pmap; Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Jan 29 15:12:31 2016 (r295041) +++ head/sys/arm/arm/machdep.c Fri Jan 29 16:01:37 2016 (r295042) @@ -455,7 +455,7 @@ cpu_startup(void *dummy) vm_pager_bufferinit(); pcb->pcb_regs.sf_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; - pmap_set_pcb_pagedir(pmap_kernel(), pcb); + pmap_set_pcb_pagedir(kernel_pmap, pcb); #if __ARM_ARCH < 6 vector_page_setprot(VM_PROT_READ); pmap_postinit(); Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri Jan 29 15:12:31 2016 (r295041) +++ head/sys/arm/arm/pmap.c Fri Jan 29 16:01:37 2016 (r295042) @@ -394,7 +394,7 @@ int pmap_needs_pte_sync; #define PMAP_SHPGPERPROC 200 #endif -#define pmap_is_current(pm) ((pm) == pmap_kernel() || \ +#define pmap_is_current(pm) ((pm) == kernel_pmap || \ curproc->p_vmspace->vm_map.pmap == (pm)) static uma_zone_t pvzone = NULL; uma_zone_t l2zone; @@ -437,10 +437,10 @@ pmap_init_l1(struct l1_ttable *l1, pd_en /* * Copy the kernel's L1 entries to each new L1. */ - if (l1pt != pmap_kernel()->pm_l1->l1_kva) - memcpy(l1pt, pmap_kernel()->pm_l1->l1_kva, L1_TABLE_SIZE); + if (l1pt != kernel_pmap->pm_l1->l1_kva) + memcpy(l1pt, kernel_pmap->pm_l1->l1_kva, L1_TABLE_SIZE); - if ((l1->l1_physaddr = pmap_extract(pmap_kernel(), (vm_offset_t)l1pt)) == 0) + if ((l1->l1_physaddr = pmap_extract(kernel_pmap, (vm_offset_t)l1pt)) == 0) panic("pmap_init_l1: can't get PA of L1 at %p", l1pt); SLIST_INSERT_HEAD(&l1_list, l1, l1_link); TAILQ_INSERT_TAIL(&l1_lru_list, l1, l1_lru); @@ -932,7 +932,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 * to a performance win over time as we don't need to continually * alloc/free. */ - if (l2b->l2b_occupancy > 0 || pm == pmap_kernel()) + if (l2b->l2b_occupancy > 0 || pm == kernel_pmap) return; /* @@ -1002,7 +1002,7 @@ pmap_l2ptp_ctor(void *mem, int size, voi * page tables, we simply fix up the cache-mode here if it's not * correct. */ - l2b = pmap_get_l2_bucket(pmap_kernel(), va); + l2b = pmap_get_l2_bucket(kernel_pmap, va); ptep = &l2b->l2b_kva[l2pte_index(va)]; pte = *ptep; @@ -1077,9 +1077,9 @@ pmap_idcache_wbinv_range(pmap_t pm, vm_o vm_size_t rest; CTR4(KTR_PMAP, "pmap_dcache_wbinv_range: pmap %p is_kernel %d va 0x%08x" - " len 0x%x ", pm, pm == pmap_kernel(), va, len); + " len 0x%x ", pm, pm == kernel_pmap, va, len); - if (pmap_is_current(pm) || pm == pmap_kernel()) { + if (pmap_is_current(pm) || pm == kernel_pmap) { rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); while (len > 0) { if (pmap_has_valid_mapping(pm, va)) { @@ -1100,7 +1100,7 @@ pmap_dcache_wb_range(pmap_t pm, vm_offse vm_size_t rest; CTR4(KTR_PMAP, "pmap_dcache_wb_range: pmap %p is_kernel %d va 0x%08x " - "len 0x%x ", pm, pm == pmap_kernel(), va, len); + "len 0x%x ", pm, pm == kernel_pmap, va, len); CTR2(KTR_PMAP, " do_inv %d rd_only %d", do_inv, rd_only); if (pmap_is_current(pm)) { @@ -1230,13 +1230,13 @@ pmap_fix_cache(struct vm_page *pg, pmap_ TAILQ_FOREACH(pv, &pg->md.pv_list, pv_list) { /* generate a count of the pv_entry uses */ if (pv->pv_flags & PVF_WRITE) { - if (pv->pv_pmap == pmap_kernel()) + if (pv->pv_pmap == kernel_pmap) kwritable++; else if (pv->pv_pmap == pm) uwritable++; writable++; } - if (pv->pv_pmap == pmap_kernel()) + if (pv->pv_pmap == kernel_pmap) kentries++; else { if (pv->pv_pmap == pm) @@ -1248,19 +1248,19 @@ pmap_fix_cache(struct vm_page *pg, pmap_ * check if the user duplicate mapping has * been removed. */ - if ((pm != pmap_kernel()) && (((uentries > 1) && uwritable) || + if ((pm != kernel_pmap) && (((uentries > 1) && uwritable) || (uwritable > 1))) pmwc = 1; TAILQ_FOREACH(pv, &pg->md.pv_list, pv_list) { /* check for user uncachable conditions - order is important */ - if (pm != pmap_kernel() && - (pv->pv_pmap == pm || pv->pv_pmap == pmap_kernel())) { + if (pm != kernel_pmap && + (pv->pv_pmap == pm || pv->pv_pmap == kernel_pmap)) { if ((uentries > 1 && uwritable) || uwritable > 1) { /* user duplicate mapping */ - if (pv->pv_pmap != pmap_kernel()) + if (pv->pv_pmap != kernel_pmap) pv->pv_flags |= PVF_MWC; if (!(pv->pv_flags & PVF_NC)) { @@ -1279,7 +1279,7 @@ pmap_fix_cache(struct vm_page *pg, pmap_ if ((kwritable && (entries || kentries > 1)) || (kwritable > 1) || ((kwritable != writable) && kentries && - (pv->pv_pmap == pmap_kernel() || + (pv->pv_pmap == kernel_pmap || (pv->pv_flags & PVF_WRITE) || (pv->pv_flags & PVF_MWC)))) { @@ -1291,7 +1291,7 @@ pmap_fix_cache(struct vm_page *pg, pmap_ } /* kernel and user are cachable */ - if ((pm == pmap_kernel()) && !(pv->pv_flags & PVF_MWC) && + if ((pm == kernel_pmap) && !(pv->pv_flags & PVF_MWC) && (pv->pv_flags & PVF_NC)) { pv->pv_flags &= ~PVF_NC; @@ -1300,8 +1300,8 @@ pmap_fix_cache(struct vm_page *pg, pmap_ continue; } /* user is no longer sharable and writable */ - if (pm != pmap_kernel() && - (pv->pv_pmap == pm || pv->pv_pmap == pmap_kernel()) && + if (pm != kernel_pmap && + (pv->pv_pmap == pm || pv->pv_pmap == kernel_pmap) && !pmwc && (pv->pv_flags & PVF_NC)) { pv->pv_flags &= ~(PVF_NC | PVF_MWC); @@ -1565,7 +1565,7 @@ vector_page_setprot(int prot) struct l2_bucket *l2b; pt_entry_t *ptep; - l2b = pmap_get_l2_bucket(pmap_kernel(), vector_page); + l2b = pmap_get_l2_bucket(kernel_pmap, vector_page); ptep = &l2b->l2b_kva[l2pte_index(vector_page)]; @@ -1603,7 +1603,7 @@ pmap_nuke_pv(struct vm_page *pg, pmap_t pg->md.pvh_attrs &= ~PVF_REF; else vm_page_aflag_set(pg, PGA_REFERENCED); - if ((pve->pv_flags & PVF_NC) && ((pm == pmap_kernel()) || + if ((pve->pv_flags & PVF_NC) && ((pm == kernel_pmap) || (pve->pv_flags & PVF_WRITE) || !(pve->pv_flags & PVF_MWC))) pmap_fix_cache(pg, pm, 0); else if (pve->pv_flags & PVF_WRITE) { @@ -1972,7 +1972,7 @@ pmap_postinit(void) pl1pt = (pd_entry_t *)va; while (va < eva) { - l2b = pmap_get_l2_bucket(pmap_kernel(), va); + l2b = pmap_get_l2_bucket(kernel_pmap, va); ptep = &l2b->l2b_kva[l2pte_index(va)]; pte = *ptep; pte = (pte & ~L2_S_CACHE_MASK) | pte_l2_s_cache_mode_pt; @@ -2122,7 +2122,7 @@ pmap_alloc_specials(vm_offset_t *availp, struct l2_bucket *l2b; if (ptep) { - l2b = pmap_get_l2_bucket(pmap_kernel(), va); + l2b = pmap_get_l2_bucket(kernel_pmap, va); if (l2b == NULL) panic("pmap_alloc_specials: no l2b for 0x%x", va); @@ -2381,7 +2381,7 @@ pmap_grow_map(vm_offset_t va, pt_entry_t if (pap) *pap = pa; - l2b = pmap_get_l2_bucket(pmap_kernel(), va); + l2b = pmap_get_l2_bucket(kernel_pmap, va); ptep = &l2b->l2b_kva[l2pte_index(va)]; *ptep = L2_S_PROTO | pa | cache_mode | @@ -2494,7 +2494,7 @@ pmap_grow_l2_bucket(pmap_t pm, vm_offset void pmap_growkernel(vm_offset_t addr) { - pmap_t kpm = pmap_kernel(); + pmap_t kpm = kernel_pmap; if (addr <= pmap_curmaxkvaddr) return; /* we are OK */ @@ -2654,9 +2654,9 @@ pmap_kenter_internal(vm_offset_t va, vm_ (uint32_t) va, (uint32_t) pa)); - l2b = pmap_get_l2_bucket(pmap_kernel(), va); + l2b = pmap_get_l2_bucket(kernel_pmap, va); if (l2b == NULL) - l2b = pmap_grow_l2_bucket(pmap_kernel(), va); + l2b = pmap_grow_l2_bucket(kernel_pmap, va); KASSERT(l2b != NULL, ("No L2 Bucket")); pte = &l2b->l2b_kva[l2pte_index(va)]; opte = *pte; @@ -2690,11 +2690,11 @@ pmap_kenter_internal(vm_offset_t va, vm_ if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva != 0) { if ((pve = pmap_get_pv_entry()) == NULL) panic("pmap_kenter_internal: no pv entries"); - PMAP_LOCK(pmap_kernel()); - pmap_enter_pv(m, pve, pmap_kernel(), va, + PMAP_LOCK(kernel_pmap); + pmap_enter_pv(m, pve, kernel_pmap, va, PVF_WRITE | PVF_UNMAN); - pmap_fix_cache(m, pmap_kernel(), va); - PMAP_UNLOCK(pmap_kernel()); + pmap_fix_cache(m, kernel_pmap, va); + PMAP_UNLOCK(kernel_pmap); } else { m->md.pv_kva = va; } @@ -2758,7 +2758,7 @@ pmap_kenter_user(vm_offset_t va, vm_padd * at the first use of the new address, or bad things will happen, * as we use one of these addresses in the exception handlers. */ - pmap_fault_fixup(pmap_kernel(), va, VM_PROT_READ|VM_PROT_WRITE, 1); + pmap_fault_fixup(kernel_pmap, va, VM_PROT_READ|VM_PROT_WRITE, 1); } vm_paddr_t @@ -2780,7 +2780,7 @@ pmap_kremove(vm_offset_t va) vm_page_t m; vm_offset_t pa; - l2b = pmap_get_l2_bucket(pmap_kernel(), va); + l2b = pmap_get_l2_bucket(kernel_pmap, va); if (!l2b) return; KASSERT(l2b != NULL, ("No L2 Bucket")); @@ -2796,11 +2796,11 @@ pmap_kremove(vm_offset_t va) * before the pvzone is initialized. */ rw_wlock(&pvh_global_lock); - PMAP_LOCK(pmap_kernel()); + PMAP_LOCK(kernel_pmap); if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa)) && - (pve = pmap_remove_pv(m, pmap_kernel(), va))) + (pve = pmap_remove_pv(m, kernel_pmap, va))) pmap_free_pv_entry(pve); - PMAP_UNLOCK(pmap_kernel()); + PMAP_UNLOCK(kernel_pmap); rw_wunlock(&pvh_global_lock); va = va & ~PAGE_MASK; cpu_dcache_wbinv_range(va, PAGE_SIZE); @@ -3027,7 +3027,7 @@ pmap_remove_all(vm_page_t m) curpm = vmspace_pmap(curproc->p_vmspace); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { if (flush == FALSE && (pv->pv_pmap == curpm || - pv->pv_pmap == pmap_kernel())) + pv->pv_pmap == kernel_pmap)) flush = TRUE; PMAP_LOCK(pv->pv_pmap); @@ -3239,7 +3239,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset PDEBUG(1, printf("pmap_enter: pmap = %08x, va = %08x, m = %08x, prot = %x, " "flags = %x\n", (uint32_t) pmap, va, (uint32_t) m, prot, flags)); - if (pmap == pmap_kernel()) { + if (pmap == kernel_pmap) { l2b = pmap_get_l2_bucket(pmap, va); if (l2b == NULL) l2b = pmap_grow_l2_bucket(pmap, va); @@ -3414,7 +3414,7 @@ do_l2b_alloc: /* * Make sure userland mappings get the right permissions */ - if (pmap != pmap_kernel() && va != vector_page) { + if (pmap != kernel_pmap && va != vector_page) { npte |= L2_S_PROT_U; } @@ -3672,9 +3672,9 @@ retry: l1pd = pmap->pm_l1->l1_kva[l1idx]; if (l1pte_section_p(l1pd)) { /* - * These should only happen for pmap_kernel() + * These should only happen for kernel_pmap */ - KASSERT(pmap == pmap_kernel(), ("huh")); + KASSERT(pmap == kernel_pmap, ("huh")); /* XXX: what to do about the bits > 32 ? */ if (l1pd & L1_S_SUPERSEC) pa = (l1pd & L1_SUP_FRAME) | (va & L1_SUP_OFFSET); @@ -4034,7 +4034,7 @@ pmap_use_minicache(vm_offset_t va, vm_si if (next_bucket > eva) next_bucket = eva; - l2b = pmap_get_l2_bucket(pmap_kernel(), va); + l2b = pmap_get_l2_bucket(kernel_pmap, va); sptep = ptep = &l2b->l2b_kva[l2pte_index(va)]; @@ -4137,10 +4137,10 @@ pmap_clean_page(struct pv_entry *pv, boo if (curthread) pm = vmspace_pmap(curproc->p_vmspace); else - pm = pmap_kernel(); + pm = kernel_pmap; for (npv = pv; npv; npv = TAILQ_NEXT(npv, pv_list)) { - if (npv->pv_pmap == pmap_kernel() || npv->pv_pmap == pm) { + if (npv->pv_pmap == kernel_pmap || npv->pv_pmap == pm) { flags |= npv->pv_flags; /* * The page is mapped non-cacheable in Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Fri Jan 29 15:12:31 2016 (r295041) +++ head/sys/arm/include/pmap-v6.h Fri Jan 29 16:01:37 2016 (r295042) @@ -271,15 +271,6 @@ void pmap_devmap_bootstrap(const struct void pmap_pte_init_mmu_v6(void); void vector_page_setprot(int); - -/* - * sys/arm/arm/db_interface.c - * sys/arm/arm/machdep.c - * sys/arm/arm/minidump_machdep.c - * sys/arm/arm/pmap.c - */ -#define pmap_kernel() kernel_pmap - /* * sys/arm/arm/bus_space_generic.c (just comment) * sys/arm/arm/devmap.c Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Fri Jan 29 15:12:31 2016 (r295041) +++ head/sys/arm/include/pmap.h Fri Jan 29 16:01:37 2016 (r295042) @@ -176,7 +176,6 @@ typedef struct pmap *pmap_t; #ifdef _KERNEL extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) -#define pmap_kernel() kernel_pmap #define PMAP_ASSERT_LOCKED(pmap) \ mtx_assert(&(pmap)->pm_mtx, MA_OWNED) @@ -247,7 +246,7 @@ vtopte(vm_offset_t va) pd_entry_t *pdep; pt_entry_t *ptep; - if (pmap_get_pde_pte(pmap_kernel(), va, &pdep, &ptep) == FALSE) + if (pmap_get_pde_pte(kernel_pmap, va, &pdep, &ptep) == FALSE) return (NULL); return (ptep); } From owner-svn-src-head@freebsd.org Fri Jan 29 16:42:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C34DA71FCA; Fri, 29 Jan 2016 16:42:04 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A5CA1C8C; Fri, 29 Jan 2016 16:42:04 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0TGg3xg064176; Fri, 29 Jan 2016 16:42:03 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TGg3ti064175; Fri, 29 Jan 2016 16:42:03 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601291642.u0TGg3ti064175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 29 Jan 2016 16:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295043 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 16:42:04 -0000 Author: skra Date: Fri Jan 29 16:42:03 2016 New Revision: 295043 URL: https://svnweb.freebsd.org/changeset/base/295043 Log: Remove NPTEPG definition which is not used anywhere now after introduction of new pmap dump interface (r294722). And do not expose pt_entry_t type. Modified: head/sys/arm/include/param.h Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Fri Jan 29 16:01:37 2016 (r295042) +++ head/sys/arm/include/param.h Fri Jan 29 16:42:03 2016 (r295043) @@ -110,7 +110,6 @@ #define PAGE_SHIFT 12 #define PAGE_SIZE (1 << PAGE_SHIFT) /* Page size */ #define PAGE_MASK (PAGE_SIZE - 1) -#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t))) #define PDR_SHIFT 20 /* log2(NBPDR) */ #define NBPDR (1 << PDR_SHIFT) From owner-svn-src-head@freebsd.org Fri Jan 29 17:08:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60A0BA727CA; Fri, 29 Jan 2016 17:08: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 mx1.freebsd.org (Postfix) with ESMTPS id 3C6E31BD4; Fri, 29 Jan 2016 17:08: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 u0TH8RMh072421; Fri, 29 Jan 2016 17:08:27 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TH8R5p072419; Fri, 29 Jan 2016 17:08:27 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601291708.u0TH8R5p072419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 29 Jan 2016 17:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295045 - in head: . sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 17:08:28 -0000 Author: asomers Date: Fri Jan 29 17:08:26 2016 New Revision: 295045 URL: https://svnweb.freebsd.org/changeset/base/295045 Log: Add a sysctl to allow ZFS pools backed by zvols Change 294329 removed the ability to build ZFS pools that are backed by zvols, because having that ability (even if it's not used) leads to deadlocks. By popular demand, I'm adding an off-by-default sysctl to reenable that ability. Reviewed by: lidl, delphij MFC after: Never Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4998 Modified: head/UPDATING head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jan 29 17:05:30 2016 (r295044) +++ head/UPDATING Fri Jan 29 17:08:26 2016 (r295045) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160129: + Building ZFS pools on top of zvols is prohibited by default. That + feature has never worked safely; it's always been prone to deadlocks. + Using a zvol as the backing store for a VM guest's virtual disk will + still work, even if the guest is using ZFS. Legacy behavior can be + restored by setting vfs.zfs.vol.recursive=1. + 20160119: The NONE and HPN patches has been removed from OpenSSH. They are still available in the security/openssh-portable port. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jan 29 17:05:30 2016 (r295044) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jan 29 17:08:26 2016 (r295045) @@ -134,6 +134,9 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTL static int volmode = ZFS_VOLMODE_GEOM; SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &volmode, 0, "Expose as GEOM providers (1), device files (2) or neither"); +static boolean_t zpool_on_zvol = B_FALSE; +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, recursive, CTLFLAG_RWTUN, &zpool_on_zvol, 0, + "Allow zpools to use zvols as vdevs (DANGEROUS)"); #endif typedef struct zvol_extent { @@ -1114,7 +1117,9 @@ zvol_open(struct g_provider *pp, int fla return (err); } #else /* !illumos */ - if (tsd_get(zfs_geom_probe_vdev_key) != NULL) { + boolean_t locked = B_FALSE; + + if (!zpool_on_zvol && tsd_get(zfs_geom_probe_vdev_key) != NULL) { /* * if zfs_geom_probe_vdev_key is set, that means that zfs is * attempting to probe geom providers while looking for a @@ -1125,19 +1130,34 @@ zvol_open(struct g_provider *pp, int fla */ return (EOPNOTSUPP); } - - mutex_enter(&zfsdev_state_lock); + /* + * Protect against recursively entering spa_namespace_lock + * when spa_open() is used for a pool on a (local) ZVOL(s). + * This is needed since we replaced upstream zfsdev_state_lock + * with spa_namespace_lock in the ZVOL code. + * We are using the same trick as spa_open(). + * Note that calls in zvol_first_open which need to resolve + * pool name to a spa object will enter spa_open() + * recursively, but that function already has all the + * necessary protection. + */ + if (!MUTEX_HELD(&zfsdev_state_lock)) { + mutex_enter(&zfsdev_state_lock); + locked = B_TRUE; + } zv = pp->private; if (zv == NULL) { - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); return (SET_ERROR(ENXIO)); } if (zv->zv_total_opens == 0) { err = zvol_first_open(zv); if (err) { - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); return (err); } pp->mediasize = zv->zv_volsize; @@ -1171,7 +1191,8 @@ zvol_open(struct g_provider *pp, int fla mutex_exit(&zfsdev_state_lock); #else zv->zv_total_opens += count; - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); #endif return (err); @@ -1181,7 +1202,8 @@ out: #ifdef illumos mutex_exit(&zfsdev_state_lock); #else - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); #endif return (err); } From owner-svn-src-head@freebsd.org Fri Jan 29 17:21:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 511C9A72E22; Fri, 29 Jan 2016 17:21:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2144E1474; Fri, 29 Jan 2016 17:21:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0THL0iS076227; Fri, 29 Jan 2016 17:21:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0THL0uG076226; Fri, 29 Jan 2016 17:21:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601291721.u0THL0uG076226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 29 Jan 2016 17:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295047 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 17:21:01 -0000 Author: mav Date: Fri Jan 29 17:20:59 2016 New Revision: 295047 URL: https://svnweb.freebsd.org/changeset/base/295047 Log: MFV 295046: 6358 A faulted pool with only unavailable vdevs triggers assertion failure in libzfs Reviewed by: Matthew Ahrens Reviewed by: Andrew Stormont Reviewed by: Serban Maduta Approved by: Dan McDonald Author: Dan Vatca illumos/illumos-gate@b289d045e084af53efcc025255af8242e41f28fa Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Fri Jan 29 17:18:50 2016 (r295046) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Fri Jan 29 17:20:59 2016 (r295047) @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2015 by Syneto S.R.L. All rights reserved. */ /* @@ -246,8 +247,9 @@ zpool_get_features(zpool_handle_t *zhp) config = zpool_get_config(zhp, NULL); } - verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, - &features) == 0); + if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, + &features) != 0) + return (NULL); return (features); } From owner-svn-src-head@freebsd.org Fri Jan 29 17:24:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E437A72097; Fri, 29 Jan 2016 17:24:09 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: from mail-pf0-x233.google.com (mail-pf0-x233.google.com [IPv6:2607:f8b0:400e:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 000BE19F5; Fri, 29 Jan 2016 17:24:08 +0000 (UTC) (envelope-from cschuber@gmail.com) Received: by mail-pf0-x233.google.com with SMTP id o185so40492469pfb.1; Fri, 29 Jan 2016 09:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:mime-version:from:subject:date:to:content-type; bh=/3PYem77a/Mi5KCsiLBN79U//W7aWd8658HqBjrIbbk=; b=gZ6o5wHHKuPkGQ34qZg5EMpRQez+yHNBfHp+j1JUfqo/qtIRQ11sc/QDmp/SjVZyeX A4zLrp3LM0hy1j0WGTFebBIQ8WTlFB00L62BInOmOMz0sCrkZktgEJExx1EifizSYt1C g4mlxnpPYCYX+oL4V0G4sReA7i0WJIBif9gijwV9tLSvf/KuRY5GlZWzbwUWoJLBVN9O frWbgWiW00iTrUmc/ExL/Z2GCVLhZDoHJWCzrRIL0VL7g1aNXxprn/EnrHj8ZoobC0/9 omm9faUtrdpEAvn9T3vEsCf3sXVBTSRex5MiwbPOcyuUXvoRFfSmK4tCL46O5IY5eZ1N 0WLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:mime-version:from:subject:date:to :content-type; bh=/3PYem77a/Mi5KCsiLBN79U//W7aWd8658HqBjrIbbk=; b=Owcjlzagy1bpAMg7qJvt4/V9s7PrIAs3meTK95nd4TMH2TDhrhRU66D1kPbImBNh2Q CUzztdFRGOLvKXsYoLR4XVDVLxGFGa+iNvgdhO7OdA2hfag/hBS0yxWg47E9gr/1dNIw TpfpFOmIN7WdFP9rnIYgYmahCJgy2zEbWu7Ns10woFIoFoIqZ4Xy0Rn9dapjS/pNL3lT /8yVxCbb2YQbL2jQeMni2WK4vkvHf/m858BHWvvnxD9p/gLvPwXgXY7TtddnqQF/tqvf uiHJXC/Q7t9oJto8NHPlrvTI2QdQKClRfelE0xddSkHUmLXo3UTK6CXG7kNDl/aov0qG 4KFg== X-Gm-Message-State: AG10YOQ8D0gy9mI6QwLiTASO/8TxrK0+5LJ2u84iDTxFwVOPxhkkf9Fyu9TmgtaGzxgYDA== X-Received: by 10.98.32.25 with SMTP id g25mr15242678pfg.20.1454088248285; Fri, 29 Jan 2016 09:24:08 -0800 (PST) Received: from [192.168.1.101] (S0106002401cb186f.gv.shawcable.net. [96.50.22.10]) by smtp.gmail.com with ESMTPSA id q136sm24827363pfq.66.2016.01.29.09.24.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 09:24:07 -0800 (PST) Message-ID: <56aba037.8e2a620a.e5e0a.571a@mx.google.com> MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r295045 - in head: .sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Fri, 29 Jan 2016 09:24:22 -0800 To: Alan Somers , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "cy.schubert@cschubert.com" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 17:24:09 -0000 Thank you. :) Sent from my cellphone, ~Cy -----Original Message----- From: Alan Somers Sent: 29/01/2016 09:08 To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: svn commit: r295045 - in head: .sys/cddl/contrib/opensolaris/uts/c= ommon/fs/zfs Author: asomers Date: Fri Jan 29 17:08:26 2016 New Revision: 295045 URL: https://svnweb.freebsd.org/changeset/base/295045 Log: Add a sysctl to allow ZFS pools backed by zvols =20 Change 294329 removed the ability to build ZFS pools that are backed by zvols, because having that ability (even if it's not used) leads to deadlocks. By popular demand, I'm adding an off-by-default sysctl to reenable that ability. =20 Reviewed by: lidl, delphij MFC after: Never Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4998 Modified: head/UPDATING head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/UPDATING =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/UPDATING Fri Jan 29 17:05:30 2016 (r295044) +++ head/UPDATING Fri Jan 29 17:08:26 2016 (r295045) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) =20 +20160129: + Building ZFS pools on top of zvols is prohibited by default. That + feature has never worked safely; it's always been prone to deadlocks. + Using a zvol as the backing store for a VM guest's virtual disk will + still work, even if the guest is using ZFS. Legacy behavior can be + restored by setting vfs.zfs.vol.recursive=3D1. + 20160119: The NONE and HPN patches has been removed from OpenSSH. They are still available in the security/openssh-portable port. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jan 29 1= 7:05:30 2016 (r295044) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jan 29 1= 7:08:26 2016 (r295045) @@ -134,6 +134,9 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTL static int volmode =3D ZFS_VOLMODE_GEOM; SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &volmode, 0, "Expose as GEOM providers (1), device files (2) or neither"); +static boolean_t zpool_on_zvol =3D B_FALSE; +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, recursive, CTLFLAG_RWTUN, &zpool_on_zvo= l, 0, + "Allow zpools to use zvols as vdevs (DANGEROUS)"); =20 #endif typedef struct zvol_extent { @@ -1114,7 +1117,9 @@ zvol_open(struct g_provider *pp, int fla return (err); } #else /* !illumos */ - if (tsd_get(zfs_geom_probe_vdev_key) !=3D NULL) { + boolean_t locked =3D B_FALSE; + + if (!zpool_on_zvol && tsd_get(zfs_geom_probe_vdev_key) !=3D NULL) { /* * if zfs_geom_probe_vdev_key is set, that means that zfs is * attempting to probe geom providers while looking for a @@ -1125,19 +1130,34 @@ zvol_open(struct g_provider *pp, int fla */ return (EOPNOTSUPP); } - - mutex_enter(&zfsdev_state_lock); + /* + * Protect against recursively entering spa_namespace_lock + * when spa_open() is used for a pool on a (local) ZVOL(s). + * This is needed since we replaced upstream zfsdev_state_lock + * with spa_namespace_lock in the ZVOL code. + * We are using the same trick as spa_open(). + * Note that calls in zvol_first_open which need to resolve + * pool name to a spa object will enter spa_open() + * recursively, but that function already has all the + * necessary protection. + */ + if (!MUTEX_HELD(&zfsdev_state_lock)) { + mutex_enter(&zfsdev_state_lock); + locked =3D B_TRUE; + } =20 zv =3D pp->private; if (zv =3D=3D NULL) { - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); return (SET_ERROR(ENXIO)); } =20 if (zv->zv_total_opens =3D=3D 0) { err =3D zvol_first_open(zv); if (err) { - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); return (err); } pp->mediasize =3D zv->zv_volsize; @@ -1171,7 +1191,8 @@ zvol_open(struct g_provider *pp, int fla mutex_exit(&zfsdev_state_lock); #else zv->zv_total_opens +=3D count; - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); #endif =20 return (err); @@ -1181,7 +1202,8 @@ out: #ifdef illumos mutex_exit(&zfsdev_state_lock); #else - mutex_exit(&zfsdev_state_lock); + if (locked) + mutex_exit(&zfsdev_state_lock); #endif return (err); } From owner-svn-src-head@freebsd.org Fri Jan 29 17:43:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDC19A72997; Fri, 29 Jan 2016 17:43:04 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7701918A5; Fri, 29 Jan 2016 17:43:04 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0THh3Ed084086; Fri, 29 Jan 2016 17:43:03 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0THh36b084081; Fri, 29 Jan 2016 17:43:03 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601291743.u0THh36b084081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 29 Jan 2016 17:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295049 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 17:43:04 -0000 Author: skra Date: Fri Jan 29 17:43:03 2016 New Revision: 295049 URL: https://svnweb.freebsd.org/changeset/base/295049 Log: Retire pmap_pte_init_mmu_v6() which was used by old pmap-v6. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Fri Jan 29 17:33:37 2016 (r295048) +++ head/sys/arm/arm/cpufunc.c Fri Jan 29 17:43:03 2016 (r295049) @@ -889,9 +889,6 @@ set_cpufuncs() cpufuncs = arm1176_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); - - pmap_pte_init_mmu_v6(); - goto out; } #endif /* CPU_ARM1176 */ @@ -915,8 +912,6 @@ set_cpufuncs() cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); - - pmap_pte_init_mmu_v6(); goto out; } #endif /* CPU_CORTEXA */ @@ -927,7 +922,6 @@ set_cpufuncs() cputype == CPU_ID_ARM_88SV581X_V7) { cpufuncs = pj4bv7_cpufuncs; get_cachetype_cp15(); - pmap_pte_init_mmu_v6(); goto out; } #endif /* CPU_MV_PJ4B */ Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Jan 29 17:33:37 2016 (r295048) +++ head/sys/arm/arm/pmap-v6.c Fri Jan 29 17:43:03 2016 (r295049) @@ -6278,11 +6278,6 @@ pte1_setrw: } /* !!!! REMOVE !!!! */ -void -pmap_pte_init_mmu_v6(void) -{ -} - void vector_page_setprot(int p) { } Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Fri Jan 29 17:33:37 2016 (r295048) +++ head/sys/arm/include/pmap-v6.h Fri Jan 29 17:43:03 2016 (r295049) @@ -268,7 +268,6 @@ void pmap_devmap_bootstrap(const struct /* * sys/arm/arm/cpufunc.c */ -void pmap_pte_init_mmu_v6(void); void vector_page_setprot(int); /* Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Fri Jan 29 17:33:37 2016 (r295048) +++ head/sys/arm/include/pmap.h Fri Jan 29 17:43:03 2016 (r295049) @@ -624,9 +624,6 @@ void pmap_copy_page_generic(vm_paddr_t, void pmap_zero_page_generic(vm_paddr_t, int, int); void pmap_pte_init_generic(void); -#if (ARM_MMU_V6 + ARM_MMU_V7) != 0 -void pmap_pte_init_mmu_v6(void); -#endif /* (ARM_MMU_V6 + ARM_MMU_V7) != 0 */ #endif /* (ARM_MMU_GENERIC + ARM_MMU_V6 + ARM_MMU_V7) != 0 */ #if ARM_MMU_XSCALE == 1 From owner-svn-src-head@freebsd.org Fri Jan 29 18:43:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98780A72904; Fri, 29 Jan 2016 18:43:52 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6902312C2; Fri, 29 Jan 2016 18:43:52 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0TIhpD1001770; Fri, 29 Jan 2016 18:43:51 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TIhpm8001769; Fri, 29 Jan 2016 18:43:51 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601291843.u0TIhpm8001769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 29 Jan 2016 18:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295050 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 18:43:52 -0000 Author: zbb Date: Fri Jan 29 18:43:51 2016 New Revision: 295050 URL: https://svnweb.freebsd.org/changeset/base/295050 Log: Fix sending IPI to all CPUs on ARM64 There is no explanation why IPI ID is incremented here by "16". This should have been removed in r285533 but somehow survived. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5120 Modified: head/sys/arm64/arm64/intr_machdep.c Modified: head/sys/arm64/arm64/intr_machdep.c ============================================================================== --- head/sys/arm64/arm64/intr_machdep.c Fri Jan 29 17:43:03 2016 (r295049) +++ head/sys/arm64/arm64/intr_machdep.c Fri Jan 29 18:43:51 2016 (r295050) @@ -472,9 +472,6 @@ ipi_all_but_self(u_int ipi) other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); - /* ARM64TODO: This will be fixed with arm_intrng */ - ipi += 16; - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); PIC_IPI_SEND(root_pic, other_cpus, ipi); } From owner-svn-src-head@freebsd.org Fri Jan 29 21:07:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF88CA729D0; Fri, 29 Jan 2016 21:07:00 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1C841162; Fri, 29 Jan 2016 21:07:00 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0TL6xIc043130; Fri, 29 Jan 2016 21:06:59 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0TL6xN0043129; Fri, 29 Jan 2016 21:06:59 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601292106.u0TL6xN0043129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 29 Jan 2016 21:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295051 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 21:07:01 -0000 Author: smh Date: Fri Jan 29 21:06:59 2016 New Revision: 295051 URL: https://svnweb.freebsd.org/changeset/base/295051 Log: Fix phy interrupts setup for ixl Fix the inverted set of interrupts being used as the mask for ixl. Without this ixl devices fail to detect link state changes. Reviewed by: erj, sbruno MFC after: 2 days Sponsored by: Multiplay Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Fri Jan 29 18:43:51 2016 (r295050) +++ head/sys/dev/ixl/if_ixl.c Fri Jan 29 21:06:59 2016 (r295051) @@ -674,9 +674,9 @@ ixl_attach(device_t dev) } /* Limit phy interrupts to link and modules failure */ - error = i40e_aq_set_phy_int_mask(hw, - I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL); - if (error) + error = i40e_aq_set_phy_int_mask(hw, ~(I40E_AQ_EVENT_LINK_UPDOWN | + I40E_AQ_EVENT_MODULE_QUAL_FAIL), NULL); + if (error) device_printf(dev, "set phy mask failed: %d\n", error); /* Get the bus configuration and set the shared code */ From owner-svn-src-head@freebsd.org Sat Jan 30 01:00:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4C8AA72FC6; Sat, 30 Jan 2016 01:00:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 843BA14B4; Sat, 30 Jan 2016 01:00:57 +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 u0U10u6t011383; Sat, 30 Jan 2016 01:00:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U10s4a011363; Sat, 30 Jan 2016 01:00:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201601300100.u0U10s4a011363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 30 Jan 2016 01:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295056 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 01:00:57 -0000 Author: jhb Date: Sat Jan 30 01:00:54 2016 New Revision: 295056 URL: https://svnweb.freebsd.org/changeset/base/295056 Log: Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions. Suggested by: jmallett Reviewed by: bdrewery, jmallett Differential Revision: https://reviews.freebsd.org/D5123 Modified: head/lib/libsysdecode/syscallnames.c head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h head/usr.bin/kdump/kdump.c head/usr.bin/truss/aarch64-cloudabi64.c head/usr.bin/truss/aarch64-freebsd.c head/usr.bin/truss/amd64-cloudabi64.c head/usr.bin/truss/amd64-freebsd.c head/usr.bin/truss/amd64-freebsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-freebsd.c head/usr.bin/truss/i386-freebsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/mips-freebsd.c head/usr.bin/truss/powerpc-freebsd.c head/usr.bin/truss/powerpc64-freebsd.c head/usr.bin/truss/powerpc64-freebsd32.c head/usr.bin/truss/sparc64-freebsd.c Modified: head/lib/libsysdecode/syscallnames.c ============================================================================== --- head/lib/libsysdecode/syscallnames.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/lib/libsysdecode/syscallnames.c Sat Jan 30 01:00:54 2016 (r295056) @@ -70,30 +70,30 @@ sysdecode_syscallname(enum sysdecode_abi { switch (abi) { - case FREEBSD: + case SYSDECODE_ABI_FREEBSD: if (code < nitems(syscallnames)) return (syscallnames[code]); break; #if defined(__amd64__) || defined(__powerpc64__) - case FREEBSD32: + case SYSDECODE_ABI_FREEBSD32: if (code < nitems(freebsd32_syscallnames)) return (freebsd32_syscallnames[code]); break; #endif #if defined(__amd64__) || defined(__i386__) - case LINUX: + case SYSDECODE_ABI_LINUX: if (code < nitems(linux_syscallnames)) return (linux_syscallnames[code]); break; #endif #ifdef __amd64__ - case LINUX32: + case SYSDECODE_ABI_LINUX32: if (code < nitems(linux32_syscallnames)) return (linux32_syscallnames[code]); break; #endif #if defined(__amd64__) || defined(__aarch64__) - case CLOUDABI64: + case SYSDECODE_ABI_CLOUDABI64: if (code < nitems(cloudabi64_syscallnames)) return (cloudabi64_syscallnames[code]); break; Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Sat Jan 30 00:09:30 2016 (r295055) +++ head/lib/libsysdecode/sysdecode.3 Sat Jan 30 01:00:54 2016 (r295056) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2016 +.Dd January 29, 2016 .Dt SYSDECODE 3 .Os .Sh NAME @@ -44,23 +44,23 @@ The supported ABIs are named by the .Vt enum sysdecode_abi enumeration. .Pp -.Bl -tag -width "Li UNKNOWN_ABI" -compact -.It Li FREEBSD +.Bl -tag -width "Li SYSDECODE_ABI_CLOUDABI64" -compact +.It Li SYSDECODE_ABI_FREEBSD Native FreeBSD binaries. Supported on all platforms. -.It Li FREEBSD32 +.It Li SYSDECODE_ABI_FREEBSD32 32-bit FreeBSD binaries. Supported on amd64 and powerpc64. -.It Li LINUX +.It Li SYSDECODE_ABI_LINUX Linux binaries of the same platform. Supported on amd64 and i386. -.It Li LINUX32 +.It Li SYSDECODE_ABI_LINUX32 32-bit Linux binaries. Supported on amd64. -.It Li CLOUDABI64 +.It Li SYSDECODE_ABI_CLOUDABI64 64-bit CloudABI binaries. Supported on aarch64 and amd64. -.It Li UNKNOWN_ABI +.It Li SYSDECODE_ABI_UNKNOWN A placeholder for use when the ABI is not known. .El .Sh SEE ALSO Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Sat Jan 30 00:09:30 2016 (r295055) +++ head/lib/libsysdecode/sysdecode.h Sat Jan 30 01:00:54 2016 (r295056) @@ -30,12 +30,12 @@ #define __SYSDECODE_H__ enum sysdecode_abi { - UNKNOWN_ABI = 0, - FREEBSD, - FREEBSD32, - LINUX, - LINUX32, - CLOUDABI64 + SYSDECODE_ABI_UNKNOWN = 0, + SYSDECODE_ABI_FREEBSD, + SYSDECODE_ABI_FREEBSD32, + SYSDECODE_ABI_LINUX, + SYSDECODE_ABI_LINUX32, + SYSDECODE_ABI_CLOUDABI64 }; const char *sysdecode_ioctlname(unsigned long _val); Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/kdump/kdump.c Sat Jan 30 01:00:54 2016 (r295056) @@ -690,20 +690,20 @@ syscallabi(u_int sv_flags) { if (sv_flags == 0) - return (FREEBSD); + return (SYSDECODE_ABI_FREEBSD); switch (sv_flags & SV_ABI_MASK) { case SV_ABI_FREEBSD: - return (FREEBSD); + return (SYSDECODE_ABI_FREEBSD); #if defined(__amd64__) || defined(__i386__) case SV_ABI_LINUX: #ifdef __amd64__ if (sv_flags & SV_ILP32) - return (LINUX32); + return (SYSDECODE_ABI_LINUX32); #endif - return (LINUX); + return (SYSDECODE_ABI_LINUX); #endif default: - return (UNKNOWN_ABI); + return (SYSDECODE_ABI_UNKNOWN); } } Modified: head/usr.bin/truss/aarch64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/aarch64-cloudabi64.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/aarch64-cloudabi64.c Sat Jan 30 01:00:54 2016 (r295056) @@ -81,7 +81,7 @@ aarch64_cloudabi64_fetch_retval(struct t static struct procabi aarch64_cloudabi64 = { "CloudABI ELF64", - CLOUDABI64, + SYSDECODE_ABI_CLOUDABI64, aarch64_cloudabi64_fetch_args, aarch64_cloudabi64_fetch_retval }; Modified: head/usr.bin/truss/aarch64-freebsd.c ============================================================================== --- head/usr.bin/truss/aarch64-freebsd.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/aarch64-freebsd.c Sat Jan 30 01:00:54 2016 (r295056) @@ -99,7 +99,7 @@ aarch64_fetch_retval(struct trussinfo *t static struct procabi aarch64_freebsd = { "FreeBSD ELF64", - FREEBSD, + SYSDECODE_ABI_FREEBSD, aarch64_fetch_args, aarch64_fetch_retval }; Modified: head/usr.bin/truss/amd64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/amd64-cloudabi64.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/amd64-cloudabi64.c Sat Jan 30 01:00:54 2016 (r295056) @@ -90,7 +90,7 @@ amd64_cloudabi64_fetch_retval(struct tru static struct procabi amd64_cloudabi64 = { "CloudABI ELF64", - CLOUDABI64, + SYSDECODE_ABI_CLOUDABI64, amd64_cloudabi64_fetch_args, amd64_cloudabi64_fetch_retval }; Modified: head/usr.bin/truss/amd64-freebsd.c ============================================================================== --- head/usr.bin/truss/amd64-freebsd.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/amd64-freebsd.c Sat Jan 30 01:00:54 2016 (r295056) @@ -121,7 +121,7 @@ amd64_fetch_retval(struct trussinfo *tru static struct procabi amd64_freebsd = { "FreeBSD ELF64", - FREEBSD, + SYSDECODE_ABI_FREEBSD, amd64_fetch_args, amd64_fetch_retval }; Modified: head/usr.bin/truss/amd64-freebsd32.c ============================================================================== --- head/usr.bin/truss/amd64-freebsd32.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/amd64-freebsd32.c Sat Jan 30 01:00:54 2016 (r295056) @@ -117,7 +117,7 @@ amd64_freebsd32_fetch_retval(struct trus static struct procabi amd64_freebsd32 = { "FreeBSD ELF32", - FREEBSD32, + SYSDECODE_ABI_FREEBSD32, amd64_freebsd32_fetch_args, amd64_freebsd32_fetch_retval }; @@ -126,7 +126,7 @@ PROCABI(amd64_freebsd32); static struct procabi amd64_freebsd32_aout = { "FreeBSD a.out", - FREEBSD32, + SYSDECODE_ABI_FREEBSD32, amd64_freebsd32_fetch_args, amd64_freebsd32_fetch_retval }; Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/amd64-linux32.c Sat Jan 30 01:00:54 2016 (r295056) @@ -131,7 +131,7 @@ amd64_linux32_fetch_retval(struct trussi static struct procabi amd64_linux32 = { "Linux ELF32", - LINUX32, + SYSDECODE_ABI_LINUX32, amd64_linux32_fetch_args, amd64_linux32_fetch_retval }; Modified: head/usr.bin/truss/arm-freebsd.c ============================================================================== --- head/usr.bin/truss/arm-freebsd.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/arm-freebsd.c Sat Jan 30 01:00:54 2016 (r295056) @@ -128,7 +128,7 @@ arm_fetch_retval(struct trussinfo *truss static struct procabi arm_freebsd = { "FreeBSD ELF32", - FREEBSD, + SYSDECODE_ABI_FREEBSD, arm_fetch_args, arm_fetch_retval }; Modified: head/usr.bin/truss/i386-freebsd.c ============================================================================== --- head/usr.bin/truss/i386-freebsd.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/i386-freebsd.c Sat Jan 30 01:00:54 2016 (r295056) @@ -110,7 +110,7 @@ i386_fetch_retval(struct trussinfo *trus static struct procabi i386_freebsd = { "FreeBSD ELF32", - FREEBSD, + SYSDECODE_ABI_FREEBSD, i386_fetch_args, i386_fetch_retval }; @@ -119,7 +119,7 @@ PROCABI(i386_freebsd); static struct procabi i386_freebsd_aout = { "FreeBSD a.out", - FREEBSD, + SYSDECODE_ABI_FREEBSD, i386_fetch_args, i386_fetch_retval }; Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/i386-linux.c Sat Jan 30 01:00:54 2016 (r295056) @@ -130,7 +130,7 @@ i386_linux_fetch_retval(struct trussinfo static struct procabi i386_linux = { "Linux ELF32", - LINUX, + SYSDECODE_ABI_LINUX, i386_linux_fetch_args, i386_linux_fetch_retval }; Modified: head/usr.bin/truss/mips-freebsd.c ============================================================================== --- head/usr.bin/truss/mips-freebsd.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/mips-freebsd.c Sat Jan 30 01:00:54 2016 (r295056) @@ -131,7 +131,7 @@ static struct procabi mips_freebsd = { #else "FreeBSD ELF32", #endif - FREEBSD, + SYSDECODE_ABI_FREEBSD, mips_fetch_args, mips_fetch_retval }; Modified: head/usr.bin/truss/powerpc-freebsd.c ============================================================================== --- head/usr.bin/truss/powerpc-freebsd.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/powerpc-freebsd.c Sat Jan 30 01:00:54 2016 (r295056) @@ -112,7 +112,7 @@ powerpc_fetch_retval(struct trussinfo *t static struct procabi powerpc_freebsd = { "FreeBSD ELF32", - FREEBSD, + SYSDECODE_ABI_FREEBSD, powerpc_fetch_args, powerpc_fetch_retval }; Modified: head/usr.bin/truss/powerpc64-freebsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-freebsd.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/powerpc64-freebsd.c Sat Jan 30 01:00:54 2016 (r295056) @@ -108,7 +108,7 @@ powerpc64_fetch_retval(struct trussinfo static struct procabi powerpc64_freebsd = { "FreeBSD ELF64", - FREEBSD, + SYSDECODE_ABI_FREEBSD, powerpc64_fetch_args, powerpc64_fetch_retval }; Modified: head/usr.bin/truss/powerpc64-freebsd32.c ============================================================================== --- head/usr.bin/truss/powerpc64-freebsd32.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/powerpc64-freebsd32.c Sat Jan 30 01:00:54 2016 (r295056) @@ -117,7 +117,7 @@ powerpc64_freebsd32_fetch_retval(struct static struct procabi powerpc64_freebsd32 = { "FreeBSD ELF32", - FREEBSD32, + SYSDECODE_ABI_FREEBSD32, powerpc64_freebsd32_fetch_args, powerpc64_freebsd32_fetch_retval }; Modified: head/usr.bin/truss/sparc64-freebsd.c ============================================================================== --- head/usr.bin/truss/sparc64-freebsd.c Sat Jan 30 00:09:30 2016 (r295055) +++ head/usr.bin/truss/sparc64-freebsd.c Sat Jan 30 01:00:54 2016 (r295056) @@ -115,7 +115,7 @@ sparc64_fetch_retval(struct trussinfo *t static struct procabi sparc64_freebsd = { "FreeBSD ELF64", - FREEBSD, + SYSDECODE_ABI_FREEBSD, sparc64_fetch_args, sparc64_fetch_retval }; From owner-svn-src-head@freebsd.org Sat Jan 30 01:15:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1671A73396 for ; Sat, 30 Jan 2016 01:15:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::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 5928C1CBD for ; Sat, 30 Jan 2016 01:15:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id p63so2110482wmp.1 for ; Fri, 29 Jan 2016 17:15:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=P6Zo3bbPSCZ/Y3jiBzK8msiD7OsMX4/POgeC94piH7o=; b=o9Ypw8K9kyIsP1HRSOuuZj+ar249wez/UZ+/0SDrdj8H3nhobq+aPyelOJVPhfywHB 7McZy811uYv4ZXV9BA+oJyLTVcDJBorIRS8wwYs02dENWNSZCe8zbwrQnmHheo15F4cO DAi+zHK34fL49GR39LX3szTnE7/ml/3pKcwZtS9sqc+5aW5eh4foiYE7KJB9iB5JrvXX TQI6yrhlivOVcB5gTx/pslJ8yBTtt/qvRAlleIknI4Q/NAUxEZBSPqvvDyHIRrqd5sBN PyjSijdzpdEVaL+3WVqwWsINKee68wFAyupJZakFZmil8pMJIsLe7g5F6hVFtqSO/jU5 Rc4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=P6Zo3bbPSCZ/Y3jiBzK8msiD7OsMX4/POgeC94piH7o=; b=h5mQRjcZD/0N6iC321dEnF1aqdTzyT9rwOvKN9GHTCHp/Qn7sICmMjxqqLUuGHaLxO MBer7TIBWsX/S1WVUKsBk0I0QZPMHdTDPA2AHBIQ8zUqHAUTD/Jb8MluKd2HNZmZeSEy woEevw4CrQb5VR5asYunTCohRsaX/O1x2cD2tS8rjR1bUnYm13LOK4hfZ1tSq3AboeM7 Z3Vzj8caNAA7dDeN7cx+97ZHC7g6zhBb2D5CkeXJFBmjPKPWv3AL92pDqVtEK0jui4xa Qcyfyj4T2rjpyCr44RGtRMwc8C1pU8E/AW/E+Ogyw35T/TTbLHBzxDstDLsFRaJDfN4U Um2A== X-Gm-Message-State: AG10YOR+l6HVr3KFZiPzAwdov/RAngMj4ZUVg5qzABZR/ZEUXjazrQiE80EVJhbgYSAS1Ul8 X-Received: by 10.194.240.66 with SMTP id vy2mr11593066wjc.28.1454116516867; Fri, 29 Jan 2016 17:15:16 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id q75sm313548wmd.6.2016.01.29.17.15.15 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 17:15:15 -0800 (PST) Subject: Re: svn commit: r295051 - head/sys/dev/ixl To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601292106.u0TL6xN0043129@repo.freebsd.org> From: Steven Hartland Message-ID: <56AC0EB4.3030109@multiplay.co.uk> Date: Sat, 30 Jan 2016 01:15:32 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601292106.u0TL6xN0043129@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 01:15:20 -0000 This should have referenced https://reviews.freebsd.org/D5106 On 29/01/2016 21:06, Steven Hartland wrote: > Author: smh > Date: Fri Jan 29 21:06:59 2016 > New Revision: 295051 > URL: https://svnweb.freebsd.org/changeset/base/295051 > > Log: > Fix phy interrupts setup for ixl > > Fix the inverted set of interrupts being used as the mask for ixl. > > Without this ixl devices fail to detect link state changes. > > Reviewed by: erj, sbruno > MFC after: 2 days > Sponsored by: Multiplay > > Modified: > head/sys/dev/ixl/if_ixl.c > > Modified: head/sys/dev/ixl/if_ixl.c > ============================================================================== > --- head/sys/dev/ixl/if_ixl.c Fri Jan 29 18:43:51 2016 (r295050) > +++ head/sys/dev/ixl/if_ixl.c Fri Jan 29 21:06:59 2016 (r295051) > @@ -674,9 +674,9 @@ ixl_attach(device_t dev) > } > > /* Limit phy interrupts to link and modules failure */ > - error = i40e_aq_set_phy_int_mask(hw, > - I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL); > - if (error) > + error = i40e_aq_set_phy_int_mask(hw, ~(I40E_AQ_EVENT_LINK_UPDOWN | > + I40E_AQ_EVENT_MODULE_QUAL_FAIL), NULL); > + if (error) > device_printf(dev, "set phy mask failed: %d\n", error); > > /* Get the bus configuration and set the shared code */ > From owner-svn-src-head@freebsd.org Sat Jan 30 04:16:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73A06A726A7; Sat, 30 Jan 2016 04:16:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8461A4F; Sat, 30 Jan 2016 04:16:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0U4G60R069380; Sat, 30 Jan 2016 04:16:06 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U4G6rs069377; Sat, 30 Jan 2016 04:16:06 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201601300416.u0U4G6rs069377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 30 Jan 2016 04:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295059 - in head: lib/libc/tests/gen libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 04:16:07 -0000 Author: sobomax Date: Sat Jan 30 04:16:05 2016 New Revision: 295059 URL: https://svnweb.freebsd.org/changeset/base/295059 Log: This seems like a very trivial bug that should have been squashed a long time ago, but for some reason it was not. Basically, without this change dlopen(3)'ing an empty .so file would just cause application to dump core with SIGSEGV. Make sure the file has enough data for at least the ELF header before mmap'ing it. Add a test case to check that dlopen an empty file return an error. There were a separate discussion as to whether it should be SIGBUS instead when you try to access region mapped from an empty file, but it's definitely SIGSEGV now, so if anyone want to check that please be my guest. Reviewed by: mjg, cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5112 Added: head/lib/libc/tests/gen/dlopen_empty_test.c (contents, props changed) Modified: head/lib/libc/tests/gen/Makefile head/libexec/rtld-elf/map_object.c Modified: head/lib/libc/tests/gen/Makefile ============================================================================== --- head/lib/libc/tests/gen/Makefile Sat Jan 30 01:52:18 2016 (r295058) +++ head/lib/libc/tests/gen/Makefile Sat Jan 30 04:16:05 2016 (r295059) @@ -11,6 +11,7 @@ ATF_TESTS_C+= ftw_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test ATF_TESTS_C+= wordexp_test +ATF_TESTS_C+= dlopen_empty_test # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, t_sleep # TODO: t_siginfo (fixes require further inspection) Added: head/lib/libc/tests/gen/dlopen_empty_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/gen/dlopen_empty_test.c Sat Jan 30 04:16:05 2016 (r295059) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2016 Maksym Sobolyev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static const char *funname; +static char *soname; + +static void +sigsegv_handler(int sig __unused) +{ + unlink(soname); + free(soname); + atf_tc_fail("got SIGSEGV in the %s(3)", funname); +} + +ATF_TC(dlopen_empty_test); +ATF_TC_HEAD(dlopen_empty_test, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the dlopen() of an empty file " + "returns an error"); +} +ATF_TC_BODY(dlopen_empty_test, tc) +{ + char tempname[] = "/tmp/temp.XXXXXX"; + char *fname; + int fd; + void *dlh; + struct sigaction act, oact; + + fname = mktemp(tempname); + ATF_REQUIRE_MSG(fname != NULL, "mktemp failed; errno=%d", errno); + asprintf(&soname, "%s.so", fname); + ATF_REQUIRE_MSG(soname != NULL, "asprintf failed; errno=%d", ENOMEM); + fd = open(soname, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE); + ATF_REQUIRE_MSG(fd != -1, "open(\"%s\") failed; errno=%d", soname, errno); + close(fd); + + act.sa_handler = sigsegv_handler; + act.sa_flags = 0; + sigemptyset(&act.sa_mask); + ATF_CHECK_MSG(sigaction(SIGSEGV, &act, &oact) != -1, + "sigaction() failed"); + + funname = "dlopen"; + dlh = dlopen(soname, RTLD_LAZY); + if (dlh != NULL) { + funname = "dlclose"; + dlclose(dlh); + } + ATF_REQUIRE_MSG(dlh == NULL, "dlopen(\"%s\") did not fail", soname); + unlink(soname); + free(soname); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, dlopen_empty_test); + + return (atf_no_error()); +} Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Sat Jan 30 01:52:18 2016 (r295058) +++ head/libexec/rtld-elf/map_object.c Sat Jan 30 04:16:05 2016 (r295059) @@ -38,7 +38,7 @@ #include "debug.h" #include "rtld.h" -static Elf_Ehdr *get_elf_header(int, const char *); +static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *); static int convert_prot(int); /* Elf flags -> mmap protection */ static int convert_flags(int); /* Elf flags -> mmap flags */ @@ -91,7 +91,7 @@ map_object(int fd, const char *path, con char *note_map; size_t note_map_len; - hdr = get_elf_header(fd, path); + hdr = get_elf_header(fd, path, sb); if (hdr == NULL) return (NULL); @@ -324,10 +324,16 @@ error: } static Elf_Ehdr * -get_elf_header(int fd, const char *path) +get_elf_header(int fd, const char *path, const struct stat *sbp) { Elf_Ehdr *hdr; + /* Make sure file has enough data for the ELF header */ + if (sbp != NULL && sbp->st_size < sizeof(Elf_Ehdr)) { + _rtld_error("%s: invalid file format", path); + return (NULL); + } + hdr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ, fd, 0); if (hdr == (Elf_Ehdr *)MAP_FAILED) { From owner-svn-src-head@freebsd.org Sat Jan 30 06:18:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3114A72A2A; Sat, 30 Jan 2016 06:18:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 966781E6A; Sat, 30 Jan 2016 06:18:38 +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 u0U6IbKZ005069; Sat, 30 Jan 2016 06:18:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U6Ibm8005064; Sat, 30 Jan 2016 06:18:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601300618.u0U6Ibm8005064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 30 Jan 2016 06:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295062 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 06:18:39 -0000 Author: imp Date: Sat Jan 30 06:18:37 2016 New Revision: 295062 URL: https://svnweb.freebsd.org/changeset/base/295062 Log: Implement power command to list all power modes, find out the power mode we're in and to set the power mode. Added: head/sbin/nvmecontrol/power.c (contents, props changed) Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/nvmecontrol.8 head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Sat Jan 30 06:12:03 2016 (r295061) +++ head/sbin/nvmecontrol/Makefile Sat Jan 30 06:18:37 2016 (r295062) @@ -2,7 +2,7 @@ PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c nvme_util.c + perftest.c reset.c nvme_util.c power.c MAN= nvmecontrol.8 .PATH: ${.CURDIR}/../../sys/dev/nvme Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Sat Jan 30 06:12:03 2016 (r295061) +++ head/sbin/nvmecontrol/nvmecontrol.8 Sat Jan 30 06:18:37 2016 (r295062) @@ -70,6 +70,11 @@ .Op Fl f Ar path_to_firmware .Op Fl a .Aq device id +.Nm +.Ic power +.Op Fl l +.Op Fl p power_state +.Op fl w workload_hint .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. @@ -120,6 +125,18 @@ Activate the firmware in slot 4 of the n .Pp Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the nvme0 controller and activate it on the next reset. +.Pp +.Dl nvmecontrol power -l nvme0 +.Pp +List all the current power modes. +.Pp +.Dl nvmecontrol power -p 3 nvme0 +.Pp +Set the current power mode. +.Pp +.Dl nvmecontrol power nvme0 +.Pp +Get the current power mode. .Sh AUTHORS .An -nosplit .Nm Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Sat Jan 30 06:12:03 2016 (r295061) +++ head/sbin/nvmecontrol/nvmecontrol.c Sat Jan 30 06:18:37 2016 (r295062) @@ -58,6 +58,7 @@ static struct nvme_function { {"reset", reset, RESET_USAGE}, {"logpage", logpage, LOGPAGE_USAGE}, {"firmware", firmware, FIRMWARE_USAGE}, + {"power", power, POWER_USAGE}, {NULL, NULL, NULL}, }; Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Sat Jan 30 06:12:03 2016 (r295061) +++ head/sbin/nvmecontrol/nvmecontrol.h Sat Jan 30 06:18:37 2016 (r295062) @@ -55,12 +55,16 @@ #define FIRMWARE_USAGE \ " nvmecontrol firmware [-s slot] [-f path_to_firmware] [-a] \n" +#define POWER_USAGE \ +" nvmecontrol power [-l] [-p new-state [-w workload-hint]] \n" + void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); void logpage(int argc, char *argv[]); void firmware(int argc, char *argv[]); +void power(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid); Added: head/sbin/nvmecontrol/power.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/power.c Sat Jan 30 06:18:37 2016 (r295062) @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 2016 Netflix, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +_Static_assert(sizeof(struct nvme_power_state) == 256 / NBBY, + "nvme_power_state size wrong"); + +static void +power_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, POWER_USAGE); + exit(1); +} + +static void +power_list_one(int i, struct nvme_power_state *nps) +{ + int mpower, apower, ipower; + + mpower = nps->mp; + if (nps->mps == 0) + mpower *= 100; + ipower = nps->idlp; + if (nps->ips == 1) + ipower *= 100; + apower = nps->actp; + if (nps->aps == 1) + apower *= 100; + printf("%2d: %2d.%04dW%c %3d.%03dms %3d.%03dms %2d %2d %2d %2d %2d.%04dW %2d.%04dW %d\n", + i, mpower / 10000, mpower % 10000, + nps->nops ? '*' : ' ', nps->enlat / 1000, nps->enlat % 1000, + nps->exlat / 1000, nps->exlat % 1000, nps->rrt, nps->rrl, + nps->rwt, nps->rwl, ipower / 10000, ipower % 10000, + apower / 10000, apower % 10000, nps->apw); +} + +static void +power_list(struct nvme_controller_data *cdata) +{ + int i; + + printf("\nPower States Supported: %d\n\n", cdata->npss + 1); + printf(" # Max pwr Enter Lat Exit Lat RT RL WT WL Idle Pwr Act Pwr Workloadd\n"); + printf("-- -------- --------- --------- -- -- -- -- -------- -------- --\n"); + for (i = 0; i <= cdata->npss; i++) + power_list_one(i, &cdata->power_state[i]); +} + +static void +power_set(int fd, int power, int workload, int perm) +{ + struct nvme_pt_command pt; + uint32_t p; + + p = perm ? (1u << 31) : 0; + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_SET_FEATURES; + pt.cmd.cdw10 = NVME_FEAT_POWER_MANAGEMENT | p; + pt.cmd.cdw11 = power | (workload << 5); + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "set feature power mgmt request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "set feature power mgmt request returned error"); +} + +static void +power_show(int fd) +{ + struct nvme_pt_command pt; + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_GET_FEATURES; + pt.cmd.cdw10 = NVME_FEAT_POWER_MANAGEMENT; + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "set feature power mgmt request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "set feature power mgmt request returned error"); + + printf("Current Power Mode is %d\n", pt.cpl.cdw0); +} + +void +power(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + int ch, listflag = 0, powerflag = 0, power = 0, fd; + int workload = 0; + char *end; + + while ((ch = getopt(argc, argv, "lp:w:")) != -1) { + switch ((char)ch) { + case 'l': + listflag = 1; + break; + case 'p': + powerflag = 1; + power = strtol(optarg, &end, 0); + if (*end != '\0') { + fprintf(stderr, "Invalid power state number: %s\n", optarg); + power_usage(); + } + break; + case 'w': + workload = strtol(optarg, &end, 0); + if (*end != '\0') { + fprintf(stderr, "Invalid workload hint: %s\n", optarg); + power_usage(); + } + break; + default: + power_usage(); + } + } + + /* Check that a controller was specified. */ + if (optind >= argc) + power_usage(); + + if (listflag && powerflag) { + fprintf(stderr, "Can't set power and list power states\n"); + power_usage(); + } + + open_dev(argv[optind], &fd, 1, 1); + read_controller_data(fd, &cdata); + + if (listflag) { + power_list(&cdata); + goto out; + } + + if (powerflag) { + power_set(fd, power, workload, 0); + goto out; + } + power_show(fd); + +out: + close(fd); + exit(0); +} From owner-svn-src-head@freebsd.org Sat Jan 30 07:00:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADD60A73E9F; Sat, 30 Jan 2016 07:00:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 881BC1982; Sat, 30 Jan 2016 07:00:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0U70SEj016681; Sat, 30 Jan 2016 07:00:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U70S2L016679; Sat, 30 Jan 2016 07:00:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601300700.u0U70S2L016679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 30 Jan 2016 07:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295063 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 07:00:29 -0000 Author: imp Date: Sat Jan 30 07:00:28 2016 New Revision: 295063 URL: https://svnweb.freebsd.org/changeset/base/295063 Log: Two new config files. One that has UEFI booting, and the other that can do both UEFI and BIOS/GPT booting. Support for nanobsd coming soon. Based in part in a patch from: andrew@ Added: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg (contents, props changed) head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg (contents, props changed) Added: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg Sat Jan 30 07:00:28 2016 (r295063) @@ -0,0 +1,43 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2010-2011 iXsystems, 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 iXsystems, Inc. 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. +# + +NANO_ARCH=amd64 +NANO_NAME=qemu-amd64-uefi-bios +NANO_LAYOUT=std-uefi-bios + +. common # Pull in common definitions + +qemu_env + +# +# Run with +# qemu-system-x86_64 -serial stdio -bios OVMF.fd \ +# -hda _.disk.image.qemu-amd64-uefi.qcow2 +# OVMF.fd is from +# http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip +# Added: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg Sat Jan 30 07:00:28 2016 (r295063) @@ -0,0 +1,43 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2010-2011 iXsystems, 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 iXsystems, Inc. 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. +# + +NANO_ARCH=amd64 +NANO_NAME=qemu-amd64-uefi +NANO_LAYOUT=std-uefi + +. common # Pull in common definitions + +qemu_env + +# +# Run with +# qemu-system-x86_64 -serial stdio -bios OVMF.fd \ +# -hda _.disk.image.qemu-amd64-uefi.qcow2 +# OVMF.fd is from +# http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip +# From owner-svn-src-head@freebsd.org Sat Jan 30 07:00:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E83B7A73EA6; Sat, 30 Jan 2016 07:00:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C007E1983; Sat, 30 Jan 2016 07:00: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 u0U70T76016725; Sat, 30 Jan 2016 07:00:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U70TDs016723; Sat, 30 Jan 2016 07:00:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601300700.u0U70TDs016723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 30 Jan 2016 07:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295064 - in head/tools/tools/nanobsd: . embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 07:00:31 -0000 Author: imp Date: Sat Jan 30 07:00:29 2016 New Revision: 295064 URL: https://svnweb.freebsd.org/changeset/base/295064 Log: Two new variables: NANO_ROOT and NANO_ALTROOT. These used to be spelled ${NANO_SLICE_ROOT}a and ${NANO_SLICE_ALTROOT}a respectively, and that's the default value. This will allow nanobsd on systems without a bsd label. That's rarely needed these days, even in an MBR world. The default will shift to this in the future, but remain an option. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Sat Jan 30 07:00:28 2016 (r295063) +++ head/tools/tools/nanobsd/defaults.sh Sat Jan 30 07:00:29 2016 (r295064) @@ -156,6 +156,8 @@ NANO_SLICE_ROOT=s1 NANO_SLICE_ALTROOT=s2 NANO_SLICE_CFG=s3 NANO_SLICE_DATA=s4 +NANO_ROOT=s1a +NANO_ALTROOT=s2a # Default ownwership for nopriv build NANO_DEF_UNAME=root @@ -569,7 +571,7 @@ setup_nanobsd_etc ( ) ( # save config file for scripts echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf - echo "/dev/${NANO_DRIVE}${NANO_SLICE_ROOT}a / ufs ro 1 1" > etc/fstab + echo "/dev/${NANO_DRIVE}${NANO_ROOT} / ufs ro 1 1" > etc/fstab echo "/dev/${NANO_DRIVE}${NANO_SLICE_CFG} /cfg ufs rw,noauto 2 2" >> etc/fstab mkdir -p cfg ) @@ -731,8 +733,8 @@ create_diskimage ( ) ( bsdlabel ${MD}${NANO_SLICE_ROOT} # Create first image - populate_slice /dev/${MD}${NANO_SLICE_ROOT}a ${NANO_WORLDDIR} ${MNT} "${NANO_SLICE_ROOT}a" - mount /dev/${MD}${NANO_SLICE_ROOT}a ${MNT} + populate_slice /dev/${MD}${NANO_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" + mount /dev/${MD}${NANO_ROOT} ${MNT} echo "Generating mtree..." ( cd "${MNT}" && mtree -c ) > ${NANO_OBJ}/_.mtree ( cd "${MNT}" && du -k ) > ${NANO_OBJ}/_.du @@ -742,7 +744,7 @@ create_diskimage ( ) ( # Duplicate to second image (if present) echo "Duplicating to second image..." dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} of=/dev/${MD}${NANO_SLICE_ALTROOT} bs=64k - mount /dev/${MD}${NANO_SLICE_ALTROOT}a ${MNT} + mount /dev/${MD}${NANO_ALTROOT} ${MNT} for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab do sed -i "" "s=${NANO_DRIVE}${NANO_SLICE_ROOT}=${NANO_DRIVE}${NANO_SLICE_ALTROOT}=g" $f @@ -751,7 +753,7 @@ create_diskimage ( ) ( # Override the label from the first partition so we # don't confuse glabel with duplicates. if [ -n "${NANO_LABEL}" ]; then - tunefs -L ${NANO_LABEL}"${NANO_SLICE_ALTROOT}a" /dev/${MD}${NANO_SLICE_ALTROOT}a + tunefs -L ${NANO_LABEL}"${NANO_ALTROOT}" /dev/${MD}${NANO_ALTROOT} fi fi Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Sat Jan 30 07:00:28 2016 (r295063) +++ head/tools/tools/nanobsd/embedded/common Sat Jan 30 07:00:29 2016 (r295064) @@ -664,6 +664,11 @@ powerpc64-apple) ;; esac +# For this config, no BSD labels so NANO_ROOT and NANO_ALTROOT need to be +# adjusted +NANO_ROOT=${NANO_SLICE_ROOT} +NANO_ALTROOT=${NANO_SLICE_ALTROOT} + NANO_SLICE_DATA= # Not included # Each major disk scheme has its own routine. Generally From owner-svn-src-head@freebsd.org Sat Jan 30 07:00:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FBBFA73EEC; Sat, 30 Jan 2016 07:00:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2835F1C01; Sat, 30 Jan 2016 07:00:38 +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 u0U70bLu016772; Sat, 30 Jan 2016 07:00:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U70bYU016770; Sat, 30 Jan 2016 07:00:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601300700.u0U70bYU016770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 30 Jan 2016 07:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295065 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 07:00:38 -0000 Author: imp Date: Sat Jan 30 07:00:36 2016 New Revision: 295065 URL: https://svnweb.freebsd.org/changeset/base/295065 Log: Preliminary EFI support. Based, in part, on patches from Andy Turner. Add support for being able to boot off both UEFI and BIOS firmware, ala the memstick trick. Add support for writing to GPT volumes. Move away from using bsd labels at all for these embedded stuff. Minor tweaks to README. Modified: head/tools/tools/nanobsd/embedded/README head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/README ============================================================================== --- head/tools/tools/nanobsd/embedded/README Sat Jan 30 07:00:29 2016 (r295064) +++ head/tools/tools/nanobsd/embedded/README Sat Jan 30 07:00:36 2016 (r295065) @@ -10,8 +10,6 @@ and DHCPd. This is a work in progress. Generally, to build this you should cd tools/tools/nanobsd/embedded sudo sh ../nanobsd.sh -c foo.cfg -but do be careful if things are interrupted. There may still be -bugs lurking that cause your entire FreeBSD tree to disappear. Some features: Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Sat Jan 30 07:00:29 2016 (r295064) +++ head/tools/tools/nanobsd/embedded/common Sat Jan 30 07:00:36 2016 (r295065) @@ -76,6 +76,8 @@ fi NANO_SLICE_FAT_SIZE=32m NANO_SLICE_CFG_SIZE=32m +NANO_BOOT2CFG="-D -h -S115200 comconsole_port=0x3e8" + NANO_RAM_ETCSIZE=8192 NANO_RAM_TMPVARSIZE=8192 NANO_IMAGES=2 @@ -292,7 +294,7 @@ create_diskimage_mbr ( ) ( bootbsd=${NANO_BOOT_BSD:+-b ${NANO_BOOT_BSD}} skiparg=${NANO_MBR_FIRST_SKIP:+-S ${NANO_MBR_FIRST_SKIP}} - for i in s1 s2 s3 s4 empty; do + for i in s1 s2 s3 s4 p1 p2 p3 p4 p5 empty; do rm -fr ${NANO_OBJ}/_.${i}* done @@ -317,10 +319,10 @@ create_diskimage_mbr ( ) ( # bsd label [ -z ${NANO_NOPRIV_BUILD} ] || extra="-F ${NANO_METALOG}" sz=${NANO_SLICE_ROOT_SIZE:+-s ${NANO_SLICE_ROOT_SIZE}} - eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_OBJ}/_.${NANO_SLICE_ROOT}a" \ + eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_OBJ}/_.${NANO_SLICE_ROOT}" \ "${NANO_WORLDDIR}" - mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \ - -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} +# mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT} \ +# -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} # Populate the /cfg partition, empty if none given if [ -z "${NANO_CFGDIR}" ]; then @@ -339,8 +341,18 @@ create_diskimage_mbr ( ) ( if [ -n "$NANO_SLICE_FAT" ]; then eval $NANO_SLICE_FAT=fat16b fi - eval $NANO_SLICE_CFG=freebsd - eval $NANO_SLICE_ROOT=freebsd + case ${NANO_SLICE_CFG} in + s*) + echo slice + eval $NANO_SLICE_CFG=freebsd + eval $NANO_SLICE_ROOT=freebsd + ;; + p*) + echo part + eval $NANO_SLICE_CFG=freebsd-ufs + eval $NANO_SLICE_ROOT=freebsd-ufs + ;; + esac # below depends on https://reviews.freebsd.org/D4403 not yet in the tree # but there's problems: it marks all partitions as active, so you have to # boot off parittion 3 or 2 by hand if you're playing around with this WIP @@ -358,6 +370,25 @@ create_diskimage_mbr ( ) ( -p ${s2}:=${NANO_OBJ}/_.s2 \ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} ;; + std-uefi) + # s1 is boot, s2 is cfg, s3 is /, not sure how to make that + # boot (marked as active) with mkimg yet + mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr \ + -p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \ + -p ${s2}:=${NANO_OBJ}/_.s2 \ + -p ${s3}:=${NANO_OBJ}/_.s3 \ + -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + ;; + std-uefi-bios) + # p1 is boot for uefi, p2 is boot for gpt, p3 is cfg, p4 is / + # and p5 is alt-root (after resize) + mkimg -a 2 ${fmtarg} ${bootmbr} -s gpt \ + -p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \ + -p freebsd-boot:=${NAANO_WORLDDIR}/boot/gptboot \ + -p ${p3}:=${NANO_OBJ}/_.p3 \ + -p ${p4}:=${NANO_OBJ}/_.p4 \ + -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + ;; powerpc64-ibm) # A lie to make the boot loader work, it boots the first BSD partition # it finds, regardless of the active flag. @@ -658,6 +689,19 @@ powerpc64-apple) echo Not yet exit 1 ;; +std-uefi) + NANO_SLICE_UEFI=s1 + NANO_SLICE_CFG=s2 + NANO_SLICE_ROOT=s3 + NANO_SLICE_ALTROOT=s4 + ;; +std-uefi-bios) + NANO_SLICE_UEFI=p1 + NANO_SLICE_BOOT=p2 + NANO_SLICE_CFG=p3 + NANO_SLICE_ROOT=p4 + NANO_SLICE_ALTROOT=p5 + ;; *) echo Unknown Layout ${NANO_LAYOUT} exit 1 From owner-svn-src-head@freebsd.org Sat Jan 30 08:02:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D480A734FE; Sat, 30 Jan 2016 08:02:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D010160C; Sat, 30 Jan 2016 08:02:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0U82DN3036496; Sat, 30 Jan 2016 08:02:13 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U82Dq8036492; Sat, 30 Jan 2016 08:02:13 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601300802.u0U82Dq8036492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 30 Jan 2016 08:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295066 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 08:02:14 -0000 Author: mmel Date: Sat Jan 30 08:02:12 2016 New Revision: 295066 URL: https://svnweb.freebsd.org/changeset/base/295066 Log: ARM: Split swtch.S into common, ARMv4 and ARMv6 parts. Cleanup them. Added: head/sys/arm/arm/swtch-v4.S - copied, changed from r295065, head/sys/arm/arm/swtch.S head/sys/arm/arm/swtch-v6.S - copied, changed from r295065, head/sys/arm/arm/swtch.S Modified: head/sys/arm/arm/swtch.S head/sys/conf/files.arm Copied and modified: head/sys/arm/arm/swtch-v4.S (from r295065, head/sys/arm/arm/swtch.S) ============================================================================== --- head/sys/arm/arm/swtch.S Sat Jan 30 07:00:36 2016 (r295065, copy source) +++ head/sys/arm/arm/swtch-v4.S Sat Jan 30 08:02:12 2016 (r295066) @@ -89,19 +89,9 @@ __FBSDID("$FreeBSD$"); -#if __ARM_ARCH >= 6 && defined(SMP) -#define GET_PCPU(tmp, tmp2) \ - mrc p15, 0, tmp, c0, c0, 5; \ - and tmp, tmp, #0xf; \ - ldr tmp2, .Lcurpcpu+4; \ - mul tmp, tmp, tmp2; \ - ldr tmp2, .Lcurpcpu; \ - add tmp, tmp, tmp2; -#else #define GET_PCPU(tmp, tmp2) \ ldr tmp, .Lcurpcpu -#endif #ifdef VFP .fpu vfp /* allow VFP instructions */ @@ -114,8 +104,6 @@ __FBSDID("$FreeBSD$"); .word _C_LABEL(blocked_lock) -#if __ARM_ARCH < 6 - #define DOMAIN_CLIENT 0x01 .Lcpufuncs: @@ -147,10 +135,8 @@ ENTRY(cpu_throw) /* Switch to lwp0 context */ ldr r9, .Lcpufuncs -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) mov lr, pc ldr pc, [r9, #CF_IDCACHE_WBINV_ALL] -#endif ldr r0, [r7, #(PCB_PL1VEC)] ldr r1, [r7, #(PCB_DACR)] /* @@ -198,21 +184,16 @@ ENTRY(cpu_throw) str r7, [r6, #PC_CURPCB] /* We have a new curthread now so make a note it */ str r5, [r6, #PC_CURTHREAD] -#if __ARM_ARCH >= 6 - mcr p15, 0, r5, c13, c0, 4 -#endif + /* Set the new tp */ ldr r6, [r5, #(TD_MD + MD_TP)] -#if __ARM_ARCH >= 6 - mcr p15, 0, r6, c13, c0, 3 -#else ldr r4, =ARM_TP_ADDRESS str r6, [r4] ldr r6, [r5, #(TD_MD + MD_RAS_START)] str r6, [r4, #4] /* ARM_RAS_START */ ldr r6, [r5, #(TD_MD + MD_RAS_END)] str r6, [r4, #8] /* ARM_RAS_END */ -#endif + /* Restore all the saved registers and exit */ add r3, r7, #PCB_R4 ldmia r3, {r4-r12, sp, pc} @@ -245,9 +226,6 @@ ENTRY(cpu_switch) /* We have a new curthread now so make a note it */ GET_PCPU(r7, r2) str r1, [r7, #PC_CURTHREAD] -#if __ARM_ARCH >= 6 - mcr p15, 0, r1, c13, c0, 4 -#endif /* Hook in a new pcb */ ldr r2, [r1, #TD_PCB] @@ -259,14 +237,6 @@ ENTRY(cpu_switch) ldr r2, [r0, #(TD_PCB)] mov r4, r0 /* Save the old thread. */ -#if __ARM_ARCH >= 6 - /* - * Set new tp. No need to store the old one first, userland can't - * change it directly on armv6. - */ - ldr r9, [r1, #(TD_MD + MD_TP)] - mcr p15, 0, r9, c13, c0, 3 -#else /* Store the old tp; userland can change it on armv4. */ ldr r3, =ARM_TP_ADDRESS ldr r9, [r3] @@ -283,7 +253,6 @@ ENTRY(cpu_switch) str r9, [r3, #4] ldr r9, [r1, #(TD_MD + MD_RAS_END)] str r9, [r3, #8] -#endif /* Get the user structure for the new process in r9 */ ldr r9, [r1, #(TD_PCB)] @@ -327,7 +296,6 @@ ENTRY(cpu_switch) cmpeq r0, r5 /* Same DACR? */ beq .Lcs_context_switched /* yes! */ -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) /* * Definately need to flush the cache. */ @@ -335,7 +303,7 @@ ENTRY(cpu_switch) ldr r1, .Lcpufuncs mov lr, pc ldr pc, [r1, #CF_IDCACHE_WBINV_ALL] -#endif + .Lcs_cache_purge_skipped: /* rem: r6 = lock */ /* rem: r9 = new PCB */ @@ -399,14 +367,6 @@ ENTRY(cpu_switch) /* Release the old thread */ str r6, [r4, #TD_LOCK] -#if defined(SCHED_ULE) && defined(SMP) - ldr r6, .Lblocked_lock - GET_CURTHREAD_PTR(r3) -1: - ldr r4, [r3, #TD_LOCK] - cmp r4, r6 - beq 1b -#endif /* XXXSCW: Safe to re-enable FIQs here */ @@ -418,404 +378,4 @@ ENTRY(cpu_switch) END(cpu_switch) -#else /* __ARM_ARCH < 6 */ -#include - -ENTRY(cpu_context_switch) /* QQQ: What about macro instead of function? */ - DSB - mcr CP15_TTBR0(r0) /* set the new TTB */ - ISB - mov r0, #(CPU_ASID_KERNEL) - mcr CP15_TLBIASID(r0) /* flush not global TLBs */ - /* - * Flush entire Branch Target Cache because of the branch predictor - * is not architecturally invisible. See ARM Architecture Reference - * Manual ARMv7-A and ARMv7-R edition, page B2-1264(65), Branch - * predictors and Requirements for branch predictor maintenance - * operations sections. - * - * QQQ: The predictor is virtually addressed and holds virtual target - * addresses. Therefore, if mapping is changed, the predictor cache - * must be flushed.The flush is part of entire i-cache invalidation - * what is always called when code mapping is changed. So herein, - * it's the only place where standalone predictor flush must be - * executed in kernel (except self modifying code case). - */ - mcr CP15_BPIALL /* and flush entire Branch Target Cache */ - DSB - mov pc, lr -END(cpu_context_switch) - -/* - * cpu_throw(oldtd, newtd) - * - * Remove current thread state, then select the next thread to run - * and load its state. - * r0 = oldtd - * r1 = newtd - */ -ENTRY(cpu_throw) - mov r10, r0 /* r10 = oldtd */ - mov r11, r1 /* r11 = newtd */ - -#ifdef VFP /* This thread is dying, disable */ - bl _C_LABEL(vfp_discard) /* VFP without preserving state. */ -#endif - GET_PCPU(r8, r9) /* r8 = current pcpu */ - ldr r4, [r8, #PC_CPUID] /* r4 = current cpu id */ - - cmp r10, #0 /* old thread? */ - beq 2f /* no, skip */ - - /* Remove this CPU from the active list. */ - ldr r5, [r8, #PC_CURPMAP] - mov r0, #(PM_ACTIVE) - add r5, r0 /* r5 = old pm_active */ - - /* Compute position and mask. */ -#if _NCPUWORDS > 1 - lsr r0, r4, #3 - bic r0, #3 - add r5, r0 /* r5 = position in old pm_active */ - mov r2, #1 - and r0, r4, #31 - lsl r2, r0 /* r2 = mask */ -#else - mov r2, #1 - lsl r2, r4 /* r2 = mask */ -#endif - /* Clear cpu from old active list. */ -#ifdef SMP -1: ldrex r0, [r5] - bic r0, r2 - strex r1, r0, [r5] - teq r1, #0 - bne 1b -#else - ldr r0, [r5] - bic r0, r2 - str r0, [r5] -#endif - -2: -#ifdef INVARIANTS - cmp r11, #0 /* new thread? */ - beq badsw1 /* no, panic */ -#endif - ldr r7, [r11, #(TD_PCB)] /* r7 = new PCB */ - - /* - * Registers at this point - * r4 = current cpu id - * r7 = new PCB - * r8 = current pcpu - * r11 = newtd - */ - - /* MMU switch to new thread. */ - ldr r0, [r7, #(PCB_PAGEDIR)] -#ifdef INVARIANTS - cmp r0, #0 /* new thread? */ - beq badsw4 /* no, panic */ -#endif - bl _C_LABEL(cpu_context_switch) - - /* - * Set new PMAP as current one. - * Insert cpu to new active list. - */ - - ldr r6, [r11, #(TD_PROC)] /* newtd->proc */ - ldr r6, [r6, #(P_VMSPACE)] /* newtd->proc->vmspace */ - add r6, #VM_PMAP /* newtd->proc->vmspace->pmap */ - str r6, [r8, #PC_CURPMAP] /* store to curpmap */ - - mov r0, #PM_ACTIVE - add r6, r0 /* r6 = new pm_active */ - - /* compute position and mask */ -#if _NCPUWORDS > 1 - lsr r0, r4, #3 - bic r0, #3 - add r6, r0 /* r6 = position in new pm_active */ - mov r2, #1 - and r0, r4, #31 - lsl r2, r0 /* r2 = mask */ -#else - mov r2, #1 - lsl r2, r4 /* r2 = mask */ -#endif - /* Set cpu to new active list. */ -#ifdef SMP -1: ldrex r0, [r6] - orr r0, r2 - strex r1, r0, [r6] - teq r1, #0 - bne 1b -#else - ldr r0, [r6] - orr r0, r2 - str r0, [r6] -#endif - /* - * Registers at this point. - * r7 = new PCB - * r8 = current pcpu - * r11 = newtd - * They must match the ones in sw1 position !!! - */ - DMB - b sw1 /* share new thread init with cpu_switch() */ -END(cpu_throw) - -/* - * cpu_switch(oldtd, newtd, lock) - * - * Save the current thread state, then select the next thread to run - * and load its state. - * r0 = oldtd - * r1 = newtd - * r2 = lock (new lock for old thread) - */ -ENTRY(cpu_switch) - /* Interrupts are disabled. */ -#ifdef INVARIANTS - cmp r0, #0 /* old thread? */ - beq badsw2 /* no, panic */ -#endif - /* Save all the registers in the old thread's pcb. */ - ldr r3, [r0, #(TD_PCB)] - add r3, #(PCB_R4) - stmia r3, {r4-r12, sp, lr, pc} - -#ifdef INVARIANTS - cmp r1, #0 /* new thread? */ - beq badsw3 /* no, panic */ -#endif - /* - * Save arguments. Note that we can now use r0-r14 until - * it is time to restore them for the new thread. However, - * some registers are not safe over function call. - */ - mov r9, r2 /* r9 = lock */ - mov r10, r0 /* r10 = oldtd */ - mov r11, r1 /* r11 = newtd */ - - GET_PCPU(r8, r3) /* r8 = current PCPU */ - ldr r7, [r11, #(TD_PCB)] /* r7 = newtd->td_pcb */ - - - -#ifdef VFP - ldr r3, [r10, #(TD_PCB)] - fmrx r0, fpexc /* If the VFP is enabled */ - tst r0, #(VFPEXC_EN) /* the current thread has */ - movne r1, #1 /* used it, so go save */ - addne r0, r3, #(PCB_VFPSTATE) /* the state into the PCB */ - blne _C_LABEL(vfp_store) /* and disable the VFP. */ -#endif - - /* - * MMU switch. If we're switching to a thread with the same - * address space as the outgoing one, we can skip the MMU switch. - */ - mrc CP15_TTBR0(r1) /* r1 = old TTB */ - ldr r0, [r7, #(PCB_PAGEDIR)] /* r0 = new TTB */ - cmp r0, r1 /* Switching to the TTB? */ - beq sw0 /* same TTB, skip */ - -#ifdef INVARIANTS - cmp r0, #0 /* new thread? */ - beq badsw4 /* no, panic */ -#endif - - bl cpu_context_switch /* new TTB as argument */ - - /* - * Registers at this point - * r7 = new PCB - * r8 = current pcpu - * r9 = lock - * r10 = oldtd - * r11 = newtd - */ - - /* - * Set new PMAP as current one. - * Update active list on PMAPs. - */ - ldr r6, [r11, #TD_PROC] /* newtd->proc */ - ldr r6, [r6, #P_VMSPACE] /* newtd->proc->vmspace */ - add r6, #VM_PMAP /* newtd->proc->vmspace->pmap */ - - ldr r5, [r8, #PC_CURPMAP] /* get old curpmap */ - str r6, [r8, #PC_CURPMAP] /* and save new one */ - - mov r0, #PM_ACTIVE - add r5, r0 /* r5 = old pm_active */ - add r6, r0 /* r6 = new pm_active */ - - /* Compute position and mask. */ - ldr r4, [r8, #PC_CPUID] -#if _NCPUWORDS > 1 - lsr r0, r4, #3 - bic r0, #3 - add r5, r0 /* r5 = position in old pm_active */ - add r6, r0 /* r6 = position in new pm_active */ - mov r2, #1 - and r0, r4, #31 - lsl r2, r0 /* r2 = mask */ -#else - mov r2, #1 - lsl r2, r4 /* r2 = mask */ -#endif - /* Clear cpu from old active list. */ -#ifdef SMP -1: ldrex r0, [r5] - bic r0, r2 - strex r1, r0, [r5] - teq r1, #0 - bne 1b -#else - ldr r0, [r5] - bic r0, r2 - str r0, [r5] -#endif - /* Set cpu to new active list. */ -#ifdef SMP -1: ldrex r0, [r6] - orr r0, r2 - strex r1, r0, [r6] - teq r1, #0 - bne 1b -#else - ldr r0, [r6] - orr r0, r2 - str r0, [r6] -#endif - -sw0: - /* - * Registers at this point - * r7 = new PCB - * r8 = current pcpu - * r9 = lock - * r10 = oldtd - * r11 = newtd - */ - - /* Change the old thread lock. */ - add r5, r10, #TD_LOCK - DMB -1: ldrex r0, [r5] - strex r1, r9, [r5] - teq r1, #0 - bne 1b - DMB - -sw1: - clrex - /* - * Registers at this point - * r7 = new PCB - * r8 = current pcpu - * r11 = newtd - */ - -#if defined(SMP) && defined(SCHED_ULE) - /* - * 386 and amd64 do the blocked lock test only for SMP and SCHED_ULE - * QQQ: What does it mean in reality and why is it done? - */ - ldr r6, =blocked_lock -1: - ldr r3, [r11, #TD_LOCK] /* atomic write regular read */ - cmp r3, r6 - beq 1b -#endif - /* Set the new tls */ - ldr r0, [r11, #(TD_MD + MD_TP)] - mcr CP15_TPIDRURO(r0) /* write tls thread reg 2 */ - - /* We have a new curthread now so make a note it */ - str r11, [r8, #PC_CURTHREAD] - mcr CP15_TPIDRPRW(r11) - - /* store pcb in per cpu structure */ - str r7, [r8, #PC_CURPCB] - - /* - * Restore all saved registers and return. Note that some saved - * registers can be changed when either cpu_fork(), cpu_set_upcall(), - * cpu_set_fork_handler(), or makectx() was called. - */ - add r3, r7, #PCB_R4 - ldmia r3, {r4-r12, sp, pc} - -#ifdef INVARIANTS -badsw1: - ldr r0, =sw1_panic_str - bl _C_LABEL(panic) -1: nop - b 1b - -badsw2: - ldr r0, =sw2_panic_str - bl _C_LABEL(panic) -1: nop - b 1b - -badsw3: - ldr r0, =sw3_panic_str - bl _C_LABEL(panic) -1: nop - b 1b - -badsw4: - ldr r0, =sw4_panic_str - bl _C_LABEL(panic) -1: nop - b 1b - -sw1_panic_str: - .asciz "cpu_throw: no newthread supplied.\n" -sw2_panic_str: - .asciz "cpu_switch: no curthread supplied.\n" -sw3_panic_str: - .asciz "cpu_switch: no newthread supplied.\n" -sw4_panic_str: - .asciz "cpu_switch: new pagedir is NULL.\n" -#endif -END(cpu_switch) - - -#endif /* __ARM_ARCH < 6 */ - -ENTRY(savectx) - stmfd sp!, {lr} - sub sp, sp, #4 - - /* Store all the registers in the thread's pcb */ - add r3, r0, #(PCB_R4) - stmia r3, {r4-r12, sp, lr, pc} -#ifdef VFP - fmrx r2, fpexc /* If the VFP is enabled */ - tst r2, #(VFPEXC_EN) /* the current thread has */ - movne r1, #1 /* used it, so go save */ - addne r0, r0, #(PCB_VFPSTATE) /* the state into the PCB */ - blne _C_LABEL(vfp_store) /* and disable the VFP. */ -#endif - add sp, sp, #4; - ldmfd sp!, {pc} -END(savectx) - -ENTRY(fork_trampoline) - STOP_UNWINDING /* EABI: Don't unwind beyond the thread enty point. */ - mov fp, #0 /* OABI: Stack traceback via fp stops here. */ - mov r2, sp - mov r1, r5 - mov r0, r4 - ldr lr, =swi_exit /* Go finish forking, then return */ - b _C_LABEL(fork_exit) /* to userland via swi_exit code. */ -END(fork_trampoline) Copied and modified: head/sys/arm/arm/swtch-v6.S (from r295065, head/sys/arm/arm/swtch.S) ============================================================================== --- head/sys/arm/arm/swtch.S Sat Jan 30 07:00:36 2016 (r295065, copy source) +++ head/sys/arm/arm/swtch-v6.S Sat Jan 30 08:02:12 2016 (r295066) @@ -114,311 +114,6 @@ __FBSDID("$FreeBSD$"); .word _C_LABEL(blocked_lock) -#if __ARM_ARCH < 6 - -#define DOMAIN_CLIENT 0x01 - -.Lcpufuncs: - .word _C_LABEL(cpufuncs) - -/* - * cpu_throw(oldtd, newtd) - * - * Remove current thread state, then select the next thread to run - * and load its state. - * r0 = oldtd - * r1 = newtd - */ -ENTRY(cpu_throw) - mov r5, r1 - - /* - * r0 = oldtd - * r5 = newtd - */ - -#ifdef VFP /* This thread is dying, disable */ - bl _C_LABEL(vfp_discard) /* VFP without preserving state. */ -#endif - - GET_PCPU(r7, r9) - ldr r7, [r5, #(TD_PCB)] /* r7 = new thread's PCB */ - - /* Switch to lwp0 context */ - - ldr r9, .Lcpufuncs -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) - mov lr, pc - ldr pc, [r9, #CF_IDCACHE_WBINV_ALL] -#endif - ldr r0, [r7, #(PCB_PL1VEC)] - ldr r1, [r7, #(PCB_DACR)] - /* - * r0 = Pointer to L1 slot for vector_page (or NULL) - * r1 = lwp0's DACR - * r5 = lwp0 - * r7 = lwp0's PCB - * r9 = cpufuncs - */ - - /* - * Ensure the vector table is accessible by fixing up lwp0's L1 - */ - cmp r0, #0 /* No need to fixup vector table? */ - ldrne r3, [r0] /* But if yes, fetch current value */ - ldrne r2, [r7, #(PCB_L1VEC)] /* Fetch new vector_page value */ - mcr p15, 0, r1, c3, c0, 0 /* Update DACR for lwp0's context */ - cmpne r3, r2 /* Stuffing the same value? */ - strne r2, [r0] /* Store if not. */ - -#ifdef PMAP_INCLUDE_PTE_SYNC - /* - * Need to sync the cache to make sure that last store is - * visible to the MMU. - */ - movne r1, #4 - movne lr, pc - ldrne pc, [r9, #CF_DCACHE_WB_RANGE] -#endif /* PMAP_INCLUDE_PTE_SYNC */ - - /* - * Note: We don't do the same optimisation as cpu_switch() with - * respect to avoiding flushing the TLB if we're switching to - * the same L1 since this process' VM space may be about to go - * away, so we don't want *any* turds left in the TLB. - */ - - /* Switch the memory to the new process */ - ldr r0, [r7, #(PCB_PAGEDIR)] - mov lr, pc - ldr pc, [r9, #CF_CONTEXT_SWITCH] - - GET_PCPU(r6, r4) - /* Hook in a new pcb */ - str r7, [r6, #PC_CURPCB] - /* We have a new curthread now so make a note it */ - str r5, [r6, #PC_CURTHREAD] -#if __ARM_ARCH >= 6 - mcr p15, 0, r5, c13, c0, 4 -#endif - /* Set the new tp */ - ldr r6, [r5, #(TD_MD + MD_TP)] -#if __ARM_ARCH >= 6 - mcr p15, 0, r6, c13, c0, 3 -#else - ldr r4, =ARM_TP_ADDRESS - str r6, [r4] - ldr r6, [r5, #(TD_MD + MD_RAS_START)] - str r6, [r4, #4] /* ARM_RAS_START */ - ldr r6, [r5, #(TD_MD + MD_RAS_END)] - str r6, [r4, #8] /* ARM_RAS_END */ -#endif - /* Restore all the saved registers and exit */ - add r3, r7, #PCB_R4 - ldmia r3, {r4-r12, sp, pc} -END(cpu_throw) - -/* - * cpu_switch(oldtd, newtd, lock) - * - * Save the current thread state, then select the next thread to run - * and load its state. - * r0 = oldtd - * r1 = newtd - * r2 = lock (new lock for old thread) - */ -ENTRY(cpu_switch) - /* Interrupts are disabled. */ - /* Save all the registers in the old thread's pcb. */ - ldr r3, [r0, #(TD_PCB)] - - /* Restore all the saved registers and exit */ - add r3, #(PCB_R4) - stmia r3, {r4-r12, sp, lr, pc} - - mov r6, r2 /* Save the mutex */ - - /* rem: r0 = old lwp */ - /* rem: interrupts are disabled */ - - /* Process is now on a processor. */ - /* We have a new curthread now so make a note it */ - GET_PCPU(r7, r2) - str r1, [r7, #PC_CURTHREAD] -#if __ARM_ARCH >= 6 - mcr p15, 0, r1, c13, c0, 4 -#endif - - /* Hook in a new pcb */ - ldr r2, [r1, #TD_PCB] - str r2, [r7, #PC_CURPCB] - - /* Stage two : Save old context */ - - /* Get the user structure for the old thread. */ - ldr r2, [r0, #(TD_PCB)] - mov r4, r0 /* Save the old thread. */ - -#if __ARM_ARCH >= 6 - /* - * Set new tp. No need to store the old one first, userland can't - * change it directly on armv6. - */ - ldr r9, [r1, #(TD_MD + MD_TP)] - mcr p15, 0, r9, c13, c0, 3 -#else - /* Store the old tp; userland can change it on armv4. */ - ldr r3, =ARM_TP_ADDRESS - ldr r9, [r3] - str r9, [r0, #(TD_MD + MD_TP)] - ldr r9, [r3, #4] - str r9, [r0, #(TD_MD + MD_RAS_START)] - ldr r9, [r3, #8] - str r9, [r0, #(TD_MD + MD_RAS_END)] - - /* Set the new tp */ - ldr r9, [r1, #(TD_MD + MD_TP)] - str r9, [r3] - ldr r9, [r1, #(TD_MD + MD_RAS_START)] - str r9, [r3, #4] - ldr r9, [r1, #(TD_MD + MD_RAS_END)] - str r9, [r3, #8] -#endif - - /* Get the user structure for the new process in r9 */ - ldr r9, [r1, #(TD_PCB)] - - /* rem: r2 = old PCB */ - /* rem: r9 = new PCB */ - /* rem: interrupts are enabled */ - -#ifdef VFP - fmrx r0, fpexc /* If the VFP is enabled */ - tst r0, #(VFPEXC_EN) /* the current thread has */ - movne r1, #1 /* used it, so go save */ - addne r0, r2, #(PCB_VFPSTATE) /* the state into the PCB */ - blne _C_LABEL(vfp_store) /* and disable the VFP. */ -#endif - - /* r0-r3 now free! */ - - /* Third phase : restore saved context */ - - /* rem: r2 = old PCB */ - /* rem: r9 = new PCB */ - - ldr r5, [r9, #(PCB_DACR)] /* r5 = new DACR */ - mov r2, #DOMAIN_CLIENT - cmp r5, r2, lsl #(PMAP_DOMAIN_KERNEL * 2) /* Sw to kernel thread? */ - beq .Lcs_context_switched /* Yup. Don't flush cache */ - mrc p15, 0, r0, c3, c0, 0 /* r0 = old DACR */ - /* - * Get the new L1 table pointer into r11. If we're switching to - * an LWP with the same address space as the outgoing one, we can - * skip the cache purge and the TTB load. - * - * To avoid data dep stalls that would happen anyway, we try - * and get some useful work done in the mean time. - */ - mrc p15, 0, r10, c2, c0, 0 /* r10 = old L1 */ - ldr r11, [r9, #(PCB_PAGEDIR)] /* r11 = new L1 */ - - teq r10, r11 /* Same L1? */ - cmpeq r0, r5 /* Same DACR? */ - beq .Lcs_context_switched /* yes! */ - -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) - /* - * Definately need to flush the cache. - */ - - ldr r1, .Lcpufuncs - mov lr, pc - ldr pc, [r1, #CF_IDCACHE_WBINV_ALL] -#endif -.Lcs_cache_purge_skipped: - /* rem: r6 = lock */ - /* rem: r9 = new PCB */ - /* rem: r10 = old L1 */ - /* rem: r11 = new L1 */ - - mov r2, #0x00000000 - ldr r7, [r9, #(PCB_PL1VEC)] - - /* - * Ensure the vector table is accessible by fixing up the L1 - */ - cmp r7, #0 /* No need to fixup vector table? */ - ldrne r2, [r7] /* But if yes, fetch current value */ - ldrne r0, [r9, #(PCB_L1VEC)] /* Fetch new vector_page value */ - mcr p15, 0, r5, c3, c0, 0 /* Update DACR for new context */ - cmpne r2, r0 /* Stuffing the same value? */ -#ifndef PMAP_INCLUDE_PTE_SYNC - strne r0, [r7] /* Nope, update it */ -#else - beq .Lcs_same_vector - str r0, [r7] /* Otherwise, update it */ - - /* - * Need to sync the cache to make sure that last store is - * visible to the MMU. - */ - ldr r2, .Lcpufuncs - mov r0, r7 - mov r1, #4 - mov lr, pc - ldr pc, [r2, #CF_DCACHE_WB_RANGE] - -.Lcs_same_vector: -#endif /* PMAP_INCLUDE_PTE_SYNC */ - - cmp r10, r11 /* Switching to the same L1? */ - ldr r10, .Lcpufuncs - beq .Lcs_same_l1 /* Yup. */ - /* - * Do a full context switch, including full TLB flush. - */ - mov r0, r11 - mov lr, pc - ldr pc, [r10, #CF_CONTEXT_SWITCH] - - b .Lcs_context_switched - - /* - * We're switching to a different process in the same L1. - * In this situation, we only need to flush the TLB for the - * vector_page mapping, and even then only if r7 is non-NULL. - */ -.Lcs_same_l1: - cmp r7, #0 - movne r0, #0 /* We *know* vector_page's VA is 0x0 */ - movne lr, pc - ldrne pc, [r10, #CF_TLB_FLUSHID_SE] - -.Lcs_context_switched: - - /* Release the old thread */ - str r6, [r4, #TD_LOCK] -#if defined(SCHED_ULE) && defined(SMP) - ldr r6, .Lblocked_lock - GET_CURTHREAD_PTR(r3) -1: - ldr r4, [r3, #TD_LOCK] - cmp r4, r6 - beq 1b -#endif - - /* XXXSCW: Safe to re-enable FIQs here */ - - /* rem: r9 = new PCB */ - - /* Restore all the saved registers and exit */ - add r3, r9, #PCB_R4 - ldmia r3, {r4-r12, sp, pc} -END(cpu_switch) - - -#else /* __ARM_ARCH < 6 */ #include ENTRY(cpu_context_switch) /* QQQ: What about macro instead of function? */ @@ -787,35 +482,3 @@ sw4_panic_str: .asciz "cpu_switch: new pagedir is NULL.\n" #endif END(cpu_switch) - - -#endif /* __ARM_ARCH < 6 */ - -ENTRY(savectx) - stmfd sp!, {lr} - sub sp, sp, #4 - - /* Store all the registers in the thread's pcb */ - add r3, r0, #(PCB_R4) - stmia r3, {r4-r12, sp, lr, pc} -#ifdef VFP - fmrx r2, fpexc /* If the VFP is enabled */ - tst r2, #(VFPEXC_EN) /* the current thread has */ - movne r1, #1 /* used it, so go save */ - addne r0, r0, #(PCB_VFPSTATE) /* the state into the PCB */ - blne _C_LABEL(vfp_store) /* and disable the VFP. */ -#endif - add sp, sp, #4; - ldmfd sp!, {pc} -END(savectx) - -ENTRY(fork_trampoline) - STOP_UNWINDING /* EABI: Don't unwind beyond the thread enty point. */ - mov fp, #0 /* OABI: Stack traceback via fp stops here. */ - mov r2, sp - mov r1, r5 - mov r0, r4 - ldr lr, =swi_exit /* Go finish forking, then return */ - b _C_LABEL(fork_exit) /* to userland via swi_exit code. */ -END(fork_trampoline) - Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sat Jan 30 07:00:36 2016 (r295065) +++ head/sys/arm/arm/swtch.S Sat Jan 30 08:02:12 2016 (r295066) @@ -79,9 +79,7 @@ */ #include "assym.s" -#include "opt_sched.h" -#include #include #include #include @@ -89,708 +87,10 @@ __FBSDID("$FreeBSD$"); -#if __ARM_ARCH >= 6 && defined(SMP) -#define GET_PCPU(tmp, tmp2) \ - mrc p15, 0, tmp, c0, c0, 5; \ - and tmp, tmp, #0xf; \ - ldr tmp2, .Lcurpcpu+4; \ - mul tmp, tmp, tmp2; \ - ldr tmp2, .Lcurpcpu; \ - add tmp, tmp, tmp2; -#else - -#define GET_PCPU(tmp, tmp2) \ - ldr tmp, .Lcurpcpu -#endif - #ifdef VFP .fpu vfp /* allow VFP instructions */ #endif -.Lcurpcpu: - .word _C_LABEL(__pcpu) - .word PCPU_SIZE -.Lblocked_lock: - .word _C_LABEL(blocked_lock) - - -#if __ARM_ARCH < 6 - -#define DOMAIN_CLIENT 0x01 - -.Lcpufuncs: - .word _C_LABEL(cpufuncs) - -/* - * cpu_throw(oldtd, newtd) - * - * Remove current thread state, then select the next thread to run - * and load its state. - * r0 = oldtd - * r1 = newtd - */ -ENTRY(cpu_throw) - mov r5, r1 - - /* - * r0 = oldtd - * r5 = newtd - */ - -#ifdef VFP /* This thread is dying, disable */ - bl _C_LABEL(vfp_discard) /* VFP without preserving state. */ -#endif - - GET_PCPU(r7, r9) - ldr r7, [r5, #(TD_PCB)] /* r7 = new thread's PCB */ - - /* Switch to lwp0 context */ - - ldr r9, .Lcpufuncs -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) - mov lr, pc - ldr pc, [r9, #CF_IDCACHE_WBINV_ALL] -#endif - ldr r0, [r7, #(PCB_PL1VEC)] - ldr r1, [r7, #(PCB_DACR)] - /* - * r0 = Pointer to L1 slot for vector_page (or NULL) - * r1 = lwp0's DACR - * r5 = lwp0 - * r7 = lwp0's PCB - * r9 = cpufuncs - */ - - /* - * Ensure the vector table is accessible by fixing up lwp0's L1 - */ - cmp r0, #0 /* No need to fixup vector table? */ - ldrne r3, [r0] /* But if yes, fetch current value */ - ldrne r2, [r7, #(PCB_L1VEC)] /* Fetch new vector_page value */ - mcr p15, 0, r1, c3, c0, 0 /* Update DACR for lwp0's context */ - cmpne r3, r2 /* Stuffing the same value? */ - strne r2, [r0] /* Store if not. */ - -#ifdef PMAP_INCLUDE_PTE_SYNC - /* - * Need to sync the cache to make sure that last store is - * visible to the MMU. - */ - movne r1, #4 - movne lr, pc - ldrne pc, [r9, #CF_DCACHE_WB_RANGE] -#endif /* PMAP_INCLUDE_PTE_SYNC */ - - /* - * Note: We don't do the same optimisation as cpu_switch() with - * respect to avoiding flushing the TLB if we're switching to - * the same L1 since this process' VM space may be about to go - * away, so we don't want *any* turds left in the TLB. - */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jan 30 08:27:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81621A73B85; Sat, 30 Jan 2016 08:27:10 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5246927E; Sat, 30 Jan 2016 08:27:10 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0U8R9ZA042502; Sat, 30 Jan 2016 08:27:09 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U8R9QY042501; Sat, 30 Jan 2016 08:27:09 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601300827.u0U8R9QY042501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 30 Jan 2016 08:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295067 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 08:27:10 -0000 Author: mmel Date: Sat Jan 30 08:27:09 2016 New Revision: 295067 URL: https://svnweb.freebsd.org/changeset/base/295067 Log: EHCI: Correct address of EHCI_USBMODE_LPM register is 0xC8, not 0xA8. Modified: head/sys/dev/usb/controller/ehcireg.h Modified: head/sys/dev/usb/controller/ehcireg.h ============================================================================== --- head/sys/dev/usb/controller/ehcireg.h Sat Jan 30 08:02:12 2016 (r295066) +++ head/sys/dev/usb/controller/ehcireg.h Sat Jan 30 08:27:09 2016 (r295067) @@ -167,7 +167,7 @@ * bits are equal */ #define EHCI_USBMODE_NOLPM 0x68 /* RW USB Device mode reg (no LPM) */ -#define EHCI_USBMODE_LPM 0xA8 /* RW USB Device mode reg (LPM) */ +#define EHCI_USBMODE_LPM 0xC8 /* RW USB Device mode reg (LPM) */ #define EHCI_UM_CM 0x00000003 /* R/WO Controller Mode */ #define EHCI_UM_CM_IDLE 0x0 /* Idle */ #define EHCI_UM_CM_HOST 0x3 /* Host Controller */ From owner-svn-src-head@freebsd.org Sat Jan 30 08:51:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C4D4A724DD; Sat, 30 Jan 2016 08:51:23 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com [IPv6:2a00:1450:4010:c07::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 7D05410D2; Sat, 30 Jan 2016 08:51:22 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by mail-lf0-x22f.google.com with SMTP id j78so667763lfb.1; Sat, 30 Jan 2016 00:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=MRhTXc977mpKDy+p1xB3To1DC5+T446tSXjxW1QZwEc=; b=F35R36m3ClgWhCv6bBgd0Up725A87RS20f32nGsB5dw5Cg6qCxYfjLh5UnmCKQo1C9 gVWXPcXA9H4V7K3anTMD6QvMUrfAaAKyynC+Vc0coqbhV04Rj3LapVtGgaMi8eB6Lvxy j65Ka+Fv8148spxJVPmdgk1txmR/otg2CQSB75y+0Kie/CjIWJDpqhv6V9EjWjUOFxV+ JYRR6xFiSfBpPziVhnntEVTdgTUU4MxzBnq/bvlrnXxy2UcN5UNdhptpDPW4erZnGC9M 5k2fIhNLU1ZG8x38+vdlj/qZUTaqOkxvXRMilCoyBnITHDpo7Rxkz3Ugw3KdPeFgZXzm +GNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cochard-me.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=MRhTXc977mpKDy+p1xB3To1DC5+T446tSXjxW1QZwEc=; b=OsGXCUBlDX1O2DxotCpqEosez0391UxQH7D5fd83QCtBdU/LqY6oZ6uD+D1S7VpC/x 1a7KelllKbvHbFQpLuwL+F3USg42Q1KYxXEMKDtJ84tYZP1k1xj1/ZNEhs8b3rX5NVIn J1ksNay1vvT6M7uM0PrMcFEAxk9dBDvk2/JTHVjUtS+P1oawxG13ej2Y9a6XjjTS50zG yowLv2e/EWCCUEcpC2fMi0S/jJ+pSEL7jGyh8i2rvtjyhSAkc+DxOdPv6yMJiE6fNQlv ZQAMNdnbp5/J77e2X83GfbSCYqrkcQs+Z3j/dVBT5UuP2wIRqonlyN3fMHRRlIHPank9 YSTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=MRhTXc977mpKDy+p1xB3To1DC5+T446tSXjxW1QZwEc=; b=jf7id1BLZ72Mt+nvnWeI1K2YREpb21hnEOGDzkCyR6gg+AmMy+9dw1evOf43wkNgP5 eYKbuldOxl6Sesm5xvSh1n17Or20Jb2SEN3LdY1yxdY4Fg0izLb4jYJe+oTi0uD4dszv Aeg9lJspJWRvcDENf8InDOL9l2fvnOgzSrxTQld86pza2aeRusW5rHFE0e3EwZ8o8k2u 5UX5SUQhHOHDOeworq74Cw4yNzY01/ZkzQiq1HoiTj/JyBx8xnZdNh9O47512faYVYCX /bXp6OdpK44VgSpC0DgWbC1/wuX5gPCF+hNF7Xk++MnS0HiAowgti/3TT7PSBKkf4RNy rPvQ== X-Gm-Message-State: AG10YORkNqqXPD4TpqwMK83/8WhaKNFgikXlgmW5mhCfObDsLRYSLoSQbmqVn0cm8ze092QrP8fwJjWwROtYdw== X-Received: by 10.25.15.226 with SMTP id 95mr5153167lfp.85.1454143880205; Sat, 30 Jan 2016 00:51:20 -0800 (PST) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.25.136.11 with HTTP; Sat, 30 Jan 2016 00:51:00 -0800 (PST) In-Reply-To: <201601300618.u0U6Ibm8005064@repo.freebsd.org> References: <201601300618.u0U6Ibm8005064@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Sat, 30 Jan 2016 09:51:00 +0100 X-Google-Sender-Auth: ZvHbiXB3WBPbwV1IJd8-fLJkTq8 Message-ID: Subject: Re: svn commit: r295062 - head/sbin/nvmecontrol To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 08:51:23 -0000 On Sat, Jan 30, 2016 at 7:18 AM, Warner Losh wrote: > Author: imp > Date: Sat Jan 30 06:18:37 2016 > New Revision: 295062 > URL: https://svnweb.freebsd.org/changeset/base/295062 > > Log: > Implement power command to list all power modes, find out the power > mode we're in and to set the power mode. > > Added: > head/sbin/nvmecontrol/power.c (contents, props changed) > =E2=80=8BHi Warner, my buildworld is no more happy ;-)=E2=80=8B --- power.o --- /usr/src/sbin/nvmecontrol/power.c:44:16: error: invalid application of 'sizeof' to an incomplete type 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ --- all_subdir_kerberos5 --- --- inquire_cred_by_mech.po --- --- all_subdir_sbin --- /usr/src/sbin/nvmecontrol/power.c:60:14: error: incomplete definition of type 'struct nvme_power_state' mpower =3D nps->mp; ~~~^ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ /usr/src/sbin/nvmecontrol/power.c:61:9: error: incomplete definition of type 'struct nvme_power_state' if (nps->mps =3D=3D 0) ~~~^ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ /usr/src/sbin/nvmecontrol/power.c:63:14: error: incomplete definition of type 'struct nvme_power_state' ipower =3D nps->idlp; ~~~^ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ /usr/src/sbin/nvmecontrol/power.c:64:9: error: incomplete definition of type 'struct nvme_power_state' if (nps->ips =3D=3D 1) ~~~^ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ /usr/src/sbin/nvmecontrol/power.c:66:14: error: incomplete definition of type 'struct nvme_power_state' apower =3D nps->actp; ~~~^ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ /usr/src/sbin/nvmecontrol/power.c:67:9: error: incomplete definition of type 'struct nvme_power_state' if (nps->aps =3D=3D 1) ~~~^ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ /usr/src/sbin/nvmecontrol/power.c:71:12: error: incomplete definition of type 'struct nvme_power_state' nps->nops ? '*' : ' ', nps->enlat / 1000, nps->enlat % 1000, ~~~^ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, ^ /usr/src/sbin/nvmecontrol/power.c:71:35: error: incomplete definition of type 'struct nvme_power_state' nps->nops ? '*' : ' ', nps->enlat / 1000, nps->enlat % 1000, ~~~^ /usr/src/sbin/nvmecontrol/power.c:44:30: note: forward declaration of 'struct nvme_power_state' _Static_assert(sizeof(struct nvme_power_state) =3D=3D 256 / NBBY, etc. =E2=80=8B From owner-svn-src-head@freebsd.org Sat Jan 30 10:10:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D738A73F64; Sat, 30 Jan 2016 10:10:30 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E24F1036; Sat, 30 Jan 2016 10:10:30 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UAATEl071293; Sat, 30 Jan 2016 10:10:29 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UAATSQ071292; Sat, 30 Jan 2016 10:10:29 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601301010.u0UAATSQ071292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 30 Jan 2016 10:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295068 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 10:10:30 -0000 Author: mmel Date: Sat Jan 30 10:10:29 2016 New Revision: 295068 URL: https://svnweb.freebsd.org/changeset/base/295068 Log: ARM: Don't misuse ARM_TP_ADDRESS as ARMv4 / ARMv6 selector. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Jan 30 08:27:09 2016 (r295067) +++ head/sys/arm/arm/machdep.c Sat Jan 30 10:10:29 2016 (r295068) @@ -427,11 +427,9 @@ cpu_startup(void *dummy) { struct pcb *pcb = thread0.td_pcb; const unsigned int mbyte = 1024 * 1024; -#ifdef ARM_TP_ADDRESS -#ifndef ARM_CACHE_LOCK_ENABLE +#if __ARM_ARCH < 6 && !defined(ARM_CACHE_LOCK_ENABLE) vm_page_t m; #endif -#endif identify_arm_cpu(); @@ -456,11 +454,9 @@ cpu_startup(void *dummy) pcb->pcb_regs.sf_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; pmap_set_pcb_pagedir(kernel_pmap, pcb); -#if __ARM_ARCH < 6 +#if __ARM_ARCH < 6 vector_page_setprot(VM_PROT_READ); pmap_postinit(); -#endif -#ifdef ARM_TP_ADDRESS #ifdef ARM_CACHE_LOCK_ENABLE pmap_kenter_user(ARM_TP_ADDRESS, ARM_TP_ADDRESS); arm_lock_cache_line(ARM_TP_ADDRESS); From owner-svn-src-head@freebsd.org Sat Jan 30 10:39:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5C5AA7278F; Sat, 30 Jan 2016 10:39:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id AD4E71BFC; Sat, 30 Jan 2016 10:39:06 +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 u0UAd5Rc079940; Sat, 30 Jan 2016 10:39:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UAd5d6079939; Sat, 30 Jan 2016 10:39:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601301039.u0UAd5d6079939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 30 Jan 2016 10:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295069 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 10:39:07 -0000 Author: tuexen Date: Sat Jan 30 10:39:05 2016 New Revision: 295069 URL: https://svnweb.freebsd.org/changeset/base/295069 Log: Ignore peer addresses in a consistent way also when checking for new addresses during restart. If this is not done, restart doesn't work when the local socket is IPv4 only and the peer uses IPv4 and IPv6 addresses. MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Jan 30 10:10:29 2016 (r295068) +++ head/sys/netinet/sctp_output.c Sat Jan 30 10:39:05 2016 (r295069) @@ -5307,6 +5307,7 @@ sctp_are_there_new_addresses(struct sctp uint16_t ptype, plen; uint8_t fnd; struct sctp_nets *net; + int check_src; #ifdef INET struct sockaddr_in sin4, *sa4; @@ -5328,39 +5329,61 @@ sctp_are_there_new_addresses(struct sctp sin6.sin6_len = sizeof(sin6); #endif /* First what about the src address of the pkt ? */ - fnd = 0; - TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - sa = (struct sockaddr *)&net->ro._l_addr; - if (sa->sa_family == src->sa_family) { + check_src = 0; + switch (src->sa_family) { #ifdef INET - if (sa->sa_family == AF_INET) { - struct sockaddr_in *src4; + case AF_INET: + if (asoc->scope.ipv4_addr_legal) { + check_src = 1; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (asoc->scope.ipv6_addr_legal) { + check_src = 1; + } + break; +#endif + default: + /* TSNH */ + break; + } + if (check_src) { + fnd = 0; + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + sa = (struct sockaddr *)&net->ro._l_addr; + if (sa->sa_family == src->sa_family) { +#ifdef INET + if (sa->sa_family == AF_INET) { + struct sockaddr_in *src4; - sa4 = (struct sockaddr_in *)sa; - src4 = (struct sockaddr_in *)src; - if (sa4->sin_addr.s_addr == src4->sin_addr.s_addr) { - fnd = 1; - break; + sa4 = (struct sockaddr_in *)sa; + src4 = (struct sockaddr_in *)src; + if (sa4->sin_addr.s_addr == src4->sin_addr.s_addr) { + fnd = 1; + break; + } } - } #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *src6; + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *src6; - sa6 = (struct sockaddr_in6 *)sa; - src6 = (struct sockaddr_in6 *)src; - if (SCTP6_ARE_ADDR_EQUAL(sa6, src6)) { - fnd = 1; - break; + sa6 = (struct sockaddr_in6 *)sa; + src6 = (struct sockaddr_in6 *)src; + if (SCTP6_ARE_ADDR_EQUAL(sa6, src6)) { + fnd = 1; + break; + } } - } #endif + } + } + if (fnd == 0) { + /* New address added! no need to look futher. */ + return (1); } - } - if (fnd == 0) { - /* New address added! no need to look futher. */ - return (1); } /* Ok so far lets munge through the rest of the packet */ offset += sizeof(struct sctp_init_chunk); @@ -5381,9 +5404,11 @@ sctp_are_there_new_addresses(struct sctp phdr == NULL) { return (1); } - p4 = (struct sctp_ipv4addr_param *)phdr; - sin4.sin_addr.s_addr = p4->addr; - sa_touse = (struct sockaddr *)&sin4; + if (asoc->scope.ipv4_addr_legal) { + p4 = (struct sctp_ipv4addr_param *)phdr; + sin4.sin_addr.s_addr = p4->addr; + sa_touse = (struct sockaddr *)&sin4; + } break; } #endif @@ -5398,10 +5423,12 @@ sctp_are_there_new_addresses(struct sctp phdr == NULL) { return (1); } - p6 = (struct sctp_ipv6addr_param *)phdr; - memcpy((caddr_t)&sin6.sin6_addr, p6->addr, - sizeof(p6->addr)); - sa_touse = (struct sockaddr *)&sin6; + if (asoc->scope.ipv6_addr_legal) { + p6 = (struct sctp_ipv6addr_param *)phdr; + memcpy((caddr_t)&sin6.sin6_addr, p6->addr, + sizeof(p6->addr)); + sa_touse = (struct sockaddr *)&sin6; + } break; } #endif From owner-svn-src-head@freebsd.org Sat Jan 30 11:10:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0363A73202; Sat, 30 Jan 2016 11:10:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id AF8E0A9E; Sat, 30 Jan 2016 11:10:23 +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 u0UBAMfN088836; Sat, 30 Jan 2016 11:10:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UBAMBc088835; Sat, 30 Jan 2016 11:10:22 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601301110.u0UBAMBc088835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 30 Jan 2016 11:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295070 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 11:10:24 -0000 Author: tuexen Date: Sat Jan 30 11:10:22 2016 New Revision: 295070 URL: https://svnweb.freebsd.org/changeset/base/295070 Log: Don't change the remote UDP encapsulation port for SCTP packets containing an INIT chunk. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Jan 30 10:39:05 2016 (r295069) +++ head/sys/netinet/sctp_input.c Sat Jan 30 11:10:22 2016 (r295070) @@ -5684,7 +5684,9 @@ sctp_common_input_processing(struct mbuf stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); #if defined(INET) || defined(INET6) - if ((net != NULL) && (port != 0)) { + if ((net != NULL) && + (ch->chunk_type != SCTP_INITIATION) && + (port != 0)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } @@ -5715,7 +5717,9 @@ sctp_common_input_processing(struct mbuf stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); #if defined(INET) || defined(INET6) - if ((net != NULL) && (port != 0)) { + if ((net != NULL) && + (ch->chunk_type != SCTP_INITIATION) && + (port != 0)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } @@ -5827,7 +5831,9 @@ sctp_common_input_processing(struct mbuf */ inp = stcb->sctp_ep; #if defined(INET) || defined(INET6) - if ((net != NULL) && (port != 0)) { + if ((net != NULL) && + (ch->chunk_type != SCTP_INITIATION) && + (port != 0)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } From owner-svn-src-head@freebsd.org Sat Jan 30 12:23:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA042A7155F; Sat, 30 Jan 2016 12:23:29 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC4F21195; Sat, 30 Jan 2016 12:23:29 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UCNS1G012056; Sat, 30 Jan 2016 12:23:28 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UCNStK012055; Sat, 30 Jan 2016 12:23:28 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601301223.u0UCNStK012055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 30 Jan 2016 12:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295071 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 12:23:29 -0000 Author: mmel Date: Sat Jan 30 12:23:28 2016 New Revision: 295071 URL: https://svnweb.freebsd.org/changeset/base/295071 Log: ARM: Cleanup mp_machdep.c. SMP is supported only on ARMv6 and later. Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Sat Jan 30 11:10:22 2016 (r295070) +++ head/sys/arm/arm/mp_machdep.c Sat Jan 30 12:23:28 2016 (r295071) @@ -156,7 +156,6 @@ init_secondary(int cpu) #ifndef ARM_INTRNG int start = 0, end = 0; #endif -#if __ARM_ARCH >= 6 uint32_t actlr_mask, actlr_set; pmap_set_tex(); @@ -168,11 +167,6 @@ init_secondary(int cpu) set_stackptrs(cpu); enable_interrupts(PSR_A); -#else /* __ARM_ARCH >= 6 */ - cpu_setup(); - setttb(pmap_pa); - cpu_tlb_flushID(); -#endif /* __ARM_ARCH >= 6 */ pc = &__pcpu[cpu]; /* @@ -184,10 +178,6 @@ init_secondary(int cpu) pcpu_init(pc, cpu, sizeof(struct pcpu)); dpcpu_init(dpcpu[cpu - 1], cpu); -#if __ARM_ARCH < 6 - /* Provide stack pointers for other processor modes. */ - set_stackptrs(cpu); -#endif /* Signal our startup to BSP */ atomic_add_rel_32(&mp_naps, 1); From owner-svn-src-head@freebsd.org Sat Jan 30 12:58:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC7F5A72111; Sat, 30 Jan 2016 12:58:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E4B41F0F; Sat, 30 Jan 2016 12:58:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UCwcXT021260; Sat, 30 Jan 2016 12:58:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UCwcGo021257; Sat, 30 Jan 2016 12:58:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601301258.u0UCwcGo021257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 30 Jan 2016 12:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295072 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 12:58:39 -0000 Author: tuexen Date: Sat Jan 30 12:58:38 2016 New Revision: 295072 URL: https://svnweb.freebsd.org/changeset/base/295072 Log: Don't allow a remote encapsulation port change during the SCTP restart procedure. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Jan 30 12:23:28 2016 (r295071) +++ head/sys/netinet/sctp_input.c Sat Jan 30 12:58:38 2016 (r295072) @@ -85,7 +85,7 @@ static void sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, - struct sctp_tcb *stcb, int *abort_no_unlock, + struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { @@ -198,8 +198,8 @@ sctp_handle_init(struct mbuf *m, int iph sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } else { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, src, dst, - sh, cp, + sctp_send_initiate_ack(inp, stcb, net, m, iphlen, offset, + src, dst, sh, cp, mflowtype, mflowid, vrf_id, port, ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); @@ -4840,7 +4840,7 @@ process_control_chunks: } sctp_handle_init(m, iphlen, *offset, src, dst, sh, (struct sctp_init_chunk *)ch, inp, - stcb, &abort_no_unlock, + stcb, *netp, &abort_no_unlock, mflowtype, mflowid, vrf_id, port); *offset = length; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Jan 30 12:23:28 2016 (r295071) +++ head/sys/netinet/sctp_output.c Sat Jan 30 12:58:38 2016 (r295072) @@ -5484,7 +5484,8 @@ sctp_are_there_new_addresses(struct sctp */ void sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct mbuf *init_pkt, int iphlen, int offset, + struct sctp_nets *src_net, struct mbuf *init_pkt, + int iphlen, int offset, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *init_chk, uint8_t mflowtype, uint32_t mflowid, @@ -5528,20 +5529,39 @@ sctp_send_initiate_ack(struct sctp_inpcb asoc = NULL; } if ((asoc != NULL) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT) && - (sctp_are_there_new_addresses(asoc, init_pkt, offset, src))) { - /* new addresses, out of here in non-cookie-wait states */ - /* - * Send a ABORT, we don't add the new address error clause - * though we even set the T bit and copy in the 0 tag.. this - * looks no different than if no listener was present. - */ - op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), - "Address added"); - sctp_send_abort(init_pkt, iphlen, src, dst, sh, 0, op_err, - mflowtype, mflowid, inp->fibnum, - vrf_id, port); - return; + (SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT)) { + if (sctp_are_there_new_addresses(asoc, init_pkt, offset, src)) { + /* + * new addresses, out of here in non-cookie-wait + * states + * + * Send an ABORT, without the new address error cause. + * This looks no different than if no listener was + * present. + */ + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Address added"); + sctp_send_abort(init_pkt, iphlen, src, dst, sh, 0, op_err, + mflowtype, mflowid, inp->fibnum, + vrf_id, port); + return; + } + if (src_net != NULL && (src_net->port != port)) { + /* + * change of remote encapsulation port, out of here + * in non-cookie-wait states + * + * Send an ABORT, without an specific error cause. This + * looks no different than if no listener was + * present. + */ + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Remote encapsulation port changed"); + sctp_send_abort(init_pkt, iphlen, src, dst, sh, 0, op_err, + mflowtype, mflowid, inp->fibnum, + vrf_id, port); + return; + } } abort_flag = 0; op_err = sctp_arethere_unrecognized_parameters(init_pkt, Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sat Jan 30 12:23:28 2016 (r295071) +++ head/sys/netinet/sctp_output.h Sat Jan 30 12:58:38 2016 (r295072) @@ -80,7 +80,8 @@ sctp_send_initiate(struct sctp_inpcb *, ); void -sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, struct mbuf *, +sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, + struct sctp_nets *, struct mbuf *, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_init_chunk *, From owner-svn-src-head@freebsd.org Sat Jan 30 13:11:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A02DAA72718; Sat, 30 Jan 2016 13:11:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C7D182D; Sat, 30 Jan 2016 13:11:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UDBDCi024614; Sat, 30 Jan 2016 13:11:13 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UDBDv5024611; Sat, 30 Jan 2016 13:11:13 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201601301311.u0UDBDv5024611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 30 Jan 2016 13:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295073 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 13:11:14 -0000 Author: mmel Date: Sat Jan 30 13:11:13 2016 New Revision: 295073 URL: https://svnweb.freebsd.org/changeset/base/295073 Log: ARM: Remove TLB IPI. We don't support SMP on ARMv6. All ARMv7 multicore cpus already uses hardware broadcast for TLB and cache operations. Modified: head/sys/arm/arm/mp_machdep.c head/sys/arm/include/cpufunc.h head/sys/arm/include/smp.h Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Sat Jan 30 12:58:38 2016 (r295072) +++ head/sys/arm/arm/mp_machdep.c Sat Jan 30 13:11:13 2016 (r295073) @@ -341,13 +341,6 @@ ipi_hardclock(void *arg) critical_exit(); } -static void -ipi_tlb(void *dummy __unused) -{ - - CTR1(KTR_SMP, "%s: IPI_TLB", __func__); - cpufuncs.cf_tlb_flushID(); -} #else static int ipi_handler(void *arg) @@ -413,10 +406,6 @@ ipi_handler(void *arg) CTR1(KTR_SMP, "%s: IPI_HARDCLOCK", __func__); hardclockintr(); break; - case IPI_TLB: - CTR1(KTR_SMP, "%s: IPI_TLB", __func__); - cpufuncs.cf_tlb_flushID(); - break; default: panic("Unknown IPI 0x%0x on cpu %d", ipi, curcpu); } @@ -446,7 +435,6 @@ release_aps(void *dummy __unused) intr_ipi_set_handler(IPI_STOP, "stop", ipi_stop, NULL, 0); intr_ipi_set_handler(IPI_PREEMPT, "preempt", ipi_preempt, NULL, 0); intr_ipi_set_handler(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL, 0); - intr_ipi_set_handler(IPI_TLB, "tlb", ipi_tlb, NULL, 0); #else #ifdef IPI_IRQ_START @@ -538,10 +526,3 @@ ipi_selected(cpuset_t cpus, u_int ipi) platform_ipi_send(cpus, ipi); } -void -tlb_broadcast(int ipi) -{ - - if (smp_started) - ipi_all_but_self(ipi); -} Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Sat Jan 30 12:58:38 2016 (r295072) +++ head/sys/arm/include/cpufunc.h Sat Jan 30 13:11:13 2016 (r295073) @@ -184,8 +184,6 @@ extern u_int cputype; #define cpu_faultstatus() cpufuncs.cf_faultstatus() #define cpu_faultaddress() cpufuncs.cf_faultaddress() -#ifndef SMP - #define cpu_tlb_flushID() cpufuncs.cf_tlb_flushID() #define cpu_tlb_flushID_SE(e) cpufuncs.cf_tlb_flushID_SE(e) #define cpu_tlb_flushI() cpufuncs.cf_tlb_flushI() @@ -193,51 +191,6 @@ extern u_int cputype; #define cpu_tlb_flushD() cpufuncs.cf_tlb_flushD() #define cpu_tlb_flushD_SE(e) cpufuncs.cf_tlb_flushD_SE(e) -#else -void tlb_broadcast(int); - -#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) -#define TLB_BROADCAST /* No need to explicitely send an IPI */ -#else -#define TLB_BROADCAST tlb_broadcast(7) -#endif - -#define cpu_tlb_flushID() do { \ - cpufuncs.cf_tlb_flushID(); \ - TLB_BROADCAST; \ -} while(0) - -#define cpu_tlb_flushID_SE(e) do { \ - cpufuncs.cf_tlb_flushID_SE(e); \ - TLB_BROADCAST; \ -} while(0) - - -#define cpu_tlb_flushI() do { \ - cpufuncs.cf_tlb_flushI(); \ - TLB_BROADCAST; \ -} while(0) - - -#define cpu_tlb_flushI_SE(e) do { \ - cpufuncs.cf_tlb_flushI_SE(e); \ - TLB_BROADCAST; \ -} while(0) - - -#define cpu_tlb_flushD() do { \ - cpufuncs.cf_tlb_flushD(); \ - TLB_BROADCAST; \ -} while(0) - - -#define cpu_tlb_flushD_SE(e) do { \ - cpufuncs.cf_tlb_flushD_SE(e); \ - TLB_BROADCAST; \ -} while(0) - -#endif - #define cpu_icache_sync_all() cpufuncs.cf_icache_sync_all() #define cpu_icache_sync_range(a, s) cpufuncs.cf_icache_sync_range((a), (s)) Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Sat Jan 30 12:58:38 2016 (r295072) +++ head/sys/arm/include/smp.h Sat Jan 30 13:11:13 2016 (r295073) @@ -14,8 +14,8 @@ enum { IPI_STOP, IPI_STOP_HARD = IPI_STOP, /* These are synonyms on arm. */ IPI_HARDCLOCK, - IPI_TLB, - IPI_CACHE, + IPI_TLB, /* Not used now, but keep it reserved. */ + IPI_CACHE, /* Not used now, but keep it reserved. */ INTR_IPI_COUNT }; #else @@ -25,8 +25,8 @@ enum { #define IPI_STOP 4 #define IPI_STOP_HARD 4 #define IPI_HARDCLOCK 6 -#define IPI_TLB 7 -#define IPI_CACHE 8 +#define IPI_TLB 7 /* Not used now, but keep it reserved. */ +#define IPI_CACHE 8 /* Not used now, but keep it reserved. */ #endif /* INTRNG */ void init_secondary(int cpu); From owner-svn-src-head@freebsd.org Sat Jan 30 15:53:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15F72A73BB5; Sat, 30 Jan 2016 15:53:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id E79FCCD7; Sat, 30 Jan 2016 15:53:29 +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 u0UFrSmG073864; Sat, 30 Jan 2016 15:53:28 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UFrSYY073863; Sat, 30 Jan 2016 15:53:28 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601301553.u0UFrSYY073863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 30 Jan 2016 15:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295074 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 15:53:30 -0000 Author: allanjude Date: Sat Jan 30 15:53:28 2016 New Revision: 295074 URL: https://svnweb.freebsd.org/changeset/base/295074 Log: The zfsboot automated part of bsdinstall now supports UEFI MFC after: 3 days Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D4960 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sat Jan 30 13:11:13 2016 (r295073) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sat Jan 30 15:53:28 2016 (r295074) @@ -109,7 +109,12 @@ f_include $BSDCFG_SHARE/variable.subr # # Default partitioning scheme to use on disks # -: ${ZFSBOOT_PARTITION_SCHEME:=GPT} +: ${ZFSBOOT_PARTITION_SCHEME:=} + +# +# Default partitioning scheme to use on disks +# +: ${ZFSBOOT_BOOT_TYPE:=} # # How much swap to put on each block device in the boot zpool @@ -193,6 +198,7 @@ GPART_ADD_ALIGN_LABEL='gpart add %s -l % GPART_ADD_ALIGN_LABEL_WITH_SIZE='gpart add %s -l %s -t %s -s %s "%s"' GPART_BOOTCODE='gpart bootcode -b "%s" "%s"' GPART_BOOTCODE_PART='gpart bootcode -b "%s" -p "%s" -i %s "%s"' +GPART_BOOTCODE_PARTONLY='gpart bootcode -p "%s" -i %s "%s"' GPART_CREATE='gpart create -s %s "%s"' GPART_DESTROY_F='gpart destroy -F "%s"' GPART_SET_ACTIVE='gpart set -a active -i %s "%s"' @@ -297,7 +303,6 @@ msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_swap_toosmall="The selected swap size (%s) is to small. Please enter a value greater than 100MB or enter 0 for no swap" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." -msg_uefi_not_supported="The FreeBSD UEFI loader does not currently support booting root-on-ZFS. Your system will need to boot in legacy (CSM) mode.\nDo you want to continue?" msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" msg_unsupported_partition_scheme="%s is an unsupported partition scheme" msg_user_cancelled="User Cancelled." @@ -345,7 +350,7 @@ dialog_menu_main() 'E $msg_encrypt_disks' '$usegeli' '$msg_encrypt_disks_help' 'P $msg_partition_scheme' - '$ZFSBOOT_PARTITION_SCHEME' + '$ZFSBOOT_PARTITION_SCHEME ($ZFSBOOT_BOOT_TYPE)' '$msg_partition_scheme_help' 'S $msg_swap_size' '$ZFSBOOT_SWAP_SIZE' '$msg_swap_size_help' @@ -695,48 +700,6 @@ dialog_menu_layout() return $DIALOG_OK } -# dialog_uefi_prompt -# -# Confirm that the user wants to continue with the installation on a BIOS -# system when they have booted with UEFI -# -dialog_uefi_prompt() -{ - local title="$DIALOG_TITLE" - local btitle="$DIALOG_BACKTITLE" - local prompt # Calculated below - local hline="$hline_arrows_tab_enter" - - local height=8 width=50 prefix=" " - local plen=${#prefix} list= line= - local max_width=$(( $width - 3 - $plen )) - - local yes no defaultno extra_args format - if [ "$USE_XDIALOG" ]; then - yes=ok no=cancel defaultno=default-no - extra_args="--wrap --left" - format="$msg_uefi_not_supported" - else - yes=yes no=no defaultno=defaultno - extra_args="--cr-wrap" - format="$msg_uefi_not_supported" - fi - - # Add height for Xdialog(1) - [ "$USE_XDIALOG" ] && height=$(( $height + $height / 5 + 3 )) - - prompt=$( printf "$format" ) - f_dprintf "%s: UEFI prompt" "$0" - $DIALOG \ - --title "$title" \ - --backtitle "$btitle" \ - --hline "$hline" \ - --$yes-label "$msg_yes" \ - --$no-label "$msg_no" \ - $extra_args \ - --yesno "$prompt" $height $width -} - # zfs_create_diskpart $disk $index # # For each block device to be used in the zpool, rather than just create the @@ -848,14 +811,25 @@ zfs_create_diskpart() fi # - # 2. Add small freebsd-boot partition labeled `boot#' + # 2. Add small freebsd-boot or efi partition # - f_eval_catch $funcname gpart "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ - "$align_small" gptboot$index freebsd-boot 512k $disk || - return $FAILURE - f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ - /boot/pmbr /boot/gptzfsboot 1 $disk || - return $FAILURE + if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" ]; then + f_eval_catch $funcname gpart \ + "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ + "$align_small" efiboot$index efi 800k $disk || + return $FAILURE + f_eval_catch $funcname gpart "$GPART_BOOTCODE_PARTONLY" \ + /boot/boot1.efifat 1 $disk || + return $FAILURE + else + f_eval_catch $funcname gpart \ + "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ + "$align_small" gptboot$index freebsd-boot \ + 512k $disk || return $FAILURE + f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ + /boot/pmbr /boot/gptzfsboot 1 $disk || + return $FAILURE + fi # NB: zpool will use the `zfs#' GPT labels bootpart=p2 swappart=p2 targetpart=p2 @@ -1463,18 +1437,16 @@ f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSD f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # -# If the system was booted with UEFI, warn the user that FreeBSD can't do -# ZFS with UEFI yet +# If the system was booted with UEFI, set the default boot type to UEFI # -if f_interactive; then - bootmethod=$( sysctl -n machdep.bootmethod ) - f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" - if [ "$bootmethod" != "BIOS" ]; then - dialog_uefi_prompt - retval=$? - f_dprintf "uefi_prompt=[%s]" "$retval" - [ $retval -eq $DIALOG_OK ] || f_die - fi +bootmethod=$( sysctl -n machdep.bootmethod ) +f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" +if [ "$bootmethod" = "UEFI" ]; then + : ${ZFSBOOT_BOOT_TYPE:=UEFI} + : ${ZFSBOOT_PARTITION_SCHEME:=GPT} +else + : ${ZFSBOOT_BOOT_TYPE:=BIOS} + : ${ZFSBOOT_PARTITION_SCHEME:=GPT} fi # @@ -1596,15 +1568,22 @@ while :; do fi ;; ?" $msg_partition_scheme") - # Toggle between GPT and MBR - if [ "$ZFSBOOT_PARTITION_SCHEME" = GPT ]; then - ZFSBOOT_PARTITION_SCHEME=MBR - elif [ "$ZFSBOOT_PARTITION_SCHEME" = MBR ]; then + # Toggle between GPT (BIOS), GPT (UEFI) and MBR + if [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a "$ZFSBOOT_BOOT_TYPE" = "BIOS" ]; then + ZFSBOOT_PARTITION_SCHEME="GPT" + ZFSBOOT_BOOT_TYPE="UEFI" + elif [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" ]; then + ZFSBOOT_PARTITION_SCHEME="MBR" + ZFSBOOT_BOOT_TYPE="BIOS" + elif [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then ZFSBOOT_PARTITION_SCHEME="GPT + Active" + ZFSBOOT_BOOT_TYPE="BIOS" elif [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT + Active" ]; then ZFSBOOT_PARTITION_SCHEME="GPT + Lenovo Fix" + ZFSBOOT_BOOT_TYPE="BIOS" else - ZFSBOOT_PARTITION_SCHEME=GPT + ZFSBOOT_PARTITION_SCHEME="GPT" + ZFSBOOT_BOOT_TYPE="BIOS" fi ;; ?" $msg_swap_size") From owner-svn-src-head@freebsd.org Sat Jan 30 16:56:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E20E7A72EC5; Sat, 30 Jan 2016 16:56:40 +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 mx1.freebsd.org (Postfix) with ESMTPS id A52577AF; Sat, 30 Jan 2016 16:56:40 +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 u0UGudal091763; Sat, 30 Jan 2016 16:56:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UGudLW091762; Sat, 30 Jan 2016 16:56:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601301656.u0UGudLW091762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 30 Jan 2016 16:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295075 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 16:56:41 -0000 Author: tuexen Date: Sat Jan 30 16:56:39 2016 New Revision: 295075 URL: https://svnweb.freebsd.org/changeset/base/295075 Log: Update the path mtu when turning on/off UDP encapsulation for SCTP. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Jan 30 15:53:28 2016 (r295074) +++ head/sys/netinet/sctp_input.c Sat Jan 30 16:56:39 2016 (r295075) @@ -5684,11 +5684,18 @@ sctp_common_input_processing(struct mbuf stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); #if defined(INET) || defined(INET6) - if ((net != NULL) && - (ch->chunk_type != SCTP_INITIATION) && - (port != 0)) { + if ((ch->chunk_type != SCTP_INITIATION) && + (net != NULL) && (net->port != port)) { if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + /* UDP encapsulation turned on. */ + net->mtu -= sizeof(struct udphdr); + if (stcb->asoc.smallest_mtu > net->mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); + } + } else if (port == 0) { + /* UDP encapsulation turned off. */ + net->mtu += sizeof(struct udphdr); + /* XXX Update smallest_mtu */ } net->port = port; } @@ -5717,11 +5724,18 @@ sctp_common_input_processing(struct mbuf stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); #if defined(INET) || defined(INET6) - if ((net != NULL) && - (ch->chunk_type != SCTP_INITIATION) && - (port != 0)) { + if ((ch->chunk_type != SCTP_INITIATION) && + (net != NULL) && (net->port != port)) { if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + /* UDP encapsulation turned on. */ + net->mtu -= sizeof(struct udphdr); + if (stcb->asoc.smallest_mtu > net->mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); + } + } else if (port == 0) { + /* UDP encapsulation turned off. */ + net->mtu += sizeof(struct udphdr); + /* XXX Update smallest_mtu */ } net->port = port; } @@ -5831,11 +5845,18 @@ sctp_common_input_processing(struct mbuf */ inp = stcb->sctp_ep; #if defined(INET) || defined(INET6) - if ((net != NULL) && - (ch->chunk_type != SCTP_INITIATION) && - (port != 0)) { + if ((ch->chunk_type != SCTP_INITIATION) && + (net != NULL) && (net->port != port)) { if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + /* UDP encapsulation turned on. */ + net->mtu -= sizeof(struct udphdr); + if (stcb->asoc.smallest_mtu > net->mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); + } + } else if (port == 0) { + /* UDP encapsulation turned off. */ + net->mtu += sizeof(struct udphdr); + /* XXX Update smallest_mtu */ } net->port = port; } From owner-svn-src-head@freebsd.org Sat Jan 30 17:10:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C18CA7323E; Sat, 30 Jan 2016 17:10:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09027C05; Sat, 30 Jan 2016 17:10:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UHAFDU094879; Sat, 30 Jan 2016 17:10:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UHAElN094874; Sat, 30 Jan 2016 17:10:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601301710.u0UHAElN094874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Jan 2016 17:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295076 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 17:10:16 -0000 Author: ngie Date: Sat Jan 30 17:10:14 2016 New Revision: 295076 URL: https://svnweb.freebsd.org/changeset/base/295076 Log: Revert r295062 to unbreak buildworld Some of the structures referenced in power.c (in particular struct nvme_power_state) are missing from sbin/nvmecontrol/ Pointyhat to: imp Reported by: Jenkins [*], O. Hartmann , Outback Dingo Deleted: head/sbin/nvmecontrol/power.c Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/nvmecontrol.8 head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Sat Jan 30 16:56:39 2016 (r295075) +++ head/sbin/nvmecontrol/Makefile Sat Jan 30 17:10:14 2016 (r295076) @@ -2,7 +2,7 @@ PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c nvme_util.c power.c + perftest.c reset.c nvme_util.c MAN= nvmecontrol.8 .PATH: ${.CURDIR}/../../sys/dev/nvme Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Sat Jan 30 16:56:39 2016 (r295075) +++ head/sbin/nvmecontrol/nvmecontrol.8 Sat Jan 30 17:10:14 2016 (r295076) @@ -70,11 +70,6 @@ .Op Fl f Ar path_to_firmware .Op Fl a .Aq device id -.Nm -.Ic power -.Op Fl l -.Op Fl p power_state -.Op fl w workload_hint .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. @@ -125,18 +120,6 @@ Activate the firmware in slot 4 of the n .Pp Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the nvme0 controller and activate it on the next reset. -.Pp -.Dl nvmecontrol power -l nvme0 -.Pp -List all the current power modes. -.Pp -.Dl nvmecontrol power -p 3 nvme0 -.Pp -Set the current power mode. -.Pp -.Dl nvmecontrol power nvme0 -.Pp -Get the current power mode. .Sh AUTHORS .An -nosplit .Nm Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Sat Jan 30 16:56:39 2016 (r295075) +++ head/sbin/nvmecontrol/nvmecontrol.c Sat Jan 30 17:10:14 2016 (r295076) @@ -58,7 +58,6 @@ static struct nvme_function { {"reset", reset, RESET_USAGE}, {"logpage", logpage, LOGPAGE_USAGE}, {"firmware", firmware, FIRMWARE_USAGE}, - {"power", power, POWER_USAGE}, {NULL, NULL, NULL}, }; Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Sat Jan 30 16:56:39 2016 (r295075) +++ head/sbin/nvmecontrol/nvmecontrol.h Sat Jan 30 17:10:14 2016 (r295076) @@ -55,16 +55,12 @@ #define FIRMWARE_USAGE \ " nvmecontrol firmware [-s slot] [-f path_to_firmware] [-a] \n" -#define POWER_USAGE \ -" nvmecontrol power [-l] [-p new-state [-w workload-hint]] \n" - void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); void logpage(int argc, char *argv[]); void firmware(int argc, char *argv[]); -void power(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid); From owner-svn-src-head@freebsd.org Sat Jan 30 17:32:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92379A73ADD; Sat, 30 Jan 2016 17:32:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5EFF619B4; Sat, 30 Jan 2016 17:32:47 +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 u0UHWkC4003320; Sat, 30 Jan 2016 17:32:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UHWktQ003319; Sat, 30 Jan 2016 17:32:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601301732.u0UHWktQ003319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 30 Jan 2016 17:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295077 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 17:32:47 -0000 Author: tuexen Date: Sat Jan 30 17:32:46 2016 New Revision: 295077 URL: https://svnweb.freebsd.org/changeset/base/295077 Log: Add missing parentheses. This was reported by ccaughie via GitHub for the userland stack. MFC after: 3 days Modified: head/sys/netinet/sctp_var.h Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Sat Jan 30 17:10:14 2016 (r295076) +++ head/sys/netinet/sctp_var.h Sat Jan 30 17:32:46 2016 (r295077) @@ -86,7 +86,7 @@ extern struct pr_usrreqs sctp_usrreqs; #define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_cc) ? (sctp_maxspace(sb) - (sb)->sb_cc) : 0)) -#define sctp_sbspace_sub(a,b) ((a > b) ? (a - b) : 0) +#define sctp_sbspace_sub(a,b) (((a) > (b)) ? ((a) - (b)) : 0) /* * I tried to cache the readq entries at one point. But the reality From owner-svn-src-head@freebsd.org Sat Jan 30 17:54:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D19BCA72092; Sat, 30 Jan 2016 17:54:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2272278; Sat, 30 Jan 2016 17:54:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UHsI8m009256; Sat, 30 Jan 2016 17:54:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UHsIpj009255; Sat, 30 Jan 2016 17:54:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601301754.u0UHsIpj009255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Jan 2016 17:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295079 - head/libexec/atrun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 17:54:19 -0000 Author: ngie Date: Sat Jan 30 17:54:18 2016 New Revision: 295079 URL: https://svnweb.freebsd.org/changeset/base/295079 Log: Fix the type for hw.ncpu, so sysctlbyname doesn't consistently fail on 64-bit architectures where sizeof(int) != sizeof(size_t). MFC after: 1 week PR: 206758 Reported by: Christoph Schönweiler Submitted by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/libexec/atrun/atrun.c Modified: head/libexec/atrun/atrun.c ============================================================================== --- head/libexec/atrun/atrun.c Sat Jan 30 17:43:41 2016 (r295078) +++ head/libexec/atrun/atrun.c Sat Jan 30 17:54:18 2016 (r295079) @@ -459,8 +459,9 @@ main(int argc, char *argv[]) int c; int run_batch; #ifdef __FreeBSD__ - size_t ncpu, ncpusz; + size_t ncpusz; double load_avg = -1; + int ncpu; #else double load_avg = LOADAVG_MX; #endif From owner-svn-src-head@freebsd.org Sat Jan 30 18:33:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BFE3A731CC; Sat, 30 Jan 2016 18:33:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B10A1D1A; Sat, 30 Jan 2016 18:33:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UIXOq7026378; Sat, 30 Jan 2016 18:33:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UIXOTq026377; Sat, 30 Jan 2016 18:33:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601301833.u0UIXOTq026377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Jan 2016 18:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295080 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 18:33:25 -0000 Author: ngie Date: Sat Jan 30 18:33:23 2016 New Revision: 295080 URL: https://svnweb.freebsd.org/changeset/base/295080 Log: Use the correct type for i when iterating over `buf` to avoid unlikely negative array indexing in iicrdwr(..) Differential Revision: https://reviews.freebsd.org/D5132 Obtained from: HardenedBSD PR: 206754 Reported by: CTurt Submitted by: Madhi Moktari Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/iicbus/iic.c Modified: head/sys/dev/iicbus/iic.c ============================================================================== --- head/sys/dev/iicbus/iic.c Sat Jan 30 17:54:18 2016 (r295079) +++ head/sys/dev/iicbus/iic.c Sat Jan 30 18:33:23 2016 (r295080) @@ -293,7 +293,8 @@ iicrdwr(struct iic_cdevpriv *priv, struc struct iic_msg *buf, *m; void **usrbufs; device_t iicdev, parent; - int error, i; + int error; + uint32_t i; iicdev = priv->sc->sc_dev; parent = device_get_parent(iicdev); From owner-svn-src-head@freebsd.org Sat Jan 30 19:59:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB96DA730A3; Sat, 30 Jan 2016 19:59:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75E41CE1; Sat, 30 Jan 2016 19:59:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UJxwd7051279; Sat, 30 Jan 2016 19:59:58 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UJxwfo051278; Sat, 30 Jan 2016 19:59:58 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601301959.u0UJxwfo051278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 30 Jan 2016 19:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295082 - head/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 19:59:59 -0000 Author: jilles Date: Sat Jan 30 19:59:58 2016 New Revision: 295082 URL: https://svnweb.freebsd.org/changeset/base/295082 Log: test: Optimize operator lookup. The linear search using strcmp() shows up in pmcstat for several percent. Split the operators into lengths and whether they start with '-' and compare bytes using == instead of strcmp(). A simple test sh -c 'i=0; w=$(printf %0100d 7); while [ "$i" -lt 1000000 ]; do v=$(printf %sx%s "$w" "$w"); i=$((i+1)); done' is over 4% faster on an amd64 bhyve VM. Modified: head/bin/test/test.c Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Sat Jan 30 18:41:56 2016 (r295081) +++ head/bin/test/test.c Sat Jan 30 19:59:58 2016 (r295082) @@ -120,51 +120,53 @@ enum token { #define TOKEN_TYPE(token) ((token) & 0xff00) -static struct t_op { - char op_text[4]; +static const struct t_op { + char op_text[2]; short op_num; -} const ops [] = { - {"-r", FILRD}, - {"-w", FILWR}, - {"-x", FILEX}, - {"-e", FILEXIST}, - {"-f", FILREG}, - {"-d", FILDIR}, - {"-c", FILCDEV}, - {"-b", FILBDEV}, - {"-p", FILFIFO}, - {"-u", FILSUID}, - {"-g", FILSGID}, - {"-k", FILSTCK}, - {"-s", FILGZ}, - {"-t", FILTT}, - {"-z", STREZ}, - {"-n", STRNZ}, - {"-h", FILSYM}, /* for backwards compat */ - {"-O", FILUID}, - {"-G", FILGID}, - {"-L", FILSYM}, - {"-S", FILSOCK}, +} ops1[] = { {"=", STREQ}, - {"==", STREQ}, - {"!=", STRNE}, {"<", STRLT}, {">", STRGT}, - {"-eq", INTEQ}, - {"-ne", INTNE}, - {"-ge", INTGE}, - {"-gt", INTGT}, - {"-le", INTLE}, - {"-lt", INTLT}, - {"-nt", FILNT}, - {"-ot", FILOT}, - {"-ef", FILEQ}, {"!", UNOT}, - {"-a", BAND}, - {"-o", BOR}, {"(", LPAREN}, {")", RPAREN}, - {"", 0} +}, opsm1[] = { + {"r", FILRD}, + {"w", FILWR}, + {"x", FILEX}, + {"e", FILEXIST}, + {"f", FILREG}, + {"d", FILDIR}, + {"c", FILCDEV}, + {"b", FILBDEV}, + {"p", FILFIFO}, + {"u", FILSUID}, + {"g", FILSGID}, + {"k", FILSTCK}, + {"s", FILGZ}, + {"t", FILTT}, + {"z", STREZ}, + {"n", STRNZ}, + {"h", FILSYM}, /* for backwards compat */ + {"O", FILUID}, + {"G", FILGID}, + {"L", FILSYM}, + {"S", FILSOCK}, + {"a", BAND}, + {"o", BOR}, +}, ops2[] = { + {"==", STREQ}, + {"!=", STRNE}, +}, opsm2[] = { + {"eq", INTEQ}, + {"ne", INTNE}, + {"ge", INTGE}, + {"gt", INTGT}, + {"le", INTLE}, + {"lt", INTLT}, + {"nt", FILNT}, + {"ot", FILOT}, + {"ef", FILEQ}, }; static int nargc; @@ -416,35 +418,71 @@ filstat(char *nm, enum token mode) } } -static enum token -t_lex(char *s) +static int +find_op_1char(const struct t_op *op, const struct t_op *end, const char *s) { - struct t_op const *op = ops; + char c; - if (s == 0) { - return EOI; + c = s[0]; + while (op != end) { + if (c == *op->op_text) + return op->op_num; + op++; } - while (*op->op_text) { - if (strcmp(s, op->op_text) == 0) { - if (((TOKEN_TYPE(op->op_num) == UNOP || - TOKEN_TYPE(op->op_num) == BUNOP) - && isunopoperand()) || - (op->op_num == LPAREN && islparenoperand()) || - (op->op_num == RPAREN && isrparenoperand())) - break; + return OPERAND; +} + +static int +find_op_2char(const struct t_op *op, const struct t_op *end, const char *s) +{ + while (op != end) { + if (s[0] == op->op_text[0] && s[1] == op->op_text[1]) return op->op_num; - } op++; } return OPERAND; } static int +find_op(const char *s) +{ + if (s[0] == '\0') + return OPERAND; + else if (s[1] == '\0') + return find_op_1char(ops1, (&ops1)[1], s); + else if (s[2] == '\0') + return s[0] == '-' ? find_op_1char(opsm1, (&opsm1)[1], s + 1) : + find_op_2char(ops2, (&ops2)[1], s); + else if (s[3] == '\0') + return s[0] == '-' ? find_op_2char(opsm2, (&opsm2)[1], s + 1) : + OPERAND; + else + return OPERAND; +} + +static enum token +t_lex(char *s) +{ + int num; + + if (s == 0) { + return EOI; + } + num = find_op(s); + if (((TOKEN_TYPE(num) == UNOP || TOKEN_TYPE(num) == BUNOP) + && isunopoperand()) || + (num == LPAREN && islparenoperand()) || + (num == RPAREN && isrparenoperand())) + return OPERAND; + return num; +} + +static int isunopoperand(void) { - struct t_op const *op = ops; char *s; char *t; + int num; if (nargc == 1) return 1; @@ -452,20 +490,16 @@ isunopoperand(void) if (nargc == 2) return parenlevel == 1 && strcmp(s, ")") == 0; t = *(t_wp + 2); - while (*op->op_text) { - if (strcmp(s, op->op_text) == 0) - return TOKEN_TYPE(op->op_num) == BINOP && - (parenlevel == 0 || t[0] != ')' || t[1] != '\0'); - op++; - } - return 0; + num = find_op(s); + return TOKEN_TYPE(num) == BINOP && + (parenlevel == 0 || t[0] != ')' || t[1] != '\0'); } static int islparenoperand(void) { - struct t_op const *op = ops; char *s; + int num; if (nargc == 1) return 1; @@ -474,12 +508,8 @@ islparenoperand(void) return parenlevel == 1 && strcmp(s, ")") == 0; if (nargc != 3) return 0; - while (*op->op_text) { - if (strcmp(s, op->op_text) == 0) - return TOKEN_TYPE(op->op_num) == BINOP; - op++; - } - return 0; + num = find_op(s); + return TOKEN_TYPE(num) == BINOP; } static int From owner-svn-src-head@freebsd.org Sat Jan 30 20:10:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701D0A7336C; Sat, 30 Jan 2016 20:10:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A3B51069; Sat, 30 Jan 2016 20:10:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UKAKb7054246; Sat, 30 Jan 2016 20:10:20 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UKAKLa054245; Sat, 30 Jan 2016 20:10:20 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601302010.u0UKAKLa054245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 30 Jan 2016 20:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295083 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 20:10:21 -0000 Author: jilles Date: Sat Jan 30 20:10:20 2016 New Revision: 295083 URL: https://svnweb.freebsd.org/changeset/base/295083 Log: sh(1): Document 'cd -'. This reflects the changes in r294649 and can therefore not be MFCed by itself. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sat Jan 30 19:59:58 2016 (r295082) +++ head/bin/sh/sh.1 Sat Jan 30 20:10:20 2016 (r295083) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd August 29, 2015 +.Dd January 30, 2016 .Dt SH 1 .Os .Sh NAME @@ -1952,13 +1952,20 @@ Execute the specified built-in command, This is useful when the user wishes to override a shell function with the same name as a built-in command. .It Ic cd Oo Fl L | P Oc Oo Fl e Oc Op Ar directory +.It Ic cd Fl Switch to the specified .Ar directory , -or to the directory specified in the +to the directory specified in the .Va HOME environment variable if no .Ar directory -is specified. +is specified or +to the directory specified in the +.Va OLDPWD +environment variable if +.Ar directory +is +.Fl . If .Ar directory does not begin with @@ -1982,10 +1989,12 @@ the .Ic cd command will print out the name of the directory that it actually switched to -if this is different from the name that the user gave. -These may be different either because the +if the .Va CDPATH -mechanism was used or because a symbolic link was crossed. +mechanism was used or if +.Ar directory +was +.Fl . .Pp If the .Fl P @@ -2774,6 +2783,10 @@ Initialization file for interactive shel Locale settings. These are inherited by children of the shell, and is used in a limited manner by the shell itself. +.It Ev OLDPWD +The previous current directory. +This is used and updated by +.Ic cd . .It Ev PWD An absolute pathname for the current directory, possibly containing symbolic links. From owner-svn-src-head@freebsd.org Sat Jan 30 21:21:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E4AFA728A7; Sat, 30 Jan 2016 21:21:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA491137; Sat, 30 Jan 2016 21:21:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ULLQsJ074932; Sat, 30 Jan 2016 21:21:26 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ULLQRA074931; Sat, 30 Jan 2016 21:21:26 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601302121.u0ULLQRA074931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 30 Jan 2016 21:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295085 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 21:21:27 -0000 Author: jilles Date: Sat Jan 30 21:21:25 2016 New Revision: 295085 URL: https://svnweb.freebsd.org/changeset/base/295085 Log: sh: Don't allocate a redirtab if there are no redirections. Builtins (including variable assignments without command word), function calls and redirected compound commands need to restore file descriptors to their original state after execution. This is handled by allocating a redirtab structure. These mallocs and frees show up heavily in pmcstat. Only allocate a redirtab if there are actually redirections and maintain a count of how many levels of REDIR_PUSH there are without redirtabs. A simple loop without external programs like sh -c 'i=0; w=$(printf %0100d 7); while [ "$i" -lt 1000000 ]; do i=$((i+1)); done' is over 25% faster on an amd64 bhyve VM. Modified: head/bin/sh/redir.c Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Sat Jan 30 20:48:45 2016 (r295084) +++ head/bin/sh/redir.c Sat Jan 30 21:21:25 2016 (r295085) @@ -70,6 +70,7 @@ struct redirtab { struct redirtab *next; int renamed[10]; int fd0_redirected; + unsigned int empty_redirs; }; @@ -82,6 +83,9 @@ static struct redirtab *redirlist; */ static int fd0_redirected = 0; +/* Number of redirtabs that have not been allocated. */ +static unsigned int empty_redirs = 0; + static void openredirect(union node *, char[10 ]); static int openhere(union node *); @@ -115,12 +119,17 @@ redirect(union node *redir, int flags) memory[i] = 0; memory[1] = flags & REDIR_BACKQ; if (flags & REDIR_PUSH) { - sv = ckmalloc(sizeof (struct redirtab)); - for (i = 0 ; i < 10 ; i++) - sv->renamed[i] = EMPTY; - sv->fd0_redirected = fd0_redirected; - sv->next = redirlist; - redirlist = sv; + empty_redirs++; + if (redir != NULL) { + sv = ckmalloc(sizeof (struct redirtab)); + for (i = 0 ; i < 10 ; i++) + sv->renamed[i] = EMPTY; + sv->fd0_redirected = fd0_redirected; + sv->empty_redirs = empty_redirs - 1; + sv->next = redirlist; + redirlist = sv; + empty_redirs = 0; + } } for (n = redir ; n ; n = n->nfile.next) { fd = n->nfile.fd; @@ -303,6 +312,12 @@ popredir(void) struct redirtab *rp = redirlist; int i; + INTOFF; + if (empty_redirs > 0) { + empty_redirs--; + INTON; + return; + } for (i = 0 ; i < 10 ; i++) { if (rp->renamed[i] != EMPTY) { if (rp->renamed[i] >= 0) { @@ -313,8 +328,8 @@ popredir(void) } } } - INTOFF; fd0_redirected = rp->fd0_redirected; + empty_redirs = rp->empty_redirs; redirlist = rp->next; ckfree(rp); INTON; From owner-svn-src-head@freebsd.org Sat Jan 30 22:03:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AB81A73796; Sat, 30 Jan 2016 22:03:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D0C684F; Sat, 30 Jan 2016 22:03:16 +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 u0UM3FTk089465; Sat, 30 Jan 2016 22:03:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UM3FCG089464; Sat, 30 Jan 2016 22:03:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601302203.u0UM3FCG089464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 30 Jan 2016 22:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295086 - head/sbin/pfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 22:03:16 -0000 Author: ian Date: Sat Jan 30 22:03:14 2016 New Revision: 295086 URL: https://svnweb.freebsd.org/changeset/base/295086 Log: Make pfctl(8) work on strict-alignment platforms, by copying a pair of embedded structures out of a packed, unaligned struct into local copies on the stack which are aligned. The original patch to do this was submitted by Guy Yur , and this is conceptually the same change, but restructured with the #ifndef __NO_STRICT_ALIGNMENT wrapper, similar to how the same issue is handled in the kernel pf code. PR: 185617 PR: 206658 Modified: head/sbin/pfctl/pf_print_state.c Modified: head/sbin/pfctl/pf_print_state.c ============================================================================== --- head/sbin/pfctl/pf_print_state.c Sat Jan 30 21:21:25 2016 (r295085) +++ head/sbin/pfctl/pf_print_state.c Sat Jan 30 22:03:14 2016 (r295086) @@ -208,22 +208,30 @@ void print_state(struct pfsync_state *s, int opts) { struct pfsync_state_peer *src, *dst; - struct pfsync_state_key *sk, *nk; + struct pfsync_state_key *key, *sk, *nk; struct protoent *p; int min, sec; +#ifndef __NO_STRICT_ALIGNMENT + struct pfsync_state_key aligned_key[2]; + + bcopy(&s->key, aligned_key, sizeof(aligned_key)); + key = aligned_key; +#else + key = s->key; +#endif if (s->direction == PF_OUT) { src = &s->src; dst = &s->dst; - sk = &s->key[PF_SK_STACK]; - nk = &s->key[PF_SK_WIRE]; + sk = &key[PF_SK_STACK]; + nk = &key[PF_SK_WIRE]; if (s->proto == IPPROTO_ICMP || s->proto == IPPROTO_ICMPV6) sk->port[0] = nk->port[0]; } else { src = &s->dst; dst = &s->src; - sk = &s->key[PF_SK_WIRE]; - nk = &s->key[PF_SK_STACK]; + sk = &key[PF_SK_WIRE]; + nk = &key[PF_SK_STACK]; if (s->proto == IPPROTO_ICMP || s->proto == IPPROTO_ICMPV6) sk->port[1] = nk->port[1]; } From owner-svn-src-head@freebsd.org Sat Jan 30 22:48:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 711FDA73608; Sat, 30 Jan 2016 22:48:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33C291A96; Sat, 30 Jan 2016 22:48:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UMm7U8001453; Sat, 30 Jan 2016 22:48:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0UMm6Wo001447; Sat, 30 Jan 2016 22:48:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601302248.u0UMm6Wo001447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 30 Jan 2016 22:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295087 - in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 22:48:08 -0000 Author: imp Date: Sat Jan 30 22:48:06 2016 New Revision: 295087 URL: https://svnweb.freebsd.org/changeset/base/295087 Log: Implement power command to list all power modes, find out the power mode we're in and to set the power mode. Added: head/sbin/nvmecontrol/power.c (contents, props changed) Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/nvmecontrol.8 head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h head/sys/dev/nvme/nvme.h Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Sat Jan 30 22:03:14 2016 (r295086) +++ head/sbin/nvmecontrol/Makefile Sat Jan 30 22:48:06 2016 (r295087) @@ -2,7 +2,7 @@ PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c nvme_util.c + perftest.c reset.c nvme_util.c power.c MAN= nvmecontrol.8 .PATH: ${.CURDIR}/../../sys/dev/nvme Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Sat Jan 30 22:03:14 2016 (r295086) +++ head/sbin/nvmecontrol/nvmecontrol.8 Sat Jan 30 22:48:06 2016 (r295087) @@ -70,6 +70,11 @@ .Op Fl f Ar path_to_firmware .Op Fl a .Aq device id +.Nm +.Ic power +.Op Fl l +.Op Fl p power_state +.Op fl w workload_hint .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. @@ -120,6 +125,18 @@ Activate the firmware in slot 4 of the n .Pp Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the nvme0 controller and activate it on the next reset. +.Pp +.Dl nvmecontrol power -l nvme0 +.Pp +List all the current power modes. +.Pp +.Dl nvmecontrol power -p 3 nvme0 +.Pp +Set the current power mode. +.Pp +.Dl nvmecontrol power nvme0 +.Pp +Get the current power mode. .Sh AUTHORS .An -nosplit .Nm Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Sat Jan 30 22:03:14 2016 (r295086) +++ head/sbin/nvmecontrol/nvmecontrol.c Sat Jan 30 22:48:06 2016 (r295087) @@ -58,6 +58,7 @@ static struct nvme_function { {"reset", reset, RESET_USAGE}, {"logpage", logpage, LOGPAGE_USAGE}, {"firmware", firmware, FIRMWARE_USAGE}, + {"power", power, POWER_USAGE}, {NULL, NULL, NULL}, }; Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Sat Jan 30 22:03:14 2016 (r295086) +++ head/sbin/nvmecontrol/nvmecontrol.h Sat Jan 30 22:48:06 2016 (r295087) @@ -55,12 +55,16 @@ #define FIRMWARE_USAGE \ " nvmecontrol firmware [-s slot] [-f path_to_firmware] [-a] \n" +#define POWER_USAGE \ +" nvmecontrol power [-l] [-p new-state [-w workload-hint]] \n" + void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); void logpage(int argc, char *argv[]); void firmware(int argc, char *argv[]); +void power(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid); Added: head/sbin/nvmecontrol/power.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/power.c Sat Jan 30 22:48:06 2016 (r295087) @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 2016 Netflix, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +_Static_assert(sizeof(struct nvme_power_state) == 256 / NBBY, + "nvme_power_state size wrong"); + +static void +power_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, POWER_USAGE); + exit(1); +} + +static void +power_list_one(int i, struct nvme_power_state *nps) +{ + int mpower, apower, ipower; + + mpower = nps->mp; + if (nps->mps == 0) + mpower *= 100; + ipower = nps->idlp; + if (nps->ips == 1) + ipower *= 100; + apower = nps->actp; + if (nps->aps == 1) + apower *= 100; + printf("%2d: %2d.%04dW%c %3d.%03dms %3d.%03dms %2d %2d %2d %2d %2d.%04dW %2d.%04dW %d\n", + i, mpower / 10000, mpower % 10000, + nps->nops ? '*' : ' ', nps->enlat / 1000, nps->enlat % 1000, + nps->exlat / 1000, nps->exlat % 1000, nps->rrt, nps->rrl, + nps->rwt, nps->rwl, ipower / 10000, ipower % 10000, + apower / 10000, apower % 10000, nps->apw); +} + +static void +power_list(struct nvme_controller_data *cdata) +{ + int i; + + printf("\nPower States Supported: %d\n\n", cdata->npss + 1); + printf(" # Max pwr Enter Lat Exit Lat RT RL WT WL Idle Pwr Act Pwr Workloadd\n"); + printf("-- -------- --------- --------- -- -- -- -- -------- -------- --\n"); + for (i = 0; i <= cdata->npss; i++) + power_list_one(i, &cdata->power_state[i]); +} + +static void +power_set(int fd, int power, int workload, int perm) +{ + struct nvme_pt_command pt; + uint32_t p; + + p = perm ? (1u << 31) : 0; + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_SET_FEATURES; + pt.cmd.cdw10 = NVME_FEAT_POWER_MANAGEMENT | p; + pt.cmd.cdw11 = power | (workload << 5); + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "set feature power mgmt request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "set feature power mgmt request returned error"); +} + +static void +power_show(int fd) +{ + struct nvme_pt_command pt; + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_GET_FEATURES; + pt.cmd.cdw10 = NVME_FEAT_POWER_MANAGEMENT; + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "set feature power mgmt request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "set feature power mgmt request returned error"); + + printf("Current Power Mode is %d\n", pt.cpl.cdw0); +} + +void +power(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + int ch, listflag = 0, powerflag = 0, power = 0, fd; + int workload = 0; + char *end; + + while ((ch = getopt(argc, argv, "lp:w:")) != -1) { + switch ((char)ch) { + case 'l': + listflag = 1; + break; + case 'p': + powerflag = 1; + power = strtol(optarg, &end, 0); + if (*end != '\0') { + fprintf(stderr, "Invalid power state number: %s\n", optarg); + power_usage(); + } + break; + case 'w': + workload = strtol(optarg, &end, 0); + if (*end != '\0') { + fprintf(stderr, "Invalid workload hint: %s\n", optarg); + power_usage(); + } + break; + default: + power_usage(); + } + } + + /* Check that a controller was specified. */ + if (optind >= argc) + power_usage(); + + if (listflag && powerflag) { + fprintf(stderr, "Can't set power and list power states\n"); + power_usage(); + } + + open_dev(argv[optind], &fd, 1, 1); + read_controller_data(fd, &cdata); + + if (listflag) { + power_list(&cdata); + goto out; + } + + if (powerflag) { + power_set(fd, power, workload, 0); + goto out; + } + power_show(fd); + +out: + close(fd); + exit(0); +} Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Sat Jan 30 22:03:14 2016 (r295086) +++ head/sys/dev/nvme/nvme.h Sat Jan 30 22:48:06 2016 (r295087) @@ -392,6 +392,34 @@ enum nvme_activate_action { NVME_AA_ACTIVATE = 0x2, }; +struct nvme_power_state { + /** Maximum Power */ + uint16_t mp; /* Maximum Power */ + uint8_t ps_rsvd1; + uint8_t mps : 1; /* Max Power Scale */ + uint8_t nops : 1; /* Non-Operational State */ + uint8_t ps_rsvd2 : 6; + uint32_t enlat; /* Entry Latency */ + uint32_t exlat; /* Exit Latency */ + uint8_t rrt : 5; /* Relative Read Throughput */ + uint8_t ps_rsvd3 : 3; + uint8_t rrl : 5; /* Relative Read Latency */ + uint8_t ps_rsvd4 : 3; + uint8_t rwt : 5; /* Relative Write Throughput */ + uint8_t ps_rsvd5 : 3; + uint8_t rwl : 5; /* Relative Write Latency */ + uint8_t ps_rsvd6 : 3; + uint16_t idlp; /* Idle Power */ + uint8_t ps_rsvd7 : 6; + uint8_t ips : 2; /* Idle Power Scale */ + uint8_t ps_rsvd8; + uint16_t actp; /* Active Power */ + uint8_t apw : 3; /* Active Power Workload */ + uint8_t ps_rsvd9 : 3; + uint8_t aps : 2; /* Active Power Scale */ + uint8_t ps_rsvd10[9]; +} __packed; + #define NVME_SERIAL_NUMBER_LENGTH 20 #define NVME_MODEL_NUMBER_LENGTH 40 #define NVME_FIRMWARE_REVISION_LENGTH 8 @@ -532,7 +560,7 @@ struct nvme_controller_data { uint8_t reserved5[1344]; /* bytes 2048-3071: power state descriptors */ - uint8_t reserved6[1024]; + struct nvme_power_state power_state[32]; /* bytes 3072-4095: vendor specific */ uint8_t vs[1024];