From owner-svn-src-head@freebsd.org Sun Aug 28 00:26: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 8120AB78E05; Sun, 28 Aug 2016 00:26:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5249EA63; Sun, 28 Aug 2016 00:26:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S0Q6rU008027; Sun, 28 Aug 2016 00:26:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S0Q6re008026; Sun, 28 Aug 2016 00:26:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608280026.u7S0Q6re008026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 28 Aug 2016 00:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304931 - head/lib/libc/amd64/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.22 Precedence: list List-Id: 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, 28 Aug 2016 00:26:07 -0000 Author: kib Date: Sun Aug 28 00:26:06 2016 New Revision: 304931 URL: https://svnweb.freebsd.org/changeset/base/304931 Log: Follow ABI when calling __error from the ptrace(2) wrapper. In particular, preserve syscall arguments on stack, since callee is not required to preserve arg-passing registers. Align stack. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/amd64/sys/ptrace.S Modified: head/lib/libc/amd64/sys/ptrace.S ============================================================================== --- head/lib/libc/amd64/sys/ptrace.S Sun Aug 28 00:21:24 2016 (r304930) +++ head/lib/libc/amd64/sys/ptrace.S Sun Aug 28 00:26:06 2016 (r304931) @@ -42,11 +42,21 @@ __FBSDID("$FreeBSD$"); .type CNAME(__error),@function ENTRY(ptrace) + pushq %rdi /* align stack */ + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx #ifdef PIC callq PIC_PLT(CNAME(__error)) #else callq CNAME(__error) #endif + popq %rcx + popq %rdx + popq %rsi + popq %rdi + popq %rdi movl $0,(%rax) mov $SYS_ptrace,%eax KERNCALL From owner-svn-src-head@freebsd.org Sun Aug 28 00:38: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 2A8BFA940E4 for ; Sun, 28 Aug 2016 00:38:21 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A708FF56 for ; Sun, 28 Aug 2016 00:38:20 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f53.google.com with SMTP id f93so79299395lfi.2 for ; Sat, 27 Aug 2016 17:38:20 -0700 (PDT) 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-transfer-encoding; bh=CqzY24gTXCDAhois49WeRcC2izgSSxhhQlJS35mdWlY=; b=VMMjX5uEjwDDgNr4n1Vo00L2b6ye0K5/aBpBcedkLPHgclQfHhpfXRDTwC9FTISmv2 aPs7lSVpoE9Q2enJwB9/eEoA4y0/hDuDd/Ez8QPFX+5altNKK0jEqX3pH+iF6fQ7CJi7 cK2IXHC3rktOwhCkFlx/6nP1AuXu+HYl5AskgGwN8JS253SLKbhF8kCLex8RSJpFz5hf RevrBt8WK2FNwweFzzjFkvC4C2PBzTRy782tRY4ovinQH9bO9psZCNWbqYb8y8oJ8pRs F+mSJRb8uXJIxA9D/00tVW4kGFlQJVyrz23eI2pC79vAP+3NsrLYg77lR4arwKUCXBQG nCMQ== X-Gm-Message-State: AE9vXwPlhmlq35y5MQRD7u0wF710xKhev6k1h1OtC//RckYrhE7jCgd7SMfkkPFS+PVkyQ== X-Received: by 10.25.150.208 with SMTP id y199mr45608lfd.92.1472344692318; Sat, 27 Aug 2016 17:38:12 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id e123sm5282761lfg.16.2016.08.27.17.38.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 17:38:11 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608272303.u7RN3N0D078505@repo.freebsd.org> From: Andrey Chernov Message-ID: <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> Date: Sun, 28 Aug 2016 03:38:10 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608272303.u7RN3N0D078505@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 00:38:21 -0000 On 28.08.2016 2:03, Konstantin Belousov wrote: > Since ptrace(2) syscall can return -1 for non-error situations, libc > wrappers set errno to 0 before performing the syscall, as the service > to the caller. Both C99 and POSIX directly prohibits any standard function to set errno to 0. ptrace() should either choose other errno to indicate non-error situation or change return -1 to something else. From owner-svn-src-head@freebsd.org Sun Aug 28 00:50: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 A6CDCA94318 for ; Sun, 28 Aug 2016 00:50:08 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37A03395 for ; Sun, 28 Aug 2016 00:50:07 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f50.google.com with SMTP id g62so79238285lfe.3 for ; Sat, 27 Aug 2016 17:50:07 -0700 (PDT) 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-transfer-encoding; bh=yTiGsqRm/ulrXF7bIzUDTyHbq7lndqDcad34tP1k1dI=; b=YHdWwbo0jyQdZu3TamUNpli7fLEjGxVv8s6T883KuUhfny9+k8HzmV0eRurnzHzmn+ T4wh1smItXlzy7fhNGRiLVQFzIJzbjI0Mvsa4ZUj7mWoXOXWUDDNasfDdBsyFeess9X4 Ew2+X4K1CAKvIhaOR+0J69oK9+G2PYQVYh3YSsRR/ZoKsGVlbIIRAG8sAF2oJRWiBuTj +x0NW5uXqOZsjd8nUFj7EYNmZ68eK6r4iZxa3hQLuS3+TF6gihn6RgKlqhmF7AWf1mTh pn3tVTlzX0lyUQZN52VYrnRaD12YAB8nfsbiqUIK6pYvxCPDSLjwYozGpFdOqEN4tP4p faDg== X-Gm-Message-State: AE9vXwMQhP9ohCPzlg0toZpIndPndVEoJRlX2f3IoDVJbjA+gRLC+5O8yVhFVZka10k5rA== X-Received: by 10.25.24.30 with SMTP id o30mr3530392lfi.58.1472345405298; Sat, 27 Aug 2016 17:50:05 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id d15sm5211028lfg.0.2016.08.27.17.50.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 17:50:04 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> From: Andrey Chernov Message-ID: Date: Sun, 28 Aug 2016 03:50:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 00:50:08 -0000 On 28.08.2016 3:38, Andrey Chernov wrote: > On 28.08.2016 2:03, Konstantin Belousov wrote: >> Since ptrace(2) syscall can return -1 for non-error situations, libc >> wrappers set errno to 0 before performing the syscall, as the service >> to the caller. > > Both C99 and POSIX directly prohibits any standard function to set errno > to 0. ptrace() should either choose other errno to indicate non-error > situation or change return -1 to something else. > ...and don't touch errno. POSIX: "No function in this volume of POSIX.1-2008 shall set errno to zero." > On both i386 and amd64, the errno symbol was directly > referenced, which only works correctly in single-threaded process. POSIX: "For each thread of a process, the value of errno shall not be affected by function calls or assignments to errno by other threads." From owner-svn-src-head@freebsd.org Sun Aug 28 00:56: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 351A7A94621; Sun, 28 Aug 2016 00:56:44 +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 C03EBA27; Sun, 28 Aug 2016 00:56:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7S0ucOG029266 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 28 Aug 2016 03:56:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7S0ucOG029266 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7S0ubMp029265; Sun, 28 Aug 2016 03:56:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 28 Aug 2016 03:56:37 +0300 From: Konstantin Belousov To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Message-ID: <20160828005637.GG83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 28 Aug 2016 00:56:44 -0000 On Sun, Aug 28, 2016 at 03:38:10AM +0300, Andrey Chernov wrote: > On 28.08.2016 2:03, Konstantin Belousov wrote: > > Since ptrace(2) syscall can return -1 for non-error situations, libc > > wrappers set errno to 0 before performing the syscall, as the service > > to the caller. > > Both C99 and POSIX directly prohibits any standard function to set errno > to 0. ptrace() should either choose other errno to indicate non-error > situation or change return -1 to something else. > ptrace(2) is not a standard function. And, we cannot break ABI for the syscall. From owner-svn-src-head@freebsd.org Sun Aug 28 01:04: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 D912DA947E5 for ; Sun, 28 Aug 2016 01:04:04 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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 6A0F0DD9 for ; Sun, 28 Aug 2016 01:04:04 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f48.google.com with SMTP id f93so79459328lfi.2 for ; Sat, 27 Aug 2016 18:04:04 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Pbk5kN459UYksGvMzF4TfnsorGdCj2gKqxTqSmCXR0s=; b=DJiNEIdt7SLQG0cA31QH1xSH1Bqzd2Ha4x3BZONgH9vp96oFFt/y7iVevctmqTGxlt wRxG0aS6EDldqv9tnM/eY04apZ2jQEKFGw3yqTLhrgsDcCa/I9HwOw7kGKkvqbSp2eWb 0Zlm9DiRC3tfqQeRFKHzT9PdGPfXFvCfnByaoIBhgqopdZf3n20Gn9Qw9Bv3dubaZcFF QDzk240zgyvegc4F3wGJhus01IKmANETG0UFJguKudbgo8ZRXxH8w46Pd8aL/+/8Agy+ KjamY3rXitzD5poULwbu23/dPydjFz6Fz9CifTjvtsxKCTolou38w4kCugqsve9th/9I 6tSg== X-Gm-Message-State: AE9vXwPIwfWh1K54NV87TVeBIJEgJ1xMqKEahu+4PnC14XZGPDBowLGL0k/N9Man+NBaSw== X-Received: by 10.25.85.198 with SMTP id j189mr3681147lfb.31.1472346242112; Sat, 27 Aug 2016 18:04:02 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id n128sm5262351lfb.45.2016.08.27.18.04.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 18:04:01 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> Date: Sun, 28 Aug 2016 04:04:00 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160828005637.GG83214@kib.kiev.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 01:04:05 -0000 On 28.08.2016 3:56, Konstantin Belousov wrote: > On Sun, Aug 28, 2016 at 03:38:10AM +0300, Andrey Chernov wrote: >> On 28.08.2016 2:03, Konstantin Belousov wrote: >>> Since ptrace(2) syscall can return -1 for non-error situations, libc >>> wrappers set errno to 0 before performing the syscall, as the service >>> to the caller. >> >> Both C99 and POSIX directly prohibits any standard function to set errno >> to 0. ptrace() should either choose other errno to indicate non-error >> situation or change return -1 to something else. >> > ptrace(2) is not a standard function. > And, we cannot break ABI for the syscall. > C99 statement sounds stricter: "The value of errno is zero at program startup, but is never set to zero by any library function. 176)" And syscall is not different from library function from C99 point of view. From owner-svn-src-head@freebsd.org Sun Aug 28 01:15: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 A7DDCA949ED; Sun, 28 Aug 2016 01:15: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 5080637F; Sun, 28 Aug 2016 01:15:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7S1F2BZ032907 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 28 Aug 2016 04:15:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7S1F2BZ032907 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7S1F2Ep032906; Sun, 28 Aug 2016 04:15:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 28 Aug 2016 04:15:01 +0300 From: Konstantin Belousov To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Message-ID: <20160828011501.GH83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 28 Aug 2016 01:15:07 -0000 On Sun, Aug 28, 2016 at 03:50:04AM +0300, Andrey Chernov wrote: > On 28.08.2016 3:38, Andrey Chernov wrote: > > On 28.08.2016 2:03, Konstantin Belousov wrote: > >> Since ptrace(2) syscall can return -1 for non-error situations, libc > >> wrappers set errno to 0 before performing the syscall, as the service > >> to the caller. > > > > Both C99 and POSIX directly prohibits any standard function to set errno > > to 0. ptrace() should either choose other errno to indicate non-error > > situation or change return -1 to something else. > > > ...and don't touch errno. > > POSIX: "No function in this volume of POSIX.1-2008 shall set errno to zero." I am quite curious where ptrace(2) is defined by POSIX. > > > On both i386 and amd64, the errno symbol was directly > > referenced, which only works correctly in single-threaded process. > > POSIX: "For each thread of a process, the value of errno shall not be > affected by function calls or assignments to errno by other threads." And ? What should the citation add new to the substance of the code change ? On Sun, Aug 28, 2016 at 04:04:00AM +0300, Andrey Chernov wrote: > On 28.08.2016 3:56, Konstantin Belousov wrote: > > On Sun, Aug 28, 2016 at 03:38:10AM +0300, Andrey Chernov wrote: > >> On 28.08.2016 2:03, Konstantin Belousov wrote: > >>> Since ptrace(2) syscall can return -1 for non-error situations, libc > >>> wrappers set errno to 0 before performing the syscall, as the service > >>> to the caller. > >> > >> Both C99 and POSIX directly prohibits any standard function to set errno > >> to 0. ptrace() should either choose other errno to indicate non-error > >> situation or change return -1 to something else. > >> > > ptrace(2) is not a standard function. > > And, we cannot break ABI for the syscall. > > > > C99 statement sounds stricter: > "The value of errno is zero at program startup, but is never set to zero > by any library function. 176)" > And syscall is not different from library function from C99 point of view. Point me to a single line in C99 which mentions ptrace(). Do you understand what did the commit changed, and what it did not ? Setting errno to zero before the syscall was the existing behaviour before the change, and I did not modified anything there. But previous wrapper set errno to zero in main thread even if called from some other thread, which was the bug fixed. From owner-svn-src-head@freebsd.org Sun Aug 28 01: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 DC259A94B41 for ; Sun, 28 Aug 2016 01:18:56 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BEC5816 for ; Sun, 28 Aug 2016 01:18:56 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f43.google.com with SMTP id g62so79420004lfe.3 for ; Sat, 27 Aug 2016 18:18:56 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=zbukKpYPENCc+CCsLwC3yAheNmCVTKJHxZu/ktaU6y4=; b=bESArFSdW/cL5iBLHmmPFxIqStSrJ65g+dKmRxjqPIG/A2EcF3UyNr6OyR7gUFABLh mNeMS3YvrqwYzE1jw/iYExcM6/QVNu37RabV6ZFRjmv4fKO5sF7SBD2v/5LgFnWlG8Qk 02tek9OHqK1BL69zfu5f6ZYnuY8h3q8peR9trtjTrUbLsHY1LPjykFS3omykYObnbLdd a5UnjBdIsoDU7J5iyG74nBsaxzhK4K9DuZqeC5vHVE2GqJobzoiY9xArj77bel4cDI8X T+y+vGsV2D9bfK2Ih3k4hOt5nh/WlnPM4cp0cx57KqsPaU+RQcOIGZT91uD6plKHiUCD uIxg== X-Gm-Message-State: AE9vXwNL2J2p4/9WJq+OnMP7A9QIKbD8Y3r+sA9I7PlN12AIbI5Jdjv7ATRirvOnXoiYNw== X-Received: by 10.46.9.144 with SMTP id 138mr3357448ljj.6.1472346799137; Sat, 27 Aug 2016 18:13:19 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id q36sm5242061lfi.26.2016.08.27.18.13.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 18:13:18 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <70b69c2b-63f0-ca41-2e5e-ebb06f765482@freebsd.org> Date: Sun, 28 Aug 2016 04:13:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 01:18:57 -0000 On 28.08.2016 4:04, Andrey Chernov wrote: > On 28.08.2016 3:56, Konstantin Belousov wrote: >> On Sun, Aug 28, 2016 at 03:38:10AM +0300, Andrey Chernov wrote: >>> On 28.08.2016 2:03, Konstantin Belousov wrote: >>>> Since ptrace(2) syscall can return -1 for non-error situations, libc >>>> wrappers set errno to 0 before performing the syscall, as the service >>>> to the caller. >>> >>> Both C99 and POSIX directly prohibits any standard function to set errno >>> to 0. ptrace() should either choose other errno to indicate non-error >>> situation or change return -1 to something else. >>> >> ptrace(2) is not a standard function. >> > > C99 statement sounds stricter: > "The value of errno is zero at program startup, but is never set to zero > by any library function. 176)" > And syscall is not different from library function from C99 point of view. > >> And, we cannot break ABI for the syscall. We can fix already broken (from standards point of view) ABI for the syscall. From owner-svn-src-head@freebsd.org Sun Aug 28 01:25: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 59F66A94D11 for ; Sun, 28 Aug 2016 01:25:51 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BD91AC8 for ; Sun, 28 Aug 2016 01:25:50 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id l89so79570534lfi.1 for ; Sat, 27 Aug 2016 18:25:50 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=BAniZ626rFJK/NorsYttLNGqMjB6+aATbLnvnv2RUAY=; b=VQDwNi5qqne0pJ4jqTpvCcdZCSRGjMCe9OMLs6n6qZY5JXfVw3LuGy5Jkn87XBXmDJ w5blitMBowN27io55VjAWN4FsCKFQu+l9SN/VDum/ME3CpOysCuNCYLlEPTxIfAYkexx W/1tpSIv0SkfiM2JlpE++1rgcgzco/nRdwTPR9AWGVJ11tjGudEDduZ86e8338BghPdw ufpq/LHkl6k7MnLC/vjTZsynqHFwfFJr/pmZZip0tyZ4Hr2LF7DhaCib6are5syJFpaD W2EYV+ymHK9QjXBzSitp/tM8vhfwzWuNXlodXYxaLV5cLtAsCyg1oY9SAWEBxPF/PDkq LsUA== X-Gm-Message-State: AE9vXwPVR3nnGjRatBtfHD+4orCPjnlD5A3YSnPyQJvXSF/2WkN4qShnWFzl4RqaczatCg== X-Received: by 10.25.19.169 with SMTP id 41mr2903292lft.24.1472347548216; Sat, 27 Aug 2016 18:25:48 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id i80sm5326519lfg.6.2016.08.27.18.25.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 18:25:47 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> <20160828011501.GH83214@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> Date: Sun, 28 Aug 2016 04:25:46 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160828011501.GH83214@kib.kiev.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 01:25:51 -0000 On 28.08.2016 4:15, Konstantin Belousov wrote: >> POSIX: "No function in this volume of POSIX.1-2008 shall set errno to zero." > I am quite curious where ptrace(2) is defined by POSIX. POSIX just repeats C99 statement for its own functions, supporting this rule too, but C99 rule is more general and related to any library functions. >> POSIX: "For each thread of a process, the value of errno shall not be >> affected by function calls or assignments to errno by other threads." > And ? What should the citation add new to the substance > of the code change ? This is for your comment "On both i386 and amd64, the errno symbol was directly referenced, which only works correctly in single-threaded process." >> C99 statement sounds stricter: >> "The value of errno is zero at program startup, but is never set to zero >> by any library function. 176)" >> And syscall is not different from library function from C99 point of view. > Point me to a single line in C99 which mentions ptrace(). > > Do you understand what did the commit changed, and what it did not ? > Setting errno to zero before the syscall was the existing behaviour > before the change, and I did not modified anything there. But previous > wrapper set errno to zero in main thread even if called from some other > thread, which was the bug fixed. If you may notice, I don't blame you and don't say that you introduce setting errno to 0. I just want to bring your attention to the problem while you are in that area and familiar with it. From owner-svn-src-head@freebsd.org Sun Aug 28 01:37: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 F26ABA94EA5 for ; Sun, 28 Aug 2016 01:37:14 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) (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 92BC0E98 for ; Sun, 28 Aug 2016 01:37:14 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f45.google.com with SMTP id g62so79530302lfe.3 for ; Sat, 27 Aug 2016 18:37:14 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=lCkFxo45hfbSIxpTlpY3dNN6YUsiEzPYbPZ0J1/VCVc=; b=JAg5InfEKmYwROIwee4TWFPoLnyxe4I45mQxklOUKVQNDrMe4hbwWPbehPVHKJNQbQ f7voVSG+bXcxv5pthP18fQchVOZyNWDMAI1magZwBLi+2mHk1ZuGpa+oGT3HShR0CnoL /U2lg6yX+iKLW7bJnAbqvPR9c5ciYaIDu+MJoc2ThEGyFcbvXnnav8b/0jGXfSdGyeOi CO59XvNfimpjPo2peTHay2iaErfsz2UrQmHcuhsdNoLBXAVG5zCMDj67RrV7v9aArS98 M8FAhph+YM1G0FuzkKeudEfXHpIfG5xCs2PuFPVt0epWXJnayYTo9G/HYfD4CMU3ZmyU r30Q== X-Gm-Message-State: AE9vXwO4tqX+oO4lWNm89oUZVxuqtrAUQcHgFfZtmdgFXktzl49Y6u3Okxi/HCqX+o23qw== X-Received: by 10.25.151.66 with SMTP id z63mr3875577lfd.159.1472348232478; Sat, 27 Aug 2016 18:37:12 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id g11sm5276570lji.25.2016.08.27.18.37.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 18:37:12 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> <20160828011501.GH83214@kib.kiev.ua> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <9fbc4bfb-7f27-fa25-917e-9909e0a32a06@freebsd.org> Date: Sun, 28 Aug 2016 04:37:11 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 01:37:15 -0000 On 28.08.2016 4:25, Andrey Chernov wrote: >> Point me to a single line in C99 which mentions ptrace(). Already done: ptrace == "any library function". From owner-svn-src-head@freebsd.org Sun Aug 28 01: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 5A938B77112 for ; Sun, 28 Aug 2016 01:45:26 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) (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 08AF0366 for ; Sun, 28 Aug 2016 01:45:25 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f45.google.com with SMTP id l89so79687982lfi.1 for ; Sat, 27 Aug 2016 18:45:25 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=a08peIWa75gh1G/sPPpwIXCAeBzfxCF5Rt+qz3R4O6I=; b=hN3M8ccUYQUDBI+1xtyroMZOmDt4XzS4UDrk9mclQNAWK+yhViI/TmsOOLN5yMKrQY yZccgswTFdfxdl6Y/0kMKUCjiZRVrtv4A7pXXgr/JY/cNlaSGnKAWzODDyZZ1xXKazxT Iyb4WxtToVp4Y2VrKPAztMkvst63PLLWjHahY2DKyK0ES3WLayWDDi4nyvrgypPXnLaX TuXmWlGAKZVkAtgidaK8/+1A0o2EvceNqMPai6WjJuYlqirKdOpkcHv/dAIxh8G0xFJX xio91RlLTEkHiRyLdeDHXalYnZFKuF+n+hu2do3vFeUMqTXibtLCVQTKV9YB0zM9oa8H dS3A== X-Gm-Message-State: AE9vXwM5I0kGELuuzAHE7oXEawsgPKXmicbukBYu1t+uqSbICu3X+uVIAQEtmvQjOcs8KA== X-Received: by 10.25.20.87 with SMTP id k84mr3656077lfi.207.1472348723698; Sat, 27 Aug 2016 18:45:23 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id k63sm5291410lfe.48.2016.08.27.18.45.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 18:45:23 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> <20160828011501.GH83214@kib.kiev.ua> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <9fbc4bfb-7f27-fa25-917e-9909e0a32a06@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <2a55f012-0b4c-1c74-4186-a37e7583025c@freebsd.org> Date: Sun, 28 Aug 2016 04:45:22 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <9fbc4bfb-7f27-fa25-917e-9909e0a32a06@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 01:45:26 -0000 On 28.08.2016 4:37, Andrey Chernov wrote: > On 28.08.2016 4:25, Andrey Chernov wrote: >>> Point me to a single line in C99 which mentions ptrace(). > > Already done: ptrace == "any library function". To elaborate it more, C99 does not have finite list of library functions, but it says about standard libraries in general (not user libraries), and ptrace() belongs to standard library according to its manpage: Standard C Library (libc, -lc) From owner-svn-src-head@freebsd.org Sun Aug 28 01:52: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 51A84B772AA; Sun, 28 Aug 2016 01:52:17 +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 C78DB982; Sun, 28 Aug 2016 01:52:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7S1qBd3042367 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 28 Aug 2016 04:52:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7S1qBd3042367 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7S1qAN7042366; Sun, 28 Aug 2016 04:52:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 28 Aug 2016 04:52:10 +0300 From: Konstantin Belousov To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Message-ID: <20160828015210.GI83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> <20160828011501.GH83214@kib.kiev.ua> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 28 Aug 2016 01:52:17 -0000 On Sun, Aug 28, 2016 at 04:25:46AM +0300, Andrey Chernov wrote: > On 28.08.2016 4:15, Konstantin Belousov wrote: > >> POSIX: "No function in this volume of POSIX.1-2008 shall set errno to zero." > > I am quite curious where ptrace(2) is defined by POSIX. > > POSIX just repeats C99 statement for its own functions, supporting this > rule too, but C99 rule is more general and related to any library functions. > > >> POSIX: "For each thread of a process, the value of errno shall not be > >> affected by function calls or assignments to errno by other threads." > > And ? What should the citation add new to the substance > > of the code change ? > > This is for your comment "On both i386 and amd64, the errno symbol was > directly referenced, which only works correctly in single-threaded > process." I still do not understand what you want to say there. Errno as the symbol existing in the symbol table of libc, gives 'POSIX errno' value for the main thread. Preprocessor definition converts C language accesses to errno into some indirections which result in accesses to per-thread errno location. The bug in x86 asm code was due to direct usage of errno. What POSIX requires from the C-level errno symbol does not define a semantic for the memory location pointed to by the errno sym-table symbol. And amusingly, all other arches did it right, except aarch64 and risc-v copied from aarch64. They lack the wrapper at all, I wrote aarch64 ptrace.S already. > > >> C99 statement sounds stricter: > >> "The value of errno is zero at program startup, but is never set to zero > >> by any library function. 176)" > >> And syscall is not different from library function from C99 point of view. > > Point me to a single line in C99 which mentions ptrace(). > > > > Do you understand what did the commit changed, and what it did not ? > > Setting errno to zero before the syscall was the existing behaviour > > before the change, and I did not modified anything there. But previous > > wrapper set errno to zero in main thread even if called from some other > > thread, which was the bug fixed. > > If you may notice, I don't blame you and don't say that you introduce > setting errno to 0. I just want to bring your attention to the problem > while you are in that area and familiar with it. > I know that POSIX requires that POSIX-defined functions did not modified errno except on error, but it cannot require anything from functions which are not defined by the standard. I agree that it would be more consistent for ptrace(2) to not do that as well, but the behaviour is already there for 35 years and I do not view the 'consistency' as a serious reason to break ABI and introduce random failures for innocent consumers of it. On Sun, Aug 28, 2016 at 04:37:11AM +0300, Andrey Chernov wrote: > On 28.08.2016 4:25, Andrey Chernov wrote: > >> Point me to a single line in C99 which mentions ptrace(). > > Already done: ptrace == "any library function". *Shaking head* 'Library functions' references in the context of C99/C11 are implicitely limited to the functions defined by the chapter 7 Library of the standard. To play this sillyness to the end, please answer whether I am allowed to provide static functions definitions in the libraries headers ? E.g. clause 7.1.2 6 of C11 says: Any declaration of a library function shall have external linkage. From owner-svn-src-head@freebsd.org Sun Aug 28 02:05: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 24387B7763B; Sun, 28 Aug 2016 02:05:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::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 DD35CF1C; Sun, 28 Aug 2016 02:05:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id x131so53838284ite.0; Sat, 27 Aug 2016 19:05:02 -0700 (PDT) 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; bh=MkabdOalRGeRSiAd8dFhNXJW714i6awxP33KaTKzdHw=; b=FmsC/J26I9sGAYaUU1Rrdg5tw3cIDr22VCICHtsKKk1FiPp5Fvcrb2cFzY6W+MhkPB 95Z/jNWosyV+DezyeQl/VHkXGdxuhP+we6DmFKAQQptU9Y0ICj8hfZh6MogVBhPELtsr VduBRC3wH3I9V48dcBNgVZrqT0tyoBH6XgusCW+mSdEpf7KYtsXpldIOnNGJkV+GsMIl L7182be86VVOFiAfP5AcYPUtM/t7cULBT803WJoBnl9LpfTLQiGt4Z5AVr10IOSukcni 9RU1HulmgTJJfWSSi9990wxHNalPK8FoGi0iSSk2OhQZipfXw92Sg1wZhx+7gUktsBXc iHOQ== 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; bh=MkabdOalRGeRSiAd8dFhNXJW714i6awxP33KaTKzdHw=; b=dOvwJz/fsIW2A4wZk1fh0WTSHdWnXAJGfIufj2izjpaTb51drnebrIfCWsn1gMK9LN yA06Z0V7HRGzzqe1M4747PxhALkP/47NUL3ofPojhBxqW/qXN9vPWLPaugnbOIdIf2ph ivQFPebCag5lVmD/HNf34FeMkgxq7VTM4AwG49KH9ER8Z1mEvJPmu+MJDxf+wo297qm/ i9gOTLfJ7IjkZ8greuJ7jA53lihVmaFp3P3Ni/rbFeafyd3KzgYCpXVOJ6H/g9IUy2tv rRmfcsK/WTs+Ijn7raH5NgBo3DdG+lj50dJNl5p8B4tg3woQFy1N5P2vl31kIBeWtujS ASoA== X-Gm-Message-State: AE9vXwN+zVwUxX7n/gByMOJVKoywbGsZERlJiEJanQqbd6hpkjL94j7n/EKDru6nSQLXPi3k9mu54DNrNhyqKw== X-Received: by 10.107.53.163 with SMTP id k35mr12175102ioo.75.1472349902362; Sat, 27 Aug 2016 19:05:02 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Sat, 27 Aug 2016 19:05:01 -0700 (PDT) In-Reply-To: <20160827004617.GJ88122@zxy.spb.ru> References: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> <20160827004617.GJ88122@zxy.spb.ru> From: Adrian Chadd Date: Sat, 27 Aug 2016 19:05:01 -0700 X-Google-Sender-Auth: 3_EyGcVPlXLp0ugP-K2ea9411g4 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 02:05:03 -0000 On 26 August 2016 at 17:46, Slawa Olhovchenkov wrote: > On Fri, Aug 26, 2016 at 04:55:34PM -0700, Adrian Chadd wrote: > >> Hi, >> >> I use the kernel lock profiling debugging, > > I am already have 100% utilise all CPU cores, I think this is drop > performance? > >> but you can use dtrace to >> get an idea: >> >> dtrace -n 'lockstat:::adaptive-block { @[stack()] = sum(arg1); }' > > How to interpret results (how to distinct lock contention from lock > cost/overhead (LOCK CMPXCGQ is very expensive))? well, paste the results? :) the lock is expensive because it's contended. :) -a >> (https://wiki.freebsd.org/DTrace/One-Liners) >> >> >> >> -adrian From owner-svn-src-head@freebsd.org Sun Aug 28 02: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 13F92B77D5C for ; Sun, 28 Aug 2016 02:33:22 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93552BB3 for ; Sun, 28 Aug 2016 02:33:21 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f50.google.com with SMTP id b199so80037903lfe.0 for ; Sat, 27 Aug 2016 19:33:21 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=NON1t5R/nN2n6ClujeeLcFiTYZBCvrnoxi/8ATI5rPM=; b=KRtuejpHzeINIz/IdA9l2CswM1Zdsr4GYWtn5LZyGs/qBj8CYRExa22pJ+gEU8t/OK US7+NIAaQEg4oXigEmbRoFbMLknKTKHfIuuTt510TwiwpKNBkLjlVT0vbsHqC8UV/BIs +umPi93Gg2bzSN4epZ7XgFo0CgT3tRnof97HPEr4wKarJdK1gYUIPGBuY2h8qTnjUMcJ dIOw4VI9WDVsIh433W+w+pKWWaeJnECFh82nz5Ho8z8W8np0M15BqD3hfVYGeGqEaXL8 a8SKw8fn2IfJQo4U1zvvbiejx3GTAyNIWOZ9n8js88FPoR6PZRKXd/Xyuy05ZzmrCU9D 1uaA== X-Gm-Message-State: AE9vXwMxaNHZNK/YC9SxNb6kPPKjJi0Mk2nEZNkQVKO1C2bRGlwYVQViyN2gGV+7Z0FJQA== X-Received: by 10.25.144.8 with SMTP id s8mr3664485lfd.94.1472351599257; Sat, 27 Aug 2016 19:33:19 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id g69sm5268331lji.44.2016.08.27.19.33.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 19:33:18 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> <20160828011501.GH83214@kib.kiev.ua> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <70b3b052-4c29-c332-14bf-e50847636a8a@freebsd.org> Date: Sun, 28 Aug 2016 05:33:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160828015210.GI83214@kib.kiev.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 02:33:22 -0000 On 28.08.2016 4:52, Konstantin Belousov wrote: >>>> POSIX: "For each thread of a process, the value of errno shall not be >>>> affected by function calls or assignments to errno by other threads." >>> And ? What should the citation add new to the substance >>> of the code change ? >> >> This is for your comment "On both i386 and amd64, the errno symbol was >> directly referenced, which only works correctly in single-threaded >> process." > I still do not understand what you want to say there. Errno as the > symbol existing in the symbol table of libc, gives 'POSIX errno' value > for the main thread. Preprocessor definition converts C language > accesses to errno into some indirections which result in accesses to > per-thread errno location. The bug in x86 asm code was due to direct > usage of errno. This particular quote is not describing a problem, it supports your change. > I know that POSIX requires that POSIX-defined functions did not modified > errno except on error, POSIX don't say it. You may modify errno to any value besides 0 while returning success from the function excepting only those functions where POSIX directly states they can't modify errno. I.e. only 0 is disallowed in all cases. > I agree that it would be more > consistent for ptrace(2) to not do that as well, but the behaviour is > already there for 35 years and I do not view the 'consistency' as a serious > reason to break ABI and introduce random failures for innocent consumers > of it. How hard it will be to bring ptrace() to what C99 expects? Perhaps now time is suited well to change some obsoleted things. >> Already done: ptrace == "any library function". > *Shaking head* > > 'Library functions' references in the context of C99/C11 are implicitely > limited to the functions defined by the chapter 7 Library of the standard. No, they are limited to the libraries described in ISO/IEC International Standards family which have C standard library among them. C standard library described in ANSI C standard which is: ISO/IEC (1999). ISO/IEC 9899:1999(E): Programming Languages. libc is C standard library with extensions, and C99 directly says about them: "conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program.3)" ptrace() is extension (additional library function) so can't set errno to 0 (it breaks strictly conforming program). > To play this sillyness to the end, please answer whether I am allowed to > provide static functions definitions in the libraries headers ? E.g. clause > 7.1.2 6 of C11 says: > Any declaration of a library function shall have external linkage. You can, as long as your static function (i.e. extension) do not alter the behavior of any strictly conforming program (see the quote above). From owner-svn-src-head@freebsd.org Sun Aug 28 04:03: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 CF297A94134; Sun, 28 Aug 2016 04:03:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D111C3; Sun, 28 Aug 2016 04:03:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S43qeW088609; Sun, 28 Aug 2016 04:03:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S43qUY088608; Sun, 28 Aug 2016 04:03:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280403.u7S43qUY088608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 04:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304932 - 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:03:53 -0000 Author: adrian Date: Sun Aug 28 04:03:52 2016 New Revision: 304932 URL: https://svnweb.freebsd.org/changeset/base/304932 Log: [mips] QCA955x config file changes to bring things into alignment with the other atheros config files. * ALT_BREAK_TO_DEBUGGER, because we get random breaks when unplugging USB to serial adapters * Build more modules! Modified: head/sys/mips/conf/QCA955X_BASE Modified: head/sys/mips/conf/QCA955X_BASE ============================================================================== --- head/sys/mips/conf/QCA955X_BASE Sun Aug 28 00:26:06 2016 (r304931) +++ head/sys/mips/conf/QCA955X_BASE Sun Aug 28 04:03:52 2016 (r304932) @@ -17,7 +17,7 @@ cpu CPU_MIPS74K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 -options BREAK_TO_DEBUGGER +#options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER # options BOOTVERBOSE=10 @@ -26,8 +26,7 @@ files "../atheros/files.ar71xx" hints "QCA955X_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -# makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc" -makeoptions MODULES_OVERRIDE="if_vlan ipfw if_gre if_gif if_bridge bridgestp" +makeoptions MODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_tap if_tun if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw ipfw_nat libalias ipfw_nptv6 urtwn urtwnfw otus otusfw" options DDB options KDB From owner-svn-src-head@freebsd.org Sun Aug 28 04:06: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 895A9A941BB; Sun, 28 Aug 2016 04:06:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C34C24C; Sun, 28 Aug 2016 04:06:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S46a8P088743; Sun, 28 Aug 2016 04:06:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S46a73088742; Sun, 28 Aug 2016 04:06:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280406.u7S46a73088742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 04:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304933 - 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:06:37 -0000 Author: adrian Date: Sun Aug 28 04:06:36 2016 New Revision: 304933 URL: https://svnweb.freebsd.org/changeset/base/304933 Log: [mips] make AR933X boards use ALT_BREAK_TO_DEBUGGER like the rest of the Atheros boards. Modified: head/sys/mips/conf/std.AR933X Modified: head/sys/mips/conf/std.AR933X ============================================================================== --- head/sys/mips/conf/std.AR933X Sun Aug 28 04:03:52 2016 (r304932) +++ head/sys/mips/conf/std.AR933X Sun Aug 28 04:06:36 2016 (r304933) @@ -25,6 +25,7 @@ makeoptions MODULES_OVERRIDE="gpio ar71x options DDB options KDB options ALQ +options ALT_BREAK_TO_DEBUGGER options SCHED_4BSD #4BSD scheduler options INET #InterNETworking From owner-svn-src-head@freebsd.org Sun Aug 28 04:06: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 2D874A941FD; Sun, 28 Aug 2016 04:06:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 009623E7; Sun, 28 Aug 2016 04:06:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S46vh1088801; Sun, 28 Aug 2016 04:06:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S46vp5088800; Sun, 28 Aug 2016 04:06:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280406.u7S46vp5088800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 04:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304934 - 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:06:58 -0000 Author: adrian Date: Sun Aug 28 04:06:57 2016 New Revision: 304934 URL: https://svnweb.freebsd.org/changeset/base/304934 Log: Since i'm using carambola 2 for more debugging, enable ARGE_DEBUG by default. Modified: head/sys/mips/conf/CARAMBOLA2 Modified: head/sys/mips/conf/CARAMBOLA2 ============================================================================== --- head/sys/mips/conf/CARAMBOLA2 Sun Aug 28 04:06:36 2016 (r304933) +++ head/sys/mips/conf/CARAMBOLA2 Sun Aug 28 04:06:57 2016 (r304934) @@ -31,6 +31,7 @@ options AR71XX_REALMEM=(64*1024* #device iic # Options required for miiproxy and mdiobus +options ARGE_DEBUG options ARGE_MDIO # Export an MDIO bus separate from arge device miiproxy # MDIO bus <-> MII PHY rendezvous From owner-svn-src-head@freebsd.org Sun Aug 28 04:07: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 AA9B2A94257; Sun, 28 Aug 2016 04:07:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 784537B5; Sun, 28 Aug 2016 04:07:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S47Ygq088869; Sun, 28 Aug 2016 04:07:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S47YTT088868; Sun, 28 Aug 2016 04:07:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280407.u7S47YTT088868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 04:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304935 - 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:07:35 -0000 Author: adrian Date: Sun Aug 28 04:07:34 2016 New Revision: 304935 URL: https://svnweb.freebsd.org/changeset/base/304935 Log: .. and since others are using wdr3600/wdr4300 right now and are having arge issues with spammed interrupts / link issues, flip on ARGE_DEBUG too. Modified: head/sys/mips/conf/TL-WDR4300 Modified: head/sys/mips/conf/TL-WDR4300 ============================================================================== --- head/sys/mips/conf/TL-WDR4300 Sun Aug 28 04:06:57 2016 (r304934) +++ head/sys/mips/conf/TL-WDR4300 Sun Aug 28 04:07:34 2016 (r304935) @@ -24,6 +24,7 @@ options AR71XX_REALMEM=(128*1024 #device iic # Options required for miiproxy and mdiobus +options ARGE_DEBUG options ARGE_MDIO # Export an MDIO bus separate from arge device miiproxy # MDIO bus <-> MII PHY rendezvous From owner-svn-src-head@freebsd.org Sun Aug 28 04:08: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 0D175A94319; Sun, 28 Aug 2016 04:08:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1C3D946; Sun, 28 Aug 2016 04:08:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S485PN088931; Sun, 28 Aug 2016 04:08:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S48557088930; Sun, 28 Aug 2016 04:08:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280408.u7S48557088930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 04:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304936 - 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:08:06 -0000 Author: adrian Date: Sun Aug 28 04:08:04 2016 New Revision: 304936 URL: https://svnweb.freebsd.org/changeset/base/304936 Log: Use ALT_BREAK_TO_DEBUGGER as well. Modified: head/sys/mips/conf/std.AR934X Modified: head/sys/mips/conf/std.AR934X ============================================================================== --- head/sys/mips/conf/std.AR934X Sun Aug 28 04:07:34 2016 (r304935) +++ head/sys/mips/conf/std.AR934X Sun Aug 28 04:08:04 2016 (r304936) @@ -25,6 +25,7 @@ makeoptions MODULES_OVERRIDE="gpio ar71x options DDB options KDB +options ALT_BREAK_TO_DEBUGGER options ALQ options SCHED_4BSD #4BSD scheduler From owner-svn-src-head@freebsd.org Sun Aug 28 04: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 43E58A94371; Sun, 28 Aug 2016 04:08:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F109DACC; Sun, 28 Aug 2016 04:08:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S48Ro2088990; Sun, 28 Aug 2016 04:08:27 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S48Qhs088985; Sun, 28 Aug 2016 04:08:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280408.u7S48Qhs088985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 04:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304937 - 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:08:28 -0000 Author: adrian Date: Sun Aug 28 04:08:26 2016 New Revision: 304937 URL: https://svnweb.freebsd.org/changeset/base/304937 Log: [mips] migrate the QCA955X_BASE file to std.QCA955X, to bring this in line with other board defaults. Added: head/sys/mips/conf/std.QCA955X - copied, changed from r304936, head/sys/mips/conf/QCA955X_BASE Deleted: head/sys/mips/conf/QCA955X_BASE Modified: head/sys/mips/conf/AP135 head/sys/mips/conf/DIR-655A1 head/sys/mips/conf/TL-ARCHERC7V2 head/sys/mips/conf/TL-WR1043NDv2 Modified: head/sys/mips/conf/AP135 ============================================================================== --- head/sys/mips/conf/AP135 Sun Aug 28 04:08:04 2016 (r304936) +++ head/sys/mips/conf/AP135 Sun Aug 28 04:08:26 2016 (r304937) @@ -15,7 +15,7 @@ #NO_UNIVERSE # Include the default QCA955x parameters -include "QCA955X_BASE" +include "std.QCA955X" ident AP135 Modified: head/sys/mips/conf/DIR-655A1 ============================================================================== --- head/sys/mips/conf/DIR-655A1 Sun Aug 28 04:08:04 2016 (r304936) +++ head/sys/mips/conf/DIR-655A1 Sun Aug 28 04:08:26 2016 (r304937) @@ -10,7 +10,7 @@ #NO_UNIVERSE # Include the default QCA955x parameters -include "QCA955X_BASE" +include "std.QCA955X" ident DIR-655A1 Modified: head/sys/mips/conf/TL-ARCHERC7V2 ============================================================================== --- head/sys/mips/conf/TL-ARCHERC7V2 Sun Aug 28 04:08:04 2016 (r304936) +++ head/sys/mips/conf/TL-ARCHERC7V2 Sun Aug 28 04:08:26 2016 (r304937) @@ -15,7 +15,7 @@ #NO_UNIVERSE # Include the default QCA955x parameters -include "QCA955X_BASE" +include "std.QCA955X" ident TL-ARCHERC7V2 Modified: head/sys/mips/conf/TL-WR1043NDv2 ============================================================================== --- head/sys/mips/conf/TL-WR1043NDv2 Sun Aug 28 04:08:04 2016 (r304936) +++ head/sys/mips/conf/TL-WR1043NDv2 Sun Aug 28 04:08:26 2016 (r304937) @@ -10,7 +10,7 @@ #NO_UNIVERSE # Include the default QCA955x parameters -include "QCA955X_BASE" +include "std.QCA955X" ident TL-WR1043NDv2 Copied and modified: head/sys/mips/conf/std.QCA955X (from r304936, head/sys/mips/conf/QCA955X_BASE) ============================================================================== --- head/sys/mips/conf/QCA955X_BASE Sun Aug 28 04:08:04 2016 (r304936, copy source) +++ head/sys/mips/conf/std.QCA955X Sun Aug 28 04:08:26 2016 (r304937) @@ -12,7 +12,7 @@ # machine mips mips -ident QCA955X_BASE +#ident std.QCA955X cpu CPU_MIPS74K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 From owner-svn-src-head@freebsd.org Sun Aug 28 04:10: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 0265BA94414; Sun, 28 Aug 2016 04:10:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5B20C5A; Sun, 28 Aug 2016 04:10:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S4AN1G089123; Sun, 28 Aug 2016 04:10:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S4ANTx089121; Sun, 28 Aug 2016 04:10:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280410.u7S4ANTx089121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 04:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304938 - 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:10:25 -0000 Author: adrian Date: Sun Aug 28 04:10:23 2016 New Revision: 304938 URL: https://svnweb.freebsd.org/changeset/base/304938 Log: [mips] move AR91XX_BASE to std.AR91XX. Added: head/sys/mips/conf/std.AR91XX - copied, changed from r304937, head/sys/mips/conf/AR91XX_BASE Deleted: head/sys/mips/conf/AR91XX_BASE Modified: head/sys/mips/conf/TP-WN1043ND Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Sun Aug 28 04:08:26 2016 (r304937) +++ head/sys/mips/conf/TP-WN1043ND Sun Aug 28 04:10:23 2016 (r304938) @@ -7,7 +7,7 @@ #NO_UNIVERSE # Include the default AR913x parameters common to all AR913x SoC users. -include "AR91XX_BASE" +include "std.AR91XX" ident TP-WN1043ND Copied and modified: head/sys/mips/conf/std.AR91XX (from r304937, head/sys/mips/conf/AR91XX_BASE) ============================================================================== --- head/sys/mips/conf/AR91XX_BASE Sun Aug 28 04:08:26 2016 (r304937, copy source) +++ head/sys/mips/conf/std.AR91XX Sun Aug 28 04:10:23 2016 (r304938) @@ -11,7 +11,7 @@ # machine mips mips -ident AR91XX_BASE +#ident std.AR91XX cpu CPU_MIPS24K makeoptions KERNLOADADDR=0x80050000 options HZ=1000 From owner-svn-src-head@freebsd.org Sun Aug 28 04:17: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 A2BA0A945E5; Sun, 28 Aug 2016 04:17:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::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 6DB28177; Sun, 28 Aug 2016 04:17:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id x131so56092333ite.0; Sat, 27 Aug 2016 21:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LE/v0DWtlXKju4vjFuP8zMlcQeh1e2F/sG5wVxk/5HM=; b=nwtkAlCNdL4w8uq/MH7z/hcrpkdNaX9nNnKYWhLlNc0C3VSC1WEUmdsJ68sSrfBcUu 80sA2oBspD1P5jdqhJcEE1I8Em4ZDBLRfz0hSIfRxnSqBZ4mSJ/aSNwLes9nRI+a0Y1z Dth8kiBmwfh3a/tDSxyod2aEjKRLNm74RaTgKWqw0l6vWIl0fpqO/wKdiRV3f2GVooq3 7ZYxrrovI6Np7de7wLBNWNRsF5C94DfWI6llgSlTnqy1YJw8d1uhWJD13gviHwQ3e63V 4er8R4uecS3Q+Bg2Svq0aQvncqO9JezWPuA568TBSmWsRretvWJLmOFvLL91Npqnp7YI a/Rg== 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; bh=LE/v0DWtlXKju4vjFuP8zMlcQeh1e2F/sG5wVxk/5HM=; b=NS/9yWSiwKSUQv+JYr7H8MDLE6FUusjhB9AinBR+PHM5+g7flrvREuxiHFUmt/WPg/ IIgadnK4DTgqrz4Dlw0LQRyGTRUnUZEsv77QZpwxj1NCMi6gY7DPm2uzgUElRhwYixBw kdzyJ4OoBt+3FJkilFn+sf7xMEJ+klx89baKx3iNQoUZQsIp6B98WQ/AMGqAp8L+sWh6 R2jMJMp6pyTsfXYIzIqDADld44I1P8f7K2FXbzn2lXolzOBfEgd1HFnEaZl1XIFqlmjg 2JdzxlnNxIHMzqXQRWN1idYiT35smKWpr3KkZFK3ZCJzMbdaHWobMqJtPscZxyyRTPQQ fEXA== X-Gm-Message-State: AE9vXwNi+9dSHQCxf8VXZy0IBJBGv3wzmNzFgERSxnl5g9flzdiOfCD3a/tnxksVlO+9EjqgQckXuYRhJGuwQA== X-Received: by 10.36.242.68 with SMTP id j65mr6633336ith.25.1472357855658; Sat, 27 Aug 2016 21:17:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Sat, 27 Aug 2016 21:17:35 -0700 (PDT) In-Reply-To: <201608271522.u7RFMtBY006582@repo.freebsd.org> References: <201608271522.u7RFMtBY006582@repo.freebsd.org> From: Adrian Chadd Date: Sat, 27 Aug 2016 21:17:35 -0700 Message-ID: Subject: Re: svn commit: r304912 - head/sys/sys To: Mariusz Zaborski 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:17:36 -0000 ... ===> lib/libnv (obj,all,install) In file included from /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/contrib/libnv/cnvlist.c:49:0: /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:107:6: error: redundant redeclaration of 'cnvlist_free_descriptor' [-Werror=redundant-decls] void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); ^ /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:101:6: note: previous declaration of 'cnvlist_free_descriptor' was here void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); ^ cc1: all warnings being treated as errors --- cnvlist.o --- *** [cnvlist.o] Error code 1 make[4]: stopped in /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv 1 error -a On 27 August 2016 at 08:22, Mariusz Zaborski wrote: > Author: oshogbo > Date: Sat Aug 27 15:22:55 2016 > New Revision: 304912 > URL: https://svnweb.freebsd.org/changeset/base/304912 > > Log: > Add missed header file for cnv.h . > > Submitted by: Adam Starak > Reported by: ache@ > > Added: > head/sys/sys/cnv.h (contents, props changed) > > Added: head/sys/sys/cnv.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/sys/cnv.h Sat Aug 27 15:22:55 2016 (r304912) > @@ -0,0 +1,113 @@ > +/*- > + * Copyright (c) 2016 Adam Starak > + * 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 _CNV_H_ > +#define _CNV_H_ > + > +#include > + > +#ifndef _KERNEL > +#include > +#include > +#include > +#include > +#endif > + > +#ifndef _NVLIST_T_DECLARED > +#define _NVLIST_T_DECLARED > +struct nvlist; > + > +typedef struct nvlist nvlist_t; > +#endif > + > +__BEGIN_DECLS > + > +/* > + * The cnvlist_get functions returns value associated with the given cookie. > + * If it returns a pointer, the pointer represents internal buffer and should > + * not be freed by the caller. > + */ > + > +bool cnvlist_get_bool(void *cookiep); > +uint64_t cnvlist_get_number(void *cookiep); > +const char *cnvlist_get_string(void *cookiep); > +const nvlist_t *cnvlist_get_nvlist(void *cookiep); > +const void *cnvlist_get_binary(void *cookiep, size_t *sizep); > +const bool *cnvlist_get_bool_array(void *cookiep, size_t *nitemsp); > +const uint64_t *cnvlist_get_number_array(void *cookiep, size_t *nitemsp); > +const char * const *cnvlist_get_string_array(void *cookiep, size_t *nitemsp); > +const nvlist_t * const *cnvlist_get_nvlist_array(void *cookiep, size_t *nitemsp); > +#ifndef _KERNEL > +int cnvlist_get_descriptor(void *cookiep); > +const int *cnvlist_get_descriptor_array(void *cookiep, size_t *nitemsp); > +#endif > + > + > +/* > + * The cnvlist_take functions returns value associated with the given cookie and > + * remove the given entry from the nvlist. > + * The caller is responsible for freeing received data. > + */ > + > +bool cnvlist_take_bool(nvlist_t *nvl, void *cookiep); > +uint64_t cnvlist_take_number(nvlist_t *nvl, void *cookiep); > +char *cnvlist_take_string(nvlist_t *nvl, void *cookiep); > +nvlist_t *cnvlist_take_nvlist(nvlist_t *nvl, void *cookiep); > +void *cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep); > +bool *cnvlist_take_bool_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); > +uint64_t *cnvlist_take_number_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); > +char **cnvlist_take_string_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); > +nvlist_t **cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); > +#ifndef _KERNEL > +int cnvlist_take_descriptor(nvlist_t *nvl, void *cookiep); > +int *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); > +#endif > + > +/* > + * The cnvlist_free functions removes the given name/value pair from the nvlist based on cookie > + * and frees memory associated with it. > + */ > + > +void cnvlist_free_bool(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_number(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_string(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_nvlist(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_binary(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_bool_array(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_number_array(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_string_array(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookiep); > +#ifndef _KERNEL > +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); > +void cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookiep); > +#endif > + > +__END_DECLS > + > +#endif /* !_CNV_H_ */ > From owner-svn-src-head@freebsd.org Sun Aug 28 04:28: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 B1A99A947F4 for ; Sun, 28 Aug 2016 04:28:45 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 405BE893 for ; Sun, 28 Aug 2016 04:28:45 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id g62so80541620lfe.3 for ; Sat, 27 Aug 2016 21:28:44 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=61YnzyjRM8vx36yND50KKoItWHOo4cko4T2EodRo98A=; b=NojYs2dZHxEjWXdVhsDFSwXeXgdNaIZtjEdHNlyVmlbzYtCmhrL1HLtbgorISwuc40 jD6ItcvbaQmiOuIBbMuWDc7+0GHv3pJ1U3bECO1u9jQQUgL9oNCejYVDTj4gO+yuZnm4 5P7LPZm0EBcQ/UhyrbkfmmPd4v7d6cZRayEwpABlOS0U4IKDbgf6WxS1GyaZCUfppyKp WzyN3dcUs7ZjVtQ8uKz65rk+SBF0yXJ6vVt/h9T25YW8bOBKokmnqqAY2YaIn8EansRs MbTX7I64MIoO1NoFRjn+I+DDxYu0Rn4LeHIM0fQNcZLqyxNFK6fAh9C1tkTe9jNcORxz FwTg== X-Gm-Message-State: AE9vXwPy74hPCG5L2mRRqDwqDqswmEJRPsGl7qGXDEsbLHGh7hH05ZisKHMmBEK1d0V0NQ== X-Received: by 10.25.145.7 with SMTP id t7mr2938742lfd.18.1472358522883; Sat, 27 Aug 2016 21:28:42 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id u186sm5518864lff.27.2016.08.27.21.28.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 21:28:42 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> <20160828011501.GH83214@kib.kiev.ua> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> <70b3b052-4c29-c332-14bf-e50847636a8a@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <116b0fed-3502-e380-a8a1-9bf41b9862f5@freebsd.org> Date: Sun, 28 Aug 2016 07:28:41 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <70b3b052-4c29-c332-14bf-e50847636a8a@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 04:28:45 -0000 On 28.08.2016 5:33, Andrey Chernov wrote: > "conforming implementation may have extensions (including additional > library functions), provided they do not alter the behavior of any > strictly conforming program.3)" > > ptrace() is extension (additional library function) so can't set errno > to 0 (it breaks strictly conforming program). Sorry for misguiding in this particular part. I confuse the "strictly conforming program" with the "conforming program" term used there too. "Strictly conforming program" can't call ptrace(). In any case our own ptrace(2) manpage suggest to set errno to 0 manually _before_ ptrace() call and do not relay on ptrace() to do it by itself: "Some requests can cause ptrace() to return -1 as a non-error value; to disambiguate, errno can be set to 0 before the call and checked afterwards." It will be better to stay common policy about errno even for extensions to not keep exclusions in the mind. From owner-svn-src-head@freebsd.org Sun Aug 28 04:40: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 3B22FA94A28; Sun, 28 Aug 2016 04:40:28 +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 0DD7DD02; Sun, 28 Aug 2016 04:40:27 +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 u7S4eRMB000187; Sun, 28 Aug 2016 04:40:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S4eRAF000186; Sun, 28 Aug 2016 04:40:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608280440.u7S4eRAF000186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 28 Aug 2016 04:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304940 - head/sys/dev/uart 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:40:28 -0000 Author: jhibbits Date: Sun Aug 28 04:40:27 2016 New Revision: 304940 URL: https://svnweb.freebsd.org/changeset/base/304940 Log: Fix UART PPS capture mode printing * Add breaks to prevent fallthrough and printing of multiple modes. * Only check the mode, mask out all other bits. Modified: head/sys/dev/uart/uart_core.c Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sun Aug 28 04:15:20 2016 (r304939) +++ head/sys/dev/uart/uart_core.c Sun Aug 28 04:40:27 2016 (r304940) @@ -97,15 +97,19 @@ uart_pps_print_mode(struct uart_softc *s { device_printf(sc->sc_dev, "PPS capture mode: "); - switch(sc->sc_pps_mode) { + switch(sc->sc_pps_mode & UART_PPS_SIGNAL_MASK) { case UART_PPS_DISABLED: printf("disabled"); + break; case UART_PPS_CTS: printf("CTS"); + break; case UART_PPS_DCD: printf("DCD"); + break; default: printf("invalid"); + break; } if (sc->sc_pps_mode & UART_PPS_INVERT_PULSE) printf("-Inverted"); From owner-svn-src-head@freebsd.org Sun Aug 28 04:54: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 F04D9A94D6D; Sun, 28 Aug 2016 04:54:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C06EA625; Sun, 28 Aug 2016 04:54:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S4s2PV007256; Sun, 28 Aug 2016 04:54:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S4s2rY007255; Sun, 28 Aug 2016 04:54:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280454.u7S4s2rY007255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 04:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304941 - head/tools/tools/net80211/wlanwds 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.22 Precedence: list List-Id: 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, 28 Aug 2016 04:54:04 -0000 Author: adrian Date: Sun Aug 28 04:54:02 2016 New Revision: 304941 URL: https://svnweb.freebsd.org/changeset/base/304941 Log: [net80211] fix up wlanwds to compile without warnings on clang. Modified: head/tools/tools/net80211/wlanwds/wlanwds.c Modified: head/tools/tools/net80211/wlanwds/wlanwds.c ============================================================================== --- head/tools/tools/net80211/wlanwds/wlanwds.c Sun Aug 28 04:40:27 2016 (r304940) +++ head/tools/tools/net80211/wlanwds/wlanwds.c Sun Aug 28 04:54:02 2016 (r304941) @@ -182,7 +182,7 @@ static int getparent(const char *ifname, char parent[IFNAMSIZ+1]) { char oid[256]; - int parentlen; + size_t parentlen; /* fetch parent interface name */ snprintf(oid, sizeof(oid), "net.wlan.%s.%%parent", ifname+4); @@ -239,7 +239,7 @@ iswdsvap(int s, const char *ifname) * to have already verified this is possible. */ static void -getbssid(int s, const char *ifname, char bssid[IEEE80211_ADDR_LEN]) +getbssid(int s, const char *ifname, uint8_t bssid[IEEE80211_ADDR_LEN]) { struct ieee80211req ireq; @@ -261,7 +261,7 @@ static void scanforvaps(int s) { char ifname[IFNAMSIZ+1]; - char bssid[IEEE80211_ADDR_LEN]; + uint8_t bssid[IEEE80211_ADDR_LEN]; int i; /* XXX brutal; should just walk sysctl tree */ From owner-svn-src-head@freebsd.org Sun Aug 28 05:28: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 01653B789D2; Sun, 28 Aug 2016 05:28:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 87967AB9; Sun, 28 Aug 2016 05:28:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 39217D60639; Sun, 28 Aug 2016 15:28:03 +1000 (AEST) Date: Sun, 28 Aug 2016 15:28:02 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys In-Reply-To: <70b3b052-4c29-c332-14bf-e50847636a8a@freebsd.org> Message-ID: <20160828144742.G1008@besplex.bde.org> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> <20160828011501.GH83214@kib.kiev.ua> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> <70b3b052-4c29-c332-14bf-e50847636a8a@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=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Wu7WcbGaMFfnaRmiAcQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 05:28:12 -0000 On Sun, 28 Aug 2016, Andrey Chernov wrote: > On 28.08.2016 4:52, Konstantin Belousov wrote: >>>>> POSIX: "For each thread of a process, the value of errno shall not be >>>>> affected by function calls or assignments to errno by other threads." >>>> And ? What should the citation add new to the substance >>>> of the code change ? >>> >>> This is for your comment "On both i386 and amd64, the errno symbol was >>> directly referenced, which only works correctly in single-threaded >>> process." >> I still do not understand what you want to say there. Errno as the >> symbol existing in the symbol table of libc, gives 'POSIX errno' value >> for the main thread. Preprocessor definition converts C language >> accesses to errno into some indirections which result in accesses to >> per-thread errno location. The bug in x86 asm code was due to direct >> usage of errno. > > This particular quote is not describing a problem, it supports your change. > >> I know that POSIX requires that POSIX-defined functions did not modified >> errno except on error, > > POSIX don't say it. You may modify errno to any value besides 0 while > returning success from the function excepting only those functions where > POSIX directly states they can't modify errno. I.e. only 0 is disallowed > in all cases. POSIX seems to be very deficient in stating which functions can't modify errno. It doesn't say this clearly even for strtol(). C90 and later C standards say this clearly for strtol() but not many other functions since not many other functions need this in plain C. POSIX only says this indirectly even for strtol() by saying that it defers to the C standard unless stated otherwise. But POSIX has many functions that need this statement, starting with read() with sizes > SSIZE_MAX on implementations that support such sizes. (read() is very hard to use if you use such sizes with it. v7 had the correct arg type (int) to disallow such sizes. Now read() is only safe to use by avoiding such sizes. This is easy to do in applications but not in libraries.) >> I agree that it would be more >> consistent for ptrace(2) to not do that as well, but the behaviour is >> already there for 35 years and I do not view the 'consistency' as a serious >> reason to break ABI and introduce random failures for innocent consumers >> of it. > > How hard it will be to bring ptrace() to what C99 expects? Perhaps now > time is suited well to change some obsoleted things. This should be safe to change, since portable applications like gdb can't assume that the implemementation clobbers errno for them. Even FreeBSD's man page doesn't document the FreeBSD behaviour. It documents, with poor wording, that applications must set errno as usual: %%% RETURN VALUES Some requests can cause ptrace() to return -1 as a non-error value; to disambiguate, errno can be set to 0 before the call and checked afterwards. %%% The poor wording is just "errno can be set to 0". It _must_ be set to 0. Also, the function gurantees to not clobber errno so that this checking is guaranteed to work. FreeBSD's man page for strtol says nothing at all about either setting errno before calls or the C90+ guarantees that make this useful. > "conforming implementation may have extensions (including additional > library functions), provided they do not alter the behavior of any > strictly conforming program.3)" > > ptrace() is extension (additional library function) so can't set errno > to 0 (it breaks strictly conforming program). Use of ptrace() makes a program very far from stricty conforming. Only quality of implementation requires ptrace() to follow the usual rules. Bruce From owner-svn-src-head@freebsd.org Sun Aug 28 05:42: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 33A23B78DFF; Sun, 28 Aug 2016 05:42:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0130526E; Sun, 28 Aug 2016 05:42:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S5g4jx022766; Sun, 28 Aug 2016 05:42:04 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S5g4RH022765; Sun, 28 Aug 2016 05:42:04 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608280542.u7S5g4RH022765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 28 Aug 2016 05:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304944 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.22 Precedence: list List-Id: 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, 28 Aug 2016 05:42:05 -0000 Author: adrian Date: Sun Aug 28 05:42:03 2016 New Revision: 304944 URL: https://svnweb.freebsd.org/changeset/base/304944 Log: [ath_hal] add USB PHY control registers for hornet/AR9330. Obtained from: linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300phy.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300phy.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300phy.h Sun Aug 28 05:18:39 2016 (r304943) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300phy.h Sun Aug 28 05:42:03 2016 (r304944) @@ -1883,6 +1883,12 @@ #define AR_PHY_PLL_BB_DPLL4 AR_PHY_65NM(overlay_0x16180.Osprey.ch0_bb_dpll4) /* + * Wasp/Hornet PHY USB PLL control + */ +#define AR_PHY_USB_CTRL1 0x16c84 +#define AR_PHY_USB_CTRL2 0x16c88 + +/* * PMU Register Map */ #define AR_PHY_PMU(_field) offsetof(struct pmu_reg, _field) From owner-svn-src-head@freebsd.org Sun Aug 28 07:40: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 151C7B78268; Sun, 28 Aug 2016 07:40:13 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D939C3B4; Sun, 28 Aug 2016 07:40:12 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7S7eC5m067013; Sun, 28 Aug 2016 07:40:12 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7S7eCH6067012; Sun, 28 Aug 2016 07:40:12 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201608280740.u7S7eCH6067012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 28 Aug 2016 07:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304952 - 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.22 Precedence: list List-Id: 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, 28 Aug 2016 07:40:13 -0000 Author: oshogbo Date: Sun Aug 28 07:40:11 2016 New Revision: 304952 URL: https://svnweb.freebsd.org/changeset/base/304952 Log: Remove duplicated declaration. Reported by: adrian@ Modified: head/sys/sys/cnv.h Modified: head/sys/sys/cnv.h ============================================================================== --- head/sys/sys/cnv.h Sun Aug 28 07:19:33 2016 (r304951) +++ head/sys/sys/cnv.h Sun Aug 28 07:40:11 2016 (r304952) @@ -98,7 +98,6 @@ void cnvlist_free_number(nvlist_t *nvl, void cnvlist_free_string(nvlist_t *nvl, void *cookiep); void cnvlist_free_nvlist(nvlist_t *nvl, void *cookiep); void cnvlist_free_binary(nvlist_t *nvl, void *cookiep); -void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); void cnvlist_free_bool_array(nvlist_t *nvl, void *cookiep); void cnvlist_free_number_array(nvlist_t *nvl, void *cookiep); void cnvlist_free_string_array(nvlist_t *nvl, void *cookiep); From owner-svn-src-head@freebsd.org Sun Aug 28 07:40: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 7593EB783AB; Sun, 28 Aug 2016 07:40:36 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 081D778B; Sun, 28 Aug 2016 07:40:36 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id q128so40817913wma.1; Sun, 28 Aug 2016 00:40:35 -0700 (PDT) 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; bh=ALmXfGB/ARK37NGGT03Ls7PwdivTwz0lxwIJjU/iuY8=; b=jdqgXX1hm06FQJyDTvlsQhKpIlnrpl3lbNgfyBNSBlCPyuY28/Z1LejY4R3Vwj3LUr 7SDEMOP7oIcaqKaTpr7NW+IXE/+3px7G446L5+uzdPB0wYu70XLwL7noGcokBbh/mgMW avaZxjkEBDaP+2lQL1inCKfv3SPZB2NGonCyodpnMqlo7GNX6oNoyoV+mMs9xpyaG+LZ qxK11fjwKXLLbuTVKnX4NVm0HL3bfID1ii3rYVyAaVciXOvbcarDKssKq+0CGXfZASl1 aD/I0j6ITMa4L5H0Q5U2dX6bGt6JbBme1TqwXXkS7oDj8FNzJnOKuI172v/SY/1ylw30 zxGA== 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; bh=ALmXfGB/ARK37NGGT03Ls7PwdivTwz0lxwIJjU/iuY8=; b=X5ysnWxe0wv/ayttl2+bN8NcUHh5x47gPuoBGjD3Z9FZ7qw9Muv7tIgg9cScHSPySi 4GzUVIxrD5JDCjvW8qRpDUxJxNy62oIGNdfO/JhHoE/dnBUk4jETNNKK5dDJaSF6JNxS DDBwjRlQOQNGYU4xl0HHcKjk7LD0QFsh1/g4wDHF8hLLXmqOtR+gJj3Jmo72vAdfu0xh z2znsSvspZkr7rcX0J9EJzKiw4Y9yVI8qvLQtVte1rrR2oroNhasCow2rR7+wzxK47sn hiiLpf9ODm2vXzc0ueVPOFTyIb5tmTojVU8ZH51yLYw4O9zJpZEKqcGaC4jes64Dxsmm HtVw== X-Gm-Message-State: AE9vXwMdH+adB/YeDusDg60xyp4gU+rdH9hG/Oex5/N2xqd5L6ERv7s/GvOeLN0U12HQeCaO2yGn20v0XVKtqA== X-Received: by 10.28.238.88 with SMTP id m85mr5292744wmh.92.1472370034345; Sun, 28 Aug 2016 00:40:34 -0700 (PDT) MIME-Version: 1.0 Sender: oshogbo.vx@gmail.com Received: by 10.28.158.193 with HTTP; Sun, 28 Aug 2016 00:40:33 -0700 (PDT) In-Reply-To: References: <201608271522.u7RFMtBY006582@repo.freebsd.org> From: Mariusz Zaborski Date: Sun, 28 Aug 2016 09:40:33 +0200 X-Google-Sender-Auth: QYQA9T4oLoWojQvFww1rCD_oI0I Message-ID: Subject: Re: svn commit: r304912 - head/sys/sys To: Adrian Chadd 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.22 Precedence: list List-Id: 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, 28 Aug 2016 07:40:36 -0000 Eh, sorry. Fixed in the @304952. On 28 August 2016 at 06:17, Adrian Chadd wrote: > ... > > ===> lib/libnv (obj,all,install) > In file included from > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/contrib/libnv/cnvlist.c:49:0: > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:107:6: > error: redundant redeclaration of 'cnvlist_free_descriptor' > [-Werror=redundant-decls] > void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); > ^ > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:101:6: > note: previous declaration of 'cnvlist_free_descriptor' was here > void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); > ^ > cc1: all warnings being treated as errors > --- cnvlist.o --- > *** [cnvlist.o] Error code 1 > > make[4]: stopped in /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv > 1 error > > > > -a > > > On 27 August 2016 at 08:22, Mariusz Zaborski wrote: >> Author: oshogbo >> Date: Sat Aug 27 15:22:55 2016 >> New Revision: 304912 >> URL: https://svnweb.freebsd.org/changeset/base/304912 >> >> Log: >> Add missed header file for cnv.h . >> >> Submitted by: Adam Starak >> Reported by: ache@ >> >> Added: >> head/sys/sys/cnv.h (contents, props changed) >> >> Added: head/sys/sys/cnv.h >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/sys/cnv.h Sat Aug 27 15:22:55 2016 (r304912) >> @@ -0,0 +1,113 @@ >> +/*- >> + * Copyright (c) 2016 Adam Starak >> + * 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 _CNV_H_ >> +#define _CNV_H_ >> + >> +#include >> + >> +#ifndef _KERNEL >> +#include >> +#include >> +#include >> +#include >> +#endif >> + >> +#ifndef _NVLIST_T_DECLARED >> +#define _NVLIST_T_DECLARED >> +struct nvlist; >> + >> +typedef struct nvlist nvlist_t; >> +#endif >> + >> +__BEGIN_DECLS >> + >> +/* >> + * The cnvlist_get functions returns value associated with the given cookie. >> + * If it returns a pointer, the pointer represents internal buffer and should >> + * not be freed by the caller. >> + */ >> + >> +bool cnvlist_get_bool(void *cookiep); >> +uint64_t cnvlist_get_number(void *cookiep); >> +const char *cnvlist_get_string(void *cookiep); >> +const nvlist_t *cnvlist_get_nvlist(void *cookiep); >> +const void *cnvlist_get_binary(void *cookiep, size_t *sizep); >> +const bool *cnvlist_get_bool_array(void *cookiep, size_t *nitemsp); >> +const uint64_t *cnvlist_get_number_array(void *cookiep, size_t *nitemsp); >> +const char * const *cnvlist_get_string_array(void *cookiep, size_t *nitemsp); >> +const nvlist_t * const *cnvlist_get_nvlist_array(void *cookiep, size_t *nitemsp); >> +#ifndef _KERNEL >> +int cnvlist_get_descriptor(void *cookiep); >> +const int *cnvlist_get_descriptor_array(void *cookiep, size_t *nitemsp); >> +#endif >> + >> + >> +/* >> + * The cnvlist_take functions returns value associated with the given cookie and >> + * remove the given entry from the nvlist. >> + * The caller is responsible for freeing received data. >> + */ >> + >> +bool cnvlist_take_bool(nvlist_t *nvl, void *cookiep); >> +uint64_t cnvlist_take_number(nvlist_t *nvl, void *cookiep); >> +char *cnvlist_take_string(nvlist_t *nvl, void *cookiep); >> +nvlist_t *cnvlist_take_nvlist(nvlist_t *nvl, void *cookiep); >> +void *cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep); >> +bool *cnvlist_take_bool_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >> +uint64_t *cnvlist_take_number_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >> +char **cnvlist_take_string_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >> +nvlist_t **cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >> +#ifndef _KERNEL >> +int cnvlist_take_descriptor(nvlist_t *nvl, void *cookiep); >> +int *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >> +#endif >> + >> +/* >> + * The cnvlist_free functions removes the given name/value pair from the nvlist based on cookie >> + * and frees memory associated with it. >> + */ >> + >> +void cnvlist_free_bool(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_number(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_string(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_nvlist(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_binary(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_bool_array(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_number_array(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_string_array(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookiep); >> +#ifndef _KERNEL >> +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); >> +void cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookiep); >> +#endif >> + >> +__END_DECLS >> + >> +#endif /* !_CNV_H_ */ >> From owner-svn-src-head@freebsd.org Sun Aug 28 11:51: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 34EAEB78DC5; Sun, 28 Aug 2016 11:51:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06167AB1; Sun, 28 Aug 2016 11:51:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SBpkoO051785; Sun, 28 Aug 2016 11:51:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SBpkd3051784; Sun, 28 Aug 2016 11:51:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608281151.u7SBpkd3051784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 28 Aug 2016 11:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304953 - head/sys/contrib/ipfilter/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.22 Precedence: list List-Id: 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, 28 Aug 2016 11:51:47 -0000 Author: dim Date: Sun Aug 28 11:51:46 2016 New Revision: 304953 URL: https://svnweb.freebsd.org/changeset/base/304953 Log: Define ipfilter's SOLARIS macro in a defined and portable way. Reviewed by: cy MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7671 Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Sun Aug 28 07:40:11 2016 (r304952) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Sun Aug 28 11:51:46 2016 (r304953) @@ -32,7 +32,11 @@ # define __KERNEL__ #endif -#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +#if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +#else +# define SOLARIS 0 +#endif #if defined(__SVR4) || defined(__svr4__) || defined(__sgi) From owner-svn-src-head@freebsd.org Sun Aug 28 12: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 80010B799E9; Sun, 28 Aug 2016 12:05:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52FCEA04; Sun, 28 Aug 2016 12:05:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SC5Yus058533; Sun, 28 Aug 2016 12:05:34 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SC5Yro058532; Sun, 28 Aug 2016 12:05:34 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201608281205.u7SC5Yro058532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 28 Aug 2016 12:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304956 - head/sys/modules 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.22 Precedence: list List-Id: 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, 28 Aug 2016 12:05:35 -0000 Author: bz Date: Sun Aug 28 12:05:34 2016 New Revision: 304956 URL: https://svnweb.freebsd.org/changeset/base/304956 Log: Back out r304907, Ed had fixed it apparently earlier in the cloudabi* subdirectories. Reported by: np Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Aug 28 11:58:15 2016 (r304955) +++ head/sys/modules/Makefile Sun Aug 28 12:05:34 2016 (r304956) @@ -766,7 +766,7 @@ _epic= epic _igb= igb .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _cloudabi32= cloudabi32 .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-head@freebsd.org Sun Aug 28 12:41: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 93347B76231 for ; Sun, 28 Aug 2016 12:41:55 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 210F3CCA for ; Sun, 28 Aug 2016 12:41:54 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f54.google.com with SMTP id g62so84120096lfe.3 for ; Sun, 28 Aug 2016 05:41:54 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Ql3xqxQSlAuEtTK7JLYGOqdvGTisyNOoclJhBzEVpmg=; b=a1qWzc5Xl0HIe66lqQulMWStRl4rZlMrNFd5BdPNEkM3wARQK93ax0AdXJw3wdZXZX lf19gpqadpfYuzeOMOS9piQYR7Ohk/gmxGbUIqfVPxDqSIOS24cCSVSwDzSQAAPZgTky 2vF7EXMGL0oFNTmk5t118YqFsrZX5sb5myATJefVj8PIl/WSO0l3vE26hOwezYFFf5p3 2R+ObnXOpVggfmzusuOAksWtKZ4WUnwo2NEVMK5cupdsuXVfmj40yaviMJTL9fjnl8My IT6rKtluvbnRMd0eSff6DXq5JxXUsCH2R40cy4Yh/nFK1vwy0beD2o1FKt+8lip1zXVo lDhQ== X-Gm-Message-State: AE9vXwPZOOyVCVDS7lI4nYVNrCwJ9yu66znvZco5rb7k7pJbu02ColmYe4xsAe4q/5OYaw== X-Received: by 10.25.161.12 with SMTP id k12mr3465805lfe.22.1472388112585; Sun, 28 Aug 2016 05:41:52 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id i22sm5670319lfh.8.2016.08.28.05.41.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Aug 2016 05:41:52 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Bruce Evans References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <9bcf10db-de3f-33ce-e418-03ce3283ac90@freebsd.org> <20160828005637.GG83214@kib.kiev.ua> <59ac1812-7c77-b677-51c4-dcadc6b2be7f@freebsd.org> <20160828011501.GH83214@kib.kiev.ua> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> <70b3b052-4c29-c332-14bf-e50847636a8a@freebsd.org> <20160828144742.G1008@besplex.bde.org> Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Sun, 28 Aug 2016 15:41:50 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160828144742.G1008@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 12:41:55 -0000 On 28.08.2016 8:28, Bruce Evans wrote: >> How hard it will be to bring ptrace() to what C99 expects? Perhaps now >> time is suited well to change some obsoleted things. > > This should be safe to change, since portable applications like gdb can't > assume that the implemementation clobbers errno for them. It looks safe for me too. > Even FreeBSD's man page doesn't document the FreeBSD behaviour. It > documents, with poor wording, that applications must set errno as usual: > > %%% > RETURN VALUES > Some requests can cause ptrace() to return -1 as a non-error value; to > disambiguate, errno can be set to 0 before the call and checked > afterwards. > %%% > > The poor wording is just "errno can be set to 0". It _must_ be set to 0. > Also, the function gurantees to not clobber errno so that this checking > is guaranteed to work. Yes, I already mention this thing in my hour ago (related to your answer) reply. We even don't have documented that ptrace() itself overwrites errno, but document usual practice by setting it to 0 by its user instead. >> "conforming implementation may have extensions (including additional >> library functions), provided they do not alter the behavior of any >> strictly conforming program.3)" >> >> ptrace() is extension (additional library function) so can't set errno >> to 0 (it breaks strictly conforming program). > > Use of ptrace() makes a program very far from stricty conforming. Only > quality of implementation requires ptrace() to follow the usual rules. It was terms mistake from my side, I already correct myself in my hour ago reply. From owner-svn-src-head@freebsd.org Sun Aug 28 13:53: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 9C9EFB774FF; Sun, 28 Aug 2016 13:53:28 +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 5CC6CAEE; Sun, 28 Aug 2016 13:53:28 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1be0A8-000H0U-7k; Sun, 28 Aug 2016 16:30:12 +0300 Date: Sun, 28 Aug 2016 16:30:12 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160828133012.GN88122@zxy.spb.ru> References: <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> <20160827004617.GJ88122@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.22 Precedence: list List-Id: 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, 28 Aug 2016 13:53:28 -0000 On Sat, Aug 27, 2016 at 07:05:01PM -0700, Adrian Chadd wrote: > On 26 August 2016 at 17:46, Slawa Olhovchenkov wrote: > > On Fri, Aug 26, 2016 at 04:55:34PM -0700, Adrian Chadd wrote: > > > >> Hi, > >> > >> I use the kernel lock profiling debugging, > > > > I am already have 100% utilise all CPU cores, I think this is drop > > performance? > > > >> but you can use dtrace to > >> get an idea: > >> > >> dtrace -n 'lockstat:::adaptive-block { @[stack()] = sum(arg1); }' > > > > How to interpret results (how to distinct lock contention from lock > > cost/overhead (LOCK CMPXCGQ is very expensive))? > > well, paste the results? :) OK, thanks! http://m.uploadedit.com/ba3s/1472390519813.txt > the lock is expensive because it's contended. :) As I am understund lock contended: 1. Multiple thread wait same lock. 2. Performance not scaled by adding CPU power As I understund lock expensive: Intel cache coherence protocol is expensive and take lock 800K per second take too much cpu/memory bandwidth w/o any contention. Memory latency at cache miss too. Adding mory CPU power (more cores, more GHz) take me performane boost. I am think my case is not lock contended. > >> (https://wiki.freebsd.org/DTrace/One-Liners) > >> > >> > >> > >> -adrian From owner-svn-src-head@freebsd.org Sun Aug 28 14:03: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 9F3D6B778A6; Sun, 28 Aug 2016 14:03:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5E239213; Sun, 28 Aug 2016 14:03:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SE3PQ2003758; Sun, 28 Aug 2016 14:03:25 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SE3POl003757; Sun, 28 Aug 2016 14:03:25 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608281403.u7SE3POl003757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 28 Aug 2016 14:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304957 - head/sys/i386/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.22 Precedence: list List-Id: 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, 28 Aug 2016 14:03:26 -0000 Author: bde Date: Sun Aug 28 14:03:25 2016 New Revision: 304957 URL: https://svnweb.freebsd.org/changeset/base/304957 Log: Fix vm86 initialization, part 1 of 2 and a half. vm86 uses the tss, but r273995 moved tss initialization to after where it may be first used, just because tss_esp0 now depends on later initializations and/or amd64 does it later. vm86 is first used for memory sizing in cases where the loader can't figure out the size or is not used. Its initialization is placed immediately before memory sizing to support this, and the tss was initialized a little earlier. Move everything in the tss initialization except for tss_esp0 back to almost where it was, immediately before vm86 initialization (the combined move is from before dblflt_tss initialization to after). Add only early initialization of tss_esp0, later reloading of the tss, and comments. The initial tss_esp0 no longer has space for the pcb since initially the size of the pcb is not known and no pcb is needed. (Later changes broke debugging at this point, so the nonexistent pcb cannot be used by debuggers, and at the time of 273995 when ddb was almost able to debug this problem it didn't need the pcb.) The iniitial tss_esp0 still has a magic 16 bytes reserved for vm86 although I think this is unused too. Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sun Aug 28 12:05:34 2016 (r304956) +++ head/sys/i386/i386/machdep.c Sun Aug 28 14:03:25 2016 (r304957) @@ -2636,6 +2636,16 @@ init386(first) dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL); dblfault_tss.tss_ldt = GSEL(GLDT_SEL, SEL_KPL); + /* Initialize the tss (except for the final esp0) early for vm86. */ + PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + + thread0.td_kstack_pages * PAGE_SIZE - 16); + PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); + gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); + PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); + PCPU_SET(common_tssd, *PCPU_GET(tss_gdt)); + PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); + ltr(gsel_tss); + vm86_initialize(); getmemsize(first); init_param2(physmem); @@ -2701,14 +2711,10 @@ init386(first) } #endif PCPU_SET(curpcb, thread0.td_pcb); - /* make an initial tss so cpu can get interrupt stack on syscall! */ + /* Move esp0 in the tss to its final place. */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ PCPU_SET(common_tss.tss_esp0, (vm_offset_t)thread0.td_pcb - 16); - PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); - gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); - PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); - PCPU_SET(common_tssd, *PCPU_GET(tss_gdt)); - PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); + gdt[GPROC0_SEL].sd.sd_type = SDT_SYS386TSS; /* clear busy bit */ ltr(gsel_tss); /* make a call gate to reenter kernel with */ From owner-svn-src-head@freebsd.org Sun Aug 28 15:23: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 93207BA6D1C; Sun, 28 Aug 2016 15:23:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 492A8B00; Sun, 28 Aug 2016 15:23:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SFNiti033370; Sun, 28 Aug 2016 15:23:44 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SFNiMD033369; Sun, 28 Aug 2016 15:23:44 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608281523.u7SFNiMD033369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 28 Aug 2016 15:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304958 - head/sys/i386/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.22 Precedence: list List-Id: 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, 28 Aug 2016 15:23:45 -0000 Author: bde Date: Sun Aug 28 15:23:44 2016 New Revision: 304958 URL: https://svnweb.freebsd.org/changeset/base/304958 Log: Fix vm86 initialization, part 1 of 2 and a half. Early use of vm86 depends on the PIC being reset to mask interrupts, but r286667 moved PIC initialization to after where vm86 may be first used. Move the PIC initialization up to immdiately before vm86 initialization. All invocations of diff that I tried display this move poorly so that it looks like PIC and vm86 initialization was moved later. r286667 was to move console initialization later. The diffs are again unreadable -- they show a large move that doesn't seem to involve the console. The PIC initialization stayed just below the console initialization where it could still be debugged but no longer works. Later console initialization breaks mainly debugging vm86 initialization and memory sizing using ddb and printf(). There are several printf()s in the memory sizing that now go nowhere since message buffer initialization has always been too late. Memory sizing is done by loader for most users, but the lost messages for this case are even more interesting than for an auto-probe since they tell you what the loader found. Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sun Aug 28 14:03:25 2016 (r304957) +++ head/sys/i386/i386/machdep.c Sun Aug 28 15:23:44 2016 (r304958) @@ -2646,20 +2646,7 @@ init386(first) PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); ltr(gsel_tss); - vm86_initialize(); - getmemsize(first); - init_param2(physmem); - - /* now running on new page tables, configured,and u/iom is accessible */ - - /* - * Initialize the console before we print anything out. - */ - cninit(); - - if (metadata_missing) - printf("WARNING: loader(8) metadata is missing!\n"); - + /* Initialize the PIC early for vm86 calls. */ #ifdef DEV_ISA #ifdef DEV_ATPIC #ifndef PC98 @@ -2681,6 +2668,20 @@ init386(first) #endif #endif + vm86_initialize(); + getmemsize(first); + init_param2(physmem); + + /* now running on new page tables, configured,and u/iom is accessible */ + + /* + * Initialize the console before we print anything out. + */ + cninit(); + + if (metadata_missing) + printf("WARNING: loader(8) metadata is missing!\n"); + #ifdef DDB db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab); #endif From owner-svn-src-head@freebsd.org Sun Aug 28 16:27: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 DB9B9BC1130; Sun, 28 Aug 2016 16:27:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA84EE3F; Sun, 28 Aug 2016 16:27:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22f.google.com with SMTP id y134so43636052pfg.0; Sun, 28 Aug 2016 09:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=B3L2FWdCbJ20+6DCv8xVeiUjdRAy/TtAT3HrMf8h6TI=; b=wF0a0zLkfrpubZD85nAlM4eS8kzg7dU6Abtxq+RknJgk6jQNoQh+x+MSOvur7C3zhV lIDALrlcymGD11DQZ7PuxlO8QbxBBvxALFXieG2QZ+FfuM4OUrGfY7OYM4tQovkouH1e qAzXykJpY4CUvICBCfTK2mShNuQy50rCisv2lpCi9KtZA0zagEejqR6wEiT+BXCPYPfE gGnj0UwWuzOFfy+RVYrZ+UWy+coWCfDrDtrwuTx/1jBLgFreuMwq2mx1zzfWOcycEVnL jXAAOKWf2beY4jGCFQ3YAZDKouGnFZ7BI31ybAuBhm2zT7PWB5UOP4/Ai2++iXGcrfRq 6QOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=B3L2FWdCbJ20+6DCv8xVeiUjdRAy/TtAT3HrMf8h6TI=; b=UvN1S0gWwEqsMD2oCJN/4GHPPlyp4EIzCvwzCWHH5Tffu00eSgPZKbckS79sCC91GI qHYqdU8ohTsRm++XSJu3+mRZyxwR5MKUE1EWjOtWvAz5pvIICu8UoT2IUg/bxH4/ADEz Lz0c232FLzZm1b/0WWvYBS8ugnpCpNpzrdoCIPtn+HXGv/1vKTXxhc5CJf0YnKC8WD5n C76IQSDzM6WrXBpq5Bqf/40RwA8KebL1q5GeMHOHTYERYgT3EeVPb1YG1y9YHwqt2AX8 NCTcx9MfexjgTmeg9RPnsG1fd3/i09/foK89soS9OQV65muHIMBgJvIlhjB8s4a9SlVa UdXA== X-Gm-Message-State: AE9vXwPTyokTZA6FdFrq8qFuEHJ50FTBP+pTMtiS+b2j7np/Jsl0UEaAlQ35rCzF9oNhIA== X-Received: by 10.98.17.152 with SMTP id 24mr24654507pfr.13.1472401679116; Sun, 28 Aug 2016 09:27:59 -0700 (PDT) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b134sm42790624pfb.55.2016.08.28.09.27.58 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Aug 2016 09:27:58 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304953 - head/sys/contrib/ipfilter/netinet From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201608281151.u7SBpkd3051784@repo.freebsd.org> Date: Sun, 28 Aug 2016 09:27:57 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <847ADF06-379A-4CCB-9AF0-C40C6E9F7A95@gmail.com> References: <201608281151.u7SBpkd3051784@repo.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3124) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 16:28:00 -0000 > On Aug 28, 2016, at 4:51 AM, Dimitry Andric wrote: >=20 > Author: dim > Date: Sun Aug 28 11:51:46 2016 > New Revision: 304953 > URL: https://svnweb.freebsd.org/changeset/base/304953 >=20 > Log: > Define ipfilter's SOLARIS macro in a defined and portable way. >=20 > Reviewed by: cy > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D7671 This broke the build with DTrace/ZFS=E2=80=94 could you please fix it or = back it out? = https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3802/console = Thanks, -Ngie= From owner-svn-src-head@freebsd.org Sun Aug 28 17:20: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 637F5B78206; Sun, 28 Aug 2016 17:20:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::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 28247D70; Sun, 28 Aug 2016 17:20:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id g62so67411427ith.1; Sun, 28 Aug 2016 10:20:11 -0700 (PDT) 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; bh=n6vxE3EGmWl2AHMdOJ7KqDYbIo4l/jFhpN/tw2zYljo=; b=gqPocXAP8Foo8wbL5KYakOuhow7G8RVpTfAeNJcPKXImCzicdEiTTCUny8pCYO3VO4 bAsQPkNOrW/FePg5viZEq3SRHRdGnJ6QgRtTavYQzQJTSdf1GpmpC5xmix+GBnSlzXQI EK+c9wkAW3iNWuyLS61UyoHfh3PlGzwzNGkXSeEGs/MJGfDNZVu+Wth1c7ztxvXuDULt qxX4L70DCom6OiEo7TlHaBX16ypcC8RiBhS4vzwH7TZET0lVhRPQ/agHFc08+M00EimQ S4S7O18zDeIFCt5RmtE1G3kZFBj8oBywJ6/ydLE6bZccYcl6q4WApzDnusgM+ecPksvO l7MQ== 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; bh=n6vxE3EGmWl2AHMdOJ7KqDYbIo4l/jFhpN/tw2zYljo=; b=kkWWI0bkavUv3FFoyVlJHz7Ar3Y+wboIcnXBFStS+QcHOp+t9WrtW2AgQI1X9pb/VN 61OzlySupg5Dy0kJo50qr6RJYlVjqjfi2gjdAhL3BG43ILvrnykfJpnXnLxK898cHLND SbjvVbjh1ImkQOz8RFdG0deNBfaJG7h6wY3sko71WEn5iStpMvu/NhWTF+ZCKsL/uRp1 5+CyXwG9wJ0v2yPtaiDDZoJNX5ZlEPm1c3sryjTkBL3keQlhaE04LalM51SnZCjdJfBZ J7PrGwaujMoikLYO1eduX7str1EF+33R0qDiD28jVkJ+KhBcuxxd8D39hRK/PRsVgbYA nU9A== X-Gm-Message-State: AE9vXwPJDXHlqDMzO/4A7iBwZKQ+0BLLxSq/zyDSAG0nB1ocwhL4MVdIPtTauyEARtB4l+sbi0YHczILyBmD4g== X-Received: by 10.36.73.195 with SMTP id e64mr8962239itd.80.1472404810395; Sun, 28 Aug 2016 10:20:10 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Sun, 28 Aug 2016 10:20:08 -0700 (PDT) In-Reply-To: <20160828133012.GN88122@zxy.spb.ru> References: <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> <20160827004617.GJ88122@zxy.spb.ru> <20160828133012.GN88122@zxy.spb.ru> From: Adrian Chadd Date: Sun, 28 Aug 2016 10:20:08 -0700 X-Google-Sender-Auth: N5abUsHrJ-vhww41PPUoPmq2S5g Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 17:20:11 -0000 Hi, There are some no brainers here so far(tm): working from the bottom up: * yeah, the ixgbe locking is a bit silly. Kip's work with iflib and converting ixgbe to use that instead of its own locking for managing things should remove the bottom two locks * the rtalloc1_fib thing - that's odd, because it shouldn't be contending there unless there's some temporary redirect that's been learnt. What's the routing table look like on your machine? I Remember investigating the rtentry reference counting a while ago and concluded that .. it's terrible, and one specific corner case was checking for routes from redirects. I'll look at my notes again and see what I find. kernel`vm_object_madvise+0x39e kernel`vm_map_madvise+0x3bb kernel`sys_madvise+0x82 kernel`amd64_syscall+0x40f kernel`0xffffffff806c8bbb 97389657 .. something's doing frequent madvise calls, which may be causing some hilarity between threads. What's the server? nginx? Then the rest of the big entries are just a combination of rtentry locking, tcp timer locking, zfs locking and madvise locking. There's some sowakeup locking there as well, from the socket producer/consumer locking. -adrian From owner-svn-src-head@freebsd.org Sun Aug 28 17:20: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 AC0CBB7824E; Sun, 28 Aug 2016 17:20:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::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 7145DEC4; Sun, 28 Aug 2016 17:20:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22e.google.com with SMTP id e63so71268326ith.1; Sun, 28 Aug 2016 10:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=U0mG4G169clsLtQI7GCpWOZy8nbtd6XrAfW+Hv/b+zM=; b=wnSVSVf/zQcZEwDX3XDDjUdKWJLP/E+ZCWn+j0T5FCPW5vyQhOMZFAughG2tWgSiy0 uuxVCowTOor27nYG5Cai2KMJTqcDmmJ3tNDb50slDZhUtbX4xy6mWwe1Fs9m6jjutfoN 4PW0FAN+37P7nWxdxvAfkn3xI3Ld6pRkZitjU6w5eQld+3TbIkn7BF7RmsS8kOZ691Fy XNk44QRbx/J7fJEUMyr4qpq/LHnWR/EQrsNSQhMH7iPvLLcTwUwc/e1r5lnzaGby3YRG eaFufa94JHoVGMjkQBKdQzEq0HFIgG9QKBUAFnRB2j5rmMQR/df2viWvSVI3czwv9rTM 3N/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:from:date :message-id:subject:to:cc; bh=U0mG4G169clsLtQI7GCpWOZy8nbtd6XrAfW+Hv/b+zM=; b=k6/tZFkS3swH3k+JXuUTScXgDM05vf+bHaIAvNMJhqVd2rCwScbxOcl121P4QHmI1J ry7qIqrRh0hz+jXDgW/kViaGcsMy+GSIvGj/Be/Y7maOCUw3W31ULmIiqN2ewo8sRwYR kH98kzgL6Ei27FNkXBT/Se1x0/7d8o4JDwFNxfh8C4qUg+588KtzRFoWGUlSGNds7TIn 7aYCL1J9WQEx1xUujXNsIr/G+1dgilHmaBMG6Y8ZTtY2Wt06Gsbas7om5nwfXdAHTr9k wcN0OLkaCepko40hnJEWbR32b2uuR+YUPB8GoVu0Lim/tJZgQTb1pAU2tMPEISg2T7FI lk1A== X-Gm-Message-State: AE9vXwNf1Vf+RH/rgWKlha4aagbPOP5EZpQlMUFm/ZpRSPnK7E91MwVmLkiaewEZ378LL9E/8utewXNoW1KThw== X-Received: by 10.36.212.6 with SMTP id x6mr9037672itg.71.1472404831303; Sun, 28 Aug 2016 10:20:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Sun, 28 Aug 2016 10:20:30 -0700 (PDT) In-Reply-To: References: <201608271522.u7RFMtBY006582@repo.freebsd.org> From: Adrian Chadd Date: Sun, 28 Aug 2016 10:20:30 -0700 Message-ID: Subject: Re: svn commit: r304912 - head/sys/sys To: Mariusz Zaborski 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.22 Precedence: list List-Id: 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, 28 Aug 2016 17:20:32 -0000 Thanks! -a On 28 August 2016 at 00:40, Mariusz Zaborski wrote: > Eh, sorry. > Fixed in the @304952. > > On 28 August 2016 at 06:17, Adrian Chadd wrote: >> ... >> >> ===> lib/libnv (obj,all,install) >> In file included from >> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/contrib/libnv/cnvlist.c:49:0: >> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:107:6: >> error: redundant redeclaration of 'cnvlist_free_descriptor' >> [-Werror=redundant-decls] >> void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); >> ^ >> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:101:6: >> note: previous declaration of 'cnvlist_free_descriptor' was here >> void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); >> ^ >> cc1: all warnings being treated as errors >> --- cnvlist.o --- >> *** [cnvlist.o] Error code 1 >> >> make[4]: stopped in /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv >> 1 error >> >> >> >> -a >> >> >> On 27 August 2016 at 08:22, Mariusz Zaborski wrote: >>> Author: oshogbo >>> Date: Sat Aug 27 15:22:55 2016 >>> New Revision: 304912 >>> URL: https://svnweb.freebsd.org/changeset/base/304912 >>> >>> Log: >>> Add missed header file for cnv.h . >>> >>> Submitted by: Adam Starak >>> Reported by: ache@ >>> >>> Added: >>> head/sys/sys/cnv.h (contents, props changed) >>> >>> Added: head/sys/sys/cnv.h >>> ============================================================================== >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/sys/sys/cnv.h Sat Aug 27 15:22:55 2016 (r304912) >>> @@ -0,0 +1,113 @@ >>> +/*- >>> + * Copyright (c) 2016 Adam Starak >>> + * 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 _CNV_H_ >>> +#define _CNV_H_ >>> + >>> +#include >>> + >>> +#ifndef _KERNEL >>> +#include >>> +#include >>> +#include >>> +#include >>> +#endif >>> + >>> +#ifndef _NVLIST_T_DECLARED >>> +#define _NVLIST_T_DECLARED >>> +struct nvlist; >>> + >>> +typedef struct nvlist nvlist_t; >>> +#endif >>> + >>> +__BEGIN_DECLS >>> + >>> +/* >>> + * The cnvlist_get functions returns value associated with the given cookie. >>> + * If it returns a pointer, the pointer represents internal buffer and should >>> + * not be freed by the caller. >>> + */ >>> + >>> +bool cnvlist_get_bool(void *cookiep); >>> +uint64_t cnvlist_get_number(void *cookiep); >>> +const char *cnvlist_get_string(void *cookiep); >>> +const nvlist_t *cnvlist_get_nvlist(void *cookiep); >>> +const void *cnvlist_get_binary(void *cookiep, size_t *sizep); >>> +const bool *cnvlist_get_bool_array(void *cookiep, size_t *nitemsp); >>> +const uint64_t *cnvlist_get_number_array(void *cookiep, size_t *nitemsp); >>> +const char * const *cnvlist_get_string_array(void *cookiep, size_t *nitemsp); >>> +const nvlist_t * const *cnvlist_get_nvlist_array(void *cookiep, size_t *nitemsp); >>> +#ifndef _KERNEL >>> +int cnvlist_get_descriptor(void *cookiep); >>> +const int *cnvlist_get_descriptor_array(void *cookiep, size_t *nitemsp); >>> +#endif >>> + >>> + >>> +/* >>> + * The cnvlist_take functions returns value associated with the given cookie and >>> + * remove the given entry from the nvlist. >>> + * The caller is responsible for freeing received data. >>> + */ >>> + >>> +bool cnvlist_take_bool(nvlist_t *nvl, void *cookiep); >>> +uint64_t cnvlist_take_number(nvlist_t *nvl, void *cookiep); >>> +char *cnvlist_take_string(nvlist_t *nvl, void *cookiep); >>> +nvlist_t *cnvlist_take_nvlist(nvlist_t *nvl, void *cookiep); >>> +void *cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep); >>> +bool *cnvlist_take_bool_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >>> +uint64_t *cnvlist_take_number_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >>> +char **cnvlist_take_string_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >>> +nvlist_t **cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >>> +#ifndef _KERNEL >>> +int cnvlist_take_descriptor(nvlist_t *nvl, void *cookiep); >>> +int *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); >>> +#endif >>> + >>> +/* >>> + * The cnvlist_free functions removes the given name/value pair from the nvlist based on cookie >>> + * and frees memory associated with it. >>> + */ >>> + >>> +void cnvlist_free_bool(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_number(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_string(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_nvlist(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_binary(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_bool_array(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_number_array(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_string_array(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookiep); >>> +#ifndef _KERNEL >>> +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); >>> +void cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookiep); >>> +#endif >>> + >>> +__END_DECLS >>> + >>> +#endif /* !_CNV_H_ */ >>> From owner-svn-src-head@freebsd.org Sun Aug 28 17:46:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C65B7888F; Sun, 28 Aug 2016 17:46:49 +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 A69DA2AAC; Sun, 28 Aug 2016 17:46:49 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1be4AP-000Mpa-7I; Sun, 28 Aug 2016 20:46:45 +0300 Date: Sun, 28 Aug 2016 20:46:45 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160828174645.GO88122@zxy.spb.ru> References: <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> <20160827004617.GJ88122@zxy.spb.ru> <20160828133012.GN88122@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.22 Precedence: list List-Id: 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, 28 Aug 2016 17:46:50 -0000 On Sun, Aug 28, 2016 at 10:20:08AM -0700, Adrian Chadd wrote: Hi, thanks for answer! > Hi, > > There are some no brainers here so far(tm): > > working from the bottom up: > > * yeah, the ixgbe locking is a bit silly. Kip's work with iflib and > converting ixgbe to use that instead of its own locking for managing > things should remove the bottom two locks I think no MFC to stbale/10 planed? > * the rtalloc1_fib thing - that's odd, because it shouldn't be > contending there unless there's some temporary redirect that's been > learnt. What's the routing table look like on your machine? I Remember # netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire default 37.220.36.1 UGS lagg0 37.220.36.0/24 link#6 U lagg0 37.220.36.11 link#6 UHS lo0 127.0.0.1 link#5 UH lo0 Internet6: Destination Gateway Flags Netif Expire ::/96 ::1 UGRS lo0 ::1 link#5 UH lo0 ::ffff:0.0.0.0/96 ::1 UGRS lo0 fe80::/10 ::1 UGRS lo0 fe80::%lo0/64 link#5 U lo0 fe80::1%lo0 link#5 UHS lo0 ff01::%lo0/32 ::1 U lo0 ff02::/16 ::1 UGRS lo0 ff02::%lo0/32 ::1 U lo0 > investigating the rtentry reference counting a while ago and concluded > that .. it's terrible, and one specific corner case was checking for > routes from redirects. I'll look at my notes again and see what I > find. > > kernel`vm_object_madvise+0x39e > kernel`vm_map_madvise+0x3bb > kernel`sys_madvise+0x82 > kernel`amd64_syscall+0x40f > kernel`0xffffffff806c8bbb > 97389657 > > .. something's doing frequent madvise calls, which may be causing some In any case, this is create load on different CPU cores. > hilarity between threads. What's the server? nginx? yes > Then the rest of the big entries are just a combination of rtentry > locking, tcp timer locking, zfs locking and madvise locking. There's > some sowakeup locking there as well, from the socket producer/consumer > locking. > > > > > -adrian From owner-svn-src-head@freebsd.org Sun Aug 28 17:54: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 C278EB78E22; Sun, 28 Aug 2016 17:54:39 +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 824A0C8; Sun, 28 Aug 2016 17:54:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1be4I1-000N1C-LC; Sun, 28 Aug 2016 20:54:37 +0300 Date: Sun, 28 Aug 2016 20:54:37 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160828175437.GP88122@zxy.spb.ru> References: <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> <20160827004617.GJ88122@zxy.spb.ru> <20160828133012.GN88122@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.22 Precedence: list List-Id: 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, 28 Aug 2016 17:54:39 -0000 On Sun, Aug 28, 2016 at 10:20:08AM -0700, Adrian Chadd wrote: > * the rtalloc1_fib thing - that's odd, because it shouldn't be > contending there unless there's some temporary redirect that's been > learnt. What's the routing table look like on your machine? I Remember > investigating the rtentry reference counting a while ago and concluded > that .. it's terrible, and one specific corner case was checking for > routes from redirects. I'll look at my notes again and see what I > find. JFYI: kernel`rtalloc1_fib+0x6d kernel`rtalloc_ign_fib+0xcc kernel`ip_output+0x3a5 kernel`tcp_output+0x1852 kernel`tcp_timer_rexmt+0x60e kernel`softclock_call_cc+0x17b kernel`softclock+0x94 kernel`intr_event_execute_handlers+0xab kernel`ithread_loop+0x96 kernel`fork_exit+0x9a kernel`0xffffffff806c8e0e 176868370 kernel`ip_output+0x3a5 is sys/netinet/ip_output.c:282 /* * We want to do any cloning requested by the link layer, * as this is probably required in all cases for correct * operation (as it is for ARP). */ if (rte == NULL) { #ifdef RADIX_MPATH rtalloc_mpath_fib(ro, ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); #else in_rtalloc_ign(ro, 0, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); #endif rte = ro->ro_rt; } From owner-svn-src-head@freebsd.org Sun Aug 28 18: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 82931BC12F6; Sun, 28 Aug 2016 18:10:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53613A82; Sun, 28 Aug 2016 18:10:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SIATTu094436; Sun, 28 Aug 2016 18:10:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SIATqL094435; Sun, 28 Aug 2016 18:10:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608281810.u7SIATqL094435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 28 Aug 2016 18:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304959 - head/sys/contrib/ipfilter/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.22 Precedence: list List-Id: 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, 28 Aug 2016 18:10:30 -0000 Author: kib Date: Sun Aug 28 18:10:29 2016 New Revision: 304959 URL: https://svnweb.freebsd.org/changeset/base/304959 Log: Complete r304953. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_log.c Modified: head/sys/contrib/ipfilter/netinet/ip_log.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_log.c Sun Aug 28 15:23:44 2016 (r304958) +++ head/sys/contrib/ipfilter/netinet/ip_log.c Sun Aug 28 18:10:29 2016 (r304959) @@ -19,7 +19,11 @@ # include #endif #ifndef SOLARIS -# define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +#if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +#else +# define SOLARIS 0 +#endif #endif #include #include From owner-svn-src-head@freebsd.org Sun Aug 28 18:34: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 55759BC1B8C; Sun, 28 Aug 2016 18:34:41 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 4349AB26; Sun, 28 Aug 2016 18:34:40 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 16A1517A47; Sun, 28 Aug 2016 11:34:40 -0700 (PDT) Date: Sun, 28 Aug 2016 11:34:39 -0700 From: hiren panchasara To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304895 - head/usr.bin/netstat Message-ID: <20160828183439.GU41576@strugglingcoder.info> References: <201608271106.u7RB669G009115@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QVzQgM+zdZ3YWXqn" Content-Disposition: inline In-Reply-To: <201608271106.u7RB669G009115@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 18:34:41 -0000 --QVzQgM+zdZ3YWXqn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/27/16 at 11:06P, Bruce Evans wrote: > Author: bde > Date: Sat Aug 27 11:06:06 2016 > New Revision: 304895 > URL: https://svnweb.freebsd.org/changeset/base/304895 >=20 > Log: > Fix build without INET6 and with gcc. A function definition was ifdefed > for INET6, but its protototype was not, and gcc detects the error. >=20 > Modified: > head/usr.bin/netstat/route.c Thanks for the fix. Wouldn't stable/11 be broken in the same way? Cheers, Hiren --QVzQgM+zdZ3YWXqn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXwy69XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lCXgH/12er7+JDx8bfxE+KO+X/X7v if8Z65x8kJj7F8UKjs02yukyaPYV6L3K7FuFEsTj2g0Bsr2RvmM9/qy7rUeNuH4j uPPNTL6ThCaSgX7oXm/VUA+0XrMKa6aBaCiJJGO/VRJpUus09usYc5hkD8VZ2eJn 2tqUiQ34VIIPzJ09esLsHZWY5kzioIP3u8Y+YI+RjBfmC5qEAX7JTL2DDy2REqzh YWqev7v3LYOFQKAS4APuOyVU+sc5AUTOK0vgkNHqz78iIQ5rQss2KveeuRKtAym7 xqIX8Twhzj0pTXIF0mfTf2/fueJE7ceV5T+b1lywxo8VbZtCv3zgW52d8mJyXEk= =MC0n -----END PGP SIGNATURE----- --QVzQgM+zdZ3YWXqn-- From owner-svn-src-head@freebsd.org Sun Aug 28 19:15: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 D7727BC569A; Sun, 28 Aug 2016 19:15:07 +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 90A5BE75; Sun, 28 Aug 2016 19:15:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7C8E71A24B2; Mon, 29 Aug 2016 05:14:58 +1000 (AEST) Date: Mon, 29 Aug 2016 05:14:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: hiren panchasara cc: Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r304895 - head/usr.bin/netstat In-Reply-To: <20160828183439.GU41576@strugglingcoder.info> Message-ID: <20160829050500.D3932@besplex.bde.org> References: <201608271106.u7RB669G009115@repo.freebsd.org> <20160828183439.GU41576@strugglingcoder.info> 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=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=kvNVZOOgqklhGUss4tcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 19:15:08 -0000 On Sun, 28 Aug 2016, hiren panchasara wrote: > On 08/27/16 at 11:06P, Bruce Evans wrote: >> >> Log: >> Fix build without INET6 and with gcc. A function definition was ifdefed >> for INET6, but its protototype was not, and gcc detects the error. >> >> Modified: >> head/usr.bin/netstat/route.c > > Thanks for the fix. > > Wouldn't stable/11 be broken in the same way? Probably. This only affects gcc users who omit INET6, and much more is broken for stable/11 for gcc. Bruce From owner-svn-src-head@freebsd.org Sun Aug 28 19:33: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 9C7DFBC5B04; Sun, 28 Aug 2016 19:33:10 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 75110B18; Sun, 28 Aug 2016 19:33:10 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SJX9tv027575; Sun, 28 Aug 2016 19:33:09 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SJX9b4027574; Sun, 28 Aug 2016 19:33:09 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608281933.u7SJX9b4027574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 28 Aug 2016 19:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304962 - head/sys/ddb 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.22 Precedence: list List-Id: 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, 28 Aug 2016 19:33:10 -0000 Author: bde Date: Sun Aug 28 19:33:09 2016 New Revision: 304962 URL: https://svnweb.freebsd.org/changeset/base/304962 Log: Expand error messages: print symbol names, parentheses and shift tokens, and negative shift counts. Fix error messages: print "Division" instead of "Divide"; print multiplier-like, addition-like and logical operator tokens instead of garbage (usually the command name). ddb has a primitive lexer with excessive information hiding that makes it hard to find even the point in the line where a syntax error is detected. Old ddb just printed "Syntax error" and this was unimproved in most places by printing a garbage token. Modified: head/sys/ddb/db_expr.c Modified: head/sys/ddb/db_expr.c ============================================================================== --- head/sys/ddb/db_expr.c Sun Aug 28 19:32:14 2016 (r304961) +++ head/sys/ddb/db_expr.c Sun Aug 28 19:33:09 2016 (r304962) @@ -57,7 +57,8 @@ db_term(db_expr_t *valuep) if (!db_value_of_name(db_tok_string, valuep) && !db_value_of_name_pcpu(db_tok_string, valuep) && !db_value_of_name_vnet(db_tok_string, valuep)) { - db_error("Symbol not found\n"); + db_printf("Symbol '%s' not found\n", db_tok_string); + db_error(NULL); /*NOTREACHED*/ } return (true); @@ -89,12 +90,14 @@ db_term(db_expr_t *valuep) } if (t == tLPAREN) { if (!db_expression(valuep)) { - db_error("Syntax error\n"); + db_printf("Expression syntax error after '%c'\n", '('); + db_error(NULL); /*NOTREACHED*/ } t = db_read_token(); if (t != tRPAREN) { - db_error("Syntax error\n"); + db_printf("Expression syntax error -- expected '%c'\n", ')'); + db_error(NULL); /*NOTREACHED*/ } return (true); @@ -164,7 +167,9 @@ db_mult_expr(db_expr_t *valuep) while (t == tSTAR || t == tSLASH || t == tPCT || t == tHASH || t == tBIT_AND ) { if (!db_term(&rhs)) { - db_printf("Expression syntax error after '%c'\n", '!'); + db_printf("Expression syntax error after '%c'\n", + t == tSTAR ? '*' : t == tSLASH ? '/' : t == tPCT ? '%' : + t == tHASH ? '#' : '&'); db_error(NULL); /*NOTREACHED*/ } @@ -177,7 +182,7 @@ db_mult_expr(db_expr_t *valuep) break; default: if (rhs == 0) { - db_error("Divide by 0\n"); + db_error("Division by 0\n"); /*NOTREACHED*/ } if (t == tSLASH) @@ -199,7 +204,6 @@ db_add_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; int t; - char c; if (!db_mult_expr(&lhs)) return (false); @@ -207,8 +211,8 @@ db_add_expr(db_expr_t *valuep) t = db_read_token(); while (t == tPLUS || t == tMINUS || t == tBIT_OR) { if (!db_mult_expr(&rhs)) { - c = db_tok_string[0]; - db_printf("Expression syntax error after '%c'\n", c); + db_printf("Expression syntax error after '%c'\n", + t == tPLUS ? '+' : t == tMINUS ? '-' : '|'); db_error(NULL); /*NOTREACHED*/ } @@ -243,11 +247,14 @@ db_shift_expr(db_expr_t *valuep) t = db_read_token(); while (t == tSHIFT_L || t == tSHIFT_R) { if (!db_add_expr(&rhs)) { - db_error("Syntax error\n"); + db_printf("Expression syntax error after '%s'\n", + t == tSHIFT_L ? "<<" : ">>"); + db_error(NULL); /*NOTREACHED*/ } if (rhs < 0) { - db_error("Negative shift amount\n"); + db_printf("Negative shift amount %jd\n", (intmax_t)rhs); + db_error(NULL); /*NOTREACHED*/ } if (t == tSHIFT_L) @@ -269,7 +276,6 @@ db_logical_relation_expr( { db_expr_t lhs, rhs; int t; - char op[3]; if (!db_shift_expr(&lhs)) return (false); @@ -277,11 +283,11 @@ db_logical_relation_expr( t = db_read_token(); while (t == tLOG_EQ || t == tLOG_NOT_EQ || t == tGREATER || t == tGREATER_EQ || t == tLESS || t == tLESS_EQ) { - op[0] = db_tok_string[0]; - op[1] = db_tok_string[1]; - op[2] = 0; if (!db_shift_expr(&rhs)) { - db_printf("Expression syntax error after \"%s\"\n", op); + db_printf("Expression syntax error after '%s'\n", + t == tLOG_EQ ? "==" : t == tLOG_NOT_EQ ? "!=" : + t == tGREATER ? ">" : t == tGREATER_EQ ? ">=" : + t == tLESS ? "<" : "<="); db_error(NULL); /*NOTREACHED*/ } From owner-svn-src-head@freebsd.org Sun Aug 28 19:34: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 A9B8ABC5BA5; Sun, 28 Aug 2016 19:34:23 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6937DC98; Sun, 28 Aug 2016 19:34:23 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SJYMPe027659; Sun, 28 Aug 2016 19:34:22 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SJYM7P027654; Sun, 28 Aug 2016 19:34:22 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608281934.u7SJYM7P027654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sun, 28 Aug 2016 19:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304963 - in head/sys/dev/bhnd: . bcma siba 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.22 Precedence: list List-Id: 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, 28 Aug 2016 19:34:23 -0000 Author: landonf Date: Sun Aug 28 19:34:22 2016 New Revision: 304963 URL: https://svnweb.freebsd.org/changeset/base/304963 Log: bhnd(4): Add a bhnd bus method for fetching the device's core table. This will allow us to perform bhndb(4) bridge configuration based on the identified hardware, prior to performing full enumeration of the child bhnd bus. Approved by: adrian (mentor, implicit) Modified: head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/siba/siba.c Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Sun Aug 28 19:33:09 2016 (r304962) +++ head/sys/dev/bhnd/bcma/bcma.c Sun Aug 28 19:34:22 2016 (r304963) @@ -492,6 +492,42 @@ bcma_free_bhnd_dinfo(device_t dev, struc bcma_free_dinfo(dev, (struct bcma_devinfo *)dinfo); } + +static int +bcma_get_core_table(device_t dev, device_t child, struct bhnd_core_info **cores, + u_int *num_cores) +{ + struct bcma_softc *sc; + struct bcma_erom erom; + const struct bhnd_chipid *cid; + struct resource *r; + int error; + int rid; + + sc = device_get_softc(dev); + + /* Map the EROM table. */ + cid = BHND_BUS_GET_CHIPID(dev, dev); + rid = 0; + r = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, cid->enum_addr, + cid->enum_addr + BCMA_EROM_TABLE_SIZE, BCMA_EROM_TABLE_SIZE, + RF_ACTIVE); + if (r == NULL) { + device_printf(dev, "failed to allocate EROM resource\n"); + return (ENXIO); + } + + /* Enumerate all declared cores */ + if ((error = bcma_erom_open(&erom, r, BCMA_EROM_TABLE_START))) + goto cleanup; + + error = bcma_erom_get_core_info(&erom, cores, num_cores); + +cleanup: + bus_release_resource(dev, SYS_RES_MEMORY, rid, r); + return (error); +} + /** * Scan a device enumeration ROM table, adding all valid discovered cores to * the bus. @@ -577,6 +613,7 @@ static device_method_t bcma_methods[] = DEVMETHOD(bhnd_bus_find_hostb_device, bcma_find_hostb_device), DEVMETHOD(bhnd_bus_alloc_devinfo, bcma_alloc_bhnd_dinfo), DEVMETHOD(bhnd_bus_free_devinfo, bcma_free_bhnd_dinfo), + DEVMETHOD(bhnd_bus_get_core_table, bcma_get_core_table), DEVMETHOD(bhnd_bus_reset_core, bcma_reset_core), DEVMETHOD(bhnd_bus_suspend_core, bcma_suspend_core), DEVMETHOD(bhnd_bus_read_config, bcma_read_config), Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sun Aug 28 19:33:09 2016 (r304962) +++ head/sys/dev/bhnd/bhnd.h Sun Aug 28 19:34:22 2016 (r304963) @@ -425,6 +425,32 @@ bhnd_get_chipid(device_t dev) { }; /** + * Get a list of all cores discoverable on the bhnd bus. + * + * Enumerates all cores discoverable on @p dev, returning the list in + * @p cores and the count in @p num_cores. + * + * The memory allocated for the list should be freed using + * `free(*cores, M_BHND)`. @p cores and @p num_cores are not changed + * when an error is returned. + * + * @param dev A bhnd bus child device. + * @param[out] cores The table of core descriptors. + * @param[out] num_cores The number of core descriptors in @p cores. + * + * @retval 0 success + * @retval non-zero if an error occurs enumerating @p dev, a regular UNIX + * error code should be returned. + */ +static inline int +bhnd_get_core_table(device_t dev, struct bhnd_core_info **cores, + u_int *num_cores) +{ + return (BHND_BUS_GET_CORE_TABLE(device_get_parent(dev), dev, cores, + num_cores)); +} + +/** * If supported by the chipset, return the clock source for the given clock. * * This function is only supported on early PWRCTL-equipped chipsets Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Sun Aug 28 19:33:09 2016 (r304962) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sun Aug 28 19:34:22 2016 (r304963) @@ -56,6 +56,13 @@ CODE { panic("bhnd_bus_get_chipid unimplemented"); } + static int + bhnd_bus_null_get_core_table(device_t dev, device_t child, + struct bhnd_core_info **cores, u_int *num_cores) + { + panic("bhnd_bus_get_core_table unimplemented"); + } + static bhnd_attach_type bhnd_bus_null_get_attach_type(device_t dev, device_t child) { @@ -271,6 +278,32 @@ METHOD const struct bhnd_chipid * get_ch } DEFAULT bhnd_bus_null_get_chipid; /** + * Get a list of all cores discoverable on @p dev. + * + * Enumerates all cores discoverable on @p dev, returning the list in + * @p cores and the count in @p num_cores. + * + * The memory allocated for the list should be freed using + * `free(*cores, M_BHND)`. @p cores and @p num_cores are not changed + * when an error is returned. + * + * @param dev The bhnd bus device. + * @param child The requesting bhnd bus child. + * @param[out] cores The table of core descriptors. + * @param[out] num_cores The number of core descriptors in @p cores. + * + * @retval 0 success + * @retval non-zero if an error occurs enumerating @p dev, a regular UNIX + * error code should be returned. + */ +METHOD int get_core_table { + device_t dev; + device_t child; + struct bhnd_core_info **cores; + u_int *num_cores; +} DEFAULT bhnd_bus_null_get_core_table; + +/** * Return the BHND attachment type of the parent bus. * * @param dev The device whose child is being examined. Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Sun Aug 28 19:33:09 2016 (r304962) +++ head/sys/dev/bhnd/siba/siba.c Sun Aug 28 19:34:22 2016 (r304963) @@ -504,6 +504,76 @@ siba_free_bhnd_dinfo(device_t dev, struc siba_free_dinfo(dev, (struct siba_devinfo *)dinfo); } + +static int +siba_get_core_table(device_t dev, device_t child, struct bhnd_core_info **cores, + u_int *num_cores) +{ + const struct bhnd_chipid *chipid; + struct bhnd_core_info *table; + struct bhnd_resource *r; + int error; + int rid; + + /* Fetch the core count from our chip identification */ + chipid = BHND_BUS_GET_CHIPID(dev, dev); + + /* Allocate our local core table */ + table = malloc(sizeof(*table) * chipid->ncores, M_BHND, M_NOWAIT); + if (table == NULL) + return (ENOMEM); + + /* Enumerate all cores. */ + for (u_int i = 0; i < chipid->ncores; i++) { + struct siba_core_id cid; + uint32_t idhigh, idlow; + + /* Map the core's register block */ + rid = 0; + r = bhnd_alloc_resource(dev, SYS_RES_MEMORY, &rid, + SIBA_CORE_ADDR(i), SIBA_CORE_ADDR(i) + SIBA_CORE_SIZE - 1, + SIBA_CORE_SIZE, RF_ACTIVE); + if (r == NULL) { + error = ENXIO; + goto failed; + } + + /* Read the core info */ + idhigh = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDHIGH)); + idlow = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDLOW)); + + cid = siba_parse_core_id(idhigh, idlow, i, 0); + table[i] = cid.core_info; + + /* Determine unit number */ + for (u_int j = 0; j < i; j++) { + if (table[j].vendor == table[i].vendor && + table[j].device == table[i].device) + table[i].unit++; + } + + /* Release our resource */ + bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r); + r = NULL; + } + + /* Provide the result values (performed last to avoid modifying + * cores/num_cores if enumeration failed). */ + *cores = table; + *num_cores = chipid->ncores; + + return (0); + +failed: + if (table != NULL) + free(table, M_BHND); + + if (r != NULL) + bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r); + + return (error); +} + /** * Scan the core table and add all valid discovered cores to * the bus. @@ -696,6 +766,7 @@ static device_method_t siba_methods[] = /* BHND interface */ DEVMETHOD(bhnd_bus_find_hostb_device, siba_find_hostb_device), + DEVMETHOD(bhnd_bus_get_core_table, siba_get_core_table), DEVMETHOD(bhnd_bus_alloc_devinfo, siba_alloc_bhnd_dinfo), DEVMETHOD(bhnd_bus_free_devinfo, siba_free_bhnd_dinfo), DEVMETHOD(bhnd_bus_reset_core, siba_reset_core), From owner-svn-src-head@freebsd.org Sun Aug 28 19:35: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 4D22FBC5C2B; Sun, 28 Aug 2016 19:35:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 286ABE16; Sun, 28 Aug 2016 19:35:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SJZUxd027812; Sun, 28 Aug 2016 19:35:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SJZTSc027806; Sun, 28 Aug 2016 19:35:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608281935.u7SJZTSc027806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 28 Aug 2016 19:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304964 - in head: contrib/ipfilter sys/contrib/ipfilter/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.22 Precedence: list List-Id: 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, 28 Aug 2016 19:35:31 -0000 Author: dim Date: Sun Aug 28 19:35:29 2016 New Revision: 304964 URL: https://svnweb.freebsd.org/changeset/base/304964 Log: Follow-up to r304953, in which I broke the build: apparently the SOLARIS macro is defined in lots of different places in ipfilter, so replace all of the nonportable definitions with portable ones. Pointy hat to: dim X-MFC-With: r304959, r304953 MFC after: 3 days Modified: head/contrib/ipfilter/opts.h head/sys/contrib/ipfilter/netinet/ip_compat.h head/sys/contrib/ipfilter/netinet/ip_fil.h head/sys/contrib/ipfilter/netinet/ip_log.c head/sys/contrib/ipfilter/netinet/ip_nat.h head/sys/contrib/ipfilter/netinet/ip_proxy.h Modified: head/contrib/ipfilter/opts.h ============================================================================== --- head/contrib/ipfilter/opts.h Sun Aug 28 19:34:22 2016 (r304963) +++ head/contrib/ipfilter/opts.h Sun Aug 28 19:35:29 2016 (r304964) @@ -12,7 +12,11 @@ #define __OPTS_H__ #ifndef SOLARIS -#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #define OPT_REMOVE 0x000001 #define OPT_DEBUG 0x000002 Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Sun Aug 28 19:34:22 2016 (r304963) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Sun Aug 28 19:35:29 2016 (r304964) @@ -32,10 +32,12 @@ # define __KERNEL__ #endif -#if defined(sun) && (defined(__svr4__) || defined(__SVR4)) -# define SOLARIS 1 -#else -# define SOLARIS 0 +#ifndef SOLARIS +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Sun Aug 28 19:34:22 2016 (r304963) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Sun Aug 28 19:35:29 2016 (r304964) @@ -29,7 +29,11 @@ #endif #ifndef SOLARIS -# define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #ifndef __P Modified: head/sys/contrib/ipfilter/netinet/ip_log.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_log.c Sun Aug 28 19:34:22 2016 (r304963) +++ head/sys/contrib/ipfilter/netinet/ip_log.c Sun Aug 28 19:35:29 2016 (r304964) @@ -19,11 +19,11 @@ # include #endif #ifndef SOLARIS -#if defined(sun) && (defined(__svr4__) || defined(__SVR4)) -# define SOLARIS 1 -#else -# define SOLARIS 0 -#endif +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #include #include Modified: head/sys/contrib/ipfilter/netinet/ip_nat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.h Sun Aug 28 19:34:22 2016 (r304963) +++ head/sys/contrib/ipfilter/netinet/ip_nat.h Sun Aug 28 19:35:29 2016 (r304964) @@ -13,8 +13,12 @@ #ifndef __IP_NAT_H__ #define __IP_NAT_H__ -#ifndef SOLARIS -#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +#ifndef SOLARIS +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) Modified: head/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_proxy.h Sun Aug 28 19:34:22 2016 (r304963) +++ head/sys/contrib/ipfilter/netinet/ip_proxy.h Sun Aug 28 19:35:29 2016 (r304964) @@ -12,8 +12,12 @@ #ifndef __IP_PROXY_H__ #define __IP_PROXY_H__ -#ifndef SOLARIS -#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) +#ifndef SOLARIS +# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# define SOLARIS 1 +# else +# define SOLARIS 0 +# endif #endif #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) From owner-svn-src-head@freebsd.org Sun Aug 28 19:36: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 7EEB9BC5CD8; Sun, 28 Aug 2016 19:36:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45AACFBE; Sun, 28 Aug 2016 19:36:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::7524:646f:a4fa:5a6] (unknown [IPv6:2001:7b8:3a7:0:7524:646f:a4fa:5a6]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0FEB5123E; Sun, 28 Aug 2016 21:36:55 +0200 (CEST) Subject: Re: svn commit: r304953 - head/sys/contrib/ipfilter/netinet Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AE60F7F7-BE88-42D3-B0DD-BD5395F82D40"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6.1 From: Dimitry Andric In-Reply-To: <847ADF06-379A-4CCB-9AF0-C40C6E9F7A95@gmail.com> Date: Sun, 28 Aug 2016 21:36:50 +0200 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201608281151.u7SBpkd3051784@repo.freebsd.org> <847ADF06-379A-4CCB-9AF0-C40C6E9F7A95@gmail.com> To: "Ngie Cooper (yaneurabeya)" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 19:36:58 -0000 --Apple-Mail=_AE60F7F7-BE88-42D3-B0DD-BD5395F82D40 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 28 Aug 2016, at 18:27, Ngie Cooper (yaneurabeya) = wrote: >=20 >> On Aug 28, 2016, at 4:51 AM, Dimitry Andric wrote: >>=20 >> Author: dim >> Date: Sun Aug 28 11:51:46 2016 >> New Revision: 304953 >> URL: https://svnweb.freebsd.org/changeset/base/304953 >>=20 >> Log: >> Define ipfilter's SOLARIS macro in a defined and portable way. >>=20 >> Reviewed by: cy >> MFC after: 3 days >> Differential Revision: https://reviews.freebsd.org/D7671 >=20 > This broke the build with DTrace/ZFS=E2=80=94 could you please fix it = or back it out? = https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3802/console Sorry about that, it hould now be fixed by r304959 and r304964. -Dimitry --Apple-Mail=_AE60F7F7-BE88-42D3-B0DD-BD5395F82D40 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlfDPVYACgkQsF6jCi4glqPjdACfahJ6+mIvpMGhQNnZUk4t9/vz GvEAoIWhumoO+KO/65xjl7rHNQI6hryi =56p8 -----END PGP SIGNATURE----- --Apple-Mail=_AE60F7F7-BE88-42D3-B0DD-BD5395F82D40-- From owner-svn-src-head@freebsd.org Sun Aug 28 20:39: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 1905DBC1198; Sun, 28 Aug 2016 20:39:35 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CEF1D116; Sun, 28 Aug 2016 20:39:34 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SKdYVT050780; Sun, 28 Aug 2016 20:39:34 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SKdYmH050779; Sun, 28 Aug 2016 20:39:34 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201608282039.u7SKdYmH050779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Sun, 28 Aug 2016 20:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304966 - head/sys/boot/i386/libi386 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.22 Precedence: list List-Id: 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, 28 Aug 2016 20:39:35 -0000 Author: peter Date: Sun Aug 28 20:39:33 2016 New Revision: 304966 URL: https://svnweb.freebsd.org/changeset/base/304966 Log: The read-ahead code from r298230 made it likely the boot code would read beyond the end of disk. r298900 added code to prevent this. Some BIOSes cause significant delays if asked to read past end-of-disk. We never trusted the BIOS to accurately report the sectorsize of disks before and this set of changes. Unfortuately they interact badly with the infamous >2TB wraparound bugs. We have a number of relatively-recent machines in the FreeBSD.org cluster where the BIOS reports 3TB disks as 1TB. With pre-r298900 they work just fine. After r298900 they stop working if the boot environment attempts to access anything outside the first 1TB on the disk. 'ZFS: I/O error, all block copies unavailable' etc. It affects both UFS and ZFS if they try to boot from large volumes. This change replaces the blind trust of the BIOS end-of-disk reporting with a read-ahead clip to prevent reads crossing the of end-of-disk boundary. Since 2^32 (2TB) size reporting truncation is not uncommon, the clipping is done on 2TB aliases of the reported end-of-disk. ie: a 3TB disk reported as 1TB has readahead clipped at 1TB, 3TB, 5TB, ... as one of them is likely to be the real end-of-disk. This should make the loader on these broken machines behave the same as traditional pre-r298900 loader behavior, without disabling read-ahead. PR: 212139 Discussed with: tsoome, allanjude Modified: head/sys/boot/i386/libi386/biosdisk.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Sun Aug 28 19:48:08 2016 (r304965) +++ head/sys/boot/i386/libi386/biosdisk.c Sun Aug 28 20:39:33 2016 (r304966) @@ -497,7 +497,7 @@ bd_realstrategy(void *devdata, int rw, d char *buf, size_t *rsize) { struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - int blks; + int blks, remaining; #ifdef BD_SUPPORT_FRAGS /* XXX: sector size */ char fragbuf[BIOSDISK_SECSIZE]; size_t fragsize; @@ -513,14 +513,15 @@ bd_realstrategy(void *devdata, int rw, d if (rsize) *rsize = 0; - if (dblk >= BD(dev).bd_sectors) { - DEBUG("IO past disk end %llu", (unsigned long long)dblk); - return (EIO); - } - - if (dblk + blks > BD(dev).bd_sectors) { - /* perform partial read */ - blks = BD(dev).bd_sectors - dblk; + /* + * Perform partial read to prevent read-ahead crossing + * the end of disk - or any 32 bit aliases of the end. + * Signed arithmetic is used to handle wrap-around cases + * like we do for TCP sequence numbers. + */ + remaining = (int)(BD(dev).bd_sectors - dblk); /* truncate */ + if (remaining > 0 && remaining < blks) { + blks = remaining; size = blks * BD(dev).bd_sectorsize; DEBUG("short read %d", blks); } From owner-svn-src-head@freebsd.org Sun Aug 28 20:39: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 0E731BC11DC; Sun, 28 Aug 2016 20:39:55 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C55DB2A5; Sun, 28 Aug 2016 20:39:54 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SKdrsM050850; Sun, 28 Aug 2016 20:39:53 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SKdrO9050847; Sun, 28 Aug 2016 20:39:53 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608282039.u7SKdrO9050847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sun, 28 Aug 2016 20:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304967 - in head/sys/dev/bhnd: . siba 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.22 Precedence: list List-Id: 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, 28 Aug 2016 20:39:55 -0000 Author: landonf Date: Sun Aug 28 20:39:53 2016 New Revision: 304967 URL: https://svnweb.freebsd.org/changeset/base/304967 Log: bhnd(4): Apply the siba chipid ncore fixup in bhnd_read_chipid(), ensuring that bhndb et al are always operating on a valid core count. Approved by: adrian (mentor, implicit) Modified: head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/siba/siba.c Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sun Aug 28 20:39:33 2016 (r304966) +++ head/sys/dev/bhnd/bhnd.h Sun Aug 28 20:39:53 2016 (r304967) @@ -317,6 +317,10 @@ void bhnd_release_resources(device_t struct bhnd_chipid bhnd_parse_chipid(uint32_t idreg, bhnd_addr_t enum_addr); +int bhnd_chipid_fixed_ncores( + const struct bhnd_chipid *cid, + uint16_t chipc_hwrev, uint8_t *ncores); + int bhnd_read_chipid(device_t dev, struct resource_spec *rs, bus_size_t chipc_offset, Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Sun Aug 28 20:39:33 2016 (r304966) +++ head/sys/dev/bhnd/bhnd_subr.c Sun Aug 28 20:39:53 2016 (r304967) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include "nvram/bhnd_nvram.h" @@ -840,6 +842,63 @@ bhnd_parse_chipid(uint32_t idreg, bhnd_a return (result); } + +/** + * Determine the correct core count for a chip identification value that + * may contain an invalid core count. + * + * On some early siba(4) devices (see CHIPC_NCORES_MIN_HWREV()), the ChipCommon + * core does not provide a valid CHIPC_ID_NUMCORE field. + * + * @param cid The chip identification to be queried. + * @param chipc_hwrev The hardware revision of the ChipCommon core from which + * @p cid was parsed. + * @param[out] ncores On success, will be set to the correct core count. + * + * @retval 0 If the core count is already correct, or was mapped to a + * a correct value. + * @retval EINVAL If the core count is incorrect, but the chip was not + * recognized. + */ +int +bhnd_chipid_fixed_ncores(const struct bhnd_chipid *cid, uint16_t chipc_hwrev, + uint8_t *ncores) +{ + /* bcma(4), and most siba(4) devices */ + if (CHIPC_NCORES_MIN_HWREV(chipc_hwrev)) { + *ncores = cid->ncores; + return (0); + } + + /* broken siba(4) chipsets */ + switch (cid->chip_id) { + case BHND_CHIPID_BCM4306: + *ncores = 6; + break; + case BHND_CHIPID_BCM4704: + *ncores = 9; + break; + case BHND_CHIPID_BCM5365: + /* + * BCM5365 does support ID_NUMCORE in at least + * some of its revisions, but for unknown + * reasons, Broadcom's drivers always exclude + * the ChipCommon revision (0x5) used by BCM5365 + * from the set of revisions supporting + * ID_NUMCORE, and instead supply a fixed value. + * + * Presumably, at least some of these devices + * shipped with a broken ID_NUMCORE value. + */ + *ncores = 7; + break; + default: + return (EINVAL); + } + + return (0); +} + /** * Allocate the resource defined by @p rs via @p dev, use it * to read the ChipCommon ID register relative to @p chipc_offset, @@ -894,6 +953,27 @@ bhnd_read_chipid(device_t dev, struct re *result = bhnd_parse_chipid(reg, enum_addr); + /* Fix the core count on early siba(4) devices */ + if (chip_type == BHND_CHIPTYPE_SIBA) { + uint32_t idh; + uint16_t chipc_hwrev; + + /* + * We need the ChipCommon revision to determine whether + * the ncore field is valid. + * + * We can safely assume the siba IDHIGH register is mapped + * within the chipc register block. + */ + idh = bus_read_4(res, SB0_REG_ABS(SIBA_CFG0_IDHIGH)); + chipc_hwrev = SIBA_IDH_CORE_REV(idh); + + error = bhnd_chipid_fixed_ncores(result, chipc_hwrev, + &result->ncores); + if (error) + goto cleanup; + } + cleanup: /* Clean up */ bus_release_resource(dev, rtype, rid, res); Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Sun Aug 28 20:39:33 2016 (r304966) +++ head/sys/dev/bhnd/siba/siba.c Sun Aug 28 20:39:53 2016 (r304967) @@ -635,35 +635,12 @@ siba_add_children(device_t dev, const st ccreg = bus_read_4(r, CHIPC_ID); ccid = bhnd_parse_chipid(ccreg, SIBA_ENUM_ADDR); - if (!CHIPC_NCORES_MIN_HWREV(ccrev)) { - switch (ccid.chip_id) { - case BHND_CHIPID_BCM4306: - ccid.ncores = 6; - break; - case BHND_CHIPID_BCM4704: - ccid.ncores = 9; - break; - case BHND_CHIPID_BCM5365: - /* - * BCM5365 does support ID_NUMCORE in at least - * some of its revisions, but for unknown - * reasons, Broadcom's drivers always exclude - * the ChipCommon revision (0x5) used by BCM5365 - * from the set of revisions supporting - * ID_NUMCORE, and instead supply a fixed value. - * - * Presumably, at least some of these devices - * shipped with a broken ID_NUMCORE value. - */ - ccid.ncores = 7; - break; - default: - device_printf(dev, "unable to determine core " - "count for unrecognized chipset 0x%hx\n", - ccid.chip_id); - error = ENXIO; - goto cleanup; - } + /* Fix up the core count */ + error = bhnd_chipid_fixed_ncores(&ccid, ccrev, &ccid.ncores); + if (error) { + device_printf(dev, "unable to determine core count for " + "chipset 0x%hx\n", ccid.chip_id); + goto cleanup; } chipid = &ccid; From owner-svn-src-head@freebsd.org Sun Aug 28 21:26: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 C98EBB777E6; Sun, 28 Aug 2016 21:26:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ABE2966; Sun, 28 Aug 2016 21:26:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7SLQBdr070082; Sun, 28 Aug 2016 21:26:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SLQB0v070081; Sun, 28 Aug 2016 21:26:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608282126.u7SLQB0v070081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 28 Aug 2016 21:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304969 - head/sbin/hastd 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.22 Precedence: list List-Id: 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, 28 Aug 2016 21:26:12 -0000 Author: dim Date: Sun Aug 28 21:26:11 2016 New Revision: 304969 URL: https://svnweb.freebsd.org/changeset/base/304969 Log: Define hastd's STRICT_ALIGN macro in a defined and portable way. MFC after: 3 days Modified: head/sbin/hastd/lzf.h Modified: head/sbin/hastd/lzf.h ============================================================================== --- head/sbin/hastd/lzf.h Sun Aug 28 20:53:31 2016 (r304968) +++ head/sbin/hastd/lzf.h Sun Aug 28 21:26:11 2016 (r304969) @@ -132,7 +132,11 @@ lzf_decompress (const void *const in_dat * Unconditionally aligning does not cost very much, so do it if unsure */ #ifndef STRICT_ALIGN -# define STRICT_ALIGN !(defined(__i386) || defined (__amd64)) +# if !(defined(__i386) || defined (__amd64)) +# define STRICT_ALIGN 1 +# else +# define STRICT_ALIGN 0 +# endif #endif /* From owner-svn-src-head@freebsd.org Sun Aug 28 21: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 A8A32B77985; Sun, 28 Aug 2016 21:31:22 +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 7FB83B8C; Sun, 28 Aug 2016 21:31:22 +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 u7SLVLmP070983; Sun, 28 Aug 2016 21:31:21 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7SLVLjS070980; Sun, 28 Aug 2016 21:31:21 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608282131.u7SLVLjS070980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 28 Aug 2016 21:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304970 - in head/sys/dev: ofw uart 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.22 Precedence: list List-Id: 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, 28 Aug 2016 21:31:22 -0000 Author: jhibbits Date: Sun Aug 28 21:31:21 2016 New Revision: 304970 URL: https://svnweb.freebsd.org/changeset/base/304970 Log: Check all compatible strings on uart devices in powerpc Summary: Some device trees put "fsl,ns16650" first in the compatible list. This causes the probe code to choke, even though the device is compatible with ns16650, and has it listed later in the tree. Reviewed by: nwhitehorn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7676 Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/uart/uart_cpu_powerpc.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Sun Aug 28 21:26:11 2016 (r304969) +++ head/sys/dev/ofw/ofw_bus_subr.c Sun Aug 28 21:31:21 2016 (r304970) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "ofw_bus_if.h" +#define OFW_COMPAT_LEN 255 + int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *obd, phandle_t node) { @@ -178,7 +180,8 @@ ofw_bus_status_okay(device_t dev) } static int -ofw_bus_node_is_compatible(const char *compat, int len, const char *onecompat) +ofw_bus_node_is_compatible_int(const char *compat, int len, + const char *onecompat) { int onelen, l, ret; @@ -203,6 +206,25 @@ ofw_bus_node_is_compatible(const char *c } int +ofw_bus_node_is_compatible(phandle_t node, const char *compatstr) +{ + char compat[OFW_COMPAT_LEN]; + int len, rv; + + if ((len = OF_getproplen(node, "compatible")) <= 0) + return (0); + + bzero(compat, OFW_COMPAT_LEN); + + if (OF_getprop(node, "compatible", compat, OFW_COMPAT_LEN) < 0) + return (0); + + rv = ofw_bus_node_is_compatible_int(compat, len, compatstr); + + return (rv); +} + +int ofw_bus_is_compatible(device_t dev, const char *onecompat) { phandle_t node; @@ -219,7 +241,7 @@ ofw_bus_is_compatible(device_t dev, cons if ((len = OF_getproplen(node, "compatible")) <= 0) return (0); - return (ofw_bus_node_is_compatible(compat, len, onecompat)); + return (ofw_bus_node_is_compatible_int(compat, len, onecompat)); } int @@ -689,7 +711,7 @@ ofw_bus_find_compatible(phandle_t node, for (child = OF_child(node); child != 0; child = OF_peer(child)) { len = OF_getprop_alloc(child, "compatible", 1, &compat); if (len >= 0) { - ret = ofw_bus_node_is_compatible(compat, len, + ret = ofw_bus_node_is_compatible_int(compat, len, onecompat); free(compat, M_OFWPROP); if (ret != 0) Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Sun Aug 28 21:26:11 2016 (r304969) +++ head/sys/dev/ofw/ofw_bus_subr.h Sun Aug 28 21:31:21 2016 (r304970) @@ -107,6 +107,7 @@ phandle_t ofw_bus_find_iparent(phandle_t /* Helper routine for checking compat prop */ int ofw_bus_is_compatible(device_t, const char *); int ofw_bus_is_compatible_strict(device_t, const char *); +int ofw_bus_node_is_compatible(phandle_t, const char *); /* * Helper routine to search a list of compat properties. The table is Modified: head/sys/dev/uart/uart_cpu_powerpc.c ============================================================================== --- head/sys/dev/uart/uart_cpu_powerpc.c Sun Aug 28 21:26:11 2016 (r304969) +++ head/sys/dev/uart/uart_cpu_powerpc.c Sun Aug 28 21:31:21 2016 (r304970) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -163,14 +164,13 @@ uart_cpu_getdev(int devtype, struct uart return (ENXIO); if (strcmp(buf, "serial") != 0) return (ENXIO); - if (OF_getprop(input, "compatible", buf, sizeof(buf)) == -1) - return (ENXIO); - if (strncmp(buf, "chrp,es", 7) == 0) { + if (ofw_bus_node_is_compatible(input, "chrp,es")) { class = &uart_z8530_class; di->bas.regshft = 4; di->bas.chan = 1; - } else if (strcmp(buf,"ns16550") == 0 || strcmp(buf,"ns8250") == 0) { + } else if (ofw_bus_node_is_compatible(input,"ns16550") || + ofw_bus_node_is_compatible(input,"ns8250")) { class = &uart_ns8250_class; di->bas.regshft = 0; di->bas.chan = 0; From owner-svn-src-head@freebsd.org Sun Aug 28 21:32: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 7490DB779E5; Sun, 28 Aug 2016 21:32:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::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 35A74E65; Sun, 28 Aug 2016 21:32:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22e.google.com with SMTP id x131so75732780ite.0; Sun, 28 Aug 2016 14:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=y7IX4oA+gJlkBZAH9RNvBCmbIMBsWwAVydD1XY4WXLQ=; b=rpVWlWN1SCHfxNiodTLVP4UYrTZdpAMAHE+VGKVOYdmPihRlQ/33S0PZzqZnxCw4qs 0fPmJup/e0GpTlRgwYMEpNUv92WbmlgiDWlimfA/DKqdtLCVoLBsGCqr00mLALtEkWGW +AHUH4vJJ+5OT4kkXMg0REJnkvE6Iw1fQkOdkT29nZSy6lNIEdtMeuop6saiPuiUVObQ 8VmZJdrtGJWTTk1oR1AQbpF8NI84lb7Bzjomg/gqBnkA477a27Hd3U0L/vrGoW+MpqCp Wpl9pAzoK+Vh9jNAWWZsidxHDVDSNUHQrPn5bKhQszRQXsk/J1UGQA3n+2ELQeektsAM 0RgQ== 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; bh=y7IX4oA+gJlkBZAH9RNvBCmbIMBsWwAVydD1XY4WXLQ=; b=NZ9DBACtKfOrU5gUNxxVUdscoeXCOdgElP2aC0pokp2hzyjsHRcXQ5SgZpxzXQr6w2 nW8jNKrxa+DL0rFQ6SPy31bApJGQ5AZxfqhBGWoBTIS73xVM3O1I2p7gjexDW+4u4nV+ g2YConrmu8X7eOXwI91kNW8XuWE3UVPMkxk1CB1kt3vx11tay4Do1KfpHITN9Q3DZjm/ Sd20ZoRAihFysRZbscfJS2oAfcM3z6Dwl9VHb4Wh21aTpKygT3wA0vR+rKSOm8HJgBPb l36uvfnX55IQAh2OX4W3k722bI+6920LHsxripGygtHo+dwAKuPVfg2ErO1druco34db /jhw== X-Gm-Message-State: AE9vXwMIxIQRIqmZ6jF0bxfXg8IV2v7MCEZ8VpwpZ2wQL5u/akyavrz+/E5pZmYNp5ZP8CiPwFNAu0ZE0pciTA== X-Received: by 10.36.239.197 with SMTP id i188mr10190160ith.71.1472419943332; Sun, 28 Aug 2016 14:32:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Sun, 28 Aug 2016 14:32:22 -0700 (PDT) Received: by 10.36.141.129 with HTTP; Sun, 28 Aug 2016 14:32:22 -0700 (PDT) In-Reply-To: <201608281934.u7SJYM7P027654@repo.freebsd.org> References: <201608281934.u7SJYM7P027654@repo.freebsd.org> From: Adrian Chadd Date: Sun, 28 Aug 2016 14:32:22 -0700 Message-ID: Subject: Re: svn commit: r304963 - in head/sys/dev/bhnd: . bcma siba To: Landon Fuller 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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 21:32:24 -0000 Heh. Make a free function too. ;) On Aug 28, 2016 12:34 PM, "Landon J. Fuller" wrote: > Author: landonf > Date: Sun Aug 28 19:34:22 2016 > New Revision: 304963 > URL: https://svnweb.freebsd.org/changeset/base/304963 > > Log: > bhnd(4): Add a bhnd bus method for fetching the device's core table. > > This will allow us to perform bhndb(4) bridge configuration based on > the identified hardware, prior to performing full enumeration of the > child bhnd bus. > > Approved by: adrian (mentor, implicit) > > Modified: > head/sys/dev/bhnd/bcma/bcma.c > head/sys/dev/bhnd/bhnd.h > head/sys/dev/bhnd/bhnd_bus_if.m > head/sys/dev/bhnd/siba/siba.c > > Modified: head/sys/dev/bhnd/bcma/bcma.c > ============================================================ > ================== > --- head/sys/dev/bhnd/bcma/bcma.c Sun Aug 28 19:33:09 2016 > (r304962) > +++ head/sys/dev/bhnd/bcma/bcma.c Sun Aug 28 19:34:22 2016 > (r304963) > @@ -492,6 +492,42 @@ bcma_free_bhnd_dinfo(device_t dev, struc > bcma_free_dinfo(dev, (struct bcma_devinfo *)dinfo); > } > > + > +static int > +bcma_get_core_table(device_t dev, device_t child, struct bhnd_core_info > **cores, > + u_int *num_cores) > +{ > + struct bcma_softc *sc; > + struct bcma_erom erom; > + const struct bhnd_chipid *cid; > + struct resource *r; > + int error; > + int rid; > + > + sc = device_get_softc(dev); > + > + /* Map the EROM table. */ > + cid = BHND_BUS_GET_CHIPID(dev, dev); > + rid = 0; > + r = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, cid->enum_addr, > + cid->enum_addr + BCMA_EROM_TABLE_SIZE, BCMA_EROM_TABLE_SIZE, > + RF_ACTIVE); > + if (r == NULL) { > + device_printf(dev, "failed to allocate EROM resource\n"); > + return (ENXIO); > + } > + > + /* Enumerate all declared cores */ > + if ((error = bcma_erom_open(&erom, r, BCMA_EROM_TABLE_START))) > + goto cleanup; > + > + error = bcma_erom_get_core_info(&erom, cores, num_cores); > + > +cleanup: > + bus_release_resource(dev, SYS_RES_MEMORY, rid, r); > + return (error); > +} > + > /** > * Scan a device enumeration ROM table, adding all valid discovered cores > to > * the bus. > @@ -577,6 +613,7 @@ static device_method_t bcma_methods[] = > DEVMETHOD(bhnd_bus_find_hostb_device, bcma_find_hostb_device), > DEVMETHOD(bhnd_bus_alloc_devinfo, bcma_alloc_bhnd_dinfo), > DEVMETHOD(bhnd_bus_free_devinfo, bcma_free_bhnd_dinfo), > + DEVMETHOD(bhnd_bus_get_core_table, bcma_get_core_table), > DEVMETHOD(bhnd_bus_reset_core, bcma_reset_core), > DEVMETHOD(bhnd_bus_suspend_core, bcma_suspend_core), > DEVMETHOD(bhnd_bus_read_config, bcma_read_config), > > Modified: head/sys/dev/bhnd/bhnd.h > ============================================================ > ================== > --- head/sys/dev/bhnd/bhnd.h Sun Aug 28 19:33:09 2016 (r304962) > +++ head/sys/dev/bhnd/bhnd.h Sun Aug 28 19:34:22 2016 (r304963) > @@ -425,6 +425,32 @@ bhnd_get_chipid(device_t dev) { > }; > > /** > + * Get a list of all cores discoverable on the bhnd bus. > + * > + * Enumerates all cores discoverable on @p dev, returning the list in > + * @p cores and the count in @p num_cores. > + * > + * The memory allocated for the list should be freed using > + * `free(*cores, M_BHND)`. @p cores and @p num_cores are not changed > + * when an error is returned. > + * > + * @param dev A bhnd bus child device. > + * @param[out] cores The table of core descriptors. > + * @param[out] num_cores The number of core descriptors in @p cores. > + * > + * @retval 0 success > + * @retval non-zero if an error occurs enumerating @p dev, a regular > UNIX > + * error code should be returned. > + */ > +static inline int > +bhnd_get_core_table(device_t dev, struct bhnd_core_info **cores, > + u_int *num_cores) > +{ > + return (BHND_BUS_GET_CORE_TABLE(device_get_parent(dev), dev, > cores, > + num_cores)); > +} > + > +/** > * If supported by the chipset, return the clock source for the given > clock. > * > * This function is only supported on early PWRCTL-equipped chipsets > > Modified: head/sys/dev/bhnd/bhnd_bus_if.m > ============================================================ > ================== > --- head/sys/dev/bhnd/bhnd_bus_if.m Sun Aug 28 19:33:09 2016 > (r304962) > +++ head/sys/dev/bhnd/bhnd_bus_if.m Sun Aug 28 19:34:22 2016 > (r304963) > @@ -56,6 +56,13 @@ CODE { > panic("bhnd_bus_get_chipid unimplemented"); > } > > + static int > + bhnd_bus_null_get_core_table(device_t dev, device_t child, > + struct bhnd_core_info **cores, u_int *num_cores) > + { > + panic("bhnd_bus_get_core_table unimplemented"); > + } > + > static bhnd_attach_type > bhnd_bus_null_get_attach_type(device_t dev, device_t child) > { > @@ -271,6 +278,32 @@ METHOD const struct bhnd_chipid * get_ch > } DEFAULT bhnd_bus_null_get_chipid; > > /** > + * Get a list of all cores discoverable on @p dev. > + * > + * Enumerates all cores discoverable on @p dev, returning the list in > + * @p cores and the count in @p num_cores. > + * > + * The memory allocated for the list should be freed using > + * `free(*cores, M_BHND)`. @p cores and @p num_cores are not changed > + * when an error is returned. > + * > + * @param dev The bhnd bus device. > + * @param child The requesting bhnd bus child. > + * @param[out] cores The table of core descriptors. > + * @param[out] num_cores The number of core descriptors in @p cores. > + * > + * @retval 0 success > + * @retval non-zero if an error occurs enumerating @p dev, a regular > UNIX > + * error code should be returned. > + */ > +METHOD int get_core_table { > + device_t dev; > + device_t child; > + struct bhnd_core_info **cores; > + u_int *num_cores; > +} DEFAULT bhnd_bus_null_get_core_table; > + > +/** > * Return the BHND attachment type of the parent bus. > * > * @param dev The device whose child is being examined. > > Modified: head/sys/dev/bhnd/siba/siba.c > ============================================================ > ================== > --- head/sys/dev/bhnd/siba/siba.c Sun Aug 28 19:33:09 2016 > (r304962) > +++ head/sys/dev/bhnd/siba/siba.c Sun Aug 28 19:34:22 2016 > (r304963) > @@ -504,6 +504,76 @@ siba_free_bhnd_dinfo(device_t dev, struc > siba_free_dinfo(dev, (struct siba_devinfo *)dinfo); > } > > + > +static int > +siba_get_core_table(device_t dev, device_t child, struct bhnd_core_info > **cores, > + u_int *num_cores) > +{ > + const struct bhnd_chipid *chipid; > + struct bhnd_core_info *table; > + struct bhnd_resource *r; > + int error; > + int rid; > + > + /* Fetch the core count from our chip identification */ > + chipid = BHND_BUS_GET_CHIPID(dev, dev); > + > + /* Allocate our local core table */ > + table = malloc(sizeof(*table) * chipid->ncores, M_BHND, M_NOWAIT); > + if (table == NULL) > + return (ENOMEM); > + > + /* Enumerate all cores. */ > + for (u_int i = 0; i < chipid->ncores; i++) { > + struct siba_core_id cid; > + uint32_t idhigh, idlow; > + > + /* Map the core's register block */ > + rid = 0; > + r = bhnd_alloc_resource(dev, SYS_RES_MEMORY, &rid, > + SIBA_CORE_ADDR(i), SIBA_CORE_ADDR(i) + SIBA_CORE_SIZE > - 1, > + SIBA_CORE_SIZE, RF_ACTIVE); > + if (r == NULL) { > + error = ENXIO; > + goto failed; > + } > + > + /* Read the core info */ > + idhigh = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDHIGH)) > ; > + idlow = bhnd_bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDLOW)); > + > + cid = siba_parse_core_id(idhigh, idlow, i, 0); > + table[i] = cid.core_info; > + > + /* Determine unit number */ > + for (u_int j = 0; j < i; j++) { > + if (table[j].vendor == table[i].vendor && > + table[j].device == table[i].device) > + table[i].unit++; > + } > + > + /* Release our resource */ > + bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r); > + r = NULL; > + } > + > + /* Provide the result values (performed last to avoid modifying > + * cores/num_cores if enumeration failed). */ > + *cores = table; > + *num_cores = chipid->ncores; > + > + return (0); > + > +failed: > + if (table != NULL) > + free(table, M_BHND); > + > + if (r != NULL) > + bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r); > + > + return (error); > +} > + > /** > * Scan the core table and add all valid discovered cores to > * the bus. > @@ -696,6 +766,7 @@ static device_method_t siba_methods[] = > > /* BHND interface */ > DEVMETHOD(bhnd_bus_find_hostb_device, siba_find_hostb_device), > + DEVMETHOD(bhnd_bus_get_core_table, siba_get_core_table), > DEVMETHOD(bhnd_bus_alloc_devinfo, siba_alloc_bhnd_dinfo), > DEVMETHOD(bhnd_bus_free_devinfo, siba_free_bhnd_dinfo), > DEVMETHOD(bhnd_bus_reset_core, siba_reset_core), > > From owner-svn-src-head@freebsd.org Sun Aug 28 23:12: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 DF4B5BC5B77; Sun, 28 Aug 2016 23:12:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA96595C; Sun, 28 Aug 2016 23:12:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 58F6CB922; Sun, 28 Aug 2016 19:12:04 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Date: Sun, 28 Aug 2016 16:09:51 -0700 Message-ID: <1595604.93PBdSz0kX@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160828015210.GI83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sun, 28 Aug 2016 19:12:04 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 28 Aug 2016 23:12:06 -0000 On Sunday, August 28, 2016 04:52:10 AM Konstantin Belousov wrote: > On Sun, Aug 28, 2016 at 04:25:46AM +0300, Andrey Chernov wrote: > > On 28.08.2016 4:15, Konstantin Belousov wrote: > > >> POSIX: "No function in this volume of POSIX.1-2008 shall set errno to zero." > > > I am quite curious where ptrace(2) is defined by POSIX. > > > > POSIX just repeats C99 statement for its own functions, supporting this > > rule too, but C99 rule is more general and related to any library functions. > > > > >> POSIX: "For each thread of a process, the value of errno shall not be > > >> affected by function calls or assignments to errno by other threads." > > > And ? What should the citation add new to the substance > > > of the code change ? > > > > This is for your comment "On both i386 and amd64, the errno symbol was > > directly referenced, which only works correctly in single-threaded > > process." > I still do not understand what you want to say there. Errno as the > symbol existing in the symbol table of libc, gives 'POSIX errno' value > for the main thread. Preprocessor definition converts C language > accesses to errno into some indirections which result in accesses to > per-thread errno location. The bug in x86 asm code was due to direct > usage of errno. > > What POSIX requires from the C-level errno symbol does not define a > semantic for the memory location pointed to by the errno sym-table > symbol. > > And amusingly, all other arches did it right, except aarch64 and risc-v > copied from aarch64. They lack the wrapper at all, I wrote aarch64 > ptrace.S already. OTOH, given that we explicitly documented it as not being true, I suspect any applications that are using ptrace() are going off the documentation, not the implementation artifact. Note that Linux's ptrace() documents the same requirement as before this change (caller is required to clear errno), so I doubt there is any actual software out there that expects the FreeBSD-specific behavior. Given that and the extra maintenance overhead of having to dink with errno in assembly on X architectures, I'd rather we keep the old language in the manpage and remove the 'errno' frobbing in the system call wrappers. To be honest, my first response to this commit was one of surprise that we modify errno directly as that is inconsistent with other system calls. (I haven't looked to see if any other system call wrappers modify errno for non-error cases.) -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 29 01:59: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 60DDFB77ACF; Mon, 29 Aug 2016 01:59:19 +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 33F1A663; Mon, 29 Aug 2016 01:59:19 +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 u7T1xItL070324; Mon, 29 Aug 2016 01:59:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T1xI3q070323; Mon, 29 Aug 2016 01:59:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608290159.u7T1xI3q070323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Aug 2016 01:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304971 - head/sys/dev/mfi 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.22 Precedence: list List-Id: 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, 29 Aug 2016 01:59:19 -0000 Author: jhb Date: Mon Aug 29 01:59:18 2016 New Revision: 304971 URL: https://svnweb.freebsd.org/changeset/base/304971 Log: Add missing array subscript. This fixes a tautological pointer comparison warning, but would also a real bug for a platform where bus_dmamap_unload of a static allocation is not a no-op. Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Sun Aug 28 21:31:21 2016 (r304970) +++ head/sys/dev/mfi/mfi.c Mon Aug 29 01:59:18 2016 (r304971) @@ -3361,7 +3361,7 @@ out: if (cm->cm_frame->header.cmd == MFI_CMD_STP) { for (i = 0; i < 2; i++) { if (sc->kbuff_arr[i]) { - if (sc->mfi_kbuff_arr_busaddr != 0) + if (sc->mfi_kbuff_arr_busaddr[i] != 0) bus_dmamap_unload( sc->mfi_kbuff_arr_dmat[i], sc->mfi_kbuff_arr_dmamap[i] From owner-svn-src-head@freebsd.org Mon Aug 29 03:22: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 95668B78E3C; Mon, 29 Aug 2016 03:22:57 +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 5DD18D2C; Mon, 29 Aug 2016 03:22:57 +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 u7T3Muc6005206; Mon, 29 Aug 2016 03:22:56 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T3MuYA005204; Mon, 29 Aug 2016 03:22:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608290322.u7T3MuYA005204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 29 Aug 2016 03:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304972 - 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.22 Precedence: list List-Id: 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, 29 Aug 2016 03:22:57 -0000 Author: sephe Date: Mon Aug 29 03:22:56 2016 New Revision: 304972 URL: https://svnweb.freebsd.org/changeset/base/304972 Log: hyperv/hn: Add definition for NDIS media state. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7652 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Aug 29 01:59:18 2016 (r304971) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Aug 29 03:22:56 2016 (r304972) @@ -117,9 +117,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include "hv_net_vsc.h" -#include "hv_rndis.h" -#include "hv_rndis_filter.h" +#include +#include +#include +#include + #include "vmbus_if.h" /* Short for Hyper-V network interface */ @@ -584,7 +586,7 @@ netvsc_attach(device_t dev) } #endif - if (device_info.link_state == 0) { + if (device_info.link_state == NDIS_MEDIA_STATE_CONNECTED) { sc->hn_carrier = 1; } Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Mon Aug 29 01:59:18 2016 (r304971) +++ head/sys/dev/hyperv/netvsc/ndis.h Mon Aug 29 03:22:56 2016 (r304972) @@ -29,6 +29,9 @@ #ifndef _NET_NDIS_H_ #define _NET_NDIS_H_ +#define NDIS_MEDIA_STATE_CONNECTED 0 +#define NDIS_MEDIA_STATE_DISCONNECTED 1 + #define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C #define NDIS_OBJTYPE_DEFAULT 0x80 From owner-svn-src-head@freebsd.org Mon Aug 29 04:44: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 92696B77C6C; Mon, 29 Aug 2016 04:44:25 +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 64CB1E87; Mon, 29 Aug 2016 04:44:25 +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 u7T4iOFh035560; Mon, 29 Aug 2016 04:44:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T4iO9r035559; Mon, 29 Aug 2016 04:44:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608290444.u7T4iO9r035559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 29 Aug 2016 04:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304973 - 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.22 Precedence: list List-Id: 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, 29 Aug 2016 04:44:25 -0000 Author: sephe Date: Mon Aug 29 04:44:24 2016 New Revision: 304973 URL: https://svnweb.freebsd.org/changeset/base/304973 Log: hyperv/hn: Switch to new RNDIS query for link status extraction. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7654 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 03:22:56 2016 (r304972) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 04:44:24 2016 (r304973) @@ -712,12 +712,12 @@ hv_rf_query_device_mac(rndis_device *dev error = hn_rndis_query(sc, OID_802_3_PERMANENT_ADDRESS, NULL, 0, device->hw_mac_addr, &hwaddr_len); if (error) - return error; + return (error); if (hwaddr_len != ETHER_ADDR_LEN) { if_printf(sc->hn_ifp, "invalid hwaddr len %zu\n", hwaddr_len); - return EINVAL; + return (EINVAL); } - return 0; + return (0); } /* @@ -726,10 +726,20 @@ hv_rf_query_device_mac(rndis_device *dev static inline int hv_rf_query_device_link_status(rndis_device *device) { - uint32_t size = sizeof(uint32_t); + struct hn_softc *sc = device->sc; + size_t size; + int error; - return (hv_rf_query_device(device, - RNDIS_OID_GEN_MEDIA_CONNECT_STATUS, &device->link_status, &size)); + size = sizeof(uint32_t); + error = hn_rndis_query(sc, OID_GEN_MEDIA_CONNECT_STATUS, NULL, 0, + &device->link_status, &size); + if (error) + return (error); + if (size != sizeof(uint32_t)) { + if_printf(sc->hn_ifp, "invalid link status len %zu\n", size); + return (EINVAL); + } + return (0); } static uint8_t netvsc_hash_key[HASH_KEYLEN] = { From owner-svn-src-head@freebsd.org Mon Aug 29 04:54: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 AD609BC5029; Mon, 29 Aug 2016 04:54:14 +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 716BC84A; Mon, 29 Aug 2016 04:54: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 u7T4sDbv039237; Mon, 29 Aug 2016 04:54:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T4sDHi039235; Mon, 29 Aug 2016 04:54:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608290454.u7T4sDHi039235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 29 Aug 2016 04:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304975 - 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.22 Precedence: list List-Id: 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, 29 Aug 2016 04:54:14 -0000 Author: sephe Date: Mon Aug 29 04:54:13 2016 New Revision: 304975 URL: https://svnweb.freebsd.org/changeset/base/304975 Log: hyperv/hn: Switch to new RNDIS query for RSS capabilities extraction. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7656 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 04:45:58 2016 (r304974) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 04:54:13 2016 (r304975) @@ -79,8 +79,6 @@ static void hv_rf_receive_indicate_statu const rndis_msg *response); static void hv_rf_receive_data(struct hn_rx_ring *rxr, const void *data, int dlen); -static int hv_rf_query_device(rndis_device *device, uint32_t oid, - void *result, uint32_t *result_size); static inline int hv_rf_query_device_mac(rndis_device *device); static inline int hv_rf_query_device_link_status(rndis_device *device); static int hv_rf_set_packet_filter(rndis_device *device, uint32_t new_filter); @@ -102,6 +100,7 @@ static int hn_rndis_query(struct hn_soft static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, size_t dlen); static int hn_rndis_conf_offload(struct hn_softc *sc); +static int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); static __inline uint32_t hn_rndis_rid(struct hn_softc *sc) @@ -628,77 +627,6 @@ hv_rf_on_receive(struct hn_softc *sc, st } /* - * RNDIS filter query device - */ -static int -hv_rf_query_device(rndis_device *device, uint32_t oid, void *result, - uint32_t *result_size) -{ - rndis_request *request; - uint32_t in_result_size = *result_size; - rndis_query_request *query; - rndis_query_complete *query_complete; - int ret = 0; - - *result_size = 0; - request = hv_rndis_request(device, REMOTE_NDIS_QUERY_MSG, - RNDIS_MESSAGE_SIZE(rndis_query_request)); - if (request == NULL) { - ret = -1; - goto cleanup; - } - - /* Set up the rndis query */ - query = &request->request_msg.msg.query_request; - query->oid = oid; - query->info_buffer_offset = sizeof(rndis_query_request); - query->info_buffer_length = 0; - query->device_vc_handle = 0; - - if (oid == RNDIS_OID_GEN_RSS_CAPABILITIES) { - struct rndis_recv_scale_cap *cap; - - request->request_msg.msg_len += - sizeof(struct rndis_recv_scale_cap); - query->info_buffer_length = sizeof(struct rndis_recv_scale_cap); - cap = (struct rndis_recv_scale_cap *)((unsigned long)query + - query->info_buffer_offset); - cap->hdr.type = RNDIS_OBJECT_TYPE_RSS_CAPABILITIES; - cap->hdr.rev = RNDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2; - cap->hdr.size = sizeof(struct rndis_recv_scale_cap); - } - - ret = hv_rf_send_request(device, request, REMOTE_NDIS_QUERY_MSG); - if (ret != 0) { - /* Fixme: printf added */ - printf("RNDISFILTER request failed to Send!\n"); - goto cleanup; - } - - sema_wait(&request->wait_sema); - - /* Copy the response back */ - query_complete = &request->response_msg.msg.query_complete; - - if (query_complete->info_buffer_length > in_result_size) { - ret = EINVAL; - goto cleanup; - } - - memcpy(result, (void *)((unsigned long)query_complete + - query_complete->info_buffer_offset), - query_complete->info_buffer_length); - - *result_size = query_complete->info_buffer_length; - -cleanup: - if (request != NULL) - hv_put_rndis_request(device, request); - - return (ret); -} - -/* * RNDIS filter query device MAC address */ static int @@ -1093,6 +1021,51 @@ done: } static int +hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt) +{ + struct ndis_rss_caps in, caps; + size_t caps_len; + int error; + + /* + * Only NDIS 6.30+ is supported. + */ + KASSERT(sc->hn_ndis_ver >= NDIS_VERSION_6_30, + ("NDIS 6.30+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); + *rxr_cnt = 0; + + memset(&in, 0, sizeof(in)); + in.ndis_hdr.ndis_type = NDIS_OBJTYPE_RSS_CAPS; + in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_2; + in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE; + + caps_len = NDIS_RSS_CAPS_SIZE; + error = hn_rndis_query(sc, OID_GEN_RSS_CAPABILITIES, + &in, NDIS_RSS_CAPS_SIZE, &caps, &caps_len); + if (error) + return (error); + if (caps_len < NDIS_RSS_CAPS_SIZE_6_0) { + if_printf(sc->hn_ifp, "invalid NDIS RSS caps len %zu", + caps_len); + return (EINVAL); + } + + if (caps.ndis_nrxr == 0) { + if_printf(sc->hn_ifp, "0 RX rings!?\n"); + return (EINVAL); + } + *rxr_cnt = caps.ndis_nrxr; + + if (caps_len == NDIS_RSS_CAPS_SIZE) { + if (bootverbose) { + if_printf(sc->hn_ifp, "RSS indirect table size %u\n", + caps.ndis_nind); + } + } + return (0); +} + +static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, size_t dlen) { struct rndis_set_req *req; @@ -1347,8 +1320,6 @@ hv_rf_on_device_add(struct hn_softc *sc, { int ret; rndis_device *rndis_dev; - struct rndis_recv_scale_cap rsscaps; - uint32_t rsscaps_size = sizeof(struct rndis_recv_scale_cap); netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = sc->hn_dev; struct hn_nvs_subch_req *req; @@ -1357,6 +1328,7 @@ hv_rf_on_device_add(struct hn_softc *sc, struct vmbus_xact *xact = NULL; uint32_t status, nsubch; int nchan = *nchan0; + int rxr_cnt; rndis_dev = hv_get_rndis_device(); if (rndis_dev == NULL) { @@ -1405,22 +1377,23 @@ hv_rf_on_device_add(struct hn_softc *sc, dev_info->link_state = rndis_dev->link_status; - if (sc->hn_nvs_ver < NVSP_PROTOCOL_VERSION_5 || nchan == 1) + if (sc->hn_ndis_ver < NDIS_VERSION_6_30 || nchan == 1) return (0); - memset(&rsscaps, 0, rsscaps_size); - ret = hv_rf_query_device(rndis_dev, - RNDIS_OID_GEN_RSS_CAPABILITIES, - &rsscaps, &rsscaps_size); - if ((ret != 0) || (rsscaps.num_recv_que < 2)) { - device_printf(dev, "hv_rf_query_device failed or " - "rsscaps.num_recv_que < 2 \n"); + /* + * Get RSS capabilities, e.g. # of RX rings, and # of indirect + * table entries. + */ + ret = hn_rndis_get_rsscaps(sc, &rxr_cnt); + if (ret) { + /* This is benign. */ + ret = 0; goto out; } - device_printf(dev, "channel, offered %u, requested %d\n", - rsscaps.num_recv_que, nchan); - if (nchan > rsscaps.num_recv_que) - nchan = rsscaps.num_recv_que; + if (nchan > rxr_cnt) + nchan = rxr_cnt; + if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", + rxr_cnt, nchan); if (nchan == 1) { device_printf(dev, "only 1 channel is supported, no vRSS\n"); Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Mon Aug 29 04:45:58 2016 (r304974) +++ head/sys/dev/hyperv/netvsc/ndis.h Mon Aug 29 04:54:13 2016 (r304975) @@ -32,9 +32,11 @@ #define NDIS_MEDIA_STATE_CONNECTED 0 #define NDIS_MEDIA_STATE_DISCONNECTED 1 +#define OID_GEN_RSS_CAPABILITIES 0x00010203 #define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C #define NDIS_OBJTYPE_DEFAULT 0x80 +#define NDIS_OBJTYPE_RSS_CAPS 0x88 /* common_set */ #define NDIS_OFFLOAD_SET_NOCHG 0 @@ -50,7 +52,10 @@ struct ndis_object_hdr { uint16_t ndis_size; /* incl. this hdr */ }; -/* OID_TCP_OFFLOAD_PARAMETERS */ +/* + * OID_TCP_OFFLOAD_PARAMETERS + * ndis_type: NDIS_OBJTYPE_DEFAULT + */ struct ndis_offload_params { struct ndis_object_hdr ndis_hdr; uint8_t ndis_ip4csum; /* param_set */ @@ -118,4 +123,35 @@ struct ndis_offload_params { #define NDIS_OFFLOAD_RSC_OFF 1 #define NDIS_OFFLOAD_RSC_ON 2 +/* + * OID_GEN_RSS_CAPABILITIES + * ndis_type: NDIS_OBJTYPE_RSS_CAPS + */ +struct ndis_rss_caps { + struct ndis_object_hdr ndis_hdr; + uint32_t ndis_flags; /* NDIS_RSS_CAP_ */ + uint32_t ndis_nmsi; /* # of MSIs */ + uint32_t ndis_nrxr; /* # of RX rings */ + /* NDIS >= 6.30 */ + uint16_t ndis_nind; /* # of indtbl ent. */ + uint16_t ndis_pad; +}; + +#define NDIS_RSS_CAPS_SIZE \ + __offsetof(struct ndis_rss_caps, ndis_pad) +#define NDIS_RSS_CAPS_SIZE_6_0 \ + __offsetof(struct ndis_rss_caps, ndis_nind) + +#define NDIS_RSS_CAPS_REV_1 1 /* NDIS 6.{0,1,20} */ +#define NDIS_RSS_CAPS_REV_2 2 /* NDIS 6.30 */ + +#define NDIS_RSS_CAP_MSI 0x01000000 +#define NDIS_RSS_CAP_CLASSIFY_ISR 0x02000000 +#define NDIS_RSS_CAP_CLASSIFY_DPC 0x04000000 +#define NDIS_RSS_CAP_MSIX 0x08000000 +#define NDIS_RSS_CAP_IPV4 0x00000100 +#define NDIS_RSS_CAP_IPV6 0x00000200 +#define NDIS_RSS_CAP_IPV6_EX 0x00000400 +#define NDIS_RSS_CAP_HASH_TOEPLITZ 0x00000001 + #endif /* !_NET_NDIS_H_ */ From owner-svn-src-head@freebsd.org Mon Aug 29 05:08: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 A8466BC5381; Mon, 29 Aug 2016 05:08:54 +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 7264CEF5; Mon, 29 Aug 2016 05:08:54 +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 u7T58riu043081; Mon, 29 Aug 2016 05:08:53 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T58r15043080; Mon, 29 Aug 2016 05:08:53 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608290508.u7T58r15043080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 29 Aug 2016 05:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304976 - 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.22 Precedence: list List-Id: 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, 29 Aug 2016 05:08:54 -0000 Author: sephe Date: Mon Aug 29 05:08:53 2016 New Revision: 304976 URL: https://svnweb.freebsd.org/changeset/base/304976 Log: hyperv/hn: Fix # of channels setting, if RSS is not available. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7657 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 04:54:13 2016 (r304975) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 05:08:53 2016 (r304976) @@ -1377,8 +1377,14 @@ hv_rf_on_device_add(struct hn_softc *sc, dev_info->link_state = rndis_dev->link_status; - if (sc->hn_ndis_ver < NDIS_VERSION_6_30 || nchan == 1) + if (sc->hn_ndis_ver < NDIS_VERSION_6_30 || nchan == 1) { + /* + * Either RSS is not supported, or multiple RX/TX rings + * are not requested. + */ + *nchan0 = 1; return (0); + } /* * Get RSS capabilities, e.g. # of RX rings, and # of indirect @@ -1386,9 +1392,9 @@ hv_rf_on_device_add(struct hn_softc *sc, */ ret = hn_rndis_get_rsscaps(sc, &rxr_cnt); if (ret) { - /* This is benign. */ - ret = 0; - goto out; + /* No RSS; this is benign. */ + *nchan0 = 1; + return (0); } if (nchan > rxr_cnt) nchan = rxr_cnt; From owner-svn-src-head@freebsd.org Mon Aug 29 05:35: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 25320BC5EC3; Mon, 29 Aug 2016 05:35:37 +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 C9F8E164; Mon, 29 Aug 2016 05:35:36 +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 u7T5Zaoa054163; Mon, 29 Aug 2016 05:35:36 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T5ZZ6g054159; Mon, 29 Aug 2016 05:35:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608290535.u7T5ZZ6g054159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 29 Aug 2016 05:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304979 - 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.22 Precedence: list List-Id: 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, 29 Aug 2016 05:35:37 -0000 Author: sephe Date: Mon Aug 29 05:35:35 2016 New Revision: 304979 URL: https://svnweb.freebsd.org/changeset/base/304979 Log: hyperv/hn: Switch to new RNDIS set for RSS parameters. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7658 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Aug 29 05:17:44 2016 (r304978) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Aug 29 05:35:35 2016 (r304979) @@ -62,6 +62,8 @@ #include #include +#include + #define HN_USE_TXDESC_BUFRING MALLOC_DECLARE(M_NETVSC); @@ -383,6 +385,8 @@ typedef struct hn_softc { uint32_t hn_rndis_rid; uint32_t hn_ndis_ver; + + struct ndis_rssprm_toeplitz hn_rss; } hn_softc_t; #define HN_FLAG_RXBUF_CONNECTED 0x0001 Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Mon Aug 29 05:17:44 2016 (r304978) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Mon Aug 29 05:35:35 2016 (r304979) @@ -536,20 +536,6 @@ struct rndis_hash_info { uint32_t hash_info; } __packed; -#define NDIS_HASH_FUNCTION_MASK 0x000000FF /* see hash function */ -#define NDIS_HASH_TYPE_MASK 0x00FFFF00 /* see hash type */ - -/* hash function */ -#define NDIS_HASH_FUNCTION_TOEPLITZ 0x00000001 - -/* hash type */ -#define NDIS_HASH_IPV4 0x00000100 -#define NDIS_HASH_TCP_IPV4 0x00000200 -#define NDIS_HASH_IPV6 0x00000400 -#define NDIS_HASH_IPV6_EX 0x00000800 -#define NDIS_HASH_TCP_IPV6 0x00001000 -#define NDIS_HASH_TCP_IPV6_EX 0x00002000 - typedef struct rndis_tcp_tso_info_ { union { struct { Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 05:17:44 2016 (r304978) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 05:35:35 2016 (r304979) @@ -101,6 +101,7 @@ static int hn_rndis_set(struct hn_softc size_t dlen); static int hn_rndis_conf_offload(struct hn_softc *sc); static int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); +static int hn_rndis_conf_rss(struct hn_softc *sc, int nchan); static __inline uint32_t hn_rndis_rid(struct hn_softc *sc) @@ -670,7 +671,7 @@ hv_rf_query_device_link_status(rndis_dev return (0); } -static uint8_t netvsc_hash_key[HASH_KEYLEN] = { +static uint8_t netvsc_hash_key[NDIS_HASH_KEYSIZE_TOEPLITZ] = { 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, @@ -679,106 +680,6 @@ static uint8_t netvsc_hash_key[HASH_KEYL }; /* - * RNDIS set vRSS parameters - */ -static int -hv_rf_set_rss_param(rndis_device *device, int num_queue) -{ - rndis_request *request; - rndis_set_request *set; - rndis_set_complete *set_complete; - rndis_recv_scale_param *rssp; - uint32_t extlen = sizeof(rndis_recv_scale_param) + - (4 * ITAB_NUM) + HASH_KEYLEN; - uint32_t *itab, status; - uint8_t *keyp; - int i, ret; - - - request = hv_rndis_request(device, REMOTE_NDIS_SET_MSG, - RNDIS_MESSAGE_SIZE(rndis_set_request) + extlen); - if (request == NULL) { - if (bootverbose) - printf("Netvsc: No memory to set vRSS parameters.\n"); - ret = -1; - goto cleanup; - } - - set = &request->request_msg.msg.set_request; - set->oid = RNDIS_OID_GEN_RSS_PARAMETERS; - set->info_buffer_length = extlen; - set->info_buffer_offset = sizeof(rndis_set_request); - set->device_vc_handle = 0; - - /* Fill out the rssp parameter structure */ - rssp = (rndis_recv_scale_param *)(set + 1); - rssp->hdr.type = RNDIS_OBJECT_TYPE_RSS_PARAMETERS; - rssp->hdr.rev = RNDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2; - rssp->hdr.size = sizeof(rndis_recv_scale_param); - rssp->flag = 0; - rssp->hashinfo = RNDIS_HASH_FUNC_TOEPLITZ | RNDIS_HASH_IPV4 | - RNDIS_HASH_TCP_IPV4 | RNDIS_HASH_IPV6 | RNDIS_HASH_TCP_IPV6; - rssp->indirect_tabsize = 4 * ITAB_NUM; - rssp->indirect_taboffset = sizeof(rndis_recv_scale_param); - rssp->hashkey_size = HASH_KEYLEN; - rssp->hashkey_offset = rssp->indirect_taboffset + - rssp->indirect_tabsize; - - /* Set indirection table entries */ - itab = (uint32_t *)(rssp + 1); - for (i = 0; i < ITAB_NUM; i++) - itab[i] = i % num_queue; - - /* Set hash key values */ - keyp = (uint8_t *)((unsigned long)rssp + rssp->hashkey_offset); - for (i = 0; i < HASH_KEYLEN; i++) - keyp[i] = netvsc_hash_key[i]; - - ret = hv_rf_send_request(device, request, REMOTE_NDIS_SET_MSG); - if (ret != 0) { - goto cleanup; - } - - /* - * Wait for the response from the host. Another thread will signal - * us when the response has arrived. In the failure case, - * sema_timedwait() returns a non-zero status after waiting 5 seconds. - */ - ret = sema_timedwait(&request->wait_sema, 5 * hz); - if (ret == 0) { - /* Response received, check status */ - set_complete = &request->response_msg.msg.set_complete; - status = set_complete->status; - if (status != RNDIS_STATUS_SUCCESS) { - /* Bad response status, return error */ - if (bootverbose) - printf("Netvsc: Failed to set vRSS " - "parameters.\n"); - ret = -2; - } else { - if (bootverbose) - printf("Netvsc: Successfully set vRSS " - "parameters.\n"); - } - } else { - /* - * We cannot deallocate the request since we may still - * receive a send completion for it. - */ - printf("Netvsc: vRSS set timeout, id = %u, ret = %d\n", - request->request_msg.msg.init_request.request_id, ret); - goto exit; - } - -cleanup: - if (request != NULL) { - hv_put_rndis_request(device, request); - } -exit: - return (ret); -} - -/* * RNDIS filter set packet filter * Sends an rndis request with the new filter, then waits for a response * from the host. @@ -1155,6 +1056,52 @@ hn_rndis_conf_offload(struct hn_softc *s return (error); } +static int +hn_rndis_conf_rss(struct hn_softc *sc, int nchan) +{ + struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; + struct ndis_rss_params *prm = &rss->rss_params; + int i, error; + + /* + * Only NDIS 6.30+ is supported. + */ + KASSERT(sc->hn_ndis_ver >= NDIS_VERSION_6_30, + ("NDIS 6.30+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); + + memset(rss, 0, sizeof(*rss)); + prm->ndis_hdr.ndis_type = NDIS_OBJTYPE_RSS_PARAMS; + prm->ndis_hdr.ndis_rev = NDIS_RSS_PARAMS_REV_2; + prm->ndis_hdr.ndis_size = sizeof(*rss); + prm->ndis_hash = NDIS_HASH_FUNCTION_TOEPLITZ | + NDIS_HASH_IPV4 | NDIS_HASH_TCP_IPV4 | + NDIS_HASH_IPV6 | NDIS_HASH_TCP_IPV6; + /* TODO: Take ndis_rss_caps.ndis_nind into account */ + prm->ndis_indsize = sizeof(rss->rss_ind); + prm->ndis_indoffset = + __offsetof(struct ndis_rssprm_toeplitz, rss_ind[0]); + prm->ndis_keysize = sizeof(rss->rss_key); + prm->ndis_keyoffset = + __offsetof(struct ndis_rssprm_toeplitz, rss_key[0]); + + /* Setup RSS key */ + memcpy(rss->rss_key, netvsc_hash_key, sizeof(rss->rss_key)); + + /* Setup RSS indirect table */ + /* TODO: Take ndis_rss_caps.ndis_nind into account */ + for (i = 0; i < NDIS_HASH_INDCNT; ++i) + rss->rss_ind[i] = i % nchan; + + error = hn_rndis_set(sc, OID_GEN_RSS_PARAMETERS, rss, sizeof(*rss)); + if (error) { + if_printf(sc->hn_ifp, "RSS config failed: %d\n", error); + } else { + if (bootverbose) + if_printf(sc->hn_ifp, "RSS config done\n"); + } + return (error); +} + /* * RNDIS filter init device */ @@ -1456,8 +1403,11 @@ hv_rf_on_device_add(struct hn_softc *sc, } nchan = nsubch + 1; - ret = hv_rf_set_rss_param(rndis_dev, nchan); - *nchan0 = nchan; + ret = hn_rndis_conf_rss(sc, nchan); + if (ret != 0) + *nchan0 = 1; + else + *nchan0 = nchan; out: if (xact != NULL) vmbus_xact_put(xact); Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Mon Aug 29 05:17:44 2016 (r304978) +++ head/sys/dev/hyperv/netvsc/ndis.h Mon Aug 29 05:35:35 2016 (r304979) @@ -33,10 +33,12 @@ #define NDIS_MEDIA_STATE_DISCONNECTED 1 #define OID_GEN_RSS_CAPABILITIES 0x00010203 +#define OID_GEN_RSS_PARAMETERS 0x00010204 #define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C #define NDIS_OBJTYPE_DEFAULT 0x80 #define NDIS_OBJTYPE_RSS_CAPS 0x88 +#define NDIS_OBJTYPE_RSS_PARAMS 0x89 /* common_set */ #define NDIS_OFFLOAD_SET_NOCHG 0 @@ -46,6 +48,23 @@ /* a.k.a GRE MAC */ #define NDIS_ENCAP_TYPE_NVGRE 0x00000001 +#define NDIS_HASH_FUNCTION_MASK 0x000000FF /* see hash function */ +#define NDIS_HASH_TYPE_MASK 0x00FFFF00 /* see hash type */ + +/* hash function */ +#define NDIS_HASH_FUNCTION_TOEPLITZ 0x00000001 + +/* hash type */ +#define NDIS_HASH_IPV4 0x00000100 +#define NDIS_HASH_TCP_IPV4 0x00000200 +#define NDIS_HASH_IPV6 0x00000400 +#define NDIS_HASH_IPV6_EX 0x00000800 +#define NDIS_HASH_TCP_IPV6 0x00001000 +#define NDIS_HASH_TCP_IPV6_EX 0x00002000 + +#define NDIS_HASH_KEYSIZE_TOEPLITZ 40 +#define NDIS_HASH_INDCNT 128 + struct ndis_object_hdr { uint8_t ndis_type; /* NDIS_OBJTYPE_ */ uint8_t ndis_rev; /* type specific */ @@ -154,4 +173,45 @@ struct ndis_rss_caps { #define NDIS_RSS_CAP_IPV6_EX 0x00000400 #define NDIS_RSS_CAP_HASH_TOEPLITZ 0x00000001 +/* + * OID_GEN_RSS_PARAMETERS + * ndis_type: NDIS_OBJTYPE_RSS_PARAMS + */ +struct ndis_rss_params { + struct ndis_object_hdr ndis_hdr; + uint16_t ndis_flags; /* NDIS_RSS_FLAG_ */ + uint16_t ndis_bcpu; /* base cpu 0 */ + uint32_t ndis_hash; /* NDIS_HASH_ */ + uint16_t ndis_indsize; /* indirect table */ + uint32_t ndis_indoffset; + uint16_t ndis_keysize; /* hash key */ + uint32_t ndis_keyoffset; + /* NDIS >= 6.20 */ + uint32_t ndis_cpumaskoffset; + uint32_t ndis_cpumaskcnt; + uint32_t ndis_cpumaskentsz; +}; + +#define NDIS_RSS_PARAMS_SIZE sizeof(struct ndis_rss_params) +#define NDIS_RSS_PARAMS_SIZE_6_0 \ + __offsetof(struct ndis_rss_params, ndis_cpumaskoffset) + +#define NDIS_RSS_PARAMS_REV_1 1 /* NDIS 6.0 */ +#define NDIS_RSS_PARAMS_REV_2 2 /* NDIS 6.20 */ + +#define NDIS_RSS_FLAG_BCPU_UNCHG 0x0001 +#define NDIS_RSS_FLAG_HASH_UNCHG 0x0002 +#define NDIS_RSS_FLAG_IND_UNCHG 0x0004 +#define NDIS_RSS_FLAG_KEY_UNCHG 0x0008 +#define NDIS_RSS_FLAG_DISABLE 0x0010 + +/* non-standard convenient struct */ +struct ndis_rssprm_toeplitz { + struct ndis_rss_params rss_params; + /* Toeplitz hash key */ + uint8_t rss_key[NDIS_HASH_KEYSIZE_TOEPLITZ]; + /* Indirect table */ + uint32_t rss_ind[NDIS_HASH_INDCNT]; +}; + #endif /* !_NET_NDIS_H_ */ From owner-svn-src-head@freebsd.org Mon Aug 29 06:07: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 2BE31B77710; Mon, 29 Aug 2016 06:07:45 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E072CB7D; Mon, 29 Aug 2016 06:07:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7T67i5Z065643; Mon, 29 Aug 2016 06:07:44 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T67ire065642; Mon, 29 Aug 2016 06:07:44 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608290607.u7T67ire065642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Aug 2016 06:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304986 - head/sys/amd64/amd64 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.22 Precedence: list List-Id: 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, 29 Aug 2016 06:07:45 -0000 Author: bde Date: Mon Aug 29 06:07:43 2016 New Revision: 304986 URL: https://svnweb.freebsd.org/changeset/base/304986 Log: Restore the nontemporal pagezero() under the name sse2_pagezero() (the same name as for i386). It is not reconnected yet. Which method is better is too machine-dependent and system-dependent to replace the old method unconditionally. Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Mon Aug 29 05:59:12 2016 (r304985) +++ head/sys/amd64/amd64/support.S Mon Aug 29 06:07:43 2016 (r304986) @@ -72,6 +72,24 @@ ENTRY(pagezero) ret END(pagezero) +/* Address: %rdi */ +ENTRY(sse2_pagezero) + PUSH_FRAME_POINTER + movq $-PAGE_SIZE,%rdx + subq %rdx,%rdi + xorl %eax,%eax +1: + movnti %rax,(%rdi,%rdx) + movnti %rax,8(%rdi,%rdx) + movnti %rax,16(%rdi,%rdx) + movnti %rax,24(%rdi,%rdx) + addq $32,%rdx + jne 1b + sfence + POP_FRAME_POINTER + ret +END(pagezero) + ENTRY(bcmp) PUSH_FRAME_POINTER movq %rdx,%rcx From owner-svn-src-head@freebsd.org Mon Aug 29 06: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 ABA6BBC72E0; Mon, 29 Aug 2016 06:50:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5055AC71; Mon, 29 Aug 2016 06:50:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7T6ojUN081365; Mon, 29 Aug 2016 06:50:45 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T6ojsx081363; Mon, 29 Aug 2016 06:50:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201608290650.u7T6ojsx081363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 29 Aug 2016 06:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304988 - in head/contrib/libarchive: libarchive tar 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.22 Precedence: list List-Id: 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, 29 Aug 2016 06:50:46 -0000 Author: mm Date: Mon Aug 29 06:50:45 2016 New Revision: 304988 URL: https://svnweb.freebsd.org/changeset/base/304988 Log: Revert r304869 This commit was incorrect and will be re-committed asap. Modified: head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/tar/util.c Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/tar/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Mon Aug 29 06:32:30 2016 (r304987) +++ head/contrib/libarchive/libarchive/archive_acl.c Mon Aug 29 06:50:45 2016 (r304988) @@ -57,27 +57,21 @@ static int archive_acl_add_entry_len_l(s size_t len, struct archive_string_conv *sc); static int isint_w(const wchar_t *start, const wchar_t *end, int *result); static int ismode_w(const wchar_t *start, const wchar_t *end, int *result); -static int parse_nfs4_flags_w(const wchar_t *start, const wchar_t *end, - int *result); -static int parse_nfs4_perms_w(const wchar_t *start, const wchar_t *end, - int *result); static void next_field_w(const wchar_t **wp, const wchar_t **start, const wchar_t **end, wchar_t *sep); static int prefix_w(const wchar_t *start, const wchar_t *end, const wchar_t *test); -static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, - int tag, const wchar_t *wname, int perm, int id); +static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, + const wchar_t *wname, int perm, int id); static void append_id_w(wchar_t **wp, int id); static int isint(const char *start, const char *end, int *result); static int ismode(const char *start, const char *end, int *result); -static int parse_nfs4_flags(const char *start, const char *end, int *result); -static int parse_nfs4_perms(const char *start, const char *end, int *result); static void next_field(const char **p, const char **start, const char **end, char *sep); static int prefix_c(const char *start, const char *end, const char *test); -static void append_entry(char **p, const char *prefix, int type, - int tag, const char *name, int perm, int id); +static void append_entry(char **p, const char *prefix, int tag, + const char *name, int perm, int id); static void append_id(char **p, int id); void @@ -453,16 +447,6 @@ archive_acl_text_w(struct archive *a, st int id, r; wchar_t *wp; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) && - (flags & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT))) { - /* cannot convert NFSv4 ACLs and POSIX1e ACLs at the same time */ - return (NULL); - } - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) && (flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) { - /* cannot have access and default at the same time */ - return (NULL); - } - if (acl->acl_text_w != NULL) { free (acl->acl_text_w); acl->acl_text_w = NULL; @@ -478,57 +462,17 @@ archive_acl_text_w(struct archive *a, st if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) length += 8; /* "default:" */ - switch (ap->tag) { - case ARCHIVE_ENTRY_ACL_USER_OBJ: - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { - length += 6; /* "owner@" */ - break; - } - /* FALLTHROUGH */ - case ARCHIVE_ENTRY_ACL_USER: - length += 4; /* "user" */ - break; - case ARCHIVE_ENTRY_ACL_GROUP_OBJ: - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { - length += 6; /* "group@" */ - break; - } - /* FALLTHROUGH */ - case ARCHIVE_ENTRY_ACL_GROUP: - case ARCHIVE_ENTRY_ACL_OTHER: - length += 5; /* "group", "other" */ - break; - case ARCHIVE_ENTRY_ACL_EVERYONE: - length += 9; /* "everyone@" */ - break; - } + length += 5; /* tag name */ length += 1; /* colon */ - if (((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) || - ap->tag == ARCHIVE_ENTRY_ACL_USER || - ap->tag == ARCHIVE_ENTRY_ACL_GROUP) { - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0 && wname != NULL) - length += wcslen(wname); - else if (r < 0 && errno == ENOMEM) - return (NULL); - else - length += sizeof(uid_t) * 3 + 1; - length += 1; /* colon */ - } - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) - length += 14; /* rwxpdDaARWcCos */ + r = archive_mstring_get_wcs(a, &ap->name, &wname); + if (r == 0 && wname != NULL) + length += wcslen(wname); + else if (r < 0 && errno == ENOMEM) + return (NULL); else - length += 3; /* rwx */ - length += 1; /* colon */ - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { - length += 7; /* fdinSFI */ - length += 1; /* colon */ - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DENY) != 0) - length += 4; /* deny */ - else - length += 5; /* allow, alarm, audit */ - length += 1; /* colon */ - } + length += sizeof(uid_t) * 3 + 1; + length ++; /* colon */ + length += 3; /* rwx */ length += 1; /* colon */ length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; length ++; /* newline */ @@ -536,39 +480,34 @@ archive_acl_text_w(struct archive *a, st ap = ap->next; } - if (count == 0) - return (NULL); - - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { length += 10; /* "user::rwx\n" */ length += 11; /* "group::rwx\n" */ length += 11; /* "other::rwx\n" */ } + if (count == 0) + return (NULL); + /* Now, allocate the string and actually populate it. */ wp = acl->acl_text_w = (wchar_t *)malloc(length * sizeof(wchar_t)); if (wp == NULL) return (NULL); count = 0; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, - ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, acl->mode & 0700, -1); + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, + acl->mode & 0700, -1); *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, - ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, acl->mode & 0070, -1); + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, + acl->mode & 0070, -1); *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, - ARCHIVE_ENTRY_ACL_OTHER, NULL, acl->mode & 0007, -1); + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, + acl->mode & 0007, -1); count += 3; - } - if ((flags & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | - ARCHIVE_ENTRY_ACL_TYPE_NFS4)) != 0) { ap = acl->acl_head; while (ap != NULL) { - if ((ap->type & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | - ARCHIVE_ENTRY_ACL_TYPE_NFS4)) != 0) { + if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { r = archive_mstring_get_wcs(a, &ap->name, &wname); if (r == 0) { *wp++ = separator; @@ -576,8 +515,8 @@ archive_acl_text_w(struct archive *a, st id = ap->id; else id = -1; - append_entry_w(&wp, NULL, ap->type, ap->tag, - wname, ap->permset, id); + append_entry_w(&wp, NULL, ap->tag, wname, + ap->permset, id); count++; } else if (r < 0 && errno == ENOMEM) return (NULL); @@ -586,6 +525,7 @@ archive_acl_text_w(struct archive *a, st } } + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) prefix = L"default:"; @@ -603,8 +543,8 @@ archive_acl_text_w(struct archive *a, st id = ap->id; else id = -1; - append_entry_w(&wp, prefix, ap->type, - ap->tag, wname, ap->permset, id); + append_entry_w(&wp, prefix, ap->tag, + wname, ap->permset, id); count ++; } else if (r < 0 && errno == ENOMEM) return (NULL); @@ -628,8 +568,8 @@ append_id_w(wchar_t **wp, int id) } static void -append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, - int tag, const wchar_t *wname, int perm, int id) +append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, + const wchar_t *wname, int perm, int id) { if (prefix != NULL) { wcscpy(*wp, prefix); @@ -639,11 +579,6 @@ append_entry_w(wchar_t **wp, const wchar case ARCHIVE_ENTRY_ACL_USER_OBJ: wname = NULL; id = -1; - if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - wcscpy(*wp, L"owner@"); - break; - } - /* FALLTHROUGH */ /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: wcscpy(*wp, L"user"); @@ -668,57 +603,18 @@ append_entry_w(wchar_t **wp, const wchar } *wp += wcslen(*wp); *(*wp)++ = L':'; - if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0 || - tag == ARCHIVE_ENTRY_ACL_USER || - tag == ARCHIVE_ENTRY_ACL_GROUP) { - if (wname != NULL) { - wcscpy(*wp, wname); - *wp += wcslen(*wp); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id_w(wp, id); - id = -1; - } - *(*wp)++ = L':'; - } - *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_READ | - ARCHIVE_ENTRY_ACL_READ_DATA | - ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? L'r' : L'-'; - *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE | - ARCHIVE_ENTRY_ACL_WRITE_DATA | - ARCHIVE_ENTRY_ACL_ADD_FILE)) ? L'w' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_EXECUTE) ? L'x' : L'-'; - if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? L'p' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? L'd' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? L'D' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? L'a' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? L'A' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? L'R' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? L'W' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ACL) ? L'c' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ACL) ? L'C' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? L'o' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? L's' : L'-'; - *(*wp)++ = L':'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? L'f' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? L'd' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? L'i' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? L'n' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? L'S' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? L'F' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? L'I' : L'-'; - *(*wp)++ = L':'; - if (type & ARCHIVE_ENTRY_ACL_TYPE_ALLOW) - wcscpy(*wp, L"allow"); - else if (type & ARCHIVE_ENTRY_ACL_TYPE_DENY) - wcscpy(*wp, L"deny"); - else if (type & ARCHIVE_ENTRY_ACL_TYPE_AUDIT) - wcscpy(*wp, L"audit"); - else if (type & ARCHIVE_ENTRY_ACL_TYPE_ALARM) - wcscpy(*wp, L"alarm"); + if (wname != NULL) { + wcscpy(*wp, wname); *wp += wcslen(*wp); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id_w(wp, id); + id = -1; } + *(*wp)++ = L':'; + *(*wp)++ = (perm & 0444) ? L'r' : L'-'; + *(*wp)++ = (perm & 0222) ? L'w' : L'-'; + *(*wp)++ = (perm & 0111) ? L'x' : L'-'; if (id != -1) { *(*wp)++ = L':'; append_id_w(wp, id); @@ -741,16 +637,6 @@ archive_acl_text_l(struct archive_acl *a int id, r; char *p; - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) && - (flags & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT))) { - /* cannot convert NFSv4 ACLs and POSIX1e ACLs at the same time */ - return (-1); - } - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) && (flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) { - /* cannot have access and default at the same time */ - return (-1); - } - if (acl->acl_text != NULL) { free (acl->acl_text); acl->acl_text = NULL; @@ -769,109 +655,63 @@ archive_acl_text_l(struct archive_acl *a if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) length += 8; /* "default:" */ - switch (ap->tag) { - case ARCHIVE_ENTRY_ACL_USER_OBJ: - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { - length += 6; /* "owner@" */ - break; - } - /* FALLTHROUGH */ - case ARCHIVE_ENTRY_ACL_USER: - length += 4; /* "user" */ - break; - case ARCHIVE_ENTRY_ACL_GROUP_OBJ: - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { - length += 6; /* "group@" */ - break; - } - /* FALLTHROUGH */ - case ARCHIVE_ENTRY_ACL_GROUP: - case ARCHIVE_ENTRY_ACL_OTHER: - length += 5; /* "group", "other" */ - break; - case ARCHIVE_ENTRY_ACL_EVERYONE: - length += 9; /* "everyone@" */ - break; - } - + length += 5; /* tag name */ length += 1; /* colon */ - if (((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) || - ap->tag == ARCHIVE_ENTRY_ACL_USER || - ap->tag == ARCHIVE_ENTRY_ACL_GROUP) { - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - if (len > 0 && name != NULL) - length += len; - else - length += sizeof(uid_t) * 3 + 1; - length += 1; /* colon */ - } - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) - length += 14; /* rwxpdDaARWcCos */ + r = archive_mstring_get_mbs_l( + &ap->name, &name, &len, sc); + if (r != 0) + return (-1); + if (len > 0 && name != NULL) + length += len; else - length += 3; /* rwx */ + length += sizeof(uid_t) * 3 + 1; + length ++; /* colon */ + length += 3; /* rwx */ length += 1; /* colon */ - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { - length += 7; /* fdinSFI */ - length += 1; /* colon */ - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DENY) != 0) - length += 4; /* deny */ - else - length += 5; /* allow, alarm, audit */ - length += 1; /* colon */ - } - length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; length ++; /* newline */ } ap = ap->next; } - if (count == 0) - return (0); - - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { length += 10; /* "user::rwx\n" */ length += 11; /* "group::rwx\n" */ length += 11; /* "other::rwx\n" */ } + if (count == 0) + return (0); + /* Now, allocate the string and actually populate it. */ p = acl->acl_text = (char *)malloc(length); if (p == NULL) return (-1); count = 0; if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, - ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, acl->mode & 0700, -1); + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, + acl->mode & 0700, -1); *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, - ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, acl->mode & 0070, -1); + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, + acl->mode & 0070, -1); *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, - ARCHIVE_ENTRY_ACL_OTHER, NULL, acl->mode & 0007, -1); + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, + acl->mode & 0007, -1); count += 3; - } - if ((flags & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | - ARCHIVE_ENTRY_ACL_TYPE_NFS4)) != 0) { for (ap = acl->acl_head; ap != NULL; ap = ap->next) { - if ((ap->type & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | - ARCHIVE_ENTRY_ACL_TYPE_NFS4)) == 0) + if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) == 0) continue; r = archive_mstring_get_mbs_l( &ap->name, &name, &len, sc); if (r != 0) return (-1); - if (count > 0) - *p++ = separator; + *p++ = separator; if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) id = ap->id; else id = -1; - append_entry(&p, NULL, ap->type, ap->tag, name, + append_entry(&p, NULL, ap->tag, name, ap->permset, id); count++; } @@ -897,7 +737,7 @@ archive_acl_text_l(struct archive_acl *a id = ap->id; else id = -1; - append_entry(&p, prefix, ap->type, ap->tag, + append_entry(&p, prefix, ap->tag, name, ap->permset, id); count ++; } @@ -920,8 +760,8 @@ append_id(char **p, int id) } static void -append_entry(char **p, const char *prefix, int type, - int tag, const char *name, int perm, int id) +append_entry(char **p, const char *prefix, int tag, + const char *name, int perm, int id) { if (prefix != NULL) { strcpy(*p, prefix); @@ -931,10 +771,6 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_USER_OBJ: name = NULL; id = -1; - if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - strcpy(*p, "owner@"); - break; - } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: strcpy(*p, "user"); @@ -942,10 +778,6 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_GROUP_OBJ: name = NULL; id = -1; - if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - strcpy(*p, "group@"); - break; - } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_GROUP: strcpy(*p, "group"); @@ -960,65 +792,21 @@ append_entry(char **p, const char *prefi name = NULL; id = -1; break; - case ARCHIVE_ENTRY_ACL_EVERYONE: - strcpy(*p, "everyone@"); - name = NULL; - id = -1; - break; } *p += strlen(*p); *(*p)++ = ':'; - if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0 || - tag == ARCHIVE_ENTRY_ACL_USER || - tag == ARCHIVE_ENTRY_ACL_GROUP) { - if (name != NULL) { - strcpy(*p, name); - *p += strlen(*p); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id(p, id); - id = -1; - } - *(*p)++ = ':'; - } - *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_READ | - ARCHIVE_ENTRY_ACL_READ_DATA | - ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? 'r' : '-'; - *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE | - ARCHIVE_ENTRY_ACL_WRITE_DATA | - ARCHIVE_ENTRY_ACL_ADD_FILE)) ? 'w' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_EXECUTE) ? 'x' : '-'; - if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? 'p' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? 'd' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? 'D' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? 'a' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? 'A' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? 'R' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? 'W' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ACL) ? 'c' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ACL) ? 'C' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? 'o' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? 's' : '-'; - *(*p)++ = ':'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? 'f' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? 'd' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? 'i' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? 'n' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? 'S' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? 'F' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? 'I' : '-'; - *(*p)++ = ':'; - if (type & ARCHIVE_ENTRY_ACL_TYPE_ALLOW) - strcpy(*p, "allow"); - else if (type & ARCHIVE_ENTRY_ACL_TYPE_DENY) - strcpy(*p, "deny"); - else if (type & ARCHIVE_ENTRY_ACL_TYPE_AUDIT) - strcpy(*p, "audit"); - else if (type & ARCHIVE_ENTRY_ACL_TYPE_ALARM) - strcpy(*p, "alarm"); + if (name != NULL) { + strcpy(*p, name); *p += strlen(*p); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id(p, id); + id = -1; } + *(*p)++ = ':'; + *(*p)++ = (perm & 0444) ? 'r' : '-'; + *(*p)++ = (perm & 0222) ? 'w' : '-'; + *(*p)++ = (perm & 0111) ? 'x' : '-'; if (id != -1) { *(*p)++ = ':'; append_id(p, id); @@ -1039,19 +827,12 @@ archive_acl_parse_w(struct archive_acl * struct { const wchar_t *start; const wchar_t *end; - } field[6], name; + } field[4], name; - int numfields, fields, n; + int fields, n; int type, tag, permset, id; - int offset; wchar_t sep; - if (default_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) - numfields = 6; - else - numfields = 4; - - while (text != NULL && *text != L'\0') { /* * Parse the fields out of the next entry, @@ -1061,7 +842,7 @@ archive_acl_parse_w(struct archive_acl * do { const wchar_t *start, *end; next_field_w(&text, &start, &end, &sep); - if (fields < numfields) { + if (fields < 4) { field[fields].start = start; field[fields].end = end; } @@ -1069,148 +850,72 @@ archive_acl_parse_w(struct archive_acl * } while (sep == L':'); /* Set remaining fields to blank. */ - for (n = fields; n < numfields; ++n) + for (n = fields; n < 4; ++n) field[n].start = field[n].end = NULL; - if (default_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - /* POSIX.1e ACLs */ - /* Check for a numeric ID in field 1 or 3. */ - id = -1; - isint_w(field[1].start, field[1].end, &id); - /* Field 3 is optional. */ - if (id == -1 && fields > 3) - isint_w(field[3].start, field[3].end, &id); - - /* - * Solaris extension: "defaultuser::rwx" is the - * default ACL corresponding to "user::rwx", etc. - */ - if (field[0].end - field[0].start > 7 - && wmemcmp(field[0].start, L"default", 7) == 0) { - type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; - field[0].start += 7; - } else - type = default_type; + /* Check for a numeric ID in field 1 or 3. */ + id = -1; + isint_w(field[1].start, field[1].end, &id); + /* Field 3 is optional. */ + if (id == -1 && fields > 3) + isint_w(field[3].start, field[3].end, &id); - name.start = name.end = NULL; - if (prefix_w(field[0].start, field[0].end, L"user")) { - if (!ismode_w(field[2].start, field[2].end, - &permset)) - return (ARCHIVE_WARN); - if (id != -1 || field[1].start < field[1].end) { - tag = ARCHIVE_ENTRY_ACL_USER; - name = field[1]; - } else - tag = ARCHIVE_ENTRY_ACL_USER_OBJ; - } else if (prefix_w(field[0].start, field[0].end, - L"group")) { - if (!ismode_w(field[2].start, field[2].end, - &permset)) - return (ARCHIVE_WARN); - if (id != -1 || field[1].start < field[1].end) { - tag = ARCHIVE_ENTRY_ACL_GROUP; - name = field[1]; - } else - tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; - } else if (prefix_w(field[0].start, field[0].end, - L"other")) { - if (fields == 2 - && field[1].start < field[1].end - && ismode_w(field[1].start, field[1].end, - &permset)) { - /* This is Solaris-style "other:rwx" */ - } else if (fields == 3 - && field[1].start == field[1].end - && field[2].start < field[2].end - && ismode_w(field[2].start, field[2].end, - &permset)) { - /* This is FreeBSD-style "other::rwx" */ - } else - return (ARCHIVE_WARN); - tag = ARCHIVE_ENTRY_ACL_OTHER; - } else if (prefix_w(field[0].start, field[0].end, - L"mask")) { - if (fields == 2 - && field[1].start < field[1].end - && ismode_w(field[1].start, field[1].end, - &permset)) { - /* This is Solaris-style "mask:rwx" */ - } else if (fields == 3 - && field[1].start == field[1].end - && field[2].start < field[2].end - && ismode_w(field[2].start, field[2].end, - &permset)) { - /* This is FreeBSD-style "mask::rwx" */ - } else - return (ARCHIVE_WARN); - tag = ARCHIVE_ENTRY_ACL_MASK; - } else + /* + * Solaris extension: "defaultuser::rwx" is the + * default ACL corresponding to "user::rwx", etc. + */ + if (field[0].end - field[0].start > 7 + && wmemcmp(field[0].start, L"default", 7) == 0) { + type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; + field[0].start += 7; + } else + type = default_type; + + name.start = name.end = NULL; + if (prefix_w(field[0].start, field[0].end, L"user")) { + if (!ismode_w(field[2].start, field[2].end, &permset)) return (ARCHIVE_WARN); - } else { - /* NFSv4 ACLs */ - if (wcsncmp(field[0].start, L"user", - field[0].end - field[0].start) == 0) + if (id != -1 || field[1].start < field[1].end) { tag = ARCHIVE_ENTRY_ACL_USER; - else if (wcsncmp(field[0].start, L"group", - field[0].end - field[0].start) == 0) - tag = ARCHIVE_ENTRY_ACL_GROUP; - else if (wcsncmp(field[0].start, L"owner@", - field[0].end - field[0].start) == 0) + name = field[1]; + } else tag = ARCHIVE_ENTRY_ACL_USER_OBJ; - else if (wcsncmp(field[0].start, L"group@", - field[0].end - field[0].start) == 0) - tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; - else if (wcsncmp(field[0].start, L"everyone@", - field[0].end - field[0].start) == 0) - tag = ARCHIVE_ENTRY_ACL_EVERYONE; - else { - /* Unknown entry */ + } else if (prefix_w(field[0].start, field[0].end, L"group")) { + if (!ismode_w(field[2].start, field[2].end, &permset)) return (ARCHIVE_WARN); - } - - permset = 0; - name.start = name.end = NULL; - - if (tag == ARCHIVE_ENTRY_ACL_USER || - tag == ARCHIVE_ENTRY_ACL_GROUP) { - offset = 1; + if (id != -1 || field[1].start < field[1].end) { + tag = ARCHIVE_ENTRY_ACL_GROUP; name = field[1]; } else - offset = 0; - - if (parse_nfs4_perms_w(field[1 + offset].start, - field[1 + offset].end, &permset) != 0) { - /* NFS4 perms are invalid */ - return (ARCHIVE_WARN); - } - if (parse_nfs4_flags_w(field[2 + offset].start, - field[2 + offset].end, &permset) != 0) { - /* NFS4 flags are invalid */ + tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; + } else if (prefix_w(field[0].start, field[0].end, L"other")) { + if (fields == 2 + && field[1].start < field[1].end + && ismode_w(field[1].start, field[1].end, &permset)) { + /* This is Solaris-style "other:rwx" */ + } else if (fields == 3 + && field[1].start == field[1].end + && field[2].start < field[2].end + && ismode_w(field[2].start, field[2].end, &permset)) { + /* This is FreeBSD-style "other::rwx" */ + } else return (ARCHIVE_WARN); - } - if (wcsncmp(field[3 + offset].start, L"allow", - field[3 + offset].end - field[3 + offset].start) - == 0) - type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; - else if (wcsncmp(field[3 + offset].start, L"deny", - field[3 + offset].end - field[3 + offset].start) - == 0) - type = ARCHIVE_ENTRY_ACL_TYPE_DENY; - else if (wcsncmp(field[3 + offset].start, L"audit", - field[3 + offset].end - field[3 + offset].start) - == 0) - type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT; - else if (wcsncmp(field[3 + offset].start, L"alarm", - field[3 + offset].end - field[3 + offset].start) - == 0) - type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; - else { - /* Unknown type */ + tag = ARCHIVE_ENTRY_ACL_OTHER; + } else if (prefix_w(field[0].start, field[0].end, L"mask")) { + if (fields == 2 + && field[1].start < field[1].end + && ismode_w(field[1].start, field[1].end, &permset)) { + /* This is Solaris-style "mask:rwx" */ + } else if (fields == 3 + && field[1].start == field[1].end + && field[2].start < field[2].end + && ismode_w(field[2].start, field[2].end, &permset)) { + /* This is FreeBSD-style "mask::rwx" */ + } else return (ARCHIVE_WARN); - } - isint_w(field[4 + offset].start, field[4 + offset].end, - &id); - } + tag = ARCHIVE_ENTRY_ACL_MASK; + } else + return (ARCHIVE_WARN); /* Add entry to the internal list. */ archive_acl_add_entry_w_len(acl, type, permset, @@ -1280,78 +985,6 @@ ismode_w(const wchar_t *start, const wch return (1); } -/* Parse a wstring as a strict NFSv4 ACL permission field. */ -static int -parse_nfs4_perms_w(const wchar_t *start, const wchar_t *end, int *permset) -{ - const wchar_t *p; - int pos; - const wchar_t *letter = L"rwxpdDaARWcCos"; - const int perms[14] = { - ARCHIVE_ENTRY_ACL_READ_DATA, - ARCHIVE_ENTRY_ACL_WRITE_DATA, - ARCHIVE_ENTRY_ACL_EXECUTE, - ARCHIVE_ENTRY_ACL_APPEND_DATA, - ARCHIVE_ENTRY_ACL_DELETE, - ARCHIVE_ENTRY_ACL_DELETE_CHILD, - ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, - ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, - ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, - ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, - ARCHIVE_ENTRY_ACL_READ_ACL, - ARCHIVE_ENTRY_ACL_WRITE_ACL, - ARCHIVE_ENTRY_ACL_WRITE_OWNER, - ARCHIVE_ENTRY_ACL_SYNCHRONIZE - }; - - if (start >= end) - return (0); - p = start; - pos = 0; - while (p < end && pos < 14) { - if (*p == letter[pos]) - *permset |= perms[pos]; - else if (*p != '-') - return (-1); - p = p + sizeof(wchar_t); - pos++; - } - return (0); -} - -/* Parse a string as a strict NFSv4 ACL flags field. */ -static int -parse_nfs4_flags_w(const wchar_t *start, const wchar_t *end, int *permset) -{ - const wchar_t *p; - int pos; - const wchar_t *letter = L"fdinSFI"; - const int perms[7] = { - ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, - ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, - ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, - ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, - ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, - ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, - ARCHIVE_ENTRY_ACL_ENTRY_INHERITED - }; - - if (start >= end) - return (0); - p = start; - pos = 0; - while (p < end && pos < 7) { - if (*p == letter[pos]) - *permset |= perms[pos]; - else if (*p != '-') - return (-1); - p = p + sizeof(wchar_t); - pos++; - } - return (0); -} - - /* * Match "[:whitespace:]*(.*)[:whitespace:]*[:,\n]". *wp is updated * to point to just after the separator. *start points to the first @@ -1424,18 +1057,12 @@ archive_acl_parse_l(struct archive_acl * struct { const char *start; const char *end; - } field[6], name; + } field[4], name; - int numfields, fields, n, r, ret = ARCHIVE_OK; + int fields, n, r, ret = ARCHIVE_OK; int type, tag, permset, id; - int offset; char sep; - if (default_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) - numfields = 6; - else - numfields = 4; - while (text != NULL && *text != '\0') { /* * Parse the fields out of the next entry, @@ -1445,7 +1072,7 @@ archive_acl_parse_l(struct archive_acl * do { const char *start, *end; next_field(&text, &start, &end, &sep); - if (fields < numfields) { + if (fields < 4) { field[fields].start = start; field[fields].end = end; } @@ -1453,148 +1080,72 @@ archive_acl_parse_l(struct archive_acl * } while (sep == ':'); /* Set remaining fields to blank. */ - for (n = fields; n < numfields; ++n) + for (n = fields; n < 4; ++n) field[n].start = field[n].end = NULL; - if (default_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - /* POSIX.1e ACLs */ - /* Check for a numeric ID in field 1 or 3. */ - id = -1; - isint(field[1].start, field[1].end, &id); - /* Field 3 is optional. */ - if (id == -1 && fields > 3) - isint(field[3].start, field[3].end, &id); - - /* - * Solaris extension: "defaultuser::rwx" is the - * default ACL corresponding to "user::rwx", etc. - */ - if (field[0].end - field[0].start > 7 - && memcmp(field[0].start, "default", 7) == 0) { - type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; - field[0].start += 7; - } else - type = default_type; + /* Check for a numeric ID in field 1 or 3. */ + id = -1; + isint(field[1].start, field[1].end, &id); + /* Field 3 is optional. */ + if (id == -1 && fields > 3) + isint(field[3].start, field[3].end, &id); - name.start = name.end = NULL; - if (prefix_c(field[0].start, field[0].end, "user")) { - if (!ismode(field[2].start, field[2].end, - &permset)) - return (ARCHIVE_WARN); - if (id != -1 || field[1].start < field[1].end) { - tag = ARCHIVE_ENTRY_ACL_USER; - name = field[1]; - } else - tag = ARCHIVE_ENTRY_ACL_USER_OBJ; - } else if (prefix_c(field[0].start, field[0].end, - "group")) { - if (!ismode(field[2].start, field[2].end, - &permset)) - return (ARCHIVE_WARN); - if (id != -1 || field[1].start < field[1].end) { - tag = ARCHIVE_ENTRY_ACL_GROUP; - name = field[1]; - } else - tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; - } else if (prefix_c(field[0].start, field[0].end, - "other")) { - if (fields == 2 - && field[1].start < field[1].end - && ismode(field[1].start, field[1].end, - &permset)) { - /* This is Solaris-style "other:rwx" */ - } else if (fields == 3 - && field[1].start == field[1].end - && field[2].start < field[2].end - && ismode(field[2].start, field[2].end, - &permset)) { - /* This is FreeBSD-style "other::rwx" */ - } else - return (ARCHIVE_WARN); - tag = ARCHIVE_ENTRY_ACL_OTHER; - } else if (prefix_c(field[0].start, field[0].end, - "mask")) { - if (fields == 2 - && field[1].start < field[1].end - && ismode(field[1].start, field[1].end, - &permset)) { - /* This is Solaris-style "mask:rwx" */ - } else if (fields == 3 - && field[1].start == field[1].end - && field[2].start < field[2].end - && ismode(field[2].start, field[2].end, - &permset)) { - /* This is FreeBSD-style "mask::rwx" */ - } else - return (ARCHIVE_WARN); - tag = ARCHIVE_ENTRY_ACL_MASK; - } else + /* + * Solaris extension: "defaultuser::rwx" is the + * default ACL corresponding to "user::rwx", etc. + */ + if (field[0].end - field[0].start > 7 + && memcmp(field[0].start, "default", 7) == 0) { + type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; + field[0].start += 7; + } else + type = default_type; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 29 06:54: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 9539DBC75AD; Mon, 29 Aug 2016 06:54:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 566701DB; Mon, 29 Aug 2016 06:54:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7T6sd2M084166; Mon, 29 Aug 2016 06:54:39 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T6sdDe084161; Mon, 29 Aug 2016 06:54:39 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201608290654.u7T6sdDe084161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 29 Aug 2016 06:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304989 - in head/contrib/libarchive: libarchive tar 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.22 Precedence: list List-Id: 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, 29 Aug 2016 06:54:40 -0000 Author: mm Date: Mon Aug 29 06:54:38 2016 New Revision: 304989 URL: https://svnweb.freebsd.org/changeset/base/304989 Log: Redo MFV r304866: Sync libarchive with vendor including security fixes Vendor issues fixed: Issue #731: Reject tar entries >= INT64_MAX Issue #744 (part of Issue #743): Enforce sandbox with very long pathnames Issue #748: Zip decompression failure with highly-compressed data Issue #767: Buffer overflow printing a filename Issue #770: Zip read: be more careful about extra_length MFC after: 3 days Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/tar/util.c Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/tar/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Mon Aug 29 06:50:45 2016 (r304988) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Mon Aug 29 06:54:38 2016 (r304989) @@ -1128,8 +1128,15 @@ header_common(struct archive_read *a, st if (tar->entry_bytes_remaining < 0) { tar->entry_bytes_remaining = 0; archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Tar entry has negative size?"); - err = ARCHIVE_WARN; + "Tar entry has negative size"); + return (ARCHIVE_FATAL); + } + if (tar->entry_bytes_remaining == INT64_MAX) { + /* Note: tar_atol returns INT64_MAX on overflow */ + tar->entry_bytes_remaining = 0; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Tar entry size overflow"); + return (ARCHIVE_FATAL); } tar->realsize = tar->entry_bytes_remaining; archive_entry_set_size(entry, tar->entry_bytes_remaining); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Mon Aug 29 06:50:45 2016 (r304988) +++ head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Mon Aug 29 06:54:38 2016 (r304989) @@ -418,18 +418,30 @@ zip_time(const char *p) * id1+size1+data1 + id2+size2+data2 ... * triplets. id and size are 2 bytes each. */ -static void -process_extra(const char *p, size_t extra_length, struct zip_entry* zip_entry) +static int +process_extra(struct archive_read *a, const char *p, size_t extra_length, struct zip_entry* zip_entry) { unsigned offset = 0; - while (offset < extra_length - 4) { + if (extra_length == 0) { + return ARCHIVE_OK; + } + + if (extra_length < 4) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Too-small extra data: Need at least 4 bytes, but only found %d bytes", (int)extra_length); + return ARCHIVE_FAILED; + } + while (offset <= extra_length - 4) { unsigned short headerid = archive_le16dec(p + offset); unsigned short datasize = archive_le16dec(p + offset + 2); offset += 4; if (offset + datasize > extra_length) { - break; + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Extra data overflow: Need %d bytes but only found %d bytes", + (int)datasize, (int)(extra_length - offset)); + return ARCHIVE_FAILED; } #ifdef DEBUG fprintf(stderr, "Header id 0x%04x, length %d\n", @@ -715,13 +727,13 @@ process_extra(const char *p, size_t extr } offset += datasize; } -#ifdef DEBUG - if (offset != extra_length) - { - fprintf(stderr, - "Extra data field contents do not match reported size!\n"); + if (offset != extra_length) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Malformed extra data: Consumed %d bytes of %d bytes", + (int)offset, (int)extra_length); + return ARCHIVE_FAILED; } -#endif + return ARCHIVE_OK; } /* @@ -840,7 +852,9 @@ zip_read_local_file_header(struct archiv return (ARCHIVE_FATAL); } - process_extra(h, extra_length, zip_entry); + if (ARCHIVE_OK != process_extra(a, h, extra_length, zip_entry)) { + return ARCHIVE_FATAL; + } __archive_read_consume(a, extra_length); /* Work around a bug in Info-Zip: When reading from a pipe, it @@ -1293,7 +1307,7 @@ zip_read_data_deflate(struct archive_rea && bytes_avail > zip->entry_bytes_remaining) { bytes_avail = (ssize_t)zip->entry_bytes_remaining; } - if (bytes_avail <= 0) { + if (bytes_avail < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Truncated ZIP file body"); return (ARCHIVE_FATAL); @@ -2691,7 +2705,9 @@ slurp_central_directory(struct archive_r "Truncated ZIP file header"); return ARCHIVE_FATAL; } - process_extra(p + filename_length, extra_length, zip_entry); + if (ARCHIVE_OK != process_extra(a, p + filename_length, extra_length, zip_entry)) { + return ARCHIVE_FATAL; + } /* * Mac resource fork files are stored under the Modified: head/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_acl.c Mon Aug 29 06:50:45 2016 (r304988) +++ head/contrib/libarchive/libarchive/archive_write_disk_acl.c Mon Aug 29 06:54:38 2016 (r304989) @@ -138,6 +138,7 @@ set_acl(struct archive *a, int fd, const acl_permset_t acl_permset; #ifdef ACL_TYPE_NFS4 acl_flagset_t acl_flagset; + int r; #endif int ret; int ae_type, ae_permset, ae_tag, ae_id; @@ -145,7 +146,7 @@ set_acl(struct archive *a, int fd, const gid_t ae_gid; const char *ae_name; int entries; - int i, r; + int i; ret = ARCHIVE_OK; entries = archive_acl_reset(abstract_acl, ae_requested_type); Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Mon Aug 29 06:50:45 2016 (r304988) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Mon Aug 29 06:54:38 2016 (r304989) @@ -2401,8 +2401,18 @@ check_symlinks(struct archive_write_disk r = lstat(a->name, &st); if (r != 0) { /* We've hit a dir that doesn't exist; stop now. */ - if (errno == ENOENT) + if (errno == ENOENT) { break; + } else { + /* Note: This effectively disables deep directory + * support when security checks are enabled. + * Otherwise, very long pathnames that trigger + * an error here could evade the sandbox. + * TODO: We could do better, but it would probably + * require merging the symlink checks with the + * deep-directory editing. */ + return (ARCHIVE_FAILED); + } } else if (S_ISLNK(st.st_mode)) { if (c == '\0') { /* Modified: head/contrib/libarchive/tar/util.c ============================================================================== --- head/contrib/libarchive/tar/util.c Mon Aug 29 06:50:45 2016 (r304988) +++ head/contrib/libarchive/tar/util.c Mon Aug 29 06:54:38 2016 (r304989) @@ -182,7 +182,7 @@ safe_fprintf(FILE *f, const char *fmt, . } /* If our output buffer is full, dump it and keep going. */ - if (i > (sizeof(outbuff) - 20)) { + if (i > (sizeof(outbuff) - 128)) { outbuff[i] = '\0'; fprintf(f, "%s", outbuff); i = 0; From owner-svn-src-head@freebsd.org Mon Aug 29 06:58: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 53DBFBC762A; Mon, 29 Aug 2016 06:58:19 +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 DFC6939F; Mon, 29 Aug 2016 06:58:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7T6wDSL054674 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 29 Aug 2016 09:58:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7T6wDSL054674 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7T6wD7b054673; Mon, 29 Aug 2016 09:58:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Aug 2016 09:58:13 +0300 From: Konstantin Belousov To: John Baldwin Cc: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Message-ID: <20160829065813.GP83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> <1595604.93PBdSz0kX@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1595604.93PBdSz0kX@ralph.baldwin.cx> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 29 Aug 2016 06:58:19 -0000 On Sun, Aug 28, 2016 at 04:09:51PM -0700, John Baldwin wrote: > OTOH, given that we explicitly documented it as not being true, I suspect > any applications that are using ptrace() are going off the documentation, not > the implementation artifact. Note that Linux's ptrace() documents the same > requirement as before this change (caller is required to clear errno), so I > doubt there is any actual software out there that expects the > FreeBSD-specific behavior. Given that and the extra maintenance overhead of > having to dink with errno in assembly on X architectures, I'd rather we keep > the old language in the manpage and remove the 'errno' frobbing in the system > call wrappers. To be honest, my first response to this commit was one of > surprise that we modify errno directly as that is inconsistent with other > system calls. (I haven't looked to see if any other system call wrappers > modify errno for non-error cases.) The problematic calls are PT_PEEK_I and PT_PEEK_D, as far as I understand. I dug into the ptrace(2) consumers, I found a lot of things using it which I would not expect to use, besides usual suspects of gdb lldb libunwind reptyr etc. Most surprising was that even high-profile consumers including gdb sometimes fail to check errno after PT_PEEK. On the other hand, I did not found a case in gdb where errno is checked after PT_PEEK but not zeroed before the syscall. I almost agreed with you after the reading, but then I decided to look into glibc just in case. What I found there is really fascinating. >From glibc/sysdeps/unix/sysv/linux: res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data); if (res >= 0 && request > 0 && request < 4) { __set_errno (0); return ret; } #define PTRACE_PEEKTEXT 1 #define PTRACE_PEEKDATA 2 #define PTRACE_PEEKUSR 3 In the end, I might consider changing the ptrace wrappers into consolidated C source, it would look like that int ptrace(int request, pid_t pid, caddr_t addr, int data) { errno = 0; return (__sys_ptrace(request, pid, addr, data)); } From owner-svn-src-head@freebsd.org Mon Aug 29 07:03: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 78EE1BC77D1; Mon, 29 Aug 2016 07:03:47 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ua0-x22a.google.com (mail-ua0-x22a.google.com [IPv6:2607:f8b0:400c:c08::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 2458DA42; Mon, 29 Aug 2016 07:03:47 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ua0-x22a.google.com with SMTP id m60so190642032uam.3; Mon, 29 Aug 2016 00:03:47 -0700 (PDT) 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; bh=Z7eu9MAVYe3rAMGj4UXXJdkCd8wuk31CWcUQJ42JpZw=; b=Z44xBWyA074ndzlMQb9Iya5P7ZK+b36rM+Dtxa5fg1+A6H5IvNvMXaFOqZHrp5eoDb KVOSKSxrxx8tamN6x5B7A9QYbJHXBAsqmsT3/cAC1z/c8ZGT4U4jjfh/yqaAQJ3UFMLN APtB+r2uIbgU+SFeF1I3v9JyivaruqqX4citVfhAeKard2IIL9iV6nhOyXmEjvQko7jb XxRFSzaA/ilIJXRGiMuPMZpd19vPRjTFIZE3fQwj/TD3IQowStDQlqNPSKKuFdtzS6At XtS4LQ62W5L6UwIahiTHEnVcs6zix8gYA9TZn+zd+fwYaxasHlH1yRwFuc/2ewRsVlyr SrSQ== 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; bh=Z7eu9MAVYe3rAMGj4UXXJdkCd8wuk31CWcUQJ42JpZw=; b=cHJh72mPA5vhwYdhAiJ46EJ0adtBZ2ZNc/xeZH0jWJK4GSZrfep4Ry5tps+NN/QB7I t1o1nR4VLOln0Muh6BnZVuQI7KO5MXDbHQ5oMysldzhK241bX8irUTuXUrmPhYqOFWPk plnj+Ve/Kvh5FXVXhNjw9FWG4t0UKp8P/fpwUal3L6OJrGk8FXuznYlm2IJGL1Qiu6i5 XKXyzmbO0KsvOFb162XwOr1uFNuOHUj14Y9zn80fVGErevD4Npdm0hlNUYGgp4svHmcN Twwboajo/nCR0/jHA5+B6mfKM8pjdDYdAMHVzfNiu4JMhoMUQmunJ2JgOLDsIZiuFiyO ptfA== X-Gm-Message-State: AE9vXwOEkpGNO4ZOEBFwI96Ofq93+3diI9E6fUA4jC4qlkh3IVXSDbDBwBBymBqKnU78orCL0iH8s3ieUTMoPg== X-Received: by 10.159.40.133 with SMTP id d5mr8968590uad.55.1472454226121; Mon, 29 Aug 2016 00:03:46 -0700 (PDT) MIME-Version: 1.0 Sender: crodr001@gmail.com Received: by 10.103.31.134 with HTTP; Mon, 29 Aug 2016 00:03:45 -0700 (PDT) In-Reply-To: <201608262023.u7QKNAAE081271@repo.freebsd.org> References: <201608262023.u7QKNAAE081271@repo.freebsd.org> From: Craig Rodrigues Date: Mon, 29 Aug 2016 00:03:45 -0700 X-Google-Sender-Auth: FTgR_amGs9DbWgry4WViK7XlRoI Message-ID: Subject: Re: svn commit: r304860 - in head: include lib/libc/gen To: Ed Schouten Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "jenkins-admin@freebsd.org" , "freebsd-testing@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 07:03:47 -0000 On Fri, Aug 26, 2016 at 1:23 PM, Ed Schouten wrote: > Author: ed > Date: Fri Aug 26 20:23:10 2016 > New Revision: 304860 > URL: https://svnweb.freebsd.org/changeset/base/304860 > > Log: > Improve compatibility of calls to dirname() on constant strings. > Ed, I think one of the dirname related tests is failing after this change. Can you take a look: https://jenkins.freebsd.org/job/FreeBSD_HEAD/561/ -- Craig From owner-svn-src-head@freebsd.org Mon Aug 29 07:06: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 45431BC7835; Mon, 29 Aug 2016 07:06:21 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ua0-x232.google.com (mail-ua0-x232.google.com [IPv6:2607:f8b0:400c:c08::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 F1D6ABF4; Mon, 29 Aug 2016 07:06:20 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ua0-x232.google.com with SMTP id l94so168025402ual.0; Mon, 29 Aug 2016 00:06:20 -0700 (PDT) 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; bh=o110dyG1GeRJsnUoe999lcRVsSpeDiHMTqeWi1pXEDs=; b=BQWSgJr5WbZQ4mUo8n0OuBmviRO1MD2h0NzTQtChxG3SbHNotujslRwYEgmSTcmdUB o746WrBGtA3W1g4Tot6i4QbfEw+WxRvqINLr4YNJhp5mWAfmyErYoiblmLteP6QGXJPe so+Rz146CUEYcr/NPgD1Hzf7BkbTL47klmft4bMvQk022oCw+4kUvjqLUdMIzgDFGenf OJYsdhkf0jSP2aNZCsE+CNYLvs3hsE6sBKiagcWVHQc88kU2lt45a63csWEZOzeXad2E HAfv0/6QPUQlHU3eoc7wd8uzhJGzLEr390jNUEVNMsN3P8tov2o1ukWEYoGMTM5y1y5S XgFQ== 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; bh=o110dyG1GeRJsnUoe999lcRVsSpeDiHMTqeWi1pXEDs=; b=AygJup9TmbiPrOK3NPuzDH69h2yLkGpnfyJQfucaZcc6nl1nbB/iN3yWViRYA0DD5W dvWkH81Wt7qZSDNTEoHkFhtK6FlekTz2C9MMg/ePk2au7mkizlgWHgsWNoFeFMOUUjb+ iANX/FjE4/AqvydpWpQGFhv6SvkkjQhmS8C5m+0MU8IlCoq4mGH+T5Dk5pC6IA0zz6xK vdlthBMCiCb+Ys18WboNfi5hqEsfow8qhOqtmGJqVtzfN9O+KHBPgBoo4j3ODmyVZxyQ kRjHb7DNzXtn50c8oTclKcu6JRLDxA4G7q9VCKKOMk0qFXKsdHKoDAsQ0zK/mgAVNRgo xMvA== X-Gm-Message-State: AE9vXwOocPqnLX4iDhpLkNG4ciAFwedeBgGWfHxO0WJnDXmFCsW6jk1R7r93iHvjC7MhA4H53Ddi4XEuH2a57Q== X-Received: by 10.176.82.196 with SMTP id w4mr4180193uaw.119.1472454379939; Mon, 29 Aug 2016 00:06:19 -0700 (PDT) MIME-Version: 1.0 Sender: crodr001@gmail.com Received: by 10.103.31.134 with HTTP; Mon, 29 Aug 2016 00:06:19 -0700 (PDT) In-Reply-To: <201608262023.u7QKNAAE081271@repo.freebsd.org> References: <201608262023.u7QKNAAE081271@repo.freebsd.org> From: Craig Rodrigues Date: Mon, 29 Aug 2016 00:06:19 -0700 X-Google-Sender-Auth: 0r66Yu80t0UQCyF3YOM9KchqYG4 Message-ID: Subject: Re: svn commit: r304860 - in head: include lib/libc/gen To: Ed Schouten 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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 07:06:21 -0000 [Resending from right e-mail address] On Fri, Aug 26, 2016 at 1:23 PM, Ed Schouten wrote: > Author: ed > Date: Fri Aug 26 20:23:10 2016 > New Revision: 304860 > URL: https://svnweb.freebsd.org/changeset/base/304860 > > Log: > Improve compatibility of calls to dirname() on constant strings. > Ed, I think one of the dirname related tests is failing after this change. Can you take a look: https://jenkins.freebsd.org/job/FreeBSD_HEAD/561/ -- Craig From owner-svn-src-head@freebsd.org Mon Aug 29 07:07: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 AA3D4BC788C; Mon, 29 Aug 2016 07:07:24 +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 4FFE0D62; Mon, 29 Aug 2016 07:07:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7T77F68057044 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 29 Aug 2016 10:07:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7T77F68057044 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7T77Ffd057043; Mon, 29 Aug 2016 10:07:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Aug 2016 10:07:15 +0300 From: Konstantin Belousov To: John Baldwin Cc: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Message-ID: <20160829070715.GQ83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160829065813.GP83214@kib.kiev.ua> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 29 Aug 2016 07:07:24 -0000 On Mon, Aug 29, 2016 at 09:58:13AM +0300, Konstantin Belousov wrote: > On Sun, Aug 28, 2016 at 04:09:51PM -0700, John Baldwin wrote: > > OTOH, given that we explicitly documented it as not being true, I suspect > > any applications that are using ptrace() are going off the documentation, not > > the implementation artifact. Note that Linux's ptrace() documents the same > > requirement as before this change (caller is required to clear errno), so I > > doubt there is any actual software out there that expects the > > FreeBSD-specific behavior. Given that and the extra maintenance overhead of > > having to dink with errno in assembly on X architectures, I'd rather we keep > > the old language in the manpage and remove the 'errno' frobbing in the system > > call wrappers. To be honest, my first response to this commit was one of > > surprise that we modify errno directly as that is inconsistent with other > > system calls. (I haven't looked to see if any other system call wrappers > > modify errno for non-error cases.) > > The problematic calls are PT_PEEK_I and PT_PEEK_D, as far as I understand. > > I dug into the ptrace(2) consumers, I found a lot of things using > it which I would not expect to use, besides usual suspects of gdb > lldb libunwind reptyr etc. Most surprising was that even high-profile > consumers including gdb sometimes fail to check errno after PT_PEEK. On > the other hand, I did not found a case in gdb where errno is checked > after PT_PEEK but not zeroed before the syscall. > > I almost agreed with you after the reading, but then I decided to look > into glibc just in case. What I found there is really fascinating. > From glibc/sysdeps/unix/sysv/linux: > res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data); > if (res >= 0 && request > 0 && request < 4) > { > __set_errno (0); > return ret; > } > #define PTRACE_PEEKTEXT 1 > #define PTRACE_PEEKDATA 2 > #define PTRACE_PEEKUSR 3 > > In the end, I might consider changing the ptrace wrappers into > consolidated C source, it would look like that > > int > ptrace(int request, pid_t pid, caddr_t addr, int data) > { > > errno = 0; > return (__sys_ptrace(request, pid, addr, data)); > } And Solaris libc, where ptrace() is the wrapper around procfs, starts its implementation this way: usr/src/lib/libc/i386/sys/ptrace.c /* * Process the request. */ errno = 0; switch (request) { case 1: /* PTRACE_PEEKTEXT */ case 2: /* PTRACE_PEEKDATA */ From owner-svn-src-head@freebsd.org Mon Aug 29 07:08: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 06C4BBC78E6; Mon, 29 Aug 2016 07:08:33 +0000 (UTC) (envelope-from yaneurabeya@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 C7C00EC2; Mon, 29 Aug 2016 07:08:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id p64so49124253pfb.1; Mon, 29 Aug 2016 00:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=5Vwejfhhg0IjbJeSeS049vcO9jo3qMjAS1FPanbVhbE=; b=0np3zypy5tbYHqmdA9bhR8Xv8QEcTXgsKkPSbQNgaQD4t0VtK6NHEbOxOeyr1J6YuB HJH92ampv6i7eB7MhsKvVH/s23lVdeesffqG7M3U4sz2/e3OS4R+9qJPOdv53/zrPMww bc91krTqmKpacrVgXHXMQ1SC0IzjySeKTdFUNLkTlKwOFtFl5kR6X7AEKqEESILo1OCs zL77QQpOR/WTE/8orr7xJ+QEcLZwhK8+597MZh95UtlNCVzca8yjQN2ON0txYYO9lH7/ /ffu9Jela/is2y9ihfnLFhUiStV5V6vpHil50e/ufHcpdWIu3fNFt4IFhXGgp+1+gUX2 3Ajg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=5Vwejfhhg0IjbJeSeS049vcO9jo3qMjAS1FPanbVhbE=; b=bzUxowZ6WF94HcPX59meL9vptG+ZUsfMn8sbqauuF2IKXdwaIu632SLtY7rGZAjrJr HowBtX0G1jDelEQ5fXfZKKiBIBY80YCgpDgLtIu5uR2xNZG9SrkAa+zLgivdSJVPnUTt CIhtyqFpQ2PncgizfFuVXtD+YdPpvp11x000zxU9FWgbJ2oZqGWqOr3IhCSyTMfNPFcb whmUcmYUnFTLx++Z9EEuR7sEnI+d5FcxrYFi47HI3RoVefiDKyXOfsjnYK4Ci+sTj+BJ 7ldA0Xo4h3289qDloSlCI6SLjt/jpL+kXgbm9LH1wXX0XHAg01stbYyqm8NQyziSNBGZ uGug== X-Gm-Message-State: AE9vXwPy7Pe99nXqCdLUVEzmQQG8QOXnmZHmzQCIGPGnL5VrF0LWruNTNPYBONBNDSzCwA== X-Received: by 10.98.213.130 with SMTP id d124mr30415281pfg.118.1472454511021; Mon, 29 Aug 2016 00:08:31 -0700 (PDT) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s89sm46225997pfi.83.2016.08.29.00.08.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Aug 2016 00:08:29 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304860 - in head: include lib/libc/gen From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Mon, 29 Aug 2016 00:08:26 -0700 Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <1D5D9E39-5BCD-4C5D-B25B-D5DD969FF75D@gmail.com> References: <201608262023.u7QKNAAE081271@repo.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.3124) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 07:08:33 -0000 > On Aug 29, 2016, at 12:06 AM, Craig Rodrigues = wrote: >=20 > [Resending from right e-mail address] >=20 > On Fri, Aug 26, 2016 at 1:23 PM, Ed Schouten > wrote: > Author: ed > Date: Fri Aug 26 20:23:10 2016 > New Revision: 304860 > URL: https://svnweb.freebsd.org/changeset/base/304860 = >=20 > Log: > Improve compatibility of calls to dirname() on constant strings. >=20 > Ed, >=20 > I think one of the dirname related tests is failing after this change. > Can you take a look: >=20 > https://jenkins.freebsd.org/job/FreeBSD_HEAD/561/ = I already filed a bug for this: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212193 = . I=E2=80=99m= going to mark this as a failure soon to mute the noise. Thanks, -Ngie= From owner-svn-src-head@freebsd.org Mon Aug 29 07:48: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 DB2BFB77100; Mon, 29 Aug 2016 07:48:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC2AE1F7; Mon, 29 Aug 2016 07:48:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7T7mZos003131; Mon, 29 Aug 2016 07:48:35 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7T7mZMW003129; Mon, 29 Aug 2016 07:48:35 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608290748.u7T7mZMW003129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 29 Aug 2016 07:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304991 - in head/sys/modules: cloudabi32 cloudabi64 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.22 Precedence: list List-Id: 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, 29 Aug 2016 07:48:37 -0000 Author: ed Date: Mon Aug 29 07:48:35 2016 New Revision: 304991 URL: https://svnweb.freebsd.org/changeset/base/304991 Log: Use both the MACHINE and MACHINE_CPUARCH directories for finding sources. When fixing this module to build on PC98, I actually broke the build on ARM64. On PC98 we need to pull in the sources from the MACHINE_CPUARCH (i386), but on ARM64 we need to use the MACHINE, as MACHINE_CPUARCH is set to aarch64 instead of just arm64. Modified: head/sys/modules/cloudabi32/Makefile head/sys/modules/cloudabi64/Makefile Modified: head/sys/modules/cloudabi32/Makefile ============================================================================== --- head/sys/modules/cloudabi32/Makefile Mon Aug 29 07:46:23 2016 (r304990) +++ head/sys/modules/cloudabi32/Makefile Mon Aug 29 07:48:35 2016 (r304991) @@ -4,6 +4,7 @@ SYSDIR?=${.CURDIR}/../.. .PATH: ${SYSDIR}/compat/cloudabi32 .PATH: ${SYSDIR}/${MACHINE_CPUARCH}/cloudabi32 +.PATH: ${SYSDIR}/${MACHINE}/cloudabi32 KMOD= cloudabi32 SRCS= cloudabi32_fd.c cloudabi32_module.c cloudabi32_poll.c \ Modified: head/sys/modules/cloudabi64/Makefile ============================================================================== --- head/sys/modules/cloudabi64/Makefile Mon Aug 29 07:46:23 2016 (r304990) +++ head/sys/modules/cloudabi64/Makefile Mon Aug 29 07:48:35 2016 (r304991) @@ -4,6 +4,7 @@ SYSDIR?=${.CURDIR}/../.. .PATH: ${SYSDIR}/compat/cloudabi64 .PATH: ${SYSDIR}/${MACHINE_CPUARCH}/cloudabi64 +.PATH: ${SYSDIR}/${MACHINE}/cloudabi64 KMOD= cloudabi64 SRCS= cloudabi64_fd.c cloudabi64_module.c cloudabi64_poll.c \ From owner-svn-src-head@freebsd.org Mon Aug 29 07:55: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 95175B772A4; Mon, 29 Aug 2016 07:55:29 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ua0-x22f.google.com (mail-ua0-x22f.google.com [IPv6:2607:f8b0:400c:c08::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 48301847; Mon, 29 Aug 2016 07:55:29 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ua0-x22f.google.com with SMTP id l94so169612661ual.0; Mon, 29 Aug 2016 00:55:29 -0700 (PDT) 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; bh=IRQ59wpxemAPwzw9gekb8FyyGzfWsn4nj/UpRKWu/b8=; b=lHEj01d8nZUR874ULdcoV+39rCIIvPM64Hx2YX2KTbeXYozxSJKguVW2GV1w1EFXC+ dm62MCPk9DpKPrInCiqjXASvdg+Yk6LffJrSYaGb2W74npugsST/XhWSSGcpqvNAhrpa wKmKYgC3h4aSsiruUcHkcT2FNM+GDYEA2XcBTiBlEvPSmbzvyJ+Up1VwWCxhCD2wQUaO /j8U1XnoagH4Q6QJ/kOaBphm872fekDbNUIXaw5u5vv+rjV087SLlVi+cLkmTtf5q23s sZQ0fT4Zaa5MoUFi5G4m2+ryniwqdVqNqcXC3F4X7UcuKtlh85wwC9+e8wF6bQ+ovtwr fhUQ== 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; bh=IRQ59wpxemAPwzw9gekb8FyyGzfWsn4nj/UpRKWu/b8=; b=JDZwnEetNv2DgInwV1xJ1jGjp4amzt1BkgbsiBVFQnYTT+ppXSEu1CzEs+mb6/JI+h GObr0bX+MAD2f4Xcqs8zz74PvX0RKV5MGPNlh7rzr5IsJLwQg9l9iiiVwYVq6WKBArSp EkVQuyFGiwF/bBIhTSgXOTzibHKpras/8xdNmUJaOKsNXuKOoigmAYXWelb42W+5mG/K 0Cpe/qc8zKqCGs63j5JgINoNWNHIR4GvNzocYGkErL8vaQwoXIaHBBW5r4N+PMUG4rSE 6Q23HrND1giYCSZmbtKVYINl4+vMo81Trwdc1QLgkW4xRBYik9L/f5sqxdJtYfq7bz3Y 9ptg== X-Gm-Message-State: AE9vXwN0lPvgwTv9lKR+lwNcT8pNR33GOPU5iZMB7NSdfsg1KMnJRmc2TD9Vswb/vEtYfoA8i9Wvoh2ZcS2dQA== X-Received: by 10.31.64.196 with SMTP id n187mr8645506vka.150.1472457328242; Mon, 29 Aug 2016 00:55:28 -0700 (PDT) MIME-Version: 1.0 Sender: crodr001@gmail.com Received: by 10.103.31.134 with HTTP; Mon, 29 Aug 2016 00:55:27 -0700 (PDT) In-Reply-To: <1D5D9E39-5BCD-4C5D-B25B-D5DD969FF75D@gmail.com> References: <201608262023.u7QKNAAE081271@repo.freebsd.org> <1D5D9E39-5BCD-4C5D-B25B-D5DD969FF75D@gmail.com> From: Craig Rodrigues Date: Mon, 29 Aug 2016 00:55:27 -0700 X-Google-Sender-Auth: hF5ZSexntvrotpULJ_lUtzvgTuA Message-ID: Subject: Re: svn commit: r304860 - in head: include lib/libc/gen To: "Ngie Cooper (yaneurabeya)" Cc: Ed Schouten , "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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 07:55:29 -0000 On Mon, Aug 29, 2016 at 12:08 AM, Ngie Cooper (yaneurabeya) < yaneurabeya@gmail.com> wrote: > > > I already filed a bug for this: https://bugs.freebsd.org > /bugzilla/show_bug.cgi?id=3D212193 . I=E2=80=99m going to mark this as a = failure > soon to mute the noise. > Thanks, > -Ngie > Thanks. That will be helpful. -- Craig From owner-svn-src-head@freebsd.org Mon Aug 29 13:07: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 E2693BC7468; Mon, 29 Aug 2016 13:07:22 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BE7CCA40; Mon, 29 Aug 2016 13:07:22 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TD7L7J025653; Mon, 29 Aug 2016 13:07:21 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TD7L6H025649; Mon, 29 Aug 2016 13:07:21 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608291307.u7TD7L6H025649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Aug 2016 13:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305004 - in head/sys: amd64/amd64 amd64/include i386/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.22 Precedence: list List-Id: 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, 29 Aug 2016 13:07:23 -0000 Author: bde Date: Mon Aug 29 13:07:21 2016 New Revision: 305004 URL: https://svnweb.freebsd.org/changeset/base/305004 Log: On amd64, declare sse2_pagezero() and start using it again, but only for zeroing pages in idle where nontemporal writes are clearly best. This is almost a no-op since zeroing in idle works does nothing good and is off by default. Fix END() statement forgotten in previous commit. Align the loop in sse2_pagezero(). Since it writes to main memory, the loop doesn't have to be very carefully written to keep up. Unrolling it was considered useless or harmful and was not done on i386, but that was too careless. Timing for i386: the loop was not unrolled at all, and moved only 4 bytes/iteration. So on a 2GHz CPU, it needed to run at 2 cycles/ iteration to keep up with a memory speed of just 4GB/sec. But when it crossed a 16-byte boundary, on old CPUs it ran at 3 cycles/ iteration so it gave a maximum speed of 2.67GB/sec and couldn't even keep up with PC3200 memory. Fix the alignment so that it keep up with 4GB/sec memory, and unroll once to get nearer to 8GB/sec. Further unrolling might be useless or harmful since it would prevent the loop fitting in 16-bytes. My test system with an old CPU and old DDR1 only needed 5+ GB/sec. My test system with a new CPU and DDR3 doesn't need any changes to keep up ~16GB/sec. Timing for amd64: with 8-byte accesses and newer faster CPUs it is easy to reach 16GB/sec but not so easy to go much faster. The alignment doesn't matter much if the CPU is not very old. The loop was already unrolled 4 times, but needs 32 bytes and uses a fancy method that doesn't work for 2-way unrolling in 16 bytes. Just align it to 32-bytes. Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/support.S head/sys/amd64/include/md_var.h head/sys/i386/i386/support.s Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Aug 29 12:57:28 2016 (r305003) +++ head/sys/amd64/amd64/pmap.c Mon Aug 29 13:07:21 2016 (r305004) @@ -5192,7 +5192,7 @@ pmap_zero_page_idle(vm_page_t m) { vm_offset_t va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - pagezero((void *)va); + sse2_pagezero((void *)va); } /* Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Mon Aug 29 12:57:28 2016 (r305003) +++ head/sys/amd64/amd64/support.S Mon Aug 29 13:07:21 2016 (r305004) @@ -78,6 +78,12 @@ ENTRY(sse2_pagezero) movq $-PAGE_SIZE,%rdx subq %rdx,%rdi xorl %eax,%eax + jmp 1f + /* + * The loop takes 29 bytes. Ensure that it doesn't cross a 32-byte + * cache line. + */ + .p2align 5,0x90 1: movnti %rax,(%rdi,%rdx) movnti %rax,8(%rdi,%rdx) @@ -88,7 +94,7 @@ ENTRY(sse2_pagezero) sfence POP_FRAME_POINTER ret -END(pagezero) +END(sse2_pagezero) ENTRY(bcmp) PUSH_FRAME_POINTER Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Mon Aug 29 12:57:28 2016 (r305003) +++ head/sys/amd64/include/md_var.h Mon Aug 29 13:07:21 2016 (r305004) @@ -57,6 +57,7 @@ void gsbase_load_fault(void) __asm(__STR void fpstate_drop(struct thread *td); void pagezero(void *addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist); +void sse2_pagezero(void *addr); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Mon Aug 29 12:57:28 2016 (r305003) +++ head/sys/i386/i386/support.s Mon Aug 29 13:07:21 2016 (r305004) @@ -69,9 +69,16 @@ ENTRY(sse2_pagezero) movl %ecx,%eax addl $4096,%eax xor %ebx,%ebx + jmp 1f + /* + * The loop takes 14 bytes. Ensure that it doesn't cross a 16-byte + * cache line. + */ + .p2align 4,0x90 1: movnti %ebx,(%ecx) - addl $4,%ecx + movnti %ebx,4(%ecx) + addl $8,%ecx cmpl %ecx,%eax jne 1b sfence From owner-svn-src-head@freebsd.org Mon Aug 29 14:38: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 2D02DB78C3D; Mon, 29 Aug 2016 14:38:33 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0AE17932; Mon, 29 Aug 2016 14:38:32 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TEcW7f059874; Mon, 29 Aug 2016 14:38:32 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TEcWr1059872; Mon, 29 Aug 2016 14:38:32 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608291438.u7TEcWr1059872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Aug 2016 14:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305005 - in head/sys: amd64/amd64 i386/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.22 Precedence: list List-Id: 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, 29 Aug 2016 14:38:33 -0000 Author: bde Date: Mon Aug 29 14:38:31 2016 New Revision: 305005 URL: https://svnweb.freebsd.org/changeset/base/305005 Log: Shorten banal comments about zeroing and copying pages. Don't give implementation details that last echoed the code 15-20 years ago. But add a detail about pagezero() on i386. Switch from Mach style to BSD style. Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Aug 29 13:07:21 2016 (r305004) +++ head/sys/amd64/amd64/pmap.c Mon Aug 29 14:38:31 2016 (r305005) @@ -5153,8 +5153,7 @@ out: } /* - * pmap_zero_page zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. + * Zero the specified hardware page. */ void pmap_zero_page(vm_page_t m) @@ -5165,10 +5164,8 @@ pmap_zero_page(vm_page_t m) } /* - * pmap_zero_page_area zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. - * - * off and size may not cover an area beyond a single hardware page. + * Zero an an area within a single hardware page. off and size must not + * cover an area beyond a single hardware page. */ void pmap_zero_page_area(vm_page_t m, int off, int size) @@ -5182,10 +5179,9 @@ pmap_zero_page_area(vm_page_t m, int off } /* - * pmap_zero_page_idle zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. This - * is intended to be called from the vm_pagezero process only and - * outside of Giant. + * Zero the specified hardware page in a way that minimizes cache thrashing. + * This is intended to be called from the vm_pagezero process only and + * outside of Giant. */ void pmap_zero_page_idle(vm_page_t m) @@ -5196,10 +5192,7 @@ pmap_zero_page_idle(vm_page_t m) } /* - * pmap_copy_page copies the specified (machine independent) - * page by mapping the page into virtual memory and using - * bcopy to copy the page, one machine dependent page at a - * time. + * Copy 1 specified hardware page to another. */ void pmap_copy_page(vm_page_t msrc, vm_page_t mdst) Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Aug 29 13:07:21 2016 (r305004) +++ head/sys/i386/i386/pmap.c Mon Aug 29 14:38:31 2016 (r305005) @@ -4174,6 +4174,9 @@ out: PMAP_UNLOCK(dst_pmap); } +/* + * Zero 1 page of virtual memory mapped from a hardware page by the caller. + */ static __inline void pagezero(void *page) { @@ -4191,8 +4194,7 @@ pagezero(void *page) } /* - * pmap_zero_page zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. + * Zero the specified hardware page. */ void pmap_zero_page(vm_page_t m) @@ -4214,10 +4216,8 @@ pmap_zero_page(vm_page_t m) } /* - * pmap_zero_page_area zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. - * - * off and size may not cover an area beyond a single hardware page. + * Zero an an area within a single hardware page. off and size must not + * cover an area beyond a single hardware page. */ void pmap_zero_page_area(vm_page_t m, int off, int size) @@ -4242,10 +4242,9 @@ pmap_zero_page_area(vm_page_t m, int off } /* - * pmap_zero_page_idle zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. This - * is intended to be called from the vm_pagezero process only and - * outside of Giant. + * Zero the specified hardware page in a way that minimizes cache thrashing. + * This is intended to be called from the vm_pagezero process only and + * outside of Giant. */ void pmap_zero_page_idle(vm_page_t m) @@ -4263,10 +4262,7 @@ pmap_zero_page_idle(vm_page_t m) } /* - * pmap_copy_page copies the specified (machine independent) - * page by mapping the page into virtual memory and using - * bcopy to copy the page, one machine dependent page at a - * time. + * Copy 1 specified hardware page to another. */ void pmap_copy_page(vm_page_t src, vm_page_t dst) From owner-svn-src-head@freebsd.org Mon Aug 29 15:06: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 647C6BC76E9 for ; Mon, 29 Aug 2016 15:06:02 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7D98F15 for ; Mon, 29 Aug 2016 15:06:01 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id g62so102858996lfe.3 for ; Mon, 29 Aug 2016 08:06:01 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2XdnpEK0n97vEv42NRaA0mzewbc2WitrBwpelosfPxs=; b=USkhCehAd4rOGZFyl236BxMk6tJs3qNJWXQe+40tZHm/peAvfgGc/4j+ObaNFt52/c JDEGo5FesWj4o/BIfZRI+m9gU7etkSF9bYNv233JHUER6n6zHfsGuAzPBVq852Ra93gW O83csogQxhnMfOgvyNGekHvkluUPmdrdQsH3bfcn3ByYakX11bSaBvF84bhkgtsvJk3S QEhZ0jp+kPN6DQRkI1ZpMuqRqQtd9Tm8Jgh1efefKJprUNf2dSmQgr/z5TxS5DZEIwx/ UpiUXuBksBa1gwbdIIWpY7BilrGqDpo5R2OZCMCZ34HTbMdCvE5AEhRDqGzDp8pwX1tc 4j7w== X-Gm-Message-State: AE9vXwMhaob18zeDjABy7UjkVC7iDsKPmIC7s5UKYifcew+lrrxkSclaUBboBC0YKR69sg== X-Received: by 10.25.21.32 with SMTP id l32mr5848024lfi.158.1472483153332; Mon, 29 Aug 2016 08:05:53 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id h62sm6475111lji.28.2016.08.29.08.05.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 08:05:52 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov , John Baldwin References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <20160829070715.GQ83214@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <66844e3f-0e62-aaa2-3c27-3d3063a51c8e@freebsd.org> Date: Mon, 29 Aug 2016 18:05:50 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160829070715.GQ83214@kib.kiev.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 15:06:02 -0000 On 29.08.2016 10:07, Konstantin Belousov wrote: > On Mon, Aug 29, 2016 at 09:58:13AM +0300, Konstantin Belousov wrote: >> On Sun, Aug 28, 2016 at 04:09:51PM -0700, John Baldwin wrote: >>> OTOH, given that we explicitly documented it as not being true, I suspect >>> any applications that are using ptrace() are going off the documentation, not >>> the implementation artifact. Note that Linux's ptrace() documents the same >>> requirement as before this change (caller is required to clear errno), so I >>> doubt there is any actual software out there that expects the >>> FreeBSD-specific behavior. Given that and the extra maintenance overhead of >>> having to dink with errno in assembly on X architectures, I'd rather we keep >>> the old language in the manpage and remove the 'errno' frobbing in the system >>> call wrappers. To be honest, my first response to this commit was one of >>> surprise that we modify errno directly as that is inconsistent with other >>> system calls. (I haven't looked to see if any other system call wrappers >>> modify errno for non-error cases.) >> >> The problematic calls are PT_PEEK_I and PT_PEEK_D, as far as I understand. >> >> I dug into the ptrace(2) consumers, I found a lot of things using >> it which I would not expect to use, besides usual suspects of gdb >> lldb libunwind reptyr etc. Most surprising was that even high-profile >> consumers including gdb sometimes fail to check errno after PT_PEEK. On >> the other hand, I did not found a case in gdb where errno is checked >> after PT_PEEK but not zeroed before the syscall. >> >> I almost agreed with you after the reading, but then I decided to look >> into glibc just in case. What I found there is really fascinating. >> From glibc/sysdeps/unix/sysv/linux: >> res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data); >> if (res >= 0 && request > 0 && request < 4) >> { >> __set_errno (0); >> return ret; >> } >> #define PTRACE_PEEKTEXT 1 >> #define PTRACE_PEEKDATA 2 >> #define PTRACE_PEEKUSR 3 >> >> In the end, I might consider changing the ptrace wrappers into >> consolidated C source, it would look like that >> >> int >> ptrace(int request, pid_t pid, caddr_t addr, int data) >> { >> >> errno = 0; >> return (__sys_ptrace(request, pid, addr, data)); >> } > > And Solaris libc, where ptrace() is the wrapper around procfs, starts its > implementation this way: > usr/src/lib/libc/i386/sys/ptrace.c > /* > * Process the request. > */ > errno = 0; > switch (request) { > case 1: /* PTRACE_PEEKTEXT */ > case 2: /* PTRACE_PEEKDATA */ > No surprise since they all share the same initial implementation. You can add NetBSD and OpenBSD too. Errno clearing as undocumented side effect is not what we need, and every system documents that user must clear errno. From owner-svn-src-head@freebsd.org Mon Aug 29 15:34: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 AB434BC7D35; Mon, 29 Aug 2016 15:34:46 +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 29605E9; Mon, 29 Aug 2016 15:34:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7TFYe36083275 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 29 Aug 2016 18:34:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7TFYe36083275 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7TFYeUd083274; Mon, 29 Aug 2016 18:34:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Aug 2016 18:34:40 +0300 From: Konstantin Belousov To: Andrey Chernov Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Message-ID: <20160829153440.GT83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <20160829070715.GQ83214@kib.kiev.ua> <66844e3f-0e62-aaa2-3c27-3d3063a51c8e@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <66844e3f-0e62-aaa2-3c27-3d3063a51c8e@freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 29 Aug 2016 15:34:46 -0000 On Mon, Aug 29, 2016 at 06:05:50PM +0300, Andrey Chernov wrote: > No surprise since they all share the same initial implementation. You > can add NetBSD and OpenBSD too. Errno clearing as undocumented side > effect is not what we need, and every system documents that user must > clear errno. Of course they do not share initial implementation. Solaris ptrace(2) is the recent clean room implementation of the interface on top of their procfs(4). Glibc provides the code specific to linux, and they only clear errno for requests which might return -1 legitimately, and only do it after. I would understand your argument if I referenced Open/NetBSD, but I did not. From owner-svn-src-head@freebsd.org Mon Aug 29 16:17: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 46FA9BC7A8C for ; Mon, 29 Aug 2016 16:17:54 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA256FEE for ; Mon, 29 Aug 2016 16:17:53 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f50.google.com with SMTP id l89so104529181lfi.1 for ; Mon, 29 Aug 2016 09:17:53 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=EiJdnyECNd6zapkJj0QpSRuvqAOEI8WHbKAFipktFVg=; b=kuZ8bhpdtNjB5TqBAuvovsF2JywlzDFL4X4n8YhduaJ9bpOUNUghnAYWmXyx9kN5+u qdxw2HkgeHPW5TSjPG0UBZgYqMW8TrAQuAI7Gm6AayFoluzkg55ToAwL1jnH8gnIjgVj JrxJ531rnoXdwTeJ04jpaYY6yjEqoVEWCl/CkPAugK6MB8uxTPlAK2jqbETsvfFwXY6s VnTT95L0n4AhoXLPwrq6wJI3H2VvCllFXsyLuAdvmznHYpv2RficGXFc2+v95FFHXxTZ 7ipvuiigvBQLYDNlkKxA/D4fBzQMcCDpnN9nY7L/q0ya00X7BNvx2n6U9KuEn3kh4IwE be1Q== X-Gm-Message-State: AE9vXwPT1cZ0vIl8CA8v81zOa5ADx8YQ0nLeQmZOjjOLTpmp/5+681q4s1fivqIjWqQk4Q== X-Received: by 10.25.76.137 with SMTP id z131mr4687051lfa.49.1472487465545; Mon, 29 Aug 2016 09:17:45 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id g3sm6578297lfe.14.2016.08.29.09.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 09:17:45 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <80ad9e03-74bc-8c99-666f-787772bef2b9@freebsd.org> <20160828015210.GI83214@kib.kiev.ua> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <20160829070715.GQ83214@kib.kiev.ua> <66844e3f-0e62-aaa2-3c27-3d3063a51c8e@freebsd.org> <20160829153440.GT83214@kib.kiev.ua> Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Mon, 29 Aug 2016 19:17:42 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160829153440.GT83214@kib.kiev.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 16:17:54 -0000 On 29.08.2016 18:34, Konstantin Belousov wrote: > On Mon, Aug 29, 2016 at 06:05:50PM +0300, Andrey Chernov wrote: >> No surprise since they all share the same initial implementation. You >> can add NetBSD and OpenBSD too. Errno clearing as undocumented side >> effect is not what we need, and every system documents that user must >> clear errno. > Of course they do not share initial implementation. Solaris ptrace(2) is > the recent clean room implementation of the interface on top of their > procfs(4). Glibc provides the code specific to linux, and they only > clear errno for requests which might return -1 legitimately, and only do > it after. > > I would understand your argument if I referenced Open/NetBSD, but I did not. > Of course I don't mean that they share the same code, it is impossible. By sharing I mean they look at the same initial implementation (or its already existent forks), writing their own code, so this errno clearing piece becomes common as becomes common that really documented another way is. But all this is history. Now we have a) Undocumented errno clearing (as bare minimum). b) Inconsistency with other libc functions and syscalls related to forced errno clearing (in wider scope). From owner-svn-src-head@freebsd.org Mon Aug 29 17:23: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 51D5EBC7018; Mon, 29 Aug 2016 17:23:05 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1BF08E28; Mon, 29 Aug 2016 17:23:05 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7THN4NA025840; Mon, 29 Aug 2016 17:23:04 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7THN4PI025839; Mon, 29 Aug 2016 17:23:04 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201608291723.u7THN4PI025839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Mon, 29 Aug 2016 17:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305006 - head/release/doc/en_US.ISO8859-1/relnotes 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.22 Precedence: list List-Id: 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, 29 Aug 2016 17:23:05 -0000 Author: skreuzer (doc,ports committer) Date: Mon Aug 29 17:23:04 2016 New Revision: 305006 URL: https://svnweb.freebsd.org/changeset/base/305006 Log: Null out the release notes for 12-CURRENT Approved by: gjb Differential Revision: D7669 Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Aug 29 14:38:31 2016 (r305005) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Aug 29 17:23:04 2016 (r305006) @@ -25,7 +25,6 @@ - 2015 2016 The &os; Documentation Project @@ -160,692 +159,51 @@ Userland Configuration Changes - The default &man.newsyslog.conf.5; now - includes files in the - /etc/newsyslog.conf.d/ and - /usr/local/etc/newsyslog.conf.d/ - directories by default for &man.newsyslog.8;. - - The &man.mailwrapper.8; utility has been - updated to use &man.mailer.conf.5; from the - LOCALBASE environment variable, which - defaults to /usr/local - if unset. - - The MK_ARM_EABI - &man.src.conf.5; option has been removed. - - The ntp suite - has been updated to version 4.2.8p8. +   Userland Application Changes - When unable to load a kernel module with - &man.kldload.8;, a message informing to view output of - &man.dmesg.8; is now printed, opposed to the previous output - Exec format error.. - - Allow &man.pciconf.8; to identify PCI - devices that are attached to a driver to be identified by - their device name instead of just the selector. Additionally, - an optional device argument to the -l flag - to restrict the output to only listing details about a single - device. - - A new flag, onifconsole - has been added to /etc/ttys. This allows - the system to provide a login prompt via serial console if the - device is an active kernel console, otherwise it is equivalent - to off. - - Support for displaying VPD for PCI - devices via &man.pciconf.8; has been added. - - &man.ping.8; protects against malicious - network packets using the Capsicum framework to drop - privileges. - - The &man.ps.1; utility has been - updated to include the -J flag, used to - filter output by matching &man.jail.8; IDs and names. - Additionally, argument 0 can be used to - -J to only list processes running on the - host system. - - The &man.top.1; utility has been updated - to filter by &man.jail.8; ID or name, in followup to the - &man.ps.1; change in r265229. - - The &man.pmcstat.8; utility has been - updated to include a new flag, -l, which - ends event collection after the specified number of - seconds. - - The &man.ps.1; utility has been updated - to include a new keyword, tracer, which - displays the PID of the tracing - process. - - Support for adding empty partitions has - been added to the &man.mkimg.1; utility. - - The &man.primes.6; utility has been - updated to correctly enumerate prime numbers between - 4295098369 and - 3825123056546413050, which prior to this - change, it would be possible for returned values to be - incorrectly identified as prime numbers. - - The &man.mkimg.1; utility has been - updated to include three options used to print information - about &man.mkimg.1; itself: - - - - - - - - Option - Output - - - - - - --version - The current version of the &man.mkimg.1; - utility - - - - --formats - The disk image file formats supported by - &man.mkimg.1; - - - - --schemes - The partition schemes supported by - &man.mkimg.1; - - - - - - Userland &man.ctf.5; support in - &man.dtrace.1; has been added. With this change, - &man.dtrace.1; is able to resolve type info for function and - USDT probe arguments, and function return - values. - - The &man.elfdump.1; utility has been - updated to support capability mode provided by - &man.capsicum.4;. - - The - &man.fstyp.8; utility has been added, which is used to - determine the filesystem on a specified device. - - The libedit library - has been updated to support UTF-8, which - additionally provides unicode support to &man.sh.1;. - - The - &man.mkimg.1; utility has been updated to support the - MBR EFI partition - type. - - The &man.ptrace.2; system - call has been updated include support for Altivec registers on - &os;/&arch.powerpc;. - - A new device control utility, - &man.devctl.8; has been added, which allows making - administrative changes to individual devices, such as - attaching and detaching drivers, and enabling and disabling - devices. The &man.devctl.8; utility uses the new - &man.devctl.3; library. - - The &man.netstat.1; utility has been - updated to link against the &man.libxo.3; shared - library. - - A new flag, -c, has - been added to the &man.mkimg.1; utility, which allows - specifying the capacity of the target disk image. - - The - &man.uefisign.8; utility has been added. - - The &man.freebsd-update.8; utility has - been updated to prevent fetching updated binary patches when - a previous upgrade has not been thoroughly completed. - - A regression in the &man.libarchive.3; - library that would prevent a directory from being included in - the archive when --one-file-system is used - has been fixed. - - The - &man.ar.1; utility has been updated to set - ARCHIVE_EXTRACT_SECURE_SYMLINKS and - ARCHIVE_EXTRACT_SECURE_NODOTDOT to disallow - directory traversal when extracting an archive, similar to - &man.tar.1;. - - A race condition in &man.wc.1; that - would cause final results to be sent to &man.stderr.4; when - receiving the SIGINFO signal has been - fixed. - - The &man.chflags.1;, &man.chgrp.1;, - &man.chmod.1;, and &man.chown.8; utilities now affect symbolic - links when the -R flag is specified, as - documented in &man.symlink.7;. - - The &man.date.1; utility has been - updated to print the modification time of the file passed as - an argument to the -r flag, improving - compatibility with the GNU &man.date.1; - utility behavior. - - The &man.pw.8; utility has been updated - with a new flag, -R, that sets the root - directory within which the utility will operate. - - The &man.lockstat.1; utility has been - updated with several improvements: - - - - Spin locks are now reported as the amount of time - spinning, instead of loop iterations. - - - - Reader locks are now recognized as adaptive that can - spin on &os;. - - - - Lock aquisition events for successful reader try-lock - events are now reported. - - - - Spin and block events are now reported before lock - acquisition events. - - - - The &man.fstyp.8; utility has been - updated to be able to detect &man.zfs.8; and &man.geli.8; - filesystems. - - The &man.mkimg.1; utility has been - updated to include support for NTFS - filesystems in both MBR and - GPT partitioning schemes. - - The &man.quota.1; utility has been - updated to include support for IPv6. - - The &man.jexec.8; utility has been - updated to include a new flag, -l, which - ensures a clean environment in the target jail when used. - Additionally, &man.jexec.8; will run a shell within the target - jail when run no commands are specified. - - The &man.w.1; utility has been updated - to display the full IPv6 remote address of the host from which - a user is connected. - - The &man.jail.8; framework has been - updated to allow mounting &man.linprocfs.5; and - &man.linsysfs.5; within a jail. - - The &man.patch.1; utility has been - updated to include a new option to the -V - flag, none, which disables backup file - creation when applying a patch. - - The - &man.ar.1; utility now enables deterministic mode - (-D) by default. This behavior can be - disabled by specifying the -U flag. - - The &man.xargs.1; utility has been - updated to allow specifying 0 as an - argument to the -P (parallel mode) flag, - which allows creating as many concurrent processes as - possible. - - The &man.patch.1; utility has been - updated to remove the automatic checkout feature. - - A - new utility, &man.sesutil.8;, has been added, which is used - to manage &man.ses.4; devices. - - The &man.pciconf.8; utility has been - updated to use the PCI ID database from the misc/pciids package, if present, - falling back to the PCI ID database in the &os; base - system. - - The &man.ifconfig.8; utility has been - updated to always exit with an error code if an important - &man.ioctl.2; fails. +   Contributed Software - &man.byacc.1; has been updated to - version 20140101. - - OpenSSH has - been updated to 7.2p2. - - mdocml has - been updated to version 1.12.3. - - The binutils - suite of utilities has been updated to include upstream - patches that add new relocations for &arch.powerpc; - support. - - The - ELF Tool Chain has been updated to - upstream revision r3136. - - The texinfo - utility and info pages were removed from - the base system. The print/texinfo port should be - installed on systems where info pages are - needed. - - The ELF - object manipulation tools - addr2line, - elfcopy (strip), - nm, - readelf, - size, and - strings were switched to the - versions from the ELF Tool Chain project. - - The libedit library - has been updated to include UTF-8 support, - adding UTF-8 support to the &man.sh.1; - shell. - - The &man.xz.1; utility has been updated - to support multi-threaded compression. - - The - elftoolchain utilities have been - updated to version 3179. - - The &man.xz.1; utility has been updated - to version 5.2.2. - - The &man.nvi.1; utility has been updated - to version 2.1.3. - - The &man.wpa.supplicant.8; and - &man.hostapd.8; utilities have been updated to version - 2.5. - - The - &man.resolvconf.8; utility has been updated to version - 3.7.3. - - less has - been updated to version v481. - - bmake has - been updated to version 20150606. - - sendmail has - been updated to 8.15.2. Starting with &os; 11.0 and - sendmail 8.15, sendmail uses uncompressed IPv6 addresses by - default, i.e., they will not contain ::. For - example, instead of ::1, it will be - 0:0:0:0:0:0:0:1. This permits a zero subnet to - have a more specific match, such as different map entries for - IPv6:0:0 versus IPv6:0. This change requires that - configuration data (including maps, files, classes, custom - ruleset, etc.) must use the same format, so make certain such - configuration data is upgrading. As a very simple check - search for patterns like 'IPv6:[0-9a-fA-F:]*::' and 'IPv6::'. - To return to the old behavior, set the m4 option - confUSE_COMPRESSED_IPV6_ADDRESSES or the cf - option UseCompressedIPv6Addresses. - - The &man.tcpdump.1; utility has been - updated to version 4.7.4. - - OpenSSL has - been updated to version 1.0.2h. - - The - &man.ssh.1; utility has been updated to re-implement hostname - canonicalization before locating the host in - known_hosts. - - The &man.libarchive.3; library has been - updated to properly skip a sparse file entry in a &man.tar.1; - file, which would previously produce errors. - - The apr - library used by &man.svnlite.1; has been updated to version - 1.5.2. - - The serf - library used by &man.svnlite.1; has been updated to version - 1.3.8. - - The &man.svnlite.1; utility has been - updated to version 1.8.14. - - The sqlite3 - library used by &man.svnlite.1; and &man.kerberos.8; has been - updated to version 3.12.1. - - Timezone data files have been updated to - version 2015f. - - The &man.acpi.4; subsystem has been - updated to version 20150818. - - The &man.unbound.8; utility has been - updated to version 1.5.4. - - &man.jemalloc.3; has been updated to - version 4.0.2. - - The &man.file.1; utility has been - updated to version 5.28. - - The &man.nc.1; utility has been updated - to the OpenBSD 5.8 version. - - Clang has - been updated to version 3.8.0. - - LLVM has - been updated to version 3.8.0. - - LLDB has - been updated to version 3.8.0. - - libc++ has - been updated to version 3.8.0. - - The - compiler_rt utility has been - updated to version 3.8.0. - - ACPICA has been - updated to version 20160527. - - OpenBSM has been - updated to version 1.2 alpha 4. - - The NetBSD - Project's &man.libblacklist.3; library and applications - have been ported and integrated into the system. Packet - filtering support for the &man.pf.4; packet filtering systems - has been implemented. The blacklist - system provides the blacklistd - daemon, the helper script - blacklistd-helper to make changes - to the running packet filter system and the - blacklistctl control program. - A selection of system daemons, including: - fingerd, - ftpd, - rlogind, and - rshd have been modified to support - sending notifications to the blacklistd - daemon. - - Support for - the &man.ipfw.4; packet filter has been added to the - blacklistd-helper script. - - Support for - the &man.ipfilter.4; packet filter has been added to the - blacklistd-helper script. +   Installation and Configuration Tools - The &man.bsdinstall.8; partition editor - and &man.sade.8; utility have been updated to include native - ZFS support. - - - &man.bsdinstall.8;/zfsboot GPT+BIOS+GELI installs now make use - of GELIBOOT which allows ZFS Boot Environments to be used with - GELI encrypted ZFS pools. - - A module to configure wifi devices has been added - to &man.bsdinstall.8; - - The &os; installation utility, - &man.bsdinstall.8;, has been updated to set the - canmount &man.zfs.8; property to - off for the /var dataset, preventing the - contents of directories within /var from conflicting when - using multiple boot environments, such as that provided by - sysutils/beadm. - - The &man.bsdconfig.8; utility has been - updated to skip the initial &man.tzsetup.8; - UTC versus wall-clock time prompt when run - in a virtual machine, determined when the - kern.vm_guest &man.sysctl.8; is set to - 1. - - The &man.bsdinstall.8; utility has been - updated to use the new &man.dpv.3; library to display progress - when extracting the &os; distributions. - - Support for detecting and implementing - aligning partitions on 1Mb boundaries has been added to - &man.bsdinstall.8;. - - Support for detecting and implementing - a workaround for various laptops and motherboards that do not - boot properly from GPT-partitioned disks - has been added to &man.bsdinstall.8;. Additionally, the - active flag will be set on the partition - when needed. - - Support for selecting the partitioning - scheme when installing on the UFS - filesystem has been added to &man.bsdinstall.8;. +   <filename class="directory">/etc/rc.d</filename> Scripts - The &man.rc.8; subsystem has been - updated to allow configuring services in ${LOCALBASE}/etc/rc.conf.d/. - If LOCALBASE is unset, it defaults to - /usr/local. - - A new &man.rc.8; script, - growfs, has been added, which will resize - the root filesystem on boot if /firstboot - exists. - - The mrouted - &man.rc.8; script has been removed from the base system. An - equivalent script is available from the net/mrouted port. - - A new &man.rc.8; script, - iovctl, has been added, which allows - automatically starting the &man.iovctl.8; utility at - boot. - - The &man.service.8; utility has been - updated to honor entries within /etc/rc.conf.d/. - +   <filename class="directory">/etc/periodic</filename> Scripts - The daily &man.periodic.8; script - 110.clean-tmps has been updated to avoid - crossing filesystem mount boundaries when cleaning files in - /tmp. - - A new - &man.periodic.8; script, - 510.status-world-kernel, has been added, - which evaluates the running userland and kernel versions from - the &man.uname.1; -U and - -K arguments, and prints an error if the - system userland and kernel are not in sync. +   Runtime Libraries and API - The Blowfish &man.crypt.3; default - format has been changed to - $2b$. - - The &man.readline.3; library is now - statically linked in software within the base system, and the - shared library is no longer installed, allowing the Ports - Collection to use a modern version of the library. - - The &man.strptime.3; library has been - updated to add support for POSIX-2001 - features %U and - %W. - - The &man.dl.iterate.phdr.3; library has been - changed to always return the path name of the - ELF object in the - dlpi_name structure member. - - The &man.libxo.3; library has been - imported to the base system. - - A - userland library for Chelsio Terminator 5 based iWARP cards - has been added, allowing userland RDMA - applications to work over compatible - NICs. - - The &man.gpio.3; library has been added, - providing a wrapper around the &man.gpio.4; kernel - interface. - - The - &man.procctl.2; system call has been updated to include - a facility for non-&man.init.8; processes to be declared as - the reaper of child processes and their decendants. - - The futimens() and - utimensat() system calls have been - added. See &man.utimensat.2; for more information. - - The &man.elf.3; compile-time dependency - has been removed from dtri.o, which - allows adding DTrace probes to - userland applications and libraries without also linking - against &man.elf.3;. - - The &man.setmode.3; function has been - updated to consistently set errno on - failure. - - The &man.qsort.3; functions have been - updated to be able to handle 32-bit aligned data on 64-bit - platforms, also providing a significant improvement in 32-bit - workloads. - - Several standard include headers have - been updated to use of gcc - attributes, such as __result_use_check(), - __alloc_size(), and - __nonnull(). - - Support for file verification in - MAC has been added. - - The - libgomp library is now only built when - building GCC from the base system. An - up-to-date version is available in the Ports Collection as - devel/libiomp5-devel. - - The stdlib.h and - malloc.h headers have been updated to - make use of the gcc - alloc_align() attribute. - - The Blowfish &man.crypt.3; library - has been updated to support $2y$ hashes. - - The &man.execl.3; and &man.execlp.3; - library functions have been updated to use the - __sentinel gcc - attribute. +   ABI Compatibility - The &linux; compatibility version has - been updated to 2.6.18. The - compat.linux.osrelease &man.sysctl.8; is - evaluated when building the emulators/linux-c6 and related - ports. - - The stack protector has been upgraded to - the "strong" level, elevating the protection against buffer - overflows. While this significantly improves the security of - the system, extensive testing was done to ensure there are no - measurable side effects in performance or - functionality. +   @@ -859,246 +217,19 @@ Kernel Bug Fixes - A kernel bug that inhibited proper - functionality of the dev.cpu.0.freq - &man.sysctl.8; on &intel; processors with Turbo - Boost ™ enabled has been fixed. - - Support for - &man.dtrace.1; stack tracing has been fixed for - &os;/&arch.powerpc;, using the trapexit() - and asttrapexit() functions instead of - checking within addressed kernel space. - - A kernel panic triggered when destroying - a &man.vnet.9; &man.jail.8; configured with &man.gif.4; has - been fixed. - - A kernel panic triggered when destroying - a &man.vnet.9; &man.jail.8; configured with &man.gre.4; has - been fixed. - - A bug in &man.ipfw.4; that could - potentially lead to a kernel panic when using &man.dummynet.4; - at layer 2 has been fixed. - - The - kernel RPC has been updated to include - several enhancements: - - - - The 45 MiB limit on requests queued for - &man.nfsd.8; threads has been removed. - - - - Avoids unnecessary throttling by not deferring - accounting for completed requests. - - - - Fixes an integer overflow and signedness bugs. - - - - Support for - &man.dtrace.1; has been added for the - Book-E ™. - - The &man.kqueue.2; system call has been - updated to handle write events to files larger than 2 - gigabytes. +   Kernel Configuration - The IMAGACT_BINMISC - kernel configuration option has been enabled by default, - which enables application execution through emulators, such - as Qemu. - - The VT kernel - configuration file has been removed, and the &man.vt.4; - driver is included in the GENERIC kernel. - To enable &man.vt.4;, enter set kern.vty=vt - at the &man.loader.8; prompt during boot, or add - kern.vty=vt to &man.loader.conf.5; and - reboot the system. - - The &man.config.8; utility has been - updated to allow using a non-standard src/ tree, specified as an - argument to the -s flag. - - The - &os;/&arch.powerpc64; kernel now builds as - a position-independent executable, allowing the kernel to be - loaded into and run from any physical or virtual - address. - - - This change requires an update to &man.loader.8;. - The userland and kernel must be updated before rebooting the - system. - - - A new module for creating - rpi.dtb has been added for the Raspberry - Pi. - - The - rpi.dtb module is now installed to - /boot/dtb/ by - default for the Raspberry Pi system. - - Kernel support for Vector-Scalar eXtension - (VSX) found on POWER7 and POWER8 hardware - has been added. - - The &man.pmap.9; implementation for 64-bit - &powerpc; processors has been overhaulded to improve - concurrency. - - A new module for creating - the dtb module for AM335x systems has - been added. - - The - PAE_TABLES kernel configuration option has - been added for &os;/&arch.i386;, which instructs &man.pmap.9; - to use PAE format for page tables while - maintaining a 32-bit physical address size elsewhere in the - kernel. The use of this option can enhance application-level - security by enabling the creation of no execute - mappings on modern &arch.i386; processors. Unlike the - PAE option, PAE_TABLES - preserves kernel binary interface (KBI) - compatibility with non-PAE kernels, - allowing non-PAE kernel modules and drivers - to work with a PAE_TABLES-enabled kernel. - Additionally, system limits are tuned for 4GB maximum - RAM, avoiding kernel virtual address space - (KVA) exhaustion. - - The SIFTR kernel - configuration has been added, allowing building &man.siftr.4; - statically into the kernel. - - The &arch.arm; boot loader, - ubldr, is now relocatable. In addition, - ubldr.bin is now created during build - time, which is a stripped binary with an entry point of - 0, providing the ability to specify the - load address by running go - ${loadaddr} in - u-boot. - - The &man.nvd.4; and &man.nvme.4; drivers are - now included in the GENERIC kernel - configuration by default. - - A new kernel configuration option, - EM_MULTIQUEUE, has been added which enables - multi-queue support in the &man.em.4; driver. - - - Multi-queue support in the &man.em.4; driver is not - officially supported by &intel;. - - - The GENERIC kernel - configuration has been updated to include the - IPSEC option by default. - - Initial NUMA - affinity and policy configuration has been added. See - &man.numactl.1;, and &man.numa.getaffinity.2;, for usage - details. - - The &man.pms.4; driver has been added - to the GENERIC kernel configuration for - supported architectures. - - The - CUBIEBOARD2 kernel configuration has been - renamed to A20. - - Kernel - debugging symbols are now installed to /usr/lib/debug/boot/kernel/. - To retain the previous behavior, add - KERN_DEBUGDIR="" to - &man.src.conf.5;. - - - NEW_PCIB is enabled by default. - +   System Tuning and Controls - The - &man.hwpmc.4; default and maximum callchain depths have been - increased. The default has been increased from 16 to 32, and - the maximum increased from 32 to 128. - - The kern.osrelease - and kern.osreldate are now configurable - &man.jail.8; parameters. - - The &man.devfs.5; device filesystem has - been changed to update timestamps for read/write operations - using seconds precision. A new &man.sysctl.8;, - vfs.devfs.dotimes has been added, which - when set to a non-zero value, enables default precision - timestamps for these operations. - - A new - &man.sysctl.8;, kern.racct.enable, has been - added, which when set to a non-zero value allows using - &man.rctl.8; with the GENERIC kernel. - A new kernel configuration option, - RACCT_DISABLED has also been added. - - The - GENERIC kernel configuration now includes - RACCT and RCTL by - default. - - - To enable RACCT and - RCTL on a system using the - GENERIC kernel configuration, add - kern.racct.enable=1 to - &man.loader.conf.5;, and reboot the system. - - - A new &man.sysctl.8;, - net.inet.tcp.hostcache.purgenow, has - been added, which when set to 1 during - runtime will flush all - net.inet.tcp.hostcache entries. - - A new &man.sysctl.8;, - hw.model, has been added, which displays - CPU model information. - - The &man.uart.4; driver has been - updated to allow tuning pulses per second captured in the - CTS line during runtime, whereas previously only the DCD line - could be used without rebuilding the kernel. +   @@ -1111,211 +242,19 @@ Device Drivers - Support for GPS ports has been added to - &man.uhso.4;. - - The &man.full.4; device has been added, - and the lindev(4) device has been removed. - Prior to this change, lindev(4) provided - only the /dev/full character device, - returning ENOSPC on write attempts. As - this device is not specific to &linux;, a native &os; version - has been added. - - Hardware context support has been - added to the drm/i915 driver, adding - support for Mesa 9.2 and - later. - - The &man.vt.4; driver has been updated, - replacing the bitmapped kern.vt.spclkeys - &man.sysctl.8; with individual - kern.vt.kbd_* variants. - - The &man.hpet.4; driver has been updated - to create a - /dev/hpetN - device, providing access to HPET from - userspace. - - The drm code has - been updated to match &linux; version 3.8.13. - - The &man.psm.4; driver has been updated - to include improved support for newer Synaptics ® - touchpads and the ClickPad ® mouse on newer - Lenovo ™ laptops. - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 29 17:29: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 63C20BC71C0; Mon, 29 Aug 2016 17:29:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B21219B; Mon, 29 Aug 2016 17:29:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AFEBAB9A5; Mon, 29 Aug 2016 13:29:18 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Date: Mon, 29 Aug 2016 09:51:50 -0700 Message-ID: <18206408.GMLM77D01s@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160829065813.GP83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 29 Aug 2016 13:29:19 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 17:29:20 -0000 On Monday, August 29, 2016 09:58:13 AM Konstantin Belousov wrote: > On Sun, Aug 28, 2016 at 04:09:51PM -0700, John Baldwin wrote: > > OTOH, given that we explicitly documented it as not being true, I suspect > > any applications that are using ptrace() are going off the documentation, not > > the implementation artifact. Note that Linux's ptrace() documents the same > > requirement as before this change (caller is required to clear errno), so I > > doubt there is any actual software out there that expects the > > FreeBSD-specific behavior. Given that and the extra maintenance overhead of > > having to dink with errno in assembly on X architectures, I'd rather we keep > > the old language in the manpage and remove the 'errno' frobbing in the system > > call wrappers. To be honest, my first response to this commit was one of > > surprise that we modify errno directly as that is inconsistent with other > > system calls. (I haven't looked to see if any other system call wrappers > > modify errno for non-error cases.) > > The problematic calls are PT_PEEK_I and PT_PEEK_D, as far as I understand. > > I dug into the ptrace(2) consumers, I found a lot of things using > it which I would not expect to use, besides usual suspects of gdb > lldb libunwind reptyr etc. Most surprising was that even high-profile > consumers including gdb sometimes fail to check errno after PT_PEEK. On > the other hand, I did not found a case in gdb where errno is checked > after PT_PEEK but not zeroed before the syscall. So the consumers are generally doing the right thing. > I almost agreed with you after the reading, but then I decided to look > into glibc just in case. What I found there is really fascinating. > From glibc/sysdeps/unix/sysv/linux: > res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data); > if (res >= 0 && request > 0 && request < 4) > { > __set_errno (0); > return ret; > } > #define PTRACE_PEEKTEXT 1 > #define PTRACE_PEEKDATA 2 > #define PTRACE_PEEKUSR 3 > > In the end, I might consider changing the ptrace wrappers into > consolidated C source, it would look like that > > int > ptrace(int request, pid_t pid, caddr_t addr, int data) > { > > errno = 0; > return (__sys_ptrace(request, pid, addr, data)); > } Certainly I think having a C wrapper like this makes more sense than doing it all in assembly N times. I would probably prefer to keep the manpage language the way it is though. If we are really worried about compat, we could bump the ptrace symver and use the function above as the FBSD_1.0 version perhaps. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 29 17:37: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 06DEEBC7482; Mon, 29 Aug 2016 17:37:35 +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 BFFAA2D8; Mon, 29 Aug 2016 17:37:34 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1beQUw-000888-9N; Mon, 29 Aug 2016 20:37:26 +0300 Date: Mon, 29 Aug 2016 20:37:26 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305004 - in head/sys: amd64/amd64 amd64/include i386/i386 Message-ID: <20160829173726.GX22212@zxy.spb.ru> References: <201608291307.u7TD7L6H025649@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608291307.u7TD7L6H025649@repo.freebsd.org> 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.22 Precedence: list List-Id: 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, 29 Aug 2016 17:37:35 -0000 On Mon, Aug 29, 2016 at 01:07:21PM +0000, Bruce Evans wrote: > Author: bde > Date: Mon Aug 29 13:07:21 2016 > New Revision: 305004 > URL: https://svnweb.freebsd.org/changeset/base/305004 > > Log: > On amd64, declare sse2_pagezero() and start using it again, but only > for zeroing pages in idle where nontemporal writes are clearly best. > This is almost a no-op since zeroing in idle works does nothing good > and is off by default. Fix END() statement forgotten in previous > commit. > > Align the loop in sse2_pagezero(). Since it writes to main memory, > the loop doesn't have to be very carefully written to keep up. > Unrolling it was considered useless or harmful and was not done on > i386, but that was too careless. > > Timing for i386: the loop was not unrolled at all, and moved only 4 > bytes/iteration. So on a 2GHz CPU, it needed to run at 2 cycles/ > iteration to keep up with a memory speed of just 4GB/sec. But when > it crossed a 16-byte boundary, on old CPUs it ran at 3 cycles/ > iteration so it gave a maximum speed of 2.67GB/sec and couldn't even > keep up with PC3200 memory. Fix the alignment so that it keep up with > 4GB/sec memory, and unroll once to get nearer to 8GB/sec. Further > unrolling might be useless or harmful since it would prevent the loop > fitting in 16-bytes. My test system with an old CPU and old DDR1 only > needed 5+ GB/sec. My test system with a new CPU and DDR3 doesn't need > any changes to keep up ~16GB/sec. > > Timing for amd64: with 8-byte accesses and newer faster CPUs it is > easy to reach 16GB/sec but not so easy to go much faster. The > alignment doesn't matter much if the CPU is not very old. The loop > was already unrolled 4 times, but needs 32 bytes and uses a fancy > method that doesn't work for 2-way unrolling in 16 bytes. Just > align it to 32-bytes. Do you think about using nontemporal writes for copying from user space to kernel space? In much cases this copy result don't need any parsing anf just go to DMA, eliminate cache use. From owner-svn-src-head@freebsd.org Mon Aug 29 17:46: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 1607BBC76E2 for ; Mon, 29 Aug 2016 17:46:53 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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 9A50BCC0 for ; Mon, 29 Aug 2016 17:46:52 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id g62so106076533lfe.3 for ; Mon, 29 Aug 2016 10:46:52 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=C9V1TyfIO1KEUdvO36APoV1JYkKuQmrUNgFevdmCtOs=; b=kx/GTbZzymihsMa9ISfIKFmOOuxHyXPNvg1Gr/vP8SmaTlpMLSfFJuyZh2QtkjDbav O+AwvnFVdPSn0G8hhwv0+oRrFJxmMoLmvSbWrl/mTDdVcvqE/R3ECtjs0D7G8qUvog69 r7YCim1dbv+1Qt/MFV5H9ElnDw7+T+sgGlaozESUZK9LlGQY1r5k4WnewENnJlGa3vxs aIjifTF3sRk2ajpCdacjQBjtphtTXw34vfTJhd8OuPSRYBf1fWTKihSoB40ZXv3wf3NC l5pgsxLB/dD6zH3YbJdVUdagU6ngtxs2UDg++1F/09Y5pE5JLSah6htoiWhCjFsJG5JU nD4w== X-Gm-Message-State: AE9vXwNcES3yeG1qHcOB4IcUdBGvvx7Mkm3IpAs+DP9bOB4KVVNuzOy2HZb7qvbNChV8yQ== X-Received: by 10.46.33.72 with SMTP id h69mr5496936ljh.45.1472492810181; Mon, 29 Aug 2016 10:46:50 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id q36sm6555924lfi.26.2016.08.29.10.46.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 10:46:49 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: John Baldwin , Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <18206408.GMLM77D01s@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Mon, 29 Aug 2016 20:46:47 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <18206408.GMLM77D01s@ralph.baldwin.cx> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 17:46:53 -0000 On 29.08.2016 19:51, John Baldwin wrote: >> int >> ptrace(int request, pid_t pid, caddr_t addr, int data) >> { >> >> errno = 0; >> return (__sys_ptrace(request, pid, addr, data)); >> } > > Certainly I think having a C wrapper like this makes more sense than > doing it all in assembly N times. I would probably prefer to keep the > manpage language the way it is though. Either we implement this wrapper or left all things as is, we need to document internal errno clearing additionally, to not make people wonder why errno becomes 0, probably with the mention that program should not relay on this obsoleted implementation feature. IMHO, it will be better to not clear errno at all, considering 'before call' way documented everywhere and consumers behavior analyzed by kib@ From owner-svn-src-head@freebsd.org Mon Aug 29 17:50: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 89B4DBC781A; Mon, 29 Aug 2016 17:50:37 +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 574DBB0; Mon, 29 Aug 2016 17:50:37 +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 u7THoadV033752; Mon, 29 Aug 2016 17:50:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7THoa0B033751; Mon, 29 Aug 2016 17:50:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608291750.u7THoa0B033751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 Aug 2016 17:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305007 - head/contrib/netbsd-tests/usr.bin/dirname 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.22 Precedence: list List-Id: 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, 29 Aug 2016 17:50:37 -0000 Author: ngie Date: Mon Aug 29 17:50:36 2016 New Revision: 305007 URL: https://svnweb.freebsd.org/changeset/base/305007 Log: Expect :basic to fail due to recent output changes in dirname(3) The dirname output change bug is actively being worked on, and this commit will need to be reverted once it's fixed. MFC after: never PR: 212193 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh Modified: head/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh Mon Aug 29 17:23:04 2016 (r305006) +++ head/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh Mon Aug 29 17:50:36 2016 (r305007) @@ -32,6 +32,9 @@ basic_head() } basic_body() { + # Begin FreeBSD + atf_tc_expect_fail "dirname //usr//bin doesn't return //usr like it used to; bug # 212193" + # End FreeBSD atf_check -o inline:"/\n" dirname / atf_check -o inline:"/\n" dirname // atf_check -o inline:"/usr\n" dirname /usr/bin/ From owner-svn-src-head@freebsd.org Mon Aug 29 17:59: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 ECC77BC7A6B; Mon, 29 Aug 2016 17:59:06 +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 B6C8AA1C; Mon, 29 Aug 2016 17:59:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id B1648781C2E; Tue, 30 Aug 2016 03:58:54 +1000 (AEST) Date: Tue, 30 Aug 2016 03:58:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305004 - in head/sys: amd64/amd64 amd64/include i386/i386 In-Reply-To: <20160829173726.GX22212@zxy.spb.ru> Message-ID: <20160830034632.A3851@besplex.bde.org> References: <201608291307.u7TD7L6H025649@repo.freebsd.org> <20160829173726.GX22212@zxy.spb.ru> 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=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=b-jchPaYlLJwnxUff-0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 17:59:07 -0000 On Mon, 29 Aug 2016, Slawa Olhovchenkov wrote: > On Mon, Aug 29, 2016 at 01:07:21PM +0000, Bruce Evans wrote: >> ... >> Log: >> On amd64, declare sse2_pagezero() and start using it again, but only >> for zeroing pages in idle where nontemporal writes are clearly best. >> This is almost a no-op since zeroing in idle works does nothing good >> and is off by default. Fix END() statement forgotten in previous >> commit. >> ... > > Do you think about using nontemporal writes for copying from user > space to kernel space? In much cases this copy result don't need any parsing > anf just go to DMA, eliminate cache use. I once tried that (for copyin/out, without DMA). It was just a small pessimization. For small data, it increases setup overheads, and large data isn't common enough to matter. DMA can be even slower since it increases latency. First there is latency to set it up, and then you often don't want it to touch the cache since that gives more latency for cache misses. Bruce From owner-svn-src-head@freebsd.org Mon Aug 29 18:05: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 1CD3FBC7D55; Mon, 29 Aug 2016 18:05:11 +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 7DDA38A; Mon, 29 Aug 2016 18:05:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7TI4u4O019201 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 29 Aug 2016 21:04:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7TI4u4O019201 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7TI4sJK019199; Mon, 29 Aug 2016 21:04:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Aug 2016 21:04:54 +0300 From: Konstantin Belousov To: John Baldwin Cc: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Message-ID: <20160829180454.GU83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <18206408.GMLM77D01s@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18206408.GMLM77D01s@ralph.baldwin.cx> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:05:11 -0000 On Mon, Aug 29, 2016 at 09:51:50AM -0700, John Baldwin wrote: > On Monday, August 29, 2016 09:58:13 AM Konstantin Belousov wrote: > > I dug into the ptrace(2) consumers, I found a lot of things using > > it which I would not expect to use, besides usual suspects of gdb > > lldb libunwind reptyr etc. Most surprising was that even high-profile > > consumers including gdb sometimes fail to check errno after PT_PEEK. On > > the other hand, I did not found a case in gdb where errno is checked > > after PT_PEEK but not zeroed before the syscall. > > So the consumers are generally doing the right thing. I only looked at gdb in details, other code is painful to read. > Certainly I think having a C wrapper like this makes more sense than > doing it all in assembly N times. I would probably prefer to keep the > manpage language the way it is though. So do you want to revert man page bits ? > > If we are really worried about compat, we could bump the ptrace symver > and use the function above as the FBSD_1.0 version perhaps. This does not solve anything. Old-time compiled consumers would get the expected interface, while the same consumers compiled anew get incompatible interface. Recent dirname/basename change demostrates the same problem. On Mon, Aug 29, 2016 at 08:46:47PM +0300, Andrey Chernov wrote: > Either we implement this wrapper or left all things as is, we need to > document internal errno clearing additionally, to not make people wonder > why errno becomes 0, probably with the mention that program should not > relay on this obsoleted implementation feature. It was done in r304928. John want to revert this change, it seems. From owner-svn-src-head@freebsd.org Mon Aug 29 18:11: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 60455BC7359; Mon, 29 Aug 2016 18:11:34 +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 19DC47E5; Mon, 29 Aug 2016 18:11:34 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1beR1w-0008y3-7K; Mon, 29 Aug 2016 21:11:32 +0300 Date: Mon, 29 Aug 2016 21:11:32 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305004 - in head/sys: amd64/amd64 amd64/include i386/i386 Message-ID: <20160829181132.GR88122@zxy.spb.ru> References: <201608291307.u7TD7L6H025649@repo.freebsd.org> <20160829173726.GX22212@zxy.spb.ru> <20160830034632.A3851@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160830034632.A3851@besplex.bde.org> 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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:11:34 -0000 On Tue, Aug 30, 2016 at 03:58:54AM +1000, Bruce Evans wrote: > On Mon, 29 Aug 2016, Slawa Olhovchenkov wrote: > > > On Mon, Aug 29, 2016 at 01:07:21PM +0000, Bruce Evans wrote: > >> ... > >> Log: > >> On amd64, declare sse2_pagezero() and start using it again, but only > >> for zeroing pages in idle where nontemporal writes are clearly best. > >> This is almost a no-op since zeroing in idle works does nothing good > >> and is off by default. Fix END() statement forgotten in previous > >> commit. > >> ... > > > > Do you think about using nontemporal writes for copying from user > > space to kernel space? In much cases this copy result don't need any parsing > > anf just go to DMA, eliminate cache use. > > I once tried that (for copyin/out, without DMA). It was just a small > pessimization. For small data, it increases setup overheads, and > large data isn't common enough to matter. DMA can be even slower > since it increases latency. First there is latency to set it up, > and May be I am not very clear: not using DMA for tranfer. Using nontemporal for data passed to devices DMA buffers. > then you often don't want it to touch the cache since that gives more > latency for cache misses. No, I am talk not about total replace such copy, only on per-case bases. I.e. introduce new function and use it in special cases (for example: tcp output). From owner-svn-src-head@freebsd.org Mon Aug 29 18:16: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 D0DA9BC74B6 for ; Mon, 29 Aug 2016 18:16:35 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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 60E7CC8E for ; Mon, 29 Aug 2016 18:16:35 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id f93so106768954lfi.2 for ; Mon, 29 Aug 2016 11:16:34 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=A+i2nZvMoWawk2Ubn46rhon+wPXJ7GR3GJhMnHdDRgc=; b=JrqR6x1QWigJ5u8hM1sZkRZu5UdHc9hc/h118jYPh6kwFA/DwmYSsryWUC1o0HVgzA 81uTaWy9NdoHFquKjcyf71DglEN1lCNho6rmky3deLsKn3zJQYGeeU9ujKut0kToEDH4 nTEGOo4Y1Z+X8zQsueTqefCUehHfx7hoR+fONvnogtLTNlcs7HaCi9WWZL6eN1tE8/Uc h8TXMXh9A8ycl3OoxA/AGFH0HBIPwzIjQKfsUmnbNPJZbvryxYKOlQCzde3gAfLzBEWz fVcuuXVXMlXGXiZcLK2B6dj/GeuHwrG+aoYEGcPao5eYXynPKTI4JjZOfdGFcbUJdVu7 DCcw== X-Gm-Message-State: AE9vXwO4W8ffQGTUaaZ5I6vZ6np8qkQyCByDqoB/QBejxqsqZq44un68k1TtJ1X1BqQqHA== X-Received: by 10.25.216.26 with SMTP id p26mr6028639lfg.122.1472494592903; Mon, 29 Aug 2016 11:16:32 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id h68sm6674155ljh.38.2016.08.29.11.16.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 11:16:32 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov , John Baldwin References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <18206408.GMLM77D01s@ralph.baldwin.cx> <20160829180454.GU83214@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Mon, 29 Aug 2016 21:16:29 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160829180454.GU83214@kib.kiev.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 18:16:35 -0000 On 29.08.2016 21:04, Konstantin Belousov wrote: > On Mon, Aug 29, 2016 at 08:46:47PM +0300, Andrey Chernov wrote: >> Either we implement this wrapper or left all things as is, we need to >> document internal errno clearing additionally, to not make people wonder >> why errno becomes 0, probably with the mention that program should not >> relay on this obsoleted implementation feature. > It was done in r304928. John want to revert this change, it seems. > Previous text is documented everywhere and describing usual good practice, so it should remains in place, in that means r304928 should be reverted, because replace proper way of doing things with obsoleted feature description. What I suggest is not _replace_ old text with new, but _add_ new text as describing current and not recommended way, with the direct mention that this feature is obsoleted and not recommended for relay on it. From owner-svn-src-head@freebsd.org Mon Aug 29 18: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 5DE6FBC7C0A; Mon, 29 Aug 2016 18:31: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 30996ABD; Mon, 29 Aug 2016 18:31: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 u7TIVY40051776; Mon, 29 Aug 2016 18:31:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TIVYq0051774; Mon, 29 Aug 2016 18:31:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608291831.u7TIVYq0051774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 29 Aug 2016 18:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305009 - 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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:31:35 -0000 Author: bdrewery Date: Mon Aug 29 18:31:34 2016 New Revision: 305009 URL: https://svnweb.freebsd.org/changeset/base/305009 Log: Allow parallelizing clean/cleandepend/depend with all. This now makes 'make -jX clean all install' safe. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Aug 29 18:00:14 2016 (r305008) +++ head/share/mk/bsd.dep.mk Mon Aug 29 18:31:34 2016 (r305009) @@ -297,6 +297,8 @@ cleandepend: rm -rf ${CLEANDEPENDDIRS} .endif .endif +.ORDER: cleandepend all +.ORDER: cleandepend depend .if !target(checkdpadd) && (defined(DPADD) || defined(LDADD)) _LDADD_FROM_DPADD= ${DPADD:R:T:C;^lib(.*)$;-l\1;g} Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Mon Aug 29 18:00:14 2016 (r305008) +++ head/share/mk/bsd.obj.mk Mon Aug 29 18:31:34 2016 (r305009) @@ -156,6 +156,7 @@ clean: -rm -rf ${CLEANDIRS} .endif .endif +.ORDER: clean all cleandir: cleanobj From owner-svn-src-head@freebsd.org Mon Aug 29 18:41: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 A213FBC30F8; Mon, 29 Aug 2016 18:41:07 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7D67B2535; Mon, 29 Aug 2016 18:41:07 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TIf6PQ053343; Mon, 29 Aug 2016 18:41:06 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TIf6mu053342; Mon, 29 Aug 2016 18:41:06 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608291841.u7TIf6mu053342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Aug 2016 18:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305010 - head/sys/dev/syscons 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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:41:07 -0000 Author: bde Date: Mon Aug 29 18:41:06 2016 New Revision: 305010 URL: https://svnweb.freebsd.org/changeset/base/305010 Log: Add screen locking calls to sc cn grab and ungrab. The locking functions just use the same mutex locking as sc cn putc so they have the same defects. The locking calls to acquire the lock are actually in sc cn open and close. Ungrab has to unlock, although this opens a race window. Change the direct mutex lock calls in sc cn putc to the new locking functions via the open and close functions. Putc also has to unlock, but doesn't keep the screen open like grab. Screen open and close reduce to locking, except screen open for grab also attempts to switch the screen. Keyboard locking is more difficult and still null, even when keyboard input calls screen functions, except some of the functions have locks too deep to work right. This organization gives a single place to fix some of the locking. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 29 18:31:34 2016 (r305009) +++ head/sys/dev/syscons/syscons.c Mon Aug 29 18:41:06 2016 (r305010) @@ -1649,6 +1649,20 @@ sc_cnterm(struct consdev *cp) static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp); static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags); +static void sccnscrlock(sc_softc_t *sc, struct sc_cnstate *sp); +static void sccnscrunlock(sc_softc_t *sc, struct sc_cnstate *sp); + +static void +sccnscrlock(sc_softc_t *sc, struct sc_cnstate *sp) +{ + SC_VIDEO_LOCK(sc); +} + +static void +sccnscrunlock(sc_softc_t *sc, struct sc_cnstate *sp) +{ + SC_VIDEO_UNLOCK(sc); +} static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags) @@ -1680,6 +1694,7 @@ sccnopen(sc_softc_t *sc, struct sc_cnsta over_keyboard: ; /* The screen is opened iff locking it succeeds. */ + sccnscrlock(sc, sp); sp->scr_opened = TRUE; /* The screen switch is optional. */ @@ -1698,6 +1713,7 @@ static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp) { sp->scr_opened = FALSE; + sccnscrunlock(sc, sp); if (!sp->kbd_opened) return; @@ -1731,8 +1747,10 @@ sc_cngrab(struct consdev *cp) sc = sc_console->sc; lev = atomic_fetchadd_int(&sc->grab_level, 1); - if (lev >= 0 && lev < 2) + if (lev >= 0 && lev < 2) { sccnopen(sc, &sc->grab_state[lev], 1 | 2); + sccnscrunlock(sc, &sc->grab_state[lev]); + } } static void @@ -1743,14 +1761,17 @@ sc_cnungrab(struct consdev *cp) sc = sc_console->sc; lev = atomic_load_acq_int(&sc->grab_level) - 1; - if (lev >= 0 && lev < 2) + if (lev >= 0 && lev < 2) { + sccnscrlock(sc, &sc->grab_state[lev]); sccnclose(sc, &sc->grab_state[lev]); + } atomic_add_int(&sc->grab_level, -1); } static void sc_cnputc(struct consdev *cd, int c) { + struct sc_cnstate st; u_char buf[1]; scr_stat *scp = sc_console; #ifndef SC_NO_HISTORY @@ -1762,7 +1783,7 @@ sc_cnputc(struct consdev *cd, int c) /* assert(sc_console != NULL) */ - SC_VIDEO_LOCK(scp->sc); + sccnopen(scp->sc, &st, 0); #ifndef SC_NO_HISTORY if (scp == scp->sc->cur_scp && scp->status & SLKED) { @@ -1797,7 +1818,7 @@ sc_cnputc(struct consdev *cd, int c) s = spltty(); /* block sckbdevent and scrn_timer */ sccnupdate(scp); splx(s); - SC_VIDEO_UNLOCK(scp->sc); + sccnclose(scp->sc, &st); } static int From owner-svn-src-head@freebsd.org Mon Aug 29 18:45: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 98022BC32F1 for ; Mon, 29 Aug 2016 18:45:39 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26F492924 for ; Mon, 29 Aug 2016 18:45:38 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f44.google.com with SMTP id f93so107307466lfi.2 for ; Mon, 29 Aug 2016 11:45:38 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6PlFIDxusg+JsGmaBt64M85Egw6mA/sIVpDZc2Xcndw=; b=cezqLOMkjx8yW0AKhLFULLyJslRdxvN6T8nH1yQYBgN/tVilPl6u8Ti6L87s3pGTww isk3jdnQpiuY0+ULSooHc07CekIF2ialdJgM7a+jdmz2QJRkw4Yw+IWcmkq2NIOe7dzL t4Tl9fCgBgYcL5WbrRoXEhFkmHE5cbpaxjEuwCTI3QZMSY4+G+LOGzkvE8ljiaS04nqr q6MSPRayShf1mDgxI+uyNOUToUc+xM9QnQKm5N9gtCOSeD5w45TpPBoCpe0GSanz61ED v9hdqZDHSMp7VQuy8IhMqlIPk1x6fRZxoXZCLSD0pXP1UzAwthJdrSPiubnfIpjFG/6B XojQ== X-Gm-Message-State: AE9vXwO0znqPDa7r1XooAKg8wXTAZ7YBc51x79xIrjfxXd02P7wlHXfVwN+8Jytgle4OFA== X-Received: by 10.25.131.141 with SMTP id f135mr4679013lfd.217.1472496336100; Mon, 29 Aug 2016 11:45:36 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id p128sm6675875lfb.32.2016.08.29.11.45.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 11:45:35 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov , John Baldwin References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <18206408.GMLM77D01s@ralph.baldwin.cx> <20160829180454.GU83214@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Mon, 29 Aug 2016 21:45:33 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 18:45:39 -0000 On 29.08.2016 21:16, Andrey Chernov wrote: > On 29.08.2016 21:04, Konstantin Belousov wrote: >> On Mon, Aug 29, 2016 at 08:46:47PM +0300, Andrey Chernov wrote: >>> Either we implement this wrapper or left all things as is, we need to >>> document internal errno clearing additionally, to not make people wonder >>> why errno becomes 0, probably with the mention that program should not >>> relay on this obsoleted implementation feature. >> It was done in r304928. John want to revert this change, it seems. >> > Previous text is documented everywhere and describing usual good > practice, so it should remains in place, in that means r304928 should be > reverted, because replace proper way of doing things with obsoleted > feature description. > > What I suggest is not _replace_ old text with new, but _add_ new text as > describing current and not recommended way, with the direct mention that > this feature is obsoleted and not recommended for relay on it. I.e. add to old text something like this (my English is bad, so it probably needs correction): "Currently ptrace(2) always set errno to 0 at the start, but portable program should not relay on this obsoleted feature". From owner-svn-src-head@freebsd.org Mon Aug 29 18:46: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 448A1BC335B; Mon, 29 Aug 2016 18:46:06 +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 123F92A83; Mon, 29 Aug 2016 18:46:05 +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 u7TIk50v056852; Mon, 29 Aug 2016 18:46:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TIk56j056851; Mon, 29 Aug 2016 18:46:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608291846.u7TIk56j056851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 Aug 2016 18:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305011 - head/usr.sbin/newsyslog/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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:46:06 -0000 Author: ngie Date: Mon Aug 29 18:46:04 2016 New Revision: 305011 URL: https://svnweb.freebsd.org/changeset/base/305011 Log: Expect sub testcases 2-4 in :tests_time_rotate to fail today due to changes to newsyslog, etc made in the past month. The issue is being root-caused as part of the bug noted below. This commit will need to be partially reverted once the issue has been found/fixed PR: 212160 Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh ============================================================================== --- head/usr.sbin/newsyslog/tests/legacy_test.sh Mon Aug 29 18:41:06 2016 (r305010) +++ head/usr.sbin/newsyslog/tests/legacy_test.sh Mon Aug 29 18:46:04 2016 (r305011) @@ -20,13 +20,22 @@ begin() # End an individual test end() { + local message + if [ $OK = 1 ] then - printf 'ok ' + message='ok ' else - printf 'not ok ' + message='not ok ' + fi + + message="$message $COUNT - $NAME" + if [ -n "$TODO" ] + then + message="$message # TODO $TODO" fi - echo "$COUNT - $NAME" + + echo "$message" } # Make a file that can later be verified @@ -336,6 +345,9 @@ tests_time_rotate() { sleep 1.1 + ( + TODO="rotate time 2-4 fail today; bug 212160" + begin "rotate time 2 ${name_postfix}" run_newsyslog ${newsyslog_args} ckfe ${LOGFNAME} @@ -357,6 +369,7 @@ tests_time_rotate() { ckfe ${LOGFNAME} chkfcnt 3 ${dir}${LOGFNAME}.*${ext} end + ) begin "noaction ${name_postfix}" ofiles=`ls -1 ${dir}${LOGFNAME}.*${ext} | tr -d '\n'` From owner-svn-src-head@freebsd.org Mon Aug 29 18:47: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 6F276BC3428; Mon, 29 Aug 2016 18:47:53 +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 30BA92C22; Mon, 29 Aug 2016 18:47:53 +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 u7TIlqd0056980; Mon, 29 Aug 2016 18:47:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TIlpkS056969; Mon, 29 Aug 2016 18:47:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608291847.u7TIlpkS056969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 18:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305012 - in head/lib/libc: amd64/sys arm/sys i386/sys include mips/sys powerpc/sys powerpc64/sys sparc64/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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:47:53 -0000 Author: kib Date: Mon Aug 29 18:47:51 2016 New Revision: 305012 URL: https://svnweb.freebsd.org/changeset/base/305012 Log: Rewrite ptrace(2) wrappers in C. Besides removing hand-translation to assembler, this also adds missing wrappers for arm64 and risc-v. Reviewed by: emaste, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D7694 Added: head/lib/libc/sys/ptrace.c (contents, props changed) Deleted: head/lib/libc/amd64/sys/ptrace.S head/lib/libc/arm/sys/ptrace.S head/lib/libc/i386/sys/ptrace.S head/lib/libc/mips/sys/ptrace.S head/lib/libc/powerpc/sys/ptrace.S head/lib/libc/powerpc64/sys/ptrace.S head/lib/libc/sparc64/sys/ptrace.S Modified: head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/Makefile.inc head/lib/libc/include/libc_private.h head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/amd64/sys/Makefile.inc Mon Aug 29 18:47:51 2016 (r305012) @@ -4,7 +4,7 @@ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ amd64_set_gsbase.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ +MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ sbrk.S setlogin.S sigreturn.S # Don't generate default code for these syscalls: Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/arm/sys/Makefile.inc Mon Aug 29 18:47:51 2016 (r305012) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/i386/sys/Makefile.inc Mon Aug 29 18:47:51 2016 (r305012) @@ -7,7 +7,7 @@ SRCS+= i386_clr_watch.c i386_set_watch.c SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c -MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ +MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ sbrk.S setlogin.S sigreturn.S syscall.S # Don't generate default code for these syscalls: Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/include/libc_private.h Mon Aug 29 18:47:51 2016 (r305012) @@ -335,6 +335,7 @@ int __sys_openat(int, const char *, int int __sys_pselect(int, struct fd_set *, struct fd_set *, struct fd_set *, const struct timespec *, const __sigset_t *); +int __sys_ptrace(int, __pid_t, char *, int); int __sys_poll(struct pollfd *, unsigned, int); int __sys_ppoll(struct pollfd *, unsigned, const struct timespec *, const __sigset_t *); Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/mips/sys/Makefile.inc Mon Aug 29 18:47:51 2016 (r305012) @@ -3,7 +3,7 @@ SRCS+= trivial-vdso_tc.c MDASM= Ovfork.S brk.S cerror.S exect.S \ - ptrace.S sbrk.S syscall.S + sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/powerpc/sys/Makefile.inc Mon Aug 29 18:47:51 2016 (r305012) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o yield.o Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/powerpc64/sys/Makefile.inc Mon Aug 29 18:47:51 2016 (r305012) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o yield.o Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/sparc64/sys/Makefile.inc Mon Aug 29 18:47:51 2016 (r305012) @@ -12,7 +12,7 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o yield.o Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Mon Aug 29 18:46:04 2016 (r305011) +++ head/lib/libc/sys/Makefile.inc Mon Aug 29 18:47:51 2016 (r305012) @@ -48,6 +48,7 @@ INTERPOSED = \ poll \ ppoll \ pselect \ + ptrace \ read \ readv \ recvfrom \ Added: head/lib/libc/sys/ptrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/ptrace.c Mon Aug 29 18:47:51 2016 (r305012) @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice(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 "libc_private.h" + +__weak_reference(_ptrace, ptrace); + +int +_ptrace(int request, pid_t pid, caddr_t addr, int data) +{ + + errno = 0; + return (__sys_ptrace(request, pid, addr, data)); +} From owner-svn-src-head@freebsd.org Mon Aug 29 18:51: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 C8D03BC35AC; Mon, 29 Aug 2016 18:51:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3B520D; Mon, 29 Aug 2016 18:51:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TIpntP060052; Mon, 29 Aug 2016 18:51:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TIpnUu060051; Mon, 29 Aug 2016 18:51:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608291851.u7TIpnUu060051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 Aug 2016 18:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305013 - head/cddl/usr.sbin/zfsd 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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:51:50 -0000 Author: dim Date: Mon Aug 29 18:51:49 2016 New Revision: 305013 URL: https://svnweb.freebsd.org/changeset/base/305013 Log: Add an empty virtual destructor to zfsd's Vdev class. This is needed because the class has virtual functions, and the compiler-generated default destructor is non-virtual. Reviewed by: asomers MFC after: 3 days Modified: head/cddl/usr.sbin/zfsd/vdev.h Modified: head/cddl/usr.sbin/zfsd/vdev.h ============================================================================== --- head/cddl/usr.sbin/zfsd/vdev.h Mon Aug 29 18:47:51 2016 (r305012) +++ head/cddl/usr.sbin/zfsd/vdev.h Mon Aug 29 18:51:49 2016 (r305013) @@ -108,6 +108,12 @@ public: * \brief No-op copy constructor for nonexistent vdevs. */ Vdev(); + + /** + * \brief No-op virtual destructor, since this class has virtual + * functions. + */ + virtual ~Vdev(); bool DoesNotExist() const; /** @@ -145,6 +151,10 @@ private: extern Vdev NonexistentVdev; //- Vdev Inline Public Methods ------------------------------------------------ +inline Vdev::~Vdev() +{ +} + inline DevdCtl::Guid Vdev::PoolGUID() const { From owner-svn-src-head@freebsd.org Mon Aug 29 18:53: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 692F2BC3757; Mon, 29 Aug 2016 18:53:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38FC987D; Mon, 29 Aug 2016 18:53:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TIrpMD060922; Mon, 29 Aug 2016 18:53:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TIrpxw060921; Mon, 29 Aug 2016 18:53:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608291853.u7TIrpxw060921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 18:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305015 - head/lib/libc/aarch64/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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:53:52 -0000 Author: kib Date: Mon Aug 29 18:53:51 2016 New Revision: 305015 URL: https://svnweb.freebsd.org/changeset/base/305015 Log: Remove commented out mention of ptrace.S. After r305012 the asm wrapper is not needed. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/aarch64/sys/Makefile.inc Modified: head/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/sys/Makefile.inc Mon Aug 29 18:53:36 2016 (r305014) +++ head/lib/libc/aarch64/sys/Makefile.inc Mon Aug 29 18:53:51 2016 (r305015) @@ -4,7 +4,6 @@ MIASM:= ${MIASM:Nfreebsd[467]_*} SRCS+= __vdso_gettc.c -#MDASM= ptrace.S MDASM= cerror.S \ shmat.S \ sigreturn.S \ From owner-svn-src-head@freebsd.org Mon Aug 29 18:55: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 E227ABC3844; Mon, 29 Aug 2016 18:55:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4C59A05; Mon, 29 Aug 2016 18:55:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TIt6Le061034; Mon, 29 Aug 2016 18:55:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TIt6AJ061032; Mon, 29 Aug 2016 18:55:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608291855.u7TIt6AJ061032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 Aug 2016 18:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305016 - head/cddl/usr.sbin/zfsd/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.22 Precedence: list List-Id: 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, 29 Aug 2016 18:55:08 -0000 Author: dim Date: Mon Aug 29 18:55:06 2016 New Revision: 305016 URL: https://svnweb.freebsd.org/changeset/base/305016 Log: Fix the zfsd unittest: * TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin * DevdCtl::EventBuffer no longer exists, so remove its forward declaration MFC after: 3 days X-MFC-With: r305013 Modified: head/cddl/usr.sbin/zfsd/tests/Makefile head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc Modified: head/cddl/usr.sbin/zfsd/tests/Makefile ============================================================================== --- head/cddl/usr.sbin/zfsd/tests/Makefile Mon Aug 29 18:53:51 2016 (r305015) +++ head/cddl/usr.sbin/zfsd/tests/Makefile Mon Aug 29 18:55:06 2016 (r305016) @@ -4,7 +4,7 @@ SRCDIR=${.CURDIR}/../../../.. .include "${.CURDIR}/../Makefile.common" .PATH: ${.CURDIR}/.. -TESTSDIR?= ${TESTSBASE}/cddl/sbin/zfsd +TESTSDIR?= ${TESTSBASE}/cddl/usr.sbin/zfsd PLAIN_TESTS_CXX= zfsd_unittest SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} Modified: head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc Mon Aug 29 18:53:51 2016 (r305015) +++ head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc Mon Aug 29 18:55:06 2016 (r305016) @@ -72,7 +72,6 @@ using std::string; using std::stringstream; using DevdCtl::Event; -using DevdCtl::EventBuffer; using DevdCtl::EventFactory; using DevdCtl::EventList; using DevdCtl::Guid; From owner-svn-src-head@freebsd.org Mon Aug 29 18:57: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 54F63BC39FE; Mon, 29 Aug 2016 18:57:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22614DA1; Mon, 29 Aug 2016 18:57:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id i6so9743937pfe.0; Mon, 29 Aug 2016 11:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=HMOwJi03BtMDQ/GiJGCNzsuwcU+sYDr2ZY4X7skkRTY=; b=Vb8UFfiyrUgzFfAbYaY4j6g2HgvXanKQI5essGj3YJXpBaptm70h1suM7xbWQZKJYR lMwiXXFQaAGYh2vA0npGbHpRxsSU49jt2Dz4ZNceNWqLPmzCUAaIsu9zPxjin/0DJ5ni 808Jwe44f5YDs4lVxg5FXMAuALfr6WSfxIc5yuqlxk5ikTUoVsb1oUYdJW96mVbPpIA6 ZJjqWjo6/xsurrjIDYW9A1kSyZqRYPEYETa5/G7k2O3BHkaCvV6g0mlgAKqjKo0+5+bx 1KdoJW8oqb7jCiTBLshVSenWkedELNXDUahvMyQxKFryFw6YhZM9/PiYOWp9iu8Rw7xW mBlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=HMOwJi03BtMDQ/GiJGCNzsuwcU+sYDr2ZY4X7skkRTY=; b=k1fadRTwwqm+BbTFpSmAEm2jKRFd7LlaI5vlZYBHMeNXAiE3qAqmjzS4DzcS/st4j2 UfxG2UbXO3/8qeZ+6/CbwGPOICIXX3DaWS93dCtmNLhIuB2aYndmCISC8HGdsijxcmMu KDP4yj7XE0vxKkIxsWRvSXJI4tmN46+fTFdiRdsmhFRRz21nAculBykoqN1HoxWx5DY7 NXyjvpEFVY1iiyfu/S87ohTSULo0JoEdWnhSspxCT3LrXIZru0cJNmN/yxP078FZ7r+0 xK/TVgzNhz2dl4P3d8rVFAwVfYyHsOZ928ndc3PdDNqg3WhgPX5QI3/xynglFjFPvwGX 53Dw== X-Gm-Message-State: AE9vXwP7vmncb1pwr+g6k1Gz6W+SN/WD1pQw5K3tCut6/qIWbfboK94O1rV/E21/84B3Hw== X-Received: by 10.98.155.17 with SMTP id r17mr35399164pfd.24.1472497060588; Mon, 29 Aug 2016 11:57:40 -0700 (PDT) Received: from [192.168.20.17] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id d5sm51030012pfa.44.2016.08.29.11.57.39 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Aug 2016 11:57:39 -0700 (PDT) Subject: Re: svn commit: r305016 - head/cddl/usr.sbin/zfsd/tests Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_716FD62A-41EE-40C8-86DE-2AA1B26B7EFD"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201608291855.u7TIt6AJ061032@repo.freebsd.org> Date: Mon, 29 Aug 2016 11:57:35 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201608291855.u7TIt6AJ061032@repo.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 18:57:41 -0000 --Apple-Mail=_716FD62A-41EE-40C8-86DE-2AA1B26B7EFD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 29, 2016, at 11:55, Dimitry Andric wrote: >=20 > Author: dim > Date: Mon Aug 29 18:55:06 2016 > New Revision: 305016 > URL: https://svnweb.freebsd.org/changeset/base/305016 >=20 > Log: > Fix the zfsd unittest: > * TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin > * DevdCtl::EventBuffer no longer exists, so remove its forward > declaration >=20 > MFC after: 3 days > X-MFC-With: r305013 >=20 > Modified: > head/cddl/usr.sbin/zfsd/tests/Makefile > head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc >=20 > Modified: head/cddl/usr.sbin/zfsd/tests/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/cddl/usr.sbin/zfsd/tests/Makefile Mon Aug 29 18:53:51 2016 = (r305015) > +++ head/cddl/usr.sbin/zfsd/tests/Makefile Mon Aug 29 18:55:06 2016 = (r305016) > @@ -4,7 +4,7 @@ SRCDIR=3D${.CURDIR}/../../../.. > .include "${.CURDIR}/../Makefile.common" > .PATH: ${.CURDIR}/.. >=20 > -TESTSDIR?=3D ${TESTSBASE}/cddl/sbin/zfsd > +TESTSDIR?=3D ${TESTSBASE}/cddl/usr.sbin/zfsd This is unnecessary on ^/head. I=E2=80=99ll delete it in a minute. Thanks, -Ngie --Apple-Mail=_716FD62A-41EE-40C8-86DE-2AA1B26B7EFD Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXxIWjAAoJEPWDqSZpMIYV7hIQAMErzLbUSuYDcDbKs66Gn7Fe vipMfBVrWB2x/HIpzm+INI2ZwuCsad5m7ieQeKoJEd0GLedLxj1FkvSx+WvNCK7H Z8R81OQgKUZiTOB3dfgwgBPN+PwLko3DM1sOAZSdf5l4WWxnJLPlTPpb9lMFOpmS nI0oRY+/FPgPJDi/gTbTi9r53mnoKwwhUY0ozfi9kC32HVvJfdEyiJDrqDTJXzLN l4YquStzowY73hHPGOFn9UudbHP5HW9HB+7Dvy/rQjWUhKdxCt9G/MixJV4F4jh1 SaYjRSB8dLHeaErt9RUqEWTIOBA1roWaqYjlXqAHPcsyJZXy5qF97Z1zXpuXsqdD p559jDTVq6kmxD/jkp8qirc/zQfgHZLxkVXxKVCiaSu/uh5QOVL9s4isKnqBApUa ZcZCRivoQcFsI/IeOiYXDnPSd2tfKHz+Qgg3Y1bno9xUA+L16yokFDv8aNWtfcUO wdqTwSWzlhjbu8pE8alKaRTZyljT6cwUS7J8h8vMq3giYJrB43Tj2Ww2S3eaJXbr uJ4JHmrhEy747gMvsfh1Cf45c30peBD3JRKlj8yRqNgun7frPGBT5ZSC787M5y6U z1ngSGtgAuh6MYroGKAnEui1N0gJ04MGf+snTPuffqUXWkp/eMV+2dJ15JFivtHL RXWutYj6e3kfTKgaJNS9 =QgN1 -----END PGP SIGNATURE----- --Apple-Mail=_716FD62A-41EE-40C8-86DE-2AA1B26B7EFD-- From owner-svn-src-head@freebsd.org Mon Aug 29 19:06: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 A6B47BC3D52; Mon, 29 Aug 2016 19:06:41 +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 5D55A893; Mon, 29 Aug 2016 19:06:41 +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 u7TJ6egi065315; Mon, 29 Aug 2016 19:06:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TJ6e2v065314; Mon, 29 Aug 2016 19:06:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608291906.u7TJ6e2v065314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 Aug 2016 19:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305018 - head/cddl/usr.sbin/zfsd 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.22 Precedence: list List-Id: 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, 29 Aug 2016 19:06:41 -0000 Author: ngie Date: Mon Aug 29 19:06:40 2016 New Revision: 305018 URL: https://svnweb.freebsd.org/changeset/base/305018 Log: Use SRCTOP instead of a homegrown definition for it (SRCDIR) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/usr.sbin/zfsd/Makefile.common Modified: head/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- head/cddl/usr.sbin/zfsd/Makefile.common Mon Aug 29 18:59:43 2016 (r305017) +++ head/cddl/usr.sbin/zfsd/Makefile.common Mon Aug 29 19:06:40 2016 (r305018) @@ -15,20 +15,20 @@ WARNS?= 3 # Ignore warnings about Solaris specific pragmas. IGNORE_PRAGMA= YES -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzpool/common -INCFLAGS+= -I${SRCDIR}/cddl/compat/opensolaris/include -INCFLAGS+= -I${SRCDIR}/cddl/compat/opensolaris/lib/libumem -INCFLAGS+= -I${SRCDIR}/sys/cddl/compat/opensolaris -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/head -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libuutil/common -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libumem/common -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzfs_core/common -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libzfs/common -INCFLAGS+= -I${SRCDIR}/cddl/contrib/opensolaris/lib/libnvpair -INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/common/zfs -INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common -INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -INCFLAGS+= -I${SRCDIR}/sys/cddl/contrib/opensolaris/uts/common/sys +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +INCFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +INCFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +INCFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libumem/common +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} From owner-svn-src-head@freebsd.org Mon Aug 29 19:07:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F113CBC3E28; Mon, 29 Aug 2016 19:07:49 +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 C24F8A38; Mon, 29 Aug 2016 19:07:49 +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 u7TJ7mYh065395; Mon, 29 Aug 2016 19:07:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TJ7mbl065394; Mon, 29 Aug 2016 19:07:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608291907.u7TJ7mbl065394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 Aug 2016 19:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305019 - head/cddl/usr.sbin/zfsd 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.22 Precedence: list List-Id: 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, 29 Aug 2016 19:07:50 -0000 Author: ngie Date: Mon Aug 29 19:07:48 2016 New Revision: 305019 URL: https://svnweb.freebsd.org/changeset/base/305019 Log: Remove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.common MFC after: 1 week X-MFC with: r305018 Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/usr.sbin/zfsd/Makefile Modified: head/cddl/usr.sbin/zfsd/Makefile ============================================================================== --- head/cddl/usr.sbin/zfsd/Makefile Mon Aug 29 19:06:40 2016 (r305018) +++ head/cddl/usr.sbin/zfsd/Makefile Mon Aug 29 19:07:48 2016 (r305019) @@ -1,6 +1,5 @@ # $FreeBSD$ -SRCDIR=${.CURDIR}/../../.. .include "Makefile.common" PROG_CXX= zfsd From owner-svn-src-head@freebsd.org Mon Aug 29 19:10: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 1324CBC3FA5; Mon, 29 Aug 2016 19:10:41 +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 7604DC40; Mon, 29 Aug 2016 19:10:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7TJAZSD035395 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 29 Aug 2016 22:10:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7TJAZSD035395 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7TJAZ5j035394; Mon, 29 Aug 2016 22:10:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Aug 2016 22:10:35 +0300 From: Konstantin Belousov To: Andrey Chernov Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Message-ID: <20160829191035.GV83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <18206408.GMLM77D01s@ralph.baldwin.cx> <20160829180454.GU83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 29 Aug 2016 19:10:41 -0000 On Mon, Aug 29, 2016 at 09:16:29PM +0300, Andrey Chernov wrote: > Previous text is documented everywhere and describing usual good > practice, so it should remains in place, in that means r304928 should be > reverted, because replace proper way of doing things with obsoleted > feature description. > > What I suggest is not _replace_ old text with new, but _add_ new text as > describing current and not recommended way, with the direct mention that > this feature is obsoleted and not recommended for relay on it. > diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index 48802f4..d406efc 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd August 28, 2016 +.Dd August 29, 2016 .Dt PTRACE 2 .Os .Sh NAME @@ -900,19 +900,29 @@ argument is ignored. .Pp Additionally, other machine-specific requests can exist. .Sh RETURN VALUES +Most requests return 0 on success and \-1 on error. Some requests can cause .Fn ptrace to return \-1 -as a non-error value; to disambiguate, +as a non-error value, among them are +.Dv PT_READ_I +and +.Dv PT_READ_D , +which return the value read from the process memory on success. +To disambiguate, .Va errno -is set to 0 in the libc wrapper for the -.Fn ptrace -system call and +can be set to 0 before the call and checked afterwards. +.Pp +Current .Fn ptrace -callers can reliably check +implementation always sets +.Va errno +to 0 before calling into kernel, both for historic reasons and for +consistency with other operating systems. +It is recommended to assign zero to .Va errno -for non-zero value afterwards. +explicitely for future compatibility. .Sh ERRORS The .Fn ptrace From owner-svn-src-head@freebsd.org Mon Aug 29 19:10: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 6DA64BC3FEF; Mon, 29 Aug 2016 19:10:59 +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 3DC63DD9; Mon, 29 Aug 2016 19:10:59 +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 u7TJAw6K066284; Mon, 29 Aug 2016 19:10:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TJAwXn066283; Mon, 29 Aug 2016 19:10:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608291910.u7TJAwXn066283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 Aug 2016 19:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305020 - head/cddl/usr.sbin/zfsd/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.22 Precedence: list List-Id: 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, 29 Aug 2016 19:10:59 -0000 Author: ngie Date: Mon Aug 29 19:10:58 2016 New Revision: 305020 URL: https://svnweb.freebsd.org/changeset/base/305020 Log: Remove redundant declarations and simplify ../ in pathing - TESTSBASE and LOCALBASE are already defined in bsd.tests.mk - TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after r289158. - Replace SRCDIR with SRCTOP MFC after: 1 week X-MFC with: r305019 Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/usr.sbin/zfsd/tests/Makefile Modified: head/cddl/usr.sbin/zfsd/tests/Makefile ============================================================================== --- head/cddl/usr.sbin/zfsd/tests/Makefile Mon Aug 29 19:07:48 2016 (r305019) +++ head/cddl/usr.sbin/zfsd/tests/Makefile Mon Aug 29 19:10:58 2016 (r305020) @@ -1,10 +1,7 @@ # $FreeBSD$ -SRCDIR=${.CURDIR}/../../../.. .include "${.CURDIR}/../Makefile.common" -.PATH: ${.CURDIR}/.. - -TESTSDIR?= ${TESTSBASE}/cddl/usr.sbin/zfsd +.PATH: ${.CURDIR:H} PLAIN_TESTS_CXX= zfsd_unittest SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} @@ -12,7 +9,7 @@ SRCS.zfsd_unittest+= libmocks.c zfsd_un SRCS= # Use #include in test programs. -INCFLAGS+= -I${.CURDIR}/../.. +INCFLAGS+= -I${.CURDIR:H:H} .if defined(DESTDIR) INCFLAGS+= -I${DESTDIR}/usr/include @@ -27,7 +24,6 @@ LIBRARY_PATH= .endif # Googletest options -LOCALBASE?= /usr/local INCFLAGS+= -I${LOCALBASE}/include -D_THREAD_SAFE -pthread LDFLAGS.zfsd_unittest+= -L${LOCALBASE}/lib -D_THREAD_SAFE -pthread LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgtest.a @@ -39,7 +35,4 @@ LDADD.zfsd_unittest+= ${LOCALBASE}/lib/l # https://groups.google.com/forum/#!msg/googletestframework/h8ixEPCFm0o/amwfu4xGJb0J CFLAGS.zfsd_unittest+= -DGTEST_HAS_PTHREAD -# Install the tests -TESTSBASE?= /usr/tests - .include From owner-svn-src-head@freebsd.org Mon Aug 29 19:14: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 A23B9BC71FF; Mon, 29 Aug 2016 19:14:42 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com [IPv6:2607:f8b0:4003:c06::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 6418F1E3; Mon, 29 Aug 2016 19:14:42 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x230.google.com with SMTP id f189so209796014oig.3; Mon, 29 Aug 2016 12:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+o1y8Tc2IfCpdeDVt7aBmXIiEnXHASHKH+GQJlEw6JI=; b=OpwK9IY/aUx9/NiP8e6+z/exlQyy3NY0DdKR//zoIDBZhzEGOskAYTjnuiBeIZjN7v Evk88fEeilCuPi0UEkYQO4D+risjVeaBAOoYOyZOR8YJ3Dt/AQV4nPC/1txqLw+pRD8W wFRI6aWG73dKqzbyg3moKyP8Qdr81hgr66vicN+skFA/L6anHNbkbTQUbDYiF2AGsYFa HoMBYOTl5FGrQX53pbIzpsIRUb2lKzqN6jLsHneUaz2pcahB/rUiB+xy8sTVrdqJaQ9z K9qNRMOEwCnz9wqEFj/O6lGdQBNANvgsZ0KU8kaM7GmkC2BZrZ8n6jn1AYs8E4+8MkYV MQfA== 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; bh=+o1y8Tc2IfCpdeDVt7aBmXIiEnXHASHKH+GQJlEw6JI=; b=OSTy0W5DccQvDDOA8JOIUSoFIvm8vifFZ2DE5pPAbdfoRY0np4ZJXkuh38BxiMPd/t tJDXJVr00ogClurec4pIjmFDakNzDYfsk8v8kh/r4ehn2q7PuAuOnZJBJSW52si12Zci jGlDf6XYplKpXTE4GTYds701QUG/LD56DKkpxyAnodS4RmXd1UVIsvQwn91M+EkGUHQE LE3+JWe498RqIdKhJVkMtddpnLeOPAkxo11omIULLRUERe6eoSLgjBE+k+NCQ2ZTVCvf +ooLFc6970riFTK8RzyhDXfgZdvkcL8dtMbFfeCLmbXNf8kADS1moCevBdNSUbvtT3+X i9ag== X-Gm-Message-State: AE9vXwON+Gqa8CiexXkGSGEbWUTjSK+D+5PCPeJOCzGRSQksmDm7CZfzKUl5wBb8GC8jorrNDFnVyQlnUIkrIA== X-Received: by 10.157.4.200 with SMTP id 66mr13298193otm.171.1472498081799; Mon, 29 Aug 2016 12:14:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.46.104 with HTTP; Mon, 29 Aug 2016 12:14:41 -0700 (PDT) In-Reply-To: <20160829191035.GV83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <18206408.GMLM77D01s@ralph.baldwin.cx> <20160829180454.GU83214@kib.kiev.ua> <20160829191035.GV83214@kib.kiev.ua> From: Benjamin Kaduk Date: Mon, 29 Aug 2016 14:14:41 -0500 Message-ID: Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov Cc: Andrey Chernov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 19:14:42 -0000 On Mon, Aug 29, 2016 at 2:10 PM, Konstantin Belousov wrote: > On Mon, Aug 29, 2016 at 09:16:29PM +0300, Andrey Chernov wrote: > > Previous text is documented everywhere and describing usual good > > practice, so it should remains in place, in that means r304928 should be > > reverted, because replace proper way of doing things with obsoleted > > feature description. > > > > What I suggest is not _replace_ old text with new, but _add_ new text as > > describing current and not recommended way, with the direct mention that > > this feature is obsoleted and not recommended for relay on it. > > > > diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 > index 48802f4..d406efc 100644 > --- a/lib/libc/sys/ptrace.2 > +++ b/lib/libc/sys/ptrace.2 > @@ -2,7 +2,7 @@ > .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ > .\" > .\" This file is in the public domain. > -.Dd August 28, 2016 > +.Dd August 29, 2016 > .Dt PTRACE 2 > .Os > .Sh NAME > @@ -900,19 +900,29 @@ argument is ignored. > .Pp > Additionally, other machine-specific requests can exist. > .Sh RETURN VALUES > +Most requests return 0 on success and \-1 on error. > Some requests can cause > .Fn ptrace > to return > \-1 > -as a non-error value; to disambiguate, > +as a non-error value, among them are > +.Dv PT_READ_I > +and > +.Dv PT_READ_D , > +which return the value read from the process memory on success. > +To disambiguate, > .Va errno > -is set to 0 in the libc wrapper for the > -.Fn ptrace > -system call and > +can be set to 0 before the call and checked afterwards. > +.Pp > +Current > The current > .Fn ptrace > -callers can reliably check > +implementation always sets > +.Va errno > +to 0 before calling into kernel, both for historic reasons and for > the kernel > +consistency with other operating systems. > +It is recommended to assign zero to > .Va errno > -for non-zero value afterwards. > +explicitely for future compatibility. > "explicitly" (only one 'e') Maybe forward compatibility instead of future compatibility, but either is fine. Feel free to commit with reviewed-by: bjk -Ben > .Sh ERRORS > The > .Fn ptrace > _______________________________________________ > 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 Aug 29 19:26: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 470F8BC77A0 for ; Mon, 29 Aug 2016 19:26:14 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C648BCB2 for ; Mon, 29 Aug 2016 19:26:13 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f50.google.com with SMTP id l89so108086295lfi.1 for ; Mon, 29 Aug 2016 12:26:13 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xGOHnyqsFd/M3LhdEWQ9P/Qr9fJdEIa29ysTSO8XZ/g=; b=DopnWJZYjKxcZKEz+Xupvm12qgk/QtrB8+Igs3IiQaQce7y9sAWMs1wEuDkI3zGBoV CLQq5C6sWv9qqbRCAMqHL4HdwzuiWpKQbk3muQS3AULO82PvTEnL3QFimG8lXV2+bSEZ Q9CHL3T7pI9Gf6RJpGa/lKp3SAnEAi4Z3N/BpSkAc53G6i2juHNKdjHrdo0E47yW4Gr7 fKAGr4UYqUxVcu7HSf8gh8AzwKgi6AGHvK8XE1IZuC7TzTscxSsArgXzHnUui03gfoYi cKUwBOPTy/3H00k+YQzKngd9w58zIbbaKM1rhuG65lbdEeoFifkvO1hsTumx0hQxNae3 MTew== X-Gm-Message-State: AE9vXwNxr6Rh9BmOsNIuVQS31UPLJJZhWhfCc1FQYYAHyV0S6sTg4RMZm9aOmU4HgjgcBA== X-Received: by 10.25.85.198 with SMTP id j189mr6161937lfb.31.1472498771159; Mon, 29 Aug 2016 12:26:11 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id n128sm6709935lfb.45.2016.08.29.12.26.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 12:26:10 -0700 (PDT) Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys To: Konstantin Belousov References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <1595604.93PBdSz0kX@ralph.baldwin.cx> <20160829065813.GP83214@kib.kiev.ua> <18206408.GMLM77D01s@ralph.baldwin.cx> <20160829180454.GU83214@kib.kiev.ua> <20160829191035.GV83214@kib.kiev.ua> Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <450d34cd-9b7c-941e-fa6e-9cb358c93307@freebsd.org> Date: Mon, 29 Aug 2016 22:26:08 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160829191035.GV83214@kib.kiev.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 19:26:14 -0000 On 29.08.2016 22:10, Konstantin Belousov wrote: > On Mon, Aug 29, 2016 at 09:16:29PM +0300, Andrey Chernov wrote: >> Previous text is documented everywhere and describing usual good >> practice, so it should remains in place, in that means r304928 should be >> reverted, because replace proper way of doing things with obsoleted >> feature description. >> >> What I suggest is not _replace_ old text with new, but _add_ new text as >> describing current and not recommended way, with the direct mention that >> this feature is obsoleted and not recommended for relay on it. >> > > diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 > index 48802f4..d406efc 100644 > --- a/lib/libc/sys/ptrace.2 > +++ b/lib/libc/sys/ptrace.2 > @@ -2,7 +2,7 @@ > .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ > .\" > .\" This file is in the public domain. > -.Dd August 28, 2016 > +.Dd August 29, 2016 > .Dt PTRACE 2 > .Os > .Sh NAME > @@ -900,19 +900,29 @@ argument is ignored. > .Pp > Additionally, other machine-specific requests can exist. > .Sh RETURN VALUES > +Most requests return 0 on success and \-1 on error. > Some requests can cause > .Fn ptrace > to return > \-1 > -as a non-error value; to disambiguate, > +as a non-error value, among them are > +.Dv PT_READ_I > +and > +.Dv PT_READ_D , > +which return the value read from the process memory on success. > +To disambiguate, > .Va errno > -is set to 0 in the libc wrapper for the > -.Fn ptrace > -system call and > +can be set to 0 before the call and checked afterwards. > +.Pp > +Current > .Fn ptrace > -callers can reliably check > +implementation always sets > +.Va errno > +to 0 before calling into kernel, both for historic reasons and for > +consistency with other operating systems. > +It is recommended to assign zero to > .Va errno > -for non-zero value afterwards. > +explicitely for future compatibility. > .Sh ERRORS > The > .Fn ptrace > Ok. From owner-svn-src-head@freebsd.org Mon Aug 29 19:33: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 B78D0BC7A16; Mon, 29 Aug 2016 19:33:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 850012649; Mon, 29 Aug 2016 19:33:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TJX7P0076922; Mon, 29 Aug 2016 19:33:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TJX7gn076921; Mon, 29 Aug 2016 19:33:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608291933.u7TJX7gn076921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 19:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305022 - head/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.22 Precedence: list List-Id: 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, 29 Aug 2016 19:33:08 -0000 Author: kib Date: Mon Aug 29 19:33:07 2016 New Revision: 305022 URL: https://svnweb.freebsd.org/changeset/base/305022 Log: Restore the requirement of setting errno to zero before calling ptrace(2). Describe the behaviour of automatically zeroing errno as historical feature. Requested by: ache, jhb Reviewed by: ache, bjk Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Mon Aug 29 19:14:52 2016 (r305021) +++ head/lib/libc/sys/ptrace.2 Mon Aug 29 19:33:07 2016 (r305022) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd August 28, 2016 +.Dd August 29, 2016 .Dt PTRACE 2 .Os .Sh NAME @@ -900,19 +900,29 @@ argument is ignored. .Pp Additionally, other machine-specific requests can exist. .Sh RETURN VALUES +Most requests return 0 on success and \-1 on error. Some requests can cause .Fn ptrace to return \-1 -as a non-error value; to disambiguate, +as a non-error value, among them are +.Dv PT_READ_I +and +.Dv PT_READ_D , +which return the value read from the process memory on success. +To disambiguate, .Va errno -is set to 0 in the libc wrapper for the -.Fn ptrace -system call and +can be set to 0 before the call and checked afterwards. +.Pp +The current .Fn ptrace -callers can reliably check +implementation always sets +.Va errno +to 0 before calling into the kernel, both for historic reasons and for +consistency with other operating systems. +It is recommended to assign zero to .Va errno -for non-zero value afterwards. +explicitly for forward compatibility. .Sh ERRORS The .Fn ptrace From owner-svn-src-head@freebsd.org Mon Aug 29 19:40: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 B55E9BC7BE0; Mon, 29 Aug 2016 19:40:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8856428FB; Mon, 29 Aug 2016 19:40:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TJekbh077886; Mon, 29 Aug 2016 19:40:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TJek72077884; Mon, 29 Aug 2016 19:40:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608291940.u7TJek72077884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 Aug 2016 19:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305023 - head/usr.sbin/bluetooth/btpand 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.22 Precedence: list List-Id: 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, 29 Aug 2016 19:40:47 -0000 Author: dim Date: Mon Aug 29 19:40:46 2016 New Revision: 305023 URL: https://svnweb.freebsd.org/changeset/base/305023 Log: Avoid undefined behavior when calling va_start() in bnep_send_control(), by making the 'type' parameter a plain unsigned. MFC after: 3 days Modified: head/usr.sbin/bluetooth/btpand/bnep.c head/usr.sbin/bluetooth/btpand/btpand.h Modified: head/usr.sbin/bluetooth/btpand/bnep.c ============================================================================== --- head/usr.sbin/bluetooth/btpand/bnep.c Mon Aug 29 19:33:07 2016 (r305022) +++ head/usr.sbin/bluetooth/btpand/bnep.c Mon Aug 29 19:40:46 2016 (r305023) @@ -574,7 +574,7 @@ bnep_recv_filter_multi_addr_rsp(channel_ } void -bnep_send_control(channel_t *chan, uint8_t type, ...) +bnep_send_control(channel_t *chan, unsigned type, ...) { packet_t *pkt; uint8_t *p; @@ -590,7 +590,7 @@ bnep_send_control(channel_t *chan, uint8 va_start(ap, type); *p++ = BNEP_CONTROL; - *p++ = type; + *p++ = (uint8_t)type; switch(type) { case BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD: Modified: head/usr.sbin/bluetooth/btpand/btpand.h ============================================================================== --- head/usr.sbin/bluetooth/btpand/btpand.h Mon Aug 29 19:33:07 2016 (r305022) +++ head/usr.sbin/bluetooth/btpand/btpand.h Mon Aug 29 19:40:46 2016 (r305023) @@ -183,7 +183,7 @@ b2eaddr(void *dst, bdaddr_t *src) /* bnep.c */ bool bnep_send(channel_t *, packet_t *); bool bnep_recv(packet_t *); -void bnep_send_control(channel_t *, uint8_t, ...); +void bnep_send_control(channel_t *, unsigned, ...); /* channel.c */ void channel_init(void); From owner-svn-src-head@freebsd.org Mon Aug 29 19:53: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 751BFBC7FAA; Mon, 29 Aug 2016 19:53:16 +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 07ADCEF; Mon, 29 Aug 2016 19:53:15 +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 u7TJrDDx084245; Mon, 29 Aug 2016 19:53:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TJrDiF084244; Mon, 29 Aug 2016 19:53:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608291953.u7TJrDiF084244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Aug 2016 19:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305024 - head/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.22 Precedence: list List-Id: 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, 29 Aug 2016 19:53:16 -0000 Author: kib Date: Mon Aug 29 19:53:13 2016 New Revision: 305024 URL: https://svnweb.freebsd.org/changeset/base/305024 Log: Typesetting fixes. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Mon Aug 29 19:40:46 2016 (r305023) +++ head/lib/libc/sys/ptrace.2 Mon Aug 29 19:53:13 2016 (r305024) @@ -104,7 +104,7 @@ Each traced process has a tracing event An event in the traced process only reports a signal stop if the corresponding flag is set in the tracing event mask. The current set of tracing event flags include: -.Bl -tag -width ".Dv PTRACE_SYSCALL" +.Bl -tag -width "Dv PTRACE_SYSCALL" .It Dv PTRACE_EXEC Report a stop for a successful invocation of .Xr execve 2 . @@ -231,7 +231,7 @@ The .Fa request argument can be: -.Bl -tag -width 12n +.Bl -tag -width "Dv PT_GET_EVENT_MASK" .It Dv PT_TRACE_ME This request is the only one used by the traced process; it declares that the process expects to be traced by its parent. @@ -469,31 +469,31 @@ The fields in the .Vt "struct ptrace_lwpinfo" have the following meaning: .Bl -tag -width indent -compact -.It pl_lwpid +.It Va pl_lwpid LWP id of the thread -.It pl_event +.It Va pl_event Event that caused the stop. -Currently defined events are -.Bl -tag -width indent -compact -.It PL_EVENT_NONE +Currently defined events are: +.Bl -tag -width "Dv PL_EVENT_SIGNAL" -compact +.It Dv PL_EVENT_NONE No reason given -.It PL_EVENT_SIGNAL +.It Dv PL_EVENT_SIGNAL Thread stopped due to the pending signal .El -.It pl_flags +.It Va pl_flags Flags that specify additional details about observed stop. Currently defined flags are: .Bl -tag -width indent -compact -.It PL_FLAG_SCE +.It Dv PL_FLAG_SCE The thread stopped due to system call entry, right after the kernel is entered. The debugger may examine syscall arguments that are stored in memory and registers according to the ABI of the current process, and modify them, if needed. -.It PL_FLAG_SCX +.It Dv PL_FLAG_SCX The thread is stopped immediately before syscall is returning to the usermode. The debugger may examine system call return values in the ABI-defined registers and/or memory. -.It PL_FLAG_EXEC +.It Dv PL_FLAG_EXEC When .Dv PL_FLAG_SCX is set, this flag may be additionally specified to inform that the @@ -501,13 +501,13 @@ program being executed by debuggee proce execution of a system call from the .Fn execve 2 family. -.It PL_FLAG_SI +.It Dv PL_FLAG_SI Indicates that .Va pl_siginfo member of .Vt "struct ptrace_lwpinfo" contains valid information. -.It PL_FLAG_FORKED +.It Dv PL_FLAG_FORKED Indicates that the process is returning from a call to .Fn fork 2 that created a new child process. @@ -515,42 +515,42 @@ The process identifier of the new proces .Va pl_child_pid member of .Vt "struct ptrace_lwpinfo" . -.It PL_FLAG_CHILD +.It Dv PL_FLAG_CHILD The flag is set for first event reported from a new child which is automatically attached when .Dv PTRACE_FORK is enabled. -.It PL_FLAG_BORN +.It Dv PL_FLAG_BORN This flag is set for the first event reported from a new LWP when .Dv PTRACE_LWP is enabled. It is reported along with .Dv PL_FLAG_SCX . -.It PL_FLAG_EXITED +.It Dv PL_FLAG_EXITED This flag is set for the last event reported by an exiting LWP when .Dv PTRACE_LWP is enabled. Note that this event is not reported when the last LWP in a process exits. The termination of the last thread is reported via a normal process exit event. -.It PL_FLAG_VFORKED +.It Dv PL_FLAG_VFORKED Indicates that the thread is returning from a call to .Xr vfork 2 that created a new child process. This flag is set in addition to .Dv PL_FLAG_FORKED . -.It PL_FLAG_VFORK_DONE +.It Dv PL_FLAG_VFORK_DONE Indicates that the thread has resumed after a child process created via .Xr vfork 2 has stopped sharing its address space with the traced process. .El -.It pl_sigmask +.It Va pl_sigmask The current signal mask of the LWP -.It pl_siglist +.It Va pl_siglist The current pending set of signals for the LWP. Note that signals that are delivered to the process would not appear on an LWP siglist until the thread is selected for delivery. -.It pl_siginfo +.It Va pl_siginfo The siginfo that accompanies the signal pending. Only valid for .Dv PL_EVENT_SIGNAL @@ -558,9 +558,9 @@ stop when .Dv PL_FLAG_SI is set in .Va pl_flags . -.It pl_tdname +.It Va pl_tdname The name of the thread. -.It pl_child_pid +.It Va pl_child_pid The process identifier of the new child process. Only valid for a .Dv PL_EVENT_SIGNAL @@ -568,7 +568,7 @@ stop when .Dv PL_FLAG_FORKED is set in .Va pl_flags . -.It pl_syscall_code +.It Va pl_syscall_code The ABI-specific identifier of the current system call. Note that for indirect system calls this field reports the indirected system call. @@ -578,7 +578,7 @@ or .Dv PL_FLAG_SCX is set in .Va pl_flags. -.It pl_syscall_narg +.It Va pl_syscall_narg The number of arguments passed to the current system call not counting the system call identifier. Note that for indirect system calls this field reports the arguments @@ -590,10 +590,10 @@ or is set in .Va pl_flags. .El -.It PT_GETNUMLWPS +.It Dv PT_GETNUMLWPS This request returns the number of kernel threads associated with the traced process. -.It PT_GETLWPLIST +.It Dv PT_GETLWPLIST This request can be used to get the current thread list. A pointer to an array of type .Vt lwpid_t @@ -604,15 +604,15 @@ with the array size specified by The return value from .Fn ptrace is the count of array entries filled in. -.It PT_SETSTEP +.It Dv PT_SETSTEP This request will turn on single stepping of the specified process. -.It PT_CLEARSTEP +.It Dv PT_CLEARSTEP This request will turn off single stepping of the specified process. -.It PT_SUSPEND +.It Dv PT_SUSPEND This request will suspend the specified thread. -.It PT_RESUME +.It Dv PT_RESUME This request will resume the specified thread. -.It PT_TO_SCE +.It Dv PT_TO_SCE This request will set the .Dv PTRACE_SCE event flag to trace all future system call entries and continue the process. @@ -622,7 +622,7 @@ and .Fa data arguments are used the same as for .Dv PT_CONTINUE. -.It PT_TO_SCX +.It Dv PT_TO_SCX This request will set the .Dv PTRACE_SCX event flag to trace all future system call exits and continue the process. @@ -632,7 +632,7 @@ and .Fa data arguments are used the same as for .Dv PT_CONTINUE. -.It PT_SYSCALL +.It Dv PT_SYSCALL This request will set the .Dv PTRACE_SYSCALL event flag to trace all future system call entries and exits and continue @@ -643,7 +643,7 @@ and .Fa data arguments are used the same as for .Dv PT_CONTINUE. -.It PT_FOLLOW_FORK +.It Dv PT_FOLLOW_FORK This request controls tracing for new child processes of a traced process. If .Fa data @@ -655,7 +655,7 @@ If is zero, .Dv PTRACE_FORK is cleared from the traced process's event tracing mask. -.It PT_LWP_EVENTS +.It Dv PT_LWP_EVENTS This request controls tracing of LWP creation and destruction. If .Fa data @@ -667,25 +667,25 @@ If is zero, .Dv PTRACE_LWP is cleared from the traced process's event tracing mask. -.It PT_GET_EVENT_MASK +.It Dv PT_GET_EVENT_MASK This request reads the traced process's event tracing mask into the integer pointed to by .Fa addr . The size of the integer must be passed in .Fa data . -.It PT_SET_EVENT_MASK +.It Dv PT_SET_EVENT_MASK This request sets the traced process's event tracing mask from the integer pointed to by .Fa addr . The size of the integer must be passed in .Fa data . -.It PT_VM_TIMESTAMP +.It Dv PT_VM_TIMESTAMP This request returns the generation number or timestamp of the memory map of the traced process as the return value from .Fn ptrace . This provides a low-cost way for the tracing process to determine if the VM map changed since the last time this request was made. -.It PT_VM_ENTRY +.It Dv PT_VM_ENTRY This request is used to iterate over the entries of the VM map of the traced process. The From owner-svn-src-head@freebsd.org Mon Aug 29 20:01: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 B14A1BC8146; Mon, 29 Aug 2016 20:01:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90FF57DF; Mon, 29 Aug 2016 20:01:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3B9ECB9A5; Mon, 29 Aug 2016 16:01:11 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys Date: Mon, 29 Aug 2016 12:59:09 -0700 Message-ID: <2853823.FYjVjBFabd@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160829191035.GV83214@kib.kiev.ua> References: <201608272303.u7RN3N0D078505@repo.freebsd.org> <20160829191035.GV83214@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 29 Aug 2016 16:01:11 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 20:01:12 -0000 On Monday, August 29, 2016 10:10:35 PM Konstantin Belousov wrote: > On Mon, Aug 29, 2016 at 09:16:29PM +0300, Andrey Chernov wrote: > > Previous text is documented everywhere and describing usual good > > practice, so it should remains in place, in that means r304928 should be > > reverted, because replace proper way of doing things with obsoleted > > feature description. > > > > What I suggest is not _replace_ old text with new, but _add_ new text as > > describing current and not recommended way, with the direct mention that > > this feature is obsoleted and not recommended for relay on it. > > > > diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 > index 48802f4..d406efc 100644 > --- a/lib/libc/sys/ptrace.2 > +++ b/lib/libc/sys/ptrace.2 > @@ -2,7 +2,7 @@ > .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ > .\" > .\" This file is in the public domain. > -.Dd August 28, 2016 > +.Dd August 29, 2016 > .Dt PTRACE 2 > .Os > .Sh NAME > @@ -900,19 +900,29 @@ argument is ignored. > .Pp > Additionally, other machine-specific requests can exist. > .Sh RETURN VALUES > +Most requests return 0 on success and \-1 on error. > Some requests can cause > .Fn ptrace > to return > \-1 > -as a non-error value; to disambiguate, > +as a non-error value, among them are > +.Dv PT_READ_I > +and > +.Dv PT_READ_D , > +which return the value read from the process memory on success. > +To disambiguate, > .Va errno > -is set to 0 in the libc wrapper for the > -.Fn ptrace > -system call and > +can be set to 0 before the call and checked afterwards. > +.Pp > +Current > .Fn ptrace > -callers can reliably check > +implementation always sets > +.Va errno > +to 0 before calling into kernel, both for historic reasons and for > +consistency with other operating systems. > +It is recommended to assign zero to > .Va errno > -for non-zero value afterwards. > +explicitely for future compatibility. > .Sh ERRORS > The > .Fn ptrace Thanks, I think this looks good. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 29 20:01: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 D2CD5BC824B; Mon, 29 Aug 2016 20:01:54 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 868A9A7C; Mon, 29 Aug 2016 20:01:54 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TK1rxh087134; Mon, 29 Aug 2016 20:01:53 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TK1rNN087133; Mon, 29 Aug 2016 20:01:53 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608292001.u7TK1rNN087133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Mon, 29 Aug 2016 20:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305026 - 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.22 Precedence: list List-Id: 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, 29 Aug 2016 20:01:54 -0000 Author: jmcneill Date: Mon Aug 29 20:01:53 2016 New Revision: 305026 URL: https://svnweb.freebsd.org/changeset/base/305026 Log: When the EFI implementation (like U-Boot) does not support WaitForKey, we can emulate efi_cons_poll(0 with a flag and caching the last key read with ReadKeyStroke. This fixes the loader.efi countdown timer on Pine64 (and other U-Boot + EFI using platforms). Reviewed by: imp, manu Differential Revision: https://reviews.freebsd.org/D7670 Modified: head/sys/boot/efi/libefi/efi_console.c Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Mon Aug 29 20:01:49 2016 (r305025) +++ head/sys/boot/efi/libefi/efi_console.c Mon Aug 29 20:01:53 2016 (r305026) @@ -51,6 +51,9 @@ void HO(void); void end_term(void); #endif +static EFI_INPUT_KEY key_cur; +static int key_pending; + static void efi_cons_probe(struct console *); static int efi_cons_init(int); void efi_cons_putchar(int); @@ -436,14 +439,20 @@ efi_cons_getchar() EFI_STATUS status; UINTN junk; - /* Try to read a key stroke. We wait for one if none is pending. */ - status = conin->ReadKeyStroke(conin, &key); - while (status == EFI_NOT_READY) { - /* Some EFI implementation (u-boot for example) do not support WaitForKey */ - if (conin->WaitForKey != NULL) - BS->WaitForEvent(1, &conin->WaitForKey, &junk); + if (key_pending) { + key = key_cur; + key_pending = 0; + } else { + /* Try to read a key stroke. We wait for one if none is pending. */ status = conin->ReadKeyStroke(conin, &key); + while (status == EFI_NOT_READY) { + /* Some EFI implementation (u-boot for example) do not support WaitForKey */ + if (conin->WaitForKey != NULL) + BS->WaitForEvent(1, &conin->WaitForKey, &junk); + status = conin->ReadKeyStroke(conin, &key); + } } + switch (key.ScanCode) { case 0x17: /* ESC */ return (0x1b); /* esc */ @@ -456,9 +465,20 @@ efi_cons_getchar() int efi_cons_poll() { + EFI_INPUT_KEY key; + EFI_STATUS status; + + if (conin->WaitForKey == NULL) { + if (key_pending) + return (1); + status = conin->ReadKeyStroke(conin, &key); + if (status == EFI_SUCCESS) { + key_cur = key; + key_pending = 1; + } + return (key_pending); + } - if (conin->WaitForKey == NULL) - return (1); /* This can clear the signaled state. */ return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); } From owner-svn-src-head@freebsd.org Mon Aug 29 20:46: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 89238BC7123; Mon, 29 Aug 2016 20:46:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDE2FA1; Mon, 29 Aug 2016 20:46:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TKkXlT003678; Mon, 29 Aug 2016 20:46:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TKkXkd003677; Mon, 29 Aug 2016 20:46:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201608292046.u7TKkXkd003677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 29 Aug 2016 20:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305027 - head/sys/dev/ioat 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.22 Precedence: list List-Id: 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, 29 Aug 2016 20:46:34 -0000 Author: cem Date: Mon Aug 29 20:46:33 2016 New Revision: 305027 URL: https://svnweb.freebsd.org/changeset/base/305027 Log: ioat(4): Don't "complete" DMA descriptors prematurely In r304602, I mistakenly removed the ioat_process_events check that we weren't processing events before the hardware had completed the descriptor ("last_seen"). Reinstate that logic. Keep the defensive loop condition and additionally make sure we've actually completed a descriptor before blindly chasing the ring around. In reset, queue and finish the startup command before allowing any event processing or submission to occur. Avoid potential missed callouts by requeueing the poll later. Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Aug 29 20:01:53 2016 (r305026) +++ head/sys/dev/ioat/ioat.c Mon Aug 29 20:46:33 2016 (r305027) @@ -683,7 +683,16 @@ ioat_process_events(struct ioat_softc *i __func__, ioat->chan_idx, comp_update, ioat->last_seen); status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK; - while (ioat_get_active(ioat) > 0) { + if (status == ioat->last_seen) { + /* + * If we landed in process_events and nothing has been + * completed, check for a timeout due to channel halt. + */ + goto out; + } + + desc = ioat_get_ring_entry(ioat, ioat->tail - 1); + while (desc->hw_desc_bus_addr != status && ioat_get_active(ioat) > 0) { desc = ioat_get_ring_entry(ioat, ioat->tail); dmadesc = &desc->bus_dmadesc; CTR4(KTR_IOAT, "channel=%u completing desc %u ok cb %p(%p)", @@ -695,8 +704,6 @@ ioat_process_events(struct ioat_softc *i completed++; ioat->tail++; - if (desc->hw_desc_bus_addr == status) - break; } if (completed != 0) { @@ -704,6 +711,7 @@ ioat_process_events(struct ioat_softc *i ioat->stats.descriptors_processed += completed; } +out: ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); /* Perform a racy check first; only take the locks if it passes. */ @@ -1913,19 +1921,17 @@ ioat_reset_hw(struct ioat_softc *ioat) error = 0; out: + /* Enqueues a null operation and ensures it completes. */ + if (error == 0) + error = ioat_start_channel(ioat); + /* * Resume completions now that ring state is consistent. - * ioat_start_channel will add a pending completion and if we are still - * blocking completions, we may livelock. */ mtx_lock(&ioat->cleanup_lock); ioat->resetting_cleanup = FALSE; mtx_unlock(&ioat->cleanup_lock); - /* Enqueues a null operation and ensures it completes. */ - if (error == 0) - error = ioat_start_channel(ioat); - /* Unblock submission of new work */ mtx_lock(IOAT_REFLK); ioat->quiescing = FALSE; @@ -1933,6 +1939,10 @@ out: ioat->resetting = FALSE; wakeup(&ioat->resetting); + + if (ioat->is_completion_pending) + callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, + ioat); mtx_unlock(IOAT_REFLK); return (error); From owner-svn-src-head@freebsd.org Mon Aug 29 20:51: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 0C63BBC7282; Mon, 29 Aug 2016 20:51:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3EBF2C1; Mon, 29 Aug 2016 20:51:35 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7TKpYYJ005908; Mon, 29 Aug 2016 20:51:34 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TKpYSS005907; Mon, 29 Aug 2016 20:51:34 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201608292051.u7TKpYSS005907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 29 Aug 2016 20:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305028 - head/sys/dev/ioat 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.22 Precedence: list List-Id: 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, 29 Aug 2016 20:51:36 -0000 Author: cem Date: Mon Aug 29 20:51:34 2016 New Revision: 305028 URL: https://svnweb.freebsd.org/changeset/base/305028 Log: ioat(4): Add additional CTR tracing during reset Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Aug 29 20:46:33 2016 (r305027) +++ head/sys/dev/ioat/ioat.c Mon Aug 29 20:51:34 2016 (r305028) @@ -1831,6 +1831,9 @@ ioat_reset_hw(struct ioat_softc *ioat) ioat->resetting_cleanup = TRUE; mtx_unlock(&ioat->cleanup_lock); + CTR2(KTR_IOAT, "%s channel=%u quiesced and drained", __func__, + ioat->chan_idx); + status = ioat_get_chansts(ioat); if (is_ioat_active(status) || is_ioat_idle(status)) ioat_suspend(ioat); @@ -1851,6 +1854,9 @@ ioat_reset_hw(struct ioat_softc *ioat) chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr); + CTR2(KTR_IOAT, "%s channel=%u hardware suspended", __func__, + ioat->chan_idx); + /* * IOAT v3 workaround - CHANERRMSK_INT with 3E07h to masks out errors * that can cause stability issues for IOAT v3. @@ -1870,6 +1876,8 @@ ioat_reset_hw(struct ioat_softc *ioat) } ioat_reset(ioat); + CTR2(KTR_IOAT, "%s channel=%u hardware reset", __func__, + ioat->chan_idx); /* Wait at most 20 ms */ for (timeout = 0; ioat_reset_pending(ioat) && timeout < 20; timeout++) @@ -1919,11 +1927,16 @@ ioat_reset_hw(struct ioat_softc *ioat) ioat_write_chancmp(ioat, ioat->comp_update_bus_addr); ioat_write_chainaddr(ioat, ioat->ring[0]->hw_desc_bus_addr); error = 0; + CTR2(KTR_IOAT, "%s channel=%u configured channel", __func__, + ioat->chan_idx); out: /* Enqueues a null operation and ensures it completes. */ - if (error == 0) + if (error == 0) { error = ioat_start_channel(ioat); + CTR2(KTR_IOAT, "%s channel=%u started channel", __func__, + ioat->chan_idx); + } /* * Resume completions now that ring state is consistent. @@ -1943,6 +1956,7 @@ out: if (ioat->is_completion_pending) callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, ioat); + CTR2(KTR_IOAT, "%s channel=%u reset done", __func__, ioat->chan_idx); mtx_unlock(IOAT_REFLK); return (error); From owner-svn-src-head@freebsd.org Mon Aug 29 22:00:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 512EBB792A5 for ; Mon, 29 Aug 2016 22:00:49 +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 35F43383; Mon, 29 Aug 2016 22:00:49 +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 u7TM0dnv011870 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 29 Aug 2016 15:00:40 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u7TM0dB5011869; Mon, 29 Aug 2016 15:00:39 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 29 Aug 2016 15:00:39 -0700 From: Gleb Smirnoff To: Ryan Stone Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160829220039.GH1740@FreeBSD.org> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 22:00:49 -0000 On Sat, Aug 20, 2016 at 12:36:58PM -0400, Ryan Stone wrote: R> - The if_addr_lock would appear to be an excellent candidate to be R> converted into an rmlock, but unfortunately we made the mistake of exposing R> the lock through the ifnet KPI. Fixing that would require rototilling R> every single Ethernet/WiFi/etc driver in the tree. Just my 2 cents: that's why I'd like to encourage developers to do a big leap with new ifnet KPI (which will give only pointer to struct ifnet to drivers), and then with our hands unentagled improve the network stack. See projects/ifnet branch in the subversion. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Aug 29 22:02: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 35BE3B793A6; Mon, 29 Aug 2016 22:02:24 +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 1B46F933; Mon, 29 Aug 2016 22:02:23 +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 u7TM2KGi011886 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 29 Aug 2016 15:02:21 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u7TM2KEn011885; Mon, 29 Aug 2016 15:02:20 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 29 Aug 2016 15:02:20 -0700 From: Gleb Smirnoff To: Ryan Stone Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160829220220.GI1740@FreeBSD.org> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 22:02:24 -0000 On Sat, Aug 20, 2016 at 11:27:25AM -0400, Ryan Stone wrote: R> > where the link layer does not have the concept of broadcast being distinct R> > from other kinds of network traffic. PPP and ATM are the most obvious R> > examples. R> R> We don't support ATM, but PPP is a good example. We support ATM with help of natm(4) and ng_atm(4). -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Aug 29 22:38: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 C6864B798F0; Mon, 29 Aug 2016 22:38: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 99691AFA; Mon, 29 Aug 2016 22:38: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 u7TMcIvX046254; Mon, 29 Aug 2016 22:38:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TMcIw1046253; Mon, 29 Aug 2016 22:38:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608292238.u7TMcIw1046253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 Aug 2016 22:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305031 - head/contrib/netbsd-tests/usr.bin/dirname 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.22 Precedence: list List-Id: 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, 29 Aug 2016 22:38:19 -0000 Author: ngie Date: Mon Aug 29 22:38:18 2016 New Revision: 305031 URL: https://svnweb.freebsd.org/changeset/base/305031 Log: Fix typo atf_tc_expect_fail should have been atf_expect_fail per atf-sh-api(3) PR: 212193 Pointyhat to: ngie Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh Directory Properties: head/ (props changed) Modified: head/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh Mon Aug 29 22:34:31 2016 (r305030) +++ head/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh Mon Aug 29 22:38:18 2016 (r305031) @@ -33,7 +33,7 @@ basic_head() basic_body() { # Begin FreeBSD - atf_tc_expect_fail "dirname //usr//bin doesn't return //usr like it used to; bug # 212193" + atf_expect_fail "dirname //usr//bin doesn't return //usr like it used to; bug # 212193" # End FreeBSD atf_check -o inline:"/\n" dirname / atf_check -o inline:"/\n" dirname // From owner-svn-src-head@freebsd.org Mon Aug 29 22:47: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 53333B79A4B; Mon, 29 Aug 2016 22:47:15 +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 10A98F0C; Mon, 29 Aug 2016 22:47:14 +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 u7TMlE1q050458; Mon, 29 Aug 2016 22:47:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TMlEf3050457; Mon, 29 Aug 2016 22:47:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608292247.u7TMlEf3050457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Aug 2016 22:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305032 - head/sys/dev/cxgbe 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.22 Precedence: list List-Id: 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, 29 Aug 2016 22:47:15 -0000 Author: jhb Date: Mon Aug 29 22:47:14 2016 New Revision: 305032 URL: https://svnweb.freebsd.org/changeset/base/305032 Log: Use device_verbose() to undo device_quiet() when detaching from t[45]iovX. The device quiet flag is not automatically reset on detach, so it is inherited by other device drivers (e.g. when switching a device driver over to ppt for PCI pass through). Cope with this behavior by explicitly marking the device verbose during detach so that the next driver can make its own decision. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_iov.c Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Mon Aug 29 22:38:18 2016 (r305031) +++ head/sys/dev/cxgbe/t4_iov.c Mon Aug 29 22:47:14 2016 (r305032) @@ -209,10 +209,15 @@ static int t4iov_detach(device_t dev) { struct t4iov_softc *sc; + int error; sc = device_get_softc(dev); - if (sc->sc_attached) - return (t4iov_detach_child(dev)); + if (sc->sc_attached) { + error = t4iov_detach_child(dev); + if (error) + return (error); + } + device_verbose(dev); return (0); } From owner-svn-src-head@freebsd.org Mon Aug 29 22:47: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 1C7F3B79AA8; Mon, 29 Aug 2016 22:47:55 +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 E0DF7C9; Mon, 29 Aug 2016 22:47:54 +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 u7TMlsVI050552; Mon, 29 Aug 2016 22:47:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TMlsXI050549; Mon, 29 Aug 2016 22:47:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608292247.u7TMlsXI050549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 29 Aug 2016 22:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305033 - in head/lib/atf: libatf-c libatf-c++ 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.22 Precedence: list List-Id: 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, 29 Aug 2016 22:47:55 -0000 Author: ngie Date: Mon Aug 29 22:47:53 2016 New Revision: 305033 URL: https://svnweb.freebsd.org/changeset/base/305033 Log: Minor Makefile simplifications for lib/atf/... - Replace uses of `${.CURDIR:H:H:H}` with ${SRCTOP} - Use built-in :H operator instead of ".." when enumerating paths. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/atf/libatf-c++/Makefile head/lib/atf/libatf-c/Makefile Modified: head/lib/atf/libatf-c++/Makefile ============================================================================== --- head/lib/atf/libatf-c++/Makefile Mon Aug 29 22:47:14 2016 (r305032) +++ head/lib/atf/libatf-c++/Makefile Mon Aug 29 22:47:53 2016 (r305033) @@ -35,15 +35,15 @@ SHLIB_MAJOR= 2 # libatf-c++ depends on the C version of the ATF library to build. LIBADD+= atf_c -LDFLAGS+= -L${.OBJDIR}/../libatf-c +LDFLAGS+= -L${.OBJDIR:H}/libatf-c -ATF= ${.CURDIR:H:H:H}/contrib/atf +ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF} .PATH: ${ATF}/atf-c++ .PATH: ${ATF}/atf-c++/detail CFLAGS+= -I${ATF} -CFLAGS+= -I${.CURDIR}/../libatf-c +CFLAGS+= -I${.CURDIR:H}/libatf-c CFLAGS+= -I. CFLAGS+= -DHAVE_CONFIG_H Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Mon Aug 29 22:47:14 2016 (r305032) +++ head/lib/atf/libatf-c/Makefile Mon Aug 29 22:47:53 2016 (r305033) @@ -36,7 +36,7 @@ LIB= atf-c PRIVATELIB= true SHLIB_MAJOR= 1 -ATF= ${.CURDIR:H:H:H}/contrib/atf +ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF} .PATH: ${ATF}/atf-c .PATH: ${ATF}/atf-c/detail From owner-svn-src-head@freebsd.org Mon Aug 29 22:48: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 C924DB79B02; Mon, 29 Aug 2016 22:48:37 +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 A30A4265; Mon, 29 Aug 2016 22:48:37 +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 u7TMmact050653; Mon, 29 Aug 2016 22:48:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7TMmaEe050646; Mon, 29 Aug 2016 22:48:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608292248.u7TMmaEe050646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Aug 2016 22:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305034 - in head: lib/libdevctl sys/kern sys/sys usr.sbin/devctl 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.22 Precedence: list List-Id: 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, 29 Aug 2016 22:48:37 -0000 Author: jhb Date: Mon Aug 29 22:48:36 2016 New Revision: 305034 URL: https://svnweb.freebsd.org/changeset/base/305034 Log: Implement 'devctl clear driver' to undo a previous 'devctl set driver'. Add a new 'clear driver' command for devctl along with the accompanying ioctl and devctl_clear_driver() library routine to reset a device to use a wildcard devclass instead of a fixed devclass. This can be used to undo a previous 'set driver' command. After the device's name has been reset to permit wildcard names, it is reprobed so that it can attach to newly-available (to it) device drivers. MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/lib/libdevctl/devctl.3 head/lib/libdevctl/devctl.c head/lib/libdevctl/devctl.h head/sys/kern/subr_bus.c head/sys/sys/bus.h head/usr.sbin/devctl/devctl.8 head/usr.sbin/devctl/devctl.c Modified: head/lib/libdevctl/devctl.3 ============================================================================== --- head/lib/libdevctl/devctl.3 Mon Aug 29 22:47:53 2016 (r305033) +++ head/lib/libdevctl/devctl.3 Mon Aug 29 22:48:36 2016 (r305034) @@ -25,12 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2016 +.Dd August 29, 2016 .Dt DEVCTL 3 .Os .Sh NAME .Nm devctl , .Nm devctl_attach , +.Nm devctl_clear_driver , .Nm devctl_delete , .Nm devctl_detach , .Nm devctl_disable , @@ -47,6 +48,8 @@ .Ft int .Fn devctl_attach "const char *device" .Ft int +.Fn devctl_clear_driver "const char *device" "bool force" +.Ft int .Fn devctl_delete "const char *device" "bool force" .Ft int .Fn devctl_detach "const char *device" "bool force" @@ -166,12 +169,30 @@ the device will be detached from its cur attached to the new device driver. .Pp The +.Fn devctl_clear_driver +function resets a device so that it can be attached to any valid device +driver rather than only drivers with a previously specified name. +This function is used to undo a previous call to +.Fn devctl_set_driver . +If the device is already attached and +.Fa force +is false, +the request will fail. +If the device is already attached and +.Fa force +is true, +the device will be detached from its current device driver. +After the device's name is reset, +it is reprobed and attached to a suitable device driver if one is found. +.Pp +The .Fn devctl_rescan function rescans a bus device checking for devices that have been added or removed. .Sh RETURN VALUES -.Rv -std devctl_attach devctl_delete devctl_detach devctl_disable \ -devctl_enable devctl_suspend devctl_rescan devctl_resume devctl_set_driver +.Rv -std devctl_attach devctl_clear_driver devctl_delete devctl_detach \ +devctl_disable devctl_enable devctl_suspend devctl_rescan devctl_resume \ +devctl_set_driver .Sh ERRORS In addition to specific errors noted below, all of the @@ -302,6 +323,24 @@ The new device driver failed to attach. .El .Pp The +.Fn devctl_clear_driver +function may fail if: +.Bl -tag -width Er +.It Bq Er EBUSY +The device is currently attached to a device driver and +.Fa force +is false. +.It Bq Er EBUSY +The current device driver for +.Fa device +is busy and cannot detach at this time. +.It Bq Er EINVAL +The device is not configured for a specific device driver name. +.It Bq Er ENXIO +The device driver chosen after reprobing failed to attach. +.El +.Pp +The .Fn devctl_rescan function may fail if: .Bl -tag -width Er Modified: head/lib/libdevctl/devctl.c ============================================================================== --- head/lib/libdevctl/devctl.c Mon Aug 29 22:47:53 2016 (r305033) +++ head/lib/libdevctl/devctl.c Mon Aug 29 22:48:36 2016 (r305034) @@ -124,6 +124,14 @@ devctl_set_driver(const char *device, co } int +devctl_clear_driver(const char *device, bool force) +{ + + return (devctl_simple_request(DEV_CLEAR_DRIVER, device, force ? + DEVF_CLEAR_DRIVER_DETACH : 0)); +} + +int devctl_rescan(const char *device) { Modified: head/lib/libdevctl/devctl.h ============================================================================== --- head/lib/libdevctl/devctl.h Mon Aug 29 22:47:53 2016 (r305033) +++ head/lib/libdevctl/devctl.h Mon Aug 29 22:48:36 2016 (r305034) @@ -38,6 +38,7 @@ int devctl_disable(const char *device, b int devctl_suspend(const char *device); int devctl_resume(const char *device); int devctl_set_driver(const char *device, const char *driver, bool force); +int devctl_clear_driver(const char *device, bool force); int devctl_rescan(const char *device); int devctl_delete(const char *device, bool force); Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Aug 29 22:47:53 2016 (r305033) +++ head/sys/kern/subr_bus.c Mon Aug 29 22:48:36 2016 (r305034) @@ -5349,6 +5349,7 @@ devctl2_ioctl(struct cdev *cdev, u_long case DEV_SUSPEND: case DEV_RESUME: case DEV_SET_DRIVER: + case DEV_CLEAR_DRIVER: case DEV_RESCAN: case DEV_DELETE: error = priv_check(td, PRIV_DRIVER); @@ -5514,6 +5515,25 @@ devctl2_ioctl(struct cdev *cdev, u_long error = device_probe_and_attach(dev); break; } + case DEV_CLEAR_DRIVER: + if (!(dev->flags & DF_FIXEDCLASS)) { + error = 0; + break; + } + if (device_is_attached(dev)) { + if (req->dr_flags & DEVF_CLEAR_DRIVER_DETACH) + error = device_detach(dev); + else + error = EBUSY; + if (error) + break; + } + + dev->flags &= ~DF_FIXEDCLASS; + dev->flags |= DF_WILDCARD; + devclass_delete_device(dev->devclass, dev); + error = device_probe_and_attach(dev); + break; case DEV_RESCAN: if (!device_is_attached(dev)) { error = ENXIO; Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon Aug 29 22:47:53 2016 (r305033) +++ head/sys/sys/bus.h Mon Aug 29 22:48:36 2016 (r305034) @@ -117,6 +117,7 @@ struct devreq { #define DEV_SUSPEND _IOW('D', 5, struct devreq) #define DEV_RESUME _IOW('D', 6, struct devreq) #define DEV_SET_DRIVER _IOW('D', 7, struct devreq) +#define DEV_CLEAR_DRIVER _IOW('D', 8, struct devreq) #define DEV_RESCAN _IOW('D', 9, struct devreq) #define DEV_DELETE _IOW('D', 10, struct devreq) @@ -126,6 +127,9 @@ struct devreq { /* Flags for DEV_SET_DRIVER. */ #define DEVF_SET_DRIVER_DETACH 0x0000001 /* Detach existing driver. */ +/* Flags for DEV_CLEAR_DRIVER. */ +#define DEVF_CLEAR_DRIVER_DETACH 0x0000001 /* Detach existing driver. */ + /* Flags for DEV_DELETE. */ #define DEVF_FORCE_DELETE 0x0000001 Modified: head/usr.sbin/devctl/devctl.8 ============================================================================== --- head/usr.sbin/devctl/devctl.8 Mon Aug 29 22:47:53 2016 (r305033) +++ head/usr.sbin/devctl/devctl.8 Mon Aug 29 22:48:36 2016 (r305034) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2016 +.Dd August 29, 2016 .Dt DEVCTL 8 .Os .Sh NAME @@ -36,6 +36,10 @@ .Cm attach .Ar device .Nm +.Cm clear driver +.Op Fl f +.Ar device +.Nm .Cm detach .Op Fl f .Ar device @@ -133,6 +137,21 @@ If the device is already attached to a d .Fl f flag is not specified, the device will not be changed. +.It Xo Cm clear driver +.Op Fl f +.Ar device +.Xc +Clear a previously-forced driver name so that the device is able to use any +valid device driver. +After the previous name has been cleared, +the device is reprobed so that other device drivers may attach to it. +This can be used to undo an earlier +.Cm set driver +command. +If the device is currently attached to a device driver and the +.Fl f +flag is not specified, +the device will not be changed. .It Cm rescan Ar device Rescan a bus device checking for devices that have been added or removed. Modified: head/usr.sbin/devctl/devctl.c ============================================================================== --- head/usr.sbin/devctl/devctl.c Mon Aug 29 22:47:53 2016 (r305033) +++ head/usr.sbin/devctl/devctl.c Mon Aug 29 22:48:36 2016 (r305034) @@ -65,12 +65,13 @@ static int devctl_table_handler(struct d SET_DECLARE(DEVCTL_DATASET(top), struct devctl_command); +DEVCTL_TABLE(top, clear); DEVCTL_TABLE(top, set); static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: devctl attach device", " devctl detach [-f] device", " devctl disable [-f] device", @@ -78,6 +79,7 @@ usage(void) " devctl suspend device", " devctl resume device", " devctl set driver [-f] device driver", + " devctl clear driver [-f] device", " devctl rescan device", " devctl delete [-f] device"); exit(1); @@ -261,6 +263,40 @@ set_driver(int ac, char **av) } DEVCTL_COMMAND(set, driver, set_driver); +static void +clear_driver_usage(void) +{ + + fprintf(stderr, "usage: devctl clear driver [-f] device\n"); + exit(1); +} + +static int +clear_driver(int ac, char **av) +{ + bool force; + int ch; + + force = false; + while ((ch = getopt(ac, av, "f")) != -1) + switch (ch) { + case 'f': + force = true; + break; + default: + clear_driver_usage(); + } + ac -= optind; + av += optind; + + if (ac != 1) + clear_driver_usage(); + if (devctl_clear_driver(av[0], force) < 0) + err(1, "Failed to clear %s driver", av[0]); + return (0); +} +DEVCTL_COMMAND(clear, driver, clear_driver); + static int rescan(int ac, char **av) { From owner-svn-src-head@freebsd.org Mon Aug 29 22:55:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B9DB79D47; Mon, 29 Aug 2016 22:55:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::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 6EC97980; Mon, 29 Aug 2016 22:55:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x233.google.com with SMTP id e63so132678394ith.1; Mon, 29 Aug 2016 15:55:49 -0700 (PDT) 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; bh=UDQm9qCdRouDltVvIMpXd7ai0V0dAigybyjPHls3qc4=; b=tlIARgbITAjpwa8/dEkkp2IVxsTGaWixBIpgnhACkE6TR5Pe6iqelHLT73QWqWGEQH y0v4l+LohD/XoVZaWb8CL++JclBv/2iZMFT+aAFXuHcXQkPNBY0TCZIbWVgolSMp/Y+Q ahGqQgUUCcORudYlma8MuKuNyKPJ+glCBLA58mGmpk7wq8h5/H+glhVe9ctrBS87MdtK O7as3fWrKvAcBr+Zk84AYH3Y2uoZbAdvDGh6CFB2jH9KqR0poGJVaOCZwXUTPNg9nuce aY0sqOUuED/3w7gAs5OA5FiUsz1LunqtNKgLfCm5kUxGTkIH6NxNWRBaMiZCYENIas2L 8qKA== 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; bh=UDQm9qCdRouDltVvIMpXd7ai0V0dAigybyjPHls3qc4=; b=KkGjt3Mn/QaTYVgWXWvctYetmum5lnvlm93korJXw1mZ1yiR0pB7h8TvP2TOTWPJ2w HJJmKULRLC40ma8788bdWKq71+La6+cEcngvCIbFwTYELwd1gqkQpY6TTSIqIKo5f3kW eJwkqFSp6I0LfidJxZU6uFfFPHPNsVC1HCjsp9eCZ1db2UnDgBN2piELWEL7pMd7hWOA 2y+tf5GsUdTy3qkhAaCDlbDmecCgPDOMpFLygwKGCfB2Y1bSdJG/CU5O9uXD0bZv2ctv zpzGTe53dsD+2xniwVGKgAbGL4DpDUB4pK50qrECGZqcnZtU/bHZVTn/ULc3z8c7qeky 5FzA== X-Gm-Message-State: AE9vXwMzd/DrCMC9BMwmBpdpul8IzX/KMFMYrb1rCS53E6VGfTiQ1CPzldmw6CX/pvP0xJ+FGMKh5kt+i2iCjw== X-Received: by 10.36.150.70 with SMTP id z67mr18256438itd.80.1472511348930; Mon, 29 Aug 2016 15:55:48 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Mon, 29 Aug 2016 15:55:47 -0700 (PDT) In-Reply-To: <20160829220039.GH1740@FreeBSD.org> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160829220039.GH1740@FreeBSD.org> From: Adrian Chadd Date: Mon, 29 Aug 2016 15:55:47 -0700 X-Google-Sender-Auth: qhwNTnXdyUGtb6CBws9MeGD5ItQ Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Gleb Smirnoff Cc: Ryan Stone , Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 22:55:49 -0000 On 29 August 2016 at 15:00, Gleb Smirnoff wrote: > On Sat, Aug 20, 2016 at 12:36:58PM -0400, Ryan Stone wrote: > R> - The if_addr_lock would appear to be an excellent candidate to be > R> converted into an rmlock, but unfortunately we made the mistake of exposing > R> the lock through the ifnet KPI. Fixing that would require rototilling > R> every single Ethernet/WiFi/etc driver in the tree. > > Just my 2 cents: that's why I'd like to encourage developers to do a big > leap with new ifnet KPI (which will give only pointer to struct ifnet > to drivers), and then with our hands unentagled improve the network stack. > > See projects/ifnet branch in the subversion. Hi, It's an easyish thing to do now - just come up with an API change proposal and I'll rototill the wifi drivers / stack in preparation. -adrian > > -- > Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Aug 29 22:57: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 5717AB79DA8; Mon, 29 Aug 2016 22:57:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38822B09; Mon, 29 Aug 2016 22:57:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 402D8B93A; Mon, 29 Aug 2016 18:57:37 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305034 - in head: lib/libdevctl sys/kern sys/sys usr.sbin/devctl Date: Mon, 29 Aug 2016 15:57:14 -0700 Message-ID: <8074036.gWSGr9DhZh@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608292248.u7TMmaEe050646@repo.freebsd.org> References: <201608292248.u7TMmaEe050646@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 29 Aug 2016 18:57:37 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 29 Aug 2016 22:57:38 -0000 On Monday, August 29, 2016 10:48:36 PM John Baldwin wrote: > Author: jhb > Date: Mon Aug 29 22:48:36 2016 > New Revision: 305034 > URL: https://svnweb.freebsd.org/changeset/base/305034 > > Log: > Implement 'devctl clear driver' to undo a previous 'devctl set driver'. > > Add a new 'clear driver' command for devctl along with the accompanying > ioctl and devctl_clear_driver() library routine to reset a device to > use a wildcard devclass instead of a fixed devclass. This can be used > to undo a previous 'set driver' command. After the device's name has > been reset to permit wildcard names, it is reprobed so that it can > attach to newly-available (to it) device drivers. > > MFC after: 1 month > Sponsored by: Chelsio Communications In particular, you can now do 'devctl set driver pciX:Y:Z ppt' to flip a device into pass through mode for bhyve and then use 'devctl clear driver pciX:Y:Z' to revert back to the host driver. Though for bhyve/ppt(4) in particular you need some additional changes currently under review so that the device ends up back in the proper I/O MMU domain so it can do DMA in the host. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 30 00:01: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 81335BC7EB1; Tue, 30 Aug 2016 00:01:22 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 70CAAA14; Tue, 30 Aug 2016 00:01:22 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 79A911735D; Mon, 29 Aug 2016 17:01:21 -0700 (PDT) Date: Mon, 29 Aug 2016 17:01:21 -0700 From: hiren panchasara To: Bruce Evans Cc: Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r304895 - head/usr.bin/netstat Message-ID: <20160830000121.GD27495@strugglingcoder.info> References: <201608271106.u7RB669G009115@repo.freebsd.org> <20160828183439.GU41576@strugglingcoder.info> <20160829050500.D3932@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="brEuL7wsLY8+TuWz" Content-Disposition: inline In-Reply-To: <20160829050500.D3932@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 30 Aug 2016 00:01:22 -0000 --brEuL7wsLY8+TuWz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/29/16 at 05:14P, Bruce Evans wrote: > On Sun, 28 Aug 2016, hiren panchasara wrote: >=20 > > On 08/27/16 at 11:06P, Bruce Evans wrote: > >> > >> Log: > >> Fix build without INET6 and with gcc. A function definition was ifd= efed > >> for INET6, but its protototype was not, and gcc detects the error. > >> > >> Modified: > >> head/usr.bin/netstat/route.c > > > > Thanks for the fix. > > > > Wouldn't stable/11 be broken in the same way? >=20 > Probably. >=20 > This only affects gcc users who omit INET6, and much more is broken for > stable/11 for gcc. Broken as in couldn't build? I don't think so. gcc + no-v6 seems like a special case but I think this should be fixed in 11. If you don't want to, I'll MFC the change myself. :-) Cheers, Hiren --brEuL7wsLY8+TuWz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXxMzOXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/liHIIAIP7chwqMqqLOln/4RVPoNON O0HvOAMaeX99s+Oz+aOdciO7PR4nTM9ThznCQFRo0mwHMUJC3mIVgv4UKmD3+CRn 2mlQq4a8h8IM+DkTieTocXeQPwfINUFlhCTSAuHhRC9JzRTZ+95AE7bcfRI9lAD7 Ss1BCHQru5NE/gD4DhFxQlkaCaBO0bTK/k4xhTnqdXLq6BlNh/oNW67dJjJkmkM5 R8lKY6Lfq6ssPdBUiY3UyAgEwb3NjRFptTdK0v/8gEzHiM64kHjOBsJplmW7JeJ4 Su/U3lq1R5f0XVepihfq1EL7VSiNxuHd4S+2JXY4YovWkuSY/ypRUz+w3f6iWJE= =aFAt -----END PGP SIGNATURE----- --brEuL7wsLY8+TuWz-- From owner-svn-src-head@freebsd.org Tue Aug 30 00: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 A7644BC888D; Tue, 30 Aug 2016 00:47:22 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4EC35E9D; Tue, 30 Aug 2016 00:47:22 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7U0lLU4095942; Tue, 30 Aug 2016 00:47:21 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U0lLLG095941; Tue, 30 Aug 2016 00:47:21 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201608300047.u7U0lLLG095941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 30 Aug 2016 00:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305036 - head/sys/boot/powerpc/boot1.chrp 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.22 Precedence: list List-Id: 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, 30 Aug 2016 00:47:22 -0000 Author: nwhitehorn Date: Tue Aug 30 00:47:21 2016 New Revision: 305036 URL: https://svnweb.freebsd.org/changeset/base/305036 Log: Some versions of SLOF do not append the partition number to the boot device argument to the stage-1 bootloader. In such cases, boot1 would only try to read the entire device rather than checking for partitions. Instead of panic'ing, fall back to reading the partitions as normal in such situations. This was preventing boot of installed systems on some versions of PowerKVM. PR: kern/211599 MFC after: 2 days Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/boot1.c Mon Aug 29 23:57:00 2016 (r305035) +++ head/sys/boot/powerpc/boot1.chrp/boot1.c Tue Aug 30 00:47:21 2016 (r305036) @@ -137,7 +137,9 @@ ofw_init(void *vpd, int res, int (*openf p = bootpath; while (*p != '\0') { + /* Truncate partition ID */ if (*p == ':') { + ofw_close(bootdev); *(++p) = '\0'; break; } @@ -419,31 +421,40 @@ main(int ac, char **av) memcpy(bootpath_full,bootpath,len+1); - if (bootpath_full[len-1] == ':') { - for (i = 0; i < 16; i++) { - if (i < 10) { - bootpath_full[len] = i + '0'; - bootpath_full[len+1] = '\0'; - } else { - bootpath_full[len] = '1'; - bootpath_full[len+1] = i - 10 + '0'; - bootpath_full[len+2] = '\0'; - } - - if (domount(bootpath_full,1) >= 0) - break; - - if (bootdev > 0) - ofw_close(bootdev); + if (bootpath_full[len-1] != ':') { + /* First try full volume */ + if (domount(bootpath_full,1) == 0) + goto out; + + /* Add a : so that we try partitions if that fails */ + if (bootdev > 0) + ofw_close(bootdev); + bootpath_full[len] = ':'; + len += 1; + } + + /* Loop through first 16 partitions to find a UFS one */ + for (i = 0; i < 16; i++) { + if (i < 10) { + bootpath_full[len] = i + '0'; + bootpath_full[len+1] = '\0'; + } else { + bootpath_full[len] = '1'; + bootpath_full[len+1] = i - 10 + '0'; + bootpath_full[len+2] = '\0'; } + + if (domount(bootpath_full,1) >= 0) + break; - if (i >= 16) - panic("domount"); - } else { - if (domount(bootpath_full,0) == -1) - panic("domount"); + if (bootdev > 0) + ofw_close(bootdev); } + if (i >= 16) + panic("domount"); + +out: printf(" Boot volume: %s\n",bootpath_full); ofw_setprop(chosenh, "bootargs", bootpath_full, len+2); load(path); From owner-svn-src-head@freebsd.org Tue Aug 30 01:31: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 C949DBC8F35; Tue, 30 Aug 2016 01:31:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86130204; Tue, 30 Aug 2016 01:31:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7U1V3Dq011227; Tue, 30 Aug 2016 01:31:03 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U1V3ip011226; Tue, 30 Aug 2016 01:31:03 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201608300131.u7U1V3ip011226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 30 Aug 2016 01:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305039 - head/sys/arm/ti 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.22 Precedence: list List-Id: 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, 30 Aug 2016 01:31:04 -0000 Author: gonzo Date: Tue Aug 30 01:31:03 2016 New Revision: 305039 URL: https://svnweb.freebsd.org/changeset/base/305039 Log: Fix TI PRUSS driver panic with INVARIANTS enabled Value passed as islocked argument to knlist_add should be consistent with actual lock state so add lock/unlock calls around knlist_add PR: 212120 Submitted by: Manuel Stuhn Modified: head/sys/arm/ti/ti_pruss.c Modified: head/sys/arm/ti/ti_pruss.c ============================================================================== --- head/sys/arm/ti/ti_pruss.c Tue Aug 30 01:01:41 2016 (r305038) +++ head/sys/arm/ti/ti_pruss.c Tue Aug 30 01:31:03 2016 (r305039) @@ -310,7 +310,9 @@ ti_pruss_kqfilter(struct cdev *cdev, str case EVFILT_READ: kn->kn_hook = sc; kn->kn_fop = &ti_pruss_kq_read; + mtx_lock(&sc->sc_mtx); knlist_add(&sc->sc_selinfo.si_note, kn, 1); + mtx_unlock(&sc->sc_mtx); break; default: return (EINVAL); From owner-svn-src-head@freebsd.org Tue Aug 30 01: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 56E48BC8799; Tue, 30 Aug 2016 01:58:50 +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 181452F1; Tue, 30 Aug 2016 01:58:50 +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 u7U1wnvD022238; Tue, 30 Aug 2016 01:58:49 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U1wnCc022236; Tue, 30 Aug 2016 01:58:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608300158.u7U1wnCc022236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 30 Aug 2016 01:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305040 - head/sys/dev/tsec 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.22 Precedence: list List-Id: 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, 30 Aug 2016 01:58:50 -0000 Author: jhibbits Date: Tue Aug 30 01:58:49 2016 New Revision: 305040 URL: https://svnweb.freebsd.org/changeset/base/305040 Log: Add support for NXP/Freescale etsec2 ethernet controller Adding the compatible property check isn't enough. Device trees for eTSEC2 devices are missing a 'reg' property on the eTSEC node itself, relegating it to the queue group child nodes. Still left to do: add Multigroup mode support (see QorIQ reference manuals s for SoCs with eTSEC2). MFC after: 2 weeks Relnotes: Yes Modified: head/sys/dev/tsec/if_tsec.h head/sys/dev/tsec/if_tsec_fdt.c Modified: head/sys/dev/tsec/if_tsec.h ============================================================================== --- head/sys/dev/tsec/if_tsec.h Tue Aug 30 01:31:03 2016 (r305039) +++ head/sys/dev/tsec/if_tsec.h Tue Aug 30 01:58:49 2016 (r305040) @@ -135,6 +135,7 @@ struct tsec_softc { int phyaddr; bus_space_tag_t phy_bst; bus_space_handle_t phy_bsh; + int phy_regoff; }; /* interface to get/put generic objects */ @@ -258,9 +259,11 @@ extern struct mtx tsec_phy_mtx; #define TSEC_PHY_LOCK(sc) mtx_lock(&tsec_phy_mtx) #define TSEC_PHY_UNLOCK(sc) mtx_unlock(&tsec_phy_mtx) #define TSEC_PHY_READ(sc, reg) \ - bus_space_read_4((sc)->phy_bst, (sc)->phy_bsh, (reg)) + bus_space_read_4((sc)->phy_bst, (sc)->phy_bsh, \ + (reg) + (sc)->phy_regoff) #define TSEC_PHY_WRITE(sc, reg, val) \ - bus_space_write_4((sc)->phy_bst, (sc)->phy_bsh, (reg), (val)) + bus_space_write_4((sc)->phy_bst, (sc)->phy_bsh, \ + (reg) + (sc)->phy_regoff, (val)) /* Lock for transmitter */ #define TSEC_TRANSMIT_LOCK(sc) do { \ Modified: head/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- head/sys/dev/tsec/if_tsec_fdt.c Tue Aug 30 01:31:03 2016 (r305039) +++ head/sys/dev/tsec/if_tsec_fdt.c Tue Aug 30 01:58:49 2016 (r305040) @@ -121,25 +121,33 @@ tsec_fdt_probe(device_t dev) sc = device_get_softc(dev); - sc->sc_rrid = 0; - sc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rrid, - RF_ACTIVE); - if (sc->sc_rres == NULL) - return (ENXIO); - - sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); - sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); - - /* Check if we are eTSEC (enhanced TSEC) */ - id = TSEC_READ(sc, TSEC_REG_ID); - sc->is_etsec = ((id >> 16) == TSEC_ETSEC_ID) ? 1 : 0; - id |= TSEC_READ(sc, TSEC_REG_ID2); - - bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, sc->sc_rres); - - if (id == 0) { - device_printf(dev, "could not identify TSEC type\n"); - return (ENXIO); + /* + * Device trees with "fsl,etsec2" compatible nodes don't have a reg + * property, as it's been relegated to the queue-group children. + */ + if (ofw_bus_is_compatible(dev, "fsl,etsec2")) + sc->is_etsec = 1; + else { + sc->sc_rrid = 0; + sc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rrid, + RF_ACTIVE); + if (sc->sc_rres == NULL) + return (ENXIO); + + sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); + sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); + + /* Check if we are eTSEC (enhanced TSEC) */ + id = TSEC_READ(sc, TSEC_REG_ID); + sc->is_etsec = ((id >> 16) == TSEC_ETSEC_ID) ? 1 : 0; + id |= TSEC_READ(sc, TSEC_REG_ID2); + + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, sc->sc_rres); + + if (id == 0) { + device_printf(dev, "could not identify TSEC type\n"); + return (ENXIO); + } } if (sc->is_etsec) @@ -154,13 +162,31 @@ static int tsec_fdt_attach(device_t dev) { struct tsec_softc *sc; - phandle_t phy; + struct resource_list *rl; + phandle_t child, mdio, phy; + int acells, scells; int error = 0; sc = device_get_softc(dev); sc->dev = dev; sc->node = ofw_bus_get_node(dev); + if (fdt_addrsize_cells(sc->node, &acells, &scells) != 0) { + acells = 1; + scells = 1; + } + if (ofw_bus_is_compatible(dev, "fsl,etsec2")) { + rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); + + /* + * TODO: Add all children resources to the list. Will be + * required to support multigroup mode. + */ + child = OF_child(sc->node); + ofw_bus_reg_to_rl(dev, child, acells, scells, rl); + ofw_bus_intr_to_rl(dev, child, rl, NULL); + } + /* Get phy address from fdt */ if (OF_getencprop(sc->node, "phy-handle", &phy, sizeof(phy)) <= 0) { device_printf(dev, "PHY not found in device tree"); @@ -168,9 +194,17 @@ tsec_fdt_attach(device_t dev) } phy = OF_node_from_xref(phy); - OF_decode_addr(OF_parent(phy), 0, &sc->phy_bst, &sc->phy_bsh, NULL); + mdio = OF_parent(phy); + OF_decode_addr(mdio, 0, &sc->phy_bst, &sc->phy_bsh, NULL); OF_getencprop(phy, "reg", &sc->phyaddr, sizeof(sc->phyaddr)); + /* + * etsec2 MDIO nodes are given the MDIO module base address, so we need + * to add the MII offset to get the PHY registers. + */ + if (ofw_bus_node_is_compatible(mdio, "fsl,etsec2-mdio")) + sc->phy_regoff = TSEC_REG_MIIBASE; + /* Init timer */ callout_init(&sc->tsec_callout, 1); From owner-svn-src-head@freebsd.org Tue Aug 30 02:04: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 035ACBC8A01; Tue, 30 Aug 2016 02:04:57 +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 AB13E9C2; Tue, 30 Aug 2016 02:04:56 +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 u7U24toj025792; Tue, 30 Aug 2016 02:04:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U24tdC025791; Tue, 30 Aug 2016 02:04:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608300204.u7U24tdC025791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 30 Aug 2016 02:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305041 - head/lib/atf/libatf-c 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.22 Precedence: list List-Id: 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, 30 Aug 2016 02:04:57 -0000 Author: ngie Date: Tue Aug 30 02:04:55 2016 New Revision: 305041 URL: https://svnweb.freebsd.org/changeset/base/305041 Log: Filter certain compile-time options into -DATF_BUILD_* Items filtered through are: - Constant defines (-D) - Include flags (-I) - Linker flags (-L) - Optimization level (-O) - Warnings / linker flags (-W) - Preprocessor options (-f) This fixes the scenario hit by the Jenkins job where it's infecting the build with --sysroot, etc options from the Jenkins build in the tests. Prefix all intermediate variables (_CFLAGS, etc) with "ATF_BUILD" [*]. MFC after: 2 weeks Reported by: Jenkins Requested by: jmmv Reviewed by: jmmv Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7702 Modified: head/lib/atf/libatf-c/Makefile Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Tue Aug 30 01:58:49 2016 (r305040) +++ head/lib/atf/libatf-c/Makefile Tue Aug 30 02:04:55 2016 (r305041) @@ -28,9 +28,9 @@ .include .include -_CFLAGS:= ${CFLAGS} -_CPPFLAGS:= ${CPPFLAGS} -_CXXFLAGS:= ${CXXFLAGS} +ATF_BUILD_CFLAGS:= ${CFLAGS:M-[DILOWf]*} +ATF_BUILD_CPPFLAGS:= ${CPPFLAGS:M-[DILOWf]*} +ATF_BUILD_CXXFLAGS:= ${CXXFLAGS:M-[DILOWf]*} LIB= atf-c PRIVATELIB= true @@ -42,11 +42,11 @@ ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/atf-c/detail CFLAGS+= -DATF_BUILD_CC='"${CC}"' -CFLAGS+= -DATF_BUILD_CFLAGS='"${_CFLAGS}"' +CFLAGS+= -DATF_BUILD_CFLAGS='"${ATF_BUILD_CFLAGS}"' CFLAGS+= -DATF_BUILD_CPP='"${CPP}"' -CFLAGS+= -DATF_BUILD_CPPFLAGS='"${_CPPFLAGS}"' +CFLAGS+= -DATF_BUILD_CPPFLAGS='"${ATF_BUILD_CPPFLAGS}"' CFLAGS+= -DATF_BUILD_CXX='"${CXX}"' -CFLAGS+= -DATF_BUILD_CXXFLAGS='"${_CXXFLAGS}"' +CFLAGS+= -DATF_BUILD_CXXFLAGS='"${ATF_BUILD_CXXFLAGS}"' CFLAGS+= -I${ATF} CFLAGS+= -I${.CURDIR} CFLAGS+= -I. From owner-svn-src-head@freebsd.org Tue Aug 30 02:09: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 8B4C2BC8AC7; Tue, 30 Aug 2016 02:09:41 +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 41A4CC9A; Tue, 30 Aug 2016 02:09:41 +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 u7U29evt026078; Tue, 30 Aug 2016 02:09:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U29eoA026077; Tue, 30 Aug 2016 02:09:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608300209.u7U29eoA026077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 30 Aug 2016 02:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305043 - head/sys/powerpc/mpc85xx 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.22 Precedence: list List-Id: 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, 30 Aug 2016 02:09:41 -0000 Author: jhibbits Date: Tue Aug 30 02:09:40 2016 New Revision: 305043 URL: https://svnweb.freebsd.org/changeset/base/305043 Log: Attach and LAW problems to fix Summary: 1) Attach problem - mpc85xx_probe() relies on fact that 0xfff0 mask matches all QorIQ CPUs what is not true since e6500. This shall be reworked to match against all supported CPUs. 2) There is no any reason for operating system to re-program or anyhow else touch the LAWs programmed by firmware (u-boot). Right now mpc85xx_attach() removes all LaW entries except for DRAM. This causes MCE to be generated when later any of driver maps DTB-provided hardware addresses which do not exist anymore because corresponding LaWs were removed. Submitted by: Ivan Krivonos Differential Revision: https://reviews.freebsd.org/D7663 Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Tue Aug 30 02:07:15 2016 (r305042) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Tue Aug 30 02:09:40 2016 (r305043) @@ -120,11 +120,16 @@ PLATFORM_DEF(mpc85xx_platform); static int mpc85xx_probe(platform_t plat) { - u_int pvr = mfpvr() >> 16; - - if ((pvr & 0xfff0) == FSL_E500v1) - return (BUS_PROBE_DEFAULT); + u_int pvr = (mfpvr() >> 16) & 0xFFFF; + switch (pvr) { + case FSL_E500v1: + case FSL_E500v2: + case FSL_E500mc: + case FSL_E5500: + case FSL_E6500: + return (BUS_PROBE_DEFAULT); + } return (ENXIO); } @@ -135,9 +140,8 @@ mpc85xx_attach(platform_t plat) const char *soc_name_guesses[] = {"/soc", "soc", NULL}; const char **name; pcell_t ranges[6], acells, pacells, scells; - uint32_t sr; uint64_t ccsrbar, ccsrsize; - int i, law_max, tgt; + int i; if ((cpus = OF_finddevice("/cpus")) != -1) { for (maxcpu = 0, child = OF_child(cpus); child != 0; @@ -194,23 +198,6 @@ mpc85xx_attach(platform_t plat) mpc85xx_fix_errata(ccsrbar_va); mpc85xx_enable_l3_cache(); - /* - * Clear local access windows. Skip DRAM entries, so we don't shoot - * ourselves in the foot. - */ - law_max = law_getmax(); - for (i = 0; i < law_max; i++) { - sr = ccsr_read4(OCP85XX_LAWSR(i)); - if ((sr & OCP85XX_ENA_MASK) == 0) - continue; - tgt = (sr & 0x01f00000) >> 20; - if (tgt == OCP85XX_TGTIF_RAM1 || tgt == OCP85XX_TGTIF_RAM2 || - tgt == OCP85XX_TGTIF_RAM_INTL) - continue; - - ccsr_write4(OCP85XX_LAWSR(i), sr & OCP85XX_DIS_MASK); - } - return (0); } From owner-svn-src-head@freebsd.org Tue Aug 30 02:55: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 A5CC2BC7550; Tue, 30 Aug 2016 02:55:08 +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 735237A; Tue, 30 Aug 2016 02:55:08 +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 u7U2t7Z1044188; Tue, 30 Aug 2016 02:55:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U2t7cX044185; Tue, 30 Aug 2016 02:55:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300255.u7U2t7cX044185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 02:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305044 - in head/sys: dev/hyperv/netvsc 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.22 Precedence: list List-Id: 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, 30 Aug 2016 02:55:08 -0000 Author: sephe Date: Tue Aug 30 02:55:07 2016 New Revision: 305044 URL: https://svnweb.freebsd.org/changeset/base/305044 Log: hyperv/hn: Move OIDs to net/rndis.h; they are standard NDIS OIDs. Actually all OIDs defined in net/rndis.h are standard NDIS OIDs. While I'm here, use the verbose macro name as in NDIS spec. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7679 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/ndis.h head/sys/net/rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 02:09:40 2016 (r305043) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 02:55:07 2016 (r305044) @@ -941,7 +941,7 @@ hn_rndis_get_rsscaps(struct hn_softc *sc in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE; caps_len = NDIS_RSS_CAPS_SIZE; - error = hn_rndis_query(sc, OID_GEN_RSS_CAPABILITIES, + error = hn_rndis_query(sc, OID_GEN_RECEIVE_SCALE_CAPABILITIES, &in, NDIS_RSS_CAPS_SIZE, &caps, &caps_len); if (error) return (error); @@ -1092,7 +1092,8 @@ hn_rndis_conf_rss(struct hn_softc *sc, i for (i = 0; i < NDIS_HASH_INDCNT; ++i) rss->rss_ind[i] = i % nchan; - error = hn_rndis_set(sc, OID_GEN_RSS_PARAMETERS, rss, sizeof(*rss)); + error = hn_rndis_set(sc, OID_GEN_RECEIVE_SCALE_PARAMETERS, + rss, sizeof(*rss)); if (error) { if_printf(sc->hn_ifp, "RSS config failed: %d\n", error); } else { Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Tue Aug 30 02:09:40 2016 (r305043) +++ head/sys/dev/hyperv/netvsc/ndis.h Tue Aug 30 02:55:07 2016 (r305044) @@ -32,10 +32,6 @@ #define NDIS_MEDIA_STATE_CONNECTED 0 #define NDIS_MEDIA_STATE_DISCONNECTED 1 -#define OID_GEN_RSS_CAPABILITIES 0x00010203 -#define OID_GEN_RSS_PARAMETERS 0x00010204 -#define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C - #define NDIS_OBJTYPE_DEFAULT 0x80 #define NDIS_OBJTYPE_RSS_CAPS 0x88 #define NDIS_OBJTYPE_RSS_PARAMS 0x89 @@ -143,7 +139,7 @@ struct ndis_offload_params { #define NDIS_OFFLOAD_RSC_ON 2 /* - * OID_GEN_RSS_CAPABILITIES + * OID_GEN_RECEIVE_SCALE_CAPABILITIES * ndis_type: NDIS_OBJTYPE_RSS_CAPS */ struct ndis_rss_caps { @@ -174,7 +170,7 @@ struct ndis_rss_caps { #define NDIS_RSS_CAP_HASH_TOEPLITZ 0x00000001 /* - * OID_GEN_RSS_PARAMETERS + * OID_GEN_RECEIVE_SCALE_PARAMETERS * ndis_type: NDIS_OBJTYPE_RSS_PARAMS */ struct ndis_rss_params { Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Tue Aug 30 02:09:40 2016 (r305043) +++ head/sys/net/rndis.h Tue Aug 30 02:55:07 2016 (r305044) @@ -62,6 +62,8 @@ #define OID_GEN_SUPPORTED_GUIDS 0x00010117 #define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118 #define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119 +#define OID_GEN_RECEIVE_SCALE_CAPABILITIES 0x00010203 +#define OID_GEN_RECEIVE_SCALE_PARAMETERS 0x00010204 #define OID_GEN_MACHINE_NAME 0x0001021A #define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B #define OID_GEN_VLAN_ID 0x0001021C @@ -82,6 +84,8 @@ #define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 #define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 +#define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C + #define RNDIS_MEDIUM_802_3 0x00000000 /* Device flags */ From owner-svn-src-head@freebsd.org Tue Aug 30 03:03: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 0D22EBC7AEF; Tue, 30 Aug 2016 03:03:21 +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 DF3F0D0A; Tue, 30 Aug 2016 03:03:20 +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 u7U33KYv049019; Tue, 30 Aug 2016 03:03:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U33K0U049018; Tue, 30 Aug 2016 03:03:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300303.u7U33K0U049018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 03:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305045 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 03:03:21 -0000 Author: sephe Date: Tue Aug 30 03:03:19 2016 New Revision: 305045 URL: https://svnweb.freebsd.org/changeset/base/305045 Log: hyperv/hn: Indentation and field comment fixup for ndis.h. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7680 Modified: head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Tue Aug 30 02:55:07 2016 (r305044) +++ head/sys/dev/hyperv/netvsc/ndis.h Tue Aug 30 03:03:19 2016 (r305045) @@ -29,42 +29,41 @@ #ifndef _NET_NDIS_H_ #define _NET_NDIS_H_ -#define NDIS_MEDIA_STATE_CONNECTED 0 -#define NDIS_MEDIA_STATE_DISCONNECTED 1 +#define NDIS_MEDIA_STATE_CONNECTED 0 +#define NDIS_MEDIA_STATE_DISCONNECTED 1 -#define NDIS_OBJTYPE_DEFAULT 0x80 -#define NDIS_OBJTYPE_RSS_CAPS 0x88 -#define NDIS_OBJTYPE_RSS_PARAMS 0x89 - -/* common_set */ -#define NDIS_OFFLOAD_SET_NOCHG 0 -#define NDIS_OFFLOAD_SET_ON 1 -#define NDIS_OFFLOAD_SET_OFF 2 +#define NDIS_OFFLOAD_SET_NOCHG 0 +#define NDIS_OFFLOAD_SET_ON 1 +#define NDIS_OFFLOAD_SET_OFF 2 /* a.k.a GRE MAC */ -#define NDIS_ENCAP_TYPE_NVGRE 0x00000001 +#define NDIS_ENCAP_TYPE_NVGRE 0x00000001 -#define NDIS_HASH_FUNCTION_MASK 0x000000FF /* see hash function */ -#define NDIS_HASH_TYPE_MASK 0x00FFFF00 /* see hash type */ +#define NDIS_HASH_FUNCTION_MASK 0x000000FF /* see hash function */ +#define NDIS_HASH_TYPE_MASK 0x00FFFF00 /* see hash type */ /* hash function */ -#define NDIS_HASH_FUNCTION_TOEPLITZ 0x00000001 +#define NDIS_HASH_FUNCTION_TOEPLITZ 0x00000001 /* hash type */ -#define NDIS_HASH_IPV4 0x00000100 -#define NDIS_HASH_TCP_IPV4 0x00000200 -#define NDIS_HASH_IPV6 0x00000400 -#define NDIS_HASH_IPV6_EX 0x00000800 -#define NDIS_HASH_TCP_IPV6 0x00001000 -#define NDIS_HASH_TCP_IPV6_EX 0x00002000 - -#define NDIS_HASH_KEYSIZE_TOEPLITZ 40 -#define NDIS_HASH_INDCNT 128 +#define NDIS_HASH_IPV4 0x00000100 +#define NDIS_HASH_TCP_IPV4 0x00000200 +#define NDIS_HASH_IPV6 0x00000400 +#define NDIS_HASH_IPV6_EX 0x00000800 +#define NDIS_HASH_TCP_IPV6 0x00001000 +#define NDIS_HASH_TCP_IPV6_EX 0x00002000 + +#define NDIS_HASH_KEYSIZE_TOEPLITZ 40 +#define NDIS_HASH_INDCNT 128 + +#define NDIS_OBJTYPE_DEFAULT 0x80 +#define NDIS_OBJTYPE_RSS_CAPS 0x88 +#define NDIS_OBJTYPE_RSS_PARAMS 0x89 struct ndis_object_hdr { - uint8_t ndis_type; /* NDIS_OBJTYPE_ */ - uint8_t ndis_rev; /* type specific */ - uint16_t ndis_size; /* incl. this hdr */ + uint8_t ndis_type; /* NDIS_OBJTYPE_ */ + uint8_t ndis_rev; /* type specific */ + uint16_t ndis_size; /* incl. this hdr */ }; /* @@ -73,70 +72,64 @@ struct ndis_object_hdr { */ struct ndis_offload_params { struct ndis_object_hdr ndis_hdr; - uint8_t ndis_ip4csum; /* param_set */ - uint8_t ndis_tcp4csum; /* param_set */ - uint8_t ndis_udp4csum; /* param_set */ - uint8_t ndis_tcp6csum; /* param_set */ - uint8_t ndis_udp6csum; /* param_set */ - uint8_t ndis_lsov1; /* lsov1_set */ - uint8_t ndis_ipsecv1; /* ipsecv1_set */ - uint8_t ndis_lsov2_ip4; /* lsov2_set */ - uint8_t ndis_lsov2_ip6; /* lsov2_set */ - uint8_t ndis_tcp4conn; /* PARAM_NOCHG */ - uint8_t ndis_tcp6conn; /* PARAM_NOCHG */ - uint32_t ndis_flags; /* 0 */ + uint8_t ndis_ip4csum; /* NDIS_OFFLOAD_PARAM_ */ + uint8_t ndis_tcp4csum; /* NDIS_OFFLOAD_PARAM_ */ + uint8_t ndis_udp4csum; /* NDIS_OFFLOAD_PARAM_ */ + uint8_t ndis_tcp6csum; /* NDIS_OFFLOAD_PARAM_ */ + uint8_t ndis_udp6csum; /* NDIS_OFFLOAD_PARAM_ */ + uint8_t ndis_lsov1; /* NDIS_OFFLOAD_PARAM_ */ + uint8_t ndis_ipsecv1; /* NDIS_OFFLOAD_IPSECV1_ */ + uint8_t ndis_lsov2_ip4; /* NDIS_OFFLOAD_LSOV2_ */ + uint8_t ndis_lsov2_ip6; /* NDIS_OFFLOAD_LSOV2_ */ + uint8_t ndis_tcp4conn; /* 0 */ + uint8_t ndis_tcp6conn; /* 0 */ + uint32_t ndis_flags; /* 0 */ /* NDIS >= 6.1 */ - uint8_t ndis_ipsecv2; /* ipsecv2_set */ - uint8_t ndis_ipsecv2_ip4; /* ipsecv2_set */ + uint8_t ndis_ipsecv2; /* NDIS_OFFLOAD_IPSECV2_ */ + uint8_t ndis_ipsecv2_ip4;/* NDIS_OFFLOAD_IPSECV2_ */ /* NDIS >= 6.30 */ - uint8_t ndis_rsc_ip4; /* rsc_set */ - uint8_t ndis_rsc_ip6; /* rsc_set */ - uint8_t ndis_encap; /* common_set */ - uint8_t ndis_encap_types; /* NDIS_ENCAP_TYPE_ */ + uint8_t ndis_rsc_ip4; /* NDIS_OFFLOAD_RSC_ */ + uint8_t ndis_rsc_ip6; /* NDIS_OFFLOAD_RSC_ */ + uint8_t ndis_encap; /* NDIS_OFFLOAD_SET_ */ + uint8_t ndis_encap_types;/* NDIS_ENCAP_TYPE_ */ }; -#define NDIS_OFFLOAD_PARAMS_SIZE sizeof(struct ndis_offload_params) -#define NDIS_OFFLOAD_PARAMS_SIZE_6_1 \ +#define NDIS_OFFLOAD_PARAMS_SIZE sizeof(struct ndis_offload_params) +#define NDIS_OFFLOAD_PARAMS_SIZE_6_1 \ __offsetof(struct ndis_offload_params, ndis_rsc_ip4) -#define NDIS_OFFLOAD_PARAMS_REV_2 2 /* NDIS 6.1 */ -#define NDIS_OFFLOAD_PARAMS_REV_3 3 /* NDIS 6.30 */ +#define NDIS_OFFLOAD_PARAMS_REV_2 2 /* NDIS 6.1 */ +#define NDIS_OFFLOAD_PARAMS_REV_3 3 /* NDIS 6.30 */ -/* param_set */ -#define NDIS_OFFLOAD_PARAM_NOCHG 0 /* common to all sets */ -#define NDIS_OFFLOAD_PARAM_OFF 1 -#define NDIS_OFFLOAD_PARAM_TX 2 -#define NDIS_OFFLOAD_PARAM_RX 3 -#define NDIS_OFFLOAD_PARAM_TXRX 4 +#define NDIS_OFFLOAD_PARAM_NOCHG 0 /* common */ +#define NDIS_OFFLOAD_PARAM_OFF 1 +#define NDIS_OFFLOAD_PARAM_TX 2 +#define NDIS_OFFLOAD_PARAM_RX 3 +#define NDIS_OFFLOAD_PARAM_TXRX 4 -/* lsov1_set */ /* NDIS_OFFLOAD_PARAM_NOCHG */ -#define NDIS_OFFLOAD_LSOV1_OFF 1 -#define NDIS_OFFLOAD_LSOV1_ON 2 +#define NDIS_OFFLOAD_LSOV1_OFF 1 +#define NDIS_OFFLOAD_LSOV1_ON 2 -/* ipsecv1_set */ /* NDIS_OFFLOAD_PARAM_NOCHG */ -#define NDIS_OFFLOAD_IPSECV1_OFF 1 -#define NDIS_OFFLOAD_IPSECV1_AH 2 -#define NDIS_OFFLOAD_IPSECV1_ESP 3 -#define NDIS_OFFLOAD_IPSECV1_AH_ESP 4 +#define NDIS_OFFLOAD_IPSECV1_OFF 1 +#define NDIS_OFFLOAD_IPSECV1_AH 2 +#define NDIS_OFFLOAD_IPSECV1_ESP 3 +#define NDIS_OFFLOAD_IPSECV1_AH_ESP 4 -/* lsov2_set */ /* NDIS_OFFLOAD_PARAM_NOCHG */ -#define NDIS_OFFLOAD_LSOV2_OFF 1 -#define NDIS_OFFLOAD_LSOV2_ON 2 +#define NDIS_OFFLOAD_LSOV2_OFF 1 +#define NDIS_OFFLOAD_LSOV2_ON 2 -/* ipsecv2_set */ /* NDIS_OFFLOAD_PARAM_NOCHG */ -#define NDIS_OFFLOAD_IPSECV2_OFF 1 -#define NDIS_OFFLOAD_IPSECV2_AH 2 -#define NDIS_OFFLOAD_IPSECV2_ESP 3 -#define NDIS_OFFLOAD_IPSECV2_AH_ESP 4 +#define NDIS_OFFLOAD_IPSECV2_OFF 1 +#define NDIS_OFFLOAD_IPSECV2_AH 2 +#define NDIS_OFFLOAD_IPSECV2_ESP 3 +#define NDIS_OFFLOAD_IPSECV2_AH_ESP 4 -/* rsc_set */ /* NDIS_OFFLOAD_PARAM_NOCHG */ -#define NDIS_OFFLOAD_RSC_OFF 1 -#define NDIS_OFFLOAD_RSC_ON 2 +#define NDIS_OFFLOAD_RSC_OFF 1 +#define NDIS_OFFLOAD_RSC_ON 2 /* * OID_GEN_RECEIVE_SCALE_CAPABILITIES @@ -152,22 +145,22 @@ struct ndis_rss_caps { uint16_t ndis_pad; }; -#define NDIS_RSS_CAPS_SIZE \ +#define NDIS_RSS_CAPS_SIZE \ __offsetof(struct ndis_rss_caps, ndis_pad) -#define NDIS_RSS_CAPS_SIZE_6_0 \ +#define NDIS_RSS_CAPS_SIZE_6_0 \ __offsetof(struct ndis_rss_caps, ndis_nind) -#define NDIS_RSS_CAPS_REV_1 1 /* NDIS 6.{0,1,20} */ -#define NDIS_RSS_CAPS_REV_2 2 /* NDIS 6.30 */ +#define NDIS_RSS_CAPS_REV_1 1 /* NDIS 6.{0,1,20} */ +#define NDIS_RSS_CAPS_REV_2 2 /* NDIS 6.30 */ -#define NDIS_RSS_CAP_MSI 0x01000000 -#define NDIS_RSS_CAP_CLASSIFY_ISR 0x02000000 -#define NDIS_RSS_CAP_CLASSIFY_DPC 0x04000000 -#define NDIS_RSS_CAP_MSIX 0x08000000 -#define NDIS_RSS_CAP_IPV4 0x00000100 -#define NDIS_RSS_CAP_IPV6 0x00000200 -#define NDIS_RSS_CAP_IPV6_EX 0x00000400 -#define NDIS_RSS_CAP_HASH_TOEPLITZ 0x00000001 +#define NDIS_RSS_CAP_MSI 0x01000000 +#define NDIS_RSS_CAP_CLASSIFY_ISR 0x02000000 +#define NDIS_RSS_CAP_CLASSIFY_DPC 0x04000000 +#define NDIS_RSS_CAP_MSIX 0x08000000 +#define NDIS_RSS_CAP_IPV4 0x00000100 +#define NDIS_RSS_CAP_IPV6 0x00000200 +#define NDIS_RSS_CAP_IPV6_EX 0x00000400 +#define NDIS_RSS_CAP_HASH_TOEPLITZ 0x00000001 /* * OID_GEN_RECEIVE_SCALE_PARAMETERS @@ -188,18 +181,18 @@ struct ndis_rss_params { uint32_t ndis_cpumaskentsz; }; -#define NDIS_RSS_PARAMS_SIZE sizeof(struct ndis_rss_params) -#define NDIS_RSS_PARAMS_SIZE_6_0 \ +#define NDIS_RSS_PARAMS_SIZE sizeof(struct ndis_rss_params) +#define NDIS_RSS_PARAMS_SIZE_6_0 \ __offsetof(struct ndis_rss_params, ndis_cpumaskoffset) -#define NDIS_RSS_PARAMS_REV_1 1 /* NDIS 6.0 */ -#define NDIS_RSS_PARAMS_REV_2 2 /* NDIS 6.20 */ +#define NDIS_RSS_PARAMS_REV_1 1 /* NDIS 6.0 */ +#define NDIS_RSS_PARAMS_REV_2 2 /* NDIS 6.20 */ -#define NDIS_RSS_FLAG_BCPU_UNCHG 0x0001 -#define NDIS_RSS_FLAG_HASH_UNCHG 0x0002 -#define NDIS_RSS_FLAG_IND_UNCHG 0x0004 -#define NDIS_RSS_FLAG_KEY_UNCHG 0x0008 -#define NDIS_RSS_FLAG_DISABLE 0x0010 +#define NDIS_RSS_FLAG_BCPU_UNCHG 0x0001 +#define NDIS_RSS_FLAG_HASH_UNCHG 0x0002 +#define NDIS_RSS_FLAG_IND_UNCHG 0x0004 +#define NDIS_RSS_FLAG_KEY_UNCHG 0x0008 +#define NDIS_RSS_FLAG_DISABLE 0x0010 /* non-standard convenient struct */ struct ndis_rssprm_toeplitz { From owner-svn-src-head@freebsd.org Tue Aug 30 03:11: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 B1760BC7D70; Tue, 30 Aug 2016 03:11:08 +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 8CD73FDC; Tue, 30 Aug 2016 03:11:08 +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 u7U3B7FM049367; Tue, 30 Aug 2016 03:11:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U3B7KF049364; Tue, 30 Aug 2016 03:11:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300311.u7U3B7KF049364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 03:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305046 - in head/sys: dev/hyperv/netvsc dev/usb/net 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.22 Precedence: list List-Id: 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, 30 Aug 2016 03:11:08 -0000 Author: sephe Date: Tue Aug 30 03:11:07 2016 New Revision: 305046 URL: https://svnweb.freebsd.org/changeset/base/305046 Log: net/rndis: Packet types are defined by NDIS; not RNDIS specific. Reviewed by: hps MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7681 Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/usb/net/if_urndis.c head/sys/net/rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Tue Aug 30 03:03:19 2016 (r305045) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Tue Aug 30 03:11:07 2016 (r305046) @@ -889,19 +889,6 @@ typedef struct rndismp_rx_bufs_info_ { #define RNDIS_HEADER_SIZE (sizeof(rndis_msg) - sizeof(rndis_msg_container)) -#define NDIS_PACKET_TYPE_DIRECTED 0x00000001 -#define NDIS_PACKET_TYPE_MULTICAST 0x00000002 -#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 -#define NDIS_PACKET_TYPE_BROADCAST 0x00000008 -#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 -#define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 -#define NDIS_PACKET_TYPE_SMT 0x00000040 -#define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 -#define NDIS_PACKET_TYPE_GROUP 0x00000100 -#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200 -#define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400 -#define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800 - /* * Externs */ Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Tue Aug 30 03:03:19 2016 (r305045) +++ head/sys/dev/usb/net/if_urndis.c Tue Aug 30 03:11:07 2016 (r305046) @@ -292,8 +292,8 @@ urndis_attach(device_t dev) memcpy(&sc->sc_ue.ue_eaddr, buf, ETHER_ADDR_LEN); /* Initialize packet filter */ - sc->sc_filter = RNDIS_PACKET_TYPE_BROADCAST | - RNDIS_PACKET_TYPE_ALL_MULTICAST; + sc->sc_filter = NDIS_PACKET_TYPE_BROADCAST | + NDIS_PACKET_TYPE_ALL_MULTICAST; msg.ibuf.filter = htole32(sc->sc_filter); URNDIS_LOCK(sc); error = urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Tue Aug 30 03:03:19 2016 (r305045) +++ head/sys/net/rndis.h Tue Aug 30 03:11:07 2016 (r305046) @@ -266,18 +266,18 @@ struct rndis_keepalive_comp { }; /* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */ -#define RNDIS_PACKET_TYPE_DIRECTED 0x00000001 -#define RNDIS_PACKET_TYPE_MULTICAST 0x00000002 -#define RNDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 -#define RNDIS_PACKET_TYPE_BROADCAST 0x00000008 -#define RNDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 -#define RNDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 -#define RNDIS_PACKET_TYPE_SMT 0x00000040 -#define RNDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 -#define RNDIS_PACKET_TYPE_GROUP 0x00001000 -#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000 -#define RNDIS_PACKET_TYPE_FUNCTIONAL 0x00004000 -#define RNDIS_PACKET_TYPE_MAC_FRAME 0x00008000 +#define NDIS_PACKET_TYPE_DIRECTED 0x00000001 +#define NDIS_PACKET_TYPE_MULTICAST 0x00000002 +#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 +#define NDIS_PACKET_TYPE_BROADCAST 0x00000008 +#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 +#define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 +#define NDIS_PACKET_TYPE_SMT 0x00000040 +#define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 +#define NDIS_PACKET_TYPE_GROUP 0x00001000 +#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000 +#define NDIS_PACKET_TYPE_FUNCTIONAL 0x00004000 +#define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000 /* RNDIS offsets */ #define RNDIS_HEADER_OFFSET 8 /* bytes */ From owner-svn-src-head@freebsd.org Tue Aug 30 03:40: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 0C89BB77726; Tue, 30 Aug 2016 03:40:24 +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 C0EB31C4; Tue, 30 Aug 2016 03:40:23 +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 u7U3eMeQ060345; Tue, 30 Aug 2016 03:40:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U3eMWD060344; Tue, 30 Aug 2016 03:40:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300340.u7U3eMWD060344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 03:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305047 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 03:40:24 -0000 Author: sephe Date: Tue Aug 30 03:40:22 2016 New Revision: 305047 URL: https://svnweb.freebsd.org/changeset/base/305047 Log: hyperv/hn: Switch to new RNDIS set for RX filters. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7683 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 03:11:07 2016 (r305046) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 03:40:22 2016 (r305047) @@ -81,10 +81,7 @@ static void hv_rf_receive_data(struct hn const void *data, int dlen); static inline int hv_rf_query_device_mac(rndis_device *device); static inline int hv_rf_query_device_link_status(rndis_device *device); -static int hv_rf_set_packet_filter(rndis_device *device, uint32_t new_filter); static int hv_rf_init_device(rndis_device *device); -static int hv_rf_open_device(rndis_device *device); -static int hv_rf_close_device(rndis_device *device); int hv_rf_send_offload_request(struct hn_softc *sc, rndis_offload_params *offloads); @@ -679,72 +676,6 @@ static uint8_t netvsc_hash_key[NDIS_HASH 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa }; -/* - * RNDIS filter set packet filter - * Sends an rndis request with the new filter, then waits for a response - * from the host. - * Returns zero on success, non-zero on failure. - */ -static int -hv_rf_set_packet_filter(rndis_device *device, uint32_t new_filter) -{ - rndis_request *request; - rndis_set_request *set; - rndis_set_complete *set_complete; - uint32_t status; - int ret; - - request = hv_rndis_request(device, REMOTE_NDIS_SET_MSG, - RNDIS_MESSAGE_SIZE(rndis_set_request) + sizeof(uint32_t)); - if (request == NULL) { - ret = -1; - goto cleanup; - } - - /* Set up the rndis set */ - set = &request->request_msg.msg.set_request; - set->oid = RNDIS_OID_GEN_CURRENT_PACKET_FILTER; - set->info_buffer_length = sizeof(uint32_t); - set->info_buffer_offset = sizeof(rndis_set_request); - - memcpy((void *)((unsigned long)set + sizeof(rndis_set_request)), - &new_filter, sizeof(uint32_t)); - - ret = hv_rf_send_request(device, request, REMOTE_NDIS_SET_MSG); - if (ret != 0) { - goto cleanup; - } - - /* - * Wait for the response from the host. Another thread will signal - * us when the response has arrived. In the failure case, - * sema_timedwait() returns a non-zero status after waiting 5 seconds. - */ - ret = sema_timedwait(&request->wait_sema, 5 * hz); - if (ret == 0) { - /* Response received, check status */ - set_complete = &request->response_msg.msg.set_complete; - status = set_complete->status; - if (status != RNDIS_STATUS_SUCCESS) { - /* Bad response status, return error */ - ret = -2; - } - } else { - /* - * We cannot deallocate the request since we may still - * receive a send completion for it. - */ - goto exit; - } - -cleanup: - if (request != NULL) { - hv_put_rndis_request(device, request); - } -exit: - return (ret); -} - static const void * hn_rndis_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, uint32_t rid, size_t reqlen, size_t *comp_len0, uint32_t comp_type) @@ -1103,6 +1034,25 @@ hn_rndis_conf_rss(struct hn_softc *sc, i return (error); } +static int +hn_rndis_set_rxfilter(struct hn_softc *sc, uint32_t filter) +{ + int error; + + error = hn_rndis_set(sc, OID_GEN_CURRENT_PACKET_FILTER, + &filter, sizeof(filter)); + if (error) { + if_printf(sc->hn_ifp, "set RX filter 0x%08x failed: %d\n", + filter, error); + } else { + if (bootverbose) { + if_printf(sc->hn_ifp, "set RX filter 0x%08x done\n", + filter); + } + } + return (error); +} + /* * RNDIS filter init device */ @@ -1211,55 +1161,6 @@ hv_rf_halt_device(rndis_device *device) } /* - * RNDIS filter open device - */ -static int -hv_rf_open_device(rndis_device *device) -{ - int ret; - - if (device->state != RNDIS_DEV_INITIALIZED) { - return (0); - } - - if (hv_promisc_mode != 1) { - ret = hv_rf_set_packet_filter(device, - NDIS_PACKET_TYPE_BROADCAST | - NDIS_PACKET_TYPE_ALL_MULTICAST | - NDIS_PACKET_TYPE_DIRECTED); - } else { - ret = hv_rf_set_packet_filter(device, - NDIS_PACKET_TYPE_PROMISCUOUS); - } - - if (ret == 0) { - device->state = RNDIS_DEV_DATAINITIALIZED; - } - - return (ret); -} - -/* - * RNDIS filter close device - */ -static int -hv_rf_close_device(rndis_device *device) -{ - int ret; - - if (device->state != RNDIS_DEV_DATAINITIALIZED) { - return (0); - } - - ret = hv_rf_set_packet_filter(device, 0); - if (ret == 0) { - device->state = RNDIS_DEV_INITIALIZED; - } - - return (ret); -} - -/* * RNDIS filter on device add */ int @@ -1442,8 +1343,17 @@ hv_rf_on_device_remove(struct hn_softc * int hv_rf_on_open(struct hn_softc *sc) { + uint32_t filter; - return (hv_rf_open_device(sc->rndis_dev)); + /* XXX */ + if (hv_promisc_mode != 1) { + filter = NDIS_PACKET_TYPE_BROADCAST | + NDIS_PACKET_TYPE_ALL_MULTICAST | + NDIS_PACKET_TYPE_DIRECTED; + } else { + filter = NDIS_PACKET_TYPE_PROMISCUOUS; + } + return (hn_rndis_set_rxfilter(sc, filter)); } /* @@ -1453,7 +1363,7 @@ int hv_rf_on_close(struct hn_softc *sc) { - return (hv_rf_close_device(sc->rndis_dev)); + return (hn_rndis_set_rxfilter(sc, 0)); } static void From owner-svn-src-head@freebsd.org Tue Aug 30 03:55: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 48140B77B80; Tue, 30 Aug 2016 03:55:44 +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 09F56DCB; Tue, 30 Aug 2016 03:55:43 +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 u7U3thgb067761; Tue, 30 Aug 2016 03:55:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U3th4a067760; Tue, 30 Aug 2016 03:55:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300355.u7U3th4a067760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 03:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305048 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 03:55:44 -0000 Author: sephe Date: Tue Aug 30 03:55:43 2016 New Revision: 305048 URL: https://svnweb.freebsd.org/changeset/base/305048 Log: hyperv/hn: Remove unused function MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7684 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 03:40:22 2016 (r305047) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 03:55:43 2016 (r305048) @@ -82,9 +82,6 @@ static void hv_rf_receive_data(struct hn static inline int hv_rf_query_device_mac(rndis_device *device); static inline int hv_rf_query_device_link_status(rndis_device *device); static int hv_rf_init_device(rndis_device *device); -int -hv_rf_send_offload_request(struct hn_softc *sc, - rndis_offload_params *offloads); static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct hn_softc *sc, struct vmbus_channel *chan, @@ -352,78 +349,6 @@ hv_rf_receive_response(rndis_device *dev } } -int -hv_rf_send_offload_request(struct hn_softc *sc, - rndis_offload_params *offloads) -{ - rndis_request *request; - rndis_set_request *set; - rndis_offload_params *offload_req; - rndis_set_complete *set_complete; - rndis_device *rndis_dev = sc->rndis_dev; - device_t dev = sc->hn_dev; - uint32_t extlen = sizeof(rndis_offload_params); - int ret; - - if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_4) { - extlen = VERSION_4_OFFLOAD_SIZE; - /* On NVSP_PROTOCOL_VERSION_4 and below, we do not support - * UDP checksum offload. - */ - offloads->udp_ipv4_csum = 0; - offloads->udp_ipv6_csum = 0; - } - - request = hv_rndis_request(rndis_dev, REMOTE_NDIS_SET_MSG, - RNDIS_MESSAGE_SIZE(rndis_set_request) + extlen); - if (!request) - return (ENOMEM); - - set = &request->request_msg.msg.set_request; - set->oid = RNDIS_OID_TCP_OFFLOAD_PARAMETERS; - set->info_buffer_length = extlen; - set->info_buffer_offset = sizeof(rndis_set_request); - set->device_vc_handle = 0; - - offload_req = (rndis_offload_params *)((unsigned long)set + - set->info_buffer_offset); - *offload_req = *offloads; - offload_req->header.type = RNDIS_OBJECT_TYPE_DEFAULT; - offload_req->header.revision = RNDIS_OFFLOAD_PARAMETERS_REVISION_3; - offload_req->header.size = extlen; - - ret = hv_rf_send_request(rndis_dev, request, REMOTE_NDIS_SET_MSG); - if (ret != 0) { - device_printf(dev, "hv send offload request failed, ret=%d!\n", - ret); - goto cleanup; - } - - ret = sema_timedwait(&request->wait_sema, 5 * hz); - if (ret != 0) { - device_printf(dev, "hv send offload request timeout\n"); - goto cleanup; - } - - set_complete = &request->response_msg.msg.set_complete; - if (set_complete->status == RNDIS_STATUS_SUCCESS) { - device_printf(dev, "hv send offload request succeeded\n"); - ret = 0; - } else { - if (set_complete->status == RNDIS_STATUS_NOT_SUPPORTED) { - device_printf(dev, "HV Not support offload\n"); - ret = 0; - } else { - ret = set_complete->status; - } - } - -cleanup: - hv_put_rndis_request(rndis_dev, request); - - return (ret); -} - /* * RNDIS filter receive indicate status */ From owner-svn-src-head@freebsd.org Tue Aug 30 04:04: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 3D2CBB77D6A; Tue, 30 Aug 2016 04:04:31 +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 E2FBB22E; Tue, 30 Aug 2016 04:04:30 +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 u7U44UR0071583; Tue, 30 Aug 2016 04:04:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U44UYD071582; Tue, 30 Aug 2016 04:04:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300404.u7U44UYD071582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 04:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305049 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 04:04:31 -0000 Author: sephe Date: Tue Aug 30 04:04:29 2016 New Revision: 305049 URL: https://svnweb.freebsd.org/changeset/base/305049 Log: hyperv/hn: Factor out func to exec RNDIS transaction w/o checking result It will be used by RNDIS HALT and RESET. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7685 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 03:55:43 2016 (r305048) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 04:04:29 2016 (r305049) @@ -602,20 +602,15 @@ static uint8_t netvsc_hash_key[NDIS_HASH }; static const void * -hn_rndis_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, uint32_t rid, - size_t reqlen, size_t *comp_len0, uint32_t comp_type) +hn_rndis_xact_exec1(struct hn_softc *sc, struct vmbus_xact *xact, size_t reqlen, + struct hn_send_ctx *sndc, size_t *comp_len) { struct vmbus_gpa gpa[HN_XACT_REQ_PGCNT]; - const struct rndis_comp_hdr *comp; - bus_addr_t paddr; - size_t comp_len, min_complen = *comp_len0; int gpa_cnt, error; + bus_addr_t paddr; - KASSERT(rid > HN_RNDIS_RID_COMPAT_MAX, ("invalid rid %u\n", rid)); KASSERT(reqlen <= HN_XACT_REQ_SIZE && reqlen > 0, ("invalid request length %zu", reqlen)); - KASSERT(min_complen >= sizeof(*comp), - ("invalid minimum complete len %zu", min_complen)); /* * Setup the SG list. @@ -644,14 +639,34 @@ hn_rndis_xact_execute(struct hn_softc *s * message. */ vmbus_xact_activate(xact); - error = hv_nv_on_send(sc->hn_prichan, HN_NVS_RNDIS_MTYPE_CTRL, - &hn_send_ctx_none, gpa, gpa_cnt); + error = hv_nv_on_send(sc->hn_prichan, HN_NVS_RNDIS_MTYPE_CTRL, sndc, + gpa, gpa_cnt); if (error) { vmbus_xact_deactivate(xact); if_printf(sc->hn_ifp, "RNDIS ctrl send failed: %d\n", error); return (NULL); } - comp = vmbus_xact_wait(xact, &comp_len); + return (vmbus_xact_wait(xact, comp_len)); +} + +static const void * +hn_rndis_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, uint32_t rid, + size_t reqlen, size_t *comp_len0, uint32_t comp_type) +{ + const struct rndis_comp_hdr *comp; + size_t comp_len, min_complen = *comp_len0; + + KASSERT(rid > HN_RNDIS_RID_COMPAT_MAX, ("invalid rid %u\n", rid)); + KASSERT(min_complen >= sizeof(*comp), + ("invalid minimum complete len %zu", min_complen)); + + /* + * Execute the xact setup by the caller. + */ + comp = hn_rndis_xact_exec1(sc, xact, reqlen, &hn_send_ctx_none, + &comp_len); + if (comp == NULL) + return (NULL); /* * Check this RNDIS complete message. From owner-svn-src-head@freebsd.org Tue Aug 30 05:09: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 6A16FBC89AC; Tue, 30 Aug 2016 05:09:27 +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 47E81CB4; Tue, 30 Aug 2016 05:09:27 +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 u7U59QX0093945; Tue, 30 Aug 2016 05:09:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U59QRq093942; Tue, 30 Aug 2016 05:09:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300509.u7U59QRq093942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 05:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305050 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 05:09:27 -0000 Author: sephe Date: Tue Aug 30 05:09:26 2016 New Revision: 305050 URL: https://svnweb.freebsd.org/changeset/base/305050 Log: hyperv/hn: Switch to new RNDIS transaction execution for halt. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7686 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 30 04:04:29 2016 (r305049) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 30 05:09:26 2016 (r305050) @@ -74,8 +74,6 @@ static void hv_nv_on_receive(struct hn_s static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct hn_softc *, struct vmbus_channel *chan, const void *, int); -static void hn_nvs_sent_xact(struct hn_send_ctx *, struct hn_softc *sc, - struct vmbus_channel *, const void *, int); struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); @@ -655,7 +653,7 @@ hv_nv_on_device_remove(struct hn_softc * return (0); } -static void +void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc __unused, struct vmbus_channel *chan __unused, const void *data, int dlen) Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 04:04:29 2016 (r305049) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 05:09:26 2016 (r305050) @@ -71,8 +71,6 @@ __FBSDID("$FreeBSD$"); /* * Forward declarations */ -static int hv_rf_send_request(rndis_device *device, rndis_request *request, - uint32_t message_type); static void hv_rf_receive_response(rndis_device *device, const rndis_msg *response); static void hv_rf_receive_indicate_status(rndis_device *device, @@ -83,12 +81,6 @@ static inline int hv_rf_query_device_mac static inline int hv_rf_query_device_link_status(rndis_device *device); static int hv_rf_init_device(rndis_device *device); -static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, - struct hn_softc *sc, struct vmbus_channel *chan, - const void *data, int dlen); -static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, - struct hn_softc *sc, struct vmbus_channel *chan, - const void *data, int dlen); static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0); static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, @@ -197,120 +189,6 @@ hv_put_rndis_device(rndis_device *device } /* - * - */ -static inline rndis_request * -hv_rndis_request(rndis_device *device, uint32_t message_type, - uint32_t message_length) -{ - rndis_request *request; - rndis_msg *rndis_mesg; - rndis_set_request *set; - - request = malloc(sizeof(rndis_request), M_NETVSC, M_WAITOK | M_ZERO); - - sema_init(&request->wait_sema, 0, "rndis sema"); - - rndis_mesg = &request->request_msg; - rndis_mesg->ndis_msg_type = message_type; - rndis_mesg->msg_len = message_length; - - /* - * Set the request id. This field is always after the rndis header - * for request/response packet types so we just use the set_request - * as a template. - */ - set = &rndis_mesg->msg.set_request; - set->request_id = atomic_fetchadd_int(&device->new_request_id, 1) & - HN_RNDIS_RID_COMPAT_MASK; - - /* Add to the request list */ - mtx_lock(&device->req_lock); - STAILQ_INSERT_TAIL(&device->myrequest_list, request, mylist_entry); - mtx_unlock(&device->req_lock); - - return (request); -} - -/* - * - */ -static inline void -hv_put_rndis_request(rndis_device *device, rndis_request *request) -{ - mtx_lock(&device->req_lock); - /* Fixme: Has O(n) performance */ - /* - * XXXKYS: Use Doubly linked lists. - */ - STAILQ_REMOVE(&device->myrequest_list, request, rndis_request_, - mylist_entry); - mtx_unlock(&device->req_lock); - - sema_destroy(&request->wait_sema); - free(request, M_NETVSC); -} - -/* - * - */ -static int -hv_rf_send_request(rndis_device *device, rndis_request *request, - uint32_t message_type) -{ - struct hn_softc *sc = device->sc; - uint32_t send_buf_section_idx, tot_data_buf_len; - struct vmbus_gpa gpa[2]; - int gpa_cnt, send_buf_section_size; - hn_sent_callback_t cb; - - /* Set up the packet to send it */ - tot_data_buf_len = request->request_msg.msg_len; - - gpa_cnt = 1; - gpa[0].gpa_page = hv_get_phys_addr(&request->request_msg) >> PAGE_SHIFT; - gpa[0].gpa_len = request->request_msg.msg_len; - gpa[0].gpa_ofs = (unsigned long)&request->request_msg & (PAGE_SIZE - 1); - - if (gpa[0].gpa_ofs + gpa[0].gpa_len > PAGE_SIZE) { - gpa_cnt = 2; - gpa[0].gpa_len = PAGE_SIZE - gpa[0].gpa_ofs; - gpa[1].gpa_page = - hv_get_phys_addr((char*)&request->request_msg + - gpa[0].gpa_len) >> PAGE_SHIFT; - gpa[1].gpa_ofs = 0; - gpa[1].gpa_len = request->request_msg.msg_len - gpa[0].gpa_len; - } - - if (message_type != REMOTE_NDIS_HALT_MSG) - cb = hn_rndis_sent_cb; - else - cb = hn_rndis_sent_halt; - - if (tot_data_buf_len < sc->hn_chim_szmax) { - send_buf_section_idx = hn_chim_alloc(sc); - if (send_buf_section_idx != HN_NVS_CHIM_IDX_INVALID) { - uint8_t *dest = sc->hn_chim + - (send_buf_section_idx * sc->hn_chim_szmax); - - memcpy(dest, &request->request_msg, request->request_msg.msg_len); - send_buf_section_size = tot_data_buf_len; - gpa_cnt = 0; - goto sendit; - } - /* Failed to allocate chimney send buffer; move on */ - } - send_buf_section_idx = HN_NVS_CHIM_IDX_INVALID; - send_buf_section_size = 0; - -sendit: - hn_send_ctx_init(&request->send_ctx, cb, request, - send_buf_section_idx, send_buf_section_size); - return hv_nv_on_send(sc->hn_prichan, HN_NVS_RNDIS_MTYPE_CTRL, - &request->send_ctx, gpa, gpa_cnt); -} - -/* * RNDIS filter receive response */ static void @@ -1052,51 +930,34 @@ done: return (error); } -#define HALT_COMPLETION_WAIT_COUNT 25 - /* * RNDIS filter halt device */ static int -hv_rf_halt_device(rndis_device *device) +hv_rf_halt_device(struct hn_softc *sc) { - rndis_request *request; - int i, ret; - - /* Attempt to do a rndis device halt */ - request = hv_rndis_request(device, REMOTE_NDIS_HALT_MSG, - RNDIS_MESSAGE_SIZE(rndis_halt_request)); - if (request == NULL) { - return (-1); - } - - /* initialize "poor man's semaphore" */ - request->halt_complete_flag = 0; - - ret = hv_rf_send_request(device, request, REMOTE_NDIS_HALT_MSG); - if (ret != 0) { - return (-1); - } + struct vmbus_xact *xact; + struct rndis_halt_req *halt; + struct hn_send_ctx sndc; + size_t comp_len; - /* - * Wait for halt response from halt callback. We must wait for - * the transaction response before freeing the request and other - * resources. - */ - for (i=HALT_COMPLETION_WAIT_COUNT; i > 0; i--) { - if (request->halt_complete_flag != 0) { - break; - } - DELAY(400); - } - if (i == 0) { - return (-1); + xact = vmbus_xact_get(sc->hn_xact, sizeof(*halt)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for RNDIS halt\n"); + return (ENXIO); } + halt = vmbus_xact_req_data(xact); + halt->rm_type = REMOTE_NDIS_HALT_MSG; + halt->rm_len = sizeof(*halt); + halt->rm_rid = hn_rndis_rid(sc); + + /* No RNDIS completion; rely on NVS message send completion */ + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); + hn_rndis_xact_exec1(sc, xact, sizeof(*halt), &sndc, &comp_len); - device->state = RNDIS_DEV_UNINITIALIZED; - - hv_put_rndis_request(device, request); - + vmbus_xact_put(xact); + if (bootverbose) + if_printf(sc->hn_ifp, "RNDIS halt done\n"); return (0); } @@ -1266,7 +1127,7 @@ hv_rf_on_device_remove(struct hn_softc * int ret; /* Halt and release the rndis device */ - ret = hv_rf_halt_device(rndis_dev); + ret = hv_rf_halt_device(sc); sc->rndis_dev = NULL; hv_put_rndis_device(rndis_dev); @@ -1306,33 +1167,6 @@ hv_rf_on_close(struct hn_softc *sc) return (hn_rndis_set_rxfilter(sc, 0)); } -static void -hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct hn_softc *sc, - struct vmbus_channel *chan __unused, const void *data __unused, - int dlen __unused) -{ - if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) - hn_chim_free(sc, sndc->hn_chim_idx); -} - -static void -hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct hn_softc *sc, - struct vmbus_channel *chan __unused, const void *data __unused, - int dlen __unused) -{ - rndis_request *request = sndc->hn_cbarg; - - if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) - hn_chim_free(sc, sndc->hn_chim_idx); - - /* - * Notify hv_rf_halt_device() about halt completion. - * The halt code must wait for completion before freeing - * the transaction resources. - */ - request->halt_complete_flag = 1; -} - void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr) { Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 30 04:04:29 2016 (r305049) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 30 05:09:26 2016 (r305050) @@ -112,6 +112,8 @@ struct vmbus_xact; const void *hn_nvs_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, void *req, int reqlen, size_t *resp_len); +void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc, + struct vmbus_channel *chan, const void *data, int dlen); uint32_t hn_chim_alloc(struct hn_softc *sc); void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); From owner-svn-src-head@freebsd.org Tue Aug 30 05: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 3BE7EBC8B42; Tue, 30 Aug 2016 05:15:43 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0EFBAEC; Tue, 30 Aug 2016 05:15:42 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7U5FgBe097495; Tue, 30 Aug 2016 05:15:42 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U5FgAq097494; Tue, 30 Aug 2016 05:15:42 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201608300515.u7U5FgAq097494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 30 Aug 2016 05:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305051 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 05:15:43 -0000 Author: kevlo Date: Tue Aug 30 05:15:42 2016 New Revision: 305051 URL: https://svnweb.freebsd.org/changeset/base/305051 Log: Zap M_IOVEC. Reviewed by: Matthew Macy Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Aug 30 05:09:26 2016 (r305050) +++ head/sys/sys/mbuf.h Tue Aug 30 05:15:42 2016 (r305051) @@ -391,7 +391,7 @@ struct mbuf { #define EXT_JUMBO9 4 /* jumbo cluster 9216 bytes */ #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ -#define EXT_MBUF 7 /* external mbuf reference (M_IOVEC) */ +#define EXT_MBUF 7 /* external mbuf reference */ #define EXT_SFBUF_NOCACHE 8 /* sendfile(2)'s sf_buf not to be cached */ #define EXT_VENDOR1 224 /* for vendor-internal use */ From owner-svn-src-head@freebsd.org Tue Aug 30 05:21: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 9B4CBBC8E07; Tue, 30 Aug 2016 05:21: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 68ED776D; Tue, 30 Aug 2016 05:21:35 +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 u7U5LYJf001326; Tue, 30 Aug 2016 05:21:34 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U5LYvO001321; Tue, 30 Aug 2016 05:21:34 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300521.u7U5LYvO001321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 05:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305052 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 05:21:35 -0000 Author: sephe Date: Tue Aug 30 05:21:34 2016 New Revision: 305052 URL: https://svnweb.freebsd.org/changeset/base/305052 Log: hyperv/hn: Remove the useless rndis_device and related bits MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7687 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_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 Tue Aug 30 05:15:42 2016 (r305051) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 30 05:21:34 2016 (r305052) @@ -641,7 +641,7 @@ cleanup: * Net VSC on device remove */ int -hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel) +hv_nv_on_device_remove(struct hn_softc *sc) { hv_nv_disconnect_from_vsp(sc); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Aug 30 05:15:42 2016 (r305051) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Aug 30 05:21:34 2016 (r305052) @@ -237,8 +237,8 @@ typedef void (*pfn_on_send_rx_completion #define TRANSPORT_TYPE_IPV6_UDP ((TYPE_IPV6 << 16) | TYPE_UDP) typedef struct { - uint8_t mac_addr[6]; /* Assumption unsigned long */ - uint8_t link_state; + uint8_t mac_addr[ETHER_ADDR_LEN]; + uint32_t link_state; } netvsc_device_info; #define HN_XACT_REQ_PGCNT 2 @@ -351,7 +351,6 @@ typedef struct hn_softc { int hn_initdone; /* See hv_netvsc_drv_freebsd.c for rules on how to use */ int temp_unusable; - struct rndis_device_ *rndis_dev; struct vmbus_channel *hn_prichan; int hn_rx_ring_cnt; @@ -400,8 +399,7 @@ struct hn_send_ctx; void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status); int hv_nv_on_device_add(struct hn_softc *sc, struct hn_rx_ring *rxr); -int hv_nv_on_device_remove(struct hn_softc *sc, - boolean_t destroy_channel); +int hv_nv_on_device_remove(struct hn_softc *sc); int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); void hv_nv_subchan_attach(struct vmbus_channel *chan, Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Aug 30 05:15:42 2016 (r305051) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Aug 30 05:21:34 2016 (r305052) @@ -154,8 +154,8 @@ __FBSDID("$FreeBSD$"); #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) +/* -1 for RNDIS packet message */ +#define HN_TX_DATA_SEGCNT_MAX (NETVSC_PACKET_MAXPAGE - 1) #define HN_DIRECT_TX_SIZE_DEF 128 @@ -651,7 +651,7 @@ netvsc_detach(device_t dev) * the netdevice. */ - hv_rf_on_device_remove(sc, HV_RF_NV_DESTROY_CHANNEL); + hv_rf_on_device_remove(sc); hn_stop_tx_tasks(sc); @@ -1029,7 +1029,8 @@ hn_encap(struct hn_tx_ring *txr, struct } *m_head0 = m_head; - txr->hn_gpa_cnt = nsegs + HV_RF_NUM_TX_RESERVED_PAGE_BUFS; + /* +1 RNDIS packet message */ + txr->hn_gpa_cnt = nsegs + 1; /* send packet with page buffer */ txr->hn_gpa[0].gpa_page = atop(txd->rndis_msg_paddr); @@ -1037,12 +1038,11 @@ hn_encap(struct hn_tx_ring *txr, struct txr->hn_gpa[0].gpa_len = rndis_msg_size; /* - * Fill the page buffers with mbuf info starting at index - * HV_RF_NUM_TX_RESERVED_PAGE_BUFS. + * Fill the page buffers with mbuf info after the page + * buffer for RNDIS packet message. */ for (i = 0; i < nsegs; ++i) { - struct vmbus_gpa *gpa = &txr->hn_gpa[ - i + HV_RF_NUM_TX_RESERVED_PAGE_BUFS]; + struct vmbus_gpa *gpa = &txr->hn_gpa[i + 1]; gpa->gpa_page = atop(segs[i].ds_addr); gpa->gpa_ofs = segs[i].ds_addr & PAGE_MASK; @@ -1576,7 +1576,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, * MTU to take effect. This includes tearing down, but not * deleting the channel, then bringing it back up. */ - error = hv_rf_on_device_remove(sc, HV_RF_NV_RETAIN_CHANNEL); + error = hv_rf_on_device_remove(sc); if (error) { NV_LOCK(sc); sc->temp_unusable = FALSE; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 05:15:42 2016 (r305051) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 05:21:34 2016 (r305052) @@ -71,15 +71,14 @@ __FBSDID("$FreeBSD$"); /* * Forward declarations */ -static void hv_rf_receive_response(rndis_device *device, - const rndis_msg *response); -static void hv_rf_receive_indicate_status(rndis_device *device, +static void hv_rf_receive_indicate_status(struct hn_softc *sc, const rndis_msg *response); static void hv_rf_receive_data(struct hn_rx_ring *rxr, const void *data, int dlen); -static inline int hv_rf_query_device_mac(rndis_device *device); -static inline int hv_rf_query_device_link_status(rndis_device *device); -static int hv_rf_init_device(rndis_device *device); +static int hv_rf_query_device_mac(struct hn_softc *sc, uint8_t *eaddr); +static int hv_rf_query_device_link_status(struct hn_softc *sc, + uint32_t *link_status); +static int hv_rf_init_device(struct hn_softc *sc); static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0); @@ -157,94 +156,24 @@ hv_get_ppi_data(rndis_packet *rpkt, uint return (NULL); } - -/* - * Allow module_param to work and override to switch to promiscuous mode. - */ -static inline rndis_device * -hv_get_rndis_device(void) -{ - rndis_device *device; - - device = malloc(sizeof(rndis_device), M_NETVSC, M_WAITOK | M_ZERO); - - mtx_init(&device->req_lock, "HV-FRL", NULL, MTX_DEF); - - /* Same effect as STAILQ_HEAD_INITIALIZER() static initializer */ - STAILQ_INIT(&device->myrequest_list); - - device->state = RNDIS_DEV_UNINITIALIZED; - - return (device); -} - -/* - * - */ -static inline void -hv_put_rndis_device(rndis_device *device) -{ - mtx_destroy(&device->req_lock); - free(device, M_NETVSC); -} - -/* - * RNDIS filter receive response - */ -static void -hv_rf_receive_response(rndis_device *device, const rndis_msg *response) -{ - rndis_request *request = NULL; - rndis_request *next_request; - boolean_t found = FALSE; - - mtx_lock(&device->req_lock); - request = STAILQ_FIRST(&device->myrequest_list); - while (request != NULL) { - /* - * All request/response message contains request_id as the - * first field - */ - if (request->request_msg.msg.init_request.request_id == - response->msg.init_complete.request_id) { - found = TRUE; - break; - } - next_request = STAILQ_NEXT(request, mylist_entry); - request = next_request; - } - mtx_unlock(&device->req_lock); - - if (found) { - if (response->msg_len <= sizeof(rndis_msg)) { - memcpy(&request->response_msg, response, - response->msg_len); - } else { - request->response_msg.msg.init_complete.status = - RNDIS_STATUS_BUFFER_OVERFLOW; - } - sema_post(&request->wait_sema); - } -} - /* * RNDIS filter receive indicate status */ static void -hv_rf_receive_indicate_status(rndis_device *device, const rndis_msg *response) +hv_rf_receive_indicate_status(struct hn_softc *sc, const rndis_msg *response) { const rndis_indicate_status *indicate = &response->msg.indicate_status; switch(indicate->status) { case RNDIS_STATUS_MEDIA_CONNECT: - netvsc_linkstatus_callback(device->sc, 1); + netvsc_linkstatus_callback(sc, 1); break; case RNDIS_STATUS_MEDIA_DISCONNECT: - netvsc_linkstatus_callback(device->sc, 0); + netvsc_linkstatus_callback(sc, 0); break; default: /* TODO: */ - device_printf(device->sc->hn_dev, + if_printf(sc->hn_ifp, "unknown status %d received\n", indicate->status); break; } @@ -374,14 +303,9 @@ int hv_rf_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, const void *data, int dlen) { - rndis_device *rndis_dev; const rndis_msg *rndis_hdr; const struct rndis_comp_hdr *comp; - rndis_dev = sc->rndis_dev; - if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) - return (EINVAL); - rndis_hdr = data; switch (rndis_hdr->ndis_msg_type) { /* data message */ @@ -395,17 +319,14 @@ hv_rf_on_receive(struct hn_softc *sc, st case REMOTE_NDIS_SET_CMPLT: case REMOTE_NDIS_KEEPALIVE_CMPLT: comp = data; - if (comp->rm_rid <= HN_RNDIS_RID_COMPAT_MAX) { - /* Transition time compat code */ - hv_rf_receive_response(rndis_dev, rndis_hdr); - } else { - vmbus_xact_ctx_wakeup(sc->hn_xact, data, dlen); - } + KASSERT(comp->rm_rid > HN_RNDIS_RID_COMPAT_MAX, + ("invalid rid 0x%08x\n", comp->rm_rid)); + vmbus_xact_ctx_wakeup(sc->hn_xact, comp, dlen); break; /* notification message */ case REMOTE_NDIS_INDICATE_STATUS_MSG: - hv_rf_receive_indicate_status(rndis_dev, rndis_hdr); + hv_rf_receive_indicate_status(sc, rndis_hdr); break; case REMOTE_NDIS_RESET_CMPLT: @@ -431,19 +352,18 @@ hv_rf_on_receive(struct hn_softc *sc, st * RNDIS filter query device MAC address */ static int -hv_rf_query_device_mac(rndis_device *device) +hv_rf_query_device_mac(struct hn_softc *sc, uint8_t *eaddr) { - struct hn_softc *sc = device->sc; - size_t hwaddr_len; + size_t eaddr_len; int error; - hwaddr_len = ETHER_ADDR_LEN; + eaddr_len = ETHER_ADDR_LEN; error = hn_rndis_query(sc, OID_802_3_PERMANENT_ADDRESS, NULL, 0, - device->hw_mac_addr, &hwaddr_len); + eaddr, &eaddr_len); if (error) return (error); - if (hwaddr_len != ETHER_ADDR_LEN) { - if_printf(sc->hn_ifp, "invalid hwaddr len %zu\n", hwaddr_len); + if (eaddr_len != ETHER_ADDR_LEN) { + if_printf(sc->hn_ifp, "invalid eaddr len %zu\n", eaddr_len); return (EINVAL); } return (0); @@ -452,16 +372,15 @@ hv_rf_query_device_mac(rndis_device *dev /* * RNDIS filter query device link status */ -static inline int -hv_rf_query_device_link_status(rndis_device *device) +static int +hv_rf_query_device_link_status(struct hn_softc *sc, uint32_t *link_status) { - struct hn_softc *sc = device->sc; size_t size; int error; - size = sizeof(uint32_t); + size = sizeof(*link_status); error = hn_rndis_query(sc, OID_GEN_MEDIA_CONNECT_STATUS, NULL, 0, - &device->link_status, &size); + link_status, &size); if (error) return (error); if (size != sizeof(uint32_t)) { @@ -875,9 +794,8 @@ hn_rndis_set_rxfilter(struct hn_softc *s * RNDIS filter init device */ static int -hv_rf_init_device(rndis_device *device) +hv_rf_init_device(struct hn_softc *sc) { - struct hn_softc *sc = device->sc; struct rndis_init_req *req; const struct rndis_init_comp *comp; struct vmbus_xact *xact; @@ -885,9 +803,6 @@ hv_rf_init_device(rndis_device *device) uint32_t rid; int error; - /* XXX */ - device->state = RNDIS_DEV_INITIALIZED; - xact = vmbus_xact_get(sc->hn_xact, sizeof(*req)); if (xact == NULL) { if_printf(sc->hn_ifp, "no xact for RNDIS init\n"); @@ -969,7 +884,6 @@ hv_rf_on_device_add(struct hn_softc *sc, int *nchan0, struct hn_rx_ring *rxr) { int ret; - rndis_device *rndis_dev; netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = sc->hn_dev; struct hn_nvs_subch_req *req; @@ -980,13 +894,6 @@ hv_rf_on_device_add(struct hn_softc *sc, int nchan = *nchan0; int rxr_cnt; - rndis_dev = hv_get_rndis_device(); - if (rndis_dev == NULL) { - return (ENOMEM); - } - sc->rndis_dev = rndis_dev; - rndis_dev->sc = sc; - /* * Let the inner driver handle this first to create the netvsc channel * NOTE! Once the channel is created, we may get a receive callback @@ -994,17 +901,15 @@ hv_rf_on_device_add(struct hn_softc *sc, * Note: Earlier code used a function pointer here. */ ret = hv_nv_on_device_add(sc, rxr); - if (ret != 0) { - hv_put_rndis_device(rndis_dev); + if (ret != 0) return (ret); - } /* * Initialize the rndis device */ /* Send the rndis initialization message */ - ret = hv_rf_init_device(rndis_dev); + ret = hv_rf_init_device(sc); if (ret != 0) { /* * TODO: If rndis init failed, we will need to shut down @@ -1013,19 +918,15 @@ hv_rf_on_device_add(struct hn_softc *sc, } /* Get the mac address */ - ret = hv_rf_query_device_mac(rndis_dev); + ret = hv_rf_query_device_mac(sc, dev_info->mac_addr); if (ret != 0) { /* TODO: shut down rndis device and the channel */ } /* Configure NDIS offload settings */ hn_rndis_conf_offload(sc); - - memcpy(dev_info->mac_addr, rndis_dev->hw_mac_addr, ETHER_ADDR_LEN); - hv_rf_query_device_link_status(rndis_dev); - - dev_info->link_state = rndis_dev->link_status; + hv_rf_query_device_link_status(sc, &dev_info->link_state); if (sc->hn_ndis_ver < NDIS_VERSION_6_30 || nchan == 1) { /* @@ -1121,19 +1022,15 @@ out: * RNDIS filter on device remove */ int -hv_rf_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel) +hv_rf_on_device_remove(struct hn_softc *sc) { - rndis_device *rndis_dev = sc->rndis_dev; int ret; /* Halt and release the rndis device */ ret = hv_rf_halt_device(sc); - sc->rndis_dev = NULL; - hv_put_rndis_device(rndis_dev); - /* Pass control to inner driver to remove the device */ - ret |= hv_nv_on_device_remove(sc, destroy_channel); + ret |= hv_nv_on_device_remove(sc); return (ret); } Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Tue Aug 30 05:15:42 2016 (r305051) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Tue Aug 30 05:21:34 2016 (r305052) @@ -36,80 +36,6 @@ #include /* - * Defines - */ - -/* Destroy or preserve channel on filter/netvsc teardown */ -#define HV_RF_NV_DESTROY_CHANNEL TRUE -#define HV_RF_NV_RETAIN_CHANNEL FALSE - -/* - * Number of page buffers to reserve for the RNDIS filter packet in the - * transmitted message. - */ -#define HV_RF_NUM_TX_RESERVED_PAGE_BUFS 1 - - -/* - * Data types - */ - -typedef enum { - RNDIS_DEV_UNINITIALIZED = 0, - RNDIS_DEV_INITIALIZING, - RNDIS_DEV_INITIALIZED, - RNDIS_DEV_DATAINITIALIZED, -} rndis_device_state; - -typedef struct rndis_request_ { - STAILQ_ENTRY(rndis_request_) mylist_entry; - struct sema wait_sema; - - /* - * The max response size is sizeof(rndis_msg) + PAGE_SIZE. - * - * XXX - * This is ugly and should be cleaned up once we busdma-fy - * RNDIS request bits. - */ - rndis_msg response_msg; - uint8_t buf_resp[PAGE_SIZE]; - - /* Simplify allocation by having a netvsc packet inline */ - struct hn_send_ctx send_ctx; - - /* - * The max request size is sizeof(rndis_msg) + PAGE_SIZE. - * - * NOTE: - * This is required for the large request like RSS settings. - * - * XXX - * This is ugly and should be cleaned up once we busdma-fy - * RNDIS request bits. - */ - rndis_msg request_msg; - uint8_t buf_req[PAGE_SIZE]; - - /* Fixme: Poor man's semaphore. */ - uint32_t halt_complete_flag; -} rndis_request; - -typedef struct rndis_device_ { - struct hn_softc *sc; - - rndis_device_state state; - uint32_t link_status; - uint32_t new_request_id; - - struct mtx req_lock; - - STAILQ_HEAD(RQ, rndis_request_) myrequest_list; - - uint8_t hw_mac_addr[ETHER_ADDR_LEN]; -} rndis_device; - -/* * Externs */ struct hn_rx_ring; @@ -119,7 +45,7 @@ int hv_rf_on_receive(struct hn_softc *sc void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan, struct hn_rx_ring *rxr); -int hv_rf_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel); +int hv_rf_on_device_remove(struct hn_softc *sc); int hv_rf_on_open(struct hn_softc *sc); int hv_rf_on_close(struct hn_softc *sc); From owner-svn-src-head@freebsd.org Tue Aug 30 05:35: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 C52E0BC802F; Tue, 30 Aug 2016 05:35:20 +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 95C7AC13; Tue, 30 Aug 2016 05:35:20 +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 u7U5ZJNA005164; Tue, 30 Aug 2016 05:35:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U5ZJqE005163; Tue, 30 Aug 2016 05:35:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300535.u7U5ZJqE005163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 05:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305053 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 05:35:20 -0000 Author: sephe Date: Tue Aug 30 05:35:19 2016 New Revision: 305053 URL: https://svnweb.freebsd.org/changeset/base/305053 Log: hyperv/hn: Log packet message alignment. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7689 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 05:21:34 2016 (r305052) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 05:35:19 2016 (r305053) @@ -833,9 +833,10 @@ hv_rf_init_device(struct hn_softc *sc) goto done; } if (bootverbose) { - if_printf(sc->hn_ifp, "RNDIS ver %u.%u, pktsz %u, pktcnt %u\n", - comp->rm_ver_major, comp->rm_ver_minor, - comp->rm_pktmaxsz, comp->rm_pktmaxcnt); + if_printf(sc->hn_ifp, "RNDIS ver %u.%u, pktsz %u, pktcnt %u, " + "align %u\n", comp->rm_ver_major, comp->rm_ver_minor, + comp->rm_pktmaxsz, comp->rm_pktmaxcnt, + 1U << comp->rm_align); } error = 0; From owner-svn-src-head@freebsd.org Tue Aug 30 05:47: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 D3968BC8244; Tue, 30 Aug 2016 05:47:59 +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 98E3B7B; Tue, 30 Aug 2016 05:47:59 +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 u7U5lwGJ009181; Tue, 30 Aug 2016 05:47:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U5lwLM009180; Tue, 30 Aug 2016 05:47:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608300547.u7U5lwLM009180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 30 Aug 2016 05:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305054 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 05:47:59 -0000 Author: sephe Date: Tue Aug 30 05:47:58 2016 New Revision: 305054 URL: https://svnweb.freebsd.org/changeset/base/305054 Log: hyperv/hn: Remove unnecessary NULL check. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7690 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 05:35:19 2016 (r305053) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 30 05:47:58 2016 (r305054) @@ -839,10 +839,8 @@ hv_rf_init_device(struct hn_softc *sc) 1U << comp->rm_align); } error = 0; - done: - if (xact != NULL) - vmbus_xact_put(xact); + vmbus_xact_put(xact); return (error); } From owner-svn-src-head@freebsd.org Tue Aug 30 05:50: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 75F8BBC83E5; Tue, 30 Aug 2016 05:50:43 +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 297AB34E; Tue, 30 Aug 2016 05:50:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7U5ogi3009326; Tue, 30 Aug 2016 05:50:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U5ogEq009325; Tue, 30 Aug 2016 05:50:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608300550.u7U5ogEq009325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Aug 2016 05:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305055 - head/cddl/contrib/opensolaris/common/ctf 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.22 Precedence: list List-Id: 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, 30 Aug 2016 05:50:43 -0000 Author: markj Date: Tue Aug 30 05:50:42 2016 New Revision: 305055 URL: https://svnweb.freebsd.org/changeset/base/305055 Log: Recursively enumerate anonymous structs and unions in ctf_member_info(). Previously, ctf_member_info() would ignore members belonging to an anonymous struct or union. This made it impossible to, for example, trace the m_next field of an mbuf using DTrace. Reported and tested by: gallatin MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_types.c Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_types.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_types.c Tue Aug 30 05:47:58 2016 (r305054) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_types.c Tue Aug 30 05:50:42 2016 (r305055) @@ -644,11 +644,8 @@ ctf_type_compat(ctf_file_t *lfp, ctf_id_ } } -/* - * Return the type and offset for a given member of a STRUCT or UNION. - */ -int -ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name, +static int +_ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name, ulong_t off, ctf_membinfo_t *mip) { ctf_file_t *ofp = fp; @@ -673,9 +670,13 @@ ctf_member_info(ctf_file_t *fp, ctf_id_t ((uintptr_t)tp + increment); for (n = LCTF_INFO_VLEN(fp, tp->ctt_info); n != 0; n--, mp++) { + if (mp->ctm_name == 0 && + _ctf_member_info(fp, mp->ctm_type, name, + mp->ctm_offset + off, mip) == 0) + return (0); if (strcmp(ctf_strptr(fp, mp->ctm_name), name) == 0) { mip->ctm_type = mp->ctm_type; - mip->ctm_offset = mp->ctm_offset; + mip->ctm_offset = mp->ctm_offset + off; return (0); } } @@ -684,9 +685,14 @@ ctf_member_info(ctf_file_t *fp, ctf_id_t ((uintptr_t)tp + increment); for (n = LCTF_INFO_VLEN(fp, tp->ctt_info); n != 0; n--, lmp++) { + if (lmp->ctlm_name == 0 && + _ctf_member_info(fp, lmp->ctlm_name, name, + (ulong_t)CTF_LMEM_OFFSET(lmp) + off, mip) == 0) + return (0); if (strcmp(ctf_strptr(fp, lmp->ctlm_name), name) == 0) { mip->ctm_type = lmp->ctlm_type; - mip->ctm_offset = (ulong_t)CTF_LMEM_OFFSET(lmp); + mip->ctm_offset = + (ulong_t)CTF_LMEM_OFFSET(lmp) + off; return (0); } } @@ -696,6 +702,17 @@ ctf_member_info(ctf_file_t *fp, ctf_id_t } /* + * Return the type and offset for a given member of a STRUCT or UNION. + */ +int +ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name, + ctf_membinfo_t *mip) +{ + + return (_ctf_member_info(fp, type, name, 0, mip)); +} + +/* * Return the array type, index, and size information for the specified ARRAY. */ int From owner-svn-src-head@freebsd.org Tue Aug 30 05:56: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 7F1A6BC84CC; Tue, 30 Aug 2016 05:56:22 +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 5CCC4A34; Tue, 30 Aug 2016 05:56:22 +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 u7U5uL7x013071; Tue, 30 Aug 2016 05:56:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U5uLX6013069; Tue, 30 Aug 2016 05:56:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608300556.u7U5uLX6013069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Aug 2016 05:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305056 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 05:56:22 -0000 Author: markj Date: Tue Aug 30 05:56:21 2016 New Revision: 305056 URL: https://svnweb.freebsd.org/changeset/base/305056 Log: Restore swap pager readahead after r292373. The removal of vm_fault_additional_pages() meant that a hard fault on a swap-backed page would result in only that page being read in. This change implements readahead and readbehind for the swap pager in swap_pager_getpages(). swap_pager_haspage() is modified to return the largest contiguous non-resident range of pages containing the requested range. Reviewed by: alc, kib Tested by: pho MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7677 Modified: head/sys/vm/swap_pager.c head/sys/vm/vm_page.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Aug 30 05:50:42 2016 (r305055) +++ head/sys/vm/swap_pager.c Tue Aug 30 05:56:21 2016 (r305056) @@ -990,22 +990,21 @@ swap_pager_copy(vm_object_t srcobject, v * page and return TRUE if it does, FALSE if it doesn't. * * If TRUE, we also try to determine how much valid, contiguous backing - * store exists before and after the requested page within a reasonable - * distance. We do not try to restrict it to the swap device stripe - * (that is handled in getpages/putpages). It probably isn't worth - * doing here. + * store exists before and after the requested page. */ static boolean_t -swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after) +swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, + int *after) { - daddr_t blk0; + daddr_t blk, blk0; + int i; VM_OBJECT_ASSERT_LOCKED(object); + /* * do we have good backing store at the requested index ? */ blk0 = swp_pager_meta_ctl(object, pindex, 0); - if (blk0 == SWAPBLK_NONE) { if (before) *before = 0; @@ -1018,34 +1017,26 @@ swap_pager_haspage(vm_object_t object, v * find backwards-looking contiguous good backing store */ if (before != NULL) { - int i; - - for (i = 1; i < (SWB_NPAGES/2); ++i) { - daddr_t blk; - + for (i = 1; i < SWB_NPAGES; i++) { if (i > pindex) break; blk = swp_pager_meta_ctl(object, pindex - i, 0); if (blk != blk0 - i) break; } - *before = (i - 1); + *before = i - 1; } /* * find forward-looking contiguous good backing store */ if (after != NULL) { - int i; - - for (i = 1; i < (SWB_NPAGES/2); ++i) { - daddr_t blk; - + for (i = 1; i < SWB_NPAGES; i++) { blk = swp_pager_meta_ctl(object, pindex + i, 0); if (blk != blk0 + i) break; } - *after = (i - 1); + *after = i - 1; } return (TRUE); } @@ -1077,62 +1068,107 @@ swap_pager_unswapped(vm_page_t m) } /* - * SWAP_PAGER_GETPAGES() - bring pages in from swap + * swap_pager_getpages() - bring pages in from swap * - * Attempt to retrieve (m, count) pages from backing store, but make - * sure we retrieve at least m[reqpage]. We try to load in as large - * a chunk surrounding m[reqpage] as is contiguous in swap and which - * belongs to the same object. - * - * The code is designed for asynchronous operation and - * immediate-notification of 'reqpage' but tends not to be - * used that way. Please do not optimize-out this algorithmic - * feature, I intend to improve on it in the future. + * Attempt to page in the pages in array "m" of length "count". The caller + * may optionally specify that additional pages preceding and succeeding + * the specified range be paged in. The number of such pages is returned + * in the "rbehind" and "rahead" parameters, and they will be in the + * inactive queue upon return. * - * The parent has a single vm_object_pip_add() reference prior to - * calling us and we should return with the same. - * - * The parent has BUSY'd the pages. We should return with 'm' - * left busy, but the others adjusted. + * The pages in "m" must be busied and will remain busied upon return. */ static int swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, int *rahead) { struct buf *bp; + vm_page_t mpred, msucc, p; + vm_pindex_t pindex; daddr_t blk; + int i, j, reqcount, shift; - /* - * Calculate range to retrieve. The pages have already been assigned - * their swapblks. We require a *contiguous* range but we know it to - * not span devices. If we do not supply it, bad things - * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the - * loops are set up such that the case(s) are handled implicitly. - * - * The swp_*() calls must be made with the object locked. - */ - blk = swp_pager_meta_ctl(m[0]->object, m[0]->pindex, 0); + reqcount = count; - if (blk == SWAPBLK_NONE) - return (VM_PAGER_FAIL); + VM_OBJECT_WUNLOCK(object); + bp = getpbuf(&nsw_rcount); + VM_OBJECT_WLOCK(object); -#ifdef INVARIANTS - for (int i = 0; i < count; i++) - KASSERT(blk + i == - swp_pager_meta_ctl(m[i]->object, m[i]->pindex, 0), - ("%s: range is not contiguous", __func__)); -#endif + if (!swap_pager_haspage(object, m[0]->pindex, rbehind, rahead)) { + relpbuf(bp, &nsw_rcount); + return (VM_PAGER_FAIL); + } /* - * Getpbuf() can sleep. + * Clip the readahead and readbehind ranges to exclude resident pages. */ - VM_OBJECT_WUNLOCK(object); + if (rahead != NULL) { + KASSERT(reqcount - 1 <= *rahead, + ("page count %d extends beyond swap block", reqcount)); + *rahead -= reqcount - 1; + pindex = m[reqcount - 1]->pindex; + msucc = TAILQ_NEXT(m[reqcount - 1], listq); + if (msucc != NULL && msucc->pindex - pindex - 1 < *rahead) + *rahead = msucc->pindex - pindex - 1; + } + if (rbehind != NULL) { + pindex = m[0]->pindex; + mpred = TAILQ_PREV(m[0], pglist, listq); + if (mpred != NULL && pindex - mpred->pindex - 1 < *rbehind) + *rbehind = pindex - mpred->pindex - 1; + } + /* - * Get a swap buffer header to perform the IO - */ - bp = getpbuf(&nsw_rcount); - bp->b_flags |= B_PAGING; + * Allocate readahead and readbehind pages. + */ + shift = rbehind != NULL ? *rbehind : 0; + if (shift != 0) { + for (i = 1; i <= shift; i++) { + p = vm_page_alloc(object, m[0]->pindex - i, + VM_ALLOC_NORMAL | VM_ALLOC_IFNOTCACHED); + if (p == NULL) { + /* Shift allocated pages to the left. */ + for (j = 0; j < i - 1; j++) + bp->b_pages[j] = + bp->b_pages[j + shift - i + 1]; + break; + } + bp->b_pages[shift - i] = p; + } + shift = i - 1; + *rbehind = shift; + } + for (i = 0; i < reqcount; i++) + bp->b_pages[i + shift] = m[i]; + if (rahead != NULL) { + for (i = 0; i < *rahead; i++) { + p = vm_page_alloc(object, + m[reqcount - 1]->pindex + i + 1, + VM_ALLOC_NORMAL | VM_ALLOC_IFNOTCACHED); + if (p == NULL) + break; + bp->b_pages[shift + reqcount + i] = p; + } + *rahead = i; + } + if (rbehind != NULL) + count += *rbehind; + if (rahead != NULL) + count += *rahead; + + vm_object_pip_add(object, count); + + for (i = 0; i < count; i++) + bp->b_pages[i]->oflags |= VPO_SWAPINPROG; + + pindex = bp->b_pages[0]->pindex; + blk = swp_pager_meta_ctl(object, pindex, 0); + KASSERT(blk != SWAPBLK_NONE, + ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex)); + VM_OBJECT_WUNLOCK(object); + + bp->b_flags |= B_PAGING; bp->b_iocmd = BIO_READ; bp->b_iodone = swp_pager_async_iodone; bp->b_rcred = crhold(thread0.td_ucred); @@ -1141,22 +1177,11 @@ swap_pager_getpages(vm_object_t object, bp->b_bcount = PAGE_SIZE * count; bp->b_bufsize = PAGE_SIZE * count; bp->b_npages = count; - - VM_OBJECT_WLOCK(object); - for (int i = 0; i < count; i++) { - bp->b_pages[i] = m[i]; - m[i]->oflags |= VPO_SWAPINPROG; - } + bp->b_pgbefore = rbehind != NULL ? *rbehind : 0; + bp->b_pgafter = rahead != NULL ? *rahead : 0; PCPU_INC(cnt.v_swapin); - PCPU_ADD(cnt.v_swappgsin, bp->b_npages); - - /* - * We still hold the lock on mreq, and our automatic completion routine - * does not remove it. - */ - vm_object_pip_add(object, bp->b_npages); - VM_OBJECT_WUNLOCK(object); + PCPU_ADD(cnt.v_swappgsin, count); /* * perform the I/O. NOTE!!! bp cannot be considered valid after @@ -1173,9 +1198,9 @@ swap_pager_getpages(vm_object_t object, swp_pager_strategy(bp); /* - * wait for the page we want to complete. VPO_SWAPINPROG is always + * Wait for the pages we want to complete. VPO_SWAPINPROG is always * cleared on completion. If an I/O error occurs, SWAPBLK_NONE - * is set in the meta-data. + * is set in the metadata for each page in the request. */ VM_OBJECT_WLOCK(object); while ((m[0]->oflags & VPO_SWAPINPROG) != 0) { @@ -1192,15 +1217,10 @@ swap_pager_getpages(vm_object_t object, /* * If we had an unrecoverable read error pages will not be valid. */ - for (int i = 0; i < count; i++) + for (i = 0; i < reqcount; i++) if (m[i]->valid != VM_PAGE_BITS_ALL) return (VM_PAGER_ERROR); - if (rbehind) - *rbehind = 0; - if (rahead) - *rahead = 0; - return (VM_PAGER_OK); /* @@ -1518,7 +1538,11 @@ swp_pager_async_iodone(struct buf *bp) ("swp_pager_async_iodone: page %p is mapped", m)); KASSERT(m->dirty == 0, ("swp_pager_async_iodone: page %p is dirty", m)); + m->valid = VM_PAGE_BITS_ALL; + if (i < bp->b_pgbefore || + i >= bp->b_npages - bp->b_pgafter) + vm_page_readahead_finish(m); } else { /* * For write success, clear the dirty Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Aug 30 05:50:42 2016 (r305055) +++ head/sys/vm/vm_page.c Tue Aug 30 05:56:21 2016 (r305056) @@ -1030,8 +1030,8 @@ vm_page_free_zero(vm_page_t m) } /* - * Unbusy and handle the page queueing for a page from the VOP_GETPAGES() - * array which was optionally read ahead or behind. + * Unbusy and handle the page queueing for a page from a getpages request that + * was optionally read ahead or behind. */ void vm_page_readahead_finish(vm_page_t m) From owner-svn-src-head@freebsd.org Tue Aug 30 08:34: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 8BC82BC89D5; Tue, 30 Aug 2016 08:34:50 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5EC6DEC8; Tue, 30 Aug 2016 08:34:50 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7U8Yna8072352; Tue, 30 Aug 2016 08:34:49 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7U8Yn1i072351; Tue, 30 Aug 2016 08:34:49 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201608300834.u7U8Yn1i072351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 30 Aug 2016 08:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305057 - head/share/man/man9 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.22 Precedence: list List-Id: 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, 30 Aug 2016 08:34:50 -0000 Author: kevlo Date: Tue Aug 30 08:34:49 2016 New Revision: 305057 URL: https://svnweb.freebsd.org/changeset/base/305057 Log: Update a comment to reflect r305051. Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Tue Aug 30 05:56:21 2016 (r305056) +++ head/share/man/man9/mbuf.9 Tue Aug 30 08:34:49 2016 (r305057) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 29, 2016 +.Dd August 30, 2016 .Dt MBUF 9 .Os .\" @@ -255,7 +255,7 @@ The available external buffer types are #define EXT_JUMBO9 4 /* jumbo cluster 9216 bytes */ #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ -#define EXT_MBUF 7 /* external mbuf reference (M_IOVEC) */ +#define EXT_MBUF 7 /* external mbuf reference */ #define EXT_NET_DRV 252 /* custom ext_buf provided by net driver(s) */ #define EXT_MOD_TYPE 253 /* custom module's ext_buf type */ #define EXT_DISPOSABLE 254 /* can throw this buffer away w/page flipping */ From owner-svn-src-head@freebsd.org Tue Aug 30 10:14: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 68A67B789C0; Tue, 30 Aug 2016 10:14:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 32C46CFC; Tue, 30 Aug 2016 10:14:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id A89BCD4362D; Tue, 30 Aug 2016 20:13:44 +1000 (AEST) Date: Tue, 30 Aug 2016 20:13:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: hiren panchasara cc: Bruce Evans , Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r304895 - head/usr.bin/netstat In-Reply-To: <20160830000121.GD27495@strugglingcoder.info> Message-ID: <20160830195941.V2030@besplex.bde.org> References: <201608271106.u7RB669G009115@repo.freebsd.org> <20160828183439.GU41576@strugglingcoder.info> <20160829050500.D3932@besplex.bde.org> <20160830000121.GD27495@strugglingcoder.info> 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=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=_M-uqYzlgCjfyfPiSZcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 30 Aug 2016 10:14:04 -0000 On Mon, 29 Aug 2016, hiren panchasara wrote: > On 08/29/16 at 05:14P, Bruce Evans wrote: >> On Sun, 28 Aug 2016, hiren panchasara wrote: >> >>> On 08/27/16 at 11:06P, Bruce Evans wrote: >>>> >>>> Log: >>>> Fix build without INET6 and with gcc. A function definition was ifdefed >>>> for INET6, but its protototype was not, and gcc detects the error. >>>> >>>> Modified: >>>> head/usr.bin/netstat/route.c >>> >>> Thanks for the fix. >>> >>> Wouldn't stable/11 be broken in the same way? >> >> Probably. >> >> This only affects gcc users who omit INET6, and much more is broken for >> stable/11 for gcc. > > Broken as in couldn't build? I don't think so. gcc + no-v6 seems like a > special case but I think this should be fixed in 11. If you don't want > to, I'll MFC the change myself. :-) Couldn't build. Building gives at least the same failures as -current used to have: - openssl has hard-coded AVX asms not supported by old binutils (even in FreeBSD-11 IIRC). Fixed in -current. Awaiting MFC. - after turning off openssl, about 20 more things break, including some things that shouldn't be optional. Hacked around in my checkout, but only for -current - something with c+11 for libunwind. Breaks building -current too. Hacked around in my copy, but only for -current. Universe builds are much more broken. No amd64 or i386 kernel builds, due to hard-coded -msse4 -mpclmul in CFLAGS for aesni. Perhaps much more, but the build stops on these flags early. Please MFC it to all affected branches. Bruce From owner-svn-src-head@freebsd.org Tue Aug 30 10: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 B9FABB78BFA; Tue, 30 Aug 2016 10:21:33 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7E2EAAA; Tue, 30 Aug 2016 10:21:33 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UALWFr011893; Tue, 30 Aug 2016 10:21:32 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UALWM8011892; Tue, 30 Aug 2016 10:21:32 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608301021.u7UALWM8011892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Tue, 30 Aug 2016 10:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305058 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 10:21:33 -0000 Author: jmcneill Date: Tue Aug 30 10:21:32 2016 New Revision: 305058 URL: https://svnweb.freebsd.org/changeset/base/305058 Log: Add support for Allwinner A64 watchdog timer. Modified: head/sys/arm/allwinner/aw_wdog.c Modified: head/sys/arm/allwinner/aw_wdog.c ============================================================================== --- head/sys/arm/allwinner/aw_wdog.c Tue Aug 30 08:34:49 2016 (r305057) +++ head/sys/arm/allwinner/aw_wdog.c Tue Aug 30 10:21:32 2016 (r305058) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #define A10_WDOG_CTRL 0x00 #define A31_WDOG_CTRL 0x10 #define WDOG_CTRL_RESTART (1 << 0) +#define A31_WDOG_CTRL_KEY (0xa57 << 1) #define A10_WDOG_MODE 0x04 #define A31_WDOG_MODE 0x18 #define A10_WDOG_MODE_INTVL_SHIFT 3 @@ -92,6 +94,7 @@ struct aw_wdog_softc { struct resource * res; struct mtx mtx; uint8_t wdog_ctrl; + uint32_t wdog_ctrl_key; uint8_t wdog_mode; uint8_t wdog_mode_intvl_shift; uint8_t wdog_mode_en; @@ -108,7 +111,8 @@ static struct ofw_compat_data compat_dat {NULL, 0} }; -static void aw_wdog_watchdog_fn(void *private, u_int cmd, int *error); +static void aw_wdog_watchdog_fn(void *, u_int, int *); +static void aw_wdog_shutdown_fn(void *, int); static int aw_wdog_probe(device_t dev) @@ -160,6 +164,7 @@ aw_wdog_attach(device_t dev) break; case A31_WATCHDOG: sc->wdog_ctrl = A31_WDOG_CTRL; + sc->wdog_ctrl_key = A31_WDOG_CTRL_KEY; sc->wdog_mode = A31_WDOG_MODE; sc->wdog_mode_intvl_shift = A31_WDOG_MODE_INTVL_SHIFT; sc->wdog_mode_en = WDOG_MODE_EN; @@ -173,6 +178,9 @@ aw_wdog_attach(device_t dev) mtx_init(&sc->mtx, "AW Watchdog", "aw_wdog", MTX_DEF); EVENTHANDLER_REGISTER(watchdog_list, aw_wdog_watchdog_fn, sc, 0); + EVENTHANDLER_REGISTER(shutdown_final, aw_wdog_shutdown_fn, sc, + SHUTDOWN_PRI_LAST - 1); + return (0); } @@ -198,7 +206,8 @@ aw_wdog_watchdog_fn(void *private, u_int WRITE(sc, sc->wdog_mode, (wd_intervals[i].value << sc->wdog_mode_intvl_shift) | sc->wdog_mode_en); - WRITE(sc, sc->wdog_ctrl, WDOG_CTRL_RESTART); + WRITE(sc, sc->wdog_ctrl, + WDOG_CTRL_RESTART | sc->wdog_ctrl_key); if (sc->wdog_config) WRITE(sc, sc->wdog_config, sc->wdog_config_value); @@ -222,6 +231,13 @@ aw_wdog_watchdog_fn(void *private, u_int mtx_unlock(&sc->mtx); } +static void +aw_wdog_shutdown_fn(void *private, int howto) +{ + if ((howto & (RB_POWEROFF|RB_HALT)) == 0) + aw_wdog_watchdog_reset(); +} + void aw_wdog_watchdog_reset() { @@ -237,6 +253,8 @@ aw_wdog_watchdog_reset() if (aw_wdog_sc->wdog_config) WRITE(aw_wdog_sc, aw_wdog_sc->wdog_config, aw_wdog_sc->wdog_config_value); + WRITE(aw_wdog_sc, aw_wdog_sc->wdog_ctrl, + WDOG_CTRL_RESTART | aw_wdog_sc->wdog_ctrl_key); while(1) ; From owner-svn-src-head@freebsd.org Tue Aug 30 10:57: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 28D12BC7224; Tue, 30 Aug 2016 10:57:21 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D61ECFE2; Tue, 30 Aug 2016 10:57:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UAvKfx025466; Tue, 30 Aug 2016 10:57:20 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UAvKGK025465; Tue, 30 Aug 2016 10:57:20 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608301057.u7UAvKGK025465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 30 Aug 2016 10:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305059 - head/sys/dev/syscons 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.22 Precedence: list List-Id: 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, 30 Aug 2016 10:57:21 -0000 Author: bde Date: Tue Aug 30 10:57:19 2016 New Revision: 305059 URL: https://svnweb.freebsd.org/changeset/base/305059 Log: Start adding locking to sc_cngetc(). Restore an splx() lost in r228644. We aren't nearly ready to remove spl's. They give hints about missing locking. This lost one was misplaced. Dropping it early for convenience gave race windows for accesses to the fkey buffer. Giant locking accidentally fixed this for non-console cases. Put the spl's around the whole function. Since there are many returns that would need splx() just before them for a direct fix, split the function into a wrapper that does the spl's and a "locked" function that does the work. Return earlier when no keyboard is attached to match the ordering in a planned version. This breaks the dubious feature of returning keys from the fkey buffer after the keyboard has gone away. Losing the keys wouldn't matter, but we keep them too long now. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Tue Aug 30 10:21:32 2016 (r305058) +++ head/sys/dev/syscons/syscons.c Tue Aug 30 10:57:19 2016 (r305059) @@ -1648,6 +1648,7 @@ sc_cnterm(struct consdev *cp) } static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp); +static int sc_cngetc_locked(struct sc_cnstate *sp); static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags); static void sccnscrlock(sc_softc_t *sc, struct sc_cnstate *sp); static void sccnscrunlock(sc_softc_t *sc, struct sc_cnstate *sp); @@ -1824,15 +1825,28 @@ sc_cnputc(struct consdev *cd, int c) static int sc_cngetc(struct consdev *cd) { + int c, s; + + /* assert(sc_console != NULL) */ + s = spltty(); /* block sckbdevent and scrn_timer while we poll */ + if (sc_console->sc->kbd == NULL) { + splx(s); + return -1; + } + c = sc_cngetc_locked(NULL); + splx(s); + return c; +} + +static int +sc_cngetc_locked(struct sc_cnstate *sp) +{ static struct fkeytab fkey; static int fkeycp; scr_stat *scp; const u_char *p; - int s = spltty(); /* block sckbdevent and scrn_timer while we poll */ int c; - /* assert(sc_console != NULL) */ - /* * Stop the screen saver and update the screen if necessary. * What if we have been running in the screen saver code... XXX @@ -1841,15 +1855,8 @@ sc_cngetc(struct consdev *cd) scp = sc_console->sc->cur_scp; /* XXX */ sccnupdate(scp); - if (fkeycp < fkey.len) { - splx(s); + if (fkeycp < fkey.len) return fkey.str[fkeycp++]; - } - - if (scp->sc->kbd == NULL) { - splx(s); - return -1; - } c = scgetc(scp->sc, SCGETC_CN | SCGETC_NONBLOCK, NULL); From owner-svn-src-head@freebsd.org Tue Aug 30 12:36: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 C362EBC73B8; Tue, 30 Aug 2016 12:36:15 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7CA23976; Tue, 30 Aug 2016 12:36:15 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UCaENm062550; Tue, 30 Aug 2016 12:36:14 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UCaEl1062549; Tue, 30 Aug 2016 12:36:14 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608301236.u7UCaEl1062549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 30 Aug 2016 12:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305060 - head/sys/dev/kbdmux 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.22 Precedence: list List-Id: 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, 30 Aug 2016 12:36:15 -0000 Author: bde Date: Tue Aug 30 12:36:14 2016 New Revision: 305060 URL: https://svnweb.freebsd.org/changeset/base/305060 Log: Fix keyboard polling "on/off" to support recursion. vt depends on this, and sc will soon depend on it again. The on/off request is passed without modification to lower layers, so the bug was smaller in this layer than in in lower layers (the sequence on;on;off left polling off when it should be on, but the sequence on;on;off;on;off... doesn't allow the interrupt handler to eat the input after an "off" that should't turn off polled mode, provided lower layers don't have the bug, since this layer is virtual. The bug was small in lower layers too. Normally everything is Giant locked for keyboards, and this locks out the interrupt handler in on;on;off;on;off... sequences. However, PR 211884 says that fixing this bug in ukbd in r303765 apparently causes the eating-by-interrupt behaviour that the fix is to prevent. Discussed with: emax Modified: head/sys/dev/kbdmux/kbdmux.c Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Tue Aug 30 10:57:19 2016 (r305059) +++ head/sys/dev/kbdmux/kbdmux.c Tue Aug 30 12:36:14 2016 (r305060) @@ -150,9 +150,9 @@ struct kbdmux_state int ks_flags; /* flags */ #define COMPOSE (1 << 0) /* compose char flag */ -#define POLLING (1 << 1) /* polling */ #define TASK (1 << 2) /* interrupt task queued */ + int ks_polling; /* poll nesting count */ int ks_mode; /* K_XLATE, K_RAW, K_CODE */ int ks_state; /* state */ int ks_accents; /* accent key index (> 0) */ @@ -666,7 +666,7 @@ next_code: /* see if there is something in the keyboard queue */ scancode = kbdmux_kbd_getc(state); if (scancode == -1) { - if (state->ks_flags & POLLING) { + if (state->ks_polling != 0) { kbdmux_kbd_t *k; SLIST_FOREACH(k, &state->ks_kbds, next) { @@ -1244,7 +1244,8 @@ kbdmux_clear_state_locked(kbdmux_state_t { KBDMUX_LOCK_ASSERT(state, MA_OWNED); - state->ks_flags &= ~(COMPOSE|POLLING); + state->ks_flags &= ~COMPOSE; + state->ks_polling = 0; state->ks_state &= LOCK_MASK; /* preserve locking key state */ state->ks_accents = 0; state->ks_composed_char = 0; @@ -1304,9 +1305,9 @@ kbdmux_poll(keyboard_t *kbd, int on) KBDMUX_LOCK(state); if (on) - state->ks_flags |= POLLING; + state->ks_polling++; else - state->ks_flags &= ~POLLING; + state->ks_polling--; /* set poll on slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) From owner-svn-src-head@freebsd.org Tue Aug 30 12:40: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 F2433BC747E; Tue, 30 Aug 2016 12:40:13 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4B80B2E; Tue, 30 Aug 2016 12:40:13 +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 u7UCeDa9062743; Tue, 30 Aug 2016 12:40:13 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UCeDCm062742; Tue, 30 Aug 2016 12:40:13 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201608301240.u7UCeDCm062742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 30 Aug 2016 12:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305061 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 12:40:14 -0000 Author: araujo Date: Tue Aug 30 12:40:12 2016 New Revision: 305061 URL: https://svnweb.freebsd.org/changeset/base/305061 Log: Invert calloc(3) argument order. Reviewed by: grehan, mav MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7613 Modified: head/usr.sbin/bhyve/pci_e82545.c Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Tue Aug 30 12:36:14 2016 (r305060) +++ head/usr.sbin/bhyve/pci_e82545.c Tue Aug 30 12:40:12 2016 (r305061) @@ -2273,7 +2273,7 @@ e82545_init(struct vmctx *ctx, struct pc int mac_provided; /* Setup our softc */ - sc = calloc(sizeof(*sc), 1); + sc = calloc(1, sizeof(*sc)); pi->pi_arg = sc; sc->esc_pi = pi; From owner-svn-src-head@freebsd.org Tue Aug 30 14:09: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 E6488BC7D8C; Tue, 30 Aug 2016 14:09:26 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 ABAADAD; Tue, 30 Aug 2016 14:09:26 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UE9PT7098205; Tue, 30 Aug 2016 14:09:25 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UE9ONL098191; Tue, 30 Aug 2016 14:09:24 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201608301409.u7UE9ONL098191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 30 Aug 2016 14:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305065 - in head: crypto/openssh secure/usr.sbin/sshd 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.22 Precedence: list List-Id: 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, 30 Aug 2016 14:09:27 -0000 Author: lidl Date: Tue Aug 30 14:09:24 2016 New Revision: 305065 URL: https://svnweb.freebsd.org/changeset/base/305065 Log: Add refactored blacklist support to sshd Change the calls to of blacklist_init() and blacklist_notify to be macros defined in the blacklist_client.h file. This avoids the need for #ifdef USE_BLACKLIST / #endif except in the blacklist.c file. Remove redundent initialization attempts from within blacklist_notify - everything always goes through blacklistd_init(). Added UseBlacklist option to sshd, which defaults to off. To enable the functionality, use '-o UseBlacklist=yes' on the command line, or uncomment in the sshd_config file. Reviewed by: des Approved by: des MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7051 Added: head/crypto/openssh/blacklist.c (contents, props changed) head/crypto/openssh/blacklist_client.h (contents, props changed) Modified: head/crypto/openssh/auth-pam.c head/crypto/openssh/auth.c head/crypto/openssh/auth1.c head/crypto/openssh/auth2.c head/crypto/openssh/packet.c head/crypto/openssh/servconf.c head/crypto/openssh/servconf.h head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 head/secure/usr.sbin/sshd/Makefile head/secure/usr.sbin/sshd/Makefile.depend Modified: head/crypto/openssh/auth-pam.c ============================================================================== --- head/crypto/openssh/auth-pam.c Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/auth-pam.c Tue Aug 30 14:09:24 2016 (r305065) @@ -98,6 +98,7 @@ #include "ssh-gss.h" #endif #include "monitor_wrap.h" +#include "blacklist_client.h" extern ServerOptions options; extern Buffer loginmsg; @@ -794,6 +795,7 @@ sshpam_query(void *ctx, char **name, cha free(msg); return (0); } + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); error("PAM: %s for %s%.100s from %.100s", msg, sshpam_authctxt->valid ? "" : "illegal user ", sshpam_authctxt->user, Modified: head/crypto/openssh/auth.c ============================================================================== --- head/crypto/openssh/auth.c Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/auth.c Tue Aug 30 14:09:24 2016 (r305065) @@ -75,6 +75,7 @@ __RCSID("$FreeBSD$"); #include "authfile.h" #include "ssherr.h" #include "compat.h" +#include "blacklist_client.h" /* import */ extern ServerOptions options; @@ -292,8 +293,11 @@ auth_log(Authctxt *authctxt, int authent authmsg = "Postponed"; else if (partial) authmsg = "Partial"; - else + else { authmsg = authenticated ? "Accepted" : "Failed"; + BLACKLIST_NOTIFY(authenticated ? + BLACKLIST_AUTH_OK : BLACKLIST_AUTH_FAIL); + } authlog("%s %s%s%s for %s%.100s from %.200s port %d %s%s%s", authmsg, @@ -640,6 +644,7 @@ getpwnamallow(const char *user) } #endif if (pw == NULL) { + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); logit("Invalid user %.100s from %.100s", user, get_remote_ipaddr()); #ifdef CUSTOM_FAILED_LOGIN Modified: head/crypto/openssh/auth1.c ============================================================================== --- head/crypto/openssh/auth1.c Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/auth1.c Tue Aug 30 14:09:24 2016 (r305065) @@ -43,6 +43,7 @@ #endif #include "monitor_wrap.h" #include "buffer.h" +#include "blacklist_client.h" /* import */ extern ServerOptions options; @@ -337,6 +338,7 @@ do_authloop(Authctxt *authctxt) char *msg; size_t len; + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); error("Access denied for user %s by PAM account " "configuration", authctxt->user); len = buffer_len(&loginmsg); @@ -404,6 +406,7 @@ do_authentication(Authctxt *authctxt) else { debug("do_authentication: invalid user %s", user); authctxt->pw = fakepw(); + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); } /* Configuration may have changed as a result of Match */ Modified: head/crypto/openssh/auth2.c ============================================================================== --- head/crypto/openssh/auth2.c Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/auth2.c Tue Aug 30 14:09:24 2016 (r305065) @@ -52,6 +52,7 @@ __RCSID("$FreeBSD$"); #include "pathnames.h" #include "buffer.h" #include "canohost.h" +#include "blacklist_client.h" #ifdef GSSAPI #include "ssh-gss.h" @@ -248,6 +249,7 @@ input_userauth_request(int type, u_int32 } else { logit("input_userauth_request: invalid user %s", user); authctxt->pw = fakepw(); + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); #ifdef SSH_AUDIT_EVENTS PRIVSEP(audit_event(SSH_INVALID_USER)); #endif Added: head/crypto/openssh/blacklist.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/crypto/openssh/blacklist.c Tue Aug 30 14:09:24 2016 (r305065) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * Copyright (c) 2016 The FreeBSD Foundation, Inc. + * All rights reserved. + * + * Portions of this software were developed by Kurt Lidl + * under sponsorship from the FreeBSD Foundation. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "includes.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "ssh.h" +#include "packet.h" +#include "log.h" +#include "misc.h" +#include "servconf.h" +#include "blacklist_client.h" +#include + +static struct blacklist *blstate = NULL; + +/* import */ +extern ServerOptions options; + +/* internal definition from bl.h */ +struct blacklist *bl_create(bool, char *, void (*)(int, const char *, va_list)); + +/* impedence match vsyslog() to sshd's internal logging levels */ +void +im_log(int priority, const char *message, va_list args) +{ + LogLevel imlevel; + + switch (priority) { + case LOG_ERR: + imlevel = SYSLOG_LEVEL_ERROR; + break; + case LOG_DEBUG: + imlevel = SYSLOG_LEVEL_DEBUG1; + break; + case LOG_INFO: + imlevel = SYSLOG_LEVEL_INFO; + break; + default: + imlevel = SYSLOG_LEVEL_DEBUG2; + } + do_log(imlevel, message, args); +} + +void +blacklist_init(void) +{ + + if (options.use_blacklist) + blstate = bl_create(false, NULL, im_log); +} + +void +blacklist_notify(int action) +{ + + if (blstate != NULL && packet_connection_is_on_socket()) + (void)blacklist_r(blstate, action, + packet_get_connection_in(), "ssh"); +} Added: head/crypto/openssh/blacklist_client.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/crypto/openssh/blacklist_client.h Tue Aug 30 14:09:24 2016 (r305065) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * Copyright (c) 2016 The FreeBSD Foundation, Inc. + * All rights reserved. + * + * Portions of this software were developed by Kurt Lidl + * under sponsorship from the FreeBSD Foundation. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef BLACKLIST_CLIENT_H +#define BLACKLIST_CLIENT_H + +enum { + BLACKLIST_AUTH_OK = 0, + BLACKLIST_AUTH_FAIL +}; + +#ifdef USE_BLACKLIST +void blacklist_init(void); +void blacklist_notify(int); + +#define BLACKLIST_INIT() blacklist_init() +#define BLACKLIST_NOTIFY(x) blacklist_notify(x) + +#else + +#define BLACKLIST_INIT() +#define BLACKLIST_NOTIFY(x) + +#endif + + +#endif /* BLACKLIST_CLIENT_H */ Modified: head/crypto/openssh/packet.c ============================================================================== --- head/crypto/openssh/packet.c Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/packet.c Tue Aug 30 14:09:24 2016 (r305065) @@ -86,6 +86,7 @@ __RCSID("$FreeBSD$"); #include "packet.h" #include "ssherr.h" #include "sshbuf.h" +#include "blacklist_client.h" #ifdef PACKET_DEBUG #define DBG(x) x @@ -2071,6 +2072,7 @@ sshpkt_fatal(struct ssh *ssh, const char case SSH_ERR_NO_KEX_ALG_MATCH: case SSH_ERR_NO_HOSTKEY_ALG_MATCH: if (ssh && ssh->kex && ssh->kex->failed_choice) { + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); fatal("Unable to negotiate with %.200s port %d: %s. " "Their offer: %s", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), ssh_err(r), Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/servconf.c Tue Aug 30 14:09:24 2016 (r305065) @@ -172,6 +172,7 @@ initialize_server_options(ServerOptions options->ip_qos_bulk = -1; options->version_addendum = NULL; options->fingerprint_hash = -1; + options->use_blacklist = -1; } /* Returns 1 if a string option is unset or set to "none" or 0 otherwise. */ @@ -360,6 +361,8 @@ fill_default_server_options(ServerOption options->fwd_opts.streamlocal_bind_unlink = 0; if (options->fingerprint_hash == -1) options->fingerprint_hash = SSH_FP_HASH_DEFAULT; + if (options->use_blacklist == -1) + options->use_blacklist = 0; assemble_algorithms(options); @@ -437,6 +440,7 @@ typedef enum { sAuthenticationMethods, sHostKeyAgent, sPermitUserRC, sStreamLocalBindMask, sStreamLocalBindUnlink, sAllowStreamLocalForwarding, sFingerprintHash, + sUseBlacklist, sDeprecated, sUnsupported } ServerOpCodes; @@ -579,6 +583,7 @@ static struct { { "streamlocalbindunlink", sStreamLocalBindUnlink, SSHCFG_ALL }, { "allowstreamlocalforwarding", sAllowStreamLocalForwarding, SSHCFG_ALL }, { "fingerprinthash", sFingerprintHash, SSHCFG_GLOBAL }, + { "useblacklist", sUseBlacklist, SSHCFG_GLOBAL }, { "noneenabled", sUnsupported, SSHCFG_ALL }, { "hpndisabled", sDeprecated, SSHCFG_ALL }, { "hpnbuffersize", sDeprecated, SSHCFG_ALL }, @@ -1861,6 +1866,10 @@ process_server_config_line(ServerOptions options->fingerprint_hash = value; break; + case sUseBlacklist: + intptr = &options->use_blacklist; + goto parse_flag; + case sDeprecated: logit("%s line %d: Deprecated option %s", filename, linenum, arg); @@ -2304,6 +2313,7 @@ dump_config(ServerOptions *o) dump_cfg_fmtint(sAllowStreamLocalForwarding, o->allow_streamlocal_forwarding); dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep); dump_cfg_fmtint(sFingerprintHash, o->fingerprint_hash); + dump_cfg_fmtint(sUseBlacklist, o->use_blacklist); /* string arguments */ dump_cfg_string(sPidFile, o->pid_file); Modified: head/crypto/openssh/servconf.h ============================================================================== --- head/crypto/openssh/servconf.h Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/servconf.h Tue Aug 30 14:09:24 2016 (r305065) @@ -195,6 +195,7 @@ typedef struct { char *auth_methods[MAX_AUTH_METHODS]; int fingerprint_hash; + int use_blacklist; } ServerOptions; /* Information about the incoming connection as used by Match */ Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/sshd.c Tue Aug 30 14:09:24 2016 (r305065) @@ -135,6 +135,7 @@ __RCSID("$FreeBSD$"); #include "ssh-sandbox.h" #include "version.h" #include "ssherr.h" +#include "blacklist_client.h" #ifdef LIBWRAP #include @@ -388,6 +389,8 @@ grace_alarm_handler(int sig) kill(0, SIGTERM); } + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); + /* Log error and exit. */ sigdie("Timeout before authentication for %s", get_remote_ipaddr()); } @@ -2251,6 +2254,8 @@ main(int ac, char **av) buffer_init(&loginmsg); auth_debug_reset(); + BLACKLIST_INIT(); + if (use_privsep) { if (privsep_preauth(authctxt) == 1) goto authenticated; Modified: head/crypto/openssh/sshd_config ============================================================================== --- head/crypto/openssh/sshd_config Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/sshd_config Tue Aug 30 14:09:24 2016 (r305065) @@ -120,6 +120,7 @@ #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none +#UseBlacklist no #VersionAddendum FreeBSD-20160310 # no default banner path Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Tue Aug 30 13:56:11 2016 (r305064) +++ head/crypto/openssh/sshd_config.5 Tue Aug 30 14:09:24 2016 (r305065) @@ -1537,6 +1537,15 @@ for authentication using .Cm TrustedUserCAKeys . For more details on certificates, see the CERTIFICATES section in .Xr ssh-keygen 1 . +.It Cm UseBlacklist +Specifies whether +.Xr sshd 8 +attempts to send authentication success and failure messages +to the +.Xr blacklistd 8 +daemon. +The default is +.Dq no . .It Cm UseDNS Specifies whether .Xr sshd 8 Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Tue Aug 30 13:56:11 2016 (r305064) +++ head/secure/usr.sbin/sshd/Makefile Tue Aug 30 14:09:24 2016 (r305065) @@ -40,6 +40,13 @@ CFLAGS+= -DUSE_BSM_AUDIT -DHAVE_GETAUDIT LIBADD+= bsm .endif +.if ${MK_BLACKLIST_SUPPORT} != "no" +CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include +SRCS+= blacklist.c +LIBADD+= blacklist +LDFLAGS+=-L${LIBBLACKLISTDIR} +.endif + .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h Modified: head/secure/usr.sbin/sshd/Makefile.depend ============================================================================== --- head/secure/usr.sbin/sshd/Makefile.depend Tue Aug 30 13:56:11 2016 (r305064) +++ head/secure/usr.sbin/sshd/Makefile.depend Tue Aug 30 14:09:24 2016 (r305065) @@ -17,6 +17,7 @@ DIRDEPS = \ kerberos5/lib/libroken \ kerberos5/lib/libwind \ lib/${CSU_DIR} \ + lib/libblacklist \ lib/libbsm \ lib/libc \ lib/libcom_err \ From owner-svn-src-head@freebsd.org Tue Aug 30 14:28: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 31DBFBC847E; Tue, 30 Aug 2016 14:28:36 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0D1C7D8E; Tue, 30 Aug 2016 14:28:35 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UESZQn005907; Tue, 30 Aug 2016 14:28:35 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UESZKQ005906; Tue, 30 Aug 2016 14:28:35 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201608301428.u7UESZKQ005906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 30 Aug 2016 14:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305066 - head/tools/tools/crypto 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.22 Precedence: list List-Id: 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, 30 Aug 2016 14:28:36 -0000 Author: gnn Date: Tue Aug 30 14:28:35 2016 New Revision: 305066 URL: https://svnweb.freebsd.org/changeset/base/305066 Log: Update cryptotest for modern algorithms Reviewed by: cem Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D7598 Modified: head/tools/tools/crypto/cryptotest.c Modified: head/tools/tools/crypto/cryptotest.c ============================================================================== --- head/tools/tools/crypto/cryptotest.c Tue Aug 30 14:09:24 2016 (r305065) +++ head/tools/tools/crypto/cryptotest.c Tue Aug 30 14:28:35 2016 (r305066) @@ -126,9 +126,10 @@ struct alg { { "blf", 0, 8, 5, 56, CRYPTO_BLF_CBC }, { "cast", 0, 8, 5, 16, CRYPTO_CAST_CBC }, { "skj", 0, 8, 10, 10, CRYPTO_SKIPJACK_CBC }, - { "aes", 0, 16, 16, 16, CRYPTO_RIJNDAEL128_CBC}, - { "aes192", 0, 16, 24, 24, CRYPTO_RIJNDAEL128_CBC}, - { "aes256", 0, 16, 32, 32, CRYPTO_RIJNDAEL128_CBC}, + { "rij", 0, 16, 16, 16, CRYPTO_RIJNDAEL128_CBC}, + { "aes", 0, 16, 16, 16, CRYPTO_AES_CBC}, + { "aes192", 0, 16, 24, 24, CRYPTO_AES_CBC}, + { "aes256", 0, 16, 32, 32, CRYPTO_AES_CBC}, #ifdef notdef { "arc4", 0, 8, 1, 32, CRYPTO_ARC4 }, #endif @@ -139,19 +140,20 @@ struct alg { { "sha512", 1, 8, 64, 64, CRYPTO_SHA2_512_HMAC }, }; -static void +void usage(const char* cmd) { printf("usage: %s [-czsbv] [-d dev] [-a algorithm] [count] [size ...]\n", cmd); printf("where algorithm is one of:\n"); - printf(" des 3des (default) blowfish cast skipjack\n"); - printf(" aes (aka rijndael) aes192 aes256 arc4\n"); + printf(" des 3des (default) blowfish cast skipjack rij\n"); + printf(" aes aes192 aes256 arc4\n"); printf("count is the number of encrypt/decrypt ops to do\n"); printf("size is the number of bytes of text to encrypt+decrypt\n"); printf("\n"); printf("-c check the results (slows timing)\n"); - printf("-d use specific device\n"); + printf("-d use specific device, specify 'soft' for testing software implementations\n"); + printf("\tNOTE: to use software you must set:\n\t sysctl kern.cryptodevallowsoft=1\n"); printf("-z run all available algorithms on a variety of sizes\n"); printf("-v be verbose\n"); printf("-b mark operations for batching\n"); @@ -159,7 +161,7 @@ usage(const char* cmd) exit(-1); } -static struct alg* +struct alg* getalgbycode(int cipher) { int i; @@ -170,7 +172,7 @@ getalgbycode(int cipher) return NULL; } -static struct alg* +struct alg* getalgbyname(const char* name) { int i; @@ -181,10 +183,10 @@ getalgbyname(const char* name) return NULL; } -static int +int devcrypto(void) { - static int fd = -1; + int fd = -1; if (fd < 0) { fd = open(_PATH_DEV "crypto", O_RDWR, 0); @@ -196,11 +198,14 @@ devcrypto(void) return fd; } -static int +int crlookup(const char *devname) { struct crypt_find_op find; + if (strncmp(devname, "soft", 4) == 0) + return CRYPTO_FLAG_SOFTWARE; + find.crid = -1; strlcpy(find.name, devname, sizeof(find.name)); if (ioctl(devcrypto(), CIOCFINDDEV, &find) == -1) @@ -208,10 +213,10 @@ crlookup(const char *devname) return find.crid; } -static const char * +const char * crfind(int crid) { - static struct crypt_find_op find; + struct crypt_find_op find; bzero(&find, sizeof(find)); find.crid = crid; @@ -220,7 +225,7 @@ crfind(int crid) return find.name; } -static int +int crget(void) { int fd; @@ -232,7 +237,7 @@ crget(void) return fd; } -static char +char rdigit(void) { const char a[] = { @@ -242,7 +247,7 @@ rdigit(void) return 0x20+a[random()%nitems(a)]; } -static void +void runtest(struct alg *alg, int count, int size, u_long cmd, struct timeval *tv) { int i, fd = crget(); @@ -386,7 +391,7 @@ runtest(struct alg *alg, int count, int } #ifdef __FreeBSD__ -static void +void resetstats() { struct cryptostats stats; @@ -409,7 +414,7 @@ resetstats() perror("kern.cryptostats"); } -static void +void printt(const char* tag, struct cryptotstat *ts) { uint64_t avg, min, max; @@ -424,7 +429,7 @@ printt(const char* tag, struct cryptotst } #endif -static void +void runtests(struct alg *alg, int count, int size, u_long cmd, int threads, int profile) { int i, status; From owner-svn-src-head@freebsd.org Tue Aug 30 16:04: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 42610BC8594; Tue, 30 Aug 2016 16:04:01 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::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 080BB286C; Tue, 30 Aug 2016 16:04:01 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x234.google.com with SMTP id f189so32284393oig.3; Tue, 30 Aug 2016 09:04:01 -0700 (PDT) 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; bh=b6frV3wyBEJ2GfZn8EYr+ojzwMd3uwgIHKU9SsqnAx4=; b=IcU4CMMRVvicC0FFk1rBDKgPgb334hhrdeyKw6s8r4Pgrag8FLEmIEMtsC+hV79z/M 0+V/J8qQpm5ra7hBvwss8uPqoToqY/pui1e+fcVlV6+DxZX+sxY40OlQMNZ4ZE7M14Zy rzFSGTubQhyv801yh3lD4TelSRdXrEzjromaYbT/uNSjhuJGJZAUyJojSUtHRhJF/o1H IKQOuI6F118ZRPqLeNsOZf0T4+WJLtIG/2OoNjg+P2EIlDtuVoigenvD693eZ7uSU0p4 9F/ZJDlnHosnIkKFA6Vc6YnGpDQCvb5wvuA3VZwdykHbdHjK7V21rVqFz+kNpbvWsLVf hoDw== 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; bh=b6frV3wyBEJ2GfZn8EYr+ojzwMd3uwgIHKU9SsqnAx4=; b=dIpQ1za4CSkSdsgY9vKTp5n0qmPIECCSRuWbAor6Xlk8j8rKImxk9Sem3UK8QAVOLE z22te3nLImi7pI9sUpOiEXcDSbbO+4Ntfqhf5rplAT9Y/ZDdR+5EzgMxZ7vv8jOKSrM7 cmNUxaKbYarqrSUlcugbE/EV1gKjVpHHwyK5cknl4NNLwPvLqOiiROpydyt3vkPaG8ZH gOgJy4TXn5MsazyGeYOqeAlgtEdh0xuvni7/15IAr8cHYYX/rNbA3Lyii3uT+841AWwr 32xkIhwKvBV3HujXfZOBL96n3g/1e99uIqSJy7TOMGh45JPEwNP3qTn+cW+e45X/pOm9 wwbg== X-Gm-Message-State: AE9vXwM9215zF0uzcdXHvrvdg6FzbAkKQq5ljPEaiovEZcErYm0sHD59RVhIttv2On0sjyDpu3utNOgNcDFXAA== X-Received: by 10.202.66.133 with SMTP id p127mr4760535oia.174.1472573040116; Tue, 30 Aug 2016 09:04:00 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.202.196.149 with HTTP; Tue, 30 Aug 2016 09:03:59 -0700 (PDT) In-Reply-To: <201608170124.u7H1OYXQ070590@repo.freebsd.org> References: <201608170124.u7H1OYXQ070590@repo.freebsd.org> From: Alan Somers Date: Tue, 30 Aug 2016 10:03:59 -0600 X-Google-Sender-Auth: 7WLn13dtKDd4FWAouasc6Mvfjxs Message-ID: Subject: Re: svn commit: r304246 - head/sys/dev/pci To: Eric van Gyzen 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.22 Precedence: list List-Id: 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, 30 Aug 2016 16:04:01 -0000 On Tue, Aug 16, 2016 at 7:24 PM, Eric van Gyzen wrote: > Author: vangyzen > Date: Wed Aug 17 01:24:34 2016 > New Revision: 304246 > URL: https://svnweb.freebsd.org/changeset/base/304246 > > Log: > PCIe HotPlug: Detect bridges that are not really HotPlug capable > > Some devices report that they have an MRL when they actually > do not. Since they always report that the MRL is open, child > devices would be ignored. Try to detect these devices and > ignore their claim of HotPlug support. Specifically, > if there is an open MRL but the Data Link Layer is active, > the MRL is not real. > > Revert r303645 to re-enable HotPlug support for slots with > power controllers, since it works correctly in my testing. > > Start the DLL state-change timer if Presence /or/ MRL state changes, > along with other conditions. Previously, we started the timer iff > Presence changed. If there is an MRL, it must be closed for power > to be turned on, so Presence is unlikely to change on an MRL-close event. > > Add a printf() of interesting registers on HotPlug interrupts and > commands (one from erj@). These were very useful for debugging. > Guard them with bootverbose, since they're spam in normal operation. > > In collaboration with: jhb > Reviewed by: jhb > MFC after: 1 day > Relnotes: yes (re-enable HotPlug support for slots with power controllers) > Sponsored by: Dell Inc. > Differential Revision: https://reviews.freebsd.org/D7509 > > Modified: > head/sys/dev/pci/pci_pci.c > I suspect that this has caused a regression for a Dell CS23-SH. It worked on stable/11 at r303879 but in 11.0 RC2 it hangs on boot. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211699 . From owner-svn-src-head@freebsd.org Tue Aug 30 16:40: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 94EDDBC8FF9; Tue, 30 Aug 2016 16:40:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7497DF19; Tue, 30 Aug 2016 16:40:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 522A5B953; Tue, 30 Aug 2016 12:40:09 -0400 (EDT) From: John Baldwin To: "George V. Neville-Neil" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305066 - head/tools/tools/crypto Date: Tue, 30 Aug 2016 09:34:03 -0700 Message-ID: <9289003.aPpUzvfJdT@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608301428.u7UESZKQ005906@repo.freebsd.org> References: <201608301428.u7UESZKQ005906@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 30 Aug 2016 12:40:09 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 30 Aug 2016 16:40:10 -0000 On Tuesday, August 30, 2016 02:28:35 PM George V. Neville-Neil wrote: > Author: gnn > Date: Tue Aug 30 14:28:35 2016 > New Revision: 305066 > URL: https://svnweb.freebsd.org/changeset/base/305066 > > Log: > Update cryptotest for modern algorithms > > Reviewed by: cem > Sponsored by: Rubicon Communications, LLC (Netgate) > Differential Revision: https://reviews.freebsd.org/D7598 Doesn't removing 'static' result in a bunch of warnings from clang now since you don't have function prototypes? Assuming these functions aren't meant to be exposed as a library to other programs, static is more correct. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 30 16:40: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 B9BCEBC8FFD; Tue, 30 Aug 2016 16:40:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BAB8F1B; Tue, 30 Aug 2016 16:40:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9C9CFB962; Tue, 30 Aug 2016 12:40:10 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305032 - head/sys/dev/cxgbe Date: Tue, 30 Aug 2016 07:22:46 -0700 Message-ID: <1531680.3M3PdubIRh@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608292247.u7TMlEf3050457@repo.freebsd.org> References: <201608292247.u7TMlEf3050457@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 30 Aug 2016 12:40:10 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 30 Aug 2016 16:40:11 -0000 On Monday, August 29, 2016 10:47:14 PM John Baldwin wrote: > Author: jhb > Date: Mon Aug 29 22:47:14 2016 > New Revision: 305032 > URL: https://svnweb.freebsd.org/changeset/base/305032 > > Log: > Use device_verbose() to undo device_quiet() when detaching from t[45]iovX. > > The device quiet flag is not automatically reset on detach, so it is > inherited by other device drivers (e.g. when switching a device driver > over to ppt for PCI pass through). Cope with this behavior by explicitly > marking the device verbose during detach so that the next driver can make > its own decision. > > Sponsored by: Chelsio Communications Even though device_quiet() is documented to work this way, I think it is probably worth considering changing this so it only affects a single attach/detach life cycle. That is, clearing the flag in device_detach() (but also handling device_probe() correctly since it is typically called during probe and if multiple drivers probe a device, you only want the behavior of the "winning" driver to be in effect when you call attach). -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 30 16:45: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 2DE6BBC8336; Tue, 30 Aug 2016 16:45:17 +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 EC541A16; Tue, 30 Aug 2016 16:45:16 +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 u7UGjGK2059228; Tue, 30 Aug 2016 16:45:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UGjGtF059227; Tue, 30 Aug 2016 16:45:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608301645.u7UGjGtF059227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 Aug 2016 16:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305071 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 16:45:17 -0000 Author: andrew Date: Tue Aug 30 16:45:15 2016 New Revision: 305071 URL: https://svnweb.freebsd.org/changeset/base/305071 Log: Because we need to use a break-before-make sequence when promoting pages there is a short period where functions that walk the kernel page table without locking them may see an invalid entry. One solution would be to add locking to these functions, however some may be called from locations where we are unable to sleep. Until a better solution can be found stop promoting pages in the kernel pmap so these functions work as expected. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 30 16:43:24 2016 (r305070) +++ head/sys/arm64/arm64/pmap.c Tue Aug 30 16:45:15 2016 (r305071) @@ -2936,14 +2936,17 @@ validate: PTE_SYNC(l3); pmap_invalidate_page(pmap, va); - if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) - cpu_icache_sync_range(va, PAGE_SIZE); - - if ((mpte == NULL || mpte->wire_count == NL3PG) && - pmap_superpages_enabled() && (m->flags & PG_FICTITIOUS) == 0 && - vm_reserv_level_iffullpop(m) == 0) { - KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); - pmap_promote_l2(pmap, pde, va, &lock); + if (pmap != pmap_kernel()) { + if (pmap == &curproc->p_vmspace->vm_pmap) + cpu_icache_sync_range(va, PAGE_SIZE); + + if ((mpte == NULL || mpte->wire_count == NL3PG) && + pmap_superpages_enabled() && + (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) { + KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); + pmap_promote_l2(pmap, pde, va, &lock); + } } if (lock != NULL) From owner-svn-src-head@freebsd.org Tue Aug 30 16:57: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 DDCEDBC87A1; Tue, 30 Aug 2016 16:57:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) (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 B164C1E1; Tue, 30 Aug 2016 16:57:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f51.google.com with SMTP id x131so176099617ite.0; Tue, 30 Aug 2016 09:57:55 -0700 (PDT) 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 :from:date:message-id:subject:to:cc; bh=0KAePSTbujotL0Gvjsb6YAjXNYJx32eBJbpcwO7B3V4=; b=cVxqyc5pADoZjjWsAhyVoihR5vSHo+7oe29XBa/NxRiIr9HiQ4Sp1uP9B0aNpSzNho oKtmDoAuICOXCbsBnojs8u5pKgZ/uzDk/fNxorak3uxciYEbflRGfMDNf40VvLqf78zE 6HE0j6w9mcKRmpBUM0PlfSw80kQ/LZiAdTBliRXLFtrpdIJ+ahfFUEtICpPtDOaRBaFo Mad/JA1pmXgqn457G7G3b9FdtXwDw09rXrW56Sh/LjzcYS/mf+enDXn1xFcJxfikioyA LFMgmT0fvZ5rOXch/fL6vvKpTNrJunupDMk4fTZy8VabUQKf0mlFY1Wa6MLpGhEdb5CH SX/g== X-Gm-Message-State: AE9vXwOHAqa5VGyhjp1XHgOcfnQFcLeHKOTYlDv38QaS+suBllYVS7RMTslxN1HLIaY/QA== X-Received: by 10.36.189.135 with SMTP id x129mr2709719ite.97.1472576269093; Tue, 30 Aug 2016 09:57:49 -0700 (PDT) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com. [209.85.214.53]) by smtp.gmail.com with ESMTPSA id 75sm19445iod.44.2016.08.30.09.57.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Aug 2016 09:57:48 -0700 (PDT) Received: by mail-it0-f53.google.com with SMTP id x131so176099036ite.0; Tue, 30 Aug 2016 09:57:48 -0700 (PDT) X-Received: by 10.36.212.132 with SMTP id x126mr26811087itg.34.1472576268588; Tue, 30 Aug 2016 09:57:48 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Tue, 30 Aug 2016 09:57:48 -0700 (PDT) In-Reply-To: <9289003.aPpUzvfJdT@ralph.baldwin.cx> References: <201608301428.u7UESZKQ005906@repo.freebsd.org> <9289003.aPpUzvfJdT@ralph.baldwin.cx> From: Conrad Meyer Date: Tue, 30 Aug 2016 09:57:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r305066 - head/tools/tools/crypto To: John Baldwin Cc: "George V. Neville-Neil" , src-committers , 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.22 Precedence: list List-Id: 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, 30 Aug 2016 16:57:56 -0000 On Tue, Aug 30, 2016 at 9:34 AM, John Baldwin wrote: > On Tuesday, August 30, 2016 02:28:35 PM George V. Neville-Neil wrote: >> Author: gnn >> Date: Tue Aug 30 14:28:35 2016 >> New Revision: 305066 >> URL: https://svnweb.freebsd.org/changeset/base/305066 >> >> Log: >> Update cryptotest for modern algorithms >> >> Reviewed by: cem Usually reviewed-by is only for 'Approved' indications on phabricator :-). Specifically, my devcrypto() suggestion seems to have been dropped in the commit. (And I never marked the phabricator review as Approved.) >> Sponsored by: Rubicon Communications, LLC (Netgate) >> Differential Revision: https://reviews.freebsd.org/D7598 Best, Conrad From owner-svn-src-head@freebsd.org Tue Aug 30 18:01: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 07A8FBC9C46; Tue, 30 Aug 2016 18:01: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 CEA27A9A; Tue, 30 Aug 2016 18:01: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 u7UI1KaP089324; Tue, 30 Aug 2016 18:01:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UI1KKN089323; Tue, 30 Aug 2016 18:01:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201608301801.u7UI1KKN089323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 30 Aug 2016 18:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305074 - head/sbin/newfs_msdos 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.22 Precedence: list List-Id: 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, 30 Aug 2016 18:01:21 -0000 Author: imp Date: Tue Aug 30 18:01:19 2016 New Revision: 305074 URL: https://svnweb.freebsd.org/changeset/base/305074 Log: Remove CHS alignment. It's not needed and causes problems for the BBB boot partition. NetBSD removed it in 1.10 in their repo some time ago. Submitted by: Guy Yur PR: 183234 Modified: head/sbin/newfs_msdos/mkfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Tue Aug 30 17:18:35 2016 (r305073) +++ head/sbin/newfs_msdos/mkfs_msdos.c Tue Aug 30 18:01:19 2016 (r305074) @@ -313,15 +313,8 @@ mkfs_msdos(const char *fname, const char bpb.bpbHiddenSecs = o.hidden_sectors; if (!(o.floppy || (o.drive_heads && o.sectors_per_track && o.bytes_per_sector && o.size && o.hidden_sectors_set))) { - off_t delta; getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb); bpb.bpbHugeSectors -= (o.offset / bpb.bpbBytesPerSec); - delta = bpb.bpbHugeSectors % bpb.bpbSecPerTrack; - if (delta != 0) { - warnx("trim %d sectors to adjust to a multiple of %d", - (int)delta, bpb.bpbSecPerTrack); - bpb.bpbHugeSectors -= delta; - } if (bpb.bpbSecPerClust == 0) { /* set defaults */ if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */ bpb.bpbSecPerClust = 1; From owner-svn-src-head@freebsd.org Tue Aug 30 18:01: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 A92B1BC9C6D; Tue, 30 Aug 2016 18:01:27 +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 5C30EB86; Tue, 30 Aug 2016 18:01:27 +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 u7UI1QWi089384; Tue, 30 Aug 2016 18:01:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UI1QBn089383; Tue, 30 Aug 2016 18:01:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201608301801.u7UI1QBn089383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 30 Aug 2016 18:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305075 - head/sbin/newfs_msdos 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.22 Precedence: list List-Id: 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, 30 Aug 2016 18:01:27 -0000 Author: imp Date: Tue Aug 30 18:01:26 2016 New Revision: 305075 URL: https://svnweb.freebsd.org/changeset/base/305075 Log: The code only converts from bpbHugeSectors to bpbSectors if the sum of the hidden and huge sectors is less than or equal MAXU16. When formatting in Windows bpbSectors is still used for 63488 sectors and 2048 hidden (sum > MAXU16). The hidden sectors count is the number of sectors before the FAT16 Boot Record so it shouldn't affect the sector count. Attached patch (huge_sec_conversion.patch) to only check for bpb.bpbHugeSectors <= MAXU16 when converting to bpbSectors. Submitted by: Guy Yur PR: 183234 Modified: head/sbin/newfs_msdos/mkfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Tue Aug 30 18:01:19 2016 (r305074) +++ head/sbin/newfs_msdos/mkfs_msdos.c Tue Aug 30 18:01:26 2016 (r305075) @@ -556,7 +556,7 @@ mkfs_msdos(const char *fname, const char bpb.bpbMedia = !bpb.bpbHiddenSecs ? 0xf0 : 0xf8; if (fat == 32) bpb.bpbRootClust = RESFTE; - if (bpb.bpbHiddenSecs + bpb.bpbHugeSectors <= MAXU16) { + if (bpb.bpbHugeSectors <= MAXU16) { bpb.bpbSectors = bpb.bpbHugeSectors; bpb.bpbHugeSectors = 0; } From owner-svn-src-head@freebsd.org Tue Aug 30 19:02: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 8C89EBC983A; Tue, 30 Aug 2016 19:02:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F686DCC; Tue, 30 Aug 2016 19:02:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UJ2Fwd012589; Tue, 30 Aug 2016 19:02:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UJ2FIM012587; Tue, 30 Aug 2016 19:02:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608301902.u7UJ2FIM012587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 Aug 2016 19:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305077 - in head: contrib/telnet/libtelnet usr.bin/newkey 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.22 Precedence: list List-Id: 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, 30 Aug 2016 19:02:16 -0000 Author: dim Date: Tue Aug 30 19:02:15 2016 New Revision: 305077 URL: https://svnweb.freebsd.org/changeset/base/305077 Log: Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted to -32768 when it is used as an argument to mp_itom(), in both libtelnet and newkey. This code has been wrong since r26238 (!), so after almost 20 years it is rather useless to try to correct it. MFC after: 1 week Modified: head/contrib/telnet/libtelnet/pk.c head/usr.bin/newkey/generic.c Modified: head/contrib/telnet/libtelnet/pk.c ============================================================================== --- head/contrib/telnet/libtelnet/pk.c Tue Aug 30 18:27:31 2016 (r305076) +++ head/contrib/telnet/libtelnet/pk.c Tue Aug 30 19:02:15 2016 (r305077) @@ -164,7 +164,7 @@ genkeys(char *public, char *secret) MINT *pk = mp_itom(0); MINT *sk = mp_itom(0); MINT *tmp; - MINT *base = mp_itom(BASE); + MINT *base = mp_itom((short)BASE); MINT *root = mp_itom(PROOT); MINT *modulus = mp_xtom(HEXMODULUS); short r; Modified: head/usr.bin/newkey/generic.c ============================================================================== --- head/usr.bin/newkey/generic.c Tue Aug 30 18:27:31 2016 (r305076) +++ head/usr.bin/newkey/generic.c Tue Aug 30 19:02:15 2016 (r305077) @@ -82,7 +82,7 @@ genkeys(char *public, char *secret, char MINT *pk = mp_itom(0); MINT *sk = mp_itom(0); MINT *tmp; - MINT *base = mp_itom(BASE); + MINT *base = mp_itom((short)BASE); MINT *root = mp_itom(PROOT); MINT *modulus = mp_xtom(HEXMODULUS); short r; From owner-svn-src-head@freebsd.org Tue Aug 30 19:03: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 19D44BC9899 for ; Tue, 30 Aug 2016 19:03:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::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 D734EF7B for ; Tue, 30 Aug 2016 19:03:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id i184so335862itf.1 for ; Tue, 30 Aug 2016 12:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7b4MxZbIPbE1Od76zFPlPic5vESCLZHA3WCiDasN7Ow=; b=SfwqyrG6YwTZo9pZA31rCK6ep260u45ovArKqBJifSj4UWlDtozSGbE8oTMiMK1MdX 9VXH+7by1oh5ObOO2ntKrOY6NlHCZxvmgUaxnWBzaCor4PD23bPGrVMLJvwwXkL3CcTV SpVAbEMHSIEEslkZ6raAnN6qhfw1mq1qWxUgFLn/w8csUmjb7SoDHc1DNmQ+496bI+SB H3df6OebT+0kPmEbodqmsPqBSakgu7QJhBbnZztOH/T2wFuFKwuT+rRv+AFr3R0o7qrX +Teyb6tbMuEEoiiFrbafZxLk3LfbuHWT/Ho0JBWzO/iVHWFYSTyKSi7IYjcXuIbUkDpS cMDA== 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; bh=7b4MxZbIPbE1Od76zFPlPic5vESCLZHA3WCiDasN7Ow=; b=IqHt+U7uFcUhyi2KQYA36FXqVwbGiMnvUvH/hCjI3U7rHpFnY5TBaUv2Fxn6QSeltd OkJsFoAGKmB/fJ/NJR9jYVfeu06KQYvucFtGdVD1Q1NHTU/ngi1T2UAYJXLoMl1+hurg MIfSBJI3q0UKWBNhAp76XLrhKNv0h8R48WWlx2tzEseUdiQ8yhUQjoUyw9WNVS61T4JB buzgISq7BrPu7gqZSKLlQQUaHD5ydKYGfls+Zfclsg2m+LzoXItcK7k3XyvNBEwLj5us MWfCb9WLEY36Uep9CEyfxmnjCM2QQeu8fV/EaqefVZV7MhbBDBuOnaZdLSqXHMmDgPTS FvZA== X-Gm-Message-State: AE9vXwOE+lmYNnTBSKyZvkIob18UHxe6MYfaAL5teHXnZ1AwTJyM3lUCAikPVUvTRFtCIMR4595uoDz8Qyizhg== X-Received: by 10.107.53.142 with SMTP id k14mr746389ioo.59.1472583816152; Tue, 30 Aug 2016 12:03:36 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Tue, 30 Aug 2016 12:03:35 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <1531680.3M3PdubIRh@ralph.baldwin.cx> References: <201608292247.u7TMlEf3050457@repo.freebsd.org> <1531680.3M3PdubIRh@ralph.baldwin.cx> From: Warner Losh Date: Tue, 30 Aug 2016 13:03:35 -0600 X-Google-Sender-Auth: vJLpho0TMSXB9DHaeCgvsuTX7xE Message-ID: Subject: Re: svn commit: r305032 - head/sys/dev/cxgbe To: John Baldwin Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 30 Aug 2016 19:03:37 -0000 On Tue, Aug 30, 2016 at 8:22 AM, John Baldwin wrote: > On Monday, August 29, 2016 10:47:14 PM John Baldwin wrote: >> Author: jhb >> Date: Mon Aug 29 22:47:14 2016 >> New Revision: 305032 >> URL: https://svnweb.freebsd.org/changeset/base/305032 >> >> Log: >> Use device_verbose() to undo device_quiet() when detaching from t[45]iovX. >> >> The device quiet flag is not automatically reset on detach, so it is >> inherited by other device drivers (e.g. when switching a device driver >> over to ppt for PCI pass through). Cope with this behavior by explicitly >> marking the device verbose during detach so that the next driver can make >> its own decision. >> >> Sponsored by: Chelsio Communications > > Even though device_quiet() is documented to work this way, I think it is probably > worth considering changing this so it only affects a single attach/detach life > cycle. That is, clearing the flag in device_detach() (but also handling > device_probe() correctly since it is typically called during probe and if > multiple drivers probe a device, you only want the behavior of the "winning" > driver to be in effect when you call attach). I concur. Years ago, I had something like this in my tree, but I had a disk failure before I could push it in :( Warner From owner-svn-src-head@freebsd.org Tue Aug 30 19:20: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 91829BC9CEC; Tue, 30 Aug 2016 19:20:27 +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 633C993F; Tue, 30 Aug 2016 19:20:27 +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 u7UJKQrc017117; Tue, 30 Aug 2016 19:20:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UJKQtL017116; Tue, 30 Aug 2016 19:20:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608301920.u7UJKQtL017116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 30 Aug 2016 19:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305078 - head/sys/dev/iscsi_initiator 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.22 Precedence: list List-Id: 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, 30 Aug 2016 19:20:27 -0000 Author: emaste Date: Tue Aug 30 19:20:26 2016 New Revision: 305078 URL: https://svnweb.freebsd.org/changeset/base/305078 Log: iscsi_initiator: make logout_req::reason unsigned char Previously this reported an error from Clang 3.9.0: implict conversion from 'int' to 'char' changes value from 128 to -128. Discussed with: dim, trasz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7699 Modified: head/sys/dev/iscsi_initiator/iscsi.h Modified: head/sys/dev/iscsi_initiator/iscsi.h ============================================================================== --- head/sys/dev/iscsi_initiator/iscsi.h Tue Aug 30 19:02:15 2016 (r305077) +++ head/sys/dev/iscsi_initiator/iscsi.h Tue Aug 30 19:20:26 2016 (r305078) @@ -356,7 +356,7 @@ typedef struct text_req { typedef struct logout_req { char cmd; // 0x06 - char reason; // 0 - close session + u_char reason; // 0 - close session // 1 - close connection // 2 - remove the connection for recovery char _2[2]; From owner-svn-src-head@freebsd.org Tue Aug 30 19:26: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 79053BC9FF4; Tue, 30 Aug 2016 19:26:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48CCCF4E; Tue, 30 Aug 2016 19:26:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UJQ7AT020667; Tue, 30 Aug 2016 19:26:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UJQ7JX020666; Tue, 30 Aug 2016 19:26:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608301926.u7UJQ7JX020666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 30 Aug 2016 19:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305079 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 19:26:08 -0000 Author: bdrewery Date: Tue Aug 30 19:26:07 2016 New Revision: 305079 URL: https://svnweb.freebsd.org/changeset/base/305079 Log: Reduce duplicated logic for !SMP Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Tue Aug 30 19:20:26 2016 (r305078) +++ head/sys/kern/subr_smp.c Tue Aug 30 19:26:07 2016 (r305079) @@ -779,15 +779,8 @@ smp_rendezvous(void (*setup_func)(void * void *arg) { - /* Look comments in the smp_rendezvous_cpus() case. */ - spinlock_enter(); - if (setup_func != NULL) - setup_func(arg); - if (action_func != NULL) - action_func(arg); - if (teardown_func != NULL) - teardown_func(arg); - spinlock_exit(); + smp_rendezvous_cpus(all_cpus, setup_func, action_func, teardown_func, + arg); } /* From owner-svn-src-head@freebsd.org Tue Aug 30 19:39: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 0061EBC9383; Tue, 30 Aug 2016 19:39:35 +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 D2338CC8; Tue, 30 Aug 2016 19:39:34 +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 u7UJdYkP024625; Tue, 30 Aug 2016 19:39:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UJdXCT024620; Tue, 30 Aug 2016 19:39:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608301939.u7UJdXCT024620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 30 Aug 2016 19:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305083 - in head/contrib: gcc/doc gcclibs/libcpp 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.22 Precedence: list List-Id: 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, 30 Aug 2016 19:39:35 -0000 Author: pfg Date: Tue Aug 30 19:39:33 2016 New Revision: 305083 URL: https://svnweb.freebsd.org/changeset/base/305083 Log: libcpp: Complete the __COUNTER__ support with upstream implementation. We brought an original __COUNTER__ implementation in r228474, however, it was missing documentation and it had a different behaviour for precompiled headers with respect to the upstream version. Since the upstream version is under the same license as GCC4.2, bring the missing pieces to reduce differences against upstream. Optained from: GCC pre-4.3 (rev. 125041 ; GPLv2) Modified: head/contrib/gcc/doc/cpp.texi head/contrib/gcclibs/libcpp/ChangeLog.gcc43 head/contrib/gcclibs/libcpp/internal.h head/contrib/gcclibs/libcpp/macro.c head/contrib/gcclibs/libcpp/pch.c Modified: head/contrib/gcc/doc/cpp.texi ============================================================================== --- head/contrib/gcc/doc/cpp.texi Tue Aug 30 19:31:12 2016 (r305082) +++ head/contrib/gcc/doc/cpp.texi Tue Aug 30 19:39:33 2016 (r305083) @@ -1912,6 +1912,13 @@ underscores. @table @code +@item __COUNTER__ +This macro expands to sequential integral values starting from 0. In +conjuction with the @code{##} operator, this provides a convenient means to +generate unique identifiers. Care must be taken to ensure that +@code{__COUNTER__} is not expanded prior to inclusion of precompiled headers +which use it. Otherwise, the precompiled headers will not be used. + @item __GNUC__ @itemx __GNUC_MINOR__ @itemx __GNUC_PATCHLEVEL__ Modified: head/contrib/gcclibs/libcpp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcclibs/libcpp/ChangeLog.gcc43 Tue Aug 30 19:31:12 2016 (r305082) +++ head/contrib/gcclibs/libcpp/ChangeLog.gcc43 Tue Aug 30 19:39:33 2016 (r305083) @@ -12,6 +12,17 @@ PR preprocessor/14331 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF. +2007-05-24 Ollie Wild (r125041) + + * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER. + * pch.c (cpp_write_pch_deps): Save __COUNTER__ state. + (cpp_write_pch_state): Save __COUNTER__ state. + (cpp_valid_state): Check valid __COUNTER__ state. + (cpp_read_state): Read new __COUNTER__ state. + * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator. + * init.c (builtin_array): Add __COUNTER__/BT_COUNTER. + * internal.h (struct cpp_reader): Add counter member. + 2007-05-21 Ian Lance Taylor (r124929) * internal.h (struct cpp_reader): Add new fields: Modified: head/contrib/gcclibs/libcpp/internal.h ============================================================================== --- head/contrib/gcclibs/libcpp/internal.h Tue Aug 30 19:31:12 2016 (r305082) +++ head/contrib/gcclibs/libcpp/internal.h Tue Aug 30 19:39:33 2016 (r305083) @@ -458,7 +458,8 @@ struct cpp_reader of precompiled headers. */ struct cpp_savedstate *savedstate; - unsigned int nextcounter; + /* Next value of __COUNTER__ macro. */ + unsigned int counter; }; /* Character classes. Based on the more primitive macros in safe-ctype.h. Modified: head/contrib/gcclibs/libcpp/macro.c ============================================================================== --- head/contrib/gcclibs/libcpp/macro.c Tue Aug 30 19:31:12 2016 (r305082) +++ head/contrib/gcclibs/libcpp/macro.c Tue Aug 30 19:39:33 2016 (r305083) @@ -268,7 +268,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi if (CPP_OPTION (pfile, directives_only) && pfile->state.in_directive) cpp_error (pfile, CPP_DL_ERROR, "__COUNTER__ expanded inside directive with -fdirectives-only"); - number = pfile->nextcounter++; + number = pfile->counter++; break; } Modified: head/contrib/gcclibs/libcpp/pch.c ============================================================================== --- head/contrib/gcclibs/libcpp/pch.c Tue Aug 30 19:31:12 2016 (r305082) +++ head/contrib/gcclibs/libcpp/pch.c Tue Aug 30 19:39:33 2016 (r305083) @@ -337,6 +337,14 @@ cpp_write_pch_deps (cpp_reader *r, FILE /* Free the saved state. */ free (ss); r->savedstate = NULL; + + /* Save the next value of __COUNTER__. */ + if (fwrite (&r->counter, sizeof (r->counter), 1, f) != 1) + { + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); + return -1; + } + return 0; } @@ -361,6 +369,15 @@ cpp_write_pch_state (cpp_reader *r, FILE return -1; } + /* Save the next __COUNTER__ value. When we include a precompiled header, + we need to start at the offset we would have if the header had been + included normally. */ + if (fwrite (&r->counter, sizeof (r->counter), 1, f) != 1) + { + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); + return -1; + } + return 0; } @@ -423,6 +440,7 @@ cpp_valid_state (cpp_reader *r, const ch struct ht_node_list nl = { 0, 0, 0 }; unsigned char *first, *last; unsigned int i; + unsigned int counter; /* Read in the list of identifiers that must be defined Check that they are defined in the same way. */ @@ -524,7 +542,23 @@ cpp_valid_state (cpp_reader *r, const ch } free(nl.defs); + nl.defs = NULL; free (undeftab); + undeftab = NULL; + + /* Read in the next value of __COUNTER__. + Check that (a) __COUNTER__ was not used in the pch or (b) __COUNTER__ + has not been used in this translation unit. */ + if (read (fd, &counter, sizeof (counter)) != sizeof (counter)) + goto error; + if (counter && r->counter) + { + if (CPP_OPTION (r, warn_invalid_pch)) + cpp_error (r, CPP_DL_WARNING_SYSHDR, + "%s: not used because `__COUNTER__' is invalid", + name); + goto fail; + } /* We win! */ return 0; @@ -631,6 +665,7 @@ cpp_read_state (cpp_reader *r, const cha { size_t i; struct lexer_state old_state; + unsigned int counter; /* Restore spec_nodes, which will be full of references to the old hashtable entries and so will now be invalid. */ @@ -690,6 +725,12 @@ cpp_read_state (cpp_reader *r, const cha if (! _cpp_read_file_entries (r, f)) goto error; + if (fread (&counter, sizeof (counter), 1, f) != 1) + goto error; + + if (!r->counter) + r->counter = counter; + return 0; error: From owner-svn-src-head@freebsd.org Tue Aug 30 19:58: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 D94A3BC98B8; Tue, 30 Aug 2016 19:58:42 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D1BDC6A; Tue, 30 Aug 2016 19:58:42 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UJwfHO032552; Tue, 30 Aug 2016 19:58:41 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UJwf1G032550; Tue, 30 Aug 2016 19:58:41 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201608301958.u7UJwf1G032550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 30 Aug 2016 19:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305084 - head/tools/regression/capsicum/syscalls 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.22 Precedence: list List-Id: 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, 30 Aug 2016 19:58:43 -0000 Author: oshogbo Date: Tue Aug 30 19:58:41 2016 New Revision: 305084 URL: https://svnweb.freebsd.org/changeset/base/305084 Log: Fix Capsicum syscalls test suite. Modified: head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Modified: head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c ============================================================================== --- head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c Tue Aug 30 19:39:33 2016 (r305083) +++ head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c Tue Aug 30 19:58:41 2016 (r305084) @@ -157,13 +157,16 @@ static void fcntl_tests_1(int fd) { uint32_t fcntlrights; + cap_rights_t rights; CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0); fcntlrights = 0; CHECK(cap_fcntls_get(fd, &fcntlrights) == 0); CHECK(fcntlrights == CAP_FCNTL_GETFL); - CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_FCNTL) == 0); + CAP_ALL(&rights); + cap_rights_clear(&rights, CAP_FCNTL); + CHECK(cap_rights_limit(fd, &rights) == 0); fcntlrights = CAP_FCNTL_ALL; CHECK(cap_fcntls_get(fd, &fcntlrights) == 0); @@ -206,8 +209,11 @@ static void fcntl_tests_2(int fd) { uint32_t fcntlrights; + cap_rights_t rights; - CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_FCNTL) == 0); + CAP_ALL(&rights); + cap_rights_clear(&rights, CAP_FCNTL); + CHECK(cap_rights_limit(fd, &rights) == 0); fcntlrights = CAP_FCNTL_ALL; CHECK(cap_fcntls_get(fd, &fcntlrights) == 0); Modified: head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c ============================================================================== --- head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Tue Aug 30 19:39:33 2016 (r305083) +++ head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Tue Aug 30 19:58:41 2016 (r305084) @@ -131,6 +131,7 @@ static void ioctl_tests_1(int fd) { unsigned long cmds[2]; + cap_rights_t rights; cmds[0] = FIOCLEX; CHECK(cap_ioctls_limit(fd, cmds, 1) == 0); @@ -139,7 +140,10 @@ ioctl_tests_1(int fd) CHECK(cmds[0] == FIOCLEX); CHECK(cmds[1] == 0); - CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_IOCTL) == 0); + CAP_ALL(&rights); + cap_rights_clear(&rights, CAP_IOCTL); + + CHECK(cap_rights_limit(fd, &rights) == 0); CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0); cmds[0] = FIOCLEX; @@ -173,8 +177,12 @@ static void ioctl_tests_2(int fd) { unsigned long cmds[2]; + cap_rights_t rights; + + CAP_ALL(&rights); + cap_rights_clear(&rights, CAP_IOCTL); - CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_IOCTL) == 0); + CHECK(cap_rights_limit(fd, &rights) == 0); CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0); cmds[0] = FIOCLEX; From owner-svn-src-head@freebsd.org Tue Aug 30 20: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 4B2B4BC71B2; Tue, 30 Aug 2016 20:24:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C0E9CDA; Tue, 30 Aug 2016 20:24:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UKOonH043798; Tue, 30 Aug 2016 20:24:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UKOoTo043797; Tue, 30 Aug 2016 20:24:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608302024.u7UKOoTo043797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 Aug 2016 20:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305085 - head/contrib/tnftp/src 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.22 Precedence: list List-Id: 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, 30 Aug 2016 20:24:51 -0000 Author: dim Date: Tue Aug 30 20:24:50 2016 New Revision: 305085 URL: https://svnweb.freebsd.org/changeset/base/305085 Log: Fix warnings in tnftp about invalid constant conversions, e.g.: contrib/tnftp/src/ftp.c:2067:11: error: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion] buf[0] = IAC; ~ ^~~ /usr/include/arpa/telnet.h:39:13: note: expanded from macro 'IAC' #define IAC 255 /* interpret as command: */ ^~~ contrib/tnftp/src/ftp.c:2068:11: error: implicit conversion from 'int' to 'char' changes value from 244 to -12 [-Werror,-Wconstant-conversion] buf[1] = IP; ~ ^~ /usr/include/arpa/telnet.h:50:12: note: expanded from macro 'IP' #define IP 244 /* interrupt process--permanently */ ^~~ Use an unsigned char buffer instead. MFC after: 1 week Modified: head/contrib/tnftp/src/ftp.c Modified: head/contrib/tnftp/src/ftp.c ============================================================================== --- head/contrib/tnftp/src/ftp.c Tue Aug 30 19:58:41 2016 (r305084) +++ head/contrib/tnftp/src/ftp.c Tue Aug 30 20:24:50 2016 (r305085) @@ -2050,7 +2050,7 @@ abort_squared(int dummy) void abort_remote(FILE *din) { - char buf[BUFSIZ]; + unsigned char buf[BUFSIZ]; int nfnd; if (cout == NULL) { From owner-svn-src-head@freebsd.org Tue Aug 30 20:27: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 22B7FBC7241; Tue, 30 Aug 2016 20:27:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1948EAD; Tue, 30 Aug 2016 20:27:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UKRM56043939; Tue, 30 Aug 2016 20:27:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UKRMIa043938; Tue, 30 Aug 2016 20:27:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608302027.u7UKRMIa043938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 Aug 2016 20:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305086 - head/contrib/telnet/telnet 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.22 Precedence: list List-Id: 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, 30 Aug 2016 20:27:24 -0000 Author: dim Date: Tue Aug 30 20:27:22 2016 New Revision: 305086 URL: https://svnweb.freebsd.org/changeset/base/305086 Log: Fix warnings in telnet about invalid constant conversions, e.g.: contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion from 'int' to 'char' changes value from 137 to -119 [-Werror,-Wconstant-conversion] *lsrp++ = IPOPT_SSRR; ~ ^~~~~~~~~~ /usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR' #define IPOPT_SSRR 137 /* strict source route */ ^~~ contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion from 'int' to 'char' changes value from 131 to -125 [-Werror,-Wconstant-conversion] *lsrp++ = IPOPT_LSRR; ~ ^~~~~~~~~~ /usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR' #define IPOPT_LSRR 131 /* loose source route */ ^~~ Use unsigned char buffers instead. MFC after: 1 week Modified: head/contrib/telnet/telnet/commands.c Modified: head/contrib/telnet/telnet/commands.c ============================================================================== --- head/contrib/telnet/telnet/commands.c Tue Aug 30 20:24:50 2016 (r305085) +++ head/contrib/telnet/telnet/commands.c Tue Aug 30 20:27:22 2016 (r305086) @@ -112,7 +112,7 @@ static int send_tncmd(void (*)(int, int) static int setmod(int); static int clearmode(int); static int modehelp(void); -static int sourceroute(struct addrinfo *, char *, char **, int *, int *, int *); +static int sourceroute(struct addrinfo *, char *, unsigned char **, int *, int *, int *); typedef struct { const char *name; /* command name */ @@ -2171,7 +2171,7 @@ switch_af(struct addrinfo **aip) int tn(int argc, char *argv[]) { - char *srp = 0; + unsigned char *srp = 0; int proto, opt; int srlen; int srcroute = 0, result; @@ -2844,10 +2844,10 @@ cmdrc(char *m1, char *m2) * setsockopt, as socket protocol family. */ static int -sourceroute(struct addrinfo *ai, char *arg, char **cpp, int *lenp, int *protop, int *optp) +sourceroute(struct addrinfo *ai, char *arg, unsigned char **cpp, int *lenp, int *protop, int *optp) { static char buf[1024 + ALIGNBYTES]; /*XXX*/ - char *cp, *cp2, *lsrp, *ep; + unsigned char *cp, *cp2, *lsrp, *ep; struct sockaddr_in *_sin; #ifdef INET6 struct sockaddr_in6 *sin6; From owner-svn-src-head@freebsd.org Tue Aug 30 21:43: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 221A9BC8F8A; Tue, 30 Aug 2016 21:43: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 E6960123; Tue, 30 Aug 2016 21:43:58 +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 u7ULhwYg073706; Tue, 30 Aug 2016 21:43:58 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ULhwSs073705; Tue, 30 Aug 2016 21:43:58 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201608302143.u7ULhwSs073705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 30 Aug 2016 21:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305090 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 21:43:59 -0000 Author: jilles Date: Tue Aug 30 21:43:57 2016 New Revision: 305090 URL: https://svnweb.freebsd.org/changeset/base/305090 Log: getvfsbyname(3): Remove [EFAULT] error. Since r101651 in 2002, getvfsbyname() has written *vfc using userland memcpy(), so the [EFAULT] error no longer occurs. MFC after: 1 week Modified: head/lib/libc/gen/getvfsbyname.3 Modified: head/lib/libc/gen/getvfsbyname.3 ============================================================================== --- head/lib/libc/gen/getvfsbyname.3 Tue Aug 30 21:08:45 2016 (r305089) +++ head/lib/libc/gen/getvfsbyname.3 Tue Aug 30 21:43:57 2016 (r305090) @@ -28,7 +28,7 @@ .\" @(#)kvm_getvfsbyname.3 8.3 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd April 5, 2007 +.Dd August 30, 2016 .Dt GETVFSBYNAME 3 .Os .Sh NAME @@ -97,11 +97,6 @@ sysctl is set to .Sh ERRORS The following errors may be reported: .Bl -tag -width Er -.It Bq Er EFAULT -The -.Fa vfc -argument -points to an invalid address. .It Bq Er ENOENT The .Fa name From owner-svn-src-head@freebsd.org Tue Aug 30 21: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 8B757BC908C; Tue, 30 Aug 2016 21:48:11 +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 5EA2936B; Tue, 30 Aug 2016 21:48:11 +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 u7ULmANJ073959; Tue, 30 Aug 2016 21:48:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ULmAKm073958; Tue, 30 Aug 2016 21:48:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201608302148.u7ULmAKm073958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 30 Aug 2016 21:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305091 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 21:48:11 -0000 Author: mjg Date: Tue Aug 30 21:48:10 2016 New Revision: 305091 URL: https://svnweb.freebsd.org/changeset/base/305091 Log: fd: simplify fd testing in fget_locked by casting to u_int Modified: head/sys/sys/filedesc.h Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Tue Aug 30 21:43:57 2016 (r305090) +++ head/sys/sys/filedesc.h Tue Aug 30 21:48:10 2016 (r305091) @@ -201,7 +201,7 @@ fget_locked(struct filedesc *fdp, int fd FILEDESC_LOCK_ASSERT(fdp); - if (fd < 0 || fd > fdp->fd_lastfile) + if ((u_int)fd > fdp->fd_lastfile) return (NULL); return (fdp->fd_ofiles[fd].fde_file); From owner-svn-src-head@freebsd.org Tue Aug 30 21:51: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 AD491BC9296; Tue, 30 Aug 2016 21:51:54 +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 68C9BA6D; Tue, 30 Aug 2016 21:51:54 +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 u7ULprnX076974; Tue, 30 Aug 2016 21:51:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ULpr4E076973; Tue, 30 Aug 2016 21:51:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608302151.u7ULpr4E076973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 30 Aug 2016 21:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305092 - head/contrib/gcc/config/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.22 Precedence: list List-Id: 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, 30 Aug 2016 21:51:54 -0000 Author: pfg Date: Tue Aug 30 21:51:53 2016 New Revision: 305092 URL: https://svnweb.freebsd.org/changeset/base/305092 Log: MFV r302423: Bring older verbatim version of cpuid.h This file is used regularly in FreeBSD builds but we usually use the similar file provided by clang. By providing the older file introduced in GCC 4.3, we hope to mimic better what is provided by an external toolchain. Obtained from: GCC-4_3-branch (SVN rev. 129548, pre GPLv3) Added: head/contrib/gcc/config/i386/cpuid.h - copied unchanged from r302423, vendor/gcc/dist/gcc/config/i386/cpuid.h Modified: Directory Properties: head/contrib/gcc/ (props changed) Copied: head/contrib/gcc/config/i386/cpuid.h (from r302423, vendor/gcc/dist/gcc/config/i386/cpuid.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/i386/cpuid.h Tue Aug 30 21:51:53 2016 (r305092, copy of r302423, vendor/gcc/dist/gcc/config/i386/cpuid.h) @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * In addition to the permissions in the GNU General Public License, the + * Free Software Foundation gives you unlimited permission to link the + * compiled version of this file with other programs, and to distribute + * those programs without any restriction coming from the use of this + * file. (The General Public License restrictions do apply in other + * respects; for example, they cover modification of the file, and + * distribution when not linked into another program.) + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * As a special exception, if you link this library with files + * compiled with GCC to produce an executable, this does not cause + * the resulting executable to be covered by the GNU General Public License. + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + */ + +/* %ecx */ +#define bit_SSE3 (1 << 0) +#define bit_SSSE3 (1 << 9) +#define bit_CMPXCHG16B (1 << 13) +#define bit_SSE4_1 (1 << 19) +#define bit_SSE4_2 (1 << 20) +#define bit_POPCNT (1 << 23) + +/* %edx */ +#define bit_CMPXCHG8B (1 << 8) +#define bit_CMOV (1 << 15) +#define bit_MMX (1 << 23) +#define bit_FXSAVE (1 << 24) +#define bit_SSE (1 << 25) +#define bit_SSE2 (1 << 26) + +/* Extended Features */ +/* %ecx */ +#define bit_LAHF_LM (1 << 0) +#define bit_SSE4a (1 << 6) +#define bit_SSE5 (1 << 11) + +/* %edx */ +#define bit_LM (1 << 29) +#define bit_3DNOWP (1 << 30) +#define bit_3DNOW (1 << 31) + + +#if defined(__i386__) && defined(__PIC__) +/* %ebx may be the PIC register. */ +#define __cpuid(level, a, b, c, d) \ + __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \ + "cpuid\n\t" \ + "xchg{l}\t{%%}ebx, %1\n\t" \ + : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ + : "0" (level)) +#else +#define __cpuid(level, a, b, c, d) \ + __asm__ ("cpuid\n\t" \ + : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ + : "0" (level)) +#endif + +/* Return highest supported input value for cpuid instruction. ext can + be either 0x0 or 0x8000000 to return highest supported value for + basic or extended cpuid information. Function returns 0 if cpuid + is not supported or whatever cpuid returns in eax register. If sig + pointer is non-null, then first four bytes of the signature + (as found in ebx register) are returned in location pointed by sig. */ + +static __inline unsigned int +__get_cpuid_max (unsigned int __ext, unsigned int *__sig) +{ + unsigned int __eax, __ebx, __ecx, __edx; + +#ifndef __x86_64__ + /* See if we can use cpuid. On AMD64 we always can. */ + __asm__ ("pushf{l|d}\n\t" + "pushf{l|d}\n\t" + "pop{l}\t%0\n\t" + "mov{l}\t{%0, %1|%1, %0}\n\t" + "xor{l}\t{%2, %0|%0, %2}\n\t" + "push{l}\t%0\n\t" + "popf{l|d}\n\t" + "pushf{l|d}\n\t" + "pop{l}\t%0\n\t" + "popf{l|d}\n\t" + : "=&r" (__eax), "=&r" (__ebx) + : "i" (0x00200000)); + + if (!((__eax ^ __ebx) & 0x00200000)) + return 0; +#endif + + /* Host supports cpuid. Return highest supported cpuid input value. */ + __cpuid (__ext, __eax, __ebx, __ecx, __edx); + + if (__sig) + *__sig = __ebx; + + return __eax; +} + +/* Return cpuid data for requested cpuid level, as found in returned + eax, ebx, ecx and edx registers. The function checks if cpuid is + supported and returns 1 for valid cpuid information or 0 for + unsupported cpuid level. All pointers are required to be non-null. */ + +static __inline int +__get_cpuid (unsigned int __level, + unsigned int *__eax, unsigned int *__ebx, + unsigned int *__ecx, unsigned int *__edx) +{ + unsigned int __ext = __level & 0x80000000; + + if (__get_cpuid_max (__ext, 0) < __level) + return 0; + + __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx); + return 1; +} From owner-svn-src-head@freebsd.org Tue Aug 30 21:53: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 B2FA0BC931B; Tue, 30 Aug 2016 21:53:23 +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 67032C91; Tue, 30 Aug 2016 21:53:23 +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 u7ULrMpb077754; Tue, 30 Aug 2016 21:53:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ULrMXf077752; Tue, 30 Aug 2016 21:53:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201608302153.u7ULrMXf077752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 30 Aug 2016 21:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305093 - in head/sys: 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.22 Precedence: list List-Id: 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, 30 Aug 2016 21:53:23 -0000 Author: mjg Date: Tue Aug 30 21:53:22 2016 New Revision: 305093 URL: https://svnweb.freebsd.org/changeset/base/305093 Log: fd: add fdeget_locked and use in kern_descrip Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Aug 30 21:51:53 2016 (r305092) +++ head/sys/kern/kern_descrip.c Tue Aug 30 21:53:22 2016 (r305093) @@ -517,28 +517,26 @@ kern_fcntl(struct thread *td, int fd, in break; case F_GETFD: + error = EBADF; FILEDESC_SLOCK(fdp); - if (fget_locked(fdp, fd) == NULL) { - FILEDESC_SUNLOCK(fdp); - error = EBADF; - break; + fde = fdeget_locked(fdp, fd); + if (fde != NULL) { + td->td_retval[0] = + (fde->fde_flags & UF_EXCLOSE) ? FD_CLOEXEC : 0; + error = 0; } - fde = &fdp->fd_ofiles[fd]; - td->td_retval[0] = - (fde->fde_flags & UF_EXCLOSE) ? FD_CLOEXEC : 0; FILEDESC_SUNLOCK(fdp); break; case F_SETFD: + error = EBADF; FILEDESC_XLOCK(fdp); - if (fget_locked(fdp, fd) == NULL) { - FILEDESC_XUNLOCK(fdp); - error = EBADF; - break; + fde = fdeget_locked(fdp, fd); + if (fde != NULL) { + fde->fde_flags = (fde->fde_flags & ~UF_EXCLOSE) | + (arg & FD_CLOEXEC ? UF_EXCLOSE : 0); + error = 0; } - fde = &fdp->fd_ofiles[fd]; - fde->fde_flags = (fde->fde_flags & ~UF_EXCLOSE) | - (arg & FD_CLOEXEC ? UF_EXCLOSE : 0); FILEDESC_XUNLOCK(fdp); break; Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Tue Aug 30 21:51:53 2016 (r305092) +++ head/sys/sys/filedesc.h Tue Aug 30 21:53:22 2016 (r305093) @@ -207,6 +207,18 @@ fget_locked(struct filedesc *fdp, int fd return (fdp->fd_ofiles[fd].fde_file); } +static __inline struct filedescent * +fdeget_locked(struct filedesc *fdp, int fd) +{ + + FILEDESC_LOCK_ASSERT(fdp); + + if ((u_int)fd > fdp->fd_lastfile) + return (NULL); + + return (&fdp->fd_ofiles[fd]); +} + static __inline bool fd_modified(struct filedesc *fdp, int fd, seq_t seq) { From owner-svn-src-head@freebsd.org Tue Aug 30 22:32: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 77D49BC9C3C; Tue, 30 Aug 2016 22:32:34 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 456FDD2; Tue, 30 Aug 2016 22:32:34 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UMWXsY092999; Tue, 30 Aug 2016 22:32:33 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UMWXjO092998; Tue, 30 Aug 2016 22:32:33 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201608302232.u7UMWXjO092998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 30 Aug 2016 22:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305094 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 22:32:34 -0000 Author: cognet Date: Tue Aug 30 22:32:33 2016 New Revision: 305094 URL: https://svnweb.freebsd.org/changeset/base/305094 Log: Garbage collect bits forgotten in r295267. Modified: head/sys/arm/arm/cpufunc_asm_xscale_c3.S Modified: head/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_xscale_c3.S Tue Aug 30 21:53:22 2016 (r305093) +++ head/sys/arm/arm/cpufunc_asm_xscale_c3.S Tue Aug 30 22:32:33 2016 (r305094) @@ -364,8 +364,6 @@ ENTRY(xscalec3_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR msr cpsr_fsxc, r3 -#else - str r2, [r3] #endif RET END(xscalec3_setttb) From owner-svn-src-head@freebsd.org Tue Aug 30 22:35: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 3B5F8BC9CC0; Tue, 30 Aug 2016 22:35:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com [209.85.214.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 870CF287; Tue, 30 Aug 2016 22:35:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f47.google.com with SMTP id e124so10761917ith.0; Tue, 30 Aug 2016 15:35:46 -0700 (PDT) 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 :from:date:message-id:subject:to:cc; bh=UE5AegV/am59jQRvnevAeyTLvEzEpZzeS2ltPzQLKbM=; b=MyjSc5G4Ouj9Ua21jQlJ2ZpDd7JS/jWEpTRsNCMOg6vxsfLll1lml8i+7IybhUjf7W Cmj0SN5QEssixqLaIWEw883mVn0H9J0YGUImalix6m76ecXKdkYAVu/48nZ2BRIUk+d0 nDt6XnylXqbW6qwK/BrVQAdnNjeCZmuu8J8KK6WOVR6wZxON6/geelsLJqM5S4nUNmzJ 6+g9kj74AcKsGxvNwwDLuAysUwMEEVhmM5HKq3sR1U6YxG7rlBitkPFjXCB+7eMW43hM ZvdtnQIfdoAWy896QCjIw3ZJhirakpWisRUQuaw3dQGJ0t7PUMHjPtdQrEbwPqLhDb4y 1rzA== X-Gm-Message-State: AE9vXwPkKTa0D2dnxby+nRKCGKedZ+EkYR0colarC2cGggy8uRWpcb7cXaZrfOAJN41XXw== X-Received: by 10.36.13.203 with SMTP id 194mr25915863itx.79.1472596540676; Tue, 30 Aug 2016 15:35:40 -0700 (PDT) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com. [209.85.214.54]) by smtp.gmail.com with ESMTPSA id z6sm550180ioz.4.2016.08.30.15.35.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Aug 2016 15:35:40 -0700 (PDT) Received: by mail-it0-f54.google.com with SMTP id e124so10761569ith.0; Tue, 30 Aug 2016 15:35:40 -0700 (PDT) X-Received: by 10.36.3.201 with SMTP id e192mr9330198ite.34.1472596540226; Tue, 30 Aug 2016 15:35:40 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Tue, 30 Aug 2016 15:35:39 -0700 (PDT) In-Reply-To: <201608302148.u7ULmAKm073958@repo.freebsd.org> References: <201608302148.u7ULmAKm073958@repo.freebsd.org> From: Conrad Meyer Date: Tue, 30 Aug 2016 15:35:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r305091 - head/sys/sys To: Mateusz Guzik Cc: src-committers , 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.22 Precedence: list List-Id: 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, 30 Aug 2016 22:35:47 -0000 On Tue, Aug 30, 2016 at 2:48 PM, Mateusz Guzik wrote: > Author: mjg > Date: Tue Aug 30 21:48:10 2016 > New Revision: 305091 > URL: https://svnweb.freebsd.org/changeset/base/305091 > > Log: > fd: simplify fd testing in fget_locked by casting to u_int > > Modified: > head/sys/sys/filedesc.h > > Modified: head/sys/sys/filedesc.h > ============================================================================== > --- head/sys/sys/filedesc.h Tue Aug 30 21:43:57 2016 (r305090) > +++ head/sys/sys/filedesc.h Tue Aug 30 21:48:10 2016 (r305091) > @@ -201,7 +201,7 @@ fget_locked(struct filedesc *fdp, int fd > > FILEDESC_LOCK_ASSERT(fdp); > > - if (fd < 0 || fd > fdp->fd_lastfile) > + if ((u_int)fd > fdp->fd_lastfile) > return (NULL); > > return (fdp->fd_ofiles[fd].fde_file); > I notice that fd_lastfile is an 'int'. Won't this trigger warnings about the differing signedness of the two sides of the comparison? Should fd_lastfile just be u_int as well? (If not (there is some valid negative value), this change may be invalid.) Best, Conrad From owner-svn-src-head@freebsd.org Tue Aug 30 22:41: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 1C9C3BC9D77; Tue, 30 Aug 2016 22:41:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::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 A2C2A76D; Tue, 30 Aug 2016 22:41:09 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id w2so7779090wmd.0; Tue, 30 Aug 2016 15:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=k2Bd2kXvsnp60X/+s3ZMMyXw87++5yZ/DDeMr53cTds=; b=VZ9zoYndBQ/grbPySmMVhUC1Dyn5KZ2Z6+73g0MHFtfuDGWvbqxEm+Ql30b0E/hs7M 0pFwQL+VuHSPHthVoGleGkFAHbpGHTy1VB0MMVlS66cjrz0c1dc3q0c2aHXgKWM3OigI LDqTVEq6f6ti7NnA5Nwk4SWqGxCTZazHzWLNuKP5YqbTd3TyErGCDAPOV1lcC62E6itB t7yU5wDDU6msQ/oH5zhfgxBrIeaLUauAjWXECv4QV7skJFgd0nydL9hFdRyCKjdYtZWQ HgeFfbSqqfRelG2Dk2lPjLQwqKgwhJY1+LGBxp71YxR7ttFZ9SAZlVNZwqZZHRsp5XgS J6Qg== 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-disposition:in-reply-to:user-agent; bh=k2Bd2kXvsnp60X/+s3ZMMyXw87++5yZ/DDeMr53cTds=; b=ACH5kGOaIVtNCuxvZ3fmLwNlD5zc0H9BBNeM/pRF6yiPywqWWLc4xjPyLe3+7Y+7vT ViZWLMZVNxgp+NJZTukzLgUQzfcFOcXwBYtmlLHH0n1KzwSuW2wZ5WYbIGEXPOGsF6f3 NRop7mid0v6E4hmpqdDbZKFoKOcle7hCaCxjCsf5BBdjPfpRg73j1xnbIAtWmDBkr16E CGjoy0u8hptrYI/HaagOIWCjl1VRikhxHzWWWKFTV1z0YEtWU7uEGsJS/3TmARMrDsIJ +jQLPbMCxf2TniGafzA5TF4Wg33oK642i87HrEWrDddMBrBLpNGsD79BJ3TxB4lAawkc mqDA== X-Gm-Message-State: AE9vXwPv31GHJDlHbt7w+TFoaWTEamBqdrVMSAG76WiqtHQm9bkrcXO/wxy35d+Mr6Q0fA== X-Received: by 10.28.182.136 with SMTP id g130mr6292867wmf.21.1472596867914; Tue, 30 Aug 2016 15:41:07 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id bw9sm41565468wjc.33.2016.08.30.15.41.06 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 30 Aug 2016 15:41:07 -0700 (PDT) Date: Wed, 31 Aug 2016 00:41:05 +0200 From: Mateusz Guzik To: Conrad Meyer Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305091 - head/sys/sys Message-ID: <20160830224104.GA16151@dft-labs.eu> References: <201608302148.u7ULmAKm073958@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 30 Aug 2016 22:41:10 -0000 On Tue, Aug 30, 2016 at 03:35:39PM -0700, Conrad Meyer wrote: > On Tue, Aug 30, 2016 at 2:48 PM, Mateusz Guzik wrote: > > Author: mjg > > Date: Tue Aug 30 21:48:10 2016 > > New Revision: 305091 > > URL: https://svnweb.freebsd.org/changeset/base/305091 > > > > Log: > > fd: simplify fd testing in fget_locked by casting to u_int > > > > Modified: > > head/sys/sys/filedesc.h > > > > Modified: head/sys/sys/filedesc.h > > ============================================================================== > > --- head/sys/sys/filedesc.h Tue Aug 30 21:43:57 2016 (r305090) > > +++ head/sys/sys/filedesc.h Tue Aug 30 21:48:10 2016 (r305091) > > @@ -201,7 +201,7 @@ fget_locked(struct filedesc *fdp, int fd > > > > FILEDESC_LOCK_ASSERT(fdp); > > > > - if (fd < 0 || fd > fdp->fd_lastfile) > > + if ((u_int)fd > fdp->fd_lastfile) > > return (NULL); > > > > return (fdp->fd_ofiles[fd].fde_file); > > > > > I notice that fd_lastfile is an 'int'. Won't this trigger warnings > about the differing signedness of the two sides of the comparison? > Should fd_lastfile just be u_int as well? (If not (there is some > valid negative value), this change may be invalid.) > It is -1 just after inception and is supposed to grow immediately after. That is, the table with -1 should never be accessible. But now that you mention it I agree this is bad style. This unnecessarily differs from the check in fget_unlocked so I'll just unify it. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Aug 30 22:48: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 D38C8BC9039; Tue, 30 Aug 2016 22:48: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 A664DBE6; Tue, 30 Aug 2016 22:48: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 u7UMm5bn096899; Tue, 30 Aug 2016 22:48:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UMm5nP096898; Tue, 30 Aug 2016 22:48:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608302248.u7UMm5nP096898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 30 Aug 2016 22:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305095 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 22:48:06 -0000 Author: bdrewery Date: Tue Aug 30 22:48:05 2016 New Revision: 305095 URL: https://svnweb.freebsd.org/changeset/base/305095 Log: AUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR. This is to be used by the new clang3.9 build and extends functionality added to 'make obj' in r279980. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Tue Aug 30 22:32:33 2016 (r305094) +++ head/share/mk/bsd.obj.mk Tue Aug 30 22:48:05 2016 (r305095) @@ -51,6 +51,30 @@ CANONICALOBJDIR= ${.OBJDIR} # but this makefile does not want it! .OBJDIR: ${.CURDIR} .endif +# Handle special case where SRCS is full-pathed and requires +# nested objdirs. This duplicates some auto.obj.mk logic. +.if (!empty(SRCS:M*/*) || !empty(DPSRCS:M*/*)) && \ + (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") +_wantdirs= ${SRCS:M*/*:H} ${DPSRCS:M*/*:H} +.if !empty(_wantdirs) +_wantdirs:= ${_wantdirs:O:u} +_needdirs= +.for _dir in ${_wantdirs} +.if !exists(${.OBJDIR}/${_dir}/) +_needdirs+= ${_dir} +.endif +.endfor +.endif +.if !empty(_needdirs) +#_mkneededdirs!= umask ${OBJDIR_UMASK:U002}; ${Mkdirs} ${_needdirs} +__objdir_made != umask ${OBJDIR_UMASK:U002}; ${Mkdirs}; \ + for dir in ${_needdirs}; do \ + dir=${.OBJDIR}/$${dir}; \ + ${ECHO_TRACE} "[Creating nested objdir $${dir}...]" >&2; \ + Mkdirs $${dir}; \ + done +.endif +.endif # !empty(SRCS:M*/*) || !empty(DPSRCS:M*/*) .elif defined(MAKEOBJDIRPREFIX) CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} .elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" From owner-svn-src-head@freebsd.org Tue Aug 30 23:30: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 093D9BC9AB0; Tue, 30 Aug 2016 23:30:28 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CAF31D1; Tue, 30 Aug 2016 23:30:27 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UNUQ99011919; Tue, 30 Aug 2016 23:30:26 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UNUQHL011918; Tue, 30 Aug 2016 23:30:26 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201608302330.u7UNUQHL011918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 30 Aug 2016 23:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305096 - 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.22 Precedence: list List-Id: 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, 30 Aug 2016 23:30:28 -0000 Author: cognet Date: Tue Aug 30 23:30:26 2016 New Revision: 305096 URL: https://svnweb.freebsd.org/changeset/base/305096 Log: Some old arm ports don't load the kernel at the beginning of the memory, because the bootloader, ie redboot, won't let them do so, and so used the memory before the kernel for early memory allocation, such as pagetables, stacks, etc... Make a bit of an effort to try to get that memory mapped. Modified: head/sys/arm/arm/locore-v4.S Modified: head/sys/arm/arm/locore-v4.S ============================================================================== --- head/sys/arm/arm/locore-v4.S Tue Aug 30 22:48:05 2016 (r305095) +++ head/sys/arm/arm/locore-v4.S Tue Aug 30 23:30:26 2016 (r305096) @@ -195,6 +195,16 @@ Lunmapped: ldr r2, =(KERNVIRTADDR) mov r3, #64 bl build_pagetables +#if defined(PHYSADDR) && (KERNVIRTADDR != KERNBASE) +/* + * If the kernel wasn't loaded at the beginning of the ram, map the memory + * before the kernel too, as some ports use that for pagetables, stack, etc... + */ + ldr r1, =PHYSADDR + ldr r2, =KERNBASE + ldr r3, =((KERNVIRTADDR - KERNBASE) / L1_S_SIZE) + bl build_pagetables +#endif /* Create a device mapping for early_printf if specified. */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) From owner-svn-src-head@freebsd.org Tue Aug 30 23:32: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 8B801BC9C09; Tue, 30 Aug 2016 23:32:40 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 46CCB6B9; Tue, 30 Aug 2016 23:32:40 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7UNWdFU015305; Tue, 30 Aug 2016 23:32:39 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7UNWdwH015301; Tue, 30 Aug 2016 23:32:39 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201608302332.u7UNWdwH015301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 30 Aug 2016 23:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305097 - head/sys/arm/xscale/i8134x 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.22 Precedence: list List-Id: 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, 30 Aug 2016 23:32:40 -0000 Author: cognet Date: Tue Aug 30 23:32:38 2016 New Revision: 305097 URL: https://svnweb.freebsd.org/changeset/base/305097 Log: Nuke obio_bs_tag, it was used before it was initialized, and arm_base_bs_tag is the same, anyway. Modified: head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/i8134x/obio.c head/sys/arm/xscale/i8134x/obiovar.h head/sys/arm/xscale/i8134x/uart_cpu_i81342.c Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Tue Aug 30 23:30:26 2016 (r305096) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Tue Aug 30 23:32:38 2016 (r305097) @@ -286,7 +286,7 @@ initarm(struct arm_boot_params *abp) cpu_setup(); i80321_calibrate_delay(); - i81342_sdram_bounds(obio_bs_tag, IOP34X_VADDR, &memstart, &memsize); + i81342_sdram_bounds(arm_base_bs_tag, IOP34X_VADDR, &memstart, &memsize); physmem = memsize / PAGE_SIZE; cninit(); /* Set stack for exception handlers */ Modified: head/sys/arm/xscale/i8134x/obio.c ============================================================================== --- head/sys/arm/xscale/i8134x/obio.c Tue Aug 30 23:30:26 2016 (r305096) +++ head/sys/arm/xscale/i8134x/obio.c Tue Aug 30 23:32:38 2016 (r305097) @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -bus_space_tag_t obio_bs_tag; - static int obio_probe(device_t dev) { @@ -69,8 +67,7 @@ obio_attach(device_t dev) { struct obio_softc *sc = device_get_softc(dev); - obio_bs_tag = arm_base_bs_tag; - sc->oba_st = obio_bs_tag; + sc->oba_st = arm_base_bs_tag; sc->oba_rman.rm_type = RMAN_ARRAY; sc->oba_rman.rm_descr = "OBIO I/O"; if (rman_init(&sc->oba_rman) != 0 || Modified: head/sys/arm/xscale/i8134x/obiovar.h ============================================================================== --- head/sys/arm/xscale/i8134x/obiovar.h Tue Aug 30 23:30:26 2016 (r305096) +++ head/sys/arm/xscale/i8134x/obiovar.h Tue Aug 30 23:32:38 2016 (r305097) @@ -50,6 +50,5 @@ struct obio_softc { struct rman oba_irq_rman; }; -extern bus_space_tag_t obio_bs_tag; #endif /* _IQ80321_OBIOVAR_H_ */ Modified: head/sys/arm/xscale/i8134x/uart_cpu_i81342.c ============================================================================== --- head/sys/arm/xscale/i8134x/uart_cpu_i81342.c Tue Aug 30 23:30:26 2016 (r305096) +++ head/sys/arm/xscale/i8134x/uart_cpu_i81342.c Tue Aug 30 23:32:38 2016 (r305097) @@ -54,14 +54,14 @@ uart_cpu_getdev(int devtype, struct uart di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = obio_bs_tag; + di->bas.bst = arm_base_bs_tag; di->bas.regshft = 2; di->bas.rclk = 33334000; di->baudrate = 115200; di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - uart_bus_space_io = obio_bs_tag; + uart_bus_space_io = arm_base_bs_tag; uart_bus_space_mem = NULL; di->bas.bsh = IOP34X_UART0_VADDR; return (0); From owner-svn-src-head@freebsd.org Wed Aug 31 00:04: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 31620BC9781; Wed, 31 Aug 2016 00:04:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 019AD2A52; Wed, 31 Aug 2016 00:04:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V04A6O027818; Wed, 31 Aug 2016 00:04:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V04A1o027817; Wed, 31 Aug 2016 00:04:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608310004.u7V04A1o027817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 31 Aug 2016 00:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305098 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 00:04:11 -0000 Author: bapt Date: Wed Aug 31 00:04:09 2016 New Revision: 305098 URL: https://svnweb.freebsd.org/changeset/base/305098 Log: Make libc++.so ldscript sysroot friendly Modified: head/lib/libc++/libc++.ldscript Modified: head/lib/libc++/libc++.ldscript ============================================================================== --- head/lib/libc++/libc++.ldscript Tue Aug 30 23:32:38 2016 (r305097) +++ head/lib/libc++/libc++.ldscript Wed Aug 31 00:04:09 2016 (r305098) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -GROUP ( @@SHLIB@@ @@LIBDIR@@/libcxxrt.so ) +GROUP ( =@@SHLIB@@ =@@LIBDIR@@/libcxxrt.so ) From owner-svn-src-head@freebsd.org Wed Aug 31 00:11: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 F13B0BC99DE; Wed, 31 Aug 2016 00:11:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BF010120; Wed, 31 Aug 2016 00:11:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V0BZNF029943; Wed, 31 Aug 2016 00:11:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V0BZJj029942; Wed, 31 Aug 2016 00:11:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608310011.u7V0BZJj029942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 31 Aug 2016 00:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305102 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 00:11:37 -0000 Author: bapt Date: Wed Aug 31 00:11:35 2016 New Revision: 305102 URL: https://svnweb.freebsd.org/changeset/base/305102 Log: Revert 305098 Was a wrong assumption from me badly look at the errors cross toolchain was telling me Modified: head/lib/libc++/libc++.ldscript Modified: head/lib/libc++/libc++.ldscript ============================================================================== --- head/lib/libc++/libc++.ldscript Wed Aug 31 00:10:40 2016 (r305101) +++ head/lib/libc++/libc++.ldscript Wed Aug 31 00:11:35 2016 (r305102) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -GROUP ( =@@SHLIB@@ =@@LIBDIR@@/libcxxrt.so ) +GROUP ( @@SHLIB@@ @@LIBDIR@@/libcxxrt.so ) From owner-svn-src-head@freebsd.org Wed Aug 31 01:04: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 EBBC8BBC9F0; Wed, 31 Aug 2016 01:04:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x231.google.com (mail-qt0-x231.google.com [IPv6:2607:f8b0:400d:c0d::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A93CF53; Wed, 31 Aug 2016 01:04:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x231.google.com with SMTP id 93so18273229qtg.2; Tue, 30 Aug 2016 18:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4PzVANZ8fnL1+BIhm9+tueiAw09jnGGNg64YhS711WI=; b=QqDbp6SqJWCTYZODtOgoOy2iXIQBvg0w5/uqo34zn5ypR62bkqJTKWR0pKXPdnNvus MU/ZKlkz08lfh/qOX0KAHKYITZ7UdBwsYQ4CngLHGreDXB+PkSgMqvyz2Cla3vsiFRoF 2J95sDkAtb/ZTdgPEmOYwUvKXKDFKC38rKKm6j4wRAeNaGVeik0+N5c/H+r9B5ZgiJ5R cWPLXksq+0JLm0LKqo8ySu3OKBYZrcppQA0M7tTP43CshMG+F8EppQzDAmr1niqUY+HR ubULccsQYE+lfPX4Iae/LgF8yn2ckKbjEBWx7u9iOa1DdYN+QUZC/A6xqASIl0iPg17v QiPg== 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; bh=4PzVANZ8fnL1+BIhm9+tueiAw09jnGGNg64YhS711WI=; b=WVNPmypoZefOykIslZn9LZN1oCuty9fckOxN+mS8lscOHoaUBUH1UQ2dhID7b65oPD fopiJzan8BLK/lJia6+QFq5M74Yok7YKOPlg4uLBVjqSHMeeAh992abpepguFHoiNew7 SeJbvqHvnFcFOd7j+Uu5miF5CqA3EO3mc7qYt6CmgvWa1GQ+b45cIiOsGVuLh6hpwXuB BMY6s0pN0NMGhmVgx/At/rPLpRCrCLrOY80drqYMt6KFjq6Et6Ti2UJ9AHmykmK5D0pC ReFBR5yMsOy069oX/1s8yTa49HuH6yJF+VbYuvBRhBOCWOTyC1KNaTVK1aS+1kHRFxo1 J4WA== X-Gm-Message-State: AE9vXwNzAMYll4H8zqUsgvlH4Oh8Uuz06CK1eQF8vjUE2n5us4cdHQFAiftVzqQIF6QfjNStxaDFbu3olhrjkQ== X-Received: by 10.200.53.214 with SMTP id l22mr7897407qtb.117.1472605490704; Tue, 30 Aug 2016 18:04:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.182.134 with HTTP; Tue, 30 Aug 2016 18:04:50 -0700 (PDT) In-Reply-To: <201608301958.u7UJwf1G032550@repo.freebsd.org> References: <201608301958.u7UJwf1G032550@repo.freebsd.org> From: Ngie Cooper Date: Tue, 30 Aug 2016 18:04:50 -0700 Message-ID: Subject: Re: svn commit: r305084 - head/tools/regression/capsicum/syscalls To: Mariusz Zaborski 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.22 Precedence: list List-Id: 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, 31 Aug 2016 01:04:52 -0000 On Tue, Aug 30, 2016 at 12:58 PM, Mariusz Zaborski wrote: > Author: oshogbo > Date: Tue Aug 30 19:58:41 2016 > New Revision: 305084 > URL: https://svnweb.freebsd.org/changeset/base/305084 > > Log: > Fix Capsicum syscalls test suite. Do you plan on MFCing the change? Thanks, -Ngie From owner-svn-src-head@freebsd.org Wed Aug 31 01:04: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 EB209BBCA16; Wed, 31 Aug 2016 01:04:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B933562; Wed, 31 Aug 2016 01:04:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V14v2S051328; Wed, 31 Aug 2016 01:04:57 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V14vot051326; Wed, 31 Aug 2016 01:04:57 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201608310104.u7V14vot051326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 31 Aug 2016 01:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305104 - head/sys/contrib/vchiq/interface/vchiq_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.22 Precedence: list List-Id: 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, 31 Aug 2016 01:04:59 -0000 Author: gonzo Date: Wed Aug 31 01:04:57 2016 New Revision: 305104 URL: https://svnweb.freebsd.org/changeset/base/305104 Log: Update VCHIQ driver to upstream version 4eda74f2 PR: 211525 Submitted by: Sylvain Garrigues Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Wed Aug 31 00:11:38 2016 (r305103) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Wed Aug 31 01:04:57 2016 (r305104) @@ -46,10 +46,10 @@ #define VCHIQ_MINOR 0 /* Some per-instance constants */ -#define MAX_COMPLETIONS 16 +#define MAX_COMPLETIONS 128 #define MAX_SERVICES 64 #define MAX_ELEMENTS 8 -#define MSG_QUEUE_SIZE 64 +#define MSG_QUEUE_SIZE 128 #define KEEPALIVE_VER 1 #define KEEPALIVE_VER_MIN KEEPALIVE_VER @@ -208,30 +208,32 @@ add_completion(VCHIQ_INSTANCE_T instance void *bulk_userdata) { VCHIQ_COMPLETION_DATA_T *completion; + int insert; DEBUG_INITIALISE(g_state.local) - while (instance->completion_insert == - (instance->completion_remove + MAX_COMPLETIONS)) { + insert = instance->completion_insert; + while ((insert - instance->completion_remove) >= MAX_COMPLETIONS) { /* Out of space - wait for the client */ DEBUG_TRACE(SERVICE_CALLBACK_LINE); vchiq_log_trace(vchiq_arm_log_level, "add_completion - completion queue full"); DEBUG_COUNT(COMPLETION_QUEUE_FULL_COUNT); + if (down_interruptible(&instance->remove_event) != 0) { vchiq_log_info(vchiq_arm_log_level, "service_callback interrupted"); return VCHIQ_RETRY; - } else if (instance->closing) { + } + + if (instance->closing) { vchiq_log_info(vchiq_arm_log_level, "service_callback closing"); - return VCHIQ_ERROR; + return VCHIQ_SUCCESS; } DEBUG_TRACE(SERVICE_CALLBACK_LINE); } - completion = - &instance->completions[instance->completion_insert & - (MAX_COMPLETIONS - 1)]; + completion = &instance->completions[insert & (MAX_COMPLETIONS - 1)]; completion->header = header; completion->reason = reason; @@ -252,9 +254,9 @@ add_completion(VCHIQ_INSTANCE_T instance wmb(); if (reason == VCHIQ_MESSAGE_AVAILABLE) - user_service->message_available_pos = - instance->completion_insert; - instance->completion_insert++; + user_service->message_available_pos = insert; + + instance->completion_insert = ++insert; up(&instance->insert_event); @@ -279,6 +281,7 @@ service_callback(VCHIQ_REASON_T reason, USER_SERVICE_T *user_service; VCHIQ_SERVICE_T *service; VCHIQ_INSTANCE_T instance; + int skip_completion = 0; DEBUG_INITIALISE(g_state.local) DEBUG_TRACE(SERVICE_CALLBACK_LINE); @@ -345,9 +348,6 @@ service_callback(VCHIQ_REASON_T reason, user_service->msg_queue[user_service->msg_insert & (MSG_QUEUE_SIZE - 1)] = header; user_service->msg_insert++; - spin_unlock(&msg_queue_spinlock); - - up(&user_service->insert_event); /* If there is a thread waiting in DEQUEUE_MESSAGE, or if ** there is a MESSAGE_AVAILABLE in the completion queue then @@ -356,13 +356,22 @@ service_callback(VCHIQ_REASON_T reason, if (((user_service->message_available_pos - instance->completion_remove) >= 0) || user_service->dequeue_pending) { - DEBUG_TRACE(SERVICE_CALLBACK_LINE); user_service->dequeue_pending = 0; - return VCHIQ_SUCCESS; + skip_completion = 1; } + spin_unlock(&msg_queue_spinlock); + + up(&user_service->insert_event); + header = NULL; } + + if (skip_completion) { + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + return VCHIQ_SUCCESS; + } + DEBUG_TRACE(SERVICE_CALLBACK_LINE); return add_completion(instance, reason, header, user_service, @@ -789,7 +798,7 @@ vchiq_ioctl(struct cdev *cdev, u_long cm break; } - memcpy(&args, (const void*)arg, sizeof(args)); + memcpy(&args, (const void*)arg, sizeof(args)); lmutex_lock(&instance->completion_mutex); @@ -797,6 +806,7 @@ vchiq_ioctl(struct cdev *cdev, u_long cm while ((instance->completion_remove == instance->completion_insert) && !instance->closing) { + DEBUG_TRACE(AWAIT_COMPLETION_LINE); lmutex_unlock(&instance->completion_mutex); rc = down_interruptible(&instance->insert_event); @@ -811,24 +821,29 @@ vchiq_ioctl(struct cdev *cdev, u_long cm } DEBUG_TRACE(AWAIT_COMPLETION_LINE); - /* A read memory barrier is needed to stop prefetch of a stale - ** completion record - */ - rmb(); - if (ret == 0) { int msgbufcount = args.msgbufcount; + int remove; + + remove = instance->completion_remove; + for (count = 0; count < args.count; count++) { VCHIQ_COMPLETION_DATA_T *completion; VCHIQ_SERVICE_T *service1; USER_SERVICE_T *user_service; VCHIQ_HEADER_T *header; - if (instance->completion_remove == - instance->completion_insert) + + if (remove == instance->completion_insert) break; + completion = &instance->completions[ - instance->completion_remove & - (MAX_COMPLETIONS - 1)]; + remove & (MAX_COMPLETIONS - 1)]; + + + /* A read memory barrier is needed to prevent + ** the prefetch of a stale completion record + */ + rmb(); service1 = completion->service_userdata; user_service = service1->base.userdata; @@ -905,7 +920,11 @@ vchiq_ioctl(struct cdev *cdev, u_long cm break; } - instance->completion_remove++; + /* Ensure that the above copy has completed + ** before advancing the remove pointer. */ + mb(); + + instance->completion_remove = ++remove; } if (msgbufcount != args.msgbufcount) { Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Wed Aug 31 00:11:38 2016 (r305103) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Wed Aug 31 01:04:57 2016 (r305104) @@ -622,15 +622,15 @@ process_free_queue(VCHIQ_STATE_T *state) BITSET_T service_found[BITSET_SIZE(VCHIQ_MAX_SERVICES)]; int slot_queue_available; - /* Use a read memory barrier to ensure that any state that may have - ** been modified by another thread is not masked by stale prefetched - ** values. */ - rmb(); - /* Find slots which have been freed by the other side, and return them ** to the available queue. */ slot_queue_available = state->slot_queue_available; + /* Use a memory barrier to ensure that any state that may have been + ** modified by another thread is not masked by stale prefetched + ** values. */ + mb(); + while (slot_queue_available != local->slot_queue_recycle) { unsigned int pos; int slot_index = local->slot_queue[slot_queue_available++ & @@ -638,6 +638,8 @@ process_free_queue(VCHIQ_STATE_T *state) char *data = (char *)SLOT_DATA_FROM_INDEX(state, slot_index); int data_found = 0; + rmb(); + vchiq_log_trace(vchiq_core_log_level, "%d: pfq %d=%x %x %x", state->id, slot_index, (unsigned int)data, local->slot_queue_recycle, slot_queue_available); @@ -753,6 +755,8 @@ process_free_queue(VCHIQ_STATE_T *state) up(&state->data_quota_event); } + mb(); + state->slot_queue_available = slot_queue_available; up(&state->slot_available_event); } @@ -904,16 +908,14 @@ queue_message(VCHIQ_STATE_T *state, VCHI error_count); return VCHIQ_ERROR; } - if (i == 0) { - if (SRVTRACE_ENABLED(service, - VCHIQ_LOG_INFO)) - vchiq_log_dump_mem("Sent", 0, - header->data + pos, - min(64u, - elements[0].size)); - } } + if (SRVTRACE_ENABLED(service, + VCHIQ_LOG_INFO)) + vchiq_log_dump_mem("Sent", 0, + header->data, + min(16, pos)); + spin_lock("a_spinlock); service_quota->message_use_count++; @@ -1052,16 +1054,13 @@ queue_message_sync(VCHIQ_STATE_T *state, error_count); return VCHIQ_ERROR; } - if (i == 0) { - if (vchiq_sync_log_level >= - VCHIQ_LOG_TRACE) - vchiq_log_dump_mem("Sent Sync", - 0, header->data + pos, - min(64u, - elements[0].size)); - } } + if (vchiq_sync_log_level >= VCHIQ_LOG_TRACE) + vchiq_log_dump_mem("Sent Sync", + 0, header->data, + min(16, pos)); + VCHIQ_SERVICE_STATS_INC(service, ctrl_tx_count); VCHIQ_SERVICE_STATS_ADD(service, ctrl_tx_bytes, size); } else { @@ -1732,7 +1731,7 @@ parse_rx_slots(VCHIQ_STATE_T *state) remoteport, localport, size); if (size > 0) vchiq_log_dump_mem("Rcvd", 0, header->data, - min(64, size)); + min(16, size)); } if (((unsigned int)header & VCHIQ_SLOT_MASK) + calc_stride(size) @@ -2202,7 +2201,7 @@ sync_func(void *v) remoteport, localport, size); if (size > 0) vchiq_log_dump_mem("Rcvd", 0, header->data, - min(64, size)); + min(16, size)); } switch (type) { From owner-svn-src-head@freebsd.org Wed Aug 31 03:55: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 5AF7BBC77CD; Wed, 31 Aug 2016 03:55:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15823BDB; Wed, 31 Aug 2016 03:55:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V3toLu018158; Wed, 31 Aug 2016 03:55:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V3tof3018157; Wed, 31 Aug 2016 03:55:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201608310355.u7V3tof3018157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 31 Aug 2016 03:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305107 - head/sys/boot/forth 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.22 Precedence: list List-Id: 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, 31 Aug 2016 03:55:51 -0000 Author: imp Date: Wed Aug 31 03:55:50 2016 New Revision: 305107 URL: https://svnweb.freebsd.org/changeset/base/305107 Log: Create a hook 'post-initialize' for people that want to define something (perhaps in loader.rc.local) that can read in .conf files after all the other .conf files have been read and override settings in them. This is quite handy if the .conf file name is determined while the loader is running, but might be generically useful for other things. If this hook exists, call it, otherwise don't do anything. Doing it in these functions ensures that this file is reliably read. It also works around a defect in forth where s" isn't allowed outside a function (well, in a compile context) leading to gross workarounds if one were to hack loader.rc like: : maybe-some-func s" some-func" sfind if execute else drop then ; maybe-some-func which somehow seems worse. Though I'm sure there's some clever forthy way of doing that with a macro. Sponsored by: Netflix, Inc Modified: head/sys/boot/forth/loader.4th Modified: head/sys/boot/forth/loader.4th ============================================================================== --- head/sys/boot/forth/loader.4th Wed Aug 31 01:27:30 2016 (r305106) +++ head/sys/boot/forth/loader.4th Wed Aug 31 03:55:50 2016 (r305107) @@ -143,6 +143,8 @@ only forth definitions also support-func s" /boot/defaults/loader.conf" initialize include_conf_files include_nextboot_file + \ If the user defined a post-initialize hook, call it now + s" post-initialize" sfind if execute else drop then \ Will *NOT* try to load kernel and modules if no configuration file \ was successfully loaded! any_conf_read? if @@ -165,12 +167,15 @@ only forth definitions also support-func \ \ Overrides support.4th initialization word with one that does \ everything start one does, short of loading the kernel and -\ modules. Returns a flag +\ modules. Returns a flag. Unsure why we don't just have start +\ call this... : initialize ( -- flag ) s" /boot/defaults/loader.conf" initialize include_conf_files include_nextboot_file + \ If the user defined a post-initialize hook, call it now + s" post-initialize" sfind if execute else drop then any_conf_read? ; From owner-svn-src-head@freebsd.org Wed Aug 31 04:02: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 2B66FBC7A9C; Wed, 31 Aug 2016 04:02:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D6F4F1E9; Wed, 31 Aug 2016 04:02:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V42rc4021816; Wed, 31 Aug 2016 04:02:53 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V42q5M021814; Wed, 31 Aug 2016 04:02:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201608310402.u7V42q5M021814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 31 Aug 2016 04:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305108 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 04:02:54 -0000 Author: nwhitehorn Date: Wed Aug 31 04:02:52 2016 New Revision: 305108 URL: https://svnweb.freebsd.org/changeset/base/305108 Log: Refix operation on sparse CPU mappings as in r302372, temporarily broken by r304716. PR: kern/210106 MFC after: 2 days Modified: head/sys/kern/imgact_elf.c head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed Aug 31 03:55:50 2016 (r305107) +++ head/sys/kern/imgact_elf.c Wed Aug 31 04:02:52 2016 (r305108) @@ -1105,6 +1105,9 @@ __elfN(freebsd_fixup)(register_t **stack AUXARGS_ENTRY(pos, AT_TIMEKEEP, imgp->sysent->sv_timekeep_base); } +#ifdef AT_HWCAP + AUXARGS_ENTRY(pos, AT_HWCAP, cpu_features); +#endif AUXARGS_ENTRY(pos, AT_STACKPROT, imgp->sysent->sv_shared_page_obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : imgp->sysent->sv_stackprot); Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Wed Aug 31 03:55:50 2016 (r305107) +++ head/sys/kern/subr_gtaskqueue.c Wed Aug 31 04:02:52 2016 (r305108) @@ -742,7 +742,7 @@ _taskqgroup_adjust(struct taskqgroup *qg LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL); cpuset_t mask; struct grouptask *gtask; - int i, old_cnt, qid; + int i, k, old_cnt, qid, cpu; mtx_assert(&qgroup->tqg_lock, MA_OWNED); @@ -806,8 +806,11 @@ _taskqgroup_adjust(struct taskqgroup *qg /* * Set new CPU and IRQ affinity */ + cpu = CPU_FIRST(); for (i = 0; i < cnt; i++) { - qgroup->tqg_queue[i].tgc_cpu = i * qgroup->tqg_stride; + qgroup->tqg_queue[i].tgc_cpu = cpu; + for (k = 0; k < qgroup->tqg_stride; k++) + cpu = CPU_NEXT(cpu); CPU_ZERO(&mask); CPU_SET(qgroup->tqg_queue[i].tgc_cpu, &mask); LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list) { From owner-svn-src-head@freebsd.org Wed Aug 31 04:03: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 754B2BC7B0A; Wed, 31 Aug 2016 04:03:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4455D39C; Wed, 31 Aug 2016 04:03:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V43tJu021916; Wed, 31 Aug 2016 04:03:55 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V43tcY021915; Wed, 31 Aug 2016 04:03:55 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201608310403.u7V43tcY021915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 31 Aug 2016 04:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305109 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 04:03:56 -0000 Author: nwhitehorn Date: Wed Aug 31 04:03:55 2016 New Revision: 305109 URL: https://svnweb.freebsd.org/changeset/base/305109 Log: Back out misfired extra file in r305108. Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed Aug 31 04:02:52 2016 (r305108) +++ head/sys/kern/imgact_elf.c Wed Aug 31 04:03:55 2016 (r305109) @@ -1105,9 +1105,6 @@ __elfN(freebsd_fixup)(register_t **stack AUXARGS_ENTRY(pos, AT_TIMEKEEP, imgp->sysent->sv_timekeep_base); } -#ifdef AT_HWCAP - AUXARGS_ENTRY(pos, AT_HWCAP, cpu_features); -#endif AUXARGS_ENTRY(pos, AT_STACKPROT, imgp->sysent->sv_shared_page_obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : imgp->sysent->sv_stackprot); From owner-svn-src-head@freebsd.org Wed Aug 31 05:27: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 0C59CBC98C5; Wed, 31 Aug 2016 05:27: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 CDD3FE63; Wed, 31 Aug 2016 05:27:31 +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 u7V5RVNA051911; Wed, 31 Aug 2016 05:27:31 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V5RU38051908; Wed, 31 Aug 2016 05:27:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608310527.u7V5RU38051908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 31 Aug 2016 05:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305110 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 05:27:32 -0000 Author: sephe Date: Wed Aug 31 05:27:30 2016 New Revision: 305110 URL: https://svnweb.freebsd.org/changeset/base/305110 Log: hyperv/hn: Consolidate NVS transaction execution. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7704 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 31 04:03:55 2016 (r305109) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 31 05:27:30 2016 (r305110) @@ -107,21 +107,45 @@ hn_chim_alloc(struct hn_softc *sc) const void * hn_nvs_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, - void *req, int reqlen, size_t *resp_len) + void *req, int reqlen, size_t *resplen0, uint32_t type) { struct hn_send_ctx sndc; + size_t resplen, min_resplen = *resplen0; + const struct hn_nvs_hdr *hdr; int error; + KASSERT(min_resplen >= sizeof(*hdr), + ("invalid minimum response len %zu", min_resplen)); + + /* + * Execute the xact setup by the caller. + */ hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); - vmbus_xact_activate(xact); + vmbus_xact_activate(xact); error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, req, reqlen, &sndc); if (error) { vmbus_xact_deactivate(xact); - return NULL; + return (NULL); } - return (vmbus_xact_wait(xact, resp_len)); + hdr = vmbus_xact_wait(xact, &resplen); + + /* + * Check this NVS response message. + */ + if (resplen < min_resplen) { + if_printf(sc->hn_ifp, "invalid NVS resp len %zu\n", resplen); + return (NULL); + } + if (hdr->nvs_type != type) { + if_printf(sc->hn_ifp, "unexpected NVS resp 0x%08x, " + "expect 0x%08x\n", hdr->nvs_type, type); + return (NULL); + } + /* All pass! */ + *resplen0 = resplen; + return (hdr); } static __inline int @@ -181,24 +205,14 @@ hv_nv_init_rx_buffer_with_net_vsp(struct conn->nvs_gpadl = sc->hn_rxbuf_gpadl; conn->nvs_sig = HN_NVS_RXBUF_SIG; - resp = hn_nvs_xact_execute(sc, xact, conn, sizeof(*conn), &resp_len); + resp_len = sizeof(*resp); + resp = hn_nvs_xact_execute(sc, xact, conn, sizeof(*conn), &resp_len, + HN_NVS_TYPE_RXBUF_CONNRESP); if (resp == NULL) { if_printf(sc->hn_ifp, "exec rxbuf conn failed\n"); error = EIO; goto cleanup; } - if (resp_len < sizeof(*resp)) { - if_printf(sc->hn_ifp, "invalid rxbuf conn resp length %zu\n", - resp_len); - error = EINVAL; - goto cleanup; - } - if (resp->nvs_type != HN_NVS_TYPE_RXBUF_CONNRESP) { - if_printf(sc->hn_ifp, "not rxbuf conn resp, type %u\n", - resp->nvs_type); - error = EINVAL; - goto cleanup; - } status = resp->nvs_status; vmbus_xact_put(xact); @@ -264,24 +278,14 @@ hv_nv_init_send_buffer_with_net_vsp(stru chim->nvs_gpadl = sc->hn_chim_gpadl; chim->nvs_sig = HN_NVS_CHIM_SIG; - resp = hn_nvs_xact_execute(sc, xact, chim, sizeof(*chim), &resp_len); + resp_len = sizeof(*resp); + resp = hn_nvs_xact_execute(sc, xact, chim, sizeof(*chim), &resp_len, + HN_NVS_TYPE_CHIM_CONNRESP); if (resp == NULL) { if_printf(sc->hn_ifp, "exec chim conn failed\n"); error = EIO; goto cleanup; } - if (resp_len < sizeof(*resp)) { - if_printf(sc->hn_ifp, "invalid chim conn resp length %zu\n", - resp_len); - error = EINVAL; - goto cleanup; - } - if (resp->nvs_type != HN_NVS_TYPE_CHIM_CONNRESP) { - if_printf(sc->hn_ifp, "not chim conn resp, type %u\n", - resp->nvs_type); - error = EINVAL; - goto cleanup; - } status = resp->nvs_status; sectsz = resp->nvs_sectsz; @@ -442,24 +446,14 @@ hv_nv_negotiate_nvsp_protocol(struct hn_ init->nvs_ver_min = nvs_ver; init->nvs_ver_max = nvs_ver; - resp = hn_nvs_xact_execute(sc, xact, init, sizeof(*init), &resp_len); + resp_len = sizeof(*resp); + resp = hn_nvs_xact_execute(sc, xact, init, sizeof(*init), &resp_len, + HN_NVS_TYPE_INIT_RESP); if (resp == NULL) { if_printf(sc->hn_ifp, "exec init failed\n"); vmbus_xact_put(xact); return (EIO); } - if (resp_len < sizeof(*resp)) { - if_printf(sc->hn_ifp, "invalid init resp length %zu\n", - resp_len); - vmbus_xact_put(xact); - return (EINVAL); - } - if (resp->nvs_type != HN_NVS_TYPE_INIT_RESP) { - if_printf(sc->hn_ifp, "not init resp, type %u\n", - resp->nvs_type); - vmbus_xact_put(xact); - return (EINVAL); - } status = resp->nvs_status; vmbus_xact_put(xact); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 31 04:03:55 2016 (r305109) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 31 05:27:30 2016 (r305110) @@ -970,24 +970,14 @@ hv_rf_on_device_add(struct hn_softc *sc, req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; req->nvs_nsubch = nchan - 1; - resp = hn_nvs_xact_execute(sc, xact, req, sizeof(*req), &resp_len); + resp_len = sizeof(*resp); + resp = hn_nvs_xact_execute(sc, xact, req, sizeof(*req), &resp_len, + HN_NVS_TYPE_SUBCH_RESP); if (resp == NULL) { if_printf(sc->hn_ifp, "exec subch failed\n"); ret = EIO; goto out; } - if (resp_len < sizeof(*resp)) { - if_printf(sc->hn_ifp, "invalid subch resp length %zu\n", - resp_len); - ret = EINVAL; - goto out; - } - if (resp->nvs_type != HN_NVS_TYPE_SUBCH_RESP) { - if_printf(sc->hn_ifp, "not subch resp, type %u\n", - resp->nvs_type); - ret = EINVAL; - goto out; - } status = resp->nvs_status; nsubch = resp->nvs_nsubch; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Aug 31 04:03:55 2016 (r305109) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Aug 31 05:27:30 2016 (r305110) @@ -111,7 +111,7 @@ struct vmbus_xact; const void *hn_nvs_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, void *req, int reqlen, - size_t *resp_len); + size_t *resp_len, uint32_t type); void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc, struct vmbus_channel *chan, const void *data, int dlen); uint32_t hn_chim_alloc(struct hn_softc *sc); From owner-svn-src-head@freebsd.org Wed Aug 31 06:00: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 18EF1BC9D4F; Wed, 31 Aug 2016 06:00:22 +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 CBE85A77; Wed, 31 Aug 2016 06:00:21 +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 u7V60KGj063151; Wed, 31 Aug 2016 06:00:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V60KDr063150; Wed, 31 Aug 2016 06:00:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608310600.u7V60KDr063150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 31 Aug 2016 06:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305111 - head/sys/dev/hyperv/utilities 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.22 Precedence: list List-Id: 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, 31 Aug 2016 06:00:22 -0000 Author: sephe Date: Wed Aug 31 06:00:20 2016 New Revision: 305111 URL: https://svnweb.freebsd.org/changeset/base/305111 Log: hyperv/timesync: Rework time adjustment policy - By default, adjust time upon SYNC request. It can be disabled through hw.hvtimesync.ignore_sync_req. SYNC request will be sent by hypervisor the host is resumed, rebooted, etc. - By default, adjust time upon SAMPLE request, if there is 100ms difference between VM time and hypervisor time. This can be disabled through hw.hvtimesync.sample_drift. And nuke the unnecessary task, since channel callback is running in a Hyper-V taskqueue nowadays. Submitted by: YanZhe Chen Discussed with: Dexuan Cui , Hongjiang Zhang , sephe MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7707 Modified: head/sys/dev/hyperv/utilities/hv_timesync.c Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Wed Aug 31 05:27:30 2016 (r305110) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Wed Aug 31 06:00:20 2016 (r305111) @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include @@ -52,11 +52,7 @@ #define HV_ICTIMESYNCFLAG_SYNC 1 #define HV_ICTIMESYNCFLAG_SAMPLE 2 #define HV_NANO_SEC_PER_SEC 1000000000 - -/* Time Sync data */ -typedef struct { - uint64_t data; -} time_sync_data; +#define HV_NANO_SEC_PER_MILLI_SEC 1000000 static const struct vmbus_ic_desc vmbus_timesync_descs[] = { { @@ -75,22 +71,43 @@ struct hv_ictimesync_data { uint8_t flags; } __packed; -typedef struct hv_timesync_sc { - hv_util_sc util_sc; - struct task task; - time_sync_data time_msg; -} hv_timesync_sc; +/* + * Globals + */ +SYSCTL_NODE(_hw, OID_AUTO, hvtimesync, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "Hyper-V timesync interface"); + +/* Ignore the sync request when set to 1. */ +static int ignore_sync_req = 0; +SYSCTL_INT(_hw_hvtimesync, OID_AUTO, ignore_sync_req, CTLFLAG_RWTUN, + &ignore_sync_req, 0, + "Ignore the sync request when set to 1."); + +/* + * Trigger sample sync when drift exceeds threshold (ms). + * Ignore the sample request when set to 0. + */ +static int sample_drift = 100; +SYSCTL_INT(_hw_hvtimesync, OID_AUTO, sample_drift, CTLFLAG_RWTUN, + &sample_drift, 0, + "Threshold that makes sample request trigger the sync."); /** - * Set host time based on time sync message from host + * @brief Synchronize time with host after reboot, restore, etc. + * + * ICTIMESYNCFLAG_SYNC flag bit indicates reboot, restore events of the VM. + * After reboot the flag ICTIMESYNCFLAG_SYNC is included in the first time + * message after the timesync channel is opened. Since the hv_utils module is + * loaded after hv_vmbus, the first message is usually missed. The other + * thing is, systime is automatically set to emulated hardware clock which may + * not be UTC time or in the same time zone. So, to override these effects, we + * use the first 50 time samples for initial system time setting. */ -static void -hv_set_host_time(void *context, int pending) +static inline +void hv_adj_guesttime(hv_util_sc *sc, uint64_t hosttime, uint8_t flags) { - hv_timesync_sc *softc = (hv_timesync_sc*)context; - uint64_t hosttime = softc->time_msg.data; struct timespec guest_ts, host_ts; - uint64_t host_tns; + uint64_t host_tns, guest_tns; int64_t diff; int error; @@ -99,37 +116,35 @@ hv_set_host_time(void *context, int pend host_ts.tv_nsec = (long)(host_tns%HV_NANO_SEC_PER_SEC); nanotime(&guest_ts); + guest_tns = guest_ts.tv_sec * HV_NANO_SEC_PER_SEC + guest_ts.tv_nsec; - diff = (int64_t)host_ts.tv_sec - (int64_t)guest_ts.tv_sec; + if ((flags & HV_ICTIMESYNCFLAG_SYNC) != 0 && ignore_sync_req == 0) { + if (bootverbose) { + device_printf(sc->ic_dev, "handle sync request " + "{host: %ju, guest: %ju}\n", + (uintmax_t)host_tns, (uintmax_t)guest_tns); + } - /* - * If host differs by 5 seconds then make the guest catch up - */ - if (diff > 5 || diff < -5) { error = kern_clock_settime(curthread, CLOCK_REALTIME, &host_ts); + return; } -} -/** - * @brief Synchronize time with host after reboot, restore, etc. - * - * ICTIMESYNCFLAG_SYNC flag bit indicates reboot, restore events of the VM. - * After reboot the flag ICTIMESYNCFLAG_SYNC is included in the first time - * message after the timesync channel is opened. Since the hv_utils module is - * loaded after hv_vmbus, the first message is usually missed. The other - * thing is, systime is automatically set to emulated hardware clock which may - * not be UTC time or in the same time zone. So, to override these effects, we - * use the first 50 time samples for initial system time setting. - */ -static inline -void hv_adj_guesttime(hv_timesync_sc *sc, uint64_t hosttime, uint8_t flags) -{ - sc->time_msg.data = hosttime; - - if (((flags & HV_ICTIMESYNCFLAG_SYNC) != 0) || - ((flags & HV_ICTIMESYNCFLAG_SAMPLE) != 0)) { - taskqueue_enqueue(taskqueue_thread, &sc->task); + if ((flags & HV_ICTIMESYNCFLAG_SAMPLE) != 0 && sample_drift != 0) { + if (bootverbose) { + device_printf(sc->ic_dev, "handle sample request " + "{host: %ju, guest: %ju}\n", + (uintmax_t)host_tns, (uintmax_t)guest_tns); + } + + diff = (int64_t)(host_tns - guest_tns) / HV_NANO_SEC_PER_MILLI_SEC; + if (diff > sample_drift || diff < -sample_drift) { + error = kern_clock_settime(curthread, CLOCK_REALTIME, + &host_ts); + if (bootverbose) + device_printf(sc->ic_dev, "trigger sample sync"); + } + return; } } @@ -145,12 +160,12 @@ hv_timesync_cb(struct vmbus_channel *cha int ret; uint8_t* time_buf; struct hv_ictimesync_data* timedatap; - hv_timesync_sc *softc; + hv_util_sc *softc; - softc = (hv_timesync_sc*)context; - time_buf = softc->util_sc.receive_buffer; + softc = (hv_util_sc*)context; + time_buf = softc->receive_buffer; - recvlen = softc->util_sc.ic_buflen; + recvlen = softc->ic_buflen; ret = vmbus_chan_recv(channel, time_buf, &recvlen, &requestId); KASSERT(ret != ENOBUFS, ("hvtimesync recvbuf is not large enough")); /* XXX check recvlen to make sure that it contains enough data */ @@ -162,7 +177,7 @@ hv_timesync_cb(struct vmbus_channel *cha if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { int error; - error = vmbus_ic_negomsg(&softc->util_sc, time_buf, &recvlen); + error = vmbus_ic_negomsg(softc, time_buf, &recvlen); if (error) return; } else { @@ -190,18 +205,12 @@ hv_timesync_probe(device_t dev) static int hv_timesync_attach(device_t dev) { - hv_timesync_sc *softc = device_get_softc(dev); - - TASK_INIT(&softc->task, 1, hv_set_host_time, softc); return hv_util_attach(dev, hv_timesync_cb); } static int hv_timesync_detach(device_t dev) { - hv_timesync_sc *softc = device_get_softc(dev); - - taskqueue_drain(taskqueue_thread, &softc->task); return hv_util_detach(dev); } @@ -213,7 +222,7 @@ static device_method_t timesync_methods[ { 0, 0 } }; -static driver_t timesync_driver = { "hvtimesync", timesync_methods, sizeof(hv_timesync_sc)}; +static driver_t timesync_driver = { "hvtimesync", timesync_methods, sizeof(hv_util_sc)}; static devclass_t timesync_devclass; From owner-svn-src-head@freebsd.org Wed Aug 31 06:32: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 4AD13BC9657; Wed, 31 Aug 2016 06:32:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id EAAC0BCD; Wed, 31 Aug 2016 06:32:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id E96EF104A647; Wed, 31 Aug 2016 16:32:26 +1000 (AEST) Date: Wed, 31 Aug 2016 16:32:26 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik cc: Conrad Meyer , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305091 - head/sys/sys In-Reply-To: <20160830224104.GA16151@dft-labs.eu> Message-ID: <20160831155441.V1481@besplex.bde.org> References: <201608302148.u7ULmAKm073958@repo.freebsd.org> <20160830224104.GA16151@dft-labs.eu> 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=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=af7uyxO1l4dUMir_YgYA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 06:32:50 -0000 On Wed, 31 Aug 2016, Mateusz Guzik wrote: > On Tue, Aug 30, 2016 at 03:35:39PM -0700, Conrad Meyer wrote: >> On Tue, Aug 30, 2016 at 2:48 PM, Mateusz Guzik wrote: >>> Author: mjg >>> Date: Tue Aug 30 21:48:10 2016 >>> New Revision: 305091 >>> URL: https://svnweb.freebsd.org/changeset/base/305091 >>> >>> Log: >>> fd: simplify fd testing in fget_locked by casting to u_int >>> >>> Modified: >>> head/sys/sys/filedesc.h >>> >>> Modified: head/sys/sys/filedesc.h >>> ============================================================================== >>> --- head/sys/sys/filedesc.h Tue Aug 30 21:43:57 2016 (r305090) >>> +++ head/sys/sys/filedesc.h Tue Aug 30 21:48:10 2016 (r305091) >>> @@ -201,7 +201,7 @@ fget_locked(struct filedesc *fdp, int fd >>> >>> FILEDESC_LOCK_ASSERT(fdp); >>> >>> - if (fd < 0 || fd > fdp->fd_lastfile) >>> + if ((u_int)fd > fdp->fd_lastfile) >>> return (NULL); >>> >>> return (fdp->fd_ofiles[fd].fde_file); This was correct. Now it is obfuscated by a bogus cast. Let the compiler do a strength reduction to a single comparison operator iff that is best. The cast is like using "register". In 1980's code I wrote lots of such unsigned casts since compilers were not so good and didn't do the strength reduction. >> I notice that fd_lastfile is an 'int'. Won't this trigger warnings >> about the differing signedness of the two sides of the comparison? >> Should fd_lastfile just be u_int as well? (If not (there is some >> valid negative value), this change may be invalid.) Ugh. fd_lastfile has the correct for a file descriptor (int). Making it unsigned would just require many more bogus casts to break warnings when comparing it with file descriptors. Almost all uses of unsigned types are errors. At best, the unsigned type doubles the range of non-negative values and gives arithmetic modulo 2**N instead of normal arithmetic. > It is -1 just after inception and is supposed to grow immediately after. > That is, the table with -1 should never be accessible. > > But now that you mention it I agree this is bad style. This > unnecessarily differs from the check in fget_unlocked so I'll just unify > it. Don't break the latter too. I already had to fix it once there. It had 2 commits just to move the bogus cast back and forth before I removed it. following churning: - created in r89969. This used 1 bogus cast. It was copied from a bad example in kern_descrip.c. It did a redundant check that (fd < 0). I had committed fixes for some bad examples like this in kern, but not this one. - I complained about this to Albert, but he didn't understand and changed it to the above in r89969. This works, but it is obscure. It depends on both fd and fdp->fd_lastfile having type int. So both operands are promoted to u_int and unsigned magic works. - some compilers apparently object to the implicit conversion of the second operand. So it was changed to use 2 bogus casts in r100072. This works, but it still depends on both fd and fdp->fd_lastfile having type int. Otherwise the cast might truncate 1 or both of them, or if they are smaller than int (perhaps int32_t) then it isn't clear if the cast works as intended. - I got tired of giving lessons and committed what I wanted in r126592. See the log message for r126592 for less details. Bruce From owner-svn-src-head@freebsd.org Wed Aug 31 06:46: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 DC9D4BC9895; Wed, 31 Aug 2016 06:46:48 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9FEF8EF; Wed, 31 Aug 2016 06:46:48 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V6klJP081691; Wed, 31 Aug 2016 06:46:47 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V6klSl081689; Wed, 31 Aug 2016 06:46:47 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201608310646.u7V6klSl081689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 31 Aug 2016 06:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305112 - head/sys/arm/ti/am335x 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.22 Precedence: list List-Id: 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, 31 Aug 2016 06:46:49 -0000 Author: loos Date: Wed Aug 31 06:46:47 2016 New Revision: 305112 URL: https://svnweb.freebsd.org/changeset/base/305112 Log: Replace a magic number with the proper register name. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/am335x/am335x_scm.h Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Wed Aug 31 06:00:20 2016 (r305111) +++ head/sys/arm/ti/am335x/am335x_prcm.c Wed Aug 31 06:46:47 2016 (r305112) @@ -619,10 +619,9 @@ am335x_clk_get_sysclk_freq(struct ti_clo { uint32_t ctrl_status; - /* Read the input clock freq from the control module */ - /* control_status reg (0x40) */ - if (ti_scm_reg_read_4(0x40, &ctrl_status)) - return ENXIO; + /* Read the input clock freq from the control module. */ + if (ti_scm_reg_read_4(SCM_CTRL_STATUS, &ctrl_status)) + return (ENXIO); switch ((ctrl_status>>22) & 0x3) { case 0x0: Modified: head/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 06:00:20 2016 (r305111) +++ head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 06:46:47 2016 (r305112) @@ -29,6 +29,7 @@ #define __AM335X_SCM_H__ /* AM335x-specific registers for control module (scm) */ +#define SCM_CTRL_STATUS 0x40 #define SCM_USB_CTRL0 0x620 #define SCM_USB_STS0 0x624 #define SCM_USB_CTRL1 0x628 From owner-svn-src-head@freebsd.org Wed Aug 31 07:03: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 41E43BC9B09; Wed, 31 Aug 2016 07:03:08 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 019F19B1; Wed, 31 Aug 2016 07:03:07 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V7375E089004; Wed, 31 Aug 2016 07:03:07 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V737LF089002; Wed, 31 Aug 2016 07:03:07 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201608310703.u7V737LF089002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 31 Aug 2016 07:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305113 - in head/sys/arm/ti: am335x cpsw 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.22 Precedence: list List-Id: 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, 31 Aug 2016 07:03:08 -0000 Author: loos Date: Wed Aug 31 07:03:06 2016 New Revision: 305113 URL: https://svnweb.freebsd.org/changeset/base/305113 Log: Replace more magic numbers with the proper register names. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/am335x/am335x_scm.h head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 06:46:47 2016 (r305112) +++ head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 07:03:06 2016 (r305113) @@ -34,6 +34,8 @@ #define SCM_USB_STS0 0x624 #define SCM_USB_CTRL1 0x628 #define SCM_USB_STS1 0x62C +#define SCM_MAC_ID0_LO 0x630 +#define SCM_MAC_ID0_HI 0x634 #define SCM_PWMSS_CTRL 0x664 #endif /* __AM335X_SCM_H__ */ Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Wed Aug 31 06:46:47 2016 (r305112) +++ head/sys/arm/ti/cpsw/if_cpsw.c Wed Aug 31 07:03:06 2016 (r305113) @@ -1019,14 +1019,14 @@ cpswp_attach(device_t dev) IFQ_SET_READY(&ifp->if_snd); /* Get high part of MAC address from control module (mac_id[0|1]_hi) */ - ti_scm_reg_read_4(0x634 + sc->unit * 8, ®); + ti_scm_reg_read_4(SCM_MAC_ID0_HI + sc->unit * 8, ®); mac_addr[0] = reg & 0xFF; mac_addr[1] = (reg >> 8) & 0xFF; mac_addr[2] = (reg >> 16) & 0xFF; mac_addr[3] = (reg >> 24) & 0xFF; /* Get low part of MAC address from control module (mac_id[0|1]_lo) */ - ti_scm_reg_read_4(0x630 + sc->unit * 8, ®); + ti_scm_reg_read_4(SCM_MAC_ID0_LO + sc->unit * 8, ®); mac_addr[4] = reg & 0xFF; mac_addr[5] = (reg >> 8) & 0xFF; From owner-svn-src-head@freebsd.org Wed Aug 31 07:05: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 CBE80BC9B70; Wed, 31 Aug 2016 07:05:26 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::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 4B0AEB39; Wed, 31 Aug 2016 07:05:26 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id b199so29954318lfe.0; Wed, 31 Aug 2016 00:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cltkIJiDc5gWag1+EmOxoMjZKBW6H4AIXiwKtp70wg0=; b=eOXDp0XBgXm0uJ/QYmLUhanLqSuUpKi4LxWmjXZazcu5hc+9i8cphGefRSaz/IFJZQ cpxnLSPmgRvWuefmOZGRrY9XEjcfRHnFX1Bbo4l3APeCj3f1oOonPSYeqQKAvAzO7a1/ JyJsKmf/4R7fwQgMNXfX97dsBAprjP2udsORlmqWgPPiFd9bQuSYK6wPcITVyT0DKO5f Sryp0N77THRUd30rsrvjy2dX+aQ9d5vM0+MmYyNlQBU88LySrkV1btke5ASb7hVFpJmD x5UVjA3acwjw1rLhZBmiH5+5qEUa3hnlFD9dx89Fyhc61l/1OZEPL6LuSI6Yy8cLMRsr NBjQ== 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 :references:mime-version:content-disposition:in-reply-to:user-agent; bh=cltkIJiDc5gWag1+EmOxoMjZKBW6H4AIXiwKtp70wg0=; b=cpnw2nUqLYgR3N9ofblzv2pGCBFB5tRZphWXORaBXuEEZ93rJamKZyG2m8/CemVOTL p3l5DEx41pgRXM/8BPeFUenZXeD0AHKW2LoIHOEwEksc89hZnEBEaKhnJsL4ej0qtkLx 9ufHkykli8l5Anz52X008GwovUfOn0IqbEIo1a1W3zn6wh59FoN9y9qsdlvkPvauWJHC sY5YXzBG2QCANm30ll8QWprm8+tdefHoSyMgF4i/QwoID5kR9jHtnJejf87wiyy8r8Y2 ehKJq4UZMbqkVW6fnpE6sRWt5eWDsNjttETmAxQjjlJlbtQ4AICVOmAyT+eiwZ+hnc96 /Nqw== X-Gm-Message-State: AE9vXwNu7Tw1cMOJz/NTQFWTJZqaUxPDxXJPKfZr1Do33fydDNaGwk24eLZAogP7szMCkQ== X-Received: by 10.46.5.5 with SMTP id 5mr2710258ljf.9.1472627123341; Wed, 31 Aug 2016 00:05:23 -0700 (PDT) Received: from jarvis ([77.79.224.226]) by smtp.gmail.com with ESMTPSA id z78sm8140325lfd.2.2016.08.31.00.05.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 00:05:22 -0700 (PDT) Sender: Mariusz Zaborski Date: Wed, 31 Aug 2016 09:06:07 +0200 From: Mariusz Zaborski To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r305084 - head/tools/regression/capsicum/syscalls Message-ID: <20160831070607.GA3259@jarvis> References: <201608301958.u7UJwf1G032550@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ibTvN161/egqYuK8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 07:05:26 -0000 --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 30, 2016 at 06:04:50PM -0700, Ngie Cooper wrote: > On Tue, Aug 30, 2016 at 12:58 PM, Mariusz Zaborski = wrote: > > Author: oshogbo > > Date: Tue Aug 30 19:58:41 2016 > > New Revision: 305084 > > URL: https://svnweb.freebsd.org/changeset/base/305084 > > > > Log: > > Fix Capsicum syscalls test suite. >=20 > Do you plan on MFCing the change? emaste@ suggested to change it to the kyua tests, what would you think about MFCing after that? > Thanks, > -Ngie Thanks, --=20 Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 --ibTvN161/egqYuK8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXxoHfAAoJEN/ChBrixsVk498P/jGPinzDKeAKxBz+/0t5+7zu LwcqyVJDHPiwQIkdMgi/1RNoD99R8oeazyceKrayk/tSaP42ltubPIWR0wH/qNfd /LFHga4O0CZdcoygzspiR3z/9JHyvz+zf0LeLupt4nNfc3UZmGLFiCxC/r2SKKG3 MuhC6UkGBBTzBVTI4G/Fz7ttj3MDYf8dWlz9RIr8+ZMIrS1uUrXHVRDzDp/y0kFY tt9gnC8ngvATey0ZYVDrF4lEg0Kx0D++oPJnIQ1GwBusrEhkxy5paWhtSxez9h2v wF6Gv5TFdFAOVDrNlRIJylQjlgwerce5Pd42puCCdVV2Xd8vcwL4KfoV5ioYsR8h qGFeWTlVILdgQW87GXtWLfVHLzo4h3mGddr++8BfOZ/8DrB8hdrjB7NMW+oZob8O YuWmjrpQ4F/hTSFSXohv0J5warmEuK0XUBIUOWKPAPXIFljovrNlkuD3bVKKPRgc 1YGzezY55Ix7BCStLEWZ1ud7FZvK/uuzIg+WQJqrV6w8eihmM65vGt6H3P4KCTpk 9U3kyoq8VDHlDWYymTurbkCXcW4ouXN326sbC/5dJqix09zbmartTUJwwsUHPnCQ u5PjDhRBkQGweMwoZ9Uw+H5axt6fZFuSjUx61dz0m+ioT9qjrZjATnKl0lOgDO9y CCOUFutrVxDjWjKH0i8M =X1MP -----END PGP SIGNATURE----- --ibTvN161/egqYuK8-- From owner-svn-src-head@freebsd.org Wed Aug 31 07:22: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 08535BC9F80; Wed, 31 Aug 2016 07:22:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C2CDB40E; Wed, 31 Aug 2016 07:22:15 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V7MEnw094476; Wed, 31 Aug 2016 07:22:14 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V7MEvA094475; Wed, 31 Aug 2016 07:22:14 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201608310722.u7V7MEvA094475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 31 Aug 2016 07:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305114 - head/sys/arm/ti 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.22 Precedence: list List-Id: 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, 31 Aug 2016 07:22:16 -0000 Author: loos Date: Wed Aug 31 07:22:14 2016 New Revision: 305114 URL: https://svnweb.freebsd.org/changeset/base/305114 Log: Allow the use of control module extensions to cope with specific platform features. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/ti_scm.c Modified: head/sys/arm/ti/ti_scm.c ============================================================================== --- head/sys/arm/ti/ti_scm.c Wed Aug 31 07:03:06 2016 (r305113) +++ head/sys/arm/ti/ti_scm.c Wed Aug 31 07:22:14 2016 (r305114) @@ -131,7 +131,11 @@ ti_scm_attach(device_t dev) ti_scm_sc = sc; - return (0); + /* Attach platform extensions, if any. */ + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + + return (bus_generic_attach(dev)); } int From owner-svn-src-head@freebsd.org Wed Aug 31 07:42: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 86BCBBC92E0; Wed, 31 Aug 2016 07:42:47 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5CC06E04; Wed, 31 Aug 2016 07:42:47 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V7gkuB004084; Wed, 31 Aug 2016 07:42:46 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V7gkjS004081; Wed, 31 Aug 2016 07:42:46 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201608310742.u7V7gkjS004081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 31 Aug 2016 07:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305115 - head/sys/arm/ti/am335x 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.22 Precedence: list List-Id: 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, 31 Aug 2016 07:42:47 -0000 Author: loos Date: Wed Aug 31 07:42:46 2016 New Revision: 305115 URL: https://svnweb.freebsd.org/changeset/base/305115 Log: Add a driver for the AM335x bandgap sensor, an on-die temperature sensor as part of the AM335x control module extension. TI says that the bandgap sensor is not very accurate on AM335x, but in our tests it seems to be a good reference for the SoC temperature. TI details: http://processors.wiki.ti.com/index.php/AM335x_Thermal_Considerations#Measuring_Case_Temperature Sponsored by: Rubicon Communications, LLC (Netgate) Added: head/sys/arm/ti/am335x/am335x_scm.c (contents, props changed) Modified: head/sys/arm/ti/am335x/am335x_scm.h head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_scm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_scm.c Wed Aug 31 07:42:46 2016 (r305115) @@ -0,0 +1,169 @@ +/*- + * Copyright (c) 2016 Rubicon Communications, LLC (Netgate) + * 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 + +#define TZ_ZEROC 2731 + +struct am335x_scm_softc { + int sc_last_temp; + struct sysctl_oid *sc_temp_oid; +}; + +static int +am335x_scm_temp_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + int i, temp; + struct am335x_scm_softc *sc; + uint32_t reg; + + dev = (device_t)arg1; + sc = device_get_softc(dev); + + /* Read the temperature and convert to Kelvin. */ + for(i = 50; i > 0; i--) { + ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + if ((reg & SCM_BGAP_EOCZ) == 0) + break; + DELAY(50); + } + if ((reg & SCM_BGAP_EOCZ) == 0) { + sc->sc_last_temp = + (reg >> SCM_BGAP_TEMP_SHIFT) & SCM_BGAP_TEMP_MASK; + sc->sc_last_temp *= 10; + } + temp = sc->sc_last_temp + TZ_ZEROC; + + return (sysctl_handle_int(oidp, &temp, 0, req)); +} + +static void +am335x_scm_identify(driver_t *driver, device_t parent) +{ + device_t child; + + /* AM335x only. */ + if (ti_chip() != CHIP_AM335X) + return; + + /* Make sure we attach only once. */ + if (device_find_child(parent, "am335x_scm", -1) != NULL) + return; + + child = device_add_child(parent, "am335x_scm", -1); + if (child == NULL) + device_printf(parent, "cannot add ti_scm child\n"); +} + +static int +am335x_scm_probe(device_t dev) +{ + + device_set_desc(dev, "AM335x Control Module Extension"); + + return (BUS_PROBE_DEFAULT); +} + +static int +am335x_scm_attach(device_t dev) +{ + struct am335x_scm_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *tree; + uint32_t reg; + + /* Set ADC to continous mode, clear output reset. */ + reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV; + ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); + /* Flush write. */ + ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + /* Start the ADC conversion. */ + reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV | SCM_BGAP_SOC; + ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); + + /* Temperature sysctl. */ + sc = device_get_softc(dev); + ctx = device_get_sysctl_ctx(dev); + tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + sc->sc_temp_oid = SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, + "temperature", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, 0, am335x_scm_temp_sysctl, "IK", "Current temperature"); + + return (0); +} + +static int +am335x_scm_detach(device_t dev) +{ + struct am335x_scm_softc *sc; + + sc = device_get_softc(dev); + + /* Remove temperature sysctl. */ + if (sc->sc_temp_oid != NULL) + sysctl_remove_oid(sc->sc_temp_oid, 1, 0); + + /* Stop the bandgap ADC. */ + ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_BGOFF); + + return (0); +} + +static device_method_t am335x_scm_methods[] = { + DEVMETHOD(device_identify, am335x_scm_identify), + DEVMETHOD(device_probe, am335x_scm_probe), + DEVMETHOD(device_attach, am335x_scm_attach), + DEVMETHOD(device_detach, am335x_scm_detach), + + DEVMETHOD_END +}; + +static driver_t am335x_scm_driver = { + "am335x_scm", + am335x_scm_methods, + sizeof(struct am335x_scm_softc), +}; + +static devclass_t am335x_scm_devclass; + +DRIVER_MODULE(am335x_scm, ti_scm, am335x_scm_driver, am335x_scm_devclass, 0, 0); +MODULE_VERSION(am335x_scm, 1); +MODULE_DEPEND(am335x_scm, ti_scm, 1, 1, 1); Modified: head/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 07:22:14 2016 (r305114) +++ head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 07:42:46 2016 (r305115) @@ -30,6 +30,14 @@ /* AM335x-specific registers for control module (scm) */ #define SCM_CTRL_STATUS 0x40 +#define SCM_BGAP_CTRL 0x448 +#define SCM_BGAP_TEMP_MASK 0xff +#define SCM_BGAP_TEMP_SHIFT 8 +#define SCM_BGAP_BGOFF (1 << 6) +#define SCM_BGAP_SOC (1 << 4) +#define SCM_BGAP_CLRZ (1 << 3) +#define SCM_BGAP_CONTCONV (1 << 2) +#define SCM_BGAP_EOCZ (1 << 1) #define SCM_USB_CTRL0 0x620 #define SCM_USB_STS0 0x624 #define SCM_USB_CTRL1 0x628 Modified: head/sys/arm/ti/am335x/files.am335x ============================================================================== --- head/sys/arm/ti/am335x/files.am335x Wed Aug 31 07:22:14 2016 (r305114) +++ head/sys/arm/ti/am335x/files.am335x Wed Aug 31 07:42:46 2016 (r305115) @@ -13,6 +13,7 @@ arm/ti/am335x/am335x_pwmss.c standard arm/ti/am335x/am335x_ehrpwm.c standard arm/ti/am335x/am335x_ecap.c standard arm/ti/am335x/am335x_rtc.c optional am335x_rtc +arm/ti/am335x/am335x_scm.c standard arm/ti/am335x/am335x_scm_padconf.c standard arm/ti/am335x/am335x_usbss.c optional musb fdt arm/ti/am335x/am335x_musb.c optional musb fdt From owner-svn-src-head@freebsd.org Wed Aug 31 09:23: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 2C2BCBC715A; Wed, 31 Aug 2016 09:23:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F05061D9; Wed, 31 Aug 2016 09:23:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7V9NAJh041308; Wed, 31 Aug 2016 09:23:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7V9NAOu041307; Wed, 31 Aug 2016 09:23:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608310923.u7V9NAOu041307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 31 Aug 2016 09:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305116 - head/lib/libstand 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.22 Precedence: list List-Id: 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, 31 Aug 2016 09:23:11 -0000 Author: tsoome Date: Wed Aug 31 09:23:09 2016 New Revision: 305116 URL: https://svnweb.freebsd.org/changeset/base/305116 Log: recvtftp() is broken for large files, report file size The tftp download for large files will cause internal block id to wrap to 0 as the data type is unsigned short. Also provide file size information for stat. PR: 200500 Reported by: tsoome Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D7660 Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Aug 31 07:42:46 2016 (r305115) +++ head/lib/libstand/tftp.c Wed Aug 31 09:23:09 2016 (r305116) @@ -200,7 +200,7 @@ recvtftp(struct tftp_handle *h, void *pk case DATA: { int got; - if (htons(t->th_block) != d->xid) { + if (htons(t->th_block) != (u_short) d->xid) { /* * Expected block? */ @@ -560,7 +560,7 @@ tftp_stat(struct open_file *f, struct st sb->st_nlink = 1; sb->st_uid = 0; sb->st_gid = 0; - sb->st_size = -1; + sb->st_size = (off_t) tftpfile->tftp_tsize; return (0); } @@ -731,6 +731,8 @@ tftp_parse_oack(struct tftp_handle *h, c } else if (strcasecmp(tftp_options[i], "tsize") == 0) { if (i + 1 < option_idx) tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); + if (tsize != 0) + h->tftp_tsize = tsize; } else { /* Do not allow any options we did not expect to be ACKed. */ printf("unexpected tftp option '%s'\n", tftp_options[i]); From owner-svn-src-head@freebsd.org Wed Aug 31 10:14: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 0B9C7BC9021; Wed, 31 Aug 2016 10:14:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C41A5C45; Wed, 31 Aug 2016 10:14:16 +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 EC53F25D37C2; Wed, 31 Aug 2016 10:14:13 +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 22803D1F7F5; Wed, 31 Aug 2016 10:14:13 +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 D43wU1yaO93B; Wed, 31 Aug 2016 10:14:11 +0000 (UTC) Received: from [10.111.64.116] (unknown [IPv6:fde9:577b:c1a9:4410:5833:303d:486f:3dfe]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 62DB8D1F7EB; Wed, 31 Aug 2016 10:14:10 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Luiz Otavio O Souza" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305113 - in head/sys/arm/ti: am335x cpsw Date: Wed, 31 Aug 2016 10:14:08 +0000 Message-ID: In-Reply-To: <201608310703.u7V737LF089002@repo.freebsd.org> References: <201608310703.u7V737LF089002@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6053) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 10:14:17 -0000 On 31 Aug 2016, at 7:03, Luiz Otavio O Souza wrote: > Author: loos > Date: Wed Aug 31 07:03:06 2016 > New Revision: 305113 > URL: https://svnweb.freebsd.org/changeset/base/305113 > > Log: > Replace more magic numbers with the proper register names. > > Sponsored by: Rubicon Communications, LLC (Netgate) > > Modified: > head/sys/arm/ti/am335x/am335x_scm.h > head/sys/arm/ti/cpsw/if_cpsw.c Was this the right header file? Looks like it wasn’t to me :( /scratch/tmp/bz/head.svn/sys/modules/cpsw/../../arm/ti/cpsw/if_cpsw.c:1022:20: error: use of undeclared identifier 'SCM_MAC_ID0_HI' /scratch/tmp/bz/head.svn/sys/modules/cpsw/../../arm/ti/cpsw/if_cpsw.c:1029:20: error: use of undeclared identifier 'SCM_MAC_ID0_LO' > > Modified: head/sys/arm/ti/am335x/am335x_scm.h > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 06:46:47 > 2016 (r305112) > +++ head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 07:03:06 > 2016 (r305113) > @@ -34,6 +34,8 @@ > #define SCM_USB_STS0 0x624 > #define SCM_USB_CTRL1 0x628 > #define SCM_USB_STS1 0x62C > +#define SCM_MAC_ID0_LO 0x630 > +#define SCM_MAC_ID0_HI 0x634 > #define SCM_PWMSS_CTRL 0x664 > > #endif /* __AM335X_SCM_H__ */ From owner-svn-src-head@freebsd.org Wed Aug 31 10:45: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 A7839BC9D16; Wed, 31 Aug 2016 10:45:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60622D5D; Wed, 31 Aug 2016 10:45:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VAjXvo071494; Wed, 31 Aug 2016 10:45:33 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VAjXRC071491; Wed, 31 Aug 2016 10:45:33 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201608311045.u7VAjXRC071491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Aug 2016 10:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305119 - in head/sys/arm/ti: am335x cpsw 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.22 Precedence: list List-Id: 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, 31 Aug 2016 10:45:34 -0000 Author: bz Date: Wed Aug 31 10:45:33 2016 New Revision: 305119 URL: https://svnweb.freebsd.org/changeset/base/305119 Log: After r305113, try to properly replace the magic numbers with proper #defines for this driver (not using the wrong header). Modified: head/sys/arm/ti/am335x/am335x_scm.h head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h Modified: head/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 09:50:02 2016 (r305118) +++ head/sys/arm/ti/am335x/am335x_scm.h Wed Aug 31 10:45:33 2016 (r305119) @@ -42,8 +42,6 @@ #define SCM_USB_STS0 0x624 #define SCM_USB_CTRL1 0x628 #define SCM_USB_STS1 0x62C -#define SCM_MAC_ID0_LO 0x630 -#define SCM_MAC_ID0_HI 0x634 #define SCM_PWMSS_CTRL 0x664 #endif /* __AM335X_SCM_H__ */ Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Wed Aug 31 09:50:02 2016 (r305118) +++ head/sys/arm/ti/cpsw/if_cpsw.c Wed Aug 31 10:45:33 2016 (r305119) @@ -1019,14 +1019,14 @@ cpswp_attach(device_t dev) IFQ_SET_READY(&ifp->if_snd); /* Get high part of MAC address from control module (mac_id[0|1]_hi) */ - ti_scm_reg_read_4(SCM_MAC_ID0_HI + sc->unit * 8, ®); + ti_scm_reg_read_4(CPSW_MAC_ID0_HI + sc->unit * 8, ®); mac_addr[0] = reg & 0xFF; mac_addr[1] = (reg >> 8) & 0xFF; mac_addr[2] = (reg >> 16) & 0xFF; mac_addr[3] = (reg >> 24) & 0xFF; /* Get low part of MAC address from control module (mac_id[0|1]_lo) */ - ti_scm_reg_read_4(SCM_MAC_ID0_LO + sc->unit * 8, ®); + ti_scm_reg_read_4(CPSW_MAC_ID0_LO + sc->unit * 8, ®); mac_addr[4] = reg & 0xFF; mac_addr[5] = (reg >> 8) & 0xFF; Modified: head/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswreg.h Wed Aug 31 09:50:02 2016 (r305118) +++ head/sys/arm/ti/cpsw/if_cpswreg.h Wed Aug 31 10:45:33 2016 (r305119) @@ -46,6 +46,9 @@ #define CPSW_PORT_P_SA_LO(p) (CPSW_PORT_OFFSET + 0x120 + ((p-1) * 0x100)) #define CPSW_PORT_P_SA_HI(p) (CPSW_PORT_OFFSET + 0x124 + ((p-1) * 0x100)) +#define CPSW_MAC_ID0_LO 0x0630 +#define CPSW_MAC_ID0_HI 0x0634 + #define CPSW_CPDMA_OFFSET 0x0800 #define CPSW_CPDMA_TX_CONTROL (CPSW_CPDMA_OFFSET + 0x04) #define CPSW_CPDMA_TX_TEARDOWN (CPSW_CPDMA_OFFSET + 0x08) From owner-svn-src-head@freebsd.org Wed Aug 31 10:45: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 66ED0BC9DEF; Wed, 31 Aug 2016 10:45:54 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 42F82EFF; Wed, 31 Aug 2016 10:45:54 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VAjrwc071554; Wed, 31 Aug 2016 10:45:53 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VAjr3M071553; Wed, 31 Aug 2016 10:45:53 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608311045.u7VAjr3M071553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 31 Aug 2016 10:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305120 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 10:45:54 -0000 Author: jmcneill Date: Wed Aug 31 10:45:53 2016 New Revision: 305120 URL: https://svnweb.freebsd.org/changeset/base/305120 Log: Add support for Allwinner A64 USB PHY. Reviewed by: manu Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Wed Aug 31 10:45:33 2016 (r305119) +++ head/sys/arm/allwinner/aw_usbphy.c Wed Aug 31 10:45:53 2016 (r305120) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -53,25 +54,89 @@ __FBSDID("$FreeBSD$"); #include "phy_if.h" #define USBPHY_NPHYS 4 +#define USBPHY_NRES USBPHY_NPHYS + +enum awusbphy_type { + AWUSBPHY_TYPE_A10 = 1, + AWUSBPHY_TYPE_A13, + AWUSBPHY_TYPE_A20, + AWUSBPHY_TYPE_A31, + AWUSBPHY_TYPE_A83T, + AWUSBPHY_TYPE_H3, + AWUSBPHY_TYPE_A64 +}; static struct ofw_compat_data compat_data[] = { - { "allwinner,sun4i-a10-usb-phy", 1 }, - { "allwinner,sun5i-a13-usb-phy", 1 }, - { "allwinner,sun6i-a31-usb-phy", 1 }, - { "allwinner,sun7i-a20-usb-phy", 1 }, - { "allwinner,sun8i-a83t-usb-phy", 1 }, - { "allwinner,sun8i-h3-usb-phy", 1 }, + { "allwinner,sun4i-a10-usb-phy", AWUSBPHY_TYPE_A10 }, + { "allwinner,sun5i-a13-usb-phy", AWUSBPHY_TYPE_A13 }, + { "allwinner,sun6i-a31-usb-phy", AWUSBPHY_TYPE_A31 }, + { "allwinner,sun7i-a20-usb-phy", AWUSBPHY_TYPE_A20 }, + { "allwinner,sun8i-a83t-usb-phy", AWUSBPHY_TYPE_A83T }, + { "allwinner,sun8i-h3-usb-phy", AWUSBPHY_TYPE_H3 }, + { "allwinner,sun50i-a64-usb-phy", AWUSBPHY_TYPE_A64 }, { NULL, 0 } }; struct awusbphy_softc { + struct resource * res[USBPHY_NRES]; regulator_t reg[USBPHY_NPHYS]; gpio_pin_t id_det_pin; int id_det_valid; gpio_pin_t vbus_det_pin; int vbus_det_valid; + enum awusbphy_type phy_type; }; +static struct resource_spec awusbphy_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_MEMORY, 2, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_MEMORY, 3, RF_ACTIVE | RF_OPTIONAL }, + { -1, 0 } +}; + +#define RD4(sc, i, o) bus_read_4((sc)->res[(i)], (o)) +#define WR4(sc, i, o, v) bus_write_4((sc)->res[(i)], (o), (v)) +#define CLR4(sc, i, o, m) WR4(sc, i, o, RD4(sc, i, o) & ~(m)) +#define SET4(sc, i, o, m) WR4(sc, i, o, RD4(sc, i, o) | (m)) + +#define OTG_PHY_CFG 0x20 +#define OTG_PHY_ROUTE_OTG (1 << 0) +#define PMU_IRQ_ENABLE 0x00 +#define PMU_AHB_INCR8 (1 << 10) +#define PMU_AHB_INCR4 (1 << 9) +#define PMU_AHB_INCRX_ALIGN (1 << 8) +#define PMU_ULPI_BYPASS (1 << 0) +#define PMU_UNK_H3 0x10 +#define PMU_UNK_H3_CLR 0x2 + +static void +awusbphy_configure(device_t dev, int phyno) +{ + struct awusbphy_softc *sc; + + sc = device_get_softc(dev); + + if (sc->res[phyno] == NULL) + return; + + if (sc->phy_type == AWUSBPHY_TYPE_A64) { + CLR4(sc, phyno, PMU_UNK_H3, PMU_UNK_H3_CLR); + + /* EHCI0 and OTG share a PHY */ + if (phyno == 0) + SET4(sc, 0, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); + else if (phyno == 1) + CLR4(sc, 0, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); + } + + if (phyno > 0) { + /* Enable passby */ + SET4(sc, phyno, PMU_IRQ_ENABLE, PMU_ULPI_BYPASS | + PMU_AHB_INCR8 | PMU_AHB_INCR4 | PMU_AHB_INCRX_ALIGN); + } +} + static int awusbphy_init(device_t dev) { @@ -86,6 +151,8 @@ awusbphy_init(device_t dev) sc = device_get_softc(dev); node = ofw_bus_get_node(dev); + sc->phy_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + /* Enable clocks */ for (off = 0; clk_get_by_ofw_index(dev, 0, off, &clk) == 0; off++) { error = clk_enable(clk); @@ -123,6 +190,10 @@ awusbphy_init(device_t dev) if (error == 0) sc->vbus_det_valid = 1; + /* Allocate resources */ + if (bus_alloc_resources(dev, awusbphy_spec, sc->res) != 0) + device_printf(dev, "couldn't allocate resources\n"); + return (0); } @@ -159,6 +230,9 @@ awusbphy_phy_enable(device_t dev, intptr sc = device_get_softc(dev); + /* Configure PHY */ + awusbphy_configure(dev, phy); + /* Regulators are optional. If not found, return success. */ reg = sc->reg[phy]; if (reg == NULL) From owner-svn-src-head@freebsd.org Wed Aug 31 11:10: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 386F3BC94B4; Wed, 31 Aug 2016 11:10:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EF0F5B40; Wed, 31 Aug 2016 11:10:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VBAeO3079614; Wed, 31 Aug 2016 11:10:40 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VBAesL079612; Wed, 31 Aug 2016 11:10:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608311110.u7VBAesL079612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 31 Aug 2016 11:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305121 - head/sys/dev/syscons 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.22 Precedence: list List-Id: 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, 31 Aug 2016 11:10:41 -0000 Author: bde Date: Wed Aug 31 11:10:39 2016 New Revision: 305121 URL: https://svnweb.freebsd.org/changeset/base/305121 Log: Add some locking to sc_cngetc(). Keyboard input needs Giant locking, and that is not possible to do correctly here. Use mtx_trylock() and proceed unlocked as before if we can't acquire Giant (non-recursively), except in kdb mode don't even try to acquire Giant. Everything here is a hack, but it often works. Even if mtx_trylock() succeeds, this might be a LOR. Keyboard input also needs screen locking, to handle screen updates and switches. Add this, using the same simplistic screen locking as for sc_cnputc(). Giant must be acquired before the screen lock, and the screen lock must be dropped when calling the keyboard driver (else it would get a harmless LOR if it tries to acquire Giant). It was intended that sc cn open/close hide the locking calls, and they do for i/o functions functions except for this complication. Non-console keyboard input is still only Giant-locked, with screen locking in some called functions. This is correct for the keyboard parts only. When Giant cannot be acquired properly, atkbd and kbdmux tend to race and work (they assume that the caller acquired Giant properly and don't try to acquire it again or check that it has been acquired, and the races rarely matter), while ukbd tends to deadlock or panic (since it does the opposite, and has other usb threads to deadlock with). The keyboard (Giant) locking here does very little, but the screen locking completes screen locking for console mode except for not detecting or handling deadlock. Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Wed Aug 31 10:45:53 2016 (r305120) +++ head/sys/dev/syscons/syscons.c Wed Aug 31 11:10:39 2016 (r305121) @@ -1649,11 +1649,33 @@ sc_cnterm(struct consdev *cp) static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp); static int sc_cngetc_locked(struct sc_cnstate *sp); +static void sccnkbdlock(sc_softc_t *sc, struct sc_cnstate *sp); +static void sccnkbdunlock(sc_softc_t *sc, struct sc_cnstate *sp); static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags); static void sccnscrlock(sc_softc_t *sc, struct sc_cnstate *sp); static void sccnscrunlock(sc_softc_t *sc, struct sc_cnstate *sp); static void +sccnkbdlock(sc_softc_t *sc, struct sc_cnstate *sp) +{ + /* + * Locking method: hope for the best. + * The keyboard is supposed to be Giant locked. We can't handle that + * in general. The kdb_active case here is not safe, and we will + * proceed without the lock in all cases. + */ + sp->kbd_locked = !kdb_active && mtx_trylock(&Giant); +} + +static void +sccnkbdunlock(sc_softc_t *sc, struct sc_cnstate *sp) +{ + if (sp->kbd_locked) + mtx_unlock(&Giant); + sp->kbd_locked = FALSE; +} + +static void sccnscrlock(sc_softc_t *sc, struct sc_cnstate *sp) { SC_VIDEO_LOCK(sc); @@ -1674,11 +1696,14 @@ sccnopen(sc_softc_t *sc, struct sc_cnsta sp->kbd_opened = FALSE; sp->scr_opened = FALSE; + sp->kbd_locked = FALSE; /* Opening the keyboard is optional. */ if (!(flags & 1) || sc->kbd == NULL) goto over_keyboard; + sccnkbdlock(sc, sp); + /* * Make sure the keyboard is accessible even when the kbd device * driver is disabled. @@ -1726,6 +1751,7 @@ sccnclose(sc_softc_t *sc, struct sc_cnst kbdd_disable(sc->kbd); sp->kbd_opened = FALSE; + sccnkbdunlock(sc, sp); } /* @@ -1751,6 +1777,7 @@ sc_cngrab(struct consdev *cp) if (lev >= 0 && lev < 2) { sccnopen(sc, &sc->grab_state[lev], 1 | 2); sccnscrunlock(sc, &sc->grab_state[lev]); + sccnkbdunlock(sc, &sc->grab_state[lev]); } } @@ -1763,6 +1790,7 @@ sc_cnungrab(struct consdev *cp) sc = sc_console->sc; lev = atomic_load_acq_int(&sc->grab_level) - 1; if (lev >= 0 && lev < 2) { + sccnkbdlock(sc, &sc->grab_state[lev]); sccnscrlock(sc, &sc->grab_state[lev]); sccnclose(sc, &sc->grab_state[lev]); } @@ -1825,16 +1853,20 @@ sc_cnputc(struct consdev *cd, int c) static int sc_cngetc(struct consdev *cd) { + struct sc_cnstate st; int c, s; /* assert(sc_console != NULL) */ + sccnopen(sc_console->sc, &st, 1); s = spltty(); /* block sckbdevent and scrn_timer while we poll */ - if (sc_console->sc->kbd == NULL) { + if (!st.kbd_opened) { splx(s); - return -1; + sccnclose(sc_console->sc, &st); + return -1; /* means no keyboard since we fudged the locking */ } - c = sc_cngetc_locked(NULL); + c = sc_cngetc_locked(&st); splx(s); + sccnclose(sc_console->sc, &st); return c; } @@ -1858,7 +1890,7 @@ sc_cngetc_locked(struct sc_cnstate *sp) if (fkeycp < fkey.len) return fkey.str[fkeycp++]; - c = scgetc(scp->sc, SCGETC_CN | SCGETC_NONBLOCK, NULL); + c = scgetc(scp->sc, SCGETC_CN | SCGETC_NONBLOCK, sp); switch (KEYFLAGS(c)) { case 0: /* normal char */ @@ -3464,7 +3496,11 @@ next_code: scp = sc->cur_scp; /* first see if there is something in the keyboard port */ for (;;) { + if (flags & SCGETC_CN) + sccnscrunlock(sc, sp); c = kbdd_read_char(sc->kbd, !(flags & SCGETC_NONBLOCK)); + if (flags & SCGETC_CN) + sccnscrlock(sc, sp); if (c == ERRKEY) { if (!(flags & SCGETC_CN)) sc_bell(scp, bios_value.bell_pitch, BELL_DURATION); Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Wed Aug 31 10:45:53 2016 (r305120) +++ head/sys/dev/syscons/syscons.h Wed Aug 31 11:10:39 2016 (r305121) @@ -190,6 +190,7 @@ struct scr_stat; struct tty; struct sc_cnstate { + u_char kbd_locked; u_char kbd_opened; u_char scr_opened; }; From owner-svn-src-head@freebsd.org Wed Aug 31 11:51: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 79329BC905C; Wed, 31 Aug 2016 11:51:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49EE43D1; Wed, 31 Aug 2016 11:51:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VBpq8I096792; Wed, 31 Aug 2016 11:51:52 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VBpqhH096791; Wed, 31 Aug 2016 11:51:52 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608311151.u7VBpqhH096791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 31 Aug 2016 11:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305122 - head/sys/netipsec 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.22 Precedence: list List-Id: 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, 31 Aug 2016 11:51:53 -0000 Author: ae Date: Wed Aug 31 11:51:52 2016 New Revision: 305122 URL: https://svnweb.freebsd.org/changeset/base/305122 Log: Remove redundant sanity checks from ipsec[46]_common_input_cb(). This check already has been done in the each protocol callback. Modified: head/sys/netipsec/ipsec_input.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Wed Aug 31 11:10:39 2016 (r305121) +++ head/sys/netipsec/ipsec_input.c Wed Aug 31 11:51:52 2016 (r305122) @@ -334,14 +334,6 @@ ipsec4_common_input_cb(struct mbuf *m, s sproto == IPPROTO_IPCOMP, ("unexpected security protocol %u", sproto)); - /* Sanity check */ - if (m == NULL) { - DPRINTF(("%s: null mbuf", __func__)); - IPSEC_ISTAT(sproto, badkcr); - KEY_FREESAV(&sav); - return EINVAL; - } - if (skip != 0) { /* * Fix IPv4 header @@ -615,14 +607,6 @@ ipsec6_common_input_cb(struct mbuf *m, s sproto == IPPROTO_IPCOMP, ("unexpected security protocol %u", sproto)); - /* Sanity check */ - if (m == NULL) { - DPRINTF(("%s: null mbuf", __func__)); - IPSEC_ISTAT(sproto, badkcr); - error = EINVAL; - goto bad; - } - /* Fix IPv6 header */ if (m->m_len < sizeof(struct ip6_hdr) && (m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { From owner-svn-src-head@freebsd.org Wed Aug 31 11:55: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 1F4DFBC9157; Wed, 31 Aug 2016 11:55:33 +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 E64E28D1; Wed, 31 Aug 2016 11:55:32 +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 u7VBtWDp098254; Wed, 31 Aug 2016 11:55:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VBtWiE098253; Wed, 31 Aug 2016 11:55:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608311155.u7VBtWiE098253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 31 Aug 2016 11:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305123 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 11:55:33 -0000 Author: mav Date: Wed Aug 31 11:55:31 2016 New Revision: 305123 URL: https://svnweb.freebsd.org/changeset/base/305123 Log: Fix kernel panic when inheriting properties without default. There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu", that have no default string value. Attempt to unset them or replicate caused kernel panic. This simple bandaid seems fixes the problem nicely. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Wed Aug 31 11:51:52 2016 (r305122) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Wed Aug 31 11:55:31 2016 (r305123) @@ -54,6 +54,8 @@ dodefault(zfs_prop_t prop, int intsz, in return (SET_ERROR(ENOENT)); if (zfs_prop_get_type(prop) == PROP_TYPE_STRING) { + if (zfs_prop_default_string(prop) == NULL) + return (SET_ERROR(ENOENT)); if (intsz != 1) return (SET_ERROR(EOVERFLOW)); (void) strncpy(buf, zfs_prop_default_string(prop), From owner-svn-src-head@freebsd.org Wed Aug 31 12:29: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 C887CBCA572; Wed, 31 Aug 2016 12:29:05 +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 922E4389; Wed, 31 Aug 2016 12:29:05 +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 u7VCT4bS010458; Wed, 31 Aug 2016 12:29:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VCT4aB010457; Wed, 31 Aug 2016 12:29:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201608311229.u7VCT4aB010457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 31 Aug 2016 12:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305124 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 12:29:05 -0000 Author: mjg Date: Wed Aug 31 12:29:04 2016 New Revision: 305124 URL: https://svnweb.freebsd.org/changeset/base/305124 Log: fd: effectively revert r305091 Turns out fd_lastfile can survive being -1 for some processes, giving incorrect results with the cast. Noted by: cem Modified: head/sys/sys/filedesc.h Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Wed Aug 31 11:55:31 2016 (r305123) +++ head/sys/sys/filedesc.h Wed Aug 31 12:29:04 2016 (r305124) @@ -201,7 +201,7 @@ fget_locked(struct filedesc *fdp, int fd FILEDESC_LOCK_ASSERT(fdp); - if ((u_int)fd > fdp->fd_lastfile) + if (fd < 0 || fd > fdp->fd_lastfile) return (NULL); return (fdp->fd_ofiles[fd].fde_file); @@ -213,7 +213,7 @@ fdeget_locked(struct filedesc *fdp, int FILEDESC_LOCK_ASSERT(fdp); - if ((u_int)fd > fdp->fd_lastfile) + if (fd < 0 || fd > fdp->fd_lastfile) return (NULL); return (&fdp->fd_ofiles[fd]); From owner-svn-src-head@freebsd.org Wed Aug 31 13: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 327D8BC914A; Wed, 31 Aug 2016 13:16:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EAB8C3EB; Wed, 31 Aug 2016 13:16:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VDGgfB029365; Wed, 31 Aug 2016 13:16:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VDGeCM029352; Wed, 31 Aug 2016 13:16:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608311316.u7VDGeCM029352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 31 Aug 2016 13:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305125 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/pc98/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.22 Precedence: list List-Id: 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, 31 Aug 2016 13:16:43 -0000 Author: bapt Date: Wed Aug 31 13:16:40 2016 New Revision: 305125 URL: https://svnweb.freebsd.org/changeset/base/305125 Log: Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi Add a new 'netproto' variable which can be set for now to NET_TFTP or NET_NFS (default to NET_NONE) From the dhcp options if one sets the root-path option to: "ip:path", the loader will consider it is booting over NFS (meaning same behaviour as the default current behaviour) if the dhcp option "tftp server address" is set (option 150) the loader will consider it is booting over tftpfs, it will then consider the root-path options with 2 possible case 1. "path" then the IP of the tftp server will be the one passed by the option 150, and the files will be retrieved under "path" on the tftp server 2. "ip:path" then the IP of the tftp server will be the one passed in the option "overwritting the IP from the option 150. We could not "abuse" the rootpath option in the form or tftp://ip:path because this is already used for other purpose by iPXE preventing any chainload from iPXE to the FreeBSD loader. Given at each open(), the loader loops over all available filesystems and keep the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa. the tftpfs and nfs implementation in libstand now return EINVAL early if 'netproto' for that purpose. Reviewed by: tsoome Relnotes: yes Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D7628 Modified: head/lib/libstand/bootp.c head/lib/libstand/bootp.h head/lib/libstand/globals.c head/lib/libstand/net.h head/lib/libstand/nfs.c head/lib/libstand/tftp.c head/sys/boot/common/dev_net.c head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/conf.c head/sys/boot/i386/libi386/pxe.c head/sys/boot/i386/loader/conf.c head/sys/boot/pc98/loader/conf.c Modified: head/lib/libstand/bootp.c ============================================================================== --- head/lib/libstand/bootp.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/lib/libstand/bootp.c Wed Aug 31 13:16:40 2016 (r305125) @@ -411,6 +411,10 @@ vend_rfc1048(cp, len) bcopy(cp, &dhcp_serverip.s_addr, sizeof(dhcp_serverip.s_addr)); } + if (tag == TAG_TFTP_SERVER) { + bcopy(cp, &tftpip.s_addr, + sizeof(tftpip.s_addr)); + } #endif cp += size; } Modified: head/lib/libstand/bootp.h ============================================================================== --- head/lib/libstand/bootp.h Wed Aug 31 12:29:04 2016 (r305124) +++ head/lib/libstand/bootp.h Wed Aug 31 13:16:40 2016 (r305125) @@ -106,6 +106,7 @@ struct bootp { #define TAG_T2 ((unsigned char) 59) #define TAG_CLASSID ((unsigned char) 60) #define TAG_CLIENTID ((unsigned char) 61) +#define TAG_TFTP_SERVER ((unsigned char) 150) #endif #define TAG_END ((unsigned char) 255) Modified: head/lib/libstand/globals.c ============================================================================== --- head/lib/libstand/globals.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/lib/libstand/globals.c Wed Aug 31 13:16:40 2016 (r305125) @@ -25,12 +25,14 @@ char hostname[FNAME_SIZE]; /* our hostn int hostnamelen; char domainname[FNAME_SIZE]; /* our DNS domain */ int domainnamelen; +int netproto = NET_NONE; /* Network prototol */ char ifname[IFNAME_SIZE]; /* name of interface (e.g. "le0") */ struct in_addr myip; /* my ip address */ struct in_addr nameip; /* DNS server ip address */ struct in_addr rootip; /* root ip address */ struct in_addr swapip; /* swap ip address */ struct in_addr gateip; /* gateway ip address */ +struct in_addr tftpip; /* TFTP ip address */ n_long netmask = 0xffffff00; /* subnet or net mask */ u_int intf_mtu; /* interface mtu from bootp/dhcp */ int errno; /* our old friend */ Modified: head/lib/libstand/net.h ============================================================================== --- head/lib/libstand/net.h Wed Aug 31 12:29:04 2016 (r305124) +++ head/lib/libstand/net.h Wed Aug 31 13:16:40 2016 (r305125) @@ -36,6 +36,8 @@ * $FreeBSD$ */ +#ifndef _STAND_NET_H +#define _STAND_NET_H #ifndef _KERNEL /* XXX - see */ #undef __IPADDR #define __IPADDR(x) htonl((u_int32_t)(x)) @@ -45,6 +47,12 @@ #define BA { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } +enum net_proto { + NET_NONE, + NET_NFS, + NET_TFTP +}; + /* Returns true if n_long's on the same net */ #define SAMENET(a1, a2, m) ((a1.s_addr & m) == (a2.s_addr & m)) @@ -74,6 +82,7 @@ extern char hostname[FNAME_SIZE]; extern int hostnamelen; extern char domainname[FNAME_SIZE]; extern int domainnamelen; +extern int netproto; extern char ifname[IFNAME_SIZE]; /* All of these are in network order. */ @@ -82,6 +91,7 @@ extern struct in_addr rootip; extern struct in_addr swapip; extern struct in_addr gateip; extern struct in_addr nameip; +extern struct in_addr tftpip; extern n_long netmask; extern u_int intf_mtu; @@ -120,3 +130,4 @@ n_long inet_addr(char *); /* Machine-dependent functions: */ time_t getsecs(void); +#endif Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/lib/libstand/nfs.c Wed Aug 31 13:16:40 2016 (r305125) @@ -458,6 +458,9 @@ nfs_open(const char *upath, struct open_ int error; char *path; + if (netproto != NET_NFS) + return (EINVAL); + #ifdef NFS_DEBUG if (debug) printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath); @@ -1100,6 +1103,9 @@ nfs_open(const char *upath, struct open_ int error; char *path; + if (netproto != NET_NFS) + return (EINVAL); + #ifdef NFS_DEBUG if (debug) printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath); Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/lib/libstand/tftp.c Wed Aug 31 13:16:40 2016 (r305125) @@ -402,6 +402,9 @@ tftp_open(const char *path, struct open_ size_t pathsize; const char *extraslash; + if (netproto != NET_TFTP) + return (EINVAL); + if (strcmp(f->f_dev->dv_name, "net") != 0) { #ifdef __i386__ if (strcmp(f->f_dev->dv_name, "pxe") != 0) Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/sys/boot/common/dev_net.c Wed Aug 31 13:16:40 2016 (r305125) @@ -167,13 +167,14 @@ net_open(struct open_file *f, ...) setenv("boot.netif.ip", inet_ntoa(myip), 1); setenv("boot.netif.netmask", intoa(netmask), 1); setenv("boot.netif.gateway", inet_ntoa(gateip), 1); -#ifdef LOADER_TFTP_SUPPORT - setenv("boot.tftproot.server", inet_ntoa(rootip), 1); - setenv("boot.tftproot.path", rootpath, 1); -#else - setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); - setenv("boot.nfsroot.path", rootpath, 1); -#endif + setenv("boot.netif.server", inet_ntoa(rootip), 1); + if (netproto == NET_TFTP) { + setenv("boot.tftproot.server", inet_ntoa(rootip), 1); + setenv("boot.tftproot.path", rootpath, 1); + } else if (netproto == NET_NFS) { + setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); + setenv("boot.nfsroot.path", rootpath, 1); + } if (intf_mtu != 0) { char mtu[16]; sprintf(mtu, "%u", intf_mtu); @@ -367,16 +368,24 @@ net_print(int verbose) uint32_t net_parse_rootpath() { - int i; + int i, ipstart; n_long addr = INADDR_NONE; + netproto = NET_NFS; + + if (tftpip.s_addr != 0) { + netproto = NET_TFTP; + addr = tftpip.s_addr; + } + for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) if (rootpath[i] == ':') break; if (i && i != FNAME_SIZE && rootpath[i] == ':') { rootpath[i++] = '\0'; - addr = inet_addr(&rootpath[0]); + addr = inet_addr(&rootpath[ipstart]); bcopy(&rootpath[i], rootpath, strlen(&rootpath[i])+1); } + return (addr); } Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Wed Aug 31 12:29:04 2016 (r305124) +++ head/sys/boot/efi/libefi/Makefile Wed Aug 31 13:16:40 2016 (r305125) @@ -13,10 +13,6 @@ SRCS+= time.c SRCS+= time_event.c .endif -.if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT -DNETIF_OPEN_CLOSE_ONCE -.endif - # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Wed Aug 31 12:29:04 2016 (r305124) +++ head/sys/boot/efi/loader/Makefile Wed Aug 31 13:16:40 2016 (r305125) @@ -21,10 +21,6 @@ SRCS= autoload.c \ smbios.c \ vers.c -.if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT -DNETIF_OPEN_CLOSE_ONCE -.endif - .if ${MK_ZFS} != "no" SRCS+= zfs.c .PATH: ${.CURDIR}/../../zfs Modified: head/sys/boot/efi/loader/conf.c ============================================================================== --- head/sys/boot/efi/loader/conf.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/sys/boot/efi/loader/conf.c Wed Aug 31 13:16:40 2016 (r305125) @@ -51,11 +51,8 @@ struct fs_ops *file_system[] = { &dosfs_fsops, &ufs_fsops, &cd9660_fsops, -#ifdef LOADER_TFTP_SUPPORT &tftp_fsops, -#else &nfs_fsops, -#endif &gzipfs_fsops, &bzipfs_fsops, NULL Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/sys/boot/i386/libi386/pxe.c Wed Aug 31 13:16:40 2016 (r305125) @@ -288,10 +288,15 @@ pxe_open(struct open_file *f, ...) bootp(pxe_sock, BOOTP_PXE); if (rootip.s_addr == 0) rootip.s_addr = bootplayer.sip; -#ifdef LOADER_NFS_SUPPORT - if (!rootpath[0]) + + netproto = NET_NFS; + if (tftpip.s_addr != 0) { + netproto = NET_TFTP; + rootip.s_addr = tftpip.s_addr; + } + + if (netproto == NET_NFS && !rootpath[0]) strcpy(rootpath, PXENFSROOTPATH); -#endif for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) if (rootpath[i] == ':') @@ -315,17 +320,17 @@ pxe_open(struct open_file *f, ...) sprintf(mtu, "%u", intf_mtu); setenv("boot.netif.mtu", mtu, 1); } -#ifdef LOADER_NFS_SUPPORT printf("pxe_open: server addr: %s\n", inet_ntoa(rootip)); printf("pxe_open: server path: %s\n", rootpath); printf("pxe_open: gateway ip: %s\n", inet_ntoa(gateip)); - setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); - setenv("boot.nfsroot.path", rootpath, 1); -#else - setenv("boot.netif.server", inet_ntoa(rootip), 1); - setenv("boot.tftproot.path", rootpath, 1); -#endif + if (netproto == NET_NFS) { + setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); + setenv("boot.nfsroot.path", rootpath, 1); + } else if (netproto == NET_TFTP) { + setenv("boot.netif.server", inet_ntoa(rootip), 1); + setenv("boot.tftproot.path", rootpath, 1); + } setenv("dhcp.host-name", hostname, 1); setenv("pxeboot.ip", inet_ntoa(myip), 1); @@ -359,10 +364,10 @@ pxe_close(struct open_file *f) if (pxe_opens > 0) return(0); -#ifdef LOADER_NFS_SUPPORT - /* get an NFS filehandle for our root filesystem */ - pxe_setnfshandle(rootpath); -#endif + if (netproto == NET_NFS) { + /* get an NFS filehandle for our root filesystem */ + pxe_setnfshandle(rootpath); + } if (pxe_sock >= 0) { @@ -422,7 +427,6 @@ pxe_perror(int err) return; } -#ifdef LOADER_NFS_SUPPORT /* * Reach inside the libstand NFS code and dig out an NFS handle * for the root filesystem. @@ -533,7 +537,6 @@ pxe_setnfshandle(char *rootpath) setenv("boot.nfsroot.nfshandlelen", buf, 1); } #endif /* OLD_NFSV2 */ -#endif /* LOADER_NFS_SUPPORT */ void pxenv_call(int func) Modified: head/sys/boot/i386/loader/conf.c ============================================================================== --- head/sys/boot/i386/loader/conf.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/sys/boot/i386/loader/conf.c Wed Aug 31 13:16:40 2016 (r305125) @@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$"); * XXX as libi386 and biosboot merge, some of these can become linker sets. */ -#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT) -#error "Cannot have both tftp and nfs support yet." -#endif - #if defined(LOADER_FIREWIRE_SUPPORT) extern struct devsw fwohci; #endif Modified: head/sys/boot/pc98/loader/conf.c ============================================================================== --- head/sys/boot/pc98/loader/conf.c Wed Aug 31 12:29:04 2016 (r305124) +++ head/sys/boot/pc98/loader/conf.c Wed Aug 31 13:16:40 2016 (r305125) @@ -42,10 +42,6 @@ __FBSDID("$FreeBSD$"); * XXX as libi386 and biosboot merge, some of these can become linker sets. */ -#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT) -#error "Cannot have both tftp and nfs support yet." -#endif - /* Exported for libstand */ struct devsw *devsw[] = { &bioscd, From owner-svn-src-head@freebsd.org Wed Aug 31 13: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 B2205BC947C; Wed, 31 Aug 2016 13:22:32 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) 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 42FA6B5F; Wed, 31 Aug 2016 13:22:32 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id w2so30973971wmd.0; Wed, 31 Aug 2016 06:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AeJaKDm4dWdKrJN/rgTmJ1o6ufU5qE4oY3rHIphfX9o=; b=APOQBrOveuP339YGZ772v/1ZP0PvT7jUq1rqZNJVYlhaJo1kfyikD0/f29yUtVcO/2 iovbF1TOeQtlAhiRSO/t09cmvWl8B56xlV+7KduUgIVpdnqyiarkBPdV+Z+tct9/zBVA nMwH5vrzTD+d4FqQDZRYVcakODZSn6ppz7RLuT2/rNZoQ2XIbKDyO/bLRpKwlmMy2RmB KZJQSCXR6wxFfevXSVC4HEwgDuD4nlQxSyCFSBl6sP0PcVRy76fWQKwiCUPy81Z1wQUk 1OHI/bAunzykQDJzS7/+DuKDqISBXo/T6Yz7/DyJv/N1FQzBsmRwDoQCf4UEkxZZM58B ybFQ== 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:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AeJaKDm4dWdKrJN/rgTmJ1o6ufU5qE4oY3rHIphfX9o=; b=nC8fixhZV7wukOUI5Vrrs+7+hE78mm0G6jv6y3waehZilOSclzCx8w0/IS69ttTXdj 9uXRbdGv5binxjBfRmbVAlIJ4c7r3uVJKAa+0keU1Ttc3xK8npKgUjYUg/lQCGfkW+gq TkqmHlA2pEbpKH+npjD8WVzr9x2LnmCKiUn1iLU7r4lkNGbUiGADmgRmCdv84KnyFtOy E5hofBw8AWq0OguGtHHjP3fwtNT/3uP4V5abiFqV+y5Fsat0Dp/uD5PWiUI1MyISFnzf FvkKYpV2jInlmFAtRhzCDmUxVoZhoZ3MgYd44FT8pHrJ/kEx6DjMyOwp2i7PsW4+xfaK 6vfg== X-Gm-Message-State: AE9vXwOp5eTEu0pLPHe71N/QsCP1zBdl6998iTSEGahXjYRW9/Urk5XBvkKmeDBS7F8WQg== X-Received: by 10.194.87.67 with SMTP id v3mr8994855wjz.103.1472649750596; Wed, 31 Aug 2016 06:22:30 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id c16sm9019088wme.4.2016.08.31.06.22.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 06:22:29 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 31 Aug 2016 15:22:29 +0200 From: Baptiste Daroussin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305125 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/pc98/loader Message-ID: <20160831132229.phrzg3itpgj7iliy@ivaldir.etoilebsd.net> References: <201608311316.u7VDGeCM029352@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3uvgvjx4c336ktya" Content-Disposition: inline In-Reply-To: <201608311316.u7VDGeCM029352@repo.freebsd.org> User-Agent: Mutt/1.6.2-neo (2016-08-08) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 13:22:32 -0000 --3uvgvjx4c336ktya Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 31, 2016 at 01:16:40PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Aug 31 13:16:40 2016 > New Revision: 305125 > URL: https://svnweb.freebsd.org/changeset/base/305125 >=20 > Log: > Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi > =20 > Add a new 'netproto' variable which can be set for now to > NET_TFTP or NET_NFS (default to NET_NONE) > =20 > From the dhcp options if one sets the root-path option to: > "ip:path", the loader will consider it is booting over NFS > (meaning same behaviour as the default current behaviour) > =20 > if the dhcp option "tftp server address" is set (option 150) > the loader will consider it is booting over tftpfs, it will then > consider the root-path options with 2 possible case > 1. "path" then the IP of the tftp server will be the one passed by > the option 150, and the files will be retrieved under "path" on the tftp > server > 2. "ip:path" then the IP of the tftp server will be the one passed in > the option "overwritting the IP from the option 150. > =20 > We could not "abuse" the rootpath option in the form or tftp://ip:path = because > this is already used for other purpose by iPXE preventing any chainload= from > iPXE to the FreeBSD loader. > =20 > Given at each open(), the loader loops over all available filesystems a= nd keep > the "best" error, we needed to prevent tftpfs to fallback on nfs and vi= ce versa. > the tftpfs and nfs implementation in libstand now return EINVAL early if > 'netproto' for that purpose. > =20 > Reviewed by: tsoome > Relnotes: yes > Sponsored by: Gandi.net > Differential Revision: https://reviews.freebsd.org/D7628 I forgot to mention a guard was added to libstand's net.h, because it is included multiple times for some loaders Best regards, Bapt --3uvgvjx4c336ktya Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXxtoKAAoJEGOJi9zxtz5aomQQAKyADodOuYI19SEUhKY/mBVi 0II7ZsjGA/kAX6d/oDJwhx0+aPrjO9K7RdMF98GfJWQg7chbghowATKq9lUdiZzu fqMlOfJrXFjgSoHyZMBLEisF6YDpTFhLIoQgYJ0dh1K9164ane29mOIbUrvmDWeF 1wOxkW1tGSXFOZVcHUlvyNQT74mA+g4mXFd0ZmHf+s2fe80myUTDsMmSfYPyKk4M p0zcsMKPHe5hxIl7p8mDHxoPVua/QCbLlRNachWEvv7+R0yMQz5PRPdwzQdeLtD/ +VM9+asJMLh+5Z3fQYEFn4jBONTy3S+P0EUfYpyGyPFEt8EorKnonBno2huMACTT kOBleVvxLhFv+8m4JhrtHALAbqmXwXTqnYVTkXZyIbohfDYXHcmC6DmGXN7FridG xeoGv4X3l7bDVaXkYXyMaU2eHsHo5yA45mJCyvDxrq3J7WzDYUmvQqI47W+VwZPF DWTvHg2S8nTWxb1bPamJu/eVDtPxI6WUAwpwfXdESmJqCJEp90avsJg/Xca881QL mZJpd3ZRj6P03D6ZbUB7eigKcxRsJ3ZiEGANldGZFGhqq/ph+uAxvmlHllxo5dJx ILUi9rPdiOAmLixtPS78j5tkybWAfKc4udBGXqh+QVPfOxQEgaxrvoCZIsXtH930 AQyffqIIJmzx7NJGJIrz =cT4t -----END PGP SIGNATURE----- --3uvgvjx4c336ktya-- From owner-svn-src-head@freebsd.org Wed Aug 31 13:50: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 DA2CABC9F1A; Wed, 31 Aug 2016 13:50:20 +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 987B2C0; Wed, 31 Aug 2016 13:50:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bf5u7-000NCv-1W; Wed, 31 Aug 2016 16:50:11 +0300 Date: Wed, 31 Aug 2016 16:50:11 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160831135010.GV88122@zxy.spb.ru> References: <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> <20160827004617.GJ88122@zxy.spb.ru> <20160828133012.GN88122@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.22 Precedence: list List-Id: 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, 31 Aug 2016 13:50:21 -0000 On Sun, Aug 28, 2016 at 10:20:08AM -0700, Adrian Chadd wrote: > Then the rest of the big entries are just a combination of rtentry > locking, tcp timer locking, zfs locking and madvise locking. There's > some sowakeup locking there as well, from the socket producer/consumer > locking. On some high network speed I am see like kevent's congestion: 22.79% [89522] __mtx_lock_sleep @ /boot/kernel.VSTREAM/kernel 82.99% [74295] knote 99.97% [74269] sowakeup 99.07% [73581] tcp_do_segment 100.0% [73581] tcp_input 100.0% [73581] ip_input 100.0% [73581] netisr_dispatch_src 100.0% [73581] ether_demux 100.0% [73581] ether_nh_input 100.0% [73581] netisr_dispatch_src 68.88% [50683] t4_eth_rx @ /boot/kernel.VSTREAM/if_cxgbe.ko 100.0% [50683] service_iq 100.0% [50683] t4_intr 100.0% [50683] intr_event_execute_handlers @ /boot/kernel.VSTREAM/kernel 100.0% [50683] ithread_loop 100.0% [50683] fork_exit 31.12% [22898] tcp_lro_flush 97.30% [22280] service_iq @ /boot/kernel.VSTREAM/if_cxgbe.ko 100.0% [22280] t4_intr 100.0% [22280] intr_event_execute_handlers @ /boot/kernel.VSTREAM/kernel 100.0% [22280] ithread_loop 100.0% [22280] fork_exit 01.55% [354] tcp_lro_flush_inactive 100.0% [354] service_iq @ /boot/kernel.VSTREAM/if_cxgbe.ko 100.0% [354] t4_intr 100.0% [354] intr_event_execute_handlers @ /boot/kernel.VSTREAM/kernel 100.0% [354] ithread_loop 01.15% [264] tcp_lro_rx 100.0% [264] t4_eth_rx @ /boot/kernel.VSTREAM/if_cxgbe.ko 100.0% [264] service_iq 100.0% [264] t4_intr 100.0% [264] intr_event_execute_handlers @ /boot/kernel.VSTREAM/kernel Can I do some recomendation? From owner-svn-src-head@freebsd.org Wed Aug 31 13:58: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 D00A3BCA20C; Wed, 31 Aug 2016 13:58: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 9D7FEA91; Wed, 31 Aug 2016 13:58:33 +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 u7VDwWhP045095; Wed, 31 Aug 2016 13:58:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VDwW9R045094; Wed, 31 Aug 2016 13:58:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608311358.u7VDwW9R045094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 31 Aug 2016 13:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305128 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 13:58:33 -0000 Author: andrew Date: Wed Aug 31 13:58:32 2016 New Revision: 305128 URL: https://svnweb.freebsd.org/changeset/base/305128 Log: Also handle instruction traps. We might hit these when the page we are executing is being promoted to a superpage. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Aug 31 13:51:41 2016 (r305127) +++ head/sys/arm64/arm64/trap.c Wed Aug 31 13:58:32 2016 (r305128) @@ -285,6 +285,7 @@ do_el1h_sync(struct trapframe *frame) print_registers(frame); printf(" esr: %.8lx\n", esr); panic("VFP exception in the kernel"); + case EXCP_INSN_ABORT: case EXCP_DATA_ABORT: far = READ_SPECIALREG(far_el1); intr_enable(); From owner-svn-src-head@freebsd.org Wed Aug 31 14:41:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8744BBCAD96; Wed, 31 Aug 2016 14:41:49 +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 761F9905; Wed, 31 Aug 2016 14:41:49 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=51964 helo=[10.0.0.103]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1bf53Q-000OyA-Uf; Wed, 31 Aug 2016 12:55:45 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r305107 - head/sys/boot/forth From: Devin Teske X-Mailer: iPhone Mail (13G35) In-Reply-To: <201608310355.u7V3tof3018157@repo.freebsd.org> Date: Wed, 31 Aug 2016 07:41:42 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Content-Transfer-Encoding: quoted-printable Message-Id: <9994950D-74C3-4326-BE5F-27B042971460@shxd.cx> References: <201608310355.u7V3tof3018157@repo.freebsd.org> To: Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 14:41:49 -0000 Please remove the following: "Unsure why we don't just have start" Others beside yourself have great understanding of the Forth and we don't ne= ed questioning comments in the code. --=20 Devin > On Aug 30, 2016, at 8:55 PM, Warner Losh wrote: >=20 > Unsure why we don't just have start From owner-svn-src-head@freebsd.org Wed Aug 31 14:43: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 D23A5BCADF5 for ; Wed, 31 Aug 2016 14:43:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::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 9A5FCAF5 for ; Wed, 31 Aug 2016 14:43:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id e124so11909057ith.0 for ; Wed, 31 Aug 2016 07:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=cnHmxbyiC16joP0bz3eeBfZbXaV5O3hLAwJbH2lfrwc=; b=WTonV9x04YpBFpYdxImOrcA7J9ivlu5DGXmlvYTzwJ9U0ZPqao/fdIC0Rt7ow4tF2P pMnwQt4fE1XulUeJHMMPtr21/zhr4KJsy2ANN9qJzjHHp26mB6FTRLBo1+D7S3nPMTTc 5RMkgFejVj2LAxeDq9EWa+h3zRwdiSDyEANwCP4ZSJZcOvRXx2lYGnBmxrOyiYC49Znz sq8lHUTQ1Nqzg2QCxEvUzaMG0TYQVr2Ix68SSC13hDov0LpEhH/QreoarxxKqr72Cmx6 XBSxosiqOiNFKZkrL2cW9I2WYUcQG9NPbTlM5mwVpTQGgRZ4qGPTSjYMne9bqeF3Ma80 33VQ== 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; bh=cnHmxbyiC16joP0bz3eeBfZbXaV5O3hLAwJbH2lfrwc=; b=E0/+remDW8Vqj+ZPq20YEvO21XKiBImHjBq+nfVbuAAP3wvuq0L8EmavFg0SEioH2w r58xF8rir4OKak7bepVb+tsiU8WDVEubeLBeQQb9oUy1YrjMIqHCZ0YvL/kUwYSs/q9A I89ynUJE2AMMo2NYiuzdyP2jKzSHgS15z5yCZ/gw46oeWf0GCzdLA0N9xVMyJ//AKb3g 4xiV/sE4ckNvbyG/mrhxBTcMNWb18a6ZsZ64zCZVG4gPrzmt8FE8VI/mCa+bI/E84g8E YqYglLYnI4ufO1OUgmDd7tZtmUnOaaKqWSGz6BJiWNv2Ym5ANVL2DmsgfWCs8MNlK16u rUsw== X-Gm-Message-State: AE9vXwMhY5+NwHon4AqqwnTi9KqdsvAx3oDT3oSy84ZPWnSrshKo3H8QXvDQfK4Xa+FLW+ZzxWG7ltSneKIYBA== X-Received: by 10.36.116.193 with SMTP id o184mr30606977itc.14.1472654606860; Wed, 31 Aug 2016 07:43:26 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 31 Aug 2016 07:43:26 -0700 (PDT) X-Originating-IP: [50.205.115.50] In-Reply-To: <9994950D-74C3-4326-BE5F-27B042971460@shxd.cx> References: <201608310355.u7V3tof3018157@repo.freebsd.org> <9994950D-74C3-4326-BE5F-27B042971460@shxd.cx> From: Warner Losh Date: Wed, 31 Aug 2016 08:43:26 -0600 X-Google-Sender-Auth: nydUUde5KM3W660iLJHmTPnRePc Message-ID: Subject: Re: svn commit: r305107 - head/sys/boot/forth To: Devin Teske Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 14:43:27 -0000 On Wed, Aug 31, 2016 at 8:41 AM, Devin Teske wrote: > Please remove the following: > > "Unsure why we don't just have start" > > Others beside yourself have great understanding of the Forth and we don't need questioning comments in the code. To be fair, it was just left in there accidentally. However, could you explain it to me? That answer is insulting without being actually helpful in resolving the situation. Warner From owner-svn-src-head@freebsd.org Wed Aug 31 14:49: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 97192BCAE8B; Wed, 31 Aug 2016 14:49:59 +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 4E520D02; Wed, 31 Aug 2016 14:49:59 +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 u7VEnwCZ064220; Wed, 31 Aug 2016 14:49:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VEnwlq064219; Wed, 31 Aug 2016 14:49:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608311449.u7VEnwlq064219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 31 Aug 2016 14:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305129 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 14:49:59 -0000 Author: kib Date: Wed Aug 31 14:49:58 2016 New Revision: 305129 URL: https://svnweb.freebsd.org/changeset/base/305129 Log: Make swapoff reliable. The swap_pager_swapoff() function uses trylock for the object lock before pagein, which means that either i/o to md(4) over swap, or intensive page faults over swap pager objects might prevent swapoff() from making any progress. Then the retry < 100 check fails and machine panics. If trylock fails, acquire the object lock in the blockable way and restart the hash bucket walk. Keep retries logic for now. Reported and tested by: pho Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7688 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Aug 31 13:58:32 2016 (r305128) +++ head/sys/vm/swap_pager.c Wed Aug 31 14:49:58 2016 (r305129) @@ -1688,36 +1688,49 @@ static void swap_pager_swapoff(struct swdevt *sp) { struct swblock *swap; + vm_object_t locked_obj, object; + vm_pindex_t pindex; int i, j, retries; sx_assert(&swdev_syscall_lock, SA_XLOCKED); retries = 0; + locked_obj = NULL; full_rescan: mtx_lock(&swhash_mtx); for (i = 0; i <= swhash_mask; i++) { /* '<=' is correct here */ restart: for (swap = swhash[i]; swap != NULL; swap = swap->swb_hnext) { - vm_object_t object = swap->swb_object; - vm_pindex_t pindex = swap->swb_index; + object = swap->swb_object; + pindex = swap->swb_index; for (j = 0; j < SWAP_META_PAGES; ++j) { - if (swp_pager_isondev(swap->swb_pages[j], sp)) { - /* avoid deadlock */ + if (!swp_pager_isondev(swap->swb_pages[j], sp)) + continue; + if (locked_obj != object) { + if (locked_obj != NULL) + VM_OBJECT_WUNLOCK(locked_obj); + locked_obj = object; if (!VM_OBJECT_TRYWLOCK(object)) { - break; - } else { mtx_unlock(&swhash_mtx); - swp_pager_force_pagein(object, - pindex + j); - VM_OBJECT_WUNLOCK(object); + /* Depends on type-stability. */ + VM_OBJECT_WLOCK(object); mtx_lock(&swhash_mtx); goto restart; } } + MPASS(locked_obj == object); + mtx_unlock(&swhash_mtx); + swp_pager_force_pagein(object, pindex + j); + mtx_lock(&swhash_mtx); + goto restart; } } } mtx_unlock(&swhash_mtx); + if (locked_obj != NULL) { + VM_OBJECT_WUNLOCK(locked_obj); + locked_obj = NULL; + } if (sp->sw_used) { /* * Objects may be locked or paging to the device being From owner-svn-src-head@freebsd.org Wed Aug 31 15:05: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 76453BCA1A4; Wed, 31 Aug 2016 15:05:07 +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 43932839; Wed, 31 Aug 2016 15:05:07 +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 u7VF56Un071379; Wed, 31 Aug 2016 15:05:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VF54mS071361; Wed, 31 Aug 2016 15:05:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608311505.u7VF54mS071361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 Aug 2016 15:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305130 - in head: contrib/elftoolchain/common contrib/elftoolchain/elfcopy contrib/elftoolchain/elfdump contrib/elftoolchain/libelf contrib/elftoolchain/libelftc contrib/elftoolchain/r... 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.22 Precedence: list List-Id: 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, 31 Aug 2016 15:05:07 -0000 Author: emaste Date: Wed Aug 31 15:05:04 2016 New Revision: 305130 URL: https://svnweb.freebsd.org/changeset/base/305130 Log: Update to ELF Tool Chain r3490 Improvements include: * readelf: report all relocation types in rel/rela for MIPS N64 * readelf: add ELFOSABI_ARM_AEABI * elfdump: add ELFOSABI_ARM_AEABI and ELFOSABI_ARM * Add recent RISC-V relocations * elfcopy: use elftc_timestamp, to support SOURCE_DATE_EPOCH Sponsored by: The FreeBSD Foundation Added: head/contrib/elftoolchain/libelftc/elftc_timestamp.3 - copied unchanged from r305126, vendor/elftoolchain/dist/libelftc/elftc_timestamp.3 head/contrib/elftoolchain/libelftc/elftc_timestamp.c - copied unchanged from r305126, vendor/elftoolchain/dist/libelftc/elftc_timestamp.c Modified: head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/elfcopy/archive.c head/contrib/elftoolchain/elfcopy/ascii.c head/contrib/elftoolchain/elfcopy/pe.c head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/libelf/elf_flagdata.3 head/contrib/elftoolchain/libelftc/Makefile head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c head/contrib/elftoolchain/libelftc/libelftc.h head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c head/contrib/elftoolchain/readelf/readelf.1 head/contrib/elftoolchain/readelf/readelf.c head/lib/libelftc/Makefile head/lib/libelftc/elftc_version.c Directory Properties: head/contrib/elftoolchain/ (props changed) head/contrib/elftoolchain/elfdump/ (props changed) Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/common/elfdefinitions.h Wed Aug 31 15:05:04 2016 (r305130) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3455 2016-05-09 13:47:29Z emaste $ + * $Id: elfdefinitions.h 3485 2016-08-18 13:38:52Z emaste $ */ /* @@ -2091,7 +2091,10 @@ _ELF_DEFINE_RELOC(R_RISCV_GNU_VTINHERIT, _ELF_DEFINE_RELOC(R_RISCV_GNU_VTENTRY, 42) \ _ELF_DEFINE_RELOC(R_RISCV_ALIGN, 43) \ _ELF_DEFINE_RELOC(R_RISCV_RVC_BRANCH, 44) \ -_ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45) +_ELF_DEFINE_RELOC(R_RISCV_RVC_JUMP, 45) \ +_ELF_DEFINE_RELOC(R_RISCV_RVC_LUI, 46) \ +_ELF_DEFINE_RELOC(R_RISCV_GPREL_I, 47) \ +_ELF_DEFINE_RELOC(R_RISCV_GPREL_S, 48) #define _ELF_DEFINE_SPARC_RELOCATIONS() \ _ELF_DEFINE_RELOC(R_SPARC_NONE, 0) \ Modified: head/contrib/elftoolchain/elfcopy/archive.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/archive.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/elfcopy/archive.c Wed Aug 31 15:05:04 2016 (r305130) @@ -38,7 +38,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: archive.c 3287 2015-12-31 16:58:48Z emaste $"); +ELFTC_VCSID("$Id: archive.c 3490 2016-08-31 00:12:22Z emaste $"); #define _ARMAG_LEN 8 /* length of ar magic string */ #define _ARHDR_LEN 60 /* length of ar header */ @@ -440,6 +440,7 @@ ac_write_objs(struct elfcopy *ecp, int o struct archive *a; struct archive_entry *entry; struct ar_obj *obj; + time_t timestamp; int nr; if ((a = archive_write_new()) == NULL) @@ -450,7 +451,9 @@ ac_write_objs(struct elfcopy *ecp, int o /* Write the archive symbol table, even if it's empty. */ entry = archive_entry_new(); archive_entry_copy_pathname(entry, "/"); - archive_entry_set_mtime(entry, time(NULL), 0); + if (elftc_timestamp(×tamp) != 0) + err(EXIT_FAILURE, "elftc_timestamp"); + archive_entry_set_mtime(entry, timestamp, 0); archive_entry_set_size(entry, (ecp->s_cnt + 1) * sizeof(uint32_t) + ecp->s_sn_sz); AC(archive_write_header(a, entry)); Modified: head/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/ascii.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/elfcopy/ascii.c Wed Aug 31 15:05:04 2016 (r305130) @@ -36,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: ascii.c 3446 2016-05-03 01:31:17Z emaste $"); +ELFTC_VCSID("$Id: ascii.c 3487 2016-08-24 18:12:08Z emaste $"); static void append_data(struct section *s, const void *buf, size_t sz); static char hex_digit(uint8_t n); @@ -251,7 +251,7 @@ create_elf_from_srec(struct elfcopy *ecp sec_index = 1; sec_addr = entry = 0; while (fgets(line, _LINE_BUFSZ, ifp) != NULL) { - sz = 0; /* Silence GCC 5.3 uninitialized variable warning */ + sz = 0; if (line[0] == '\r' || line[0] == '\n') continue; if (line[0] == '$' && line[1] == '$') { Modified: head/contrib/elftoolchain/elfcopy/pe.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/pe.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/elfcopy/pe.c Wed Aug 31 15:05:04 2016 (r305130) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: pe.c 3477 2016-05-25 20:00:42Z kaiwang27 $"); +ELFTC_VCSID("$Id: pe.c 3490 2016-08-31 00:12:22Z emaste $"); /* Convert ELF object to Portable Executable (PE). */ void @@ -54,6 +54,7 @@ create_pe(struct elfcopy *ecp, int ifd, PE_Buffer *pb; const char *name; size_t indx; + time_t timestamp; int elferr; if (ecp->otf == ETF_EFI || ecp->oem == EM_X86_64) @@ -89,7 +90,9 @@ create_pe(struct elfcopy *ecp, int ifd, pch.ch_machine = IMAGE_FILE_MACHINE_UNKNOWN; break; } - pch.ch_timestamp = (uint32_t) time(NULL); + if (elftc_timestamp(×tamp) != 0) + err(EXIT_FAILURE, "elftc_timestamp"); + pch.ch_timestamp = (uint32_t) timestamp; if (pe_update_coff_header(pe, &pch) < 0) err(EXIT_FAILURE, "pe_update_coff_header() failed"); Modified: head/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- head/contrib/elftoolchain/elfdump/elfdump.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/elfdump/elfdump.c Wed Aug 31 15:05:04 2016 (r305130) @@ -50,7 +50,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: elfdump.c 3474 2016-05-17 20:44:53Z emaste $"); +ELFTC_VCSID("$Id: elfdump.c 3482 2016-08-02 18:47:00Z emaste $"); #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" @@ -332,6 +332,8 @@ static const char *ei_abis[256] = { "ELFOSABI_IRIX", "ELFOSABI_FREEBSD", "ELFOSABI_TRU64", "ELFOSABI_MODESTO", "ELFOSABI_OPENBSD", [17] = "ELFOSABI_CLOUDABI", + [64] = "ELFOSABI_ARM_AEABI", + [97] = "ELFOSABI_ARM", [255] = "ELFOSABI_STANDALONE" }; Modified: head/contrib/elftoolchain/libelf/elf_flagdata.3 ============================================================================== --- head/contrib/elftoolchain/libelf/elf_flagdata.3 Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/libelf/elf_flagdata.3 Wed Aug 31 15:05:04 2016 (r305130) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_flagdata.3 2884 2013-01-11 02:03:46Z jkoshy $ +.\" $Id: elf_flagdata.3 3479 2016-06-25 20:44:33Z jkoshy $ .\" .Dd December 3, 2011 .Os @@ -208,16 +208,13 @@ was called without a program header bein .Xr elf 3 , .Xr elf32_newehdr 3 , .Xr elf32_newphdr 3 , -.Xr elf32_newshdr 3 , .Xr elf64_newehdr 3 , .Xr elf64_newphdr 3 , -.Xr elf64_newshdr 3 , .Xr elf_newdata 3 , .Xr elf_update 3 , .Xr gelf 3 , .Xr gelf_newehdr 3 , .Xr gelf_newphdr 3 , -.Xr gelf_newshdr 3 , .Xr gelf_update_dyn 3 , .Xr gelf_update_move 3 , .Xr gelf_update_rel 3 , Modified: head/contrib/elftoolchain/libelftc/Makefile ============================================================================== --- head/contrib/elftoolchain/libelftc/Makefile Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/libelftc/Makefile Wed Aug 31 15:05:04 2016 (r305130) @@ -1,4 +1,4 @@ -# $Id: Makefile 3418 2016-02-19 20:04:42Z emaste $ +# $Id: Makefile 3489 2016-08-31 00:12:15Z emaste $ TOP= ${.CURDIR}/.. @@ -10,6 +10,7 @@ SRCS= elftc_bfdtarget.c \ elftc_reloc_type_str.c \ elftc_set_timestamps.c \ elftc_string_table.c \ + elftc_timestamp.c \ elftc_version.c \ libelftc_bfdtarget.c \ libelftc_dem_arm.c \ Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Wed Aug 31 15:05:04 2016 (r305130) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_bfd_find_target.3 3348 2016-01-18 14:18:50Z emaste $ +.\" $Id: elftc_bfd_find_target.3 3488 2016-08-24 18:15:57Z emaste $ .\" .Dd November 30, 2011 .Os Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Wed Aug 31 15:05:04 2016 (r305130) @@ -545,6 +545,9 @@ elftc_reloc_type_str(unsigned int mach, case 43: return "R_RISCV_ALIGN"; case 44: return "R_RISCV_RVC_BRANCH"; case 45: return "R_RISCV_RVC_JUMP"; + case 46: return "R_RISCV_RVC_LUI"; + case 47: return "R_RISCV_GPREL_I"; + case 48: return "R_RISCV_GPREL_S"; } break; case EM_SPARC: Copied: head/contrib/elftoolchain/libelftc/elftc_timestamp.3 (from r305126, vendor/elftoolchain/dist/libelftc/elftc_timestamp.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/libelftc/elftc_timestamp.3 Wed Aug 31 15:05:04 2016 (r305130, copy of r305126, vendor/elftoolchain/dist/libelftc/elftc_timestamp.3) @@ -0,0 +1,79 @@ +.\" Copyright (c) 2016 The FreeBSD Foundation. All rights reserved. +.\" +.\" This documentation was written by Ed Maste under sponsorship of +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" This software is provided by the author and contributors ``as is'' and +.\" any express or implied warranties, including, but not limited to, the +.\" implied warranties of merchantability and fitness for a particular purpose +.\" are disclaimed. In no event shall the author or contributors be liable +.\" for any direct, indirect, incidental, special, exemplary, or consequential +.\" damages (including, but not limited to, procurement of substitute goods +.\" or services; loss of use, data, or profits; or business interruption) +.\" however caused and on any theory of liability, whether in contract, strict +.\" liability, or tort (including negligence or otherwise) arising in any way +.\" out of the use of this software, even if advised of the possibility of +.\" such damage. +.\" +.\" $Id$ +.\" +.Dd August 24, 2016 +.Os +.Dt ELFTC_TIMESTAMP 3 +.Sh NAME +.Nm elftc_timestamp +.Nd return the current or environment-provided timestamp +.Sh LIBRARY +.Lb libelftc +.Sh SYNOPSIS +.In libelftc.h +.Ft int +.Fo elftc_timestamp +.Fa "time_t *timestamp" +.Fc +.Sh DESCRIPTION +The +.Fn elftc_timestamp +function returns a timestamp supplied by the +.Ev SOURCE_DATE_EPOCH +environment variable, or the current time provided by +.Xr time 3 +if the environment variable is not set. +.Pp +The +.Ar timestamp +argument specifies a pointer to the location where the timestamp will be +stored. +.Sh RETURN VALUE +Function +.Fn elftc_timestamp +returns 0 on success, and -1 in the event of an error. +.Sh ERRORS +The +.Fn elftc_timestamp +function may fail with the following errors: +.Bl -tag -width ".Bq Er ERANGE" +.It Bq Er EINVAL +.Ev SOURCE_DATE_EPOCH +contains invalid characters. +.It Bq Er ERANGE +.Ev SOURCE_DATE_EPOCH +specifies a negative value or a value that cannot be stored in a +time_t. +.El +The +.Fn elftc_timestamp +function may also fail for any of the reasons described in +.Xr strtoll 3 . +.Sh SEE ALSO +.Xr strtoll 3 , +.Xr time 3 Copied: head/contrib/elftoolchain/libelftc/elftc_timestamp.c (from r305126, vendor/elftoolchain/dist/libelftc/elftc_timestamp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/libelftc/elftc_timestamp.c Wed Aug 31 15:05:04 2016 (r305130, copy of r305126, vendor/elftoolchain/dist/libelftc/elftc_timestamp.c) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Ed Maste under sponsorship + * of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include + +int +elftc_timestamp(time_t *timestamp) +{ + long long source_date_epoch; + char *env, *eptr; + + if ((env = getenv("SOURCE_DATE_EPOCH")) != NULL) { + errno = 0; + source_date_epoch = strtoll(env, &eptr, 10); + if (*eptr != '\0') + errno = EINVAL; + if (source_date_epoch < 0) + errno = ERANGE; + if (errno != 0) + return (-1); + *timestamp = source_date_epoch; + return (0); + } + *timestamp = time(NULL); + return (0); +} Modified: head/contrib/elftoolchain/libelftc/libelftc.h ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc.h Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/libelftc/libelftc.h Wed Aug 31 15:05:04 2016 (r305130) @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: users/kaiwang27/elftc/libelftc.h 392 2009-05-31 19:17:46Z kaiwang27 $ - * $Id: libelftc.h 3418 2016-02-19 20:04:42Z emaste $ + * $Id: libelftc.h 3489 2016-08-31 00:12:15Z emaste $ */ #ifndef _LIBELFTC_H_ @@ -91,6 +91,7 @@ int elftc_string_table_remove(Elftc_Str const char *_string); const char *elftc_string_table_to_string(Elftc_String_Table *_table, size_t offset); +int elftc_timestamp(time_t *_timestamp); const char *elftc_version(void); #ifdef __cplusplus } Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Wed Aug 31 15:05:04 2016 (r305130) @@ -30,7 +30,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3309 2016-01-10 09:10:51Z kaiwang27 $"); +ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3488 2016-08-24 18:15:57Z emaste $"); struct _Elftc_Bfd_Target _libelftc_targets[] = { Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Wed Aug 31 15:05:04 2016 (r305130) @@ -36,7 +36,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3447 2016-05-03 13:32:23Z emaste $"); +ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3480 2016-07-24 23:38:41Z emaste $"); /** * @file cpp_demangle.c Modified: head/contrib/elftoolchain/readelf/readelf.1 ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.1 Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/readelf/readelf.1 Wed Aug 31 15:05:04 2016 (r305130) @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: readelf.1 3219 2015-05-24 23:42:34Z kaiwang27 $ +.\" $Id: readelf.1 3486 2016-08-22 14:10:05Z emaste $ .\" .Dd September 13, 2012 .Os @@ -43,12 +43,12 @@ .Op Fl p Ar section | Fl -string-dump Ns = Ns Ar section .Op Fl r | Fl -relocs .Op Fl t | Fl -section-details -.Op Fl x Ar section | Fl -hex-dump Ns = Ns Ar section .Op Fl v | Fl -version .Oo .Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc | .Fl -debug-dump Ns Op Ns = Ns Ar long-option-name , Ns ... .Oc +.Op Fl x Ar section | Fl -hex-dump Ns = Ns Ar section .Op Fl A | Fl -arch-specific .Op Fl D | Fl -use-dynamic .Op Fl H | Fl -help Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Aug 31 15:05:04 2016 (r305130) @@ -47,7 +47,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: readelf.c 3469 2016-05-15 23:16:09Z emaste $"); +ELFTC_VCSID("$Id: readelf.c 3484 2016-08-03 13:36:49Z emaste $"); /* Backwards compatability for older FreeBSD releases. */ #ifndef STB_GNU_UNIQUE @@ -440,6 +440,7 @@ elf_osabi(unsigned int abi) case ELFOSABI_OPENVMS: return "OpenVMS"; case ELFOSABI_NSK: return "NSK"; case ELFOSABI_CLOUDABI: return "CloudABI"; + case ELFOSABI_ARM_AEABI: return "ARM EABI"; case ELFOSABI_ARM: return "ARM"; case ELFOSABI_STANDALONE: return "StandAlone"; default: @@ -2787,6 +2788,8 @@ dump_rel(struct readelf *re, struct sect const char *symname; uint64_t symval; int i, len; + uint32_t type; + uint8_t type2, type3; if (s->link >= re->shnum) return; @@ -2796,8 +2799,8 @@ dump_rel(struct readelf *re, struct sect elftc_reloc_type_str(re->ehdr.e_machine, \ ELF32_R_TYPE(r.r_info)), (uintmax_t)symval, symname #define REL_CT64 (uintmax_t)r.r_offset, (uintmax_t)r.r_info, \ - elftc_reloc_type_str(re->ehdr.e_machine, \ - ELF64_R_TYPE(r.r_info)), (uintmax_t)symval, symname + elftc_reloc_type_str(re->ehdr.e_machine, type), \ + (uintmax_t)symval, symname printf("\nRelocation section (%s):\n", s->name); if (re->ec == ELFCLASS32) @@ -2823,12 +2826,35 @@ dump_rel(struct readelf *re, struct sect ELF64_R_TYPE(r.r_info)); printf("%8.8jx %8.8jx %-19.19s %8.8jx %s\n", REL_CT32); } else { + type = ELF64_R_TYPE(r.r_info); + if (re->ehdr.e_machine == EM_MIPS) { + type2 = (type >> 8) & 0xFF; + type3 = (type >> 16) & 0xFF; + type = type & 0xFF; + } if (re->options & RE_WW) printf("%16.16jx %16.16jx %-24.24s" " %16.16jx %s\n", REL_CT64); else printf("%12.12jx %12.12jx %-19.19s" " %16.16jx %s\n", REL_CT64); + if (re->ehdr.e_machine == EM_MIPS) { + if (re->options & RE_WW) { + printf("%32s: %s\n", "Type2", + elftc_reloc_type_str(EM_MIPS, + type2)); + printf("%32s: %s\n", "Type3", + elftc_reloc_type_str(EM_MIPS, + type3)); + } else { + printf("%24s: %s\n", "Type2", + elftc_reloc_type_str(EM_MIPS, + type2)); + printf("%24s: %s\n", "Type3", + elftc_reloc_type_str(EM_MIPS, + type3)); + } + } } } @@ -2843,6 +2869,8 @@ dump_rela(struct readelf *re, struct sec const char *symname; uint64_t symval; int i, len; + uint32_t type; + uint8_t type2, type3; if (s->link >= re->shnum) return; @@ -2853,8 +2881,8 @@ dump_rela(struct readelf *re, struct sec elftc_reloc_type_str(re->ehdr.e_machine, \ ELF32_R_TYPE(r.r_info)), (uintmax_t)symval, symname #define RELA_CT64 (uintmax_t)r.r_offset, (uintmax_t)r.r_info, \ - elftc_reloc_type_str(re->ehdr.e_machine, \ - ELF64_R_TYPE(r.r_info)), (uintmax_t)symval, symname + elftc_reloc_type_str(re->ehdr.e_machine, type), \ + (uintmax_t)symval, symname printf("\nRelocation section with addend (%s):\n", s->name); if (re->ec == ELFCLASS32) @@ -2881,6 +2909,12 @@ dump_rela(struct readelf *re, struct sec printf("%8.8jx %8.8jx %-19.19s %8.8jx %s", RELA_CT32); printf(" + %x\n", (uint32_t) r.r_addend); } else { + type = ELF64_R_TYPE(r.r_info); + if (re->ehdr.e_machine == EM_MIPS) { + type2 = (type >> 8) & 0xFF; + type3 = (type >> 16) & 0xFF; + type = type & 0xFF; + } if (re->options & RE_WW) printf("%16.16jx %16.16jx %-24.24s" " %16.16jx %s", RELA_CT64); @@ -2888,6 +2922,23 @@ dump_rela(struct readelf *re, struct sec printf("%12.12jx %12.12jx %-19.19s" " %16.16jx %s", RELA_CT64); printf(" + %jx\n", (uintmax_t) r.r_addend); + if (re->ehdr.e_machine == EM_MIPS) { + if (re->options & RE_WW) { + printf("%32s: %s\n", "Type2", + elftc_reloc_type_str(EM_MIPS, + type2)); + printf("%32s: %s\n", "Type3", + elftc_reloc_type_str(EM_MIPS, + type3)); + } else { + printf("%24s: %s\n", "Type2", + elftc_reloc_type_str(EM_MIPS, + type2)); + printf("%24s: %s\n", "Type3", + elftc_reloc_type_str(EM_MIPS, + type3)); + } + } } } Modified: head/lib/libelftc/Makefile ============================================================================== --- head/lib/libelftc/Makefile Wed Aug 31 14:49:58 2016 (r305129) +++ head/lib/libelftc/Makefile Wed Aug 31 15:05:04 2016 (r305130) @@ -16,6 +16,7 @@ SRCS= elftc_bfdtarget.c elftc_reloc_type_str.c \ elftc_set_timestamps.c \ elftc_string_table.c \ + elftc_timestamp.c \ elftc_version.c \ libelftc_bfdtarget.c \ libelftc_dem_arm.c \ Modified: head/lib/libelftc/elftc_version.c ============================================================================== --- head/lib/libelftc/elftc_version.c Wed Aug 31 14:49:58 2016 (r305129) +++ head/lib/libelftc/elftc_version.c Wed Aug 31 15:05:04 2016 (r305130) @@ -6,5 +6,5 @@ const char * elftc_version(void) { - return "elftoolchain r3477M"; + return "elftoolchain r3490M"; } From owner-svn-src-head@freebsd.org Wed Aug 31 15:11: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 4FF70BCA3A5; Wed, 31 Aug 2016 15:11:28 +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 0A6DAD31; Wed, 31 Aug 2016 15:11:28 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bf7Ai-000PD4-2K; Wed, 31 Aug 2016 18:11:24 +0300 Date: Wed, 31 Aug 2016 18:11:24 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160831151123.GW88122@zxy.spb.ru> References: <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> <20160827004617.GJ88122@zxy.spb.ru> <20160828133012.GN88122@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.22 Precedence: list List-Id: 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, 31 Aug 2016 15:11:28 -0000 On Sun, Aug 28, 2016 at 10:20:08AM -0700, Adrian Chadd wrote: > Hi, > > There are some no brainers here so far(tm): > > working from the bottom up: > > * yeah, the ixgbe locking is a bit silly. Kip's work with iflib and > converting ixgbe to use that instead of its own locking for managing > things should remove the bottom two locks > * the rtalloc1_fib thing - that's odd, because it shouldn't be > contending there unless there's some temporary redirect that's been > learnt. What's the routing table look like on your machine? I Remember As I understund this code: === static struct radix_node * in_matroute(void *v_arg, struct radix_node_head *head) { struct radix_node *rn = rn_match(v_arg, head); struct rtentry *rt = (struct rtentry *)rn; if (rt) { RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; rt->rt_expire = 0; } RT_UNLOCK(rt); } return rn; } === lock congestion will be created for any route: for any route captured captured exclusive lock (for test). From owner-svn-src-head@freebsd.org Wed Aug 31 15:28: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 26101BCA87E; Wed, 31 Aug 2016 15:28:39 +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 DE0E7A1A; Wed, 31 Aug 2016 15:28:38 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bf7RM-000Pax-13; Wed, 31 Aug 2016 18:28:36 +0300 Date: Wed, 31 Aug 2016 18:28:35 +0300 From: Slawa Olhovchenkov To: "George V. Neville-Neil" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297225 - in head/sys: net netinet netinet6 Message-ID: <20160831152835.GY22212@zxy.spb.ru> References: <201603240754.u2O7suvM006925@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603240754.u2O7suvM006925@repo.freebsd.org> 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.22 Precedence: list List-Id: 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, 31 Aug 2016 15:28:39 -0000 On Thu, Mar 24, 2016 at 07:54:56AM +0000, George V. Neville-Neil wrote: > Author: gnn > Date: Thu Mar 24 07:54:56 2016 > New Revision: 297225 > URL: https://svnweb.freebsd.org/changeset/base/297225 > > Log: > FreeBSD previously provided route caching for TCP (and UDP). Re-add > route caching for TCP, with some improvements. In particular, invalidate > the route cache if a new route is added, which might be a better match. > The cache is automatically invalidated if the old route is deleted. > > Submitted by: Mike Karels > Reviewed by: gnn > Differential Revision: https://reviews.freebsd.org/D4306 Can this mergered to stable/10 (in private branch, I mean ABI breakage)? Have any dependecis of this commit? From owner-svn-src-head@freebsd.org Wed Aug 31 15:32: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 76A48BCAA66; Wed, 31 Aug 2016 15:32:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47535F6B; Wed, 31 Aug 2016 15:32:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VFWqcD082580; Wed, 31 Aug 2016 15:32:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VFWqbe082579; Wed, 31 Aug 2016 15:32:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201608311532.u7VFWqbe082579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 31 Aug 2016 15:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305132 - head/sys/boot/forth 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.22 Precedence: list List-Id: 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, 31 Aug 2016 15:32:53 -0000 Author: imp Date: Wed Aug 31 15:32:52 2016 New Revision: 305132 URL: https://svnweb.freebsd.org/changeset/base/305132 Log: Remove accidentally committed stray comment. Noticed by: dteske@ Modified: head/sys/boot/forth/loader.4th Modified: head/sys/boot/forth/loader.4th ============================================================================== --- head/sys/boot/forth/loader.4th Wed Aug 31 15:06:24 2016 (r305131) +++ head/sys/boot/forth/loader.4th Wed Aug 31 15:32:52 2016 (r305132) @@ -167,8 +167,7 @@ only forth definitions also support-func \ \ Overrides support.4th initialization word with one that does \ everything start one does, short of loading the kernel and -\ modules. Returns a flag. Unsure why we don't just have start -\ call this... +\ modules. Returns a flag. : initialize ( -- flag ) s" /boot/defaults/loader.conf" initialize From owner-svn-src-head@freebsd.org Wed Aug 31 15:38: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 ECAF9BCAB85; Wed, 31 Aug 2016 15:38:39 +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 B7D64805; Wed, 31 Aug 2016 15:38:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id E3C907883A8; Thu, 1 Sep 2016 01:38:31 +1000 (AEST) Date: Thu, 1 Sep 2016 01:38:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305129 - head/sys/vm In-Reply-To: <201608311449.u7VEnwlq064219@repo.freebsd.org> Message-ID: <20160901011048.T45881@besplex.bde.org> References: <201608311449.u7VEnwlq064219@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=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=WAYQV6Fnp0Brtd7ixUAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 15:38:40 -0000 On Wed, 31 Aug 2016, Konstantin Belousov wrote: > Log: > Make swapoff reliable. > > The swap_pager_swapoff() function uses trylock for the object lock > before pagein, which means that either i/o to md(4) over swap, or > intensive page faults over swap pager objects might prevent swapoff() > from making any progress. Then the retry < 100 check fails and machine > panics. > > If trylock fails, acquire the object lock in the blockable way and > restart the hash bucket walk. Keep retries logic for now. Trylock is difficult to use. When it fails, there is no way for the caller to tell how long it should wait before retrying (much like EAGAIN errors for userland). Sometimes there is deadlock so retrying is worse than useless. Sometimes trylock can detect deadlock, but callers never can (otherwise they wouldn't try). My version of mtx_trylock_spin_flags() has a timeout in usec. It returns immediately if deadlock is detected. The timeout is just for convenience in simple cases where the caller want to aquire the lock normally but doesn't want the unbounded timeout or panic given by mtx_trylock_spin(). The important thing is to return error codes like: - EDEADLK for deadlock detected (e.g., when the CPU running the thread holding the lock is stopped) - EMAYBEDEADLK when deadlock is almost detected (e.g., when CPUs are being stopped) - EAGAIN when no problem is detected but the lock is held - ERECURSE when the lock is held but acquiring it recursively would work if the caller asked for that - ELOR if acquiring the lock would work but give a LOR, and the caller didn't ask for LORs. The current return value is positive logic for success and doesn't allow returning error codes. In my applications in console drivers, the caller doesn't want the lock if it would give a LOR. Without WITNESS, it is too hard to tell if the lock would give a LOR, but some errors are easy to detect. E.g., acquiring sleep lock in a critical section. Bruce From owner-svn-src-head@freebsd.org Wed Aug 31 15:48: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 10C49BCAE65; Wed, 31 Aug 2016 15:48:00 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D48BB15F; Wed, 31 Aug 2016 15:47:59 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VFlxVB086519; Wed, 31 Aug 2016 15:47:59 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VFlxRg086518; Wed, 31 Aug 2016 15:47:59 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608311547.u7VFlxRg086518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 31 Aug 2016 15:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305133 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 15:48:00 -0000 Author: ache Date: Wed Aug 31 15:47:58 2016 New Revision: 305133 URL: https://svnweb.freebsd.org/changeset/base/305133 Log: Apply the same qsort() usage fix as in r304911 getaddrinfo.c qsort() can't be stabilized with just return(-1) alone. MFC after: 3 days Modified: head/lib/libc/net/name6.c Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Wed Aug 31 15:32:52 2016 (r305132) +++ head/lib/libc/net/name6.c Wed Aug 31 15:47:58 2016 (r305133) @@ -185,6 +185,7 @@ struct hp_order { #define aio_sa aio_un.aiou_sa int aio_matchlen; char *aio_h_addr; + int aio_initial_sequence; }; static struct hostent *_hpcopy(struct hostent *, int *); @@ -711,6 +712,7 @@ _hpreorder(struct hostent *hp) aio[i].aio_dstscope = gai_addr2scopetype(sa); aio[i].aio_dstpolicy = match_addrselectpolicy(sa, &policyhead); set_source(&aio[i], &policyhead); + aio[i].aio_initial_sequence = i; } /* perform sorting. */ @@ -1045,6 +1047,23 @@ comp_dst(const void *arg1, const void *a } /* Rule 10: Otherwise, leave the order unchanged. */ + + /* + * Note that qsort is unstable; so, we can't return zero and + * expect the order to be unchanged. + * That also means we can't depend on the current position of + * dst2 being after dst1. We must enforce the initial order + * with an explicit compare on the original position. + * The qsort specification requires that "When the same objects + * (consisting of width bytes, irrespective of their current + * positions in the array) are passed more than once to the + * comparison function, the results shall be consistent with one + * another." + * In other words, If A < B, then we must also return B > A. + */ + if (dst2->aio_initial_sequence < dst1->aio_initial_sequence) + return(1); + return(-1); } From owner-svn-src-head@freebsd.org Wed Aug 31 16:39: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 00C39BCAC61; Wed, 31 Aug 2016 16:39:50 +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 9F22EFE7; Wed, 31 Aug 2016 16:39:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7VGdhj7096286 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 31 Aug 2016 19:39:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7VGdhj7096286 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7VGdhav096285; Wed, 31 Aug 2016 19:39:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 31 Aug 2016 19:39:43 +0300 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305129 - head/sys/vm Message-ID: <20160831163943.GE83214@kib.kiev.ua> References: <201608311449.u7VEnwlq064219@repo.freebsd.org> <20160901011048.T45881@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160901011048.T45881@besplex.bde.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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.22 Precedence: list List-Id: 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, 31 Aug 2016 16:39:50 -0000 On Thu, Sep 01, 2016 at 01:38:31AM +1000, Bruce Evans wrote: > On Wed, 31 Aug 2016, Konstantin Belousov wrote: > > > Log: > > Make swapoff reliable. > > > > The swap_pager_swapoff() function uses trylock for the object lock > > before pagein, which means that either i/o to md(4) over swap, or > > intensive page faults over swap pager objects might prevent swapoff() > > from making any progress. Then the retry < 100 check fails and machine > > panics. > > > > If trylock fails, acquire the object lock in the blockable way and > > restart the hash bucket walk. Keep retries logic for now. > > Trylock is difficult to use. When it fails, there is no way for the > caller to tell how long it should wait before retrying (much like EAGAIN > errors for userland). Sometimes there is deadlock so retrying is worse > than useless. Sometimes trylock can detect deadlock, but callers never > can (otherwise they wouldn't try). It is actually a way for the caller to tell how long to wait. The lock should be taken in blockable or sleepable way. Issue is that we have to drop other locks, to avoid LOR, and restart the algorithm. This approach, i.e. try fast to get lock with trylock, and do the slow reset on failure with the required lock already held or not, is very common pattern. E.g. it is used in vm_fault() to handle LOR between vnode lock and vm map lock, it is used in ufs_rename() to avoid LORs between all vnode locks participating in rename, and in many other places. > > My version of mtx_trylock_spin_flags() has a timeout in usec. It returns > immediately if deadlock is detected. The timeout is just for convenience > in simple cases where the caller want to aquire the lock normally but > doesn't want the unbounded timeout or panic given by > mtx_trylock_spin(). The important thing is to return error codes like: > - EDEADLK for deadlock detected (e.g., when the CPU running the thread > holding the lock is stopped) > - EMAYBEDEADLK when deadlock is almost detected (e.g., when CPUs are being > stopped) > - EAGAIN when no problem is detected but the lock is held > - ERECURSE when the lock is held but acquiring it recursively would work > if the caller asked for that > - ELOR if acquiring the lock would work but give a LOR, and the caller didn't > ask for LORs. > > The current return value is positive logic for success and doesn't allow > returning error codes. Your use of trylock for console locks is very specific. It is implied by the intent of console output working in any context, which is not needed for typical trylock usage. > > In my applications in console drivers, the caller doesn't want the lock if > it would give a LOR. Without WITNESS, it is too hard to tell if the lock > would give a LOR, but some errors are easy to detect. E.g., acquiring > sleep lock in a critical section. Indeed. From owner-svn-src-head@freebsd.org Wed Aug 31 16:54: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 30C09BCA1E6; Wed, 31 Aug 2016 16:54:13 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBA28CC0; Wed, 31 Aug 2016 16:54:12 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x242.google.com with SMTP id f128so6295611ith.2; Wed, 31 Aug 2016 09:54:12 -0700 (PDT) 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; bh=xFkkRqEdsJH1TJKiQ22XRLIX//Tr69atx6WdkQBb2c4=; b=C3oacWEcSnXpBaopMGwG+0UdVPOV6qDAsBc6j2bh6FDZhb+LX1IDom2PkHhmNrjMyC sgwdfMWsLusF1+fcu+jUCNSs8lULinydvQ8YZnXqoXqHgpbs4CZVglXbiyr5uwLg0ZEe khPbiVovMlS4C4ZeMmTMvx4/IdKGDXlqdbocIyk4eRYYB5j/tyAaInrgzMJsJgwq0+6m didpz6kqlaLA6Ogd/DS5o89etUeHYg+7UepQ9HAVP957Zqx4a+OHCfFBrGFTlZCwyjQM Lg02SizR0ddfYXGCe81UywMS7jwbMT+mez1sRYSbCQ1zsFfNBm+pXTZR0C9vNs4P5788 17fw== 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; bh=xFkkRqEdsJH1TJKiQ22XRLIX//Tr69atx6WdkQBb2c4=; b=HrFIdv3pkhhjE8RkbBVOcYyVaSaAqZLpCcvIuNFXyEY8TVNd6ypSd2MG+R/byhwYSf 9gq5j41dvwJA4cOdhzgH3edSO2GcrBgOwRw3UmdKseh8R1S7wG6sdCwiAYl4LZYdGTIc 93bzyS+iHgDQd+0DGB0O1AmhJLHIg174ZZFHia34V8J+qaiAEy9ccjWt6KO4DEwIvEcD 3S2lk5UWYhLaAkplCR7Qnc39Y170pHcbLLXQX2Ge05pY/Qmo8cmRWuUIwk01Z/JZEMYz C4dXKYlAJsLOs9tDG5Qo2Fy3mwuu99zdzduuuxHhdWXBqUMBu13/3E9ZBTXnB30Jpvuk aPwQ== X-Gm-Message-State: AE9vXwPNKlP34qISF5WHDKqFE26dv4ikCsnqzq+nl+TJoIadte8kUf8hSKxEIPL3oCFqSV8TGI8vV2wP0WEBJA== X-Received: by 10.36.111.209 with SMTP id x200mr30939066itb.59.1472662452116; Wed, 31 Aug 2016 09:54:12 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.138.28 with HTTP; Wed, 31 Aug 2016 09:53:51 -0700 (PDT) In-Reply-To: <201608200008.u7K08Bok069627@repo.freebsd.org> References: <201608200008.u7K08Bok069627@repo.freebsd.org> From: Ed Maste Date: Wed, 31 Aug 2016 12:53:51 -0400 X-Google-Sender-Auth: sPdXelMF2lJp660_cV6isLz7gkY Message-ID: Subject: Re: svn commit: r304510 - head/sys/dev/ixl To: Eric Joyner 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.22 Precedence: list List-Id: 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, 31 Aug 2016 16:54:13 -0000 On 19 August 2016 at 20:08, Eric Joyner wrote: > Author: erj > Date: Sat Aug 20 00:08:10 2016 > New Revision: 304510 > URL: https://svnweb.freebsd.org/changeset/base/304510 > > Log: > ixlv(4): Fix ixlv(4) not loading when loaded as a kernel module and netmap is enabled. I did not confirm it's this commit, but kernel builds currently have this warning: if_ixlv.o: warning: common of `ixl_crcstrip' overridden by definition if_ixl.o: warning: defined here if_ixlv.o: warning: multiple common of `ixl_rx_miss' if_ixl.o: warning: previous common is here if_ixlv.o: warning: multiple common of `ixl_rx_miss_bufs' if_ixl.o: warning: previous common is here From owner-svn-src-head@freebsd.org Wed Aug 31 16:56: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 4A972BCA30C; Wed, 31 Aug 2016 16:56:56 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 14358ED7; Wed, 31 Aug 2016 16:56:56 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VGutEm013428; Wed, 31 Aug 2016 16:56:55 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VGusND013419; Wed, 31 Aug 2016 16:56:54 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608311656.u7VGusND013419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 31 Aug 2016 16:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305134 - in head/sys/boot/fdt/dts: . 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.22 Precedence: list List-Id: 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, 31 Aug 2016 16:56:56 -0000 Author: jmcneill Date: Wed Aug 31 16:56:54 2016 New Revision: 305134 URL: https://svnweb.freebsd.org/changeset/base/305134 Log: Add Allwinner A64 (sun50i) and Pine64 dts files. Reviewed by: andrew, imp, manu, wca Differential Revision: https://reviews.freebsd.org/D7169 Added: head/sys/boot/fdt/dts/arm64/ head/sys/boot/fdt/dts/arm64/Makefile (contents, props changed) head/sys/boot/fdt/dts/arm64/a64.dtsi (contents, props changed) head/sys/boot/fdt/dts/arm64/pine64_plus.dts (contents, props changed) head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64-common.dtsi (contents, props changed) head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64-plus.dts (contents, props changed) head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64.dts (contents, props changed) head/sys/boot/fdt/dts/arm64/sun50i-a64.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/Makefile Modified: head/sys/boot/fdt/dts/Makefile ============================================================================== --- head/sys/boot/fdt/dts/Makefile Wed Aug 31 15:47:58 2016 (r305133) +++ head/sys/boot/fdt/dts/Makefile Wed Aug 31 16:56:54 2016 (r305134) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR=arm mips powerpc +SUBDIR=arm arm64 mips powerpc .include Added: head/sys/boot/fdt/dts/arm64/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm64/Makefile Wed Aug 31 16:56:54 2016 (r305134) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +DTS!=ls *.dts + +all: test-dts + +.include Added: head/sys/boot/fdt/dts/arm64/a64.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm64/a64.dtsi Wed Aug 31 16:56:54 2016 (r305134) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * 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$ + */ + +/ { + clocks { + pll_hsic: clk@01c20044 { + #clock-cells = <0>; + compatible = "allwinner,sun50i-a64-pllhsic-clk"; + reg = <0x01c20044 0x4>; + clocks = <&osc24M>; + clock-output-names = "pll_hsic"; + }; + + usb_clk: clk@01c200cc { + #clock-cells = <1>; + #reset-cells = <1>; + compatible = "allwinner,sun8i-a83t-usb-clk"; + reg = <0x01c200cc 0x4>; + clocks = <&osc24M>, <&pll_hsic>; + clock-indices = <8>, <9>, + <10>, <11>, + <16>, <17>; + clock-output-names = "usb_phy0", "usb_phy1", + "usb_hsic_pll", "usb_hsic_12m", + "usb_otg_ohci", "usb_ohci0"; + }; + }; + + soc { + watchdog: watchdog@01c20ca0 { + compatible = "allwinner,sun6i-a31-wdt"; + reg = <0x01c20ca0 0x20>; + interrupts = ; + clocks = <&osc24M>; + }; + + nmi_intc: interrupt-controller@01f00c0c { + compatible = "allwinner,sun6i-a31-sc-nmi"; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x01f00c0c 0x38>; + interrupts = ; + }; + + r_rsb: i2c@01f03400 { + compatible = "allwinner,sun8i-a23-rsb"; + reg = <0x01f03400 0x400>; + interrupts = ; + clock-frequency = <3000000>; + pinctrl-names = "default"; + pinctrl-0 = <&r_rsb_pins>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + usbphy: phy@01c19400 { + compatible = "allwinner,sun50i-a64-usb-phy"; + reg = <0x01c19400 0x24 0x01c1a800 0x4 0x01c1b800 0x4>; + reg-names = "phy_ctrl", "pmu1", "pmu2"; + clocks = <&usb_clk 8>, + <&usb_clk 9>; + clock-names = "usb0_phy", + "usb1_phy"; + resets = <&usb_clk 0>, + <&usb_clk 1>; + reset-names = "usb0_reset", + "usb1_reset"; + status = "disabled"; + #phy-cells = <1>; + }; + + ohci0: usb@01c1a400 { + compatible = "generic-ohci"; + reg = <0x01c1a400 0x100>; + interrupts = ; + clocks = <&bus_gates 28>, <&usb_clk 16>, <&usb_clk 17>; + resets = <&ahb_rst 28>; + phys = <&usbphy 1>; + phy-names = "usb"; + status = "disabled"; + }; + + ehci0: usb@01c1a000 { + compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci"; + reg = <0x01c1a000 0x100>; + interrupts = ; + clocks = <&bus_gates 24>; + resets = <&ahb_rst 24>; + phys = <&usbphy 1>; + phy-names = "usb"; + status = "disabled"; + }; + + ohci1: usb@01c1b400 { + compatible = "generic-ohci"; + reg = <0x01c1b400 0x100>; + interrupts = ; + clocks = <&bus_gates 29>, <&usb_clk 16>, <&usb_clk 17>; + resets = <&ahb_rst 29>; + phys = <&usbphy 2>; + phy-names = "usb"; + status = "disabled"; + }; + + ehci1: usb@01c1b000 { + compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci"; + reg = <0x01c1b000 0x100>; + interrupts = ; + clocks = <&bus_gates 25>; + resets = <&ahb_rst 25>; + phys = <&usbphy 2>; + phy-names = "usb"; + status = "disabled"; + }; + }; +}; + +&pio { + r_rsb_pins: r_rsb { + allwinner,pins = "PL0", "PL1"; + allwinner,function = "s_rsb"; + allwinner,drive = ; + allwinner,pull = ; + }; +}; Added: head/sys/boot/fdt/dts/arm64/pine64_plus.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm64/pine64_plus.dts Wed Aug 31 16:56:54 2016 (r305134) @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * 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 "sun50i-a64-pine64-plus.dts" +#include "a64.dtsi" + +#include + +&pio { + emac_phy_reset_pin_pine64_plus: emac_phy_reset_pin@0 { + allwinner,pins = "PD14"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>, <&emac_phy_reset_pin_pine64_plus>; + phy-supply = <®_dc1dc>; + allwinner,reset-gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; + allwinner,reset-active-low; + allwinner,reset-delays-us = <0 10000 30000>; +}; + +&r_rsb { + status = "okay"; + + axp81x: pmic@3a3 { + compatible = "x-powers,axp813"; + reg = <0x3a3>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + gpio-controller; + #gpio-cells = <1>; + + regulators { + reg_dc1dc: dc1sw { + regulator-name = "dc1sw"; + }; + }; + }; +}; + +&usbphy { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; Added: head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64-common.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64-common.dtsi Wed Aug 31 16:56:54 2016 (r305134) @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2016 ARM Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * $FreeBSD$ + */ + +#include "sun50i-a64.dtsi" + +/ { + + aliases { + serial0 = &uart0; + }; + + soc { + reg_vcc3v3: vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + }; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>, <&mmc0_default_cd_pin>; + vmmc-supply = <®_vcc3v3>; + cd-gpios = <&pio 5 6 0>; + cd-inverted; + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + status = "okay"; +}; Added: head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64-plus.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64-plus.dts Wed Aug 31 16:56:54 2016 (r305134) @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016 ARM Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +#include "sun50i-a64-pine64-common.dtsi" + +/ { + model = "Pine64+"; + compatible = "pine64,pine64-plus", "allwinner,sun50i-a64"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + /* There is a model with 2GB of DRAM, but U-Boot fixes this for us. */ + memory { + reg = <0x40000000 0x40000000>; + }; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; + phy-mode = "rgmii"; + phy = <&phy1>; + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + }; +}; Added: head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm64/sun50i-a64-pine64.dts Wed Aug 31 16:56:54 2016 (r305134) @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2016 ARM Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +#include "sun50i-a64-pine64-common.dtsi" + +/ { + model = "Pine64"; + compatible = "pine64,pine64", "allwinner,sun50i-a64"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0x40000000 0x20000000>; + }; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy = <&phy1>; + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + }; +}; Added: head/sys/boot/fdt/dts/arm64/sun50i-a64.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm64/sun50i-a64.dtsi Wed Aug 31 16:56:54 2016 (r305134) @@ -0,0 +1,661 @@ +/* + * Copyright (C) 2016 ARM Ltd. + * based on the Allwinner H3 dtsi: + * Copyright (C) 2015 Jens Kuske + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * $FreeBSD$ + */ + +#include +#include + +/ { + interrupt-parent = <&gic>; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <0>; + enable-method = "psci"; + }; + + cpu@1 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <1>; + enable-method = "psci"; + }; + + cpu@2 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <2>; + enable-method = "psci"; + }; + + cpu@3 { + compatible = "arm,cortex-a53", "arm,armv8"; + device_type = "cpu"; + reg = <3>; + enable-method = "psci"; + }; + }; + + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + + memory { + device_type = "memory"; + reg = <0x40000000 0>; + }; + + gic: interrupt-controller@1c81000 { + compatible = "arm,gic-400"; + interrupt-controller; + #interrupt-cells = <3>; + #address-cells = <0>; + + reg = <0x01c81000 0x1000>, + <0x01c82000 0x2000>, + <0x01c84000 0x2000>, + <0x01c86000 0x2000>; + interrupts = ; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = , + , + , + ; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + osc24M: osc24M_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "osc24M"; + }; + + osc32k: osc32k_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; + clock-output-names = "osc32k"; + }; + + cpux: clk@1c20000 { + #clock-cells = <0>; + compatible = "allwinner,sun8i-a23-pll1-clk"; + reg = <0x01c20000 0x4>; + clocks = <&osc24M>; + clock-output-names = "cpux"; + }; + + periph0: clk@1c20028 { + #clock-cells = <1>; + compatible = "allwinner,sun6i-a31-pll6-clk"; + reg = <0x01c20028 0x4>; + clocks = <&osc24M>; + clock-output-names = "periph0", "periph0x2"; + }; + + periph0d2: periph0d2_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clock-div = <2>; + clock-mult = <1>; + clocks = <&periph0 0>; + clock-output-names = "periph0d2"; + }; + + periph1: clk@1c2002c { + #clock-cells = <1>; + compatible = "allwinner,sun6i-a31-pll6-clk"; + reg = <0x01c2002c 0x4>; + clocks = <&osc24M>; + clock-output-names = "periph1", "periph1x2"; + }; + + cpu: cpu_clk@1c20050 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-cpu-clk"; + reg = <0x01c20050 0x4>; + clocks = <&osc32k>, <&osc24M>, <&cpux>, <&cpux>; + clock-output-names = "cpu"; + critical-clocks = <0>; + }; + + axi: axi_clk@1c20050 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-axi-clk"; + reg = <0x01c20050 0x4>; + clocks = <&cpu>; + clock-output-names = "axi"; + }; + + ahb1: ahb1_clk@1c20054 { + #clock-cells = <0>; + compatible = "allwinner,sun6i-a31-ahb1-clk"; + reg = <0x01c20054 0x4>; + clocks = <&osc32k>, <&osc24M>, <&axi>, <&periph0 0>; + clock-output-names = "ahb1"; + }; + + ahb2: ahb2_clk@1c2005c { + #clock-cells = <0>; + compatible = "allwinner,sun8i-h3-ahb2-clk"; + reg = <0x01c2005c 0x4>; + clocks = <&ahb1>, <&periph0d2>; + clock-output-names = "ahb2"; + }; + + apb1: apb1_clk@1c20054 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-apb0-clk"; + reg = <0x01c20054 0x4>; + clocks = <&ahb1>; + clock-output-names = "apb1"; + }; + + apb2: apb2_clk@1c20058 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-apb1-clk"; + reg = <0x01c20058 0x4>; + clocks = <&osc32k>, <&osc24M>, + <&periph0 1>, <&periph0 1>; + clock-output-names = "apb2"; + }; + + bus_gates: bus_gates_clk@1c20060 { + #clock-cells = <1>; + compatible = "allwinner,sun50i-a64-bus-gates-clk", + "allwinner,sunxi-multi-bus-gates-clk"; + reg = <0x01c20060 0x14>; + ahb1_parent { + clocks = <&ahb1>; + clock-indices = <1>, <5>, + <6>, <8>, + <9>, <10>, + <13>, <14>, + <18>, <19>, + <20>, <21>, + <23>, <24>, + <25>, <28>, + <32>, <35>, + <36>, <37>, + <40>, <43>, + <44>, <52>, + <53>, <54>, + <135>; + clock-output-names = "bus_mipidsi", "bus_ce", + "bus_dma", "bus_mmc0", + "bus_mmc1", "bus_mmc2", + "bus_nand", "bus_sdram", + "bus_ts", "bus_hstimer", + "bus_spi0", "bus_spi1", + "bus_otg", "bus_otg_ehci0", + "bus_ehci0", "bus_otg_ohci0", + "bus_ve", "bus_lcd0", + "bus_lcd1", "bus_deint", + "bus_csi", "bus_hdmi", + "bus_de", "bus_gpu", + "bus_msgbox", "bus_spinlock", + "bus_dbg"; + }; + ahb2_parent { + clocks = <&ahb2>; + clock-indices = <17>, <29>; + clock-output-names = "bus_gmac", "bus_ohci0"; + }; + apb1_parent { + clocks = <&apb1>; + clock-indices = <64>, <65>, + <69>, <72>, + <76>, <77>, + <78>; + clock-output-names = "bus_codec", "bus_spdif", + "bus_pio", "bus_ths", + "bus_i2s0", "bus_i2s1", + "bus_i2s2"; + }; + abp2_parent { + clocks = <&apb2>; + clock-indices = <96>, <97>, + <98>, <101>, + <112>, <113>, + <114>, <115>, + <116>; + clock-output-names = "bus_i2c0", "bus_i2c1", + "bus_i2c2", "bus_scr", + "bus_uart0", "bus_uart1", + "bus_uart2", "bus_uart3", + "bus_uart4"; + }; + }; + + mmc0_clk: mmc0_clk@1c20088 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-mod0-clk"; + reg = <0x01c20088 0x4>; + clocks = <&osc24M>, <&periph0 1>, <&periph1 1>; + clock-output-names = "mmc0"; + }; + + mmc1_clk: mmc1_clk@1c2008c { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-mod0-clk"; + reg = <0x01c2008c 0x4>; + clocks = <&osc24M>, <&periph0 1>, <&periph1 1>; + clock-output-names = "mmc1"; + }; + + mmc2_clk: mmc2_clk@1c20090 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-mod0-clk"; + reg = <0x01c20090 0x4>; + clocks = <&osc24M>, <&periph0 1>, <&periph1 1>; + clock-output-names = "mmc2"; + }; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + mmc0: mmc@1c0f000 { + compatible = "allwinner,sun50i-a64-mmc", + "allwinner,sun5i-a13-mmc"; + reg = <0x01c0f000 0x1000>; + clocks = <&bus_gates 8>, <&mmc0_clk>, + <&mmc0_clk>, <&mmc0_clk>; + clock-names = "ahb", "mmc", + "output", "sample"; + resets = <&ahb_rst 8>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc1: mmc@1c10000 { + compatible = "allwinner,sun50i-a64-mmc", + "allwinner,sun5i-a13-mmc"; + reg = <0x01c10000 0x1000>; + clocks = <&bus_gates 9>, <&mmc1_clk>, + <&mmc1_clk>, <&mmc1_clk>; + clock-names = "ahb", "mmc", + "output", "sample"; + resets = <&ahb_rst 9>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc2: mmc@1c11000 { + compatible = "allwinner,sun50i-a64-mmc", + "allwinner,sun5i-a13-mmc"; + reg = <0x01c11000 0x1000>; + clocks = <&bus_gates 10>, <&mmc2_clk>, + <&mmc2_clk>, <&mmc2_clk>; + clock-names = "ahb", "mmc", + "output", "sample"; + resets = <&ahb_rst 10>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + pio: pinctrl@1c20800 { + compatible = "allwinner,sun50i-a64-pinctrl"; + reg = <0x01c20800 0x400>; + interrupts = , + , + ; + clocks = <&bus_gates 69>; + gpio-controller; + #gpio-cells = <3>; + interrupt-controller; + #interrupt-cells = <2>; + + uart0_pins_a: uart0@0 { + allwinner,pins = "PB8", "PB9"; + allwinner,function = "uart0"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart0_pins_b: uart0@1 { + allwinner,pins = "PF2", "PF3"; + allwinner,function = "uart0"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart1_2pins: uart1_2@0 { + allwinner,pins = "PG6", "PG7"; + allwinner,function = "uart1"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart1_4pins: uart1_4@0 { + allwinner,pins = "PG6", "PG7", "PG8", "PG9"; + allwinner,function = "uart1"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart2_2pins: uart2_2@0 { + allwinner,pins = "PB0", "PB1"; + allwinner,function = "uart2"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart2_4pins: uart2_4@0 { + allwinner,pins = "PB0", "PB1", "PB2", "PB3"; + allwinner,function = "uart2"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart3_pins_a: uart3@0 { + allwinner,pins = "PD0", "PD1"; + allwinner,function = "uart3"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart3_2pins_b: uart3_2@1 { + allwinner,pins = "PH4", "PH5"; + allwinner,function = "uart3"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart3_4pins_b: uart3_4@1 { + allwinner,pins = "PH4", "PH5", "PH6", "PH7"; + allwinner,function = "uart3"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart4_2pins: uart4_2@0 { + allwinner,pins = "PD2", "PD3"; + allwinner,function = "uart4"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart4_4pins: uart4_4@0 { + allwinner,pins = "PD2", "PD3", "PD4", "PD5"; + allwinner,function = "uart4"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc0_pins: mmc0@0 { + allwinner,pins = "PF0", "PF1", "PF2", "PF3", + "PF4", "PF5"; + allwinner,function = "mmc0"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc0_default_cd_pin: mmc0_cd_pin@0 { + allwinner,pins = "PF6"; + allwinner,function = "gpio_in"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc1_pins: mmc1@0 { + allwinner,pins = "PG0", "PG1", "PG2", "PG3", + "PG4", "PG5"; + allwinner,function = "mmc1"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc2_pins: mmc2@0 { + allwinner,pins = "PC1", "PC5", "PC6", "PC8", + "PC9", "PC10"; + allwinner,function = "mmc2"; + allwinner,drive = ; + allwinner,pull = ; + }; + + i2c0_pins: i2c0_pins { + allwinner,pins = "PH0", "PH1"; + allwinner,function = "i2c0"; + allwinner,drive = ; + allwinner,pull = ; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 31 17:52: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 20971BC864E; Wed, 31 Aug 2016 17:52:13 +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 E4E89ABB; Wed, 31 Aug 2016 17:52:12 +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 u7VHqCWe035738; Wed, 31 Aug 2016 17:52:12 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VHqChb035731; Wed, 31 Aug 2016 17:52:12 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201608311752.u7VHqChb035731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 31 Aug 2016 17:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305137 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 17:52:13 -0000 Author: allanjude Date: Wed Aug 31 17:52:11 2016 New Revision: 305137 URL: https://svnweb.freebsd.org/changeset/base/305137 Log: Eliminate unnecessary loop in _cap_check() Calling cap_rights_contains() several times with the same inputs is not going to produce a different output. The variable being iterated, i, is never used inside the for loop. The loop is actually done in cap_rights_contains() Submitted by: Ryan Moeller Reviewed by: oshogbo, ed MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7369 Modified: head/sys/kern/sys_capability.c Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Wed Aug 31 17:36:43 2016 (r305136) +++ head/sys/kern/sys_capability.c Wed Aug 31 17:52:11 2016 (r305137) @@ -150,16 +150,13 @@ static inline int _cap_check(const cap_rights_t *havep, const cap_rights_t *needp, enum ktr_cap_fail_type type) { - int i; - for (i = 0; i < nitems(havep->cr_rights); i++) { - if (!cap_rights_contains(havep, needp)) { + if (!cap_rights_contains(havep, needp)) { #ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(type, needp, havep); + if (KTRPOINT(curthread, KTR_CAPFAIL)) + ktrcapfail(type, needp, havep); #endif - return (ENOTCAPABLE); - } + return (ENOTCAPABLE); } return (0); } From owner-svn-src-head@freebsd.org Wed Aug 31 18:10: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 C658BBC8C68; Wed, 31 Aug 2016 18:10:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C2148EA; Wed, 31 Aug 2016 18:10:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VIAfUV040649; Wed, 31 Aug 2016 18:10:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VIAfwK040648; Wed, 31 Aug 2016 18:10:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201608311810.u7VIAfwK040648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 31 Aug 2016 18:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305139 - head/bin/df 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.22 Precedence: list List-Id: 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, 31 Aug 2016 18:10:42 -0000 Author: cem Date: Wed Aug 31 18:10:41 2016 New Revision: 305139 URL: https://svnweb.freebsd.org/changeset/base/305139 Log: df(1): Allow duplicate -l flags gracefully Rather than producing a misleading error message when duplicate -l flags are provided to df(1), simply ignore extra flags and proceed as if only one was specified. This seems most reasonable given the usage for -l: -l Only display information about locally-mounted file systems. l and t flags still conflict, as before. PR: 208169 Reported by: by at reorigin.com Reviewed by: allanjude Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Wed Aug 31 18:00:41 2016 (r305138) +++ head/bin/df/df.c Wed Aug 31 18:10:41 2016 (r305139) @@ -166,6 +166,9 @@ main(int argc, char *argv[]) hflag = 0; break; case 'l': + /* Ignore duplicate -l */ + if (lflag) + break; if (vfslist != NULL) xo_errx(1, "-l and -t are mutually exclusive."); vfslist = makevfslist(makenetvfslist()); From owner-svn-src-head@freebsd.org Wed Aug 31 18:13: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 4AAEEBC8E97; Wed, 31 Aug 2016 18:13:03 +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 3AE1BC71; Wed, 31 Aug 2016 18:13:03 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=53063 helo=[10.0.0.107]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1bf8Lv-0001A9-Lv; Wed, 31 Aug 2016 16:27:03 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r305107 - head/sys/boot/forth From: Devin Teske In-Reply-To: Date: Wed, 31 Aug 2016 11:13:01 -0700 Cc: Devin Teske , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske Content-Transfer-Encoding: quoted-printable Message-Id: <92B74CEF-1016-4CAD-A505-84DC82DCEAE2@freebsd.org> References: <201608310355.u7V3tof3018157@repo.freebsd.org> <9994950D-74C3-4326-BE5F-27B042971460@shxd.cx> To: Warner Losh X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 18:13:03 -0000 > On Aug 31, 2016, at 7:43 AM, Warner Losh wrote: >=20 > On Wed, Aug 31, 2016 at 8:41 AM, Devin Teske wrote: >> Please remove the following: >>=20 >> "Unsure why we don't just have start" >>=20 >> Others beside yourself have great understanding of the Forth and we = don't need questioning comments in the code. >=20 > To be fair, it was just left in there accidentally. However, could you > explain it to me? That answer is insulting without being actually > helpful in resolving the situation. >=20 Many apologies, I did not mean to be insulting -- just under the gun and = short on time for eloquence (poor excuse, I know). Let me try and put something together that better answers any = question(s) you may have about the Forth. If you have some time later, maybe we can catch up on IRC and we can = either improve the code, the comments, or understanding thereof not only = for ourselves but for others as well. --=20 Cheers, Devin= From owner-svn-src-head@freebsd.org Wed Aug 31 18:33: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 3BB5FBC9590; Wed, 31 Aug 2016 18:33:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D02C50; Wed, 31 Aug 2016 18:33:15 +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 u7VIXFnI052280; Wed, 31 Aug 2016 18:33:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VIXFDW052279; Wed, 31 Aug 2016 18:33:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608311833.u7VIXFDW052279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 Aug 2016 18:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305140 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 18:33:16 -0000 Author: emaste Date: Wed Aug 31 18:33:15 2016 New Revision: 305140 URL: https://svnweb.freebsd.org/changeset/base/305140 Log: Allow getdtablesize in capability mode getdtablesize is "trivial global state" and is similar to getrlimit(RLIMIT_NOFILE), so should be permitted in capability mode. Reviewed by: oshogbo MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7719 Modified: head/sys/kern/capabilities.conf Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Wed Aug 31 18:10:41 2016 (r305139) +++ head/sys/kern/capabilities.conf Wed Aug 31 18:33:15 2016 (r305140) @@ -248,6 +248,7 @@ getdirentries ## Allow querying certain trivial global state. ## getdomainname +getdtablesize ## ## Allow querying current process credential state. From owner-svn-src-head@freebsd.org Wed Aug 31 18:35: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 8907BBC9658; Wed, 31 Aug 2016 18:35:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5BF49E18; Wed, 31 Aug 2016 18:35:42 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VIZfo5052409; Wed, 31 Aug 2016 18:35:41 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VIZffJ052408; Wed, 31 Aug 2016 18:35:41 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201608311835.u7VIZffJ052408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 31 Aug 2016 18:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305141 - head/sys/arm/ti/am335x 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.22 Precedence: list List-Id: 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, 31 Aug 2016 18:35:42 -0000 Author: loos Date: Wed Aug 31 18:35:41 2016 New Revision: 305141 URL: https://svnweb.freebsd.org/changeset/base/305141 Log: Fix the build. Works better when the file with the #define is actually included... Modified: head/sys/arm/ti/am335x/am335x_prcm.c Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Wed Aug 31 18:33:15 2016 (r305140) +++ head/sys/arm/ti/am335x/am335x_prcm.c Wed Aug 31 18:35:41 2016 (r305141) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include +#include "am335x_scm.h" + #define CM_PER 0 #define CM_PER_L4LS_CLKSTCTRL (CM_PER + 0x000) #define CM_PER_L3S_CLKSTCTRL (CM_PER + 0x004) From owner-svn-src-head@freebsd.org Wed Aug 31 18:37: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 41D3ABC97D5; Wed, 31 Aug 2016 18:37:52 +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 116652D2; Wed, 31 Aug 2016 18:37:51 +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 u7VIbpiE052576; Wed, 31 Aug 2016 18:37:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VIbp7Z052575; Wed, 31 Aug 2016 18:37:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608311837.u7VIbp7Z052575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 Aug 2016 18:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305143 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 18:37:52 -0000 Author: emaste Date: Wed Aug 31 18:37:51 2016 New Revision: 305143 URL: https://svnweb.freebsd.org/changeset/base/305143 Log: Regnerate after r305140, getdtablesize in capability mode Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed Aug 31 18:37:04 2016 (r305142) +++ head/sys/kern/init_sysent.c Wed Aug 31 18:37:51 2016 (r305143) @@ -135,7 +135,7 @@ struct sysent sysent[] = { { AS(getitimer_args), (sy_call_t *)sys_getitimer, AUE_GETITIMER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 86 = getitimer */ { compat(AS(gethostname_args),gethostname), AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 87 = old gethostname */ { compat(AS(sethostname_args),sethostname), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 88 = old sethostname */ - { 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = getdtablesize */ + { 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 89 = getdtablesize */ { AS(dup2_args), (sy_call_t *)sys_dup2, AUE_DUP2, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 90 = dup2 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 91 = getdopt */ { AS(fcntl_args), (sy_call_t *)sys_fcntl, AUE_FCNTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 92 = fcntl */ From owner-svn-src-head@freebsd.org Wed Aug 31 18:49: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 7FFB8BC9AF7; Wed, 31 Aug 2016 18:49:51 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 52FF4AEA; Wed, 31 Aug 2016 18:49:51 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VInogU056384; Wed, 31 Aug 2016 18:49:50 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VInone056382; Wed, 31 Aug 2016 18:49:50 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608311849.u7VInone056382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 31 Aug 2016 18:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305144 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 18:49:51 -0000 Author: ache Date: Wed Aug 31 18:49:50 2016 New Revision: 305144 URL: https://svnweb.freebsd.org/changeset/base/305144 Log: 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted by: Herbie.Robinson@stratus.com MFC after: 7 days Modified: head/lib/libc/net/getaddrinfo.c head/lib/libc/net/name6.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Wed Aug 31 18:37:51 2016 (r305143) +++ head/lib/libc/net/getaddrinfo.c Wed Aug 31 18:49:50 2016 (r305144) @@ -949,7 +949,7 @@ matchlen(struct sockaddr *src, struct so while (s < lim) if ((r = (*d++ ^ *s++)) != 0) { - while (r < addrlen * 8) { + while ((r & 0x80) == 0) { match++; r <<= 1; } Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Wed Aug 31 18:37:51 2016 (r305143) +++ head/lib/libc/net/name6.c Wed Aug 31 18:49:50 2016 (r305144) @@ -930,7 +930,7 @@ matchlen(struct sockaddr *src, struct so while (s < lim) if ((r = (*d++ ^ *s++)) != 0) { - while (r < addrlen * 8) { + while ((r & 0x80) == 0) { match++; r <<= 1; } From owner-svn-src-head@freebsd.org Wed Aug 31 19: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 86F6FBCA440; Wed, 31 Aug 2016 19:18:38 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68C34616; Wed, 31 Aug 2016 19:18:38 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [208.184.220.60] (helo=limiting-factor.dolby.net) by id.bluezbox.com with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1bfAek-000F0r-FI; Wed, 31 Aug 2016 11:54:38 -0700 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r305114 - head/sys/arm/ti From: Oleksandr Tymoshenko In-Reply-To: <201608310722.u7V7MEvA094475@repo.freebsd.org> Date: Wed, 31 Aug 2016 11:54:08 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201608310722.u7V7MEvA094475@repo.freebsd.org> To: Luiz Otavio O Souza X-Mailer: Apple Mail (2.3124) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Aug 31, 2016, at 12:22 AM, Luiz Otavio O Souza wrote: > > Author: loos > Date: Wed Aug 31 07:22:14 2016 > New Revision: 305114 > URL: https://svnweb.freebsd.org/changeset/base/305114 > > Log: > Allow the use of control module extensions to cope with specific platform > features. > > Sponsored by: Rubicon Communications, LLC (Netgate) > > Modified: > head/sys/arm/ti/ti_scm.c > > Modified: head/sys/arm/ti/ti_scm.c > ============================================================================== > --- head/sys/arm/ti/ti_scm.c Wed Aug 31 07:03:06 2016 (r305113) > +++ head/sys/arm/ti/ti_scm.c Wed Aug 31 07:22:14 2016 (r305114) > @@ -131, 7 +131, 11 @@ ti_scm_attach(device_t dev) > > ti_scm_sc = sc; > > - return (0); > + /* Attach platform extensions, if any. */ > + bus_generic_probe(dev); > + bus_enumerate_hinted_children(dev); > + > + return (bus_generic_attach(dev)); > } [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 19:18:38 -0000 > On Aug 31, 2016, at 12:22 AM, Luiz Otavio O Souza = wrote: >=20 > Author: loos > Date: Wed Aug 31 07:22:14 2016 > New Revision: 305114 > URL: https://svnweb.freebsd.org/changeset/base/305114 >=20 > Log: > Allow the use of control module extensions to cope with specific = platform > features. >=20 > Sponsored by: Rubicon Communications, LLC (Netgate) >=20 > Modified: > head/sys/arm/ti/ti_scm.c >=20 > Modified: head/sys/arm/ti/ti_scm.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/arm/ti/ti_scm.c Wed Aug 31 07:03:06 2016 = (r305113) > +++ head/sys/arm/ti/ti_scm.c Wed Aug 31 07:22:14 2016 = (r305114) > @@ -131,7 +131,11 @@ ti_scm_attach(device_t dev) >=20 > ti_scm_sc =3D sc; >=20 > - return (0); > + /* Attach platform extensions, if any. */ > + bus_generic_probe(dev); > + bus_enumerate_hinted_children(dev); > + > + return (bus_generic_attach(dev)); > } Is bus_enumerate_hinted_children really required? I think all TI = platforms are FDT-compatible=20= From owner-svn-src-head@freebsd.org Wed Aug 31 19:30: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 0B73BBCA760; Wed, 31 Aug 2016 19:30:02 +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 CFB5DBB5; Wed, 31 Aug 2016 19:30:01 +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 u7VJU1MQ071863; Wed, 31 Aug 2016 19:30:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VJU1pO071862; Wed, 31 Aug 2016 19:30:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608311930.u7VJU1pO071862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 31 Aug 2016 19:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305145 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 19:30:02 -0000 Author: bdrewery Date: Wed Aug 31 19:30:00 2016 New Revision: 305145 URL: https://svnweb.freebsd.org/changeset/base/305145 Log: DIRDEPS_BUILD: Avoid cyclic dependency with libc++. The DIRDEPS_BUILD does not have a 'make includes' phase, so it would otherwise want libc++ to be fully built/staged before building libgcc. Using the header directly works. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Wed Aug 31 18:49:50 2016 (r305144) +++ head/gnu/lib/libgcc/Makefile Wed Aug 31 19:30:00 2016 (r305145) @@ -95,6 +95,10 @@ CXXFLAGS+= -std=c++11 .endif CXXFLAGS+= -fno-rtti STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC +.if ${MK_DIRDEPS_BUILD} == "yes" +# Avoid dependency on lib/libc++ +CFLAGS+= -I${SRCTOP}/contrib/libc++/include +.endif .else # MK_LLVM_LIBUNWIND From owner-svn-src-head@freebsd.org Wed Aug 31 19:30:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8607CBCA7BD; Wed, 31 Aug 2016 19:30:49 +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 4790ED4D; Wed, 31 Aug 2016 19:30:49 +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 u7VJUmLe072014; Wed, 31 Aug 2016 19:30:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VJUlKk071997; Wed, 31 Aug 2016 19:30:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608311930.u7VJUlKk071997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 31 Aug 2016 19:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305146 - in head: cddl/usr.sbin/dtrace cddl/usr.sbin/lockstat cddl/usr.sbin/plockstat lib/clang/libclangformat lib/clang/libclangtoolingcore lib/libc/tests/stdlib lib/libproc lib/libpr... 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.22 Precedence: list List-Id: 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, 31 Aug 2016 19:30:49 -0000 Author: bdrewery Date: Wed Aug 31 19:30:46 2016 New Revision: 305146 URL: https://svnweb.freebsd.org/changeset/base/305146 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/usr.sbin/dtrace/Makefile.depend head/cddl/usr.sbin/lockstat/Makefile.depend head/cddl/usr.sbin/plockstat/Makefile.depend head/lib/clang/libclangformat/Makefile.depend head/lib/clang/libclangtoolingcore/Makefile.depend head/lib/libc/tests/stdlib/Makefile.depend head/lib/libproc/Makefile.depend head/lib/libproc/tests/Makefile.depend head/lib/librtld_db/Makefile.depend head/secure/usr.bin/ssh/Makefile.depend head/usr.bin/nfsstat/Makefile.depend head/usr.bin/tar/tests/Makefile.depend head/usr.sbin/bhyve/Makefile.depend head/usr.sbin/pw/tests/Makefile.depend Modified: head/cddl/usr.sbin/dtrace/Makefile.depend ============================================================================== --- head/cddl/usr.sbin/dtrace/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/cddl/usr.sbin/dtrace/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -13,7 +13,9 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libcxxrt \ lib/libelf \ + lib/libkvm \ lib/libproc \ + lib/libprocstat \ lib/librtld_db \ lib/libthr \ lib/libutil \ Modified: head/cddl/usr.sbin/lockstat/Makefile.depend ============================================================================== --- head/cddl/usr.sbin/lockstat/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/cddl/usr.sbin/lockstat/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -13,7 +13,9 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libcxxrt \ lib/libelf \ + lib/libkvm \ lib/libproc \ + lib/libprocstat \ lib/librt \ lib/librtld_db \ lib/libthr \ Modified: head/cddl/usr.sbin/plockstat/Makefile.depend ============================================================================== --- head/cddl/usr.sbin/plockstat/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/cddl/usr.sbin/plockstat/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -13,7 +13,9 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libcxxrt \ lib/libelf \ + lib/libkvm \ lib/libproc \ + lib/libprocstat \ lib/librtld_db \ lib/libthr \ lib/libutil \ Modified: head/lib/clang/libclangformat/Makefile.depend ============================================================================== --- head/lib/clang/libclangformat/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/lib/clang/libclangformat/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -6,6 +6,7 @@ DIRDEPS = \ include/xlocale \ lib/libc++ \ lib/msun \ + usr.bin/clang/clang-tblgen.host \ .include Modified: head/lib/clang/libclangtoolingcore/Makefile.depend ============================================================================== --- head/lib/clang/libclangtoolingcore/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/lib/clang/libclangtoolingcore/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -6,6 +6,7 @@ DIRDEPS = \ include/xlocale \ lib/libc++ \ lib/msun \ + usr.bin/clang/clang-tblgen.host \ .include Modified: head/lib/libc/tests/stdlib/Makefile.depend ============================================================================== --- head/lib/libc/tests/stdlib/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/lib/libc/tests/stdlib/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -11,9 +11,10 @@ DIRDEPS = \ lib/atf/libatf-c++ \ lib/libc \ lib/libc++ \ - lib/libthr \ lib/libcompiler_rt \ + lib/libcxxrt \ lib/libnetbsd \ + lib/libthr \ lib/libutil \ lib/msun \ Modified: head/lib/libproc/Makefile.depend ============================================================================== --- head/lib/libproc/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/lib/libproc/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -12,6 +12,7 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libcxxrt \ lib/libelf \ + lib/libprocstat \ lib/librtld_db \ lib/libutil \ Modified: head/lib/libproc/tests/Makefile.depend ============================================================================== --- head/lib/libproc/tests/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/lib/libproc/tests/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -13,7 +13,9 @@ DIRDEPS = \ lib/libcompiler_rt \ lib/libcxxrt \ lib/libelf \ + lib/libkvm \ lib/libproc \ + lib/libprocstat \ lib/librtld_db \ lib/libutil \ lib/libz \ Modified: head/lib/librtld_db/Makefile.depend ============================================================================== --- head/lib/librtld_db/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/lib/librtld_db/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -10,6 +10,7 @@ DIRDEPS = \ lib/libc \ lib/libcompiler_rt \ lib/libelf \ + lib/libprocstat \ lib/libutil \ Modified: head/secure/usr.bin/ssh/Makefile.depend ============================================================================== --- head/secure/usr.bin/ssh/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/secure/usr.bin/ssh/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -9,8 +9,6 @@ DIRDEPS = \ include/gssapi \ include/rpc \ include/xlocale \ - kerberos5/lib/libasn1 \ - kerberos5/lib/libkrb5 \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Modified: head/usr.bin/nfsstat/Makefile.depend ============================================================================== --- head/usr.bin/nfsstat/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/usr.bin/nfsstat/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -9,6 +9,9 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libdevstat \ + lib/libelf \ + lib/libkvm \ .include Modified: head/usr.bin/tar/tests/Makefile.depend ============================================================================== --- head/usr.bin/tar/tests/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/usr.bin/tar/tests/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -8,8 +8,14 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libarchive \ + lib/libbz2 \ lib/libc \ lib/libcompiler_rt \ + lib/libexpat \ + lib/liblzma \ + lib/libthr \ + lib/libz \ + secure/lib/libcrypto \ .include Modified: head/usr.sbin/bhyve/Makefile.depend ============================================================================== --- head/usr.sbin/bhyve/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/usr.sbin/bhyve/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -5,6 +5,7 @@ DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ include \ + include/arpa \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ @@ -13,6 +14,7 @@ DIRDEPS = \ lib/libthr \ lib/libutil \ lib/libvmmapi \ + lib/libz \ .include Modified: head/usr.sbin/pw/tests/Makefile.depend ============================================================================== --- head/usr.sbin/pw/tests/Makefile.depend Wed Aug 31 19:30:00 2016 (r305145) +++ head/usr.sbin/pw/tests/Makefile.depend Wed Aug 31 19:30:46 2016 (r305146) @@ -2,6 +2,13 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/libcrypt \ .include From owner-svn-src-head@freebsd.org Wed Aug 31 19:30: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 DD933BCA7F2; Wed, 31 Aug 2016 19:30:53 +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 AD187DA6; Wed, 31 Aug 2016 19:30:53 +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 u7VJUqFx072231; Wed, 31 Aug 2016 19:30:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VJUqO8072181; Wed, 31 Aug 2016 19:30:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608311930.u7VJUqO8072181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 31 Aug 2016 19:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305147 - in 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.22 Precedence: list List-Id: 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, 31 Aug 2016 19:30:54 -0000 Author: bdrewery Date: Wed Aug 31 19:30:52 2016 New Revision: 305147 URL: https://svnweb.freebsd.org/changeset/base/305147 Log: Add a 'make print-dir' that simply traverses all directories and prints them. This is useful for finding connected directories. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile head/share/mk/bsd.dep.mk head/share/mk/bsd.init.mk head/share/mk/bsd.subdir.mk head/share/mk/local.meta.sys.mk head/share/mk/sys.mk Modified: head/Makefile ============================================================================== --- head/Makefile Wed Aug 31 19:30:46 2016 (r305146) +++ head/Makefile Wed Aug 31 19:30:52 2016 (r305147) @@ -109,7 +109,8 @@ # Note: we use this awkward construct to be compatible with FreeBSD's # old make used in 10.0 and 9.2 and earlier. -.if defined(MK_DIRDEPS_BUILD) && ${MK_DIRDEPS_BUILD} == "yes" && !make(showconfig) +.if defined(MK_DIRDEPS_BUILD) && ${MK_DIRDEPS_BUILD} == "yes" && \ + !make(showconfig) && !make(print-dir) # targets/Makefile plays the role of top-level .include "targets/Makefile" .else @@ -132,7 +133,7 @@ TGTS= all all-man buildenv buildenvvars xdev-links native-xtools stageworld stagekernel stage-packages \ create-world-packages create-kernel-packages create-packages \ packages installconfig real-packages sign-packages package-pkg \ - test-system-compiler + print-dir test-system-compiler # XXX: r156740: This can't work since bsd.subdir.mk is not included ever. # It will only work for SUBDIR_TARGETS in make.conf. @@ -257,6 +258,10 @@ _TARGET_ARCH= ${XDEV_ARCH} _TARGET?= ${MACHINE} _TARGET_ARCH?= ${MACHINE_ARCH} +.if make(print-dir) +.SILENT: +.endif + # # Make sure we have an up-to-date make(1). Only world and buildworld # should do this as those are the initial targets used for upgrades. Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Aug 31 19:30:46 2016 (r305146) +++ head/share/mk/bsd.dep.mk Wed Aug 31 19:30:52 2016 (r305147) @@ -82,9 +82,9 @@ _meta_filemon= 1 # since it will track dependencies itself. OBJS_DEPEND_GUESS is still used. .if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ ${.TARGETS:M*install*} == ${.TARGETS} || \ - make(analyze) || defined(_meta_filemon) + make(analyze) || defined(_meta_filemon) || make(print-dir) _SKIP_READ_DEPEND= 1 -.if ${MK_DIRDEPS_BUILD} == "no" +.if ${MK_DIRDEPS_BUILD} == "no" || make(analyze) || make(print-dir) .MAKE.DEPENDFILE= /dev/null .endif .endif @@ -198,7 +198,7 @@ CFLAGS+= ${DEPEND_CFLAGS} .endif # !defined(_meta_filemon) .endif # defined(SRCS) -.if ${MK_DIRDEPS_BUILD} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" && !make(analyze) && !make(print-dir) # Prevent meta.autodep.mk from tracking "local dependencies". .depend: .include Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Wed Aug 31 19:30:46 2016 (r305146) +++ head/share/mk/bsd.init.mk Wed Aug 31 19:30:52 2016 (r305147) @@ -31,7 +31,7 @@ _SKIP_BUILD = not building at level 0 .if ${MK_META_MODE} == "yes" .if !exists(/dev/filemon) && \ ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON) && \ - !make(showconfig) && ${.MAKEFLAGS:M-V} == "" + !make(showconfig) && !make(print-dir) && ${.MAKEFLAGS:M-V} == "" .warning The filemon module (/dev/filemon) is not loaded. .warning META_MODE is less useful for incremental builds without filemon. .warning 'kldload filemon' or pass -DNO_FILEMON to suppress this warning. Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Aug 31 19:30:46 2016 (r305146) +++ head/share/mk/bsd.subdir.mk Wed Aug 31 19:30:52 2016 (r305147) @@ -42,15 +42,15 @@ SUBDIR_TARGETS+= \ all all-man analyze buildconfig buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanilinks \ cleanobj depend distribute files includes installconfig \ - installfiles installincludes realinstall lint maninstall \ - manlint obj objlink tags \ + installfiles installincludes print-dir realinstall lint \ + maninstall manlint obj objlink tags \ # Described above. STANDALONE_SUBDIR_TARGETS+= \ all-man buildconfig buildfiles buildincludes check checkdpadd \ clean cleandepend cleandir cleanilinks cleanobj files includes \ - installconfig installincludes installfiles maninstall manlint \ - obj objlink \ + installconfig installincludes installfiles print-dir \ + maninstall manlint obj objlink # It is safe to install in parallel when staging. .if defined(NO_ROOT) @@ -59,6 +59,16 @@ STANDALONE_SUBDIR_TARGETS+= realinstall .include +.if make(print-dir) +NEED_SUBDIR= 1 +ECHODIR= : +.SILENT: +.if ${RELDIR:U.} != "." +print-dir: .PHONY + @echo ${RELDIR} +.endif +.endif + .if !defined(NEED_SUBDIR) .if ${.MAKE.LEVEL} == 0 && ${MK_DIRDEPS_BUILD} == "yes" && !empty(SUBDIR) && !(make(clean*) || make(destroy*)) .include Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed Aug 31 19:30:46 2016 (r305146) +++ head/share/mk/local.meta.sys.mk Wed Aug 31 19:30:52 2016 (r305147) @@ -214,7 +214,8 @@ CSU_DIR := ${CSU_DIR.${MACHINE_ARCH}} .if !empty(TIME_STAMP) TRACER= ${TIME_STAMP} ${:U} .endif -.if !defined(_RECURSING_PROGS) && !defined(_RECURSING_CRUNCH) +.if !defined(_RECURSING_PROGS) && !defined(_RECURSING_CRUNCH) && \ + !make(print-dir) WITH_META_STATS= t .endif Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Wed Aug 31 19:30:46 2016 (r305146) +++ head/share/mk/sys.mk Wed Aug 31 19:30:52 2016 (r305147) @@ -97,7 +97,7 @@ META_MODE?= normal # This needs to be done early - before .PATH is computed # Don't do this for 'make showconfig' as it enables all options where meta mode # is not expected. -.if !make(showconfig) +.if !make(showconfig) && !make(print-dir) .sinclude .endif .endif From owner-svn-src-head@freebsd.org Wed Aug 31 19:31: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 D402CBCA84A; Wed, 31 Aug 2016 19:31:01 +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 A7AC4FD9; Wed, 31 Aug 2016 19:31:01 +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 u7VJV0mk072312; Wed, 31 Aug 2016 19:31:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VJUx7X072291; Wed, 31 Aug 2016 19:30:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608311930.u7VJUx7X072291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 31 Aug 2016 19:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305148 - in head: cddl/usr.sbin/zfsd libexec/rtld-elf/tests/libpythagoras libexec/rtld-elf/tests/target targets/pseudo/tests targets/pseudo/userland targets/pseudo/userland/cddl target... 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.22 Precedence: list List-Id: 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, 31 Aug 2016 19:31:02 -0000 Author: bdrewery Date: Wed Aug 31 19:30:59 2016 New Revision: 305148 URL: https://svnweb.freebsd.org/changeset/base/305148 Log: DIRDEPS_BUILD: Add some missing dirctories to the build. Sponsored by: EMC / Isilon Storage Division Added: head/cddl/usr.sbin/zfsd/Makefile.depend (contents, props changed) head/libexec/rtld-elf/tests/libpythagoras/Makefile.depend (contents, props changed) head/libexec/rtld-elf/tests/target/Makefile.depend (contents, props changed) head/tests/sys/pjdfstest/pjdfstest/Makefile.depend (contents, props changed) head/tests/sys/sys/Makefile.depend (contents, props changed) head/usr.bin/bsdcat/tests/Makefile.depend (contents, props changed) head/usr.bin/sdiff/tests/Makefile.depend (contents, props changed) head/usr.bin/xinstall/tests/Makefile.depend (contents, props changed) head/usr.sbin/extattr/tests/Makefile.depend (contents, props changed) head/usr.sbin/pmcstudy/Makefile.depend (contents, props changed) head/usr.sbin/ypldap/Makefile.depend (contents, props changed) Modified: head/targets/pseudo/tests/Makefile.depend head/targets/pseudo/userland/Makefile.depend head/targets/pseudo/userland/cddl/Makefile.depend head/targets/pseudo/userland/libexec/Makefile.depend Added: head/cddl/usr.sbin/zfsd/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/zfsd/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,35 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + cddl/lib/libavl \ + cddl/lib/libnvpair \ + cddl/lib/libumem \ + cddl/lib/libuutil \ + cddl/lib/libzfs \ + cddl/lib/libzfs_core \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libcxxrt \ + lib/libdevdctl \ + lib/libexpat \ + lib/libgeom \ + lib/libmd \ + lib/libsbuf \ + lib/libthr \ + lib/libutil \ + lib/libz \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/libexec/rtld-elf/tests/libpythagoras/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/tests/libpythagoras/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/libexec/rtld-elf/tests/target/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/tests/target/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + libexec/rtld-elf/tests/libpythagoras \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/targets/pseudo/tests/Makefile.depend ============================================================================== --- head/targets/pseudo/tests/Makefile.depend Wed Aug 31 19:30:52 2016 (r305147) +++ head/targets/pseudo/tests/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -166,6 +166,8 @@ DIRDEPS= \ libexec/atf/atf-sh/tests \ libexec/atf/tests \ libexec/rtld-elf/tests \ + libexec/rtld-elf/tests/libpythagoras \ + libexec/rtld-elf/tests/target \ libexec/tests \ sbin/devd/tests \ sbin/dhclient/tests \ @@ -213,6 +215,7 @@ DIRDEPS= \ tests/sys/mqueue \ tests/sys/netinet \ tests/sys/opencrypto \ + tests/sys/pjdfstest/pjdfstest \ tests/sys/pjdfstest/tests \ tests/sys/pjdfstest/tests/chflags \ tests/sys/pjdfstest/tests/chmod \ @@ -230,6 +233,7 @@ DIRDEPS= \ tests/sys/pjdfstest/tests/truncate \ tests/sys/pjdfstest/tests/unlink \ tests/sys/posixshm \ + tests/sys/sys \ tests/sys/vfs \ tests/sys/vm \ usr.bin/apply/tests \ @@ -303,6 +307,7 @@ DIRDEPS= \ usr.bin/mkimg/tests \ usr.bin/ncal/tests \ usr.bin/printf/tests \ + usr.bin/sdiff/tests \ usr.bin/sed/tests \ usr.bin/sed/tests/regress.multitest.out \ usr.bin/soelim/tests \ @@ -315,10 +320,12 @@ DIRDEPS= \ usr.bin/uudecode/tests \ usr.bin/uuencode/tests \ usr.bin/xargs/tests \ + usr.bin/xinstall/tests \ usr.bin/xo/tests \ usr.bin/yacc/tests \ usr.sbin/chown/tests \ usr.sbin/etcupdate/tests \ + usr.sbin/extattr/tests \ usr.sbin/fstyp/tests \ usr.sbin/makefs/tests \ usr.sbin/newsyslog/tests \ Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Wed Aug 31 19:30:52 2016 (r305147) +++ head/targets/pseudo/userland/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -701,6 +701,7 @@ DIRDEPS+= \ usr.sbin/pmcannotate \ usr.sbin/pmccontrol \ usr.sbin/pmcstat \ + usr.sbin/pmcstudy \ usr.sbin/portsnap/make_index \ usr.sbin/portsnap/phttpget \ usr.sbin/portsnap/portsnap \ @@ -785,6 +786,7 @@ DIRDEPS+= \ usr.sbin/wpa/wpa_supplicant \ usr.sbin/yp_mkdb \ usr.sbin/ypbind \ + usr.sbin/ypldap \ usr.sbin/yppoll \ usr.sbin/yppush \ usr.sbin/ypserv \ Modified: head/targets/pseudo/userland/cddl/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/cddl/Makefile.depend Wed Aug 31 19:30:52 2016 (r305147) +++ head/targets/pseudo/userland/cddl/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -21,6 +21,7 @@ DIRDEPS = \ cddl/usr.sbin/dtruss \ cddl/usr.sbin/lockstat \ cddl/usr.sbin/plockstat \ + cddl/usr.sbin/zfsd \ DIRDEPS.ZFS = \ Modified: head/targets/pseudo/userland/libexec/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/libexec/Makefile.depend Wed Aug 31 19:30:52 2016 (r305147) +++ head/targets/pseudo/userland/libexec/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -45,4 +45,13 @@ DIRDEPS = \ DIRDEPS+= libexec/blacklistd-helper .endif +.if ${MK_DMAGENT} != "no" +DIRDEPS+= libexec/dma/dma-mbox-create +DIRDEPS+= libexec/dma/dmagent +.endif + +.if ${MK_MAN_UTILS} != "no" +DIRDEPS+= libexec/makewhatis.local +.endif + .include Added: head/tests/sys/pjdfstest/pjdfstest/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/pjdfstest/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/tests/sys/sys/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/sys/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,19 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/atf/libatf-c \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/bsdcat/tests/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/bsdcat/tests/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,25 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libarchive \ + lib/libbz2 \ + lib/libc \ + lib/libcompiler_rt \ + lib/libexpat \ + lib/liblzma \ + lib/libthr \ + lib/libz \ + secure/lib/libcrypto \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/sdiff/tests/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/tests/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.bin/xinstall/tests/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xinstall/tests/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.sbin/extattr/tests/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/extattr/tests/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.sbin/pmcstudy/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstudy/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/usr.sbin/ypldap/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ypldap/Makefile.depend Wed Aug 31 19:30:59 2016 (r305148) @@ -0,0 +1,25 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/rpc \ + include/rpcsvc \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/libevent \ + lib/libopenbsd \ + lib/librpcsvc \ + lib/libutil \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif From owner-svn-src-head@freebsd.org Wed Aug 31 19:37: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 C32C9BCAC35; Wed, 31 Aug 2016 19:37:11 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9399F29DB; Wed, 31 Aug 2016 19:37:11 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VJbAAr076226; Wed, 31 Aug 2016 19:37:10 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VJbASV076225; Wed, 31 Aug 2016 19:37:10 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201608311937.u7VJbASV076225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 31 Aug 2016 19:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305149 - head/sys/arm/ti 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.22 Precedence: list List-Id: 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, 31 Aug 2016 19:37:11 -0000 Author: loos Date: Wed Aug 31 19:37:10 2016 New Revision: 305149 URL: https://svnweb.freebsd.org/changeset/base/305149 Log: All the TI platforms are FDT based and it is not necessary to enumerate the hinted children (there wont be any). Spotted by: gonzo Modified: head/sys/arm/ti/ti_scm.c Modified: head/sys/arm/ti/ti_scm.c ============================================================================== --- head/sys/arm/ti/ti_scm.c Wed Aug 31 19:30:59 2016 (r305148) +++ head/sys/arm/ti/ti_scm.c Wed Aug 31 19:37:10 2016 (r305149) @@ -133,7 +133,6 @@ ti_scm_attach(device_t dev) /* Attach platform extensions, if any. */ bus_generic_probe(dev); - bus_enumerate_hinted_children(dev); return (bus_generic_attach(dev)); } From owner-svn-src-head@freebsd.org Wed Aug 31 19:40: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 2BF63BCADCC; Wed, 31 Aug 2016 19:40:11 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::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 EAE6D2C44; Wed, 31 Aug 2016 19:40:10 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id e124so27767450ith.0; Wed, 31 Aug 2016 12:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pQUZ4p1JpzB04uPjMhQ8aePF5ChDHKQ3/upok5yHPOU=; b=Q9rR+tPhrZQiuAJRy8FQvJsNDeMjKxfNCSJqlMzuvksPTpCRfDiAe6TxQa9nojOlS4 ikS+BvFAp0kNHW3S3TQaW6PcXi3q9C6To5Ll9Gke6Gpr4rLQ1rrOBr9Yo1lwpQnM2L5L uzk695d1eUjcPvmzpI9MtvHyzpwNJAIgXggyJXU3QUzLAUpOJrPBfOXFPc8DvN2wLfsv 5iSkFVVsV8iKFksD5pWJIu20hpDWCcY9oETPWABqm5g/jUUjm/B2wMngIC1mVC8iK92H HKfx7Fs3Saa+olvtfhUvec1AlXpEJlFfJubosP/7R91hh2eFZze1FgE4XdLsDeo7FYRk SIXw== 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; bh=pQUZ4p1JpzB04uPjMhQ8aePF5ChDHKQ3/upok5yHPOU=; b=Fzsr3jwCq8smEjgjZwa+/qoewCgSI7ZFuokLjpApvl9q+ZTgXP9UDm0zJLWENRfMfI /E0aWIz5QgX/d8oPJQ1HpFVSxaPpTqDU0JS58D32rpX2iZFm6n2EmqRw1nrlqHDD4O5X yj99rfFhgiBV2KzX+0jU6u7pVMoQPR4D/igI28iVOl3RTva7DfywV+16xjcFM0/iR3FM UluomLhldcQ9E3SmkqQP+0enM118muN3Jm/Zuxv+GVqqk16VVjM+FgcU3mcmSlm5P16r /6m9ja9DmLZ9TyO1HMCfa72U1YpuZHLjNvvMyMHcuNrK7ywqXTIopbEdwRk5i+9m4SQ5 LLrg== X-Gm-Message-State: AE9vXwPMkJ6y0G5p+f0rcfQNV2unXUDNHvO55qdyDyHzTR3EbnZta4m1Oc6bUBMGQdmns9fMl6I6f11FnaTDvw== X-Received: by 10.36.223.196 with SMTP id r187mr16858457itg.2.1472672410398; Wed, 31 Aug 2016 12:40:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.16.92 with HTTP; Wed, 31 Aug 2016 12:40:10 -0700 (PDT) In-Reply-To: References: <201608310722.u7V7MEvA094475@repo.freebsd.org> From: Luiz Otavio O Souza Date: Wed, 31 Aug 2016 16:40:10 -0300 Message-ID: Subject: Re: svn commit: r305114 - head/sys/arm/ti To: Oleksandr Tymoshenko Cc: Luiz Otavio O Souza , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 19:40:11 -0000 On Wed, Aug 31, 2016 at 3:54 PM, wrote: > >> On Aug 31, 2016, at 12:22 AM, Luiz Otavio O Souza wrote: >> >> Author: loos >> Date: Wed Aug 31 07:22:14 2016 >> New Revision: 305114 >> URL: https://svnweb.freebsd.org/changeset/base/305114 >> >> Log: >> Allow the use of control module extensions to cope with specific platform >> features. >> >> Sponsored by: Rubicon Communications, LLC (Netgate) >> >> Modified: >> head/sys/arm/ti/ti_scm.c >> >> Modified: head/sys/arm/ti/ti_scm.c >> ============================================================================== >> --- head/sys/arm/ti/ti_scm.c Wed Aug 31 07:03:06 2016 (r305113) >> +++ head/sys/arm/ti/ti_scm.c Wed Aug 31 07:22:14 2016 (r305114) >> @@ -131,7 +131,11 @@ ti_scm_attach(device_t dev) >> >> ti_scm_sc = sc; >> >> - return (0); >> + /* Attach platform extensions, if any. */ >> + bus_generic_probe(dev); >> + bus_enumerate_hinted_children(dev); >> + >> + return (bus_generic_attach(dev)); >> } > > Is bus_enumerate_hinted_children really required? I think all TI platforms are FDT-compatible No, it is not required. Fixed in r305149. Thanks! Luiz From owner-svn-src-head@freebsd.org Wed Aug 31 20:38: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 BBCCABCA5C6; Wed, 31 Aug 2016 20:38:41 +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 6FB3E2C76; Wed, 31 Aug 2016 20:38:41 +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 u7VKcerE099048; Wed, 31 Aug 2016 20:38:40 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VKce8M099047; Wed, 31 Aug 2016 20:38:40 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201608312038.u7VKce8M099047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 31 Aug 2016 20:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305154 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 20:38:41 -0000 Author: jilles Date: Wed Aug 31 20:38:40 2016 New Revision: 305154 URL: https://svnweb.freebsd.org/changeset/base/305154 Log: directory(3): Deprecate readdir_r(). Clarify dirent buffers. In existing implementations including FreeBSD, there is no reason to use readdir_r() in the common case where potentially multiple threads each list their own directory. Code using readdir() is simpler. What's more, lthough readdir_r() can safely be used on FreeBSD because NAME_MAX is forced to 255, it cannot be used safely on systems where {NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes. Deprecating readdir_r() in POSIX has been proposed in http://www.austingroupbugs.net/view.php?id=696 and glibc wants to deprecate it as well. Reviewed by: ed, wblock MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7678 Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Wed Aug 31 20:33:59 2016 (r305153) +++ head/lib/libc/gen/directory.3 Wed Aug 31 20:38:40 2016 (r305154) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 19, 2016 +.Dd August 31, 2016 .Dt DIRECTORY 3 .Os .Sh NAME @@ -68,6 +68,15 @@ .Ft int .Fn dirfd "DIR *dirp" .Sh DESCRIPTION +.Bf -symbolic +The +.Fn readdir_r +interface is deprecated +because it cannot be used correctly unless +.Brq Va NAME_MAX +is a fixed value. +.Ef +.Pp The .Fn opendir function @@ -122,7 +131,13 @@ The .Fn readdir function returns a pointer to the next directory entry. -It returns +The directory entry remains valid until the next call to +.Fn readdir +or +.Fn closedir +on the same +.Em directory stream . +The function returns .Dv NULL upon reaching the end of the directory or on error. In the event of an error, @@ -139,6 +154,13 @@ provides the same functionality as but the caller must provide a directory .Fa entry buffer to store the results in. +The buffer must be large enough for a +.Vt struct dirent +with a +.Va d_name +array with +.Brq Va NAME_MAX ++ 1 elements. If the read succeeds, .Fa result is pointed at the From owner-svn-src-head@freebsd.org Wed Aug 31 21:04: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 B9F8ABCACAD; Wed, 31 Aug 2016 21:04:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CDA6128; Wed, 31 Aug 2016 21:04:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7VL4wpd010377; Wed, 31 Aug 2016 21:04:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VL4wO2010376; Wed, 31 Aug 2016 21:04:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608312104.u7VL4wO2010376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 Aug 2016 21:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305155 - head/contrib/elftoolchain/readelf 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.22 Precedence: list List-Id: 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, 31 Aug 2016 21:04:59 -0000 Author: emaste Date: Wed Aug 31 21:04:58 2016 New Revision: 305155 URL: https://svnweb.freebsd.org/changeset/base/305155 Log: readelf: silence GCC 4.2.1 uninitialized variable warning Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Aug 31 20:38:40 2016 (r305154) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Aug 31 21:04:58 2016 (r305155) @@ -2831,6 +2831,8 @@ dump_rel(struct readelf *re, struct sect type2 = (type >> 8) & 0xFF; type3 = (type >> 16) & 0xFF; type = type & 0xFF; + } else { + type2 = type3 = 0; } if (re->options & RE_WW) printf("%16.16jx %16.16jx %-24.24s" @@ -2914,6 +2916,8 @@ dump_rela(struct readelf *re, struct sec type2 = (type >> 8) & 0xFF; type3 = (type >> 16) & 0xFF; type = type & 0xFF; + } else { + type2 = type3 = 0; } if (re->options & RE_WW) printf("%16.16jx %16.16jx %-24.24s" From owner-svn-src-head@freebsd.org Wed Aug 31 21:12: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 34DD5BCAEAD; Wed, 31 Aug 2016 21:12:52 +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 F34D880C; Wed, 31 Aug 2016 21:12:51 +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 u7VLCpkQ014020; Wed, 31 Aug 2016 21:12:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VLCpP2014019; Wed, 31 Aug 2016 21:12:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608312112.u7VLCpP2014019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 Aug 2016 21:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305156 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 21:12:52 -0000 Author: emaste Date: Wed Aug 31 21:12:50 2016 New Revision: 305156 URL: https://svnweb.freebsd.org/changeset/base/305156 Log: users: don't build when we don't have a C++ toolchain (On RISC-V MK_CXX is in BROKEN_OPTIONS, so users remains skipped there.) Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D7725 Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Wed Aug 31 21:04:58 2016 (r305155) +++ head/usr.bin/Makefile Wed Aug 31 21:12:50 2016 (r305156) @@ -294,7 +294,7 @@ 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 +.if ${MK_CXX} != "no" SUBDIR.${MK_UTMPX}+= users .endif SUBDIR.${MK_UTMPX}+= who From owner-svn-src-head@freebsd.org Wed Aug 31 21:16: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 8EA76BCA1AF; Wed, 31 Aug 2016 21:16:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 491D8CC7; Wed, 31 Aug 2016 21:16:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::ccba:c7:f08e:333b] (unknown [IPv6:2001:7b8:3a7:0:ccba:c7:f08e:333b]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6136B144A; Wed, 31 Aug 2016 23:15:57 +0200 (CEST) Subject: Re: svn commit: r304510 - head/sys/dev/ixl Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5741C9D5-2E57-417C-AC67-014BAD53BCA3"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6.1 From: Dimitry Andric In-Reply-To: Date: Wed, 31 Aug 2016 23:15:43 +0200 Cc: Eric Joyner , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <8A65E29F-1DF1-44F4-9E38-FFC038EE52E7@FreeBSD.org> References: <201608200008.u7K08Bok069627@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 21:16:06 -0000 --Apple-Mail=_5741C9D5-2E57-417C-AC67-014BAD53BCA3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 31 Aug 2016, at 18:53, Ed Maste wrote: >=20 > On 19 August 2016 at 20:08, Eric Joyner wrote: >> Author: erj >> Date: Sat Aug 20 00:08:10 2016 >> New Revision: 304510 >> URL: https://svnweb.freebsd.org/changeset/base/304510 >>=20 >> Log: >> ixlv(4): Fix ixlv(4) not loading when loaded as a kernel module and = netmap is enabled. >=20 > I did not confirm it's this commit, but kernel builds currently have > this warning: >=20 > if_ixlv.o: warning: common of `ixl_crcstrip' overridden by definition > if_ixl.o: warning: defined here > if_ixlv.o: warning: multiple common of `ixl_rx_miss' > if_ixl.o: warning: previous common is here > if_ixlv.o: warning: multiple common of `ixl_rx_miss_bufs' > if_ixl.o: warning: previous common is here Interestingly, with the external gcc build, it is even an error: --- kernel.full --- linking kernel.full if_ixlv.o:(.bss+0x0): multiple definition of `ixl_crcstrip' if_ixl.o:(.data+0xb8): first defined here if_ixlv.o: In function `ixlv_media_change': /builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixlv.c:2252: multiple = definition of `ixl_rx_miss_bufs' if_ixl.o:/builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixl.c:680: first = defined here if_ixlv.o: In function `ixlv_media_change': /builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixlv.c:2262: multiple = definition of `ixl_rx_miss' if_ixl.o:/builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixl.c:681: first = defined here *** [kernel.full] Error code 1 See e.g. = https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1505/console -Dimitry --Apple-Mail=_5741C9D5-2E57-417C-AC67-014BAD53BCA3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlfHSQwACgkQsF6jCi4glqMaHgCdG2AYAycOljwu1KMtbWlokOym 9vAAn1fT4Spi/0GV3cMcmVMWKn34caqc =DgwE -----END PGP SIGNATURE----- --Apple-Mail=_5741C9D5-2E57-417C-AC67-014BAD53BCA3-- From owner-svn-src-head@freebsd.org Wed Aug 31 21:35: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 A3BCABCA762; Wed, 31 Aug 2016 21:35:39 +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 5C872D1B; Wed, 31 Aug 2016 21:35:39 +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 u7VLZcgQ022042; Wed, 31 Aug 2016 21:35:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VLZcs9022040; Wed, 31 Aug 2016 21:35:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608312135.u7VLZcs9022040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 Aug 2016 21:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305160 - in head/sys/boot/efi: boot1 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.22 Precedence: list List-Id: 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, 31 Aug 2016 21:35:39 -0000 Author: emaste Date: Wed Aug 31 21:35:38 2016 New Revision: 305160 URL: https://svnweb.freebsd.org/changeset/base/305160 Log: Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds Reviewed by: rpokala MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7633 Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Wed Aug 31 21:35:12 2016 (r305159) +++ head/sys/boot/efi/boot1/Makefile Wed Aug 31 21:35:38 2016 (r305160) @@ -89,11 +89,15 @@ EFI_TARGET= efi-app-ia32 EFI_TARGET= binary .endif +# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 +# for build reproducibility. +SOURCE_DATE_EPOCH?=1451606400 boot1.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ fi + SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame \ Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Wed Aug 31 21:35:12 2016 (r305159) +++ head/sys/boot/efi/loader/Makefile Wed Aug 31 21:35:38 2016 (r305160) @@ -131,11 +131,15 @@ EFI_TARGET= efi-app-ia32 EFI_TARGET= binary .endif +# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 +# for build reproducibility. +SOURCE_DATE_EPOCH?=1451606400 loader.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ fi + SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ From owner-svn-src-head@freebsd.org Wed Aug 31 21:48: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 2E6BEBCAD0D; Wed, 31 Aug 2016 21:48:24 +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 D8F3DBA6; Wed, 31 Aug 2016 21:48:23 +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 u7VLmNPG025964; Wed, 31 Aug 2016 21:48:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VLmN3d025963; Wed, 31 Aug 2016 21:48:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608312148.u7VLmN3d025963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 31 Aug 2016 21:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305164 - 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.22 Precedence: list List-Id: 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, 31 Aug 2016 21:48:24 -0000 Author: markj Date: Wed Aug 31 21:48:22 2016 New Revision: 305164 URL: https://svnweb.freebsd.org/changeset/base/305164 Log: Rename unp_dispose_so() to unp_dispose(). It implements the dom_dispose method for local socket domain, so its name should match the method name. Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Aug 31 21:41:32 2016 (r305163) +++ head/sys/kern/uipc_usrreq.c Wed Aug 31 21:48:22 2016 (r305164) @@ -277,8 +277,8 @@ static int unp_connectat(int, struct soc struct thread *); static int unp_connect2(struct socket *so, struct socket *so2, int); static void unp_disconnect(struct unpcb *unp, struct unpcb *unp2); -static void unp_dispose(struct mbuf *); -static void unp_dispose_so(struct socket *so); +static void unp_dispose(struct socket *so); +static void unp_dispose_mbuf(struct mbuf *); static void unp_shutdown(struct unpcb *); static void unp_drop(struct unpcb *); static void unp_gc(__unused void *, int); @@ -335,7 +335,7 @@ static struct domain localdomain = { .dom_name = "local", .dom_init = unp_init, .dom_externalize = unp_externalize, - .dom_dispose = unp_dispose_so, + .dom_dispose = unp_dispose, .dom_protosw = localsw, .dom_protoswNPROTOSW = &localsw[nitems(localsw)] }; @@ -1051,7 +1051,7 @@ uipc_send(struct socket *so, int flags, UNP_LINK_RUNLOCK(); if (control != NULL && error != 0) - unp_dispose(control); + unp_dispose_mbuf(control); release: if (control != NULL) @@ -2352,7 +2352,7 @@ unp_gc(__unused void *arg, int pending) } static void -unp_dispose(struct mbuf *m) +unp_dispose_mbuf(struct mbuf *m) { if (m) @@ -2363,7 +2363,7 @@ unp_dispose(struct mbuf *m) * Synchronize against unp_gc, which can trip over data as we are freeing it. */ static void -unp_dispose_so(struct socket *so) +unp_dispose(struct socket *so) { struct unpcb *unp; @@ -2371,7 +2371,7 @@ unp_dispose_so(struct socket *so) UNP_LIST_LOCK(); unp->unp_gcflag |= UNPGC_IGNORE_RIGHTS; UNP_LIST_UNLOCK(); - unp_dispose(so->so_rcv.sb_mb); + unp_dispose_mbuf(so->so_rcv.sb_mb); } static void From owner-svn-src-head@freebsd.org Wed Aug 31 21:48: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 A5FA1BCAD50; Wed, 31 Aug 2016 21:48:41 +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 8AC4ED09; Wed, 31 Aug 2016 21:48:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8369C18B1; Wed, 31 Aug 2016 21:48:41 +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 3A56723EE4; Wed, 31 Aug 2016 21:48:41 +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 XavbI9m3UoT0; Wed, 31 Aug 2016 21:48:38 +0000 (UTC) Subject: Re: svn commit: r305012 - in head/lib/libc: amd64/sys arm/sys i386/sys include mips/sys powerpc/sys powerpc64/sys sparc64/sys sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7C5E623EDE To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608291847.u7TIlpkS056969@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Wed, 31 Aug 2016 14:48:34 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608291847.u7TIlpkS056969@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EqwhFid9K4O3i8g1I559XlSeWixfWj2Wc" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 31 Aug 2016 21:48:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EqwhFid9K4O3i8g1I559XlSeWixfWj2Wc Content-Type: multipart/mixed; boundary="OV7HamO5EJ7LMKMSpGJAHL6emNjJGwP4w" From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r305012 - in head/lib/libc: amd64/sys arm/sys i386/sys include mips/sys powerpc/sys powerpc64/sys sparc64/sys sys References: <201608291847.u7TIlpkS056969@repo.freebsd.org> In-Reply-To: <201608291847.u7TIlpkS056969@repo.freebsd.org> --OV7HamO5EJ7LMKMSpGJAHL6emNjJGwP4w Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/29/16 11:47 AM, Konstantin Belousov wrote: > Author: kib > Date: Mon Aug 29 18:47:51 2016 > New Revision: 305012 > URL: https://svnweb.freebsd.org/changeset/base/305012 >=20 > Log: > Rewrite ptrace(2) wrappers in C. > Besides removing hand-translation to assembler, this also adds missin= g > wrappers for arm64 and risc-v. > =20 > Reviewed by: emaste, jhb > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D7694 >=20 > Added: > head/lib/libc/sys/ptrace.c (contents, props changed) > Deleted: > head/lib/libc/amd64/sys/ptrace.S > head/lib/libc/arm/sys/ptrace.S > head/lib/libc/i386/sys/ptrace.S > head/lib/libc/mips/sys/ptrace.S > head/lib/libc/powerpc/sys/ptrace.S > head/lib/libc/powerpc64/sys/ptrace.S > head/lib/libc/sparc64/sys/ptrace.S There is a known bug with "FAST_DEPEND" (which is default and the only way now) which may result in something like: > cc: error: no such file or directory: '/usr/src/lib/libc/amd64/sys/ptra= ce.S' I am working on a fix, but in the meantime a workaround is 'make cleandepend', or removing the .depend.ptrace.* files in the lib/libc object directories. --=20 Regards, Bryan Drewery --OV7HamO5EJ7LMKMSpGJAHL6emNjJGwP4w-- --EqwhFid9K4O3i8g1I559XlSeWixfWj2Wc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXx1CzAAoJEDXXcbtuRpfPSUAH/jIZe9Bk4O7dWGZDQjaQ3KpK lObR8j8bRBeaZrq86K50QfFVPP6+BRavFWw2SHpKetLU1bxwXqVw8KSMtMQ2KtIn Zp8dFbWHwkGHYADf9Q0axV0cN+icFqwvt+14MvDn99QuyoJ2jbuOFiz48ytNPzHd qwtBUmyIBBCU0AIGn8tBPi2tPbG+z6lcVe3rAepLDXDuaIM3y6Q4hAyZd2vmS+Gz my9wW20ZvFXxU1/aWHVfqAZxcONO2fJW/B2uHyvkoViQ1j15xs0+FfydaojmGFhs z42N3efEw5DJ3ja0a+2b+7fqMaGjLQHhCgPMw5iGT76rxwe2/bMXShbMXs3xE4w= =C/k5 -----END PGP SIGNATURE----- --EqwhFid9K4O3i8g1I559XlSeWixfWj2Wc-- From owner-svn-src-head@freebsd.org Wed Aug 31 22:49: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 C4BDABCA9C1; Wed, 31 Aug 2016 22:49:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d: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 8F429A5C; Wed, 31 Aug 2016 22:49:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22d.google.com with SMTP id v123so67378866qkh.2; Wed, 31 Aug 2016 15:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=o5sYKhH8EZ2NDVCkTHHUatn1OJw3x2wgsvo5IIvEy7I=; b=Hngr45GY4HlYLW+iV6NAX7o3fQPkmufQscaOmUx5LPKHHx8HiSC6qsAbQ/gmz0Wwu1 LADfUeUOyQ5pqRBhg5cZVphf0WwOC8HHh49U4XQAtGBdPusCabG5h5QHEBaQXwdSsXXU u2q68G/fPyEOcGRO9qO54SflA1xJoYUY89Xxor61yDIyikxy7taaOc6grHJPE1kzS+M/ GbiJvl0nYYPajTlo8dN6k05WXoigRbdI/IclO8ZGdnHkDrW103L2399pTrhxVsAyMHwz ZJoM+fdjoT3m3qEKgJicb7zOhboqt2e+a+y+GkCIaR4/BfuWLXt611yhoj9G0uQ82R5p T4/Q== 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; bh=o5sYKhH8EZ2NDVCkTHHUatn1OJw3x2wgsvo5IIvEy7I=; b=EBNs7M1s2jHUPxfkfbBCe5cGAc0RROmSV+qetwIgnzOihfHGcb8/2bL2mJzo8nC5dg yPTH3MWcPo3w155mkmbZNckbwy7n0T+ah4gRuKa8jTAiL7z6l7mrY0EwLGYMj45/sk44 Fi25StC0KFSSAkM52k8bgowJuevaSwmF7cNdAyNjmJJmucXxsbR81SnvlSeZIg2nOI9B 4wUsng7Csd01R5JQWxfEfGU3UDQadipCAdPsd8FR7spnMW1HKxyuPAxaHtXPt21tzkIm 6p6KVfONkQPHhhPEefRsKWPLshqh5BlitXX3aeNxWoCNG/LPZtQ68Egt/KrIGGR1EqF+ Iiow== X-Gm-Message-State: AE9vXwM98w8tlB6NMO1lPizHHicppzA2W8Z7TcHVcXDlesGGwSfu6f6fyHvzj7HoMc+PwCLG6Y4irUtqhuKQLQ== X-Received: by 10.55.87.135 with SMTP id l129mr14425396qkb.0.1472683774583; Wed, 31 Aug 2016 15:49:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.182.134 with HTTP; Wed, 31 Aug 2016 15:49:34 -0700 (PDT) In-Reply-To: <8A65E29F-1DF1-44F4-9E38-FFC038EE52E7@FreeBSD.org> References: <201608200008.u7K08Bok069627@repo.freebsd.org> <8A65E29F-1DF1-44F4-9E38-FFC038EE52E7@FreeBSD.org> From: Ngie Cooper Date: Wed, 31 Aug 2016 15:49:34 -0700 Message-ID: Subject: Re: svn commit: r304510 - head/sys/dev/ixl To: Dimitry Andric Cc: Ed Maste , Eric Joyner , "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.22 Precedence: list List-Id: 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, 31 Aug 2016 22:49:35 -0000 On Wed, Aug 31, 2016 at 2:15 PM, Dimitry Andric wrote: ... > Interestingly, with the external gcc build, it is even an error: > > --- kernel.full --- > linking kernel.full > if_ixlv.o:(.bss+0x0): multiple definition of `ixl_crcstrip' > if_ixl.o:(.data+0xb8): first defined here > if_ixlv.o: In function `ixlv_media_change': > /builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixlv.c:2252: multiple definition of `ixl_rx_miss_bufs' > if_ixl.o:/builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixl.c:680: first defined here > if_ixlv.o: In function `ixlv_media_change': > /builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixlv.c:2262: multiple definition of `ixl_rx_miss' > if_ixl.o:/builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixl.c:681: first defined here > *** [kernel.full] Error code 1 > > See e.g. https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1505/console +1: linking kernel.full if_ixlv.o: warning: common of `ixl_crcstrip' overridden by definition if_ixl.o: warning: defined here if_ixlv.o: warning: multiple common of `ixl_rx_miss' if_ixl.o: warning: previous common is here if_ixlv.o: warning: multiple common of `ixl_rx_miss_bufs' if_ixl.o: warning: previous common is here From owner-svn-src-head@freebsd.org Wed Aug 31 23:23: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 CBE1CBC94CB; Wed, 31 Aug 2016 23:23:47 +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 9A942DD3; Wed, 31 Aug 2016 23:23:47 +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 u7VNNkBj063202; Wed, 31 Aug 2016 23:23:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7VNNkZS063197; Wed, 31 Aug 2016 23:23:46 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608312323.u7VNNkZS063197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 31 Aug 2016 23:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305166 - in head/sys/dev/cxgbe: cxgbei 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.22 Precedence: list List-Id: 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, 31 Aug 2016 23:23:47 -0000 Author: np Date: Wed Aug 31 23:23:46 2016 New Revision: 305166 URL: https://svnweb.freebsd.org/changeset/base/305166 Log: cxgbe/t4_tom: Add general purpose routines to deal with page pod regions and allocations within them. Switch to these routines to manage the TOE DDP region. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Wed Aug 31 22:18:50 2016 (r305165) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Wed Aug 31 23:23:46 2016 (r305166) @@ -157,7 +157,6 @@ ulp_mem_io_set_hdr(struct adapter *sc, i idata->len = htonl(dlen); } -#define PPOD_SIZE sizeof(struct pagepod) #define ULPMEM_IDATA_MAX_NPPODS 1 /* 256/PPOD_SIZE */ #define PCIE_MEMWIN_MAX_NPPODS 16 /* 1024/PPOD_SIZE */ Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Wed Aug 31 22:18:50 2016 (r305165) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Wed Aug 31 23:23:46 2016 (r305166) @@ -85,44 +85,11 @@ static void ddp_complete_all(struct toep static void t4_aio_cancel_active(struct kaiocb *job); static void t4_aio_cancel_queued(struct kaiocb *job); -#define PPOD_SZ(n) ((n) * sizeof(struct pagepod)) -#define PPOD_SIZE (PPOD_SZ(1)) - static TAILQ_HEAD(, pageset) ddp_orphan_pagesets; static struct mtx ddp_orphan_pagesets_lock; static struct task ddp_orphan_task; #define MAX_DDP_BUFFER_SIZE (M_TCB_RX_DDP_BUF0_LEN) -static int -alloc_ppods(struct tom_data *td, int n, u_int *ppod_addr) -{ - vmem_addr_t v; - int rc; - - MPASS(n > 0); - - rc = vmem_alloc(td->ppod_arena, PPOD_SZ(n), M_NOWAIT | M_FIRSTFIT, &v); - *ppod_addr = (u_int)v; - - return (rc); -} - -static void -free_ppods(struct tom_data *td, u_int ppod_addr, int n) -{ - - MPASS(n > 0); - - vmem_free(td->ppod_arena, (vmem_addr_t)ppod_addr, PPOD_SZ(n)); -} - -static inline int -pages_to_nppods(int npages, int ddp_pgsz) -{ - int nsegs = npages * PAGE_SIZE / ddp_pgsz; - - return (howmany(nsegs, PPOD_PAGES)); -} /* * A page set holds information about a buffer used for DDP. The page @@ -147,8 +114,8 @@ free_pageset(struct tom_data *td, struct vm_page_t p; int i; - if (ps->nppods > 0) - free_ppods(td, ps->ppod_addr, ps->nppods); + if (ps->prsv.prsv_nppods > 0) + t4_free_page_pods(&ps->prsv); if (ps->flags & PS_WIRED) { for (i = 0; i < ps->npages; i++) { @@ -483,7 +450,7 @@ mk_update_tcb_for_ddp(struct adapter *sc ulpmc = mk_set_tcb_field_ulp(ulpmc, toep, W_TCB_RX_DDP_BUF0_TAG + db_idx, V_TCB_RX_DDP_BUF0_TAG(M_TCB_RX_DDP_BUF0_TAG), - V_TCB_RX_DDP_BUF0_TAG(ps->tag)); + V_TCB_RX_DDP_BUF0_TAG(ps->prsv.prsv_tag)); /* Update the current offset in the DDP buffer and its total length */ if (db_idx == 0) @@ -879,13 +846,52 @@ calculate_hcf(int n1, int n2) return (b); } +static inline int +pages_to_nppods(int npages, int ddp_page_shift) +{ + + MPASS(ddp_page_shift >= PAGE_SHIFT); + + return (howmany(npages >> (ddp_page_shift - PAGE_SHIFT), PPOD_PAGES)); +} + static int -alloc_page_pods(struct tom_data *td, struct pageset *ps) +alloc_page_pods(struct ppod_region *pr, u_int nppods, u_int pgsz_idx, + struct ppod_reservation *prsv) { - int i, hcf, seglen, idx, ppod, nppods; - u_int ppod_addr; + vmem_addr_t addr; /* relative to start of region */ + + if (vmem_alloc(pr->pr_arena, PPOD_SZ(nppods), M_NOWAIT | M_FIRSTFIT, + &addr) != 0) + return (ENOMEM); + + CTR5(KTR_CXGBE, "%-17s arena %p, addr 0x%08x, nppods %d, pgsz %d", + __func__, pr->pr_arena, (uint32_t)addr & pr->pr_tag_mask, + nppods, 1 << pr->pr_page_shift[pgsz_idx]); + + /* + * The hardware tagmask includes an extra invalid bit but the arena was + * seeded with valid values only. An allocation out of this arena will + * fit inside the tagmask but won't have the invalid bit set. + */ + MPASS((addr & pr->pr_tag_mask) == addr); + MPASS((addr & pr->pr_invalid_bit) == 0); + + prsv->prsv_pr = pr; + prsv->prsv_tag = V_PPOD_PGSZ(pgsz_idx) | addr; + prsv->prsv_nppods = nppods; + + return (0); +} + +int +t4_alloc_page_pods_for_ps(struct ppod_region *pr, struct pageset *ps) +{ + int i, hcf, seglen, idx, nppods; + struct ppod_reservation *prsv = &ps->prsv; - KASSERT(ps->nppods == 0, ("%s: page pods already allocated", __func__)); + KASSERT(prsv->prsv_nppods == 0, + ("%s: page pods already allocated", __func__)); /* * The DDP page size is unrelated to the VM page size. We combine @@ -905,79 +911,85 @@ alloc_page_pods(struct tom_data *td, str } hcf = calculate_hcf(hcf, seglen); - if (hcf < td->ddp_pgsz[1]) { + if (hcf < (1 << pr->pr_page_shift[1])) { idx = 0; goto have_pgsz; /* give up, short circuit */ } } - if (hcf % td->ddp_pgsz[0] != 0) { - /* hmmm. This could only happen when PAGE_SIZE < 4K */ - KASSERT(PAGE_SIZE < 4096, - ("%s: PAGE_SIZE %d, hcf %d", __func__, PAGE_SIZE, hcf)); - CTR3(KTR_CXGBE, "%s: PAGE_SIZE %d, hcf %d", - __func__, PAGE_SIZE, hcf); - return (0); - } - - for (idx = nitems(td->ddp_pgsz) - 1; idx > 0; idx--) { - if (hcf % td->ddp_pgsz[idx] == 0) +#define PR_PAGE_MASK(x) ((1 << pr->pr_page_shift[(x)]) - 1) + MPASS((hcf & PR_PAGE_MASK(0)) == 0); /* PAGE_SIZE is >= 4K everywhere */ + for (idx = nitems(pr->pr_page_shift) - 1; idx > 0; idx--) { + if ((hcf & PR_PAGE_MASK(idx)) == 0) break; } +#undef PR_PAGE_MASK + have_pgsz: MPASS(idx <= M_PPOD_PGSZ); - nppods = pages_to_nppods(ps->npages, td->ddp_pgsz[idx]); - if (alloc_ppods(td, nppods, &ppod_addr) != 0) { - CTR4(KTR_CXGBE, "%s: no pods, nppods %d, npages %d, pgsz %d", - __func__, nppods, ps->npages, td->ddp_pgsz[idx]); + nppods = pages_to_nppods(ps->npages, pr->pr_page_shift[idx]); + if (alloc_page_pods(pr, nppods, idx, prsv) != 0) return (0); - } - - ppod = (ppod_addr - td->ppod_start) / PPOD_SIZE; - ps->tag = V_PPOD_PGSZ(idx) | V_PPOD_TAG(ppod); - ps->ppod_addr = ppod_addr; - ps->nppods = nppods; - - CTR5(KTR_CXGBE, "New page pods. " - "ps %p, ddp_pgsz %d, ppod 0x%x, npages %d, nppods %d", - ps, td->ddp_pgsz[idx], ppod, ps->npages, ps->nppods); + MPASS(prsv->prsv_nppods > 0); return (1); } +void +t4_free_page_pods(struct ppod_reservation *prsv) +{ + struct ppod_region *pr = prsv->prsv_pr; + vmem_addr_t addr; + + MPASS(prsv != NULL); + MPASS(prsv->prsv_nppods != 0); + + addr = prsv->prsv_tag & pr->pr_tag_mask; + MPASS((addr & pr->pr_invalid_bit) == 0); + + CTR4(KTR_CXGBE, "%-17s arena %p, addr 0x%08x, nppods %d", __func__, + pr->pr_arena, addr, prsv->prsv_nppods); + + vmem_free(pr->pr_arena, addr, PPOD_SZ(prsv->prsv_nppods)); + prsv->prsv_nppods = 0; +} + #define NUM_ULP_TX_SC_IMM_PPODS (256 / PPOD_SIZE) -static int -write_page_pods(struct adapter *sc, struct toepcb *toep, struct pageset *ps) +int +t4_write_page_pods_for_ps(struct adapter *sc, struct sge_wrq *wrq, int tid, + struct pageset *ps) { struct wrqe *wr; struct ulp_mem_io *ulpmc; struct ulptx_idata *ulpsc; struct pagepod *ppod; - struct tom_data *td = sc->tom_softc; int i, j, k, n, chunk, len, ddp_pgsz, idx; u_int ppod_addr; uint32_t cmd; + struct ppod_reservation *prsv = &ps->prsv; + struct ppod_region *pr = prsv->prsv_pr; KASSERT(!(ps->flags & PS_PPODS_WRITTEN), ("%s: page pods already written", __func__)); + MPASS(prsv->prsv_nppods > 0); cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE)); if (is_t4(sc)) cmd |= htobe32(F_ULP_MEMIO_ORDER); else cmd |= htobe32(F_T5_ULP_MEMIO_IMM); - ddp_pgsz = td->ddp_pgsz[G_PPOD_PGSZ(ps->tag)]; - ppod_addr = ps->ppod_addr; - for (i = 0; i < ps->nppods; ppod_addr += chunk) { + ddp_pgsz = 1 << pr->pr_page_shift[G_PPOD_PGSZ(prsv->prsv_tag)]; + ppod_addr = pr->pr_start + (prsv->prsv_tag & pr->pr_tag_mask); + for (i = 0; i < prsv->prsv_nppods; ppod_addr += chunk) { /* How many page pods are we writing in this cycle */ - n = min(ps->nppods - i, NUM_ULP_TX_SC_IMM_PPODS); + n = min(prsv->prsv_nppods - i, NUM_ULP_TX_SC_IMM_PPODS); chunk = PPOD_SZ(n); len = roundup2(sizeof(*ulpmc) + sizeof(*ulpsc) + chunk, 16); - wr = alloc_wrqe(len, toep->ctrlq); + wr = alloc_wrqe(len, wrq); if (wr == NULL) return (ENOMEM); /* ok to just bail out */ ulpmc = wrtod(wr); @@ -995,7 +1007,7 @@ write_page_pods(struct adapter *sc, stru ppod = (struct pagepod *)(ulpsc + 1); for (j = 0; j < n; i++, j++, ppod++) { ppod->vld_tid_pgsz_tag_color = htobe64(F_PPOD_VALID | - V_PPOD_TID(toep->tid) | ps->tag); + V_PPOD_TID(tid) | prsv->prsv_tag); ppod->len_offset = htobe64(V_PPOD_LEN(ps->len) | V_PPOD_OFST(ps->offset)); ppod->rsvd = 0; @@ -1053,51 +1065,64 @@ prep_pageset(struct adapter *sc, struct if (!(ps->flags & PS_WIRED)) wire_pageset(ps); - if (ps->nppods == 0 && !alloc_page_pods(td, ps)) { + if (ps->prsv.prsv_nppods == 0 && + !t4_alloc_page_pods_for_ps(&td->pr, ps)) { return (0); } if (!(ps->flags & PS_PPODS_WRITTEN) && - write_page_pods(sc, toep, ps) != 0) { + t4_write_page_pods_for_ps(sc, toep->ctrlq, toep->tid, ps) != 0) { return (0); } return (1); } -void -t4_init_ddp(struct adapter *sc, struct tom_data *td) +int +t4_init_ppod_region(struct ppod_region *pr, struct t4_range *r, u_int psz, + const char *name) { int i; - uint32_t r; - r = t4_read_reg(sc, A_ULP_RX_TDDP_PSZ); - td->ddp_pgsz[0] = 4096 << G_HPZ0(r); - td->ddp_pgsz[1] = 4096 << G_HPZ1(r); - td->ddp_pgsz[2] = 4096 << G_HPZ2(r); - td->ddp_pgsz[3] = 4096 << G_HPZ3(r); + MPASS(pr != NULL); + MPASS(r->size > 0); - /* - * The SGL -> page pod algorithm requires the sizes to be in increasing - * order. - */ - for (i = 1; i < nitems(td->ddp_pgsz); i++) { - if (td->ddp_pgsz[i] <= td->ddp_pgsz[i - 1]) - return; - } + pr->pr_start = r->start; + pr->pr_len = r->size; + pr->pr_page_shift[0] = 12 + G_HPZ0(psz); + pr->pr_page_shift[1] = 12 + G_HPZ1(psz); + pr->pr_page_shift[2] = 12 + G_HPZ2(psz); + pr->pr_page_shift[3] = 12 + G_HPZ3(psz); + + /* The SGL -> page pod algorithm requires the sizes to be in order. */ + for (i = 1; i < nitems(pr->pr_page_shift); i++) { + if (pr->pr_page_shift[i] <= pr->pr_page_shift[i - 1]) + return (ENXIO); + } + + pr->pr_tag_mask = ((1 << fls(r->size)) - 1) & V_PPOD_TAG(M_PPOD_TAG); + pr->pr_alias_mask = V_PPOD_TAG(M_PPOD_TAG) & ~pr->pr_tag_mask; + if (pr->pr_tag_mask == 0 || pr->pr_alias_mask == 0) + return (ENXIO); + pr->pr_alias_shift = fls(pr->pr_tag_mask); + pr->pr_invalid_bit = 1 << (pr->pr_alias_shift - 1); + + pr->pr_arena = vmem_create(name, 0, pr->pr_len, PPOD_SIZE, 0, + M_FIRSTFIT | M_NOWAIT); + if (pr->pr_arena == NULL) + return (ENOMEM); - td->ppod_start = sc->vres.ddp.start; - td->ppod_arena = vmem_create("DDP page pods", sc->vres.ddp.start, - sc->vres.ddp.size, PPOD_SIZE, 512, M_FIRSTFIT | M_NOWAIT); + return (0); } void -t4_uninit_ddp(struct adapter *sc __unused, struct tom_data *td) +t4_free_ppod_region(struct ppod_region *pr) { - if (td->ppod_arena != NULL) { - vmem_destroy(td->ppod_arena); - td->ppod_arena = NULL; - } + MPASS(pr != NULL); + + if (pr->pr_arena) + vmem_destroy(pr->pr_arena); + bzero(pr, sizeof(*pr)); } static int Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Wed Aug 31 22:18:50 2016 (r305165) +++ head/sys/dev/cxgbe/tom/t4_tom.c Wed Aug 31 23:23:46 2016 (r305166) @@ -930,7 +930,7 @@ free_tom_data(struct adapter *sc, struct KASSERT(td->lctx_count == 0, ("%s: lctx hash table is not empty.", __func__)); - t4_uninit_ddp(sc, td); + t4_free_ppod_region(&td->pr); destroy_clip_table(sc, td); if (td->listen_mask != 0) @@ -1024,8 +1024,12 @@ t4_tom_activate(struct adapter *sc) if (rc != 0) goto done; - /* DDP page pods and CPL handlers */ - t4_init_ddp(sc, td); + rc = t4_init_ppod_region(&td->pr, &sc->vres.ddp, + t4_read_reg(sc, A_ULP_RX_TDDP_PSZ), "TDDP page pods"); + if (rc != 0) + goto done; + t4_set_reg_field(sc, A_ULP_RX_TDDP_TAGMASK, + V_TDDPTAGMASK(M_TDDPTAGMASK), td->pr.pr_tag_mask); /* CLIP table for IPv6 offload */ init_clip_table(sc, td); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Wed Aug 31 22:18:50 2016 (r305165) +++ head/sys/dev/cxgbe/tom/t4_tom.h Wed Aug 31 23:23:46 2016 (r305166) @@ -51,6 +51,9 @@ #define USE_DDP_RX_FLOW_CONTROL +#define PPOD_SZ(n) ((n) * sizeof(struct pagepod)) +#define PPOD_SIZE (PPOD_SZ(1)) + /* TOE PCB flags */ enum { TPF_ATTACHED = (1 << 0), /* a tcpcb refers to this toepcb */ @@ -83,16 +86,31 @@ struct ofld_tx_sdesc { uint8_t tx_credits; /* firmware tx credits (unit is 16B) */ }; +struct ppod_region { + u_int pr_start; + u_int pr_len; + u_int pr_page_shift[4]; + uint32_t pr_tag_mask; /* hardware tagmask for this region. */ + uint32_t pr_invalid_bit; /* OR with this to invalidate tag. */ + uint32_t pr_alias_mask; /* AND with tag to get alias bits. */ + u_int pr_alias_shift; /* shift this much for first alias bit. */ + vmem_t *pr_arena; +}; + +struct ppod_reservation { + struct ppod_region *prsv_pr; + uint32_t prsv_tag; /* Full tag: pgsz, alias, tag, color */ + u_int prsv_nppods; +}; + struct pageset { TAILQ_ENTRY(pageset) link; vm_page_t *pages; int npages; int flags; - u_int ppod_addr; - int nppods; - uint32_t tag; /* includes color, page pod addr, and DDP page size */ int offset; /* offset in first page */ int len; + struct ppod_reservation prsv; struct vmspace *vm; u_int vm_timestamp; }; @@ -239,9 +257,7 @@ struct tom_data { u_long listen_mask; int lctx_count; /* # of lctx in the hash table */ - u_int ppod_start; - u_int ddp_pgsz[4]; - vmem_t *ppod_arena; + struct ppod_region pr; struct mtx clip_table_lock; struct clip_head clip_table; @@ -346,8 +362,13 @@ void t4_push_pdus(struct adapter *sc, st int do_set_tcb_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); /* t4_ddp.c */ -void t4_init_ddp(struct adapter *, struct tom_data *); -void t4_uninit_ddp(struct adapter *, struct tom_data *); +int t4_init_ppod_region(struct ppod_region *, struct t4_range *, u_int, + const char *); +void t4_free_ppod_region(struct ppod_region *); +int t4_alloc_page_pods_for_ps(struct ppod_region *, struct pageset *); +int t4_write_page_pods_for_ps(struct adapter *, struct sge_wrq *, int, + struct pageset *); +void t4_free_page_pods(struct ppod_reservation *); int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *, struct mbuf **, struct mbuf **, int *); int t4_aio_queue_ddp(struct socket *, struct kaiocb *); From owner-svn-src-head@freebsd.org Thu Sep 1 00:52: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 0E73ABC807A; Thu, 1 Sep 2016 00:52:01 +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 C375086F; Thu, 1 Sep 2016 00:52:00 +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 u810q0IH095042; Thu, 1 Sep 2016 00:52:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u810pxiH095036; Thu, 1 Sep 2016 00:51:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609010051.u810pxiH095036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 1 Sep 2016 00:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305167 - head/sys/dev/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.22 Precedence: list List-Id: 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, 01 Sep 2016 00:52:01 -0000 Author: np Date: Thu Sep 1 00:51:59 2016 New Revision: 305167 URL: https://svnweb.freebsd.org/changeset/base/305167 Log: cxgbe/t4_tom: Two new routines to allocate and write page pods for a buffer in the kernel's address space. Modified: head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Wed Aug 31 23:23:46 2016 (r305166) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Thu Sep 1 00:51:59 2016 (r305167) @@ -936,6 +936,64 @@ have_pgsz: return (1); } +int +t4_alloc_page_pods_for_buf(struct ppod_region *pr, vm_offset_t buf, int len, + struct ppod_reservation *prsv) +{ + int hcf, seglen, idx, npages, nppods; + uintptr_t start_pva, end_pva, pva, p1; + + MPASS(buf > 0); + MPASS(len > 0); + + /* + * The DDP page size is unrelated to the VM page size. We combine + * contiguous physical pages into larger segments to get the best DDP + * page size possible. This is the largest of the four sizes in + * A_ULP_RX_ISCSI_PSZ that evenly divides the HCF of the segment sizes + * in the page list. + */ + hcf = 0; + start_pva = trunc_page(buf); + end_pva = trunc_page(buf + len - 1); + pva = start_pva; + while (pva <= end_pva) { + seglen = PAGE_SIZE; + p1 = pmap_kextract(pva); + pva += PAGE_SIZE; + while (pva <= end_pva && p1 + seglen == pmap_kextract(pva)) { + seglen += PAGE_SIZE; + pva += PAGE_SIZE; + } + + hcf = calculate_hcf(hcf, seglen); + if (hcf < (1 << pr->pr_page_shift[1])) { + idx = 0; + goto have_pgsz; /* give up, short circuit */ + } + } + +#define PR_PAGE_MASK(x) ((1 << pr->pr_page_shift[(x)]) - 1) + MPASS((hcf & PR_PAGE_MASK(0)) == 0); /* PAGE_SIZE is >= 4K everywhere */ + for (idx = nitems(pr->pr_page_shift) - 1; idx > 0; idx--) { + if ((hcf & PR_PAGE_MASK(idx)) == 0) + break; + } +#undef PR_PAGE_MASK + +have_pgsz: + MPASS(idx <= M_PPOD_PGSZ); + + npages = 1; + npages += (end_pva - start_pva) >> pr->pr_page_shift[idx]; + nppods = howmany(npages, PPOD_PAGES); + if (alloc_page_pods(pr, nppods, idx, prsv) != 0) + return (ENOMEM); + MPASS(prsv->prsv_nppods > 0); + + return (0); +} + void t4_free_page_pods(struct ppod_reservation *prsv) { @@ -1036,6 +1094,94 @@ t4_write_page_pods_for_ps(struct adapter return (0); } +int +t4_write_page_pods_for_buf(struct adapter *sc, struct sge_wrq *wrq, int tid, + struct ppod_reservation *prsv, vm_offset_t buf, int buflen) +{ + struct wrqe *wr; + struct ulp_mem_io *ulpmc; + struct ulptx_idata *ulpsc; + struct pagepod *ppod; + int i, j, k, n, chunk, len, ddp_pgsz; + u_int ppod_addr, offset; + uint32_t cmd; + struct ppod_region *pr = prsv->prsv_pr; + uintptr_t end_pva, pva, pa; + + cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE)); + if (is_t4(sc)) + cmd |= htobe32(F_ULP_MEMIO_ORDER); + else + cmd |= htobe32(F_T5_ULP_MEMIO_IMM); + ddp_pgsz = 1 << pr->pr_page_shift[G_PPOD_PGSZ(prsv->prsv_tag)]; + offset = buf & PAGE_MASK; + ppod_addr = pr->pr_start + (prsv->prsv_tag & pr->pr_tag_mask); + pva = trunc_page(buf); + end_pva = trunc_page(buf + buflen - 1); + for (i = 0; i < prsv->prsv_nppods; ppod_addr += chunk) { + + /* How many page pods are we writing in this cycle */ + n = min(prsv->prsv_nppods - i, NUM_ULP_TX_SC_IMM_PPODS); + MPASS(n > 0); + chunk = PPOD_SZ(n); + len = roundup2(sizeof(*ulpmc) + sizeof(*ulpsc) + chunk, 16); + + wr = alloc_wrqe(len, wrq); + if (wr == NULL) + return (ENOMEM); /* ok to just bail out */ + ulpmc = wrtod(wr); + + INIT_ULPTX_WR(ulpmc, len, 0, 0); + ulpmc->cmd = cmd; + ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); + ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); + ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); + + ulpsc = (struct ulptx_idata *)(ulpmc + 1); + ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); + ulpsc->len = htobe32(chunk); + + ppod = (struct pagepod *)(ulpsc + 1); + for (j = 0; j < n; i++, j++, ppod++) { + ppod->vld_tid_pgsz_tag_color = htobe64(F_PPOD_VALID | + V_PPOD_TID(tid) | + (prsv->prsv_tag & ~V_PPOD_PGSZ(M_PPOD_PGSZ))); + ppod->len_offset = htobe64(V_PPOD_LEN(buflen) | + V_PPOD_OFST(offset)); + ppod->rsvd = 0; + + for (k = 0; k < nitems(ppod->addr); k++) { + if (pva > end_pva) + ppod->addr[k] = 0; + else { + pa = pmap_kextract(pva); + ppod->addr[k] = htobe64(pa); + pva += ddp_pgsz; + } +#if 0 + CTR5(KTR_CXGBE, + "%s: tid %d ppod[%d]->addr[%d] = %p", + __func__, tid, i, k, + htobe64(ppod->addr[k])); +#endif + } + + /* + * Walk back 1 segment so that the first address in the + * next pod is the same as the last one in the current + * pod. + */ + pva -= ddp_pgsz; + } + + t4_wrq_tx(sc, wr); + } + + MPASS(pva <= end_pva); + + return (0); +} + static void wire_pageset(struct pageset *ps) { Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Wed Aug 31 23:23:46 2016 (r305166) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Sep 1 00:51:59 2016 (r305167) @@ -366,8 +366,12 @@ int t4_init_ppod_region(struct ppod_regi const char *); void t4_free_ppod_region(struct ppod_region *); int t4_alloc_page_pods_for_ps(struct ppod_region *, struct pageset *); +int t4_alloc_page_pods_for_buf(struct ppod_region *, vm_offset_t, int, + struct ppod_reservation *); int t4_write_page_pods_for_ps(struct adapter *, struct sge_wrq *, int, struct pageset *); +int t4_write_page_pods_for_buf(struct adapter *, struct sge_wrq *, int tid, + struct ppod_reservation *, vm_offset_t, int); void t4_free_page_pods(struct ppod_reservation *); int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *, struct mbuf **, struct mbuf **, int *); From owner-svn-src-head@freebsd.org Thu Sep 1 01:08: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 22341BC8440; Thu, 1 Sep 2016 01:08:20 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9D4FF2F; Thu, 1 Sep 2016 01:08:19 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8118I74000336; Thu, 1 Sep 2016 01:08:18 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8118IfB000333; Thu, 1 Sep 2016 01:08:18 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201609010108.u8118IfB000333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 1 Sep 2016 01:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305168 - in head/sys/dev: ixl netmap 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.22 Precedence: list List-Id: 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, 01 Sep 2016 01:08:20 -0000 Author: erj Date: Thu Sep 1 01:08:18 2016 New Revision: 305168 URL: https://svnweb.freebsd.org/changeset/base/305168 Log: Fix linker warnings (errors on gcc) that resulted from r304510. The variables that are extern in the netmap header file should be defined in ixl_txrx.c (the file that is included in both ixl(4)/ixlv(4), not in the main driver source files. Reported by: ed@, dim@, ngie@ Modified: head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl_txrx.c head/sys/dev/netmap/if_ixl_netmap.h Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Thu Sep 1 00:51:59 2016 (r305167) +++ head/sys/dev/ixl/if_ixlv.c Thu Sep 1 01:08:18 2016 (r305168) @@ -217,11 +217,6 @@ TUNABLE_INT("hw.ixlv.tx_itr", &ixlv_tx_i SYSCTL_INT(_hw_ixlv, OID_AUTO, tx_itr, CTLFLAG_RDTUN, &ixlv_tx_itr, 0, "TX Interrupt Rate"); -/* Fix when building as a standalone module when netmap is enabled */ -#if defined(DEV_NETMAP) && !defined(NETMAP_IXL_MAIN) -int ixl_rx_miss, ixl_rx_miss_bufs, ixl_crcstrip; -#endif - /********************************************************************* * Device identification routine * Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Thu Sep 1 00:51:59 2016 (r305167) +++ head/sys/dev/ixl/ixl_txrx.c Thu Sep 1 01:08:18 2016 (r305168) @@ -69,6 +69,7 @@ static inline u32 ixl_get_tx_head(struct #ifdef DEV_NETMAP #include +int ixl_rx_miss, ixl_rx_miss_bufs, ixl_crcstrip = 1; #endif /* DEV_NETMAP */ /* Modified: head/sys/dev/netmap/if_ixl_netmap.h ============================================================================== --- head/sys/dev/netmap/if_ixl_netmap.h Thu Sep 1 00:51:59 2016 (r305167) +++ head/sys/dev/netmap/if_ixl_netmap.h Thu Sep 1 01:08:18 2016 (r305168) @@ -71,7 +71,6 @@ SYSCTL_DECL(_dev_netmap); /* * The xl driver by default strips CRCs and we do not override it. */ -int ixl_rx_miss, ixl_rx_miss_bufs, ixl_crcstrip = 1; #if 0 SYSCTL_INT(_dev_netmap, OID_AUTO, ixl_crcstrip, CTLFLAG_RW, &ixl_crcstrip, 1, "strip CRC on rx frames"); From owner-svn-src-head@freebsd.org Thu Sep 1 02: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 5A087BCA56C; Thu, 1 Sep 2016 02:05:47 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2A609A6A; Thu, 1 Sep 2016 02:05:47 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8125kQP022809; Thu, 1 Sep 2016 02:05:46 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8125kjk022808; Thu, 1 Sep 2016 02:05:46 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201609010205.u8125kjk022808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Thu, 1 Sep 2016 02:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305169 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 02:05:47 -0000 Author: pkelsey Date: Thu Sep 1 02:05:46 2016 New Revision: 305169 URL: https://svnweb.freebsd.org/changeset/base/305169 Log: _taskqueue_start_threads() now fails if it doesn't actually start any threads. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7701 Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Thu Sep 1 01:08:18 2016 (r305168) +++ head/sys/kern/subr_taskqueue.c Thu Sep 1 02:05:46 2016 (r305169) @@ -625,6 +625,11 @@ _taskqueue_start_threads(struct taskqueu } else tq->tq_tcount++; } + if (tq->tq_tcount == 0) { + free(tq->tq_threads, M_TASKQUEUE); + tq->tq_threads = NULL; + return (ENOMEM); + } for (i = 0; i < count; i++) { if (tq->tq_threads[i] == NULL) continue; From owner-svn-src-head@freebsd.org Thu Sep 1 02:11: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 614A7BCA652; Thu, 1 Sep 2016 02:11:53 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ua0-x22c.google.com (mail-ua0-x22c.google.com [IPv6:2607:f8b0:400c:c08::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 192C6DDC; Thu, 1 Sep 2016 02:11:53 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ua0-x22c.google.com with SMTP id i32so121225125uai.2; Wed, 31 Aug 2016 19:11:53 -0700 (PDT) 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; bh=60tMKaj8BnWro8GRObSvtmg4a27r0oMvXRMSDJ0NYXk=; b=BzfaSv2r3HZuKHyWHJM7p8FHIwNeKW3nALTsOcqbe0H6YW7vZAekc3c9hkUZqinZjG U04UvaH1It/3oHMp98ezeurQk5Fz6IQSODzSBRYUKubclCJbGpw44z/JKRbzaxKXHUeX slVNdHh55LekPnvXBsD1/GKY8lHPWeOIXOQbfhUSdvIlvTwvclAs+OWjz++6dF3nwRvN ZH092SeiKIT3vdoinTDfdF78Eivk8EmcBWFCiQO5T8K9n78IkTp/Ne7o4d28IQydVusa 6a3R6ux9pzZhBZP1GcqcWza7vfoeKPs671/pBGGwaUnIYkiyQJj14rWdxv/3I/FNvjAo Ybug== 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; bh=60tMKaj8BnWro8GRObSvtmg4a27r0oMvXRMSDJ0NYXk=; b=dC7QL90LBmjkjpdTSLvfz8VwlmzvHM/3gleM5gt66nVb7RQBlauWDCgJqqkqXmoUDd a4zSBmUDt7Z9Bvv3Z/jW0dmCst/6K/pJEiOms6k+NgBi8BnigMuPHevc4iUg4Cx7zfh3 20K6Qnw0FjC+j+qVqNg60Co3Bd3g/+MYRamEICG2OAMNrcCyafyj5tpsHy5Sw697/Z5T 9oi3Y5c1W8Jm266c4aM3zUxtsuxxEMUAZH10j62Zq0rAEhdgfdIjfMCLxdrpUN1645qd 3hk4Sl9rRIOyayjAlEuFO1aRHacNq94+wcW9NdJXXRFHUH3hoeUH6cRabj47MT61UAAl Xw3w== X-Gm-Message-State: AE9vXwMSvPKuBlWDDIN1+trcy4OFbqJcP9r7eGLDGS78l+72etUA8GXQHfFrr2sRcFXpsCBloH93+e2XyQvK3Q== X-Received: by 10.176.82.50 with SMTP id i47mr6780473uaa.60.1472695912079; Wed, 31 Aug 2016 19:11:52 -0700 (PDT) MIME-Version: 1.0 Sender: crodr001@gmail.com Received: by 10.103.31.134 with HTTP; Wed, 31 Aug 2016 19:11:51 -0700 (PDT) In-Reply-To: <201606091835.u59IZbtB094147@repo.freebsd.org> References: <201606091835.u59IZbtB094147@repo.freebsd.org> From: Craig Rodrigues Date: Wed, 31 Aug 2016 19:11:51 -0700 X-Google-Sender-Auth: nDhuaJ8yjFM_3B2pU8hODJgoWEM Message-ID: Subject: Re: svn commit: r301752 - head/contrib/netbsd-tests/lib/libc/string To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "jenkins-admin@freebsd.org" , FreeBSD stable Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 02:11:53 -0000 Ngie, Can you please MFC this to stable/10 branch? I believe this has been causing a test failure in this branch since June. Thanks. -- Craig On Thu, Jun 9, 2016 at 11:35 AM, Garrett Cooper wrote: > Author: ngie > Date: Thu Jun 9 18:35:37 2016 > New Revision: 301752 > URL: https://svnweb.freebsd.org/changeset/base/301752 > > Log: > Update `goodResult` after recent changes made to the PRNG in libc > > The PRNG was changed in r300953/r300956, and subsequently, the numbers > generated have changed. This is expected ABI breakage per ache > > X-MFC with: r300953, r300956 > Tested with: amd64, i386 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c > > Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c > ============================================================ > ================== > --- head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Thu Jun > 9 18:27:41 2016 (r301751) > +++ head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Thu Jun > 9 18:35:37 2016 (r301752) > @@ -54,7 +54,7 @@ char result[100]; > #ifdef __NetBSD__ > const char goodResult[] = "7b405d24bc03195474c70ddae9e1f8fb"; > #else > -const char goodResult[] = "217b4fbe456916bf62a2f85df752e4ab"; > +const char goodResult[] = "5ab4443f0e3e058d94087d9f2a11ef5e"; > #endif > > static void > > From owner-svn-src-head@freebsd.org Thu Sep 1 02:13: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 8832EBCA88C; Thu, 1 Sep 2016 02:13:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55827136; Thu, 1 Sep 2016 02:13:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x241.google.com with SMTP id cf3so3453760pad.2; Wed, 31 Aug 2016 19:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=R3BXulsNu3OWLcXjpOj9PhPXPDp+BmMrNuw8Awbxa5s=; b=ntlTm9AbT1n49HDhKamfNsw66cQrM4KGi/ixPbdPQJF8UfQnP2ASdrUFIuM88IbNLk 4xfKtjn3680+awSQpl6Ioytv/RlKmFMzfDk018/uIAuAGcy4U3HzQsfeDPphqH/xbACY aqkjmu3T/xuZiQBeSoZO16La0M/D7SbIVxlBWmCXl/GSgphmbhZhOhcS6F8971lqbXj6 fEdMLh09q/XjTb/uN5EF4Zmoq/VHSIIB4T4/GWNX9A6i5jUTEyprPTDFH3tLCsokCClb z/S5HTDvHc4DndUeSLA1m/cY3nr44Gn3f8dz1RXBnFtXB1WMA1qaVrbh/+z+yvOn6V5T nkIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=R3BXulsNu3OWLcXjpOj9PhPXPDp+BmMrNuw8Awbxa5s=; b=R9t3m9jtV4z48xb1QsJ2yruXjtwzZr6w2o5sRf55xXI36JlAPvwIa7u3Qjix4eOVvP uWG3j/GsXUEB4VzXxrIQrZH3wrQo203q2Vs457XLSzILit5my6kyeA/LsnO9OcY4e8yv MyggnFEZRVq8Wk/LXjG0Fdjkgkb4QKU3hKo3ZYLSFL8ysKG6s6+fMyJOGMipnVVxX63n EXiN4jLDDT9yQHsdmzWX5SPwnK2wTzMgo7cODlrYEpL0R6vsUzPBSy28s2B+N1vmE/8h n3iJSiDjQod2aVItxMe2TNmSksZ2X5CLL/QMqBGYbMFEISjVNJ2F7qoGMi9wC8iQ01nh GiUQ== X-Gm-Message-State: AE9vXwMhML1E/H13/oeciNlTeYbTuiekriFL0+qYA2SqxH4+BDbz6ZtC9tHZ2ZRhmj/HTw== X-Received: by 10.66.189.199 with SMTP id gk7mr22765812pac.158.1472695981825; Wed, 31 Aug 2016 19:13:01 -0700 (PDT) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m128sm2599312pfm.42.2016.08.31.19.12.54 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Aug 2016 19:12:56 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r301752 - head/contrib/netbsd-tests/lib/libc/string From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Wed, 31 Aug 2016 19:12:54 -0700 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "jenkins-admin@freebsd.org" , FreeBSD stable Content-Transfer-Encoding: quoted-printable Message-Id: <7C6CB7A6-085E-40CF-B72A-3013DBEE386E@gmail.com> References: <201606091835.u59IZbtB094147@repo.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 02:13:02 -0000 > On Aug 31, 2016, at 7:11 PM, Craig Rodrigues = wrote: >=20 > Ngie, >=20 > Can you please MFC this to stable/10 branch? > I believe this has been causing a test failure in this branch > since June. Shoot =E2=80=94 I=E2=80=99ll verify the issue and commit the change. Thanks, -Ngie From owner-svn-src-head@freebsd.org Thu Sep 1 02:42: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 64315BCAF25; Thu, 1 Sep 2016 02:42:12 +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 1159EEB2; Thu, 1 Sep 2016 02:42:12 +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 u812gB1K037526; Thu, 1 Sep 2016 02:42:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u812gBkP037525; Thu, 1 Sep 2016 02:42:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609010242.u812gBkP037525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 1 Sep 2016 02:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305170 - head/lib/atf/libatf-c 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.22 Precedence: list List-Id: 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, 01 Sep 2016 02:42:12 -0000 Author: ngie Date: Thu Sep 1 02:42:11 2016 New Revision: 305170 URL: https://svnweb.freebsd.org/changeset/base/305170 Log: Don't bake all of CC/CPP/CXX into CFLAGS Capture executable names for CC, CPP, CXX (assumed to be the first non-CCACHE_BIN word). This change strips out all of the cross-compiler arguments, (-target, -B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it doesn't infect the build and subsequently the test. Add comments noting why this logic is being added, and why the logic in r305041 was necessary/what it was trying to achieve. This is required after recent changes made to the toolchain to always specify --sysroot, -target, -B, etc with clang in buildworld (presumably r304681). Reviewed by: rodrigc (earlier version) Reported by: Jenkins (FreeBSD_HEAD job from 559+) MFC after: 12 days X-MFC with: r304681, r305041 Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7732 Modified: head/lib/atf/libatf-c/Makefile Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Thu Sep 1 02:05:46 2016 (r305169) +++ head/lib/atf/libatf-c/Makefile Thu Sep 1 02:42:11 2016 (r305170) @@ -28,6 +28,18 @@ .include .include +# Store the toolchain executable in ATF_BUILD_{CC,CPP,CXX} to ensure other +# values -- like -target, -B ..., etc -- don't get leaked into the tests. +# +# Be sure to omit ${CCACHE_BIN} (if specified) from the variable as it gets +# automatically appended to the variables in bsd.compiler.mk when +# ${MK_CCACHE_BUILD} != no. +ATF_BUILD_CC:= ${CC:N${CCACHE_BIN}:[1]} +ATF_BUILD_CPP:= ${CPP:N${CCACHE_BIN}:[1]} +ATF_BUILD_CXX:= ${CXX:N${CCACHE_BIN}:[1]} + +# Only capture defines, includes, linker flags, optimization levels, warnings +# and preprocessor flags when building ATF_BUILD_{C,CPP,CXX}FLAGS. ATF_BUILD_CFLAGS:= ${CFLAGS:M-[DILOWf]*} ATF_BUILD_CPPFLAGS:= ${CPPFLAGS:M-[DILOWf]*} ATF_BUILD_CXXFLAGS:= ${CXXFLAGS:M-[DILOWf]*} @@ -41,11 +53,11 @@ ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/atf-c .PATH: ${ATF}/atf-c/detail -CFLAGS+= -DATF_BUILD_CC='"${CC}"' +CFLAGS+= -DATF_BUILD_CC='"${ATF_BUILD_CC}"' CFLAGS+= -DATF_BUILD_CFLAGS='"${ATF_BUILD_CFLAGS}"' -CFLAGS+= -DATF_BUILD_CPP='"${CPP}"' +CFLAGS+= -DATF_BUILD_CPP='"${ATF_BUILD_CPP}"' CFLAGS+= -DATF_BUILD_CPPFLAGS='"${ATF_BUILD_CPPFLAGS}"' -CFLAGS+= -DATF_BUILD_CXX='"${CXX}"' +CFLAGS+= -DATF_BUILD_CXX='"${ATF_BUILD_CXX}"' CFLAGS+= -DATF_BUILD_CXXFLAGS='"${ATF_BUILD_CXXFLAGS}"' CFLAGS+= -I${ATF} CFLAGS+= -I${.CURDIR} From owner-svn-src-head@freebsd.org Thu Sep 1 02:51: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 5A3A5BC703D; Thu, 1 Sep 2016 02:51:51 +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 1C7C2632; Thu, 1 Sep 2016 02:51:51 +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 u812po2K041325; Thu, 1 Sep 2016 02:51:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u812poju041324; Thu, 1 Sep 2016 02:51:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609010251.u812poju041324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 1 Sep 2016 02:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305171 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 02:51:51 -0000 Author: emaste Date: Thu Sep 1 02:51:50 2016 New Revision: 305171 URL: https://svnweb.freebsd.org/changeset/base/305171 Log: allow kern.proc.nfds sysctl in capability mode Reviewed by: allanjude MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7733 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Sep 1 02:42:11 2016 (r305170) +++ head/sys/kern/kern_descrip.c Thu Sep 1 02:51:50 2016 (r305171) @@ -3178,7 +3178,7 @@ sysctl_kern_proc_nfds(SYSCTL_HANDLER_ARG } static SYSCTL_NODE(_kern_proc, KERN_PROC_NFDS, nfds, - CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_nfds, + CTLFLAG_RD|CTLFLAG_CAPRD|CTLFLAG_MPSAFE, sysctl_kern_proc_nfds, "Number of open file descriptors"); /* From owner-svn-src-head@freebsd.org Thu Sep 1 04:55: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 AEF2BBCB173; Thu, 1 Sep 2016 04:55:55 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-yb0-f172.google.com (mail-yb0-f172.google.com [209.85.213.172]) (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 74D96EC2; Thu, 1 Sep 2016 04:55:54 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-yb0-f172.google.com with SMTP id d205so1873132ybh.0; Wed, 31 Aug 2016 21:55:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CG9KLSVpTH9IjfRbtly59EMeLC8QjVjEPVfb2j+vZLU=; b=czs+NqzTVyJcRcVUjNgsKdyrCY9VeqXryo1UhgkjxNdIE/DmC6YpbGmP1EVaHFHg6L /9KuVrEvAVhpT3hBdxeDDz5bDUK3yMyh6G+WiQHUVu3NRFFWSlXGRKrWJp+elBmZYYGJ 6fIuQDUHRWr67dqMd1UYY7JaoMG2JS3lNXlaBkD1gtlbP0sy49fdQAUwTmhj1W2OvGWt 4x5xEpjkgk/V9WostF4VMRLweg4u0AuoBn+Bf2SIlub21WC+/2JN3DpVED9kVAGqG1fb IsTT3x+XIQFzrXeLxDOugIDyq6acVOpxuwrOXS1TxCswkMV/iEDGncaJZYY9+waI/KJR tJqQ== X-Gm-Message-State: AE9vXwNXqy385JHqFkUoF164JlALuHhilQNYVXkUcBasAjDcJa7GswrJMyAO5UbrfZicQA== X-Received: by 10.37.123.195 with SMTP id w186mr9934798ybc.186.1472679067564; Wed, 31 Aug 2016 14:31:07 -0700 (PDT) Received: from mail-yb0-f178.google.com (mail-yb0-f178.google.com. [209.85.213.178]) by smtp.gmail.com with ESMTPSA id e197sm651679ywa.16.2016.08.31.14.31.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 14:31:07 -0700 (PDT) Received: by mail-yb0-f178.google.com with SMTP id h3so21896085ybi.2; Wed, 31 Aug 2016 14:31:07 -0700 (PDT) X-Received: by 10.37.25.4 with SMTP id 4mr9680559ybz.161.1472679067216; Wed, 31 Aug 2016 14:31:07 -0700 (PDT) MIME-Version: 1.0 References: <201608200008.u7K08Bok069627@repo.freebsd.org> <8A65E29F-1DF1-44F4-9E38-FFC038EE52E7@FreeBSD.org> In-Reply-To: <8A65E29F-1DF1-44F4-9E38-FFC038EE52E7@FreeBSD.org> From: Eric Joyner Date: Wed, 31 Aug 2016 21:30:56 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r304510 - head/sys/dev/ixl To: Dimitry Andric , Ed Maste 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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 04:55:55 -0000 It's weird that the gcc message is mentioning "ixlv_media_change", but I'll do something about it shortly. On Wed, Aug 31, 2016 at 2:16 PM Dimitry Andric wrote: > On 31 Aug 2016, at 18:53, Ed Maste wrote: > > > > On 19 August 2016 at 20:08, Eric Joyner wrote: > >> Author: erj > >> Date: Sat Aug 20 00:08:10 2016 > >> New Revision: 304510 > >> URL: https://svnweb.freebsd.org/changeset/base/304510 > >> > >> Log: > >> ixlv(4): Fix ixlv(4) not loading when loaded as a kernel module and > netmap is enabled. > > > > I did not confirm it's this commit, but kernel builds currently have > > this warning: > > > > if_ixlv.o: warning: common of `ixl_crcstrip' overridden by definition > > if_ixl.o: warning: defined here > > if_ixlv.o: warning: multiple common of `ixl_rx_miss' > > if_ixl.o: warning: previous common is here > > if_ixlv.o: warning: multiple common of `ixl_rx_miss_bufs' > > if_ixl.o: warning: previous common is here > > Interestingly, with the external gcc build, it is even an error: > > --- kernel.full --- > linking kernel.full > if_ixlv.o:(.bss+0x0): multiple definition of `ixl_crcstrip' > if_ixl.o:(.data+0xb8): first defined here > if_ixlv.o: In function `ixlv_media_change': > /builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixlv.c:2252: multiple > definition of `ixl_rx_miss_bufs' > if_ixl.o:/builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixl.c:680: first > defined here > if_ixlv.o: In function `ixlv_media_change': > /builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixlv.c:2262: multiple > definition of `ixl_rx_miss' > if_ixl.o:/builds/FreeBSD_HEAD_amd64_gcc/sys/dev/ixl/if_ixl.c:681: first > defined here > *** [kernel.full] Error code 1 > > See e.g. > https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/1505/console > > -Dimitry > > From owner-svn-src-head@freebsd.org Thu Sep 1 05:15: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 2C429BCC5A2; Thu, 1 Sep 2016 05:15:05 +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 F3895806; Thu, 1 Sep 2016 05:15:04 +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 u815F46a094593; Thu, 1 Sep 2016 05:15:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u815F41a094592; Thu, 1 Sep 2016 05:15:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609010515.u815F41a094592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Sep 2016 05:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305173 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 05:15:05 -0000 Author: sephe Date: Thu Sep 1 05:15:04 2016 New Revision: 305173 URL: https://svnweb.freebsd.org/changeset/base/305173 Log: net/rndis: Add comment for rndis_set_parameter MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7705 Modified: head/sys/net/rndis.h Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Thu Sep 1 02:57:15 2016 (r305172) +++ head/sys/net/rndis.h Thu Sep 1 05:15:04 2016 (r305173) @@ -217,6 +217,9 @@ struct rndis_set_comp { uint32_t rm_status; }; +/* + * Parameter used by OID_GEN_RNDIS_CONFIG_PARAMETER. + */ #define REMOTE_NDIS_SET_PARAM_NUMERIC 0x00000000 #define REMOTE_NDIS_SET_PARAM_STRING 0x00000002 From owner-svn-src-head@freebsd.org Thu Sep 1 05:40: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 A147ABCDE62; Thu, 1 Sep 2016 05:40:14 +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 74284D7B; Thu, 1 Sep 2016 05:40: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 u815eDTs003020; Thu, 1 Sep 2016 05:40:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u815eDYP003019; Thu, 1 Sep 2016 05:40:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609010540.u815eDYP003019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Sep 2016 05:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305175 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 05:40:14 -0000 Author: sephe Date: Thu Sep 1 05:40:13 2016 New Revision: 305175 URL: https://svnweb.freebsd.org/changeset/base/305175 Log: net/rndis: Define per-packet-info for RNDIS packet message MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7708 Modified: head/sys/net/rndis.h Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Thu Sep 1 05:29:58 2016 (r305174) +++ head/sys/net/rndis.h Thu Sep 1 05:40:13 2016 (r305175) @@ -112,6 +112,26 @@ struct rndis_packet_msg { }; /* + * Minimum value for rm_dataoffset, rm_oobdataoffset, and + * rm_pktinfooffset. + */ +#define RNDIS_PACKET_MSG_OFFSET_MIN \ + (sizeof(struct rndis_packet_msg) - \ + __offsetof(struct rndis_packet_msg, rm_dataoffset)) + +/* Per-packet-info for RNDIS data message */ +struct rndis_pktinfo { + uint32_t rm_size; + uint32_t rm_type; + uint32_t rm_pktinfooffset; + uint8_t rm_data[]; +}; + +#define RNDIS_PKTINFO_OFFSET \ + __offsetof(struct rndis_pktinfo, rm_data[0]) +#define RNDIS_PKTINFO_ALIGN 4 + +/* * RNDIS control messages */ struct rndis_comp_hdr { From owner-svn-src-head@freebsd.org Thu Sep 1 06:32: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 D95ADBCB9E5; Thu, 1 Sep 2016 06:32:36 +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 AC415ECD; Thu, 1 Sep 2016 06:32:36 +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 u816WZwF025187; Thu, 1 Sep 2016 06:32:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u816WZUj025186; Thu, 1 Sep 2016 06:32:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609010632.u816WZUj025186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Sep 2016 06:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305177 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 06:32:37 -0000 Author: sephe Date: Thu Sep 1 06:32:35 2016 New Revision: 305177 URL: https://svnweb.freebsd.org/changeset/base/305177 Log: net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1. Reviewed by: araujo, hps MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7710 Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Thu Sep 1 06:05:08 2016 (r305176) +++ head/sys/net/ethernet.h Thu Sep 1 06:32:35 2016 (r305177) @@ -92,7 +92,7 @@ struct ether_vlan_header { #define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7) #define EVL_CFIOFTAG(tag) (((tag) >> 12) & 1) #define EVL_MAKETAG(vlid, pri, cfi) \ - ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) + ((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) /* * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields. From owner-svn-src-head@freebsd.org Thu Sep 1 05:30: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 6797BBCDD98; Thu, 1 Sep 2016 05:30:00 +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 1C2C3FE2; Thu, 1 Sep 2016 05:30:00 +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 u815TxUS098917; Thu, 1 Sep 2016 05:29:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u815TxtM098915; Thu, 1 Sep 2016 05:29:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609010529.u815TxtM098915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Sep 2016 05:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305174 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 05:30:00 -0000 Author: sephe Date: Thu Sep 1 05:29:58 2016 New Revision: 305174 URL: https://svnweb.freebsd.org/changeset/base/305174 Log: hyperv/hn: Remove unused function MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7706 Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Sep 1 05:15:04 2016 (r305173) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Sep 1 05:29:58 2016 (r305174) @@ -904,7 +904,5 @@ void* hv_set_rppi_data(rndis_msg *rndis_ uint32_t rppi_size, int pkt_type); -void* hv_get_ppi_data(rndis_packet *rpkt, uint32_t type); - #endif /* __HV_RNDIS_H__ */ Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Sep 1 05:15:04 2016 (r305173) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Sep 1 05:29:58 2016 (r305174) @@ -128,35 +128,6 @@ hv_set_rppi_data(rndis_msg *rndis_mesg, } /* - * Get the Per-Packet-Info with the specified type - * return NULL if not found. - */ -void * -hv_get_ppi_data(rndis_packet *rpkt, uint32_t type) -{ - rndis_per_packet_info *ppi; - int len; - - if (rpkt->per_pkt_info_offset == 0) - return (NULL); - - ppi = (rndis_per_packet_info *)((unsigned long)rpkt + - rpkt->per_pkt_info_offset); - len = rpkt->per_pkt_info_length; - - while (len > 0) { - if (ppi->type == type) - return (void *)((unsigned long)ppi + - ppi->per_packet_info_offset); - - len -= ppi->size; - ppi = (rndis_per_packet_info *)((unsigned long)ppi + ppi->size); - } - - return (NULL); -} - -/* * RNDIS filter receive indicate status */ static void From owner-svn-src-head@freebsd.org Thu Sep 1 06:05: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 D59A6BCE650; Thu, 1 Sep 2016 06:05:09 +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 AE773D81; Thu, 1 Sep 2016 06:05:09 +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 u81658QZ014140; Thu, 1 Sep 2016 06:05:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81658o7014139; Thu, 1 Sep 2016 06:05:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609010605.u81658o7014139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Sep 2016 06:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305176 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 06:05:09 -0000 Author: sephe Date: Thu Sep 1 06:05:08 2016 New Revision: 305176 URL: https://svnweb.freebsd.org/changeset/base/305176 Log: hyperv/hn: Stringent per-packet-info verification. While I'm here, minor style changes. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7709 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Sep 1 05:40:13 2016 (r305175) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Sep 1 06:05:08 2016 (r305176) @@ -153,8 +153,8 @@ hv_rf_receive_indicate_status(struct hn_ static int hv_rf_find_recvinfo(const rndis_packet *rpkt, struct hn_recvinfo *info) { - const rndis_per_packet_info *ppi; - uint32_t mask, len; + const struct rndis_pktinfo *pi; + uint32_t mask = 0, len; info->vlan_info = NULL; info->csum_info = NULL; @@ -162,70 +162,80 @@ hv_rf_find_recvinfo(const rndis_packet * info->hash_value = NULL; if (rpkt->per_pkt_info_offset == 0) - return 0; + return (0); + if (__predict_false(rpkt->per_pkt_info_offset & + (RNDIS_PKTINFO_ALIGN - 1))) + return (EINVAL); + if (__predict_false(rpkt->per_pkt_info_offset < + RNDIS_PACKET_MSG_OFFSET_MIN)) + return (EINVAL); - ppi = (const rndis_per_packet_info *) + pi = (const struct rndis_pktinfo *) ((const uint8_t *)rpkt + rpkt->per_pkt_info_offset); len = rpkt->per_pkt_info_length; - mask = 0; while (len != 0) { - const void *ppi_dptr; - uint32_t ppi_dlen; + const void *data; + uint32_t dlen; - if (__predict_false(ppi->size < ppi->per_packet_info_offset)) - return EINVAL; - ppi_dlen = ppi->size - ppi->per_packet_info_offset; - ppi_dptr = (const uint8_t *)ppi + ppi->per_packet_info_offset; + if (__predict_false(len < sizeof(*pi))) + return (EINVAL); + if (__predict_false(len < pi->rm_size)) + return (EINVAL); + len -= pi->rm_size; + + if (__predict_false(pi->rm_size & (RNDIS_PKTINFO_ALIGN - 1))) + return (EINVAL); + if (__predict_false(pi->rm_size < pi->rm_pktinfooffset)) + return (EINVAL); + dlen = pi->rm_size - pi->rm_pktinfooffset; + data = pi->rm_data; - switch (ppi->type) { + switch (pi->rm_type) { case ieee_8021q_info: - if (__predict_false(ppi_dlen < sizeof(ndis_8021q_info))) - return EINVAL; - info->vlan_info = ppi_dptr; + if (__predict_false(dlen < sizeof(ndis_8021q_info))) + return (EINVAL); + info->vlan_info = data; mask |= HV_RF_RECVINFO_VLAN; break; case tcpip_chksum_info: - if (__predict_false(ppi_dlen < + if (__predict_false(dlen < sizeof(rndis_tcp_ip_csum_info))) - return EINVAL; - info->csum_info = ppi_dptr; + return (EINVAL); + info->csum_info = data; mask |= HV_RF_RECVINFO_CSUM; break; case nbl_hash_value: - if (__predict_false(ppi_dlen < + if (__predict_false(dlen < sizeof(struct rndis_hash_value))) - return EINVAL; - info->hash_value = ppi_dptr; + return (EINVAL); + info->hash_value = data; mask |= HV_RF_RECVINFO_HASHVAL; break; case nbl_hash_info: - if (__predict_false(ppi_dlen < + if (__predict_false(dlen < sizeof(struct rndis_hash_info))) - return EINVAL; - info->hash_info = ppi_dptr; + return (EINVAL); + info->hash_info = data; mask |= HV_RF_RECVINFO_HASHINF; break; default: - goto skip; + goto next; } if (mask == HV_RF_RECVINFO_ALL) { /* All found; done */ break; } -skip: - if (__predict_false(len < ppi->size)) - return EINVAL; - len -= ppi->size; - ppi = (const rndis_per_packet_info *) - ((const uint8_t *)ppi + ppi->size); +next: + pi = (const struct rndis_pktinfo *) + ((const uint8_t *)pi + pi->rm_size); } - return 0; + return (0); } /* From owner-svn-src-head@freebsd.org Thu Sep 1 06:35: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 8F524BCD4BA; Thu, 1 Sep 2016 06:35:14 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 485FA19A; Thu, 1 Sep 2016 06:35:14 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u816ZD82025341; Thu, 1 Sep 2016 06:35:13 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u816ZDlc025340; Thu, 1 Sep 2016 06:35:13 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201609010635.u816ZDlc025340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 1 Sep 2016 06:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305178 - head/sys/boot/i386/libi386 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.22 Precedence: list List-Id: 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, 01 Sep 2016 06:35:14 -0000 Author: tsoome Date: Thu Sep 1 06:35:13 2016 New Revision: 305178 URL: https://svnweb.freebsd.org/changeset/base/305178 Log: bd_int13probe() should check extended info if sector info is bad In some Dell systems and usb stick combinations, it is found that int13 AH=08 is reporting back bad sector information, preventing the boot. This update is allowing bd_int13probe() to use extended info call to build disk properties. It also can happen the total sectors count from extended info may be wrong, in such case, the CHS data is used to calculate total sectors. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D7718 Modified: head/sys/boot/i386/libi386/biosdisk.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Thu Sep 1 06:32:35 2016 (r305177) +++ head/sys/boot/i386/libi386/biosdisk.c Thu Sep 1 06:35:13 2016 (r305178) @@ -244,6 +244,7 @@ static int bd_int13probe(struct bdinfo *bd) { struct edd_params params; + int ret = 1; /* assume success */ v86.ctl = V86_FLAGS; v86.addr = 0x13; @@ -251,11 +252,14 @@ bd_int13probe(struct bdinfo *bd) v86.edx = bd->bd_unit; v86int(); + /* Don't error out if we get bad sector number, try EDD as well */ if (V86_CY(v86.efl) || /* carry set */ - (v86.ecx & 0x3f) == 0 || /* absurd sector number */ (v86.edx & 0xff) <= (unsigned)(bd->bd_unit & 0x7f)) /* unit # bad */ return (0); /* skip device */ + if ((v86.ecx & 0x3f) == 0) /* absurd sector number */ + ret = 0; /* set error */ + /* Convert max cyl # -> # of cylinders */ bd->bd_cyl = ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> 8) + 1; /* Convert max head # -> # of heads */ @@ -280,7 +284,8 @@ bd_int13probe(struct bdinfo *bd) if (V86_CY(v86.efl) || /* carry set */ (v86.ebx & 0xffff) != 0xaa55 || /* signature */ (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) - return (1); + return (ret); /* return code from int13 AH=08 */ + /* EDD supported */ bd->bd_flags |= BD_MODEEDD1; if ((v86.eax & 0xff00) >= 0x3000) @@ -295,12 +300,22 @@ bd_int13probe(struct bdinfo *bd) v86.esi = VTOPOFF(¶ms); v86int(); if (!V86_CY(v86.efl)) { - bd->bd_sectors = params.sectors; + uint64_t total; + + if (params.sectors != 0) + bd->bd_sectors = params.sectors; + + total = (uint64_t)params.cylinders * + params.heads * params.sectors_per_track; + if (bd->bd_sectors < total) + bd->bd_sectors = total; + bd->bd_sectorsize = params.sector_size; + ret = 1; } DEBUG("unit 0x%x flags %x, sectors %llu, sectorsize %u", bd->bd_unit, bd->bd_flags, bd->bd_sectors, bd->bd_sectorsize); - return (1); + return (ret); } /* From owner-svn-src-head@freebsd.org Thu Sep 1 05:57: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 9FCC2BCD948; Thu, 1 Sep 2016 05:57:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 713C0978; Thu, 1 Sep 2016 05:57:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id x72so27598443pfd.2; Wed, 31 Aug 2016 22:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=aZrhnUyjddbkVWSJWJ0+B0hs9i4lGIVEH3L19NaApLQ=; b=M8xpDtqjHZ9KOxj9f29XBcI5Jh3H5+t2ENETc0Sj+5ozdMS9XG91gdeT6RfX038vd5 Gvdwpmjsc+vzDpAp1L9+kf4mQAVUx9RUUD5rOe+MWnLQmXfrTtyvxmGFmL7lLMcIsGrc otvpd3uw70kwv+r1x7zb9sg4BQJ2+NV6+JeHcKiNBse7fRM3GjSUNel/vrVLP94OvTgl mTxfDNWudWtBlQFFsj11pNJoqeeIz5R0nSC1XCODVGuRP/CWgQmej8rR2meJ6u9rO/bA b7mmEQU5NaLKRUG/T/b8N0RwOj1qc+4ndo6gRhKv+5snRjxlEU1HwJtnkVekv1iSa8Ac P2bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=aZrhnUyjddbkVWSJWJ0+B0hs9i4lGIVEH3L19NaApLQ=; b=LeFQDuhWhPn1fHtz7qE8NdlQwlHHVBCAgDrjTZ8wXjhPwSw7a3rdsWQcEtXEzSRWWB oY0YMXN3GatNlNHNvzBMBNzNlxut/oExdg+SGg5QxmX/u4ok6vgrpvl78aKE5OHAhpHn EP1Sr2w1PYGj5OUfE96lIUZvSqBg3Hb9ZS9xW/cp415RfvOJ/KXQGFnXFLFW7tK1/eFR kmmcXFFw2Uj+E5JxQbIVLHlmKZHCses+KPrLYORooiDmGj79KBI0n+LgyiTUC4hrWN5Z DNMesoyuXclF7u+Ax/ngvWtmDOu4qnU00l5KxPCCULqpghCa3lU95alIVn467c1nszfT Mh7Q== X-Gm-Message-State: AE9vXwN0yre7kEDLjYxdrOBNAjhQloIOuwk/kB8y/j3zeGe/reCBM9Cf2iIx1iJd86D3Dg== X-Received: by 10.98.23.134 with SMTP id 128mr23826079pfx.96.1472709443965; Wed, 31 Aug 2016 22:57:23 -0700 (PDT) Received: from [192.168.50.103] ([50.251.209.113]) by smtp.gmail.com with ESMTPSA id c7sm3925466pfj.25.2016.08.31.22.57.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Aug 2016 22:57:23 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r305168 - in head/sys/dev: ixl netmap From: Ngie Cooper X-Mailer: iPhone Mail (13G36) In-Reply-To: <201609010108.u8118IfB000333@repo.freebsd.org> Date: Wed, 31 Aug 2016 22:57:22 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <76EF1946-A231-44D8-894C-C0DD5463A241@gmail.com> References: <201609010108.u8118IfB000333@repo.freebsd.org> To: Eric Joyner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 05:57:24 -0000 > On Aug 31, 2016, at 18:08, Eric Joyner wrote: > > Author: erj > Date: Thu Sep 1 01:08:18 2016 > New Revision: 305168 > URL: https://svnweb.freebsd.org/changeset/base/305168 > > Log: > Fix linker warnings (errors on gcc) that resulted from r304510. > > The variables that are extern in the netmap header file should be > defined in ixl_txrx.c (the file that is included in both ixl(4)/ixlv(4), > not in the main driver source files. > > Reported by: ed@, dim@, ngie@ Thank you :)! From owner-svn-src-head@freebsd.org Thu Sep 1 07:04:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35348BCCF09; Thu, 1 Sep 2016 07:04:49 +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 10907153; Thu, 1 Sep 2016 07:04:48 +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 u8174mRH036578; Thu, 1 Sep 2016 07:04:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8174lcu036573; Thu, 1 Sep 2016 07:04:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609010704.u8174lcu036573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Sep 2016 07:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305179 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 07:04:49 -0000 Author: sephe Date: Thu Sep 1 07:04:47 2016 New Revision: 305179 URL: https://svnweb.freebsd.org/changeset/base/305179 Log: hyperv/hn: Fix VLAN tag construction. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7716 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Sep 1 06:35:13 2016 (r305178) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Sep 1 07:04:47 2016 (r305179) @@ -1412,8 +1412,11 @@ netvsc_recv(struct hn_rx_ring *rxr, cons } } skip: - if (info->vlan_info != NULL) { - m_new->m_pkthdr.ether_vtag = info->vlan_info->u1.s1.vlan_id; + if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) { + m_new->m_pkthdr.ether_vtag = EVL_MAKETAG( + NDIS_VLAN_INFO_ID(info->vlan_info), + NDIS_VLAN_INFO_PRI(info->vlan_info), + NDIS_VLAN_INFO_CFI(info->vlan_info)); m_new->m_flags |= M_VLANTAG; } Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Sep 1 06:35:13 2016 (r305178) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Sep 1 07:04:47 2016 (r305179) @@ -156,7 +156,7 @@ hv_rf_find_recvinfo(const rndis_packet * const struct rndis_pktinfo *pi; uint32_t mask = 0, len; - info->vlan_info = NULL; + info->vlan_info = HN_NDIS_VLAN_INFO_INVALID; info->csum_info = NULL; info->hash_info = NULL; info->hash_value = NULL; @@ -193,9 +193,9 @@ hv_rf_find_recvinfo(const rndis_packet * switch (pi->rm_type) { case ieee_8021q_info: - if (__predict_false(dlen < sizeof(ndis_8021q_info))) + if (__predict_false(dlen < NDIS_VLAN_INFO_SIZE)) return (EINVAL); - info->vlan_info = data; + info->vlan_info = *((const uint32_t *)data); mask |= HV_RF_RECVINFO_VLAN; break; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Sep 1 06:35:13 2016 (r305178) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Sep 1 07:04:47 2016 (r305179) @@ -55,8 +55,10 @@ struct rndix_hash_value; struct ndis_8021q_info_; struct rndis_tcp_ip_csum_info_; +#define HN_NDIS_VLAN_INFO_INVALID 0xffffffff + struct hn_recvinfo { - const struct ndis_8021q_info_ *vlan_info; + uint32_t vlan_info; const struct rndis_tcp_ip_csum_info_ *csum_info; const struct rndis_hash_info *hash_info; const struct rndis_hash_value *hash_value; Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Thu Sep 1 06:35:13 2016 (r305178) +++ head/sys/dev/hyperv/netvsc/ndis.h Thu Sep 1 07:04:47 2016 (r305179) @@ -203,4 +203,20 @@ struct ndis_rssprm_toeplitz { uint32_t rss_ind[NDIS_HASH_INDCNT]; }; +/* + * Per-packet-info + */ + +/* VLAN */ +#define NDIS_VLAN_INFO_SIZE sizeof(uint32_t) +#define NDIS_VLAN_INFO_PRI_MASK 0x0007 +#define NDIS_VLAN_INFO_CFI_MASK 0x0008 +#define NDIS_VLAN_INFO_ID_MASK 0xfff0 +#define NDIS_VLAN_INFO_MAKE(id, pri, cfi) \ + (((pri) & NVIS_VLAN_INFO_PRI_MASK) | \ + (((cfi) & 0x1) << 3) | (((id) & 0xfff) << 4)) +#define NDIS_VLAN_INFO_ID(inf) (((inf) & NDIS_VLAN_INFO_ID_MASK) >> 4) +#define NDIS_VLAN_INFO_CFI(inf) (((inf) & NDIS_VLAN_INFO_CFI_MASK) >> 3) +#define NDIS_VLAN_INFO_PRI(inf) ((inf) & NDIS_VLAN_INFO_PRI_MASK) + #endif /* !_NET_NDIS_H_ */ From owner-svn-src-head@freebsd.org Thu Sep 1 07:17: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 7E062BCB245; Thu, 1 Sep 2016 07:17:07 +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 4B65DC21; Thu, 1 Sep 2016 07:17:07 +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 u817H6nY040465; Thu, 1 Sep 2016 07:17:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u817H6L4040464; Thu, 1 Sep 2016 07:17:06 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609010717.u817H6L4040464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Sep 2016 07:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305182 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 07:17:07 -0000 Author: sephe Date: Thu Sep 1 07:17:06 2016 New Revision: 305182 URL: https://svnweb.freebsd.org/changeset/base/305182 Log: net/rndis: Define types for RNDIS pktinfo rm_type field. They are defined by NDIS spec, so the NDIS prefix. Reviewed by: hps MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7717 Modified: head/sys/net/rndis.h Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Thu Sep 1 07:15:23 2016 (r305181) +++ head/sys/net/rndis.h Thu Sep 1 07:17:06 2016 (r305182) @@ -122,7 +122,7 @@ struct rndis_packet_msg { /* Per-packet-info for RNDIS data message */ struct rndis_pktinfo { uint32_t rm_size; - uint32_t rm_type; + uint32_t rm_type; /* NDIS_PKTINFO_TYPE_ */ uint32_t rm_pktinfooffset; uint8_t rm_data[]; }; @@ -131,6 +131,19 @@ struct rndis_pktinfo { __offsetof(struct rndis_pktinfo, rm_data[0]) #define RNDIS_PKTINFO_ALIGN 4 +#define NDIS_PKTINFO_TYPE_CSUM 0 +#define NDIS_PKTINFO_TYPE_IPSEC 1 +#define NDIS_PKTINFO_TYPE_LSO 2 +#define NDIS_PKTINFO_TYPE_CLASSIFY 3 +/* reserved 4 */ +#define NDIS_PKTINFO_TYPE_SGLIST 5 +#define NDIS_PKTINFO_TYPE_VLAN 6 +#define NDIS_PKTINFO_TYPE_ORIG 7 +#define NDIS_PKTINFO_TYPE_PKT_CANCELID 8 +#define NDIS_PKTINFO_TYPE_ORIG_NBLIST 9 +#define NDIS_PKTINFO_TYPE_CACHE_NBLIST 10 +#define NDIS_PKTINFO_TYPE_PKT_PAD 11 + /* * RNDIS control messages */ From owner-svn-src-head@freebsd.org Thu Sep 1 08:38: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 2E8EDBC8959; Thu, 1 Sep 2016 08:38:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC88F994; Thu, 1 Sep 2016 08:38:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x241.google.com with SMTP id cf3so3904275pad.2; Thu, 01 Sep 2016 01:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=gqVDnGf34iUMwVwDf9Oj1nFr6YbSik8hnGTrUCKHvlI=; b=Kzlu1lW/12LAmLWqkRx0WiW5zdbhQAkCTVD3GPGFfUdjRsXm7zVR8QQ0d2BrnGI/l+ 36bVA2WkfWOhV6Z0TmtNZcXxGFMeFlY/njb2F2hUo3B0dxHG0eCkXLk19CfywjSFOnc8 nRBZQyWsuaVMhvLPC4wz6I9MvTQlpH4GT26jf2gXnDhyAfe0cWjRNpZOCtvdgiYejlU4 AErtEuTuUfZV3UwFcmAErz6BTAGTNerPJhpN0CtIJXIefWYH/ncy+MxT344XjxNW0Ssq 7q8il4WkVcVGOuGXKWSUYnLPbzKYoS7nEg5r/G2l/e88KYOW0vpLJamRYkKWVtI1F6yL EY9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=gqVDnGf34iUMwVwDf9Oj1nFr6YbSik8hnGTrUCKHvlI=; b=c0F3DPVSDiy8xw6XHyxIs0ohVMFmMM8mk6J+0EnOV7cUsadz9qOemgeIRklFwG4zgV jMP42Rod9vqK06ykAFCmefxuf4Fz6R3oIJGgsHReY52bnd569arem/wHt9F7rTZ0CCOT Mzef1wReZ+ziMJRBstyRpo3aAkmXiLzTxjFq3rDKfy1wFpG3kSh/o8tEEtiz8ZMbhPCA GWAnL2ifHMZ7zm8MF7i6mtQhrbQfojm6C80nuZRhrriefT34xFu/t1DuYaRh1kwkFhPv q+1gobnyPaQOdBInezSyD6Mi1XmOXT4QwKu1DYKbF8Hr1hwfwKJu+u+WS/Rw7f4n8jIw 6wTw== X-Gm-Message-State: AE9vXwM80xZ/X5snYWZIom/zWEBiWZAyqwmGIXWu0O8P+jeM49pe4yr9taHXIBZLtaDHMg== X-Received: by 10.66.148.7 with SMTP id to7mr24965103pab.128.1472719118467; Thu, 01 Sep 2016 01:38:38 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id tr1sm5429548pab.19.2016.09.01.01.38.36 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 01:38:36 -0700 (PDT) Subject: Re: svn commit: r301752 - head/contrib/netbsd-tests/lib/libc/string Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_CAC72662-B589-483A-A1D0-2640029AAA4B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <7C6CB7A6-085E-40CF-B72A-3013DBEE386E@gmail.com> Date: Thu, 1 Sep 2016 01:38:35 -0700 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "jenkins-admin@freebsd.org" , FreeBSD stable Message-Id: References: <201606091835.u59IZbtB094147@repo.freebsd.org> <7C6CB7A6-085E-40CF-B72A-3013DBEE386E@gmail.com> To: Craig Rodrigues X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 08:38:39 -0000 --Apple-Mail=_CAC72662-B589-483A-A1D0-2640029AAA4B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 31, 2016, at 19:12, Ngie Cooper (yaneurabeya) = wrote: =E2=80=A6 > Shoot =E2=80=94 I=E2=80=99ll verify the issue and commit the change. Confirmed and fixed in r305190. Thanks! -Ngie --Apple-Mail=_CAC72662-B589-483A-A1D0-2640029AAA4B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXx+kLAAoJEPWDqSZpMIYVy7MQANJdXZdfwJiOSXzaii4fklwB pWbr6nogDmPqE6KdQOBByqWtRGBLY6d9geoSXdsMHfgFGXC51UhZglMyrHuXCtrh iQxfq7L6UHqdvKErtgegTBOiXi8TlfSKOLrTiXI3jDbet/fcEWL50auYAWIF09Bz Z+Qvo595cAE+NAtQEMGOvdfwB4J4Bqs9Lq8OL25+2miTMOkKAXwUbevDjeVCnIUo 4EMpEkbNi+ia7z5198/QkAT2eHCEOytq9267Ivcc2LEQDmzyT5A9YrKmaikP18KF jEdqZITt6z9LTC5hewbHKlEef3tSIA+wc67IAw6YRmLrAKPwGIDuoHt/BsPvBFzg XBplnEaVfwVtlAym2osWjbrioJg/faxjxykYBGOZE5EIkFYvqQfd7hXoYk3xG+jD /aZvuWLJNkor2+WS1qNimtcSu2UQdTI+eiIcpqUH21tSd8Gq9QE6lgHx8v5qYqsY iMFRS8kl5M+7YyImYCRVGvxqgiN8vUVBZzoLuqThFVmhuLygrExdQuRpYiiCMeY9 ID1wisi+fMHCOi4hazzIUJkm6xHIWjOqlRKaLL2KZqHIlUfTdXZX6h+bre9KrYaa 6+8hFjhI5IpbPsCKDQCnYpgV7c5GhqXmBOqOa/tDg8UDch8c7mxF4SUft13EkPOn QoM1PinayTDFFUjQvPyP =gefO -----END PGP SIGNATURE----- --Apple-Mail=_CAC72662-B589-483A-A1D0-2640029AAA4B-- From owner-svn-src-head@freebsd.org Thu Sep 1 10:26: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 CE9DFBC9E55; Thu, 1 Sep 2016 10:26:07 +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 9EECCEEC; Thu, 1 Sep 2016 10:26:07 +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 u81AQ6ZB012180; Thu, 1 Sep 2016 10:26:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81AQ6sn012179; Thu, 1 Sep 2016 10:26:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609011026.u81AQ6sn012179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 1 Sep 2016 10:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305191 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 10:26:07 -0000 Author: andrew Date: Thu Sep 1 10:26:06 2016 New Revision: 305191 URL: https://svnweb.freebsd.org/changeset/base/305191 Log: Fix arm64 superpages bugs in pmap_enter: * Pass the correct virtual address when demoting a superpage * Use the correct l3 table after demoting a superpage * Remove an invalid KASSERT hit demoting then promoting a superpage [1] With this it is believed that superpages on arm64 is stable. Reported by: [1] cognet Obtained from: ABT Systems Ltd MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Sep 1 08:34:31 2016 (r305190) +++ head/sys/arm64/arm64/pmap.c Thu Sep 1 10:26:06 2016 (r305191) @@ -2732,7 +2732,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pde != NULL && lvl == 1) { l2 = pmap_l1_to_l2(pde, va); if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK && - (l3 = pmap_demote_l2_locked(pmap, l2, va, &lock)) != NULL) { + (l3 = pmap_demote_l2_locked(pmap, l2, va & ~L2_OFFSET, + &lock)) != NULL) { + l3 = &l3[pmap_l3_index(va)]; if (va < VM_MAXUSER_ADDRESS) { mpte = PHYS_TO_VM_PAGE( pmap_load(l2) & ~ATTR_MASK); @@ -2944,7 +2946,6 @@ validate: pmap_superpages_enabled() && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { - KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); pmap_promote_l2(pmap, pde, va, &lock); } } From owner-svn-src-head@freebsd.org Thu Sep 1 13:04: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 7172BBCB8A5; Thu, 1 Sep 2016 13:04:37 +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 23C777FE; Thu, 1 Sep 2016 13:04:37 +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 u81D4ako072666; Thu, 1 Sep 2016 13:04:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81D4aIq072665; Thu, 1 Sep 2016 13:04:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011304.u81D4aIq072665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 13:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305193 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 13:04:37 -0000 Author: mav Date: Thu Sep 1 13:04:36 2016 New Revision: 305193 URL: https://svnweb.freebsd.org/changeset/base/305193 Log: MFV r302642: 6876 Stack corruption after importing a pool with a too-long name illumos/illumos-gate@c971037baa5d64dfecf6d87ed602fc3116ebec41 https://github.com/illumos/illumos-gate/commit/c971037baa5d64dfecf6d87ed602fc3116ebec41 https://www.illumos.org/issues/6876 Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for trouble. We should check every dataset on import, using a 1024 byte buffer and checking each time to see if the dataset's new name is longer than 256 bytes. Reviewed by: Prakash Surya Reviewed by: Dan Kimmel Reviewed by: George Wilson Reviewed by: Yuri Pankov Approved by: Richard Lowe Author: Paul Dagnelie Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.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 Thu Sep 1 12:01:23 2016 (r305192) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Sep 1 13:04:36 2016 (r305193) @@ -1996,6 +1996,19 @@ spa_load_verify_cb(spa_t *spa, zilog_t * return (0); } +/* ARGSUSED */ +int +verify_dataset_name_len(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg) +{ + char namebuf[MAXPATHLEN]; + dsl_dataset_name(ds, namebuf); + if (strlen(namebuf) > MAXNAMELEN) { + return (SET_ERROR(ENAMETOOLONG)); + } + + return (0); +} + static int spa_load_verify(spa_t *spa) { @@ -2010,6 +2023,14 @@ spa_load_verify(spa_t *spa) if (policy.zrp_request & ZPOOL_NEVER_REWIND) return (0); + dsl_pool_config_enter(spa->spa_dsl_pool, FTAG); + error = dmu_objset_find_dp(spa->spa_dsl_pool, + spa->spa_dsl_pool->dp_root_dir_obj, verify_dataset_name_len, NULL, + DS_FIND_CHILDREN); + dsl_pool_config_exit(spa->spa_dsl_pool, FTAG); + if (error != 0) + return (error); + rio = zio_root(spa, NULL, &sle, ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE); From owner-svn-src-head@freebsd.org Thu Sep 1 13: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 609A1BCBD0A; Thu, 1 Sep 2016 13:14:32 +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 17F96D4; Thu, 1 Sep 2016 13:14:32 +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 u81DEVCQ076671; Thu, 1 Sep 2016 13:14:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81DEVll076670; Thu, 1 Sep 2016 13:14:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011314.u81DEVll076670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 13:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305194 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 13:14:32 -0000 Author: mav Date: Thu Sep 1 13:14:31 2016 New Revision: 305194 URL: https://svnweb.freebsd.org/changeset/base/305194 Log: MFV r302642: 6876 Stack corruption after importing a pool with a too-long name illumos/illumos-gate@c971037baa5d64dfecf6d87ed602fc3116ebec41 https://github.com/illumos/illumos-gate/commit/c971037baa5d64dfecf6d87ed602fc3116ebec41 https://www.illumos.org/issues/6876 Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for trouble. We should check every dataset on import, using a 1024 byte buffer and checking each time to see if the dataset's new name is longer than 256 bytes. Reviewed by: Prakash Surya Reviewed by: Dan Kimmel Reviewed by: George Wilson Reviewed by: Yuri Pankov Approved by: Richard Lowe Author: Paul Dagnelie Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.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_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Sep 1 13:04:36 2016 (r305193) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Sep 1 13:14:31 2016 (r305194) @@ -1786,7 +1786,12 @@ zpool_import_props(libzfs_handle_t *hdl, case EEXIST: (void) zpool_standard_error(hdl, error, desc); break; - + case ENAMETOOLONG: + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "new name of at least one dataset is longer than " + "the maximum allowable length")); + (void) zfs_error(hdl, EZFS_NAMETOOLONG, desc); + break; default: (void) zpool_standard_error(hdl, error, desc); zpool_explain_recover(hdl, From owner-svn-src-head@freebsd.org Thu Sep 1 13:29: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 28D46BCA373; Thu, 1 Sep 2016 13:29:55 +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 06470EA8; Thu, 1 Sep 2016 13:29: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 u81DTsWI081330; Thu, 1 Sep 2016 13:29:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81DTrVr081317; Thu, 1 Sep 2016 13:29:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011329.u81DTrVr081317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 13:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305195 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/... 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.22 Precedence: list List-Id: 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, 01 Sep 2016 13:29:55 -0000 Author: mav Date: Thu Sep 1 13:29:53 2016 New Revision: 305195 URL: https://svnweb.freebsd.org/changeset/base/305195 Log: MFV r302643: 6902 speed up listing of snapshots if requesting name only and sorting by name This was our change from the beginning, so just reduce the upstream diff. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Thu Sep 1 13:14:31 2016 (r305194) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Thu Sep 1 13:29:53 2016 (r305195) @@ -21,8 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 Pawel Jakub Dawidek . - * All rights reserved. + * Copyright (c) 2012 Pawel Jakub Dawidek. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. */ @@ -320,8 +319,8 @@ zfs_sort(const void *larg, const void *r } else if (psc->sc_prop == ZFS_PROP_NAME) { lvalid = rvalid = B_TRUE; - (void) strlcpy(lbuf, zfs_get_name(l), sizeof(lbuf)); - (void) strlcpy(rbuf, zfs_get_name(r), sizeof(rbuf)); + (void) strlcpy(lbuf, zfs_get_name(l), sizeof (lbuf)); + (void) strlcpy(rbuf, zfs_get_name(r), sizeof (rbuf)); lstr = lbuf; rstr = rbuf; Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h Thu Sep 1 13:14:31 2016 (r305194) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h Thu Sep 1 13:29:53 2016 (r305195) @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 1 13:14:31 2016 (r305194) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 1 13:29:53 2016 (r305195) @@ -24,8 +24,7 @@ * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Copyright (c) 2011-2012 Pawel Jakub Dawidek . - * All rights reserved. + * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. @@ -3009,7 +3008,7 @@ print_dataset(zfs_handle_t *zhp, list_cb if (pl->pl_prop == ZFS_PROP_NAME) { (void) strlcpy(property, zfs_get_name(zhp), - sizeof(property)); + sizeof (property)); propstr = property; right_justify = zfs_prop_align_right(pl->pl_prop); } else if (pl->pl_prop != ZPROP_INVAL) { Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Sep 1 13:14:31 2016 (r305194) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Sep 1 13:29:53 2016 (r305195) @@ -21,8 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 Pawel Jakub Dawidek . - * All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 13:14:31 2016 (r305194) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 13:29:53 2016 (r305195) @@ -24,9 +24,8 @@ * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. - * Copyright (c) 2011-2012 Pawel Jakub Dawidek . - * All rights reserved. - * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. + * Copyright (c) 2013 Martin Matuska. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Thu Sep 1 13:14:31 2016 (r305194) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Thu Sep 1 13:29:53 2016 (r305195) @@ -21,8 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 Pawel Jakub Dawidek . - * All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. */ Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Thu Sep 1 13:14:31 2016 (r305194) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Thu Sep 1 13:29:53 2016 (r305195) @@ -22,8 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2015 by Delphix. All rights reserved. - * Copyright (c) 2012 Pawel Jakub Dawidek . - * All rights reserved. + * Copyright (c) 2012 Pawel Jakub Dawidek. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 13:14:31 2016 (r305194) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 13:29:53 2016 (r305195) @@ -23,8 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 Pawel Jakub Dawidek . - * All rights reserved. + * 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. * Copyright (c) 2014 Integros [integros.com] 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 Thu Sep 1 13:14:31 2016 (r305194) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Thu Sep 1 13:29:53 2016 (r305195) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright 2016 RackTop Systems. * Copyright (c) 2014 Integros [integros.com] 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 Thu Sep 1 13:14:31 2016 (r305194) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Sep 1 13:29:53 2016 (r305195) @@ -21,8 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011-2012 Pawel Jakub Dawidek . - * All rights reserved. + * Copyright (c) 2011-2012 Pawel Jakub Dawidek. 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. From owner-svn-src-head@freebsd.org Thu Sep 1 13:38: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 3E924BCACA8; Thu, 1 Sep 2016 13:38:47 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0F87AB18; Thu, 1 Sep 2016 13:38:46 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81Dckes085584; Thu, 1 Sep 2016 13:38:46 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Dckc0085583; Thu, 1 Sep 2016 13:38:46 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201609011338.u81Dckc0085583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Thu, 1 Sep 2016 13:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305196 - head/sys/dev/bhnd/cores/pmu 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.22 Precedence: list List-Id: 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, 01 Sep 2016 13:38:47 -0000 Author: mizhka Date: Thu Sep 1 13:38:46 2016 New Revision: 305196 URL: https://svnweb.freebsd.org/changeset/base/305196 Log: [BHND/PMU] Correct shift of bits in BHND_PMU_SET_BITS macro The purpose of BHND_PMU_{GET,SET}_BITS macro is to transform values from/into register format. SET macro shifts value to left and applies filter mask. GET macro applies filter mask and then shifts value to right. Reviewed by: landonf, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7721 Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h ============================================================================== --- head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h Thu Sep 1 13:29:53 2016 (r305195) +++ head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h Thu Sep 1 13:38:46 2016 (r305196) @@ -30,7 +30,7 @@ #define BHND_PMU_GET_BITS(_value, _field) \ (((_value) & _field ## _MASK) >> _field ## _SHIFT) #define BHND_PMU_SET_BITS(_value, _field) \ - (((_value) & _field ## _MASK) >> _field ## _SHIFT) + (((_value) << _field ## _SHIFT) & _field ## _MASK) #define BHND_PMU_ILP_CLOCK 32000 /**< default ILP freq */ #define BHND_PMU_ALP_CLOCK 20000000 /**< default ALP freq */ From owner-svn-src-head@freebsd.org Thu Sep 1 13:42: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 A8472BCAF78; Thu, 1 Sep 2016 13:42:05 +0000 (UTC) (envelope-from marieheleneka@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::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 3FA14F7; Thu, 1 Sep 2016 13:42:05 +0000 (UTC) (envelope-from marieheleneka@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id v143so22545825wmv.0; Thu, 01 Sep 2016 06:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yiPbxLlIQQDQiUdkksmqumZZJxoIdtEKabpmVvXMm9g=; b=nW3eCJdnrDqrOgqyW+LJxX/TXEK7YOQRb/jE3gQLZucseTlWfJy+ZxQ8wMaMdzS9Ua q3wlEUQ8CZYuUo/sLDdG4i7NY85+yZVJCdGwRylnAggMWNsx4LbB0yuD48blZlEPnbPg nRE5/nVNitCOpCSfuqBB501K7FkdL7JWePtyQswOZJjhYNjetHTvFGwZIw4OpF48b6H5 ds2mo+m1kB0rCBJSOfCzm3aIsjcjYp2+IMMrthIsmpywTNZVYJA/UEr/JO14Ti+ycWEx XXb+tbCxgMGpWUbaCrXtJlOxAwllPrE8xl3lbBrbaCHNTjUklygXsi2xswbDjpSBAtsf uvnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yiPbxLlIQQDQiUdkksmqumZZJxoIdtEKabpmVvXMm9g=; b=lmYkf+3+9Rr0Eqau9rtKiclMkMkg+x6NLXz1bt+jnkaZi8ojM7bff6CE/RmZ+z61pg rj08PW+h+HQc13VCvT/EmaN/5ZvpT1Ulha0JxM+hDVSt3OZ1H/jLHe+XCyMh3WmOFC/L UmAK9TnWvlWXBO/LiPsaRv/6cf7rwJL2nQJ++K/rX3Sg/Lxb43eG8LxI58aoqyWUUejS sfv/dKvnJXsasvTuNvKqPMq6ff5ssC4z+l9L15HfYOqVAvUOAEWvrAH6ZytiyJXT/VCp ADosPCJtveu0YeoEsWL9gtQ3hWOZSahVVGsq7o7NnIZq3n+qWNVozJkYeOftswb0i36J Ruug== X-Gm-Message-State: AE9vXwPiJEA1xc+a5XV8v4g8Zvs1kE2/JeXWFYgwC53U3Fkx8uY7+CFRfP9z6/GZwp0a5pvxyebl06cl24P+tg== X-Received: by 10.194.133.104 with SMTP id pb8mr14320245wjb.139.1472737321460; Thu, 01 Sep 2016 06:42:01 -0700 (PDT) MIME-Version: 1.0 References: <201608251940.u7PJePv3023083@repo.freebsd.org> <23395083.lPEyYQ7ZbW@ralph.baldwin.cx> <1A050E0F-4B9F-420A-97C6-C203B92A5F3F@FreeBSD.org> <20160825203014.GB5517@FreeBSD.org> In-Reply-To: <20160825203014.GB5517@FreeBSD.org> From: Marie Helene Kvello-Aune Date: Thu, 01 Sep 2016 13:41:50 +0000 Message-ID: Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk To: Alexey Dokuchaev , Kristof Provost Cc: John Baldwin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 13:42:05 -0000 On Thu, Aug 25, 2016 at 10:30 PM Alexey Dokuchaev wrote: > On Thu, Aug 25, 2016 at 10:20:29PM +0200, Kristof Provost wrote: > > On 25 Aug 2016, at 22:14, John Baldwin wrote: > > > I hate even writing this mail, and it looks like the topic wasn't > > > really discussed in the review, but I think libifconfig is probably > > > the "better" name if the goal is to move most of ifconfig into it. > > > ... > > > Hmm, it seems you are 'libifc_*'. Most of our libraries do not > > > include 'lib' in the namespace prefix (see above examples that all > > > use the name of the library without 'lib' as the prefix). If nothing > > > else I'd suggest dropping 'lib' to be consistent with most other > > > libraries in the tree. > > +1. > > > The name was in fact discussed privately, and we figured libifconfig > > was a bit on the long side. > > Oh come one, we already have `libblocksruntime' and `libbluetooth' (and > some others I probably don't remember now). `libifconfig' is just fine. > Potential namespace clashes are a lot nastier than a longer name. > > > I certainly take your point about libifc_. Does anyone else have any > > views regarding the naming (or other subjects)? > > I second John, dropping the `lib' prefix and going with `ifconfig_' looks > like a good idea. > > ./danfe > Considering the points raised on this topic, I agree naming it 'libifconfig' and using 'ifconfig_' prefix is better than what's currently in place. I've submitted a differential revision for it here: https://reviews.freebsd.org/D7742 This should be committed before further fixes, to keep as much history as possible. Regards, Marie Helene From owner-svn-src-head@freebsd.org Thu Sep 1 14:06: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 4741EBCB7ED; Thu, 1 Sep 2016 14:06:32 +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 228CC65D; Thu, 1 Sep 2016 14:06:32 +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 u81E6VSv097435; Thu, 1 Sep 2016 14:06:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81E6VTh097431; Thu, 1 Sep 2016 14:06:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011406.u81E6VTh097431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305197 - in head/sys/cddl/contrib/opensolaris: common/zfs uts/common/fs/zfs 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:06:32 -0000 Author: mav Date: Thu Sep 1 14:06:30 2016 New Revision: 305197 URL: https://svnweb.freebsd.org/changeset/base/305197 Log: MFV r302646: 6980 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch illumos/illumos-gate@ea4a67f462de0a39a9adea8197bcdef849de5371 https://github.com/illumos/illumos-gate/commit/ea4a67f462de0a39a9adea8197bcdef84 9de5371 https://www.illumos.org/issues/6980 doing zfs send -i snap1 snap2 >testfile results in internal error: Invalid argument Abort (core dumped) Reviewed by: Paul Dagnelie Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h 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/common/zfs/zfs_ioctl_compat.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c Thu Sep 1 13:38:46 2016 (r305196) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c Thu Sep 1 14:06:30 2016 (r305197) @@ -55,8 +55,52 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_ zfs_cmd_zcmd_t *zcmd_c; zfs_cmd_edbp_t *edbp_c; zfs_cmd_resume_t *resume_c; + zfs_cmd_inlanes_t *inlanes_c; switch (cflag) { + case ZFS_CMD_COMPAT_INLANES: + inlanes_c = (void *)addr; + /* zc */ + strlcpy(zc->zc_name, inlanes_c->zc_name, MAXPATHLEN); + strlcpy(zc->zc_value, inlanes_c->zc_value, MAXPATHLEN * 2); + strlcpy(zc->zc_string, inlanes_c->zc_string, MAXPATHLEN); + +#define FIELD_COPY(field) zc->field = inlanes_c->field + FIELD_COPY(zc_nvlist_src); + FIELD_COPY(zc_nvlist_src_size); + FIELD_COPY(zc_nvlist_dst); + FIELD_COPY(zc_nvlist_dst_size); + FIELD_COPY(zc_nvlist_dst_filled); + FIELD_COPY(zc_pad2); + FIELD_COPY(zc_history); + FIELD_COPY(zc_guid); + FIELD_COPY(zc_nvlist_conf); + FIELD_COPY(zc_nvlist_conf_size); + FIELD_COPY(zc_cookie); + FIELD_COPY(zc_objset_type); + FIELD_COPY(zc_perm_action); + FIELD_COPY(zc_history_len); + FIELD_COPY(zc_history_offset); + FIELD_COPY(zc_obj); + FIELD_COPY(zc_iflags); + FIELD_COPY(zc_share); + FIELD_COPY(zc_jailid); + FIELD_COPY(zc_objset_stats); + FIELD_COPY(zc_begin_record); + FIELD_COPY(zc_inject_record); + FIELD_COPY(zc_defer_destroy); + FIELD_COPY(zc_flags); + FIELD_COPY(zc_action_handle); + FIELD_COPY(zc_cleanup_fd); + FIELD_COPY(zc_simple); + FIELD_COPY(zc_resumable); + FIELD_COPY(zc_sendobj); + FIELD_COPY(zc_fromobj); + FIELD_COPY(zc_createtxg); + FIELD_COPY(zc_stat); +#undef FIELD_COPY + break; + case ZFS_CMD_COMPAT_RESUME: resume_c = (void *)addr; /* zc */ @@ -434,8 +478,50 @@ zfs_cmd_compat_put(zfs_cmd_t *zc, caddr_ zfs_cmd_zcmd_t *zcmd_c; zfs_cmd_edbp_t *edbp_c; zfs_cmd_resume_t *resume_c; + zfs_cmd_inlanes_t *inlanes_c; switch (cflag) { + case ZFS_CMD_COMPAT_INLANES: + inlanes_c = (void *)addr; + strlcpy(inlanes_c->zc_name, zc->zc_name, MAXPATHLEN); + strlcpy(inlanes_c->zc_value, zc->zc_value, MAXPATHLEN * 2); + strlcpy(inlanes_c->zc_string, zc->zc_string, MAXPATHLEN); + +#define FIELD_COPY(field) inlanes_c->field = zc->field + FIELD_COPY(zc_nvlist_src); + FIELD_COPY(zc_nvlist_src_size); + FIELD_COPY(zc_nvlist_dst); + FIELD_COPY(zc_nvlist_dst_size); + FIELD_COPY(zc_nvlist_dst_filled); + FIELD_COPY(zc_pad2); + FIELD_COPY(zc_history); + FIELD_COPY(zc_guid); + FIELD_COPY(zc_nvlist_conf); + FIELD_COPY(zc_nvlist_conf_size); + FIELD_COPY(zc_cookie); + FIELD_COPY(zc_objset_type); + FIELD_COPY(zc_perm_action); + FIELD_COPY(zc_history_len); + FIELD_COPY(zc_history_offset); + FIELD_COPY(zc_obj); + FIELD_COPY(zc_iflags); + FIELD_COPY(zc_share); + FIELD_COPY(zc_jailid); + FIELD_COPY(zc_objset_stats); + FIELD_COPY(zc_begin_record); + FIELD_COPY(zc_inject_record); + FIELD_COPY(zc_defer_destroy); + FIELD_COPY(zc_flags); + FIELD_COPY(zc_action_handle); + FIELD_COPY(zc_cleanup_fd); + FIELD_COPY(zc_simple); + FIELD_COPY(zc_sendobj); + FIELD_COPY(zc_fromobj); + FIELD_COPY(zc_createtxg); + FIELD_COPY(zc_stat); +#undef FIELD_COPY + break; + case ZFS_CMD_COMPAT_RESUME: resume_c = (void *)addr; strlcpy(resume_c->zc_name, zc->zc_name, MAXPATHLEN); @@ -987,6 +1073,12 @@ zcmd_ioctl_compat(int fd, int request, z zp.zfs_cmd_size = sizeof(zfs_cmd_t); zp.zfs_ioctl_version = ZFS_IOCVER_CURRENT; return (ioctl(fd, ncmd, &zp)); + case ZFS_CMD_COMPAT_INLANES: + ncmd = _IOWR('Z', request, struct zfs_iocparm); + zp.zfs_cmd = (uint64_t)zc; + zp.zfs_cmd_size = sizeof(zfs_cmd_inlanes_t); + zp.zfs_ioctl_version = ZFS_IOCVER_INLANES; + return (ioctl(fd, ncmd, &zp)); case ZFS_CMD_COMPAT_RESUME: ncmd = _IOWR('Z', request, struct zfs_iocparm); zp.zfs_cmd = (uint64_t)zc; @@ -1104,7 +1196,7 @@ zfs_ioctl_compat_innvl(zfs_cmd_t *zc, nv if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC || cflag == ZFS_CMD_COMPAT_ZCMD || cflag == ZFS_CMD_COMPAT_EDBP || - cflag == ZFS_CMD_COMPAT_RESUME) + cflag == ZFS_CMD_COMPAT_RESUME || cflag == ZFS_CMD_COMPAT_INLANES) goto out; switch (vec) { @@ -1257,7 +1349,7 @@ zfs_ioctl_compat_outnvl(zfs_cmd_t *zc, n if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC || cflag == ZFS_CMD_COMPAT_ZCMD || cflag == ZFS_CMD_COMPAT_EDBP || - cflag == ZFS_CMD_COMPAT_RESUME) + cflag == ZFS_CMD_COMPAT_RESUME || cflag == ZFS_CMD_COMPAT_INLANES) return (outnvl); switch (vec) { Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h Thu Sep 1 13:38:46 2016 (r305196) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h Thu Sep 1 14:06:30 2016 (r305197) @@ -54,7 +54,8 @@ extern "C" { #define ZFS_IOCVER_EDBP 4 #define ZFS_IOCVER_RESUME 5 #define ZFS_IOCVER_INLANES 6 -#define ZFS_IOCVER_CURRENT ZFS_IOCVER_INLANES +#define ZFS_IOCVER_PAD 7 +#define ZFS_IOCVER_CURRENT ZFS_IOCVER_PAD /* compatibility conversion flag */ #define ZFS_CMD_COMPAT_NONE 0 @@ -65,6 +66,7 @@ extern "C" { #define ZFS_CMD_COMPAT_ZCMD 5 #define ZFS_CMD_COMPAT_EDBP 6 #define ZFS_CMD_COMPAT_RESUME 7 +#define ZFS_CMD_COMPAT_INLANES 8 #define ZFS_IOC_COMPAT_PASS 254 #define ZFS_IOC_COMPAT_FAIL 255 @@ -355,6 +357,49 @@ typedef struct zfs_cmd_resume { zfs_stat_t zc_stat; } zfs_cmd_resume_t; +typedef struct zfs_cmd_inlanes { + char zc_name[MAXPATHLEN]; /* name of pool or dataset */ + uint64_t zc_nvlist_src; /* really (char *) */ + uint64_t zc_nvlist_src_size; + uint64_t zc_nvlist_dst; /* really (char *) */ + uint64_t zc_nvlist_dst_size; + boolean_t zc_nvlist_dst_filled; /* put an nvlist in dst? */ + int zc_pad2; + + /* + * The following members are for legacy ioctls which haven't been + * converted to the new method. + */ + uint64_t zc_history; /* really (char *) */ + char zc_value[MAXPATHLEN * 2]; + char zc_string[MAXNAMELEN]; + uint64_t zc_guid; + uint64_t zc_nvlist_conf; /* really (char *) */ + uint64_t zc_nvlist_conf_size; + uint64_t zc_cookie; + uint64_t zc_objset_type; + uint64_t zc_perm_action; + uint64_t zc_history_len; + uint64_t zc_history_offset; + uint64_t zc_obj; + uint64_t zc_iflags; /* internal to zfs(7fs) */ + zfs_share_t zc_share; + uint64_t zc_jailid; + dmu_objset_stats_t zc_objset_stats; + dmu_replay_record_t zc_begin_record; + zinject_record_t zc_inject_record; + uint32_t zc_defer_destroy; + uint32_t zc_flags; + uint64_t zc_action_handle; + int zc_cleanup_fd; + uint8_t zc_simple; + boolean_t zc_resumable; + uint64_t zc_sendobj; + uint64_t zc_fromobj; + uint64_t zc_createtxg; + zfs_stat_t zc_stat; +} zfs_cmd_inlanes_t; + #ifdef _KERNEL unsigned static long zfs_ioctl_v15_to_v28[] = { 0, /* 0 ZFS_IOC_POOL_CREATE */ 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 Thu Sep 1 13:38:46 2016 (r305196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Thu Sep 1 14:06:30 2016 (r305197) @@ -353,6 +353,12 @@ typedef enum zfs_case { ZFS_CASE_MIXED } zfs_case_t; +/* + * Note: this struct must have the same layout in 32-bit and 64-bit, so + * that 32-bit processes (like /sbin/zfs) can pass it to the 64-bit + * kernel. Therefore, we add padding to it so that no "hidden" padding + * is automatically added on 64-bit (but not on 32-bit). + */ typedef struct zfs_cmd { char zc_name[MAXPATHLEN]; /* name of pool or dataset */ uint64_t zc_nvlist_src; /* really (char *) */ @@ -389,7 +395,9 @@ typedef struct zfs_cmd { uint64_t zc_action_handle; int zc_cleanup_fd; uint8_t zc_simple; + uint8_t zc_pad3[3]; boolean_t zc_resumable; + uint32_t zc_pad4; uint64_t zc_sendobj; uint64_t zc_fromobj; uint64_t zc_createtxg; 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 Thu Sep 1 13:38:46 2016 (r305196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Sep 1 14:06:30 2016 (r305197) @@ -6252,6 +6252,14 @@ zfsdev_ioctl(struct cdev *dev, u_long zc goto out; } break; + case ZFS_IOCVER_INLANES: + if (zc_iocparm->zfs_cmd_size != sizeof(zfs_cmd_inlanes_t)) { + error = SET_ERROR(EFAULT); + goto out; + } + compat = B_TRUE; + cflag = ZFS_CMD_COMPAT_INLANES; + break; case ZFS_IOCVER_RESUME: if (zc_iocparm->zfs_cmd_size != sizeof(zfs_cmd_resume_t)) { error = SET_ERROR(EFAULT); From owner-svn-src-head@freebsd.org Thu Sep 1 14:17: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 75001BCBBE3; Thu, 1 Sep 2016 14:17: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 52E259A; Thu, 1 Sep 2016 14:17: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 u81EHU7x002064; Thu, 1 Sep 2016 14:17:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81EHUYf002062; Thu, 1 Sep 2016 14:17:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011417.u81EHUYf002062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305198 - in head/sys/cddl/contrib/opensolaris/uts/common: fs/zfs sys/sysevent 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:17:31 -0000 Author: mav Date: Thu Sep 1 14:17:30 2016 New Revision: 305198 URL: https://svnweb.freebsd.org/changeset/base/305198 Log: MFV r302647: 6922 Emit ESC_ZFS_VDEV_REMOVE_AUX after removing an aux device illumos/illumos-gate@63364b0ee2604783e7a55f8425888867768eafa4 https://github.com/illumos/illumos-gate/commit/63364b0ee2604783e7a55f84258888677 68eafa4 https://www.illumos.org/issues/6922 ZFS does not do a config_sync after removing an aux (spare, log, or cache) device. AFAICT this isn't being done because it is slow and was deemed unnecessary. However, it should be such a rare operation that speed doesn't matter, and not doing it results in two problems: 1) It is theoretically possible to remove an aux device from one pool and attach it to another, then lose power. When power is restored, both pools woul d think that they own the aux device. 2) Removal of the aux device doesn't send any useful sysevents to userland. Reviewed by: George Wilson Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: Alan Somers Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h 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 Thu Sep 1 14:06:30 2016 (r305197) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Sep 1 14:17:30 2016 (r305198) @@ -5773,6 +5773,7 @@ spa_vdev_remove(spa_t *spa, uint64_t gui } else { error = SET_ERROR(EBUSY); } + spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); } else if (spa->spa_l2cache.sav_vdevs != NULL && nvlist_lookup_nvlist_array(spa->spa_l2cache.sav_config, ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0 && @@ -5784,6 +5785,7 @@ spa_vdev_remove(spa_t *spa, uint64_t gui ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache, nv); spa_load_l2cache(spa); spa->spa_l2cache.sav_sync = B_TRUE; + spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); } else if (vd != NULL && vd->vdev_islog) { ASSERT(!locked); ASSERT(vd == vd->vdev_top); @@ -5822,6 +5824,7 @@ spa_vdev_remove(spa_t *spa, uint64_t gui */ spa_vdev_remove_from_namespace(spa, vd); + spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_DEV); } else if (vd != NULL) { /* * Normal vdevs cannot be removed (yet). @@ -5835,7 +5838,7 @@ spa_vdev_remove(spa_t *spa, uint64_t gui } if (!locked) - return (spa_vdev_exit(spa, NULL, txg, error)); + error = spa_vdev_exit(spa, NULL, txg, error); return (error); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h Thu Sep 1 14:06:30 2016 (r305197) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h Thu Sep 1 14:17:30 2016 (r305198) @@ -249,6 +249,8 @@ extern "C" { #define ESC_ZFS_RESILVER_START "ESC_ZFS_resilver_start" #define ESC_ZFS_RESILVER_FINISH "ESC_ZFS_resilver_finish" #define ESC_ZFS_VDEV_REMOVE "ESC_ZFS_vdev_remove" +#define ESC_ZFS_VDEV_REMOVE_AUX "ESC_ZFS_vdev_remove_aux" +#define ESC_ZFS_VDEV_REMOVE_DEV "ESC_ZFS_vdev_remove_dev" #define ESC_ZFS_POOL_CREATE "ESC_ZFS_pool_create" #define ESC_ZFS_POOL_DESTROY "ESC_ZFS_pool_destroy" #define ESC_ZFS_POOL_IMPORT "ESC_ZFS_pool_import" From owner-svn-src-head@freebsd.org Thu Sep 1 14:24: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 7E2E8BCBD9F; Thu, 1 Sep 2016 14:24:55 +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 4B5276ED; Thu, 1 Sep 2016 14:24:55 +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 u81EOsnl005664; Thu, 1 Sep 2016 14:24:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81EOsOA005663; Thu, 1 Sep 2016 14:24:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011424.u81EOsOA005663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305199 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:24:55 -0000 Author: mav Date: Thu Sep 1 14:24:54 2016 New Revision: 305199 URL: https://svnweb.freebsd.org/changeset/base/305199 Log: MFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set Note that the bulk of the upstream change is not applicable to FreeBSD and the affected files are not even in the vendor area. illumos/illumos-gate@45b1747515a17db45e8971501ee84a26bdff37b2 https://github.com/illumos/illumos-gate/commit/45b1747515a17db45e8971501ee84a26bdff37b2 https://www.illumos.org/issues/7019 Currently zfsdev_ioctl, when confronted by a request with the FKIOCTL flag set, skips all processing of secpolicy functions. This means that ZFS is not doing any kind of verification of the credentials or access rights of the caller and assuming that (as it is an in-kernel client) all such checks have already been done. This turns out to be quite a dangerous assumption, especially with respect to sdev. In general I don't think it's particularly reasonable to offload this enforcement of access rights onto other kernel subsystems when ZFS has some particular local semantics in this area (delegated datasets etc) and does not provide any kind of API to allow other subsystems to avoid code duplication when doing it. ZFS should apply its normal access policy to requests from within the kernel, and callers should take care to give it the correct credentials and call it from the correct context in order to get the results they need. You can observe the currently unfortunate consequences of this bug in any non- global zone that has access to /dev/zvol or any subset of it via sdev profiles. In particular, a zone used to contain a KVM or similar which has a single zvol passed through to it using a Reviewed by: Richard Lowe Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: Alex Wilson 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 Thu Sep 1 14:17:30 2016 (r305198) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Sep 1 14:24:54 2016 (r305199) @@ -26,7 +26,7 @@ * 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) 2014, 2016 Joyent, Inc. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -6367,7 +6367,7 @@ zfsdev_ioctl(struct cdev *dev, u_long zc break; } - if (error == 0 && !(flag & FKIOCTL)) + if (error == 0) error = vec->zvec_secpolicy(zc, innvl, cr); if (error != 0) From owner-svn-src-head@freebsd.org Thu Sep 1 14:38: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 2E8C5BCB1B9; Thu, 1 Sep 2016 14:38:27 +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 F1ABBFA0; Thu, 1 Sep 2016 14:38:26 +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 u81EcQrO009695; Thu, 1 Sep 2016 14:38:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81EcPZQ009689; Thu, 1 Sep 2016 14:38:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011438.u81EcPZQ009689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305200 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:38:27 -0000 Author: mav Date: Thu Sep 1 14:38:25 2016 New Revision: 305200 URL: https://svnweb.freebsd.org/changeset/base/305200 Log: MFV r302651: 7054 dmu_tx_hold_t should use refcount_t to track space illumos/illumos-gate@0c779ad424a92a84d1e07d47cab7f8009189202b https://github.com/illumos/illumos-gate/commit/0c779ad424a92a84d1e07d47cab7f8009 189202b https://www.illumos.org/issues/7054 upstream: ee0003de7d3e598499be7ac3fe6b61efcc47cb7f DLPX-40399 dmu_tx_hold_t should use refcount_t to track space Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Igor Kozhukhov Approved by: Dan McDonald Author: Matthew Ahrens Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Sep 1 14:24:54 2016 (r305199) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Sep 1 14:38:25 2016 (r305200) @@ -129,6 +129,12 @@ dmu_tx_hold_object_impl(dmu_tx_t *tx, ob txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_SLEEP); txh->txh_tx = tx; txh->txh_dnode = dn; + refcount_create(&txh->txh_space_towrite); + refcount_create(&txh->txh_space_tofree); + refcount_create(&txh->txh_space_tooverwrite); + refcount_create(&txh->txh_space_tounref); + refcount_create(&txh->txh_memory_tohold); + refcount_create(&txh->txh_fudge); #ifdef ZFS_DEBUG txh->txh_type = type; txh->txh_arg1 = arg1; @@ -201,12 +207,18 @@ dmu_tx_count_twig(dmu_tx_hold_t *txh, dn freeable = (bp && (freeable || dsl_dataset_block_freeable(ds, bp, bp->blk_birth))); - if (freeable) - txh->txh_space_tooverwrite += space; - else - txh->txh_space_towrite += space; - if (bp) - txh->txh_space_tounref += bp_get_dsize(os->os_spa, bp); + if (freeable) { + (void) refcount_add_many(&txh->txh_space_tooverwrite, + space, FTAG); + } else { + (void) refcount_add_many(&txh->txh_space_towrite, + space, FTAG); + } + + if (bp) { + (void) refcount_add_many(&txh->txh_space_tounref, + bp_get_dsize(os->os_spa, bp), FTAG); + } dmu_tx_count_twig(txh, dn, parent, level + 1, blkid >> epbs, freeable, history); @@ -336,8 +348,11 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u bits = 64 - min_bs; epbs = min_ibs - SPA_BLKPTRSHIFT; for (bits -= epbs * (nlvls - 1); - bits >= 0; bits -= epbs) - txh->txh_fudge += 1ULL << max_ibs; + bits >= 0; bits -= epbs) { + (void) refcount_add_many( + &txh->txh_fudge, + 1ULL << max_ibs, FTAG); + } goto out; } off += delta; @@ -353,7 +368,8 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u */ start = P2ALIGN(off, 1ULL << max_bs); end = P2ROUNDUP(off + len, 1ULL << max_bs) - 1; - txh->txh_space_towrite += end - start + 1; + (void) refcount_add_many(&txh->txh_space_towrite, + end - start + 1, FTAG); start >>= min_bs; end >>= min_bs; @@ -368,18 +384,21 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u start >>= epbs; end >>= epbs; ASSERT3U(end, >=, start); - txh->txh_space_towrite += (end - start + 1) << max_ibs; + (void) refcount_add_many(&txh->txh_space_towrite, + (end - start + 1) << max_ibs, FTAG); if (start != 0) { /* * We also need a new blkid=0 indirect block * to reference any existing file data. */ - txh->txh_space_towrite += 1ULL << max_ibs; + (void) refcount_add_many(&txh->txh_space_towrite, + 1ULL << max_ibs, FTAG); } } out: - if (txh->txh_space_towrite + txh->txh_space_tooverwrite > + if (refcount_count(&txh->txh_space_towrite) + + refcount_count(&txh->txh_space_tooverwrite) > 2 * DMU_MAX_ACCESS) err = SET_ERROR(EFBIG); @@ -398,12 +417,15 @@ dmu_tx_count_dnode(dmu_tx_hold_t *txh) if (dn && dn->dn_dbuf->db_blkptr && dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, dn->dn_dbuf->db_blkptr, dn->dn_dbuf->db_blkptr->blk_birth)) { - txh->txh_space_tooverwrite += space; - txh->txh_space_tounref += space; + (void) refcount_add_many(&txh->txh_space_tooverwrite, + space, FTAG); + (void) refcount_add_many(&txh->txh_space_tounref, space, FTAG); } else { - txh->txh_space_towrite += space; - if (dn && dn->dn_dbuf->db_blkptr) - txh->txh_space_tounref += space; + (void) refcount_add_many(&txh->txh_space_towrite, space, FTAG); + if (dn && dn->dn_dbuf->db_blkptr) { + (void) refcount_add_many(&txh->txh_space_tounref, + space, FTAG); + } } } @@ -525,7 +547,8 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui break; } - txh->txh_memory_tohold += dbuf->db.db_size; + (void) refcount_add_many(&txh->txh_memory_tohold, + dbuf->db.db_size, FTAG); /* * We don't check memory_tohold against DMU_MAX_ACCESS because @@ -578,20 +601,23 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui (dn->dn_indblkshift - SPA_BLKPTRSHIFT); while (level++ < maxlevel) { - txh->txh_memory_tohold += MAX(MIN(blkcnt, nl1blks), 1) - << dn->dn_indblkshift; + (void) refcount_add_many(&txh->txh_memory_tohold, + MAX(MIN(blkcnt, nl1blks), 1) << dn->dn_indblkshift, + FTAG); blkcnt = 1 + (blkcnt >> epbs); } } /* account for new level 1 indirect blocks that might show up */ if (skipped > 0) { - txh->txh_fudge += skipped << dn->dn_indblkshift; + (void) refcount_add_many(&txh->txh_fudge, + skipped << dn->dn_indblkshift, FTAG); skipped = MIN(skipped, DMU_MAX_DELETEBLKCNT >> epbs); - txh->txh_memory_tohold += skipped << dn->dn_indblkshift; + (void) refcount_add_many(&txh->txh_memory_tohold, + skipped << dn->dn_indblkshift, FTAG); } - txh->txh_space_tofree += space; - txh->txh_space_tounref += unref; + (void) refcount_add_many(&txh->txh_space_tofree, space, FTAG); + (void) refcount_add_many(&txh->txh_space_tounref, unref, FTAG); } /* @@ -617,7 +643,10 @@ dmu_tx_mark_netfree(dmu_tx_t *tx) * cause overflows when doing math with these values (e.g. in * dmu_tx_try_assign()). */ - txh->txh_space_tofree = txh->txh_space_tounref = 1024 * 1024 * 1024; + (void) refcount_add_many(&txh->txh_space_tofree, + 1024 * 1024 * 1024, FTAG); + (void) refcount_add_many(&txh->txh_space_tounref, + 1024 * 1024 * 1024, FTAG); } void @@ -717,9 +746,7 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o { dmu_tx_hold_t *txh; dnode_t *dn; - dsl_dataset_phys_t *ds_phys; - uint64_t nblocks; - int epbs, err; + int err; ASSERT(tx->tx_txg == 0); @@ -762,12 +789,17 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o */ bp = &dn->dn_phys->dn_blkptr[0]; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, - bp, bp->blk_birth)) - txh->txh_space_tooverwrite += MZAP_MAX_BLKSZ; - else - txh->txh_space_towrite += MZAP_MAX_BLKSZ; - if (!BP_IS_HOLE(bp)) - txh->txh_space_tounref += MZAP_MAX_BLKSZ; + bp, bp->blk_birth)) { + (void) refcount_add_many(&txh->txh_space_tooverwrite, + MZAP_MAX_BLKSZ, FTAG); + } else { + (void) refcount_add_many(&txh->txh_space_towrite, + MZAP_MAX_BLKSZ, FTAG); + } + if (!BP_IS_HOLE(bp)) { + (void) refcount_add_many(&txh->txh_space_tounref, + MZAP_MAX_BLKSZ, FTAG); + } return; } @@ -789,15 +821,29 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o /* * If the modified blocks are scattered to the four winds, - * we'll have to modify an indirect twig for each. + * we'll have to modify an indirect twig for each. We can make + * modifications at up to 3 locations: + * - header block at the beginning of the object + * - target leaf block + * - end of the object, where we might need to write: + * - a new leaf block if the target block needs to be split + * - the new pointer table, if it is growing + * - the new cookie table, if it is growing */ - epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - ds_phys = dsl_dataset_phys(dn->dn_objset->os_dsl_dataset); - for (nblocks = dn->dn_maxblkid >> epbs; nblocks != 0; nblocks >>= epbs) - if (ds_phys->ds_prev_snap_obj) - txh->txh_space_towrite += 3 << dn->dn_indblkshift; - else - txh->txh_space_tooverwrite += 3 << dn->dn_indblkshift; + int epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; + dsl_dataset_phys_t *ds_phys = + dsl_dataset_phys(dn->dn_objset->os_dsl_dataset); + for (int lvl = 1; lvl < dn->dn_nlevels; lvl++) { + uint64_t num_indirects = 1 + (dn->dn_maxblkid >> (epbs * lvl)); + uint64_t spc = MIN(3, num_indirects) << dn->dn_indblkshift; + if (ds_phys->ds_prev_snap_obj != 0) { + (void) refcount_add_many(&txh->txh_space_towrite, + spc, FTAG); + } else { + (void) refcount_add_many(&txh->txh_space_tooverwrite, + spc, FTAG); + } + } } void @@ -822,7 +868,7 @@ dmu_tx_hold_space(dmu_tx_t *tx, uint64_t txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, DMU_NEW_OBJECT, THT_SPACE, space, 0); - txh->txh_space_towrite += space; + (void) refcount_add_many(&txh->txh_space_towrite, space, FTAG); } int @@ -1175,12 +1221,12 @@ dmu_tx_try_assign(dmu_tx_t *tx, txg_how_ (void) refcount_add(&dn->dn_tx_holds, tx); mutex_exit(&dn->dn_mtx); } - towrite += txh->txh_space_towrite; - tofree += txh->txh_space_tofree; - tooverwrite += txh->txh_space_tooverwrite; - tounref += txh->txh_space_tounref; - tohold += txh->txh_memory_tohold; - fudge += txh->txh_fudge; + towrite += refcount_count(&txh->txh_space_towrite); + tofree += refcount_count(&txh->txh_space_tofree); + tooverwrite += refcount_count(&txh->txh_space_tooverwrite); + tounref += refcount_count(&txh->txh_space_tounref); + tohold += refcount_count(&txh->txh_memory_tohold); + fudge += refcount_count(&txh->txh_fudge); } /* @@ -1383,24 +1429,59 @@ dmu_tx_willuse_space(dmu_tx_t *tx, int64 #endif } -void -dmu_tx_commit(dmu_tx_t *tx) +static void +dmu_tx_destroy(dmu_tx_t *tx) { dmu_tx_hold_t *txh; + while ((txh = list_head(&tx->tx_holds)) != NULL) { + dnode_t *dn = txh->txh_dnode; + + list_remove(&tx->tx_holds, txh); + refcount_destroy_many(&txh->txh_space_towrite, + refcount_count(&txh->txh_space_towrite)); + refcount_destroy_many(&txh->txh_space_tofree, + refcount_count(&txh->txh_space_tofree)); + refcount_destroy_many(&txh->txh_space_tooverwrite, + refcount_count(&txh->txh_space_tooverwrite)); + refcount_destroy_many(&txh->txh_space_tounref, + refcount_count(&txh->txh_space_tounref)); + refcount_destroy_many(&txh->txh_memory_tohold, + refcount_count(&txh->txh_memory_tohold)); + refcount_destroy_many(&txh->txh_fudge, + refcount_count(&txh->txh_fudge)); + kmem_free(txh, sizeof (dmu_tx_hold_t)); + if (dn != NULL) + dnode_rele(dn, tx); + } + + list_destroy(&tx->tx_callbacks); + list_destroy(&tx->tx_holds); +#ifdef ZFS_DEBUG + refcount_destroy_many(&tx->tx_space_written, + refcount_count(&tx->tx_space_written)); + refcount_destroy_many(&tx->tx_space_freed, + refcount_count(&tx->tx_space_freed)); +#endif + kmem_free(tx, sizeof (dmu_tx_t)); +} + +void +dmu_tx_commit(dmu_tx_t *tx) +{ ASSERT(tx->tx_txg != 0); /* * Go through the transaction's hold list and remove holds on * associated dnodes, notifying waiters if no holds remain. */ - while (txh = list_head(&tx->tx_holds)) { + for (dmu_tx_hold_t *txh = list_head(&tx->tx_holds); txh != NULL; + txh = list_next(&tx->tx_holds, txh)) { dnode_t *dn = txh->txh_dnode; - list_remove(&tx->tx_holds, txh); - kmem_free(txh, sizeof (dmu_tx_hold_t)); if (dn == NULL) continue; + mutex_enter(&dn->dn_mtx); ASSERT3U(dn->dn_assigned_txg, ==, tx->tx_txg); @@ -1409,7 +1490,6 @@ dmu_tx_commit(dmu_tx_t *tx) cv_broadcast(&dn->dn_notxholds); } mutex_exit(&dn->dn_mtx); - dnode_rele(dn, tx); } if (tx->tx_tempreserve_cookie) @@ -1421,51 +1501,26 @@ dmu_tx_commit(dmu_tx_t *tx) if (tx->tx_anyobj == FALSE) txg_rele_to_sync(&tx->tx_txgh); - list_destroy(&tx->tx_callbacks); - list_destroy(&tx->tx_holds); #ifdef ZFS_DEBUG dprintf("towrite=%llu written=%llu tofree=%llu freed=%llu\n", tx->tx_space_towrite, refcount_count(&tx->tx_space_written), tx->tx_space_tofree, refcount_count(&tx->tx_space_freed)); - refcount_destroy_many(&tx->tx_space_written, - refcount_count(&tx->tx_space_written)); - refcount_destroy_many(&tx->tx_space_freed, - refcount_count(&tx->tx_space_freed)); #endif - kmem_free(tx, sizeof (dmu_tx_t)); + dmu_tx_destroy(tx); } void dmu_tx_abort(dmu_tx_t *tx) { - dmu_tx_hold_t *txh; - ASSERT(tx->tx_txg == 0); - while (txh = list_head(&tx->tx_holds)) { - dnode_t *dn = txh->txh_dnode; - - list_remove(&tx->tx_holds, txh); - kmem_free(txh, sizeof (dmu_tx_hold_t)); - if (dn != NULL) - dnode_rele(dn, tx); - } - /* * Call any registered callbacks with an error code. */ if (!list_is_empty(&tx->tx_callbacks)) dmu_tx_do_callbacks(&tx->tx_callbacks, ECANCELED); - list_destroy(&tx->tx_callbacks); - list_destroy(&tx->tx_holds); -#ifdef ZFS_DEBUG - refcount_destroy_many(&tx->tx_space_written, - refcount_count(&tx->tx_space_written)); - refcount_destroy_many(&tx->tx_space_freed, - refcount_count(&tx->tx_space_freed)); -#endif - kmem_free(tx, sizeof (dmu_tx_t)); + dmu_tx_destroy(tx); } uint64_t @@ -1504,7 +1559,7 @@ dmu_tx_do_callbacks(list_t *cb_list, int { dmu_tx_callback_t *dcb; - while (dcb = list_head(cb_list)) { + while ((dcb = list_head(cb_list)) != NULL) { list_remove(cb_list, dcb); dcb->dcb_func(dcb->dcb_data, error); kmem_free(dcb, sizeof (dmu_tx_callback_t)); @@ -1562,18 +1617,24 @@ dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t /* If blkptr doesn't exist then add space to towrite */ if (!(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) { - txh->txh_space_towrite += SPA_OLD_MAXBLOCKSIZE; + (void) refcount_add_many(&txh->txh_space_towrite, + SPA_OLD_MAXBLOCKSIZE, FTAG); } else { blkptr_t *bp; bp = &dn->dn_phys->dn_spill; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, - bp, bp->blk_birth)) - txh->txh_space_tooverwrite += SPA_OLD_MAXBLOCKSIZE; - else - txh->txh_space_towrite += SPA_OLD_MAXBLOCKSIZE; - if (!BP_IS_HOLE(bp)) - txh->txh_space_tounref += SPA_OLD_MAXBLOCKSIZE; + bp, bp->blk_birth)) { + (void) refcount_add_many(&txh->txh_space_tooverwrite, + SPA_OLD_MAXBLOCKSIZE, FTAG); + } else { + (void) refcount_add_many(&txh->txh_space_towrite, + SPA_OLD_MAXBLOCKSIZE, FTAG); + } + if (!BP_IS_HOLE(bp)) { + (void) refcount_add_many(&txh->txh_space_tounref, + SPA_OLD_MAXBLOCKSIZE, FTAG); + } } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h Thu Sep 1 14:24:54 2016 (r305199) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h Thu Sep 1 14:38:25 2016 (r305200) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_DMU_TX_H @@ -101,12 +101,12 @@ typedef struct dmu_tx_hold { dmu_tx_t *txh_tx; list_node_t txh_node; struct dnode *txh_dnode; - uint64_t txh_space_towrite; - uint64_t txh_space_tofree; - uint64_t txh_space_tooverwrite; - uint64_t txh_space_tounref; - uint64_t txh_memory_tohold; - uint64_t txh_fudge; + refcount_t txh_space_towrite; + refcount_t txh_space_tofree; + refcount_t txh_space_tooverwrite; + refcount_t txh_space_tounref; + refcount_t txh_memory_tohold; + refcount_t txh_fudge; #ifdef ZFS_DEBUG enum dmu_tx_hold_type txh_type; uint64_t txh_arg1; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Thu Sep 1 14:24:54 2016 (r305199) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Thu Sep 1 14:38:25 2016 (r305200) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_ZAP_H @@ -80,6 +80,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { @@ -217,7 +218,7 @@ int zap_prefetch_uint64(objset_t *os, ui int key_numints); int zap_count_write(objset_t *os, uint64_t zapobj, const char *name, - int add, uint64_t *towrite, uint64_t *tooverwrite); + int add, refcount_t *towrite, refcount_t *tooverwrite); /* * Create an attribute with the given name and value. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h Thu Sep 1 14:24:54 2016 (r305199) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h Thu Sep 1 14:38:25 2016 (r305200) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -213,8 +214,8 @@ int fzap_lookup(zap_name_t *zn, uint64_t integer_size, uint64_t num_integers, void *buf, char *realname, int rn_len, boolean_t *normalization_conflictp); void fzap_prefetch(zap_name_t *zn); -int fzap_count_write(zap_name_t *zn, int add, uint64_t *towrite, - uint64_t *tooverwrite); +int fzap_count_write(zap_name_t *zn, int add, refcount_t *towrite, + refcount_t *tooverwrite); int fzap_add(zap_name_t *zn, uint64_t integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx); int fzap_update(zap_name_t *zn, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Thu Sep 1 14:24:54 2016 (r305199) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Thu Sep 1 14:38:25 2016 (r305200) @@ -1342,8 +1342,8 @@ fzap_get_stats(zap_t *zap, zap_stats_t * } int -fzap_count_write(zap_name_t *zn, int add, uint64_t *towrite, - uint64_t *tooverwrite) +fzap_count_write(zap_name_t *zn, int add, refcount_t *towrite, + refcount_t *tooverwrite) { zap_t *zap = zn->zn_zap; zap_leaf_t *l; @@ -1353,9 +1353,11 @@ fzap_count_write(zap_name_t *zn, int add * Account for the header block of the fatzap. */ if (!add && dmu_buf_freeable(zap->zap_dbuf)) { - *tooverwrite += zap->zap_dbuf->db_size; + (void) refcount_add_many(tooverwrite, + zap->zap_dbuf->db_size, FTAG); } else { - *towrite += zap->zap_dbuf->db_size; + (void) refcount_add_many(towrite, + zap->zap_dbuf->db_size, FTAG); } /* @@ -1367,10 +1369,13 @@ fzap_count_write(zap_name_t *zn, int add * could extend the table. */ if (add) { - if (zap_f_phys(zap)->zap_ptrtbl.zt_blk == 0) - *towrite += zap->zap_dbuf->db_size; - else - *towrite += (zap->zap_dbuf->db_size * 3); + if (zap_f_phys(zap)->zap_ptrtbl.zt_blk == 0) { + (void) refcount_add_many(towrite, + zap->zap_dbuf->db_size, FTAG); + } else { + (void) refcount_add_many(towrite, + zap->zap_dbuf->db_size * 3, FTAG); + } } /* @@ -1383,13 +1388,14 @@ fzap_count_write(zap_name_t *zn, int add } if (!add && dmu_buf_freeable(l->l_dbuf)) { - *tooverwrite += l->l_dbuf->db_size; + (void) refcount_add_many(tooverwrite, l->l_dbuf->db_size, FTAG); } else { /* * If this an add operation, the leaf block could split. * Hence, we need to account for an additional leaf block. */ - *towrite += (add ? 2 : 1) * l->l_dbuf->db_size; + (void) refcount_add_many(towrite, + (add ? 2 : 1) * l->l_dbuf->db_size, FTAG); } zap_put_leaf(l); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Thu Sep 1 14:24:54 2016 (r305199) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Thu Sep 1 14:38:25 2016 (r305200) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -1414,7 +1414,7 @@ zap_get_stats(objset_t *os, uint64_t zap int zap_count_write(objset_t *os, uint64_t zapobj, const char *name, int add, - uint64_t *towrite, uint64_t *tooverwrite) + refcount_t *towrite, refcount_t *tooverwrite) { zap_t *zap; int err = 0; @@ -1424,14 +1424,15 @@ zap_count_write(objset_t *os, uint64_t z * be affected in this operation. So, account for the worst case : * - 3 blocks overwritten: target leaf, ptrtbl block, header block * - 4 new blocks written if adding: - * - 2 blocks for possibly split leaves, - * - 2 grown ptrtbl blocks + * - 2 blocks for possibly split leaves, + * - 2 grown ptrtbl blocks * * This also accomodates the case where an add operation to a fairly * large microzap results in a promotion to fatzap. */ if (name == NULL) { - *towrite += (3 + (add ? 4 : 0)) * SPA_OLD_MAXBLOCKSIZE; + (void) refcount_add_many(towrite, + (3 + (add ? 4 : 0)) * SPA_OLD_MAXBLOCKSIZE, FTAG); return (err); } @@ -1455,7 +1456,8 @@ zap_count_write(objset_t *os, uint64_t z /* * We treat this case as similar to (name == NULL) */ - *towrite += (3 + (add ? 4 : 0)) * SPA_OLD_MAXBLOCKSIZE; + (void) refcount_add_many(towrite, + (3 + (add ? 4 : 0)) * SPA_OLD_MAXBLOCKSIZE, FTAG); } } else { /* @@ -1473,13 +1475,17 @@ zap_count_write(objset_t *os, uint64_t z * 4 new blocks written : 2 new split leaf, 2 grown * ptrtbl blocks */ - if (dmu_buf_freeable(zap->zap_dbuf)) - *tooverwrite += MZAP_MAX_BLKSZ; - else - *towrite += MZAP_MAX_BLKSZ; + if (dmu_buf_freeable(zap->zap_dbuf)) { + (void) refcount_add_many(tooverwrite, + MZAP_MAX_BLKSZ, FTAG); + } else { + (void) refcount_add_many(towrite, + MZAP_MAX_BLKSZ, FTAG); + } if (add) { - *towrite += 4 * MZAP_MAX_BLKSZ; + (void) refcount_add_many(towrite, + 4 * MZAP_MAX_BLKSZ, FTAG); } } From owner-svn-src-head@freebsd.org Thu Sep 1 14:45: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 27DFBBCB724; Thu, 1 Sep 2016 14:45:12 +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 05B178E6; Thu, 1 Sep 2016 14:45: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 u81EjB8u013300; Thu, 1 Sep 2016 14:45:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81EjB3P013299; Thu, 1 Sep 2016 14:45:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011445.u81EjB3P013299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305201 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:45:12 -0000 Author: mav Date: Thu Sep 1 14:45:11 2016 New Revision: 305201 URL: https://svnweb.freebsd.org/changeset/base/305201 Log: MFV r302653: 6111 zfs send should ignore datasets created after the ending snapshot illumos/illumos-gate@4a20c933b148de8a1c1d3538391c64284e636653 https://github.com/illumos/illumos-gate/commit/4a20c933b148de8a1c1d3538391c64284 e636653 https://www.illumos.org/issues/6111 If you create a zfs child folder, zfs send returns an error when a recursive incremental send is done between two snapshots made prior to the folder creation. The problem can be reproduced with the following steps. root@zfs:/# zfs create pool/test root@zfs:/# zfs snapshot pool/test@snap1 root@zfs:/# zfs snapshot pool/test@snap2 root@zfs:/# zfs create pool/test/child root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap2 > /dev/null WARNING: could not send pool/test/child@snap2: does not exist WARNING: could not send pool/test/child@snap2: does not exist root@zfs:/# echo $? 1 root@zfs:/# zfs snapshot -r pool/test@snap3 root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap3 > /dev/null root@zfs:/# echo $? 0 root@zfs:/# zfs send -R -I pool/test@snap2 pool/test@snap3 > /dev/null root@zfs:/# echo $? 0 Since pool/test/child was created after snap2, zfs send should not expect snap2 to be in pool/test/child when doing a recursive send. It should examine the compare the creation time of the snapshot and each child folder to decide if the folder will be sent. The next incremental send between snap2 and snap3 would properly create the child folder and snap3 which first appears in the child folder. The problem is identical if '-i' is used instead of '-I'. Reviewed by: Alex Aizman alex.aizman@nexenta.com Reviewed by: Alek Pinchuk alek.pinchuk@nexenta.com Reviewed by: Roman Strashkin roman.strashkin@nexenta.com Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Approved by: Garrett D'Amore Author: Alex Deiter Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.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_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 14:38:25 2016 (r305200) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 14:45:11 2016 (r305201) @@ -579,13 +579,30 @@ fsavl_create(nvlist_t *fss) * Routines for dealing with the giant nvlist of fs-nvlists, etc. */ typedef struct send_data { + /* + * assigned inside every recursive call, + * restored from *_save on return: + * + * guid of fromsnap snapshot in parent dataset + * txg of fromsnap snapshot in current dataset + * txg of tosnap snapshot in current dataset + */ + uint64_t parent_fromsnap_guid; + uint64_t fromsnap_txg; + uint64_t tosnap_txg; + + /* the nvlists get accumulated during depth-first traversal */ nvlist_t *parent_snaps; nvlist_t *fss; nvlist_t *snapprops; + + /* send-receive configuration, does not change during traversal */ + const char *fsname; const char *fromsnap; const char *tosnap; boolean_t recursive; + boolean_t verbose; /* * The header nvlist is of the following format: @@ -618,11 +635,23 @@ send_iterate_snap(zfs_handle_t *zhp, voi { send_data_t *sd = arg; uint64_t guid = zhp->zfs_dmustats.dds_guid; + uint64_t txg = zhp->zfs_dmustats.dds_creation_txg; char *snapname; nvlist_t *nv; snapname = strrchr(zhp->zfs_name, '@')+1; + if (sd->tosnap_txg != 0 && txg > sd->tosnap_txg) { + if (sd->verbose) { + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "skipping snapshot %s because it was created " + "after the destination snapshot (%s)\n"), + zhp->zfs_name, sd->tosnap); + } + zfs_close(zhp); + return (0); + } + VERIFY(0 == nvlist_add_uint64(sd->parent_snaps, snapname, guid)); /* * NB: if there is no fromsnap here (it's a newly created fs in @@ -716,6 +745,31 @@ send_iterate_prop(zfs_handle_t *zhp, nvl } /* + * returns snapshot creation txg + * and returns 0 if the snapshot does not exist + */ +static uint64_t +get_snap_txg(libzfs_handle_t *hdl, const char *fs, const char *snap) +{ + char name[ZFS_MAXNAMELEN]; + uint64_t txg = 0; + + if (fs == NULL || fs[0] == '\0' || snap == NULL || snap[0] == '\0') + return (txg); + + (void) snprintf(name, sizeof (name), "%s@%s", fs, snap); + if (zfs_dataset_exists(hdl, name, ZFS_TYPE_SNAPSHOT)) { + zfs_handle_t *zhp = zfs_open(hdl, name, ZFS_TYPE_SNAPSHOT); + if (zhp != NULL) { + txg = zfs_prop_get_int(zhp, ZFS_PROP_CREATETXG); + zfs_close(zhp); + } + } + + return (txg); +} + +/* * recursively generate nvlists describing datasets. See comment * for the data structure send_data_t above for description of contents * of the nvlist. @@ -727,9 +781,48 @@ send_iterate_fs(zfs_handle_t *zhp, void nvlist_t *nvfs, *nv; int rv = 0; uint64_t parent_fromsnap_guid_save = sd->parent_fromsnap_guid; + uint64_t fromsnap_txg_save = sd->fromsnap_txg; + uint64_t tosnap_txg_save = sd->tosnap_txg; + uint64_t txg = zhp->zfs_dmustats.dds_creation_txg; uint64_t guid = zhp->zfs_dmustats.dds_guid; + uint64_t fromsnap_txg, tosnap_txg; char guidstring[64]; + fromsnap_txg = get_snap_txg(zhp->zfs_hdl, zhp->zfs_name, sd->fromsnap); + if (fromsnap_txg != 0) + sd->fromsnap_txg = fromsnap_txg; + + tosnap_txg = get_snap_txg(zhp->zfs_hdl, zhp->zfs_name, sd->tosnap); + if (tosnap_txg != 0) + sd->tosnap_txg = tosnap_txg; + + /* + * on the send side, if the current dataset does not have tosnap, + * perform two additional checks: + * + * - skip sending the current dataset if it was created later than + * the parent tosnap + * - return error if the current dataset was created earlier than + * the parent tosnap + */ + if (sd->tosnap != NULL && tosnap_txg == 0) { + if (sd->tosnap_txg != 0 && txg > sd->tosnap_txg) { + if (sd->verbose) { + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "skipping dataset %s: snapshot %s does " + "not exist\n"), zhp->zfs_name, sd->tosnap); + } + } else { + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "cannot send %s@%s%s: snapshot %s@%s does not " + "exist\n"), sd->fsname, sd->tosnap, sd->recursive ? + dgettext(TEXT_DOMAIN, " recursively") : "", + zhp->zfs_name, sd->tosnap); + rv = -1; + } + goto out; + } + VERIFY(0 == nvlist_alloc(&nvfs, NV_UNIQUE_NAME, 0)); VERIFY(0 == nvlist_add_string(nvfs, "name", zhp->zfs_name)); VERIFY(0 == nvlist_add_uint64(nvfs, "parentfromsnap", @@ -738,8 +831,10 @@ send_iterate_fs(zfs_handle_t *zhp, void if (zhp->zfs_dmustats.dds_origin[0]) { zfs_handle_t *origin = zfs_open(zhp->zfs_hdl, zhp->zfs_dmustats.dds_origin, ZFS_TYPE_SNAPSHOT); - if (origin == NULL) - return (-1); + if (origin == NULL) { + rv = -1; + goto out; + } VERIFY(0 == nvlist_add_uint64(nvfs, "origin", origin->zfs_dmustats.dds_guid)); } @@ -770,7 +865,10 @@ send_iterate_fs(zfs_handle_t *zhp, void if (sd->recursive) rv = zfs_iter_filesystems(zhp, send_iterate_fs, sd); +out: sd->parent_fromsnap_guid = parent_fromsnap_guid_save; + sd->fromsnap_txg = fromsnap_txg_save; + sd->tosnap_txg = tosnap_txg_save; zfs_close(zhp); return (rv); @@ -778,7 +876,8 @@ send_iterate_fs(zfs_handle_t *zhp, void static int gather_nvlist(libzfs_handle_t *hdl, const char *fsname, const char *fromsnap, - const char *tosnap, boolean_t recursive, nvlist_t **nvlp, avl_tree_t **avlp) + const char *tosnap, boolean_t recursive, boolean_t verbose, + nvlist_t **nvlp, avl_tree_t **avlp) { zfs_handle_t *zhp; send_data_t sd = { 0 }; @@ -789,9 +888,11 @@ gather_nvlist(libzfs_handle_t *hdl, cons return (EZFS_BADTYPE); VERIFY(0 == nvlist_alloc(&sd.fss, NV_UNIQUE_NAME, 0)); + sd.fsname = fsname; sd.fromsnap = fromsnap; sd.tosnap = tosnap; sd.recursive = recursive; + sd.verbose = verbose; if ((error = send_iterate_fs(zhp, &sd)) != 0) { nvlist_free(sd.fss); @@ -1699,7 +1800,8 @@ zfs_send(zfs_handle_t *zhp, const char * } err = gather_nvlist(zhp->zfs_hdl, zhp->zfs_name, - fromsnap, tosnap, flags->replicate, &fss, &fsavl); + fromsnap, tosnap, flags->replicate, flags->verbose, + &fss, &fsavl); if (err) goto err_out; VERIFY(0 == nvlist_add_nvlist(hdrnv, "fss", fss)); @@ -2315,7 +2417,7 @@ again: VERIFY(0 == nvlist_alloc(&deleted, NV_UNIQUE_NAME, 0)); if ((error = gather_nvlist(hdl, tofs, fromsnap, NULL, - recursive, &local_nv, &local_avl)) != 0) + recursive, B_FALSE, &local_nv, &local_avl)) != 0) return (error); /* @@ -3379,7 +3481,7 @@ zfs_receive_one(libzfs_handle_t *hdl, in */ *cp = '\0'; if (gather_nvlist(hdl, zc.zc_value, NULL, NULL, B_FALSE, - &local_nv, &local_avl) == 0) { + B_FALSE, &local_nv, &local_avl) == 0) { *cp = '@'; fs = fsavl_find(local_avl, drrb->drr_toguid, NULL); fsavl_destroy(local_avl); From owner-svn-src-head@freebsd.org Thu Sep 1 14:46: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 32B01BCB7AE; Thu, 1 Sep 2016 14:46:35 +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 0010FAC0; Thu, 1 Sep 2016 14:46:34 +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 u81EkYBY013395; Thu, 1 Sep 2016 14:46:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81EkY5o013394; Thu, 1 Sep 2016 14:46:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011446.u81EkY5o013394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305202 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:46:35 -0000 Author: mav Date: Thu Sep 1 14:46:33 2016 New Revision: 305202 URL: https://svnweb.freebsd.org/changeset/base/305202 Log: MFV r302654: 6879 incorrect endianness swap for drr_spill.drr_length in libzfs_sendrecv.c illumos/illumos-gate@20fea7a47472aceb64d3ed48cc2a3ea268bc4795 https://github.com/illumos/illumos-gate/commit/20fea7a47472aceb64d3ed48cc2a3ea26 8bc4795 https://www.illumos.org/issues/6879 In libzfs_sendrecv, there's a typo: case DRR_SPILL: if (byteswap) { drr->drr_u.drr_write.drr_length = BSWAP_64(drr->drr_u.drr_spill.drr_length); } Instead of drr_write.drr_length, we should be assigning the result of the byteswap to drr_spill.drr_length. Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Approved by: Robert Mustacchi Author: Dan Kimmel Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.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_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 14:45:11 2016 (r305201) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 14:46:33 2016 (r305202) @@ -2967,7 +2967,7 @@ recv_skip(libzfs_handle_t *hdl, int fd, break; case DRR_SPILL: if (byteswap) { - drr->drr_u.drr_write.drr_length = + drr->drr_u.drr_spill.drr_length = BSWAP_64(drr->drr_u.drr_spill.drr_length); } (void) recv_read(hdl, fd, buf, From owner-svn-src-head@freebsd.org Thu Sep 1 14:47: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 6834CBCB849; Thu, 1 Sep 2016 14:47:44 +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 38983C67; Thu, 1 Sep 2016 14:47:44 +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 u81ElhDJ013487; Thu, 1 Sep 2016 14:47:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81ElhIs013486; Thu, 1 Sep 2016 14:47:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011447.u81ElhIs013486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305203 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:47:44 -0000 Author: mav Date: Thu Sep 1 14:47:43 2016 New Revision: 305203 URL: https://svnweb.freebsd.org/changeset/base/305203 Log: MFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist illumos/illumos-gate@4cde22c29999ffb907ca39d2ebd512812f7e5168 https://github.com/illumos/illumos-gate/commit/4cde22c29999ffb907ca39d2ebd512812 f7e5168 https://www.illumos.org/issues/6873 lzc_destroy_snaps() returns an nvlist in errlist. zfs_destroy_snaps_nvl() should nvlist_free() it before returning. Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Approved by: Dan McDonald Author: Chris Williamson Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.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_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:46:33 2016 (r305202) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:47:43 2016 (r305203) @@ -3466,12 +3466,14 @@ int zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer) { int ret; - nvlist_t *errlist; + nvlist_t *errlist = NULL; ret = lzc_destroy_snaps(snaps, defer, &errlist); - if (ret == 0) + if (ret == 0) { + nvlist_free(errlist); return (0); + } if (nvlist_empty(errlist)) { char errbuf[1024]; @@ -3499,6 +3501,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *h } } + nvlist_free(errlist); return (ret); } From owner-svn-src-head@freebsd.org Thu Sep 1 14:49: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 9121EBCB8F1; Thu, 1 Sep 2016 14:49:08 +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 46BF5E04; Thu, 1 Sep 2016 14:49:08 +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 u81En7Au013589; Thu, 1 Sep 2016 14:49:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81En7bu013588; Thu, 1 Sep 2016 14:49:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011449.u81En7bu013588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305204 - head/cddl/contrib/opensolaris 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:49:08 -0000 Author: mav Date: Thu Sep 1 14:49:07 2016 New Revision: 305204 URL: https://svnweb.freebsd.org/changeset/base/305204 Log: Record r302656 as merged. Modified: Directory Properties: head/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-head@freebsd.org Thu Sep 1 14:52: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 6ECDDBCBB44; Thu, 1 Sep 2016 14:52:07 +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 31E0B3D2; Thu, 1 Sep 2016 14:52:07 +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 u81Eq6Qf017252; Thu, 1 Sep 2016 14:52:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Eq6p0017248; Thu, 1 Sep 2016 14:52:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011452.u81Eq6p0017248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305205 - in head/cddl/contrib/opensolaris: cmd/zfs 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:52:07 -0000 Author: mav Date: Thu Sep 1 14:52:05 2016 New Revision: 305205 URL: https://svnweb.freebsd.org/changeset/base/305205 Log: MFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a" illumos/illumos-gate@8808ac5dae118369991f158b6ab736cb2691ecde https://github.com/illumos/illumos-gate/commit/8808ac5dae118369991f158b6ab736cb2 691ecde https://www.illumos.org/issues/4521 zfstest is trying to execute evil "zfs unmount -a", which fails (fortunately, as it would otherwise leave me with my ~ missing): 03:44:11.86 cannot unmount '/export/home/yuri': Device busy cannot unmount '/ export/home': Device busy 03:44:11.86 ERROR: /usr/sbin/zfs unmount -a exited 1 This affects, at least, zfs_mount_009_neg and zfs_mount_all_001_pos, both failing on that step. The pool containing the /export/home hierarchy is included in KEEP variable, but it doesn't seem to affect anything here. Reviewed by: Andriy Gapon Reviewed by: Dan McDonald Reviewed by: Matthew Ahrens Reviewed by: John Kennedy Approved by: Robert Mustacchi Author: Yuri Pankov Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 1 14:49:07 2016 (r305204) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 1 14:52:05 2016 (r305205) @@ -27,9 +27,9 @@ * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Igor Kozhukhov . + * Copyright 2016 Nexenta Systems, Inc. */ #include @@ -6483,6 +6483,15 @@ unshare_unmount(int op, int argc, char * continue; } + /* + * Ignore datasets that are excluded/restricted by + * parent pool name. + */ + if (zpool_skip_pool(zfs_get_pool_name(zhp))) { + zfs_close(zhp); + continue; + } + switch (op) { case OP_SHARE: verify(zfs_prop_get(zhp, ZFS_PROP_SHARENFS, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Sep 1 14:49:07 2016 (r305204) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Sep 1 14:52:05 2016 (r305205) @@ -26,8 +26,8 @@ * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Nexenta Systems, Inc. */ #ifndef _LIBZFS_H @@ -221,6 +221,7 @@ extern void zpool_free_handles(libzfs_ha */ typedef int (*zpool_iter_f)(zpool_handle_t *, void *); extern int zpool_iter(libzfs_handle_t *, zpool_iter_f, void *); +extern boolean_t zpool_skip_pool(const char *); /* * Functions to create and destroy pools @@ -411,6 +412,7 @@ extern void zfs_close(zfs_handle_t *); extern zfs_type_t zfs_get_type(const zfs_handle_t *); extern const char *zfs_get_name(const zfs_handle_t *); extern zpool_handle_t *zfs_get_pool_handle(const zfs_handle_t *); +extern const char *zfs_get_pool_name(const zfs_handle_t *); /* * Property management functions. Some functions are shared with the kernel, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Thu Sep 1 14:49:07 2016 (r305204) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Thu Sep 1 14:52:05 2016 (r305205) @@ -27,6 +27,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2015 by Syneto S.R.L. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. */ /* @@ -338,33 +339,47 @@ zpool_refresh_stats(zpool_handle_t *zhp, } /* - * If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over - * pools it lists. + * The following environment variables are undocumented + * and should be used for testing purposes only: * - * This is an undocumented feature for use during testing only. + * __ZFS_POOL_EXCLUDE - don't iterate over the pools it lists + * __ZFS_POOL_RESTRICT - iterate only over the pools it lists * * This function returns B_TRUE if the pool should be skipped * during iteration. */ -static boolean_t -check_restricted(const char *poolname) +boolean_t +zpool_skip_pool(const char *poolname) { static boolean_t initialized = B_FALSE; - static char *restricted = NULL; + static const char *exclude = NULL; + static const char *restricted = NULL; const char *cur, *end; - int len, namelen; + int len; + int namelen = strlen(poolname); if (!initialized) { initialized = B_TRUE; + exclude = getenv("__ZFS_POOL_EXCLUDE"); restricted = getenv("__ZFS_POOL_RESTRICT"); } + if (exclude != NULL) { + cur = exclude; + do { + end = strchr(cur, ' '); + len = (NULL == end) ? strlen(cur) : (end - cur); + if (len == namelen && 0 == strncmp(cur, poolname, len)) + return (B_TRUE); + cur += (len + 1); + } while (NULL != end); + } + if (NULL == restricted) return (B_FALSE); cur = restricted; - namelen = strlen(poolname); do { end = strchr(cur, ' '); len = (NULL == end) ? strlen(cur) : (end - cur); @@ -402,7 +417,7 @@ zpool_iter(libzfs_handle_t *hdl, zpool_i for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL; cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) { - if (check_restricted(cn->cn_name)) + if (zpool_skip_pool(cn->cn_name)) continue; if (zpool_open_silent(hdl, cn->cn_name, &zhp) != 0) { @@ -440,7 +455,7 @@ zfs_iter_root(libzfs_handle_t *hdl, zfs_ for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL; cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) { - if (check_restricted(cn->cn_name)) + if (zpool_skip_pool(cn->cn_name)) continue; if ((zhp = make_dataset_handle(hdl, cn->cn_name)) == NULL) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:49:07 2016 (r305204) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:52:05 2016 (r305205) @@ -27,8 +27,8 @@ * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2013 Martin Matuska. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Nexenta Systems, Inc. */ #include @@ -2962,6 +2962,15 @@ zfs_get_name(const zfs_handle_t *zhp) } /* + * Returns the name of the parent pool for the given zfs handle. + */ +const char * +zfs_get_pool_name(const zfs_handle_t *zhp) +{ + return (zhp->zpool_hdl->zpool_name); +} + +/* * Returns the type of the given zfs handle. */ zfs_type_t From owner-svn-src-head@freebsd.org Thu Sep 1 14:53: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 5B42FBCBC3F; Thu, 1 Sep 2016 14:53:58 +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 1F3448AE; Thu, 1 Sep 2016 14:53:58 +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 u81ErvDX017420; Thu, 1 Sep 2016 14:53:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Erudf017415; Thu, 1 Sep 2016 14:53:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011453.u81Erudf017415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305206 - in head/cddl/contrib/opensolaris: cmd/zpool 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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:53:58 -0000 Author: mav Date: Thu Sep 1 14:53:56 2016 New Revision: 305206 URL: https://svnweb.freebsd.org/changeset/base/305206 Log: MFV r302658: 6872 zfs libraries should not allow uninitialized variables illumos/illumos-gate@f83b46baf98d276f5f84fa84c8b461f412ac1f5e https://github.com/illumos/illumos-gate/commit/f83b46baf98d276f5f84fa84c8b461f41 2ac1f5e https://www.illumos.org/issues/6872 We compile the zfs libraries with -Wno-uninitialized. We should remove this. Change makefiles, fix new warnings, fix pbchk errors. Reviewed by: Dan Kimmel Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Yuri Pankov Approved by: Robert Mustacchi Author: Paul Dagnelie Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Thu Sep 1 14:52:05 2016 (r305205) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Thu Sep 1 14:53:56 2016 (r305206) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov . */ @@ -597,7 +597,6 @@ get_replication(nvlist_t *nvroot, boolea verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, &top, &toplevels) == 0); - lastrep.zprl_type = NULL; for (t = 0; t < toplevels; t++) { uint64_t is_log = B_FALSE; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:52:05 2016 (r305205) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:53:56 2016 (r305206) @@ -1584,7 +1584,7 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl libzfs_handle_t *hdl = zhp->zfs_hdl; nvlist_t *nvl; int nvl_len; - int added_resv; + int added_resv = 0; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot set property for '%s'"), @@ -3212,7 +3212,7 @@ zfs_create_ancestors(libzfs_handle_t *hd { int prefix; char *path_copy; - int rc; + int rc = 0; if (check_parents(hdl, path, NULL, B_TRUE, &prefix) != 0) return (-1); @@ -3854,7 +3854,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_hand rollback_data_t cb = { 0 }; int err; boolean_t restore_resv = 0; - uint64_t old_volsize, new_volsize; + uint64_t old_volsize = 0, new_volsize; zfs_prop_t resv_prop; assert(zhp->zfs_type == ZFS_TYPE_FILESYSTEM || @@ -4071,6 +4071,7 @@ zfs_rename(zfs_handle_t *zhp, const char "child dataset with inherited mountpoint is used " "in a non-global zone")); (void) zfs_error(hdl, EZFS_ZONED, errbuf); + ret = -1; goto error; } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Sep 1 14:52:05 2016 (r305205) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Sep 1 14:53:56 2016 (r305206) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright 2015 RackTop Systems. * Copyright 2016 Nexenta Systems, Inc. */ @@ -440,12 +440,12 @@ get_configs(libzfs_handle_t *hdl, pool_l pool_entry_t *pe; vdev_entry_t *ve; config_entry_t *ce; - nvlist_t *ret = NULL, *config = NULL, *tmp, *nvtop, *nvroot; + nvlist_t *ret = NULL, *config = NULL, *tmp = NULL, *nvtop, *nvroot; nvlist_t **spares, **l2cache; uint_t i, nspares, nl2cache; boolean_t config_seen; uint64_t best_txg; - char *name, *hostname; + char *name, *hostname = NULL; uint64_t guid; uint_t children = 0; nvlist_t **child = NULL; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Thu Sep 1 14:52:05 2016 (r305205) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Thu Sep 1 14:53:56 2016 (r305206) @@ -1010,7 +1010,7 @@ zprop_print_one_property(const char *nam const char *source, const char *recvd_value) { int i; - const char *str; + const char *str = NULL; char buf[128]; /* From owner-svn-src-head@freebsd.org Thu Sep 1 14:57: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 A440ABCBD08; Thu, 1 Sep 2016 14:57:08 +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 752B4A6E; Thu, 1 Sep 2016 14:57:08 +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 u81Ev7bu017690; Thu, 1 Sep 2016 14:57:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Ev6PO017682; Thu, 1 Sep 2016 14:57:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011457.u81Ev6PO017682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 14:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305207 - in head: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:57:08 -0000 Author: mav Date: Thu Sep 1 14:57:06 2016 New Revision: 305207 URL: https://svnweb.freebsd.org/changeset/base/305207 Log: MFV r302659: 6931 lib/libzfs: cleanup gcc warnings illumos/illumos-gate@88f61dee20b358671b1b643e9d1dbf220a1d69be https://github.com/illumos/illumos-gate/commit/88f61dee20b358671b1b643e9d1dbf220a1d69be https://www.illumos.org/issues/6931 need cleanup: CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-function Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Igor Kozhukhov Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.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_changelist.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c Thu Sep 1 14:53:56 2016 (r305206) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c Thu Sep 1 14:57:06 2016 (r305207) @@ -24,9 +24,9 @@ * Use is subject to license terms. * * Portions Copyright 2007 Ramprakash Jelari - * * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. + * Copyright 2016 Igor Kozhukhov */ #include @@ -136,6 +136,9 @@ changelist_prefix(prop_changelist_t *clp case ZFS_PROP_SHARESMB: (void) zfs_unshare_smb(cn->cn_handle, NULL); break; + + default: + break; } } } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:53:56 2016 (r305206) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:57:06 2016 (r305207) @@ -29,6 +29,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Nexenta Systems, Inc. + * Copyright 2016 Igor Kozhukhov */ #include @@ -78,55 +79,18 @@ zfs_type_to_name(zfs_type_t type) return (dgettext(TEXT_DOMAIN, "snapshot")); case ZFS_TYPE_VOLUME: return (dgettext(TEXT_DOMAIN, "volume")); + case ZFS_TYPE_POOL: + return (dgettext(TEXT_DOMAIN, "pool")); + case ZFS_TYPE_BOOKMARK: + return (dgettext(TEXT_DOMAIN, "bookmark")); + default: + assert(!"unhandled zfs_type_t"); } return (NULL); } /* - * Given a path and mask of ZFS types, return a string describing this dataset. - * This is used when we fail to open a dataset and we cannot get an exact type. - * We guess what the type would have been based on the path and the mask of - * acceptable types. - */ -static const char * -path_to_str(const char *path, int types) -{ - /* - * When given a single type, always report the exact type. - */ - if (types == ZFS_TYPE_SNAPSHOT) - return (dgettext(TEXT_DOMAIN, "snapshot")); - if (types == ZFS_TYPE_FILESYSTEM) - return (dgettext(TEXT_DOMAIN, "filesystem")); - if (types == ZFS_TYPE_VOLUME) - return (dgettext(TEXT_DOMAIN, "volume")); - - /* - * The user is requesting more than one type of dataset. If this is the - * case, consult the path itself. If we're looking for a snapshot, and - * a '@' is found, then report it as "snapshot". Otherwise, remove the - * snapshot attribute and try again. - */ - if (types & ZFS_TYPE_SNAPSHOT) { - if (strchr(path, '@') != NULL) - return (dgettext(TEXT_DOMAIN, "snapshot")); - return (path_to_str(path, types & ~ZFS_TYPE_SNAPSHOT)); - } - - /* - * The user has requested either filesystems or volumes. - * We have no way of knowing a priori what type this would be, so always - * report it as "filesystem" or "volume", our two primitive types. - */ - if (types & ZFS_TYPE_FILESYSTEM) - return (dgettext(TEXT_DOMAIN, "filesystem")); - - assert(types & ZFS_TYPE_VOLUME); - return (dgettext(TEXT_DOMAIN, "volume")); -} - -/* * Validate a ZFS path. This is used even before trying to open the dataset, to * provide a more meaningful error message. We call zfs_error_aux() to * explain exactly why the name was not valid. @@ -187,6 +151,11 @@ zfs_validate_name(libzfs_handle_t *hdl, zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "reserved disk name")); break; + + default: + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "(%d) not defined"), why); + break; } } @@ -769,7 +738,8 @@ libzfs_mnttab_fini(libzfs_handle_t *hdl) void *cookie = NULL; mnttab_node_t *mtn; - while (mtn = avl_destroy_nodes(&hdl->libzfs_mnttab_cache, &cookie)) { + while ((mtn = avl_destroy_nodes(&hdl->libzfs_mnttab_cache, &cookie)) + != NULL) { free(mtn->mtn_mt.mnt_special); free(mtn->mtn_mt.mnt_mountp); free(mtn->mtn_mt.mnt_fstype); @@ -841,7 +811,8 @@ libzfs_mnttab_remove(libzfs_handle_t *hd mnttab_node_t *ret; find.mtn_mt.mnt_special = (char *)fsname; - if (ret = avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, NULL)) { + if ((ret = avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, NULL)) + != NULL) { avl_remove(&hdl->libzfs_mnttab_cache, ret); free(ret->mtn_mt.mnt_special); free(ret->mtn_mt.mnt_mountp); @@ -1193,6 +1164,13 @@ badlabel: "component of '%s' is too long"), propname); break; + + default: + zfs_error_aux(hdl, + dgettext(TEXT_DOMAIN, + "(%d) not defined"), + why); + break; } (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; @@ -1311,12 +1289,17 @@ badlabel: } break; + case ZFS_PROP_UTF8ONLY: chosen_utf = (int)intval; break; + case ZFS_PROP_NORMALIZE: chosen_normal = (int)intval; break; + + default: + break; } /* @@ -1365,6 +1348,9 @@ badlabel: goto error; } break; + + default: + break; } } } @@ -1974,6 +1960,9 @@ get_numeric_property(zfs_handle_t *zhp, mntopt_on = MNTOPT_NBMAND; mntopt_off = MNTOPT_NONBMAND; break; + + default: + break; } /* @@ -3160,7 +3149,7 @@ create_parents(libzfs_handle_t *hdl, cha * up to the prefixlen-long one. */ for (cp = target + prefixlen + 1; - cp = strchr(cp, '/'); *cp = '/', cp++) { + (cp = strchr(cp, '/')) != NULL; *cp = '/', cp++) { *cp = '\0'; @@ -3926,7 +3915,7 @@ int zfs_rename(zfs_handle_t *zhp, const char *source, const char *target, renameflags_t flags) { - int ret; + int ret = 0; zfs_cmd_t zc = { 0 }; char *delim; prop_changelist_t *cl = NULL; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Thu Sep 1 14:53:56 2016 (r305206) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Thu Sep 1 14:57:06 2016 (r305207) @@ -23,6 +23,7 @@ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2016 Joyent, Inc. + * Copyright 2016 Igor Kozhukhov */ /* @@ -353,7 +354,7 @@ write_inuse_diffs(FILE *fp, differ_info_ int err; for (o = dr->ddr_first; o <= dr->ddr_last; o++) { - if (err = write_inuse_diffs_one(fp, di, o)) + if ((err = write_inuse_diffs_one(fp, di, o)) != 0) return (err); } return (0); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Thu Sep 1 14:53:56 2016 (r305206) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Thu Sep 1 14:57:06 2016 (r305207) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014 by Delphix. All rights reserved. + * Copyright 2016 Igor Kozhukhov */ /* @@ -475,7 +476,8 @@ zfs_is_shared_proto(zfs_handle_t *zhp, c if (!zfs_is_mounted(zhp, &mountpoint)) return (SHARED_NOT_SHARED); - if (rc = is_shared(zhp->zfs_hdl, mountpoint, proto)) { + if ((rc = is_shared(zhp->zfs_hdl, mountpoint, proto)) + != SHARED_NOT_SHARED) { if (where != NULL) *where = mountpoint; else Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Sep 1 14:53:56 2016 (r305206) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Sep 1 14:57:06 2016 (r305207) @@ -24,6 +24,7 @@ * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2016 Nexenta Systems, Inc. + * Copyright 2016 Igor Kozhukhov */ #include @@ -199,6 +200,9 @@ zpool_state_to_name(vdev_state_t state, return (gettext("DEGRADED")); case VDEV_STATE_HEALTHY: return (gettext("ONLINE")); + + default: + break; } return (gettext("UNKNOWN")); @@ -635,6 +639,11 @@ zpool_valid_proplist(libzfs_handle_t *hd goto error; } break; + + default: + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "property '%s'(%d) not defined"), propname, prop); + break; } } @@ -943,6 +952,10 @@ zpool_name_valid(libzfs_handle_t *hdl, b "multiple '@' delimiters in name")); break; + default: + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "(%d) not defined"), why); + break; } } return (B_FALSE); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 14:53:56 2016 (r305206) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 14:57:06 2016 (r305207) @@ -27,6 +27,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Igor Kozhukhov */ #include @@ -1283,8 +1284,8 @@ dump_snapshot(zfs_handle_t *zhp, void *a pa.pa_fd = sdd->outfd; pa.pa_parsable = sdd->parsable; - if (err = pthread_create(&tid, NULL, - send_progress_thread, &pa)) { + if ((err = pthread_create(&tid, NULL, + send_progress_thread, &pa)) != 0) { zfs_close(zhp); return (err); } @@ -1762,7 +1763,7 @@ zfs_send(zfs_handle_t *zhp, const char * if (flags->dedup && !flags->dryrun) { featureflags |= (DMU_BACKUP_FEATURE_DEDUP | DMU_BACKUP_FEATURE_DEDUPPROPS); - if (err = pipe(pipefd)) { + if ((err = pipe(pipefd)) != 0) { zfs_error_aux(zhp->zfs_hdl, strerror(errno)); return (zfs_error(zhp->zfs_hdl, EZFS_PIPEFAILED, errbuf)); @@ -1770,7 +1771,7 @@ zfs_send(zfs_handle_t *zhp, const char * dda.outputfd = outfd; dda.inputfd = pipefd[1]; dda.dedup_hdl = zhp->zfs_hdl; - if (err = pthread_create(&tid, NULL, cksummer, &dda)) { + if ((err = pthread_create(&tid, NULL, cksummer, &dda)) != 0) { (void) close(pipefd[0]); (void) close(pipefd[1]); zfs_error_aux(zhp->zfs_hdl, strerror(errno)); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Thu Sep 1 14:53:56 2016 (r305206) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Thu Sep 1 14:57:06 2016 (r305207) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright 2016 Igor Kozhukhov */ /* @@ -1062,6 +1063,10 @@ zprop_print_one_property(const char *nam case ZPROP_SRC_RECEIVED: str = "received"; break; + + default: + str = NULL; + assert(!"unhandled zprop_source_t"); } break; Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.c Thu Sep 1 14:53:56 2016 (r305206) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.c Thu Sep 1 14:57:06 2016 (r305207) @@ -22,6 +22,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2016 Igor Kozhukhov */ #include @@ -177,8 +178,9 @@ zfs_deleg_verify_nvlist(nvlist_t *nvp) nvpair_name(perm_name)); if (error) return (-1); - } while (perm_name = nvlist_next_nvpair(perms, perm_name)); - } while (who = nvlist_next_nvpair(nvp, who)); + } while ((perm_name = nvlist_next_nvpair(perms, perm_name)) + != NULL); + } while ((who = nvlist_next_nvpair(nvp, who)) != NULL); return (0); } From owner-svn-src-head@freebsd.org Thu Sep 1 14:58: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 A8CC2BCBDDA; Thu, 1 Sep 2016 14:58:12 +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 6BE40C09; Thu, 1 Sep 2016 14:58:12 +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 u81EwBhG017781; Thu, 1 Sep 2016 14:58:11 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81EwB6v017778; Thu, 1 Sep 2016 14:58:11 GMT (envelope-from br@FreeBSD.org) Message-Id: <201609011458.u81EwB6v017778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 1 Sep 2016 14:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305208 - in head/sys: boot/fdt/dts/riscv riscv/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.22 Precedence: list List-Id: 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, 01 Sep 2016 14:58:12 -0000 Author: br Date: Thu Sep 1 14:58:11 2016 New Revision: 305208 URL: https://svnweb.freebsd.org/changeset/base/305208 Log: o Separate rtc and timecmp registers: they are different across RISC-V cpu implementations. o Update RocketChip device tree source (DTS). We now support latest verison of RocketChip synthesized on Xilinx FPGA (Zedboard). RocketChip is an implementation of RISC-V processor written on Chisel hardware construction language. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/boot/fdt/dts/riscv/rocket.dts head/sys/boot/fdt/dts/riscv/spike.dts head/sys/riscv/riscv/timer.c Modified: head/sys/boot/fdt/dts/riscv/rocket.dts ============================================================================== --- head/sys/boot/fdt/dts/riscv/rocket.dts Thu Sep 1 14:57:06 2016 (r305207) +++ head/sys/boot/fdt/dts/riscv/rocket.dts Thu Sep 1 14:58:11 2016 (r305208) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -37,8 +37,8 @@ /dts-v1/; / { - model = "UC Berkeley Spike Simulator RV64I"; - compatible = "riscv,rv64i"; + model = "RocketChip RV64"; + compatible = "riscv,rv64"; #address-cells = <1>; #size-cells = <1>; #interrupt-cells = <1>; @@ -49,8 +49,8 @@ cpu@0 { device_type = "cpu"; - compatible = "riscv,rv64i"; - reg = <0x40002000>; + compatible = "riscv,rv64"; + reg = <0x0>; }; }; @@ -59,13 +59,17 @@ }; memory { + /* + * This is not used currently. + * We take information from sbi_query_memory. + */ device_type = "memory"; - reg = <0x0 0x10000000>; /* 256MB at 0x0 */ + reg = <0x80000000 0x10000000>; /* 256MB at 0x80000000 */ }; soc { - #address-cells = <2>; - #size-cells = <2>; + #address-cells = <1>; + #size-cells = <1>; #interrupt-cells = <1>; compatible = "simple-bus"; @@ -78,7 +82,9 @@ timer0: timer@0 { compatible = "riscv,timer"; - interrupts = < 1 >; + reg = < 0x4400bff8 0x0008 >, /* rtc */ + < 0x44004000 0x1000 >; /* timecmp */ + interrupts = < 5 >; interrupt-parent = < &pic0 >; clock-frequency = < 1000000 >; }; Modified: head/sys/boot/fdt/dts/riscv/spike.dts ============================================================================== --- head/sys/boot/fdt/dts/riscv/spike.dts Thu Sep 1 14:57:06 2016 (r305207) +++ head/sys/boot/fdt/dts/riscv/spike.dts Thu Sep 1 14:58:11 2016 (r305208) @@ -50,13 +50,13 @@ cpu@0 { device_type = "cpu"; compatible = "riscv,rv64"; - reg = <0x40001000>; + reg = <0x0>; }; cpu@1 { device_type = "cpu"; compatible = "riscv,rv64"; - reg = <0x40002000>; + reg = <0x0>; }; }; @@ -88,7 +88,8 @@ timer0: timer@0 { compatible = "riscv,timer"; - reg = < 0x40000000 0x100 >; + reg = < 0x40000000 0x0008 >, /* rtc */ + < 0x40000008 0x1000 >; /* timecmp */ interrupts = < 5 >; interrupt-parent = < &pic0 >; clock-frequency = < 1000000 >; Modified: head/sys/riscv/riscv/timer.c ============================================================================== --- head/sys/riscv/riscv/timer.c Thu Sep 1 14:57:06 2016 (r305207) +++ head/sys/riscv/riscv/timer.c Thu Sep 1 14:58:11 2016 (r305208) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_FREQ 1000000 #define TIMER_COUNTS 0x00 -#define TIMER_MTIMECMP(cpu) (0x08 + (cpu * 8)) +#define TIMER_MTIMECMP(cpu) (cpu * 8) #define READ8(_sc, _reg) \ bus_space_read_8(_sc->bst, _sc->bsh, _reg) @@ -77,9 +77,11 @@ __FBSDID("$FreeBSD$"); bus_space_write_8(_sc->bst, _sc->bsh, _reg, _val) struct riscv_tmr_softc { - struct resource *res[2]; + struct resource *res[3]; bus_space_tag_t bst; bus_space_handle_t bsh; + bus_space_tag_t bst_timecmp; + bus_space_handle_t bsh_timecmp; void *ih; uint32_t clkfreq; struct eventtimer et; @@ -89,6 +91,7 @@ static struct riscv_tmr_softc *riscv_tmr static struct resource_spec timer_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, { -1, 0 } }; @@ -107,8 +110,11 @@ static struct timecounter riscv_tmr_time static long get_counts(struct riscv_tmr_softc *sc) { + uint64_t counts; + + counts = READ8(sc, TIMER_COUNTS); - return (READ8(sc, TIMER_COUNTS)); + return (counts); } static unsigned @@ -134,7 +140,8 @@ riscv_tmr_start(struct eventtimer *et, s counts = ((uint32_t)et->et_frequency * first) >> 32; counts += READ8(sc, TIMER_COUNTS); cpu = PCPU_GET(cpuid); - WRITE8(sc, TIMER_MTIMECMP(cpu), counts); + bus_space_write_8(sc->bst_timecmp, sc->bsh_timecmp, + TIMER_MTIMECMP(cpu), counts); csr_set(sie, SIE_STIE); sbi_set_timer(counts); @@ -225,11 +232,13 @@ riscv_tmr_attach(device_t dev) /* Memory interface */ sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); + sc->bst_timecmp = rman_get_bustag(sc->res[1]); + sc->bsh_timecmp = rman_get_bushandle(sc->res[1]); riscv_tmr_sc = sc; /* Setup IRQs handler */ - error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_CLK, + error = bus_setup_intr(dev, sc->res[2], INTR_TYPE_CLK, riscv_tmr_intr, NULL, sc, &sc->ih); if (error) { device_printf(dev, "Unable to alloc int resource.\n"); From owner-svn-src-head@freebsd.org Thu Sep 1 15:08: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 26A40BCB28D; Thu, 1 Sep 2016 15:08:30 +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 B38FE817; Thu, 1 Sep 2016 15:08:29 +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 u81F8Sv0022112; Thu, 1 Sep 2016 15:08:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81F8RD5022094; Thu, 1 Sep 2016 15:08:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011508.u81F8RD5022094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 15:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305209 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/z... 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.22 Precedence: list List-Id: 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, 01 Sep 2016 15:08:30 -0000 Author: mav Date: Thu Sep 1 15:08:27 2016 New Revision: 305209 URL: https://svnweb.freebsd.org/changeset/base/305209 Log: MFV r302660: 6314 buffer overflow in dsl_dataset_name illumos/illumos-gate@9adfa60d484ce2435f5af77cc99dcd4e692b6660 https://github.com/illumos/illumos-gate/commit/9adfa60d484ce2435f5af77cc99dcd4e6 92b6660 https://www.illumos.org/issues/6314 Callers of dsl_dataset_name pass a buffer of size ZFS_MAXNAMELEN, but dsl_dataset_name copies the datasets' name PLUS the snapshot name to it, resulting in a max of 2 * ZFS_MAXNAMELEN + '@'. Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Igor Kozhukhov Approved by: Dan McDonald Author: Matthew Ahrens Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/cmd/zhack/zhack.c head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Sep 1 15:08:27 2016 (r305209) @@ -60,7 +60,6 @@ #include #include #include -#undef ZFS_MAXNAMELEN #undef verify #include @@ -1945,7 +1944,7 @@ dump_dir(objset_t *os) uint64_t refdbytes, usedobjs, scratch; char numbuf[32]; char blkbuf[BP_SPRINTF_LEN + 20]; - char osname[MAXNAMELEN]; + char osname[ZFS_MAX_DATASET_NAME_LEN]; char *type = "UNKNOWN"; int verbosity = dump_opt['d']; int print_header = 1; @@ -3482,7 +3481,7 @@ find_zpool(char **target, nvlist_t **con nvlist_t *match = NULL; char *name = NULL; char *sepp = NULL; - char sep; + char sep = '\0'; int count = 0; importargs_t args = { 0 }; Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 1 15:08:27 2016 (r305209) @@ -1510,7 +1510,7 @@ get_callback(zfs_handle_t *zhp, void *da char buf[ZFS_MAXPROPLEN]; char rbuf[ZFS_MAXPROPLEN]; zprop_source_t sourcetype; - char source[ZFS_MAXNAMELEN]; + char source[ZFS_MAX_DATASET_NAME_LEN]; zprop_get_cbdata_t *cbp = data; nvlist_t *user_props = zfs_get_user_props(zhp); zprop_list_t *pl = cbp->cb_proplist; @@ -1990,7 +1990,7 @@ typedef struct upgrade_cbdata { uint64_t cb_version; boolean_t cb_newer; boolean_t cb_foundone; - char cb_lastfs[ZFS_MAXNAMELEN]; + char cb_lastfs[ZFS_MAX_DATASET_NAME_LEN]; } upgrade_cbdata_t; static int @@ -2436,7 +2436,7 @@ userspace_cb(void *arg, const char *doma if (domain != NULL && domain[0] != '\0') { /* SMB */ - char sid[ZFS_MAXNAMELEN + 32]; + char sid[MAXNAMELEN + 32]; uid_t id; #ifdef illumos int err; @@ -2573,7 +2573,7 @@ print_us_node(boolean_t scripted, boolea size_t *width, us_node_t *node) { nvlist_t *nvl = node->usn_nvl; - char valstr[ZFS_MAXNAMELEN]; + char valstr[MAXNAMELEN]; boolean_t first = B_TRUE; int cfield = 0; int field; @@ -3472,7 +3472,7 @@ zfs_do_rollback(int argc, char **argv) boolean_t force = B_FALSE; rollback_cbdata_t cb = { 0 }; zfs_handle_t *zhp, *snap; - char parentname[ZFS_MAXNAMELEN]; + char parentname[ZFS_MAX_DATASET_NAME_LEN]; char *delim; /* check options */ @@ -3872,7 +3872,7 @@ zfs_do_send(int argc, char **argv) */ if (strchr(argv[0], '@') == NULL || (fromname && strchr(fromname, '#') != NULL)) { - char frombuf[ZFS_MAXNAMELEN]; + char frombuf[ZFS_MAX_DATASET_NAME_LEN]; enum lzc_send_flags lzc_flags = 0; if (flags.replicate || flags.doall || flags.props || @@ -3924,7 +3924,7 @@ zfs_do_send(int argc, char **argv) * case if they specify the origin. */ if (fromname && (cp = strchr(fromname, '@')) != NULL) { - char origin[ZFS_MAXNAMELEN]; + char origin[ZFS_MAX_DATASET_NAME_LEN]; zprop_source_t src; (void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN, @@ -4058,7 +4058,7 @@ zfs_do_receive(int argc, char **argv) usage(B_FALSE); } - char namebuf[ZFS_MAXNAMELEN]; + char namebuf[ZFS_MAX_DATASET_NAME_LEN]; (void) snprintf(namebuf, sizeof (namebuf), "%s/%%recv", argv[0]); @@ -4916,7 +4916,7 @@ store_allow_perm(zfs_deleg_who_type_t ty { int i; char ld[2] = { '\0', '\0' }; - char who_buf[ZFS_MAXNAMELEN+32]; + char who_buf[MAXNAMELEN + 32]; char base_type = '\0'; char set_type = '\0'; nvlist_t *base_nvl = NULL; @@ -5284,7 +5284,7 @@ static void print_fs_perms(fs_perm_set_t *fspset) { fs_perm_node_t *node = NULL; - char buf[ZFS_MAXNAMELEN+32]; + char buf[MAXNAMELEN + 32]; const char *dsname = buf; for (node = uu_list_first(fspset->fsps_list); node != NULL; @@ -5293,7 +5293,7 @@ print_fs_perms(fs_perm_set_t *fspset) uu_avl_t *uge_avl = node->fspn_fsperm.fsp_uge_avl; int left = 0; - (void) snprintf(buf, ZFS_MAXNAMELEN+32, + (void) snprintf(buf, sizeof (buf), gettext("---- Permissions on %s "), node->fspn_fsperm.fsp_name); (void) printf(dsname); @@ -5490,7 +5490,7 @@ zfs_do_hold_rele_impl(int argc, char **a for (i = 0; i < argc; ++i) { zfs_handle_t *zhp; - char parent[ZFS_MAXNAMELEN]; + char parent[ZFS_MAX_DATASET_NAME_LEN]; const char *delim; char *path = argv[i]; @@ -5623,7 +5623,7 @@ holds_callback(zfs_handle_t *zhp, void * nvlist_t *nvl = NULL; nvpair_t *nvp = NULL; const char *zname = zfs_get_name(zhp); - size_t znamelen = strnlen(zname, ZFS_MAXNAMELEN); + size_t znamelen = strlen(zname); if (cbp->cb_recursive && cbp->cb_snapname != NULL) { const char *snapname; @@ -5644,7 +5644,7 @@ holds_callback(zfs_handle_t *zhp, void * while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) { const char *tag = nvpair_name(nvp); - size_t taglen = strnlen(tag, MAXNAMELEN); + size_t taglen = strlen(tag); if (taglen > cbp->cb_max_taglen) cbp->cb_max_taglen = taglen; } @@ -6981,7 +6981,7 @@ zfs_do_diff(int argc, char **argv) static int zfs_do_bookmark(int argc, char **argv) { - char snapname[ZFS_MAXNAMELEN]; + char snapname[ZFS_MAX_DATASET_NAME_LEN]; zfs_handle_t *zhp; nvlist_t *nvl; int ret = 0; Modified: head/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zhack/zhack.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/cmd/zhack/zhack.c Thu Sep 1 15:08:27 2016 (r305209) @@ -48,7 +48,6 @@ #include #include #include -#undef ZFS_MAXNAMELEN #undef verify #include Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Sep 1 15:08:27 2016 (r305209) @@ -4540,7 +4540,7 @@ zpool_do_status(int argc, char **argv) typedef struct upgrade_cbdata { boolean_t cb_first; boolean_t cb_unavail; - char cb_poolname[ZPOOL_MAXNAMELEN]; + char cb_poolname[ZFS_MAX_DATASET_NAME_LEN]; int cb_argc; uint64_t cb_version; char **cb_argv; Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Sep 1 15:08:27 2016 (r305209) @@ -141,8 +141,8 @@ typedef struct ztest_shared_hdr { static ztest_shared_hdr_t *ztest_shared_hdr; typedef struct ztest_shared_opts { - char zo_pool[MAXNAMELEN]; - char zo_dir[MAXNAMELEN]; + char zo_pool[ZFS_MAX_DATASET_NAME_LEN]; + char zo_dir[ZFS_MAX_DATASET_NAME_LEN]; char zo_alt_ztest[MAXNAMELEN]; char zo_alt_libpath[MAXNAMELEN]; uint64_t zo_vdevs; @@ -268,7 +268,7 @@ typedef struct ztest_od { uint64_t od_crblocksize; uint64_t od_gen; uint64_t od_crgen; - char od_name[MAXNAMELEN]; + char od_name[ZFS_MAX_DATASET_NAME_LEN]; } ztest_od_t; /* @@ -280,7 +280,7 @@ typedef struct ztest_ds { rwlock_t zd_zilog_lock; zilog_t *zd_zilog; ztest_od_t *zd_od; /* debugging aid */ - char zd_name[MAXNAMELEN]; + char zd_name[ZFS_MAX_DATASET_NAME_LEN]; mutex_t zd_dirobj_lock; rll_t zd_object_lock[ZTEST_OBJECT_LOCKS]; rll_t zd_range_lock[ZTEST_RANGE_LOCKS]; @@ -3227,7 +3227,7 @@ ztest_objset_destroy_cb(const char *name static boolean_t ztest_snapshot_create(char *osname, uint64_t id) { - char snapname[MAXNAMELEN]; + char snapname[ZFS_MAX_DATASET_NAME_LEN]; int error; (void) snprintf(snapname, sizeof (snapname), "%llu", (u_longlong_t)id); @@ -3247,10 +3247,10 @@ ztest_snapshot_create(char *osname, uint static boolean_t ztest_snapshot_destroy(char *osname, uint64_t id) { - char snapname[MAXNAMELEN]; + char snapname[ZFS_MAX_DATASET_NAME_LEN]; int error; - (void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname, + (void) snprintf(snapname, sizeof (snapname), "%s@%llu", osname, (u_longlong_t)id); error = dsl_destroy_snapshot(snapname, B_FALSE); @@ -3267,12 +3267,12 @@ ztest_dmu_objset_create_destroy(ztest_ds int iters; int error; objset_t *os, *os2; - char name[MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; zilog_t *zilog; (void) rw_rdlock(&ztest_name_lock); - (void) snprintf(name, MAXNAMELEN, "%s/temp_%llu", + (void) snprintf(name, sizeof (name), "%s/temp_%llu", ztest_opts.zo_pool, (u_longlong_t)id); /* @@ -3378,18 +3378,23 @@ ztest_dmu_snapshot_create_destroy(ztest_ void ztest_dsl_dataset_cleanup(char *osname, uint64_t id) { - char snap1name[MAXNAMELEN]; - char clone1name[MAXNAMELEN]; - char snap2name[MAXNAMELEN]; - char clone2name[MAXNAMELEN]; - char snap3name[MAXNAMELEN]; + char snap1name[ZFS_MAX_DATASET_NAME_LEN]; + char clone1name[ZFS_MAX_DATASET_NAME_LEN]; + char snap2name[ZFS_MAX_DATASET_NAME_LEN]; + char clone2name[ZFS_MAX_DATASET_NAME_LEN]; + char snap3name[ZFS_MAX_DATASET_NAME_LEN]; int error; - (void) snprintf(snap1name, MAXNAMELEN, "%s@s1_%llu", osname, id); - (void) snprintf(clone1name, MAXNAMELEN, "%s/c1_%llu", osname, id); - (void) snprintf(snap2name, MAXNAMELEN, "%s@s2_%llu", clone1name, id); - (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id); - (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id); + (void) snprintf(snap1name, sizeof (snap1name), + "%s@s1_%llu", osname, id); + (void) snprintf(clone1name, sizeof (clone1name), + "%s/c1_%llu", osname, id); + (void) snprintf(snap2name, sizeof (snap2name), + "%s@s2_%llu", clone1name, id); + (void) snprintf(clone2name, sizeof (clone2name), + "%s/c2_%llu", osname, id); + (void) snprintf(snap3name, sizeof (snap3name), + "%s@s3_%llu", clone1name, id); error = dsl_destroy_head(clone2name); if (error && error != ENOENT) @@ -3415,11 +3420,11 @@ void ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id) { objset_t *os; - char snap1name[MAXNAMELEN]; - char clone1name[MAXNAMELEN]; - char snap2name[MAXNAMELEN]; - char clone2name[MAXNAMELEN]; - char snap3name[MAXNAMELEN]; + char snap1name[ZFS_MAX_DATASET_NAME_LEN]; + char clone1name[ZFS_MAX_DATASET_NAME_LEN]; + char snap2name[ZFS_MAX_DATASET_NAME_LEN]; + char clone2name[ZFS_MAX_DATASET_NAME_LEN]; + char snap3name[ZFS_MAX_DATASET_NAME_LEN]; char *osname = zd->zd_name; int error; @@ -3427,11 +3432,16 @@ ztest_dsl_dataset_promote_busy(ztest_ds_ ztest_dsl_dataset_cleanup(osname, id); - (void) snprintf(snap1name, MAXNAMELEN, "%s@s1_%llu", osname, id); - (void) snprintf(clone1name, MAXNAMELEN, "%s/c1_%llu", osname, id); - (void) snprintf(snap2name, MAXNAMELEN, "%s@s2_%llu", clone1name, id); - (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id); - (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id); + (void) snprintf(snap1name, sizeof (snap1name), + "%s@s1_%llu", osname, id); + (void) snprintf(clone1name, sizeof (clone1name), + "%s/c1_%llu", osname, id); + (void) snprintf(snap2name, sizeof (snap2name), + "%s@s2_%llu", clone1name, id); + (void) snprintf(clone2name, sizeof (clone2name), + "%s/c2_%llu", osname, id); + (void) snprintf(snap3name, sizeof (snap3name), + "%s@s3_%llu", clone1name, id); error = dmu_objset_snapshot_one(osname, strchr(snap1name, '@') + 1); if (error && error != EEXIST) { @@ -4249,7 +4259,7 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id) * 2050 entries we should see ptrtbl growth and leaf-block split. */ for (int i = 0; i < 2050; i++) { - char name[MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; uint64_t value = i; dmu_tx_t *tx; int error; @@ -4654,7 +4664,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, char fullname[100]; char clonename[100]; char tag[100]; - char osname[MAXNAMELEN]; + char osname[ZFS_MAX_DATASET_NAME_LEN]; nvlist_t *holds; (void) rw_rdlock(&ztest_name_lock); @@ -5450,13 +5460,13 @@ ztest_thread(void *arg) static void ztest_dataset_name(char *dsname, char *pool, int d) { - (void) snprintf(dsname, MAXNAMELEN, "%s/ds_%d", pool, d); + (void) snprintf(dsname, ZFS_MAX_DATASET_NAME_LEN, "%s/ds_%d", pool, d); } static void ztest_dataset_destroy(int d) { - char name[MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; ztest_dataset_name(name, ztest_opts.zo_pool, d); @@ -5505,7 +5515,7 @@ ztest_dataset_open(int d) uint64_t committed_seq = ZTEST_GET_SHARED_DS(d)->zd_seq; objset_t *os; zilog_t *zilog; - char name[MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; int error; ztest_dataset_name(name, ztest_opts.zo_pool, d); @@ -5728,8 +5738,8 @@ ztest_run(ztest_shared_t *zs) * different name. */ if (ztest_random(2) == 0) { - char name[MAXNAMELEN]; - (void) snprintf(name, MAXNAMELEN, "%s_import", + char name[ZFS_MAX_DATASET_NAME_LEN]; + (void) snprintf(name, sizeof (name), "%s_import", ztest_opts.zo_pool); ztest_spa_import_export(ztest_opts.zo_pool, name); ztest_spa_import_export(name, ztest_opts.zo_pool); @@ -6297,7 +6307,7 @@ main(int argc, char **argv) if (spa_open(ztest_opts.zo_pool, &spa, FTAG) == 0) { spa_close(spa, FTAG); } else { - char tmpname[MAXNAMELEN]; + char tmpname[ZFS_MAX_DATASET_NAME_LEN]; kernel_fini(); kernel_init(FREAD | FWRITE); (void) snprintf(tmpname, sizeof (tmpname), "%s_tmp", Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Sep 1 15:08:27 2016 (r305209) @@ -51,8 +51,6 @@ extern "C" { /* * Miscellaneous ZFS constants */ -#define ZFS_MAXNAMELEN MAXNAMELEN -#define ZPOOL_MAXNAMELEN MAXNAMELEN #define ZFS_MAXPROPLEN MAXPATHLEN #define ZPOOL_MAXPROPLEN MAXPATHLEN Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c Thu Sep 1 15:08:27 2016 (r305209) @@ -26,6 +26,7 @@ * Portions Copyright 2007 Ramprakash Jelari * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. + * Copyright (c) 2014, 2015 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov */ @@ -296,7 +297,7 @@ void changelist_rename(prop_changelist_t *clp, const char *src, const char *dst) { prop_changenode_t *cn; - char newname[ZFS_MAXNAMELEN]; + char newname[ZFS_MAX_DATASET_NAME_LEN]; for (cn = uu_list_first(clp->cl_list); cn != NULL; cn = uu_list_next(clp->cl_list, cn)) { Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 1 15:08:27 2016 (r305209) @@ -554,7 +554,7 @@ zfs_bookmark_exists(const char *path) { nvlist_t *bmarks; nvlist_t *props; - char fsname[ZFS_MAXNAMELEN]; + char fsname[ZFS_MAX_DATASET_NAME_LEN]; char *bmark_name; char *pound; int err; @@ -2181,7 +2181,7 @@ struct get_clones_arg { uint64_t numclones; nvlist_t *value; const char *origin; - char buf[ZFS_MAXNAMELEN]; + char buf[ZFS_MAX_DATASET_NAME_LEN]; }; int @@ -2236,7 +2236,7 @@ zfs_get_clones_nvl(zfs_handle_t *zhp) if (gca.numclones != 0) { zfs_handle_t *root; - char pool[ZFS_MAXNAMELEN]; + char pool[ZFS_MAX_DATASET_NAME_LEN]; char *cp = pool; /* get the pool name */ @@ -3021,7 +3021,7 @@ check_parents(libzfs_handle_t *hdl, cons boolean_t accept_ancestor, int *prefixlen) { zfs_cmd_t zc = { 0 }; - char parent[ZFS_MAXNAMELEN]; + char parent[ZFS_MAX_DATASET_NAME_LEN]; char *slash; zfs_handle_t *zhp; char errbuf[1024]; @@ -3260,7 +3260,7 @@ zfs_create(libzfs_handle_t *hdl, const c ost = LZC_DATSET_TYPE_ZFS; /* open zpool handle for prop validation */ - char pool_path[MAXNAMELEN]; + char pool_path[ZFS_MAX_DATASET_NAME_LEN]; (void) strlcpy(pool_path, path, sizeof (pool_path)); /* truncate pool_path at first slash */ @@ -3329,7 +3329,7 @@ zfs_create(libzfs_handle_t *hdl, const c /* check for failure */ if (ret != 0) { - char parent[ZFS_MAXNAMELEN]; + char parent[ZFS_MAX_DATASET_NAME_LEN]; (void) parent_name(path, parent, sizeof (parent)); switch (errno) { @@ -3419,7 +3419,7 @@ static int zfs_check_snap_cb(zfs_handle_t *zhp, void *arg) { struct destroydata *dd = arg; - char name[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; int rv = 0; (void) snprintf(name, sizeof (name), @@ -3509,7 +3509,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *h int zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props) { - char parent[ZFS_MAXNAMELEN]; + char parent[ZFS_MAX_DATASET_NAME_LEN]; int ret; char errbuf[1024]; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -3639,7 +3639,7 @@ static int zfs_snapshot_cb(zfs_handle_t *zhp, void *arg) { snapdata_t *sd = arg; - char name[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; int rv = 0; if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) { @@ -3688,7 +3688,7 @@ zfs_snapshot_nvl(libzfs_handle_t *hdl, n * get pool handle for prop validation. assumes all snaps are in the * same pool, as does lzc_snapshot (below). */ - char pool[MAXNAMELEN]; + char pool[ZFS_MAX_DATASET_NAME_LEN]; elem = nvlist_next_nvpair(snaps, NULL); (void) strlcpy(pool, nvpair_name(elem), sizeof (pool)); pool[strcspn(pool, "/@")] = '\0'; @@ -3742,7 +3742,7 @@ zfs_snapshot(libzfs_handle_t *hdl, const { int ret; snapdata_t sd = { 0 }; - char fsname[ZFS_MAXNAMELEN]; + char fsname[ZFS_MAX_DATASET_NAME_LEN]; char *cp; zfs_handle_t *zhp; char errbuf[1024]; @@ -3921,7 +3921,7 @@ zfs_rename(zfs_handle_t *zhp, const char prop_changelist_t *cl = NULL; zfs_handle_t *zhrp = NULL; char *parentname = NULL; - char parent[ZFS_MAXNAMELEN]; + char parent[ZFS_MAX_DATASET_NAME_LEN]; char property[ZFS_MAXPROPLEN]; libzfs_handle_t *hdl = zhp->zfs_hdl; char errbuf[1024]; @@ -4435,7 +4435,7 @@ static int zfs_hold_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - char name[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; int rv = 0; (void) snprintf(name, sizeof (name), @@ -4554,7 +4554,7 @@ static int zfs_release_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - char name[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; int rv = 0; nvlist_t *existing_holds; @@ -4683,7 +4683,7 @@ tryagain: zc.zc_nvlist_dst_size = nvsz; zc.zc_nvlist_dst = (uintptr_t)nvbuf; - (void) strlcpy(zc.zc_name, zhp->zfs_name, ZFS_MAXNAMELEN); + (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); if (ioctl(hdl->libzfs_fd, ZFS_IOC_GET_FSACL, &zc) != 0) { (void) snprintf(errbuf, sizeof (errbuf), Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Thu Sep 1 15:08:27 2016 (r305209) @@ -22,6 +22,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2015 by Delphix. All rights reserved. * Copyright 2016 Joyent, Inc. * Copyright 2016 Igor Kozhukhov */ @@ -618,7 +619,7 @@ get_snapshot_names(differ_info_t *di, co * not the same dataset name, might be okay if * tosnap is a clone of a fromsnap descendant. */ - char origin[ZFS_MAXNAMELEN]; + char origin[ZFS_MAX_DATASET_NAME_LEN]; zprop_source_t src; zfs_handle_t *zhp; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Thu Sep 1 15:08:27 2016 (r305209) @@ -22,18 +22,18 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. */ #ifndef _LIBZFS_IMPL_H #define _LIBZFS_IMPL_H -#include #include -#include #include #include +#include +#include #include #include @@ -86,7 +86,7 @@ struct libzfs_handle { struct zfs_handle { libzfs_handle_t *zfs_hdl; zpool_handle_t *zpool_hdl; - char zfs_name[ZFS_MAXNAMELEN]; + char zfs_name[ZFS_MAX_DATASET_NAME_LEN]; zfs_type_t zfs_type; /* type including snapshot */ zfs_type_t zfs_head_type; /* type excluding snapshot */ dmu_objset_stats_t zfs_dmustats; @@ -107,7 +107,7 @@ struct zfs_handle { struct zpool_handle { libzfs_handle_t *zpool_hdl; zpool_handle_t *zpool_next; - char zpool_name[ZPOOL_MAXNAMELEN]; + char zpool_name[ZFS_MAX_DATASET_NAME_LEN]; int zpool_state; size_t zpool_config_size; nvlist_t *zpool_config; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Thu Sep 1 15:08:27 2016 (r305209) @@ -197,7 +197,7 @@ zfs_iter_bookmarks(zfs_handle_t *zhp, zf for (nvpair_t *pair = nvlist_next_nvpair(bmarks, NULL); pair != NULL; pair = nvlist_next_nvpair(bmarks, pair)) { - char name[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; char *bmark_name; nvlist_t *bmark_props; @@ -385,7 +385,7 @@ zfs_iter_snapspec(zfs_handle_t *fs_zhp, * exists. */ if (ssa.ssa_last[0] != '\0') { - char snapname[ZFS_MAXNAMELEN]; + char snapname[ZFS_MAX_DATASET_NAME_LEN]; (void) snprintf(snapname, sizeof (snapname), "%s@%s", zfs_get_name(fs_zhp), ssa.ssa_last); @@ -405,7 +405,7 @@ zfs_iter_snapspec(zfs_handle_t *fs_zhp, ret = ENOENT; } } else { - char snapname[ZFS_MAXNAMELEN]; + char snapname[ZFS_MAX_DATASET_NAME_LEN]; zfs_handle_t *snap_zhp; (void) snprintf(snapname, sizeof (snapname), "%s@%s", zfs_get_name(fs_zhp), comma_separated); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Thu Sep 1 15:08:27 2016 (r305209) @@ -236,7 +236,7 @@ static boolean_t zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen, zprop_source_t *source) { - char sourceloc[ZFS_MAXNAMELEN]; + char sourceloc[MAXNAMELEN]; zprop_source_t sourcetype; if (!zfs_prop_valid_for_type(ZFS_PROP_MOUNTPOINT, zhp->zfs_type)) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Sep 1 15:08:27 2016 (r305209) @@ -407,7 +407,7 @@ bootfs_name_valid(const char *pool, char boolean_t zpool_is_bootable(zpool_handle_t *zhp) { - char bootfs[ZPOOL_MAXNAMELEN]; + char bootfs[ZFS_MAX_DATASET_NAME_LEN]; return (zpool_get_prop(zhp, ZPOOL_PROP_BOOTFS, bootfs, sizeof (bootfs), NULL, B_FALSE) == 0 && strncmp(bootfs, "-", @@ -3803,7 +3803,7 @@ zpool_obj_to_path(zpool_handle_t *zhp, u zfs_cmd_t zc = { 0 }; boolean_t mounted = B_FALSE; char *mntpnt = NULL; - char dsname[MAXNAMELEN]; + char dsname[ZFS_MAX_DATASET_NAME_LEN]; if (dsobj == 0) { /* special case for the MOS */ @@ -4064,7 +4064,7 @@ zvol_check_dump_config(char *arg) uint_t toplevels; libzfs_handle_t *hdl; char errbuf[1024]; - char poolname[ZPOOL_MAXNAMELEN]; + char poolname[ZFS_MAX_DATASET_NAME_LEN]; int pathlen = strlen(ZVOL_FULL_DEV_DIR); int ret = 1; @@ -4087,7 +4087,7 @@ zvol_check_dump_config(char *arg) "malformed dataset name")); (void) zfs_error(hdl, EZFS_INVALIDNAME, errbuf); return (1); - } else if (p - volname >= ZFS_MAXNAMELEN) { + } else if (p - volname >= ZFS_MAX_DATASET_NAME_LEN) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "dataset name is too long")); (void) zfs_error(hdl, EZFS_NAMETOOLONG, errbuf); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 1 15:08:27 2016 (r305209) @@ -752,7 +752,7 @@ send_iterate_prop(zfs_handle_t *zhp, nvl static uint64_t get_snap_txg(libzfs_handle_t *hdl, const char *fs, const char *snap) { - char name[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; uint64_t txg = 0; if (fs == NULL || fs[0] == '\0' || snap == NULL || snap[0] == '\0') @@ -920,7 +920,7 @@ typedef struct send_dump_data { /* these are all just the short snapname (the part after the @) */ const char *fromsnap; const char *tosnap; - char prevsnap[ZFS_MAXNAMELEN]; + char prevsnap[ZFS_MAX_DATASET_NAME_LEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; boolean_t verbose, dryrun, parsable, progress, embed_data, std_out; @@ -933,7 +933,7 @@ typedef struct send_dump_data { snapfilter_cb_t *filter_cb; void *filter_cb_arg; nvlist_t *debugnv; - char holdtag[ZFS_MAXNAMELEN]; + char holdtag[ZFS_MAX_DATASET_NAME_LEN]; int cleanup_fd; uint64_t size; } send_dump_data_t; @@ -1569,7 +1569,7 @@ zfs_send_resume(libzfs_handle_t *hdl, se uint64_t resumeobj, resumeoff, toguid, fromguid, bytes; zfs_handle_t *zhp; int error = 0; - char name[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; enum lzc_send_flags lzc_flags = 0; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, @@ -2163,8 +2163,8 @@ recv_rename(libzfs_handle_t *hdl, const if (err != 0 && strncmp(name + baselen, "recv-", 5) != 0) { seq++; - (void) snprintf(newname, ZFS_MAXNAMELEN, "%.*srecv-%u-%u", - baselen, name, getpid(), seq); + (void) snprintf(newname, ZFS_MAX_DATASET_NAME_LEN, + "%.*srecv-%u-%u", baselen, name, getpid(), seq); (void) strlcpy(zc.zc_value, newname, sizeof (zc.zc_value)); if (flags->verbose) { @@ -2292,7 +2292,7 @@ static int guid_to_name(libzfs_handle_t *hdl, const char *parent, uint64_t guid, boolean_t bookmark_ok, char *name) { - char pname[ZFS_MAXNAMELEN]; + char pname[ZFS_MAX_DATASET_NAME_LEN]; guid_to_name_data_t gtnd; gtnd.guid = guid; @@ -2347,7 +2347,7 @@ created_before(libzfs_handle_t *hdl, avl { nvlist_t *nvfs; char *fsname, *snapname; - char buf[ZFS_MAXNAMELEN]; + char buf[ZFS_MAX_DATASET_NAME_LEN]; int rv; zfs_handle_t *guid1hdl, *guid2hdl; uint64_t create1, create2; @@ -2398,7 +2398,7 @@ recv_incremental_replication(libzfs_hand avl_tree_t *local_avl; nvpair_t *fselem, *nextfselem; char *fromsnap; - char newname[ZFS_MAXNAMELEN]; + char newname[ZFS_MAX_DATASET_NAME_LEN]; char guidname[32]; int error; boolean_t needagain, progress, recursive; @@ -2517,7 +2517,7 @@ again: /* check for delete */ if (found == NULL) { - char name[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; if (!flags->force) continue; @@ -2557,8 +2557,8 @@ again: /* check for different snapname */ if (strcmp(nvpair_name(snapelem), stream_snapname) != 0) { - char name[ZFS_MAXNAMELEN]; - char tryname[ZFS_MAXNAMELEN]; + char name[ZFS_MAX_DATASET_NAME_LEN]; + char tryname[ZFS_MAX_DATASET_NAME_LEN]; (void) snprintf(name, sizeof (name), "%s@%s", fsname, nvpair_name(snapelem)); @@ -2640,7 +2640,7 @@ again: ((flags->isprefix || strcmp(tofs, fsname) != 0) && (s1 != NULL) && (s2 != NULL) && strcmp(s1, s2) != 0)) { nvlist_t *parent; - char tryname[ZFS_MAXNAMELEN]; + char tryname[ZFS_MAX_DATASET_NAME_LEN]; parent = fsavl_find(local_avl, stream_parent_fromsnap_guid, NULL); @@ -2708,8 +2708,8 @@ zfs_receive_package(libzfs_handle_t *hdl char *fromsnap = NULL; char *sendsnap = NULL; char *cp; - char tofs[ZFS_MAXNAMELEN]; - char sendfs[ZFS_MAXNAMELEN]; + char tofs[ZFS_MAX_DATASET_NAME_LEN]; + char sendfs[ZFS_MAX_DATASET_NAME_LEN]; char errbuf[1024]; dmu_replay_record_t drre; int error; @@ -2793,7 +2793,7 @@ zfs_receive_package(libzfs_handle_t *hdl nvlist_t *renamed = NULL; nvpair_t *pair = NULL; - (void) strlcpy(tofs, destname, ZFS_MAXNAMELEN); + (void) strlcpy(tofs, destname, sizeof (tofs)); if (flags->isprefix) { struct drr_begin *drrb = &drr->drr_u.drr_begin; int i; @@ -2802,7 +2802,7 @@ zfs_receive_package(libzfs_handle_t *hdl cp = strrchr(drrb->drr_toname, '/'); if (cp == NULL) { (void) strlcat(tofs, "/", - ZFS_MAXNAMELEN); + sizeof (tofs)); i = 0; } else { i = (cp - drrb->drr_toname); @@ -2812,7 +2812,7 @@ zfs_receive_package(libzfs_handle_t *hdl } /* zfs_receive_one() will create_parents() */ (void) strlcat(tofs, &drrb->drr_toname[i], - ZFS_MAXNAMELEN); + sizeof (tofs)); *strchr(tofs, '@') = '\0'; } @@ -2854,7 +2854,7 @@ zfs_receive_package(libzfs_handle_t *hdl * zfs_receive_one(). */ (void) strlcpy(sendfs, drr->drr_u.drr_begin.drr_toname, - ZFS_MAXNAMELEN); + sizeof (sendfs)); if ((cp = strchr(sendfs, '@')) != NULL) { *cp = '\0'; /* @@ -3004,7 +3004,7 @@ static void recv_ecksum_set_aux(libzfs_handle_t *hdl, const char *target_snap, boolean_t resumable) { - char target_fs[ZFS_MAXNAMELEN]; + char target_fs[ZFS_MAX_DATASET_NAME_LEN]; zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "checksum mismatch or incomplete stream")); @@ -3207,7 +3207,7 @@ zfs_receive_one(libzfs_handle_t *hdl, in if (flags->verbose) (void) printf("found clone origin %s\n", zc.zc_string); } else if (originsnap) { - (void) strncpy(zc.zc_string, originsnap, ZFS_MAXNAMELEN); + (void) strncpy(zc.zc_string, originsnap, sizeof (zc.zc_string)); if (flags->verbose) (void) printf("using provided clone origin %s\n", zc.zc_string); @@ -3232,7 +3232,7 @@ zfs_receive_one(libzfs_handle_t *hdl, in *cp = '\0'; if (cp && !zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) { - char suffix[ZFS_MAXNAMELEN]; + char suffix[ZFS_MAX_DATASET_NAME_LEN]; (void) strcpy(suffix, strrchr(zc.zc_value, '/')); if (guid_to_name(hdl, zc.zc_name, parent_snapguid, B_FALSE, zc.zc_value) == 0) { @@ -3259,7 +3259,7 @@ zfs_receive_one(libzfs_handle_t *hdl, in if ((flags->isprefix || (*(chopprefix = drrb->drr_toname + strlen(sendfs)) != '\0' && *chopprefix != '@')) && !zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) { - char snap[ZFS_MAXNAMELEN]; + char snap[ZFS_MAX_DATASET_NAME_LEN]; (void) strcpy(snap, strchr(zc.zc_value, '@')); if (guid_to_name(hdl, zc.zc_name, drrb->drr_fromguid, B_FALSE, zc.zc_value) == 0) { @@ -3709,7 +3709,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, c } if (DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) == DMU_SUBSTREAM) { - char nonpackage_sendfs[ZFS_MAXNAMELEN]; + char nonpackage_sendfs[ZFS_MAX_DATASET_NAME_LEN]; if (sendfs == NULL) { /* * We were not called from zfs_receive_package(). Get @@ -3717,7 +3717,8 @@ zfs_receive_impl(libzfs_handle_t *hdl, c */ char *cp; (void) strlcpy(nonpackage_sendfs, - drr.drr_u.drr_begin.drr_toname, ZFS_MAXNAMELEN); + drr.drr_u.drr_begin.drr_toname, + sizeof (nonpackage_sendfs)); if ((cp = strchr(nonpackage_sendfs, '@')) != NULL) *cp = '\0'; sendfs = nonpackage_sendfs; Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Thu Sep 1 15:08:27 2016 (r305209) @@ -265,7 +265,7 @@ lzc_snapshot(nvlist_t *snaps, nvlist_t * nvpair_t *elem; nvlist_t *args; int error; - char pool[MAXNAMELEN]; + char pool[ZFS_MAX_DATASET_NAME_LEN]; *errlist = NULL; @@ -317,7 +317,7 @@ lzc_destroy_snaps(nvlist_t *snaps, boole nvpair_t *elem; nvlist_t *args; int error; - char pool[MAXNAMELEN]; + char pool[ZFS_MAX_DATASET_NAME_LEN]; /* determine the pool name */ elem = nvlist_next_nvpair(snaps, NULL); @@ -344,7 +344,7 @@ lzc_snaprange_space(const char *firstsna nvlist_t *args; nvlist_t *result; int err; - char fs[MAXNAMELEN]; + char fs[ZFS_MAX_DATASET_NAME_LEN]; char *atp; /* determine the fs name */ @@ -409,7 +409,7 @@ lzc_exists(const char *dataset) int lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist) { - char pool[MAXNAMELEN]; + char pool[ZFS_MAX_DATASET_NAME_LEN]; nvlist_t *args; nvpair_t *elem; int error; @@ -456,7 +456,7 @@ lzc_hold(nvlist_t *holds, int cleanup_fd int lzc_release(nvlist_t *holds, nvlist_t **errlist) { - char pool[MAXNAMELEN]; + char pool[ZFS_MAX_DATASET_NAME_LEN]; nvpair_t *elem; /* determine the pool name */ @@ -743,7 +743,7 @@ lzc_bookmark(nvlist_t *bookmarks, nvlist { nvpair_t *elem; int error; - char pool[MAXNAMELEN]; + char pool[ZFS_MAX_DATASET_NAME_LEN]; /* determine the pool name */ elem = nvlist_next_nvpair(bookmarks, NULL); @@ -805,7 +805,7 @@ lzc_destroy_bookmarks(nvlist_t *bmarks, { nvpair_t *elem; int error; - char pool[MAXNAMELEN]; + char pool[ZFS_MAX_DATASET_NAME_LEN]; /* determine the pool name */ elem = nvlist_next_nvpair(bmarks, NULL); Modified: head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc Thu Sep 1 14:58:11 2016 (r305208) +++ head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc Thu Sep 1 15:08:27 2016 (r305209) @@ -82,7 +82,7 @@ struct zpool_handle { libzfs_handle_t *zpool_hdl; zpool_handle_t *zpool_next; - char zpool_name[ZPOOL_MAXNAMELEN]; + char zpool_name[ZFS_MAX_DATASET_NAME_LEN]; int zpool_state; size_t zpool_config_size; nvlist_t *zpool_config; Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c Thu Sep 1 14:58:11 2016 (r305208) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c Thu Sep 1 15:08:27 2016 (r305209) @@ -69,7 +69,7 @@ zfs_component_namecheck(const char *path { const char *loc; - if (strlen(path) >= MAXNAMELEN) { + if (strlen(path) >= ZFS_MAX_DATASET_NAME_LEN) { if (why) *why = NAME_ERR_TOOLONG; return (-1); @@ -140,14 +140,9 @@ dataset_namecheck(const char *path, name /* * Make sure the name is not too long. - * - * ZFS_MAXNAMELEN is the maximum dataset length used in the userland - * which is the same as MAXNAMELEN used in the kernel. - * If ZFS_MAXNAMELEN value is changed, make sure to cleanup all - * places using MAXNAMELEN. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Sep 1 15:10: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 DE94ABCB3DD; Thu, 1 Sep 2016 15:10: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 94B84A10; Thu, 1 Sep 2016 15:10:41 +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 u81FAegU022258; Thu, 1 Sep 2016 15:10:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81FAenk022257; Thu, 1 Sep 2016 15:10:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011510.u81FAenk022257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 15:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305210 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 15:10:42 -0000 Author: mav Date: Thu Sep 1 15:10:40 2016 New Revision: 305210 URL: https://svnweb.freebsd.org/changeset/base/305210 Log: MFV r302661: 7082 bptree_iterate() passes wrong args to zfs_dbgmsg() illumos/illumos-gate@10e67aa0db0823d5464aafdd681f3c966155c68e https://github.com/illumos/illumos-gate/commit/10e67aa0db0823d5464aafdd681f3c966 155c68e https://www.illumos.org/issues/7082 upstream DLPX-40542 bptree_iterate() passes wrong args to zfs_dbgmsg() Reviewed by: Dan Kimmel Reviewed by: George Wilson Reviewed by: Igor Kozhukhov Approved by: Dan McDonald Author: Matthew Ahrens Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Thu Sep 1 15:08:27 2016 (r305209) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Thu Sep 1 15:10:40 2016 (r305210) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -220,9 +220,10 @@ bptree_iterate(objset_t *os, uint64_t ob if (zfs_free_leak_on_eio) flags |= TRAVERSE_HARD; - zfs_dbgmsg("bptree index %d: traversing from min_txg=%lld " + zfs_dbgmsg("bptree index %lld: traversing from min_txg=%lld " "bookmark %lld/%lld/%lld/%lld", - i, (longlong_t)bte.be_birth_txg, + (longlong_t)i, + (longlong_t)bte.be_birth_txg, (longlong_t)bte.be_zb.zb_objset, (longlong_t)bte.be_zb.zb_object, (longlong_t)bte.be_zb.zb_level, From owner-svn-src-head@freebsd.org Thu Sep 1 15: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 75B9FBCB5EF; Thu, 1 Sep 2016 15:17:40 +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 40BA8E3A; Thu, 1 Sep 2016 15:17: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 u81FHdAx026068; Thu, 1 Sep 2016 15:17:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81FHdCG026066; Thu, 1 Sep 2016 15:17:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011517.u81FHdCG026066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 15:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305211 - in head: cddl/contrib/opensolaris/lib/libnvpair sys/cddl/contrib/opensolaris/common/nvpair 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.22 Precedence: list List-Id: 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, 01 Sep 2016 15:17:40 -0000 Author: mav Date: Thu Sep 1 15:17:39 2016 New Revision: 305211 URL: https://svnweb.freebsd.org/changeset/base/305211 Log: MFV r302662: 6447 handful of nvpair cleanups illumos/illumos-gate@759e89be359f2af635e4122d147df56bce948773 https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bc e948773 https://www.illumos.org/issues/6447 I got a patch from someone who uses nvpair code outside of illumos. It fixes a couple of gcc warnings/bugs for him. 1. silence uninitialized use warnings 2. add parentheses around assignment used as truth value 3. fix printf format specifier (ll is for integers only) 4. strstr, strspn, strcspn, and strcmp are declared in string.h, not strings.h. 5. avoid scanning integer into boolean variable Reviewed by: Josef 'Jeff' Sipek Reviewed by: Andy Stormont Reviewed by: Garrett D'Amore Approved by: Robert Mustacchi Author: Steve Dougherty Modified: head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c Thu Sep 1 15:10:40 2016 (r305210) +++ head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c Thu Sep 1 15:17:39 2016 (r305211) @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include "libnvpair.h" @@ -1228,7 +1228,8 @@ nvpair_value_match_regex(nvpair_t *nvp, break; } case DATA_TYPE_BOOLEAN_VALUE: { - boolean_t val, val_arg; + int32_t val_arg; + boolean_t val; /* scanf boolean_t from value and check for match */ sr = sscanf(value, "%"SCNi32, &val_arg); @@ -1239,7 +1240,8 @@ nvpair_value_match_regex(nvpair_t *nvp, break; } case DATA_TYPE_BOOLEAN_ARRAY: { - boolean_t *val_array, val_arg; + boolean_t *val_array; + int32_t val_arg; /* check indexed value of array for match */ sr = sscanf(value, "%"SCNi32, &val_arg); Modified: head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Thu Sep 1 15:10:40 2016 (r305210) +++ head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Thu Sep 1 15:17:39 2016 (r305211) @@ -1629,6 +1629,8 @@ nvlist_lookup_nvpair_ei_sep(nvlist_t *nv if ((nvl == NULL) || (name == NULL)) return (EINVAL); + sepp = NULL; + idx = 0; /* step through components of name */ for (np = name; np && *np; np = sepp) { /* ensure unique names */ @@ -2386,7 +2388,7 @@ nvlist_xpack(nvlist_t *nvl, char **bufp, */ nv_priv_init(&nvpriv, nva, 0); - if (err = nvlist_size(nvl, &alloc_size, encoding)) + if ((err = nvlist_size(nvl, &alloc_size, encoding))) return (err); if ((buf = nv_mem_zalloc(&nvpriv, alloc_size)) == NULL) From owner-svn-src-head@freebsd.org Thu Sep 1 15:23: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 8A36DBCB798; Thu, 1 Sep 2016 15:23:34 +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 3DA7D360; Thu, 1 Sep 2016 15:23:34 +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 u81FNXRR029598; Thu, 1 Sep 2016 15:23:33 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81FNXI3029597; Thu, 1 Sep 2016 15:23:33 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201609011523.u81FNXI3029597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 1 Sep 2016 15:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305212 - head/usr.bin/localedef 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.22 Precedence: list List-Id: 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, 01 Sep 2016 15:23:34 -0000 Author: araujo Date: Thu Sep 1 15:23:33 2016 New Revision: 305212 URL: https://svnweb.freebsd.org/changeset/base/305212 Log: - Invert calloc(3) argument order. MFC after: 4 weeks Modified: head/usr.bin/localedef/collate.c Modified: head/usr.bin/localedef/collate.c ============================================================================== --- head/usr.bin/localedef/collate.c Thu Sep 1 15:17:39 2016 (r305211) +++ head/usr.bin/localedef/collate.c Thu Sep 1 15:23:33 2016 (r305212) @@ -490,7 +490,7 @@ define_collsym(char *name) { collsym_t *sym; - if ((sym = calloc(sizeof (*sym), 1)) == NULL) { + if ((sym = calloc(1, sizeof(*sym))) == NULL) { fprintf(stderr,"out of memory"); return; } @@ -536,7 +536,7 @@ get_collundef(char *name) srch.name = name; if ((ud = RB_FIND(collundefs, &collundefs, &srch)) == NULL) { - if (((ud = calloc(sizeof (*ud), 1)) == NULL) || + if (((ud = calloc(1, sizeof(*ud))) == NULL) || ((ud->name = strdup(name)) == NULL)) { fprintf(stderr,"out of memory"); free(ud); @@ -561,7 +561,7 @@ get_collchar(wchar_t wc, int create) srch.wc = wc; cc = RB_FIND(collchars, &collchars, &srch); if ((cc == NULL) && create) { - if ((cc = calloc(sizeof (*cc), 1)) == NULL) { + if ((cc = calloc(1, sizeof(*cc))) == NULL) { fprintf(stderr, "out of memory"); return (NULL); } @@ -793,7 +793,7 @@ define_collelem(char *name, wchar_t *wcs return; } - if ((e = calloc(sizeof (*e), 1)) == NULL) { + if ((e = calloc(1, sizeof(*e))) == NULL) { fprintf(stderr, "out of memory"); return; } @@ -927,7 +927,7 @@ add_order_subst(void) s = RB_FIND(substs_ref, &substs_ref[curr_weight], &srch); if (s == NULL) { - if ((s = calloc(sizeof (*s), 1)) == NULL) { + if ((s = calloc(1, sizeof(*s))) == NULL) { fprintf(stderr,"out of memory"); return; } @@ -1035,7 +1035,7 @@ add_weight(int32_t ref, int pass) if (RB_FIND(weights, &weights[pass], &srch) != NULL) return; - if ((w = calloc(sizeof (*w), 1)) == NULL) { + if ((w = calloc(1, sizeof(*w))) == NULL) { fprintf(stderr, "out of memory"); return; } From owner-svn-src-head@freebsd.org Thu Sep 1 15: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 AF385BCC198; Thu, 1 Sep 2016 15:57:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 73E69971; Thu, 1 Sep 2016 15:57:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81FviFX041204; Thu, 1 Sep 2016 15:57:44 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Fvib5041202; Thu, 1 Sep 2016 15:57:44 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201609011557.u81Fvib5041202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 1 Sep 2016 15:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305213 - in head/sys: amd64/amd64 i386/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.22 Precedence: list List-Id: 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, 01 Sep 2016 15:57:45 -0000 Author: alc Date: Thu Sep 1 15:57:44 2016 New Revision: 305213 URL: https://svnweb.freebsd.org/changeset/base/305213 Log: As an optimization to the machine-independent layer, change the machine- dependent pmap_ts_referenced() so that it updates the page's dirty field if a modified bit is found while counting reference bits. This opportunistic update can be performed at low cost and can eliminate the need for some future calls to pmap_is_modified() by the machine- independent layer. Reviewed by: kib, markj MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7722 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Sep 1 15:23:33 2016 (r305212) +++ head/sys/amd64/amd64/pmap.c Thu Sep 1 15:57:44 2016 (r305213) @@ -5843,6 +5843,14 @@ safe_to_clear_referenced(pmap_t pmap, pt * should be tested and standardized at some point in the future for * optimal aging of shared pages. * + * As an optimization, update the page's dirty field if a modified bit is + * found while counting reference bits. This opportunistic update can be + * performed at low cost and can eliminate the need for some future calls + * to pmap_is_modified(). However, since this function stops after + * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some + * dirty pages. Those dirty pages will only be detected by a future call + * to pmap_is_modified(). + * * A DI block is not needed within this function, because * invalidations are performed before the PV list lock is * released. @@ -5855,7 +5863,7 @@ pmap_ts_referenced(vm_page_t m) pmap_t pmap; struct rwlock *lock; pd_entry_t oldpde, *pde; - pt_entry_t *pte, PG_A; + pt_entry_t *pte, PG_A, PG_M, PG_RW; vm_offset_t va; vm_paddr_t pa; int cleared, md_gen, not_cleared, pvh_gen; @@ -5890,9 +5898,19 @@ retry: } } PG_A = pmap_accessed_bit(pmap); + PG_M = pmap_modified_bit(pmap); + PG_RW = pmap_rw_bit(pmap); va = pv->pv_va; pde = pmap_pde(pmap, pv->pv_va); oldpde = *pde; + if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) { + /* + * Although "oldpde" is mapping a 2MB page, because + * this function is called at a 4KB page granularity, + * we only update the 4KB page under test. + */ + vm_page_dirty(m); + } if ((*pde & PG_A) != 0) { /* * Since this reference bit is shared by 512 4KB @@ -5986,11 +6004,15 @@ small_mappings: } } PG_A = pmap_accessed_bit(pmap); + PG_M = pmap_modified_bit(pmap); + PG_RW = pmap_rw_bit(pmap); pde = pmap_pde(pmap, pv->pv_va); KASSERT((*pde & PG_PS) == 0, ("pmap_ts_referenced: found a 2mpage in page %p's pv list", m)); pte = pmap_pde_to_pte(pde, pv->pv_va); + if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) + vm_page_dirty(m); if ((*pte & PG_A) != 0) { if (safe_to_clear_referenced(pmap, *pte)) { atomic_clear_long(pte, PG_A); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Sep 1 15:23:33 2016 (r305212) +++ head/sys/i386/i386/pmap.c Thu Sep 1 15:57:44 2016 (r305213) @@ -4798,6 +4798,14 @@ retry: * XXX: The exact number of bits to check and clear is a matter that * should be tested and standardized at some point in the future for * optimal aging of shared pages. + * + * As an optimization, update the page's dirty field if a modified bit is + * found while counting reference bits. This opportunistic update can be + * performed at low cost and can eliminate the need for some future calls + * to pmap_is_modified(). However, since this function stops after + * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some + * dirty pages. Those dirty pages will only be detected by a future call + * to pmap_is_modified(). */ int pmap_ts_referenced(vm_page_t m) @@ -4824,6 +4832,14 @@ pmap_ts_referenced(vm_page_t m) pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pde = pmap_pde(pmap, pv->pv_va); + if ((*pde & (PG_M | PG_RW)) == (PG_M | PG_RW)) { + /* + * Although "*pde" is mapping a 2/4MB page, because + * this function is called at a 4KB page granularity, + * we only update the 4KB page under test. + */ + vm_page_dirty(m); + } if ((*pde & PG_A) != 0) { /* * Since this reference bit is shared by either 1024 @@ -4872,6 +4888,8 @@ small_mappings: ("pmap_ts_referenced: found a 4mpage in page %p's pv list", m)); pte = pmap_pte_quick(pmap, pv->pv_va); + if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW)) + vm_page_dirty(m); if ((*pte & PG_A) != 0) { atomic_clear_int((u_int *)pte, PG_A); pmap_invalidate_page(pmap, pv->pv_va); From owner-svn-src-head@freebsd.org Thu Sep 1 16:54: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 9744FBCCC68; Thu, 1 Sep 2016 16:54:53 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 593BB6EA; Thu, 1 Sep 2016 16:54:53 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 1BC385A9F27; Thu, 1 Sep 2016 16:54:46 +0000 (UTC) Date: Thu, 1 Sep 2016 16:54:46 +0000 From: Brooks Davis To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305170 - head/lib/atf/libatf-c Message-ID: <20160901165446.GE29873@spindle.one-eyed-alien.net> References: <201609010242.u812gBkP037525@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mSxgbZZZvrAyzONB" Content-Disposition: inline In-Reply-To: <201609010242.u812gBkP037525@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 16:54:53 -0000 --mSxgbZZZvrAyzONB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 01, 2016 at 02:42:11AM +0000, Ngie Cooper wrote: > Author: ngie > Date: Thu Sep 1 02:42:11 2016 > New Revision: 305170 > URL: https://svnweb.freebsd.org/changeset/base/305170 >=20 > Log: > Don't bake all of CC/CPP/CXX into CFLAGS > =20 > Capture executable names for CC, CPP, CXX (assumed to be the > first non-CCACHE_BIN word). > =20 > This change strips out all of the cross-compiler arguments, (-target, > -B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it > doesn't infect the build and subsequently the test. > =20 > Add comments noting why this logic is being added, and why the logic in > r305041 was necessary/what it was trying to achieve. > =20 > This is required after recent changes made to the toolchain to always > specify --sysroot, -target, -B, etc with clang in buildworld (presumably > r304681). > =20 > Reviewed by: rodrigc (earlier version) > Reported by: Jenkins (FreeBSD_HEAD job from 559+) > MFC after: 12 days > X-MFC with: r304681, r305041 > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7732 >=20 > Modified: > head/lib/atf/libatf-c/Makefile >=20 > Modified: head/lib/atf/libatf-c/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/atf/libatf-c/Makefile Thu Sep 1 02:05:46 2016 (r305169) > +++ head/lib/atf/libatf-c/Makefile Thu Sep 1 02:42:11 2016 (r305170) > @@ -28,6 +28,18 @@ > .include > .include > =20 > +# Store the toolchain executable in ATF_BUILD_{CC,CPP,CXX} to ensure oth= er > +# values -- like -target, -B ..., etc -- don't get leaked into the tests. > +# > +# Be sure to omit ${CCACHE_BIN} (if specified) from the variable as it g= ets > +# automatically appended to the variables in bsd.compiler.mk when > +# ${MK_CCACHE_BUILD} !=3D no. > +ATF_BUILD_CC:=3D ${CC:N${CCACHE_BIN}:[1]} > +ATF_BUILD_CPP:=3D ${CPP:N${CCACHE_BIN}:[1]} > +ATF_BUILD_CXX:=3D ${CXX:N${CCACHE_BIN}:[1]} > + > +# Only capture defines, includes, linker flags, optimization levels, war= nings > +# and preprocessor flags when building ATF_BUILD_{C,CPP,CXX}FLAGS. > ATF_BUILD_CFLAGS:=3D ${CFLAGS:M-[DILOWf]*} > ATF_BUILD_CPPFLAGS:=3D ${CPPFLAGS:M-[DILOWf]*} > ATF_BUILD_CXXFLAGS:=3D ${CXXFLAGS:M-[DILOWf]*} > @@ -41,11 +53,11 @@ ATF=3D ${SRCTOP}/contrib/atf > .PATH: ${ATF}/atf-c > .PATH: ${ATF}/atf-c/detail > =20 > -CFLAGS+=3D -DATF_BUILD_CC=3D'"${CC}"' > +CFLAGS+=3D -DATF_BUILD_CC=3D'"${ATF_BUILD_CC}"' > CFLAGS+=3D -DATF_BUILD_CFLAGS=3D'"${ATF_BUILD_CFLAGS}"' > -CFLAGS+=3D -DATF_BUILD_CPP=3D'"${CPP}"' > +CFLAGS+=3D -DATF_BUILD_CPP=3D'"${ATF_BUILD_CPP}"' > CFLAGS+=3D -DATF_BUILD_CPPFLAGS=3D'"${ATF_BUILD_CPPFLAGS}"' > -CFLAGS+=3D -DATF_BUILD_CXX=3D'"${CXX}"' > +CFLAGS+=3D -DATF_BUILD_CXX=3D'"${ATF_BUILD_CXX}"' > CFLAGS+=3D -DATF_BUILD_CXXFLAGS=3D'"${ATF_BUILD_CXXFLAGS}"' > CFLAGS+=3D -I${ATF} > CFLAGS+=3D -I${.CURDIR} >=20 Are these the variables used to control the tests that try to compile things? I've run into to some problems with them on CheriBSD because the external compiler isn't available on the test target, but isn't listed as a dependency. These tests should declare a dependency on CC, etc as appropriate and be skipped if it isn't there. I'm not actually convinced this shouldn't just use cc, cpp, and c++. (That would be wrong for CheriBSD, but closer to right for current cases in FreeBSD). -- Brooks --mSxgbZZZvrAyzONB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJXyF1VAAoJEKzQXbSebgfAnkgH/36zFJ20O8GhTr4Skl9giZI3 a2/kix/8+ogCWuDhBaU4zTAF2Pg2Dqk5fRac/Y9SdOO0pbHX0B3nh90xRTfVOPzI mlbWQQtkOWVpgi0rxaK0MYzQnd+RYEuDKeruP2OvUkn7mzzuIFyJOLkdVhj56ZSL PtX8uHkCTEQGGocBH0jeD6rzFyAMkwFp2Q1koZ+Y2Q8hZKXijpOEUTxc9j08Zdgf 4aAO5HF4stFyLY/SuL/oZjWs8ZKYODBtGIvdHdyi0ZuCxKu22x8W9lWuACj1+jAk YwraEqLnNho/3B8n68md1HIm/9spdFqW4kTEog7/ux0hgeYp8AGkOYYzsX/R7H8= =pRbJ -----END PGP SIGNATURE----- --mSxgbZZZvrAyzONB-- From owner-svn-src-head@freebsd.org Thu Sep 1 17:05: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 5704ABCB461; Thu, 1 Sep 2016 17:05:55 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 28504319; Thu, 1 Sep 2016 17:05:55 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81H5sYD067728; Thu, 1 Sep 2016 17:05:54 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81H5s3w067727; Thu, 1 Sep 2016 17:05:54 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201609011705.u81H5s3w067727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Thu, 1 Sep 2016 17:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305215 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 17:05:55 -0000 Author: maxim Date: Thu Sep 1 17:05:54 2016 New Revision: 305215 URL: https://svnweb.freebsd.org/changeset/base/305215 Log: OpenBSD 6.0 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Thu Sep 1 16:09:09 2016 (r305214) +++ head/share/misc/bsd-family-tree Thu Sep 1 17:05:54 2016 (r305215) @@ -339,7 +339,7 @@ FreeBSD 5.2 | | | FreeBSD | | OpenBSD 5.9 | | 10.3 | | | | | | | | DragonFly 4.6.0 - *--FreeBSD | | | | + *--FreeBSD | | OpenBSD 6.0 | | 11.0 | | | | | | | | | | | | | | @@ -692,6 +692,7 @@ DragonFly 4.4.1 2015-12-07 [DFB] OpenBSD 5.9 2016-03-29 [OBD] FreeBSD 10.3 2016-04-04 [FBD] DragonFly 4.6.0 2016-08-02 [DFB] +OpenBSD 6.0 2016-09-01 [OBD] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Thu Sep 1 17:36: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 C7399BC90C6; Thu, 1 Sep 2016 17:36:53 +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 7D65CB2C; Thu, 1 Sep 2016 17:36:53 +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 u81HaqUP078827; Thu, 1 Sep 2016 17:36:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Haq4q078826; Thu, 1 Sep 2016 17:36:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609011736.u81Haq4q078826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Sep 2016 17:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305216 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 17:36:53 -0000 Author: bdrewery Date: Thu Sep 1 17:36:52 2016 New Revision: 305216 URL: https://svnweb.freebsd.org/changeset/base/305216 Log: FAST_DEPEND/META_MODE: Fix several issues with SRCS containing '/'. - For FAST_DEPEND, properly apply the -M flags when compiling by enduring that the condition also has the s,/,_,g filter applied to it first. - For FAST_DEPEND, properly read from the filtered filename. - For META_MODE, it needs to read from a full-pathed and s,/,_,g replaced filename based on bmake's meta_name() function which names the .meta file for SRCS with '/' in them. This support has not been extended to the kernel build yet but may be in the future. MFC after: 2 weeks Reported by: dim 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 Sep 1 17:05:54 2016 (r305215) +++ head/share/mk/bsd.dep.mk Thu Sep 1 17:36:52 2016 (r305216) @@ -181,7 +181,7 @@ DEPEND_CFLAGS+= -MT${.TARGET} .if defined(.PARSEDIR) # Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS # as those are the only ones we will include. -DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:M${.TARGET:${DEPEND_FILTER}}}" != "" +DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:${DEPEND_FILTER}:M${.TARGET:${DEPEND_FILTER}}}" != "" CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} .else CFLAGS+= ${DEPEND_CFLAGS} @@ -216,8 +216,17 @@ afterdepend: beforedepend # For meta+filemon the .meta file is checked for since it is the dependency # file used. .for __obj in ${DEPENDOBJS:O:u} -.if (defined(_meta_filemon) && !exists(${.OBJDIR}/${__obj}.meta)) || \ - (!defined(_meta_filemon) && !exists(${.OBJDIR}/${DEPENDFILE}.${__obj})) +# If the obj has any '/', then replace with '_'. For meta files, this is +# mimicing what bmake's meta_name() does and adding in the full path +# as well to ensure that the expected meta file is read. +.if ${__obj:M*/*} +_meta_obj= ${.OBJDIR:C,/,_,g}_${__obj:C,/,_,g}.meta +.else +_meta_obj= ${__obj}.meta +.endif +_dep_obj= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} +.if (defined(_meta_filemon) && !exists(${.OBJDIR}/${_meta_obj})) || \ + (!defined(_meta_filemon) && !exists(${.OBJDIR}/${_dep_obj})) ${__obj}: ${OBJS_DEPEND_GUESS} ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .elif defined(_meta_filemon) From owner-svn-src-head@freebsd.org Thu Sep 1 18:11: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 CAC87BCB317; Thu, 1 Sep 2016 18:11:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B570D88; Thu, 1 Sep 2016 18:11:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81IBiYi091825; Thu, 1 Sep 2016 18:11:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81IBiDe091824; Thu, 1 Sep 2016 18:11:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609011811.u81IBiDe091824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Sep 2016 18:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305218 - head/contrib/llvm/lib/Target/AArch64 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.22 Precedence: list List-Id: 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, 01 Sep 2016 18:11:45 -0000 Author: dim Date: Thu Sep 1 18:11:44 2016 New Revision: 305218 URL: https://svnweb.freebsd.org/changeset/base/305218 Log: Pull in r277331 from upstream llvm trunk (by Diana Picus): [AArch64] Return the correct size for TLSDESC_CALLSEQ The branch relaxation pass is computing the wrong offsets because it assumes TLSDESC_CALLSEQ eats up 4 bytes, when in fact it is lowered to an instruction sequence taking up 16 bytes. This can become a problem in huge files with lots of TLS accesses, as it may slowly move branch targets out of the range computed by the branch relaxation pass. Fixes PR24234 https://llvm.org/bugs/show_bug.cgi?id=24234 Differential Revision: https://reviews.llvm.org/D22870 This fixes "error in backend: fixup value out of range" when compiling the misc/talkfilters port for AArch64. Reported by: sbruno PR: 201762 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp Modified: head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp Thu Sep 1 18:03:34 2016 (r305217) +++ head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp Thu Sep 1 18:11:44 2016 (r305218) @@ -52,6 +52,9 @@ unsigned AArch64InstrInfo::GetInstSizeIn case TargetOpcode::IMPLICIT_DEF: case TargetOpcode::KILL: return 0; + case AArch64::TLSDESC_CALLSEQ: + // This gets lowered to an instruction sequence which takes 16 bytes + return 16; } llvm_unreachable("GetInstSizeInBytes()- Unable to determin insn size"); From owner-svn-src-head@freebsd.org Thu Sep 1 18:12: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 56CB7BCB4E7; Thu, 1 Sep 2016 18:12:54 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2012BFAE; Thu, 1 Sep 2016 18:12:54 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81ICrCD093948; Thu, 1 Sep 2016 18:12:53 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81ICrwZ093947; Thu, 1 Sep 2016 18:12:53 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609011812.u81ICrwZ093947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 1 Sep 2016 18:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305219 - head/lib/libc/stdio 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.22 Precedence: list List-Id: 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, 01 Sep 2016 18:12:54 -0000 Author: ache Date: Thu Sep 1 18:12:53 2016 New Revision: 305219 URL: https://svnweb.freebsd.org/changeset/base/305219 Log: If error happens, don't overwrite original errno comes from __mbrtowc() and __srefill(). MFC after: 3 days Modified: head/lib/libc/stdio/fgetwc.c Modified: head/lib/libc/stdio/fgetwc.c ============================================================================== --- head/lib/libc/stdio/fgetwc.c Thu Sep 1 18:11:44 2016 (r305218) +++ head/lib/libc/stdio/fgetwc.c Thu Sep 1 18:12:53 2016 (r305219) @@ -84,9 +84,10 @@ __fgetwc_mbs(FILE *fp, mbstate_t *mbs, i return (WEOF); do { nconv = l->__mbrtowc(&wc, fp->_p, fp->_r, mbs); - if (nconv == (size_t)-1) - break; - else if (nconv == (size_t)-2) + if (nconv == (size_t)-1) { + fp->_flags |= __SERR; + return (WEOF); + } else if (nconv == (size_t)-2) continue; else if (nconv == 0) { fp->_p++; @@ -100,7 +101,9 @@ __fgetwc_mbs(FILE *fp, mbstate_t *mbs, i return (wc); } } while (__srefill(fp) == 0); - fp->_flags |= __SERR; - errno = EILSEQ; + if (__sfeof(fp)) { + fp->_flags |= __SERR; + errno = EILSEQ; + } return (WEOF); } From owner-svn-src-head@freebsd.org Thu Sep 1 18:25: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 6F110BCB8E1; Thu, 1 Sep 2016 18:25: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 41A259ED; Thu, 1 Sep 2016 18:25: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 u81IPnRk097935; Thu, 1 Sep 2016 18:25:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81IPnlO097934; Thu, 1 Sep 2016 18:25:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011825.u81IPnlO097934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 18:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305221 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 18:25:50 -0000 Author: mav Date: Thu Sep 1 18:25:49 2016 New Revision: 305221 URL: https://svnweb.freebsd.org/changeset/base/305221 Log: MFV r302992: 7071 lzc_snapshot does not fill in errlist on ENOENT illumos/illumos-gate@25f7d993adbfb3452ac4625b3791670746d35ae3 https://github.com/illumos/illumos-gate/commit/25f7d993adbfb3452ac4625b379167074 6d35ae3 https://www.illumos.org/issues/7071 upstream DLPX-40482 lzc_snapshot does not fill in errlist on ENOENT Reviewed by: Igor Kozhukhov Reviewed by: George Wilson Reviewed by: Dan Kimmel Approved by: Robert Mustacchi Author: Matthew Ahrens 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 Thu Sep 1 18:16:45 2016 (r305220) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Sep 1 18:25:49 2016 (r305221) @@ -500,6 +500,14 @@ zfs_secpolicy_write_perms(const char *na dsl_dataset_t *ds; dsl_pool_t *dp; + /* + * First do a quick check for root in the global zone, which + * is allowed to do all write_perms. This ensures that zfs_ioc_* + * will get to handle nonexistent datasets. + */ + if (INGLOBALZONE(curthread) && secpolicy_zfs(cr) == 0) + return (0); + error = dsl_pool_hold(name, FTAG, &dp); if (error != 0) return (error); From owner-svn-src-head@freebsd.org Thu Sep 1 18:33: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 23EB8BCBB8A; Thu, 1 Sep 2016 18:33: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 F2EFEEF9; Thu, 1 Sep 2016 18:33: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 u81IXefJ001665; Thu, 1 Sep 2016 18:33:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81IXdxi001661; Thu, 1 Sep 2016 18:33:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011833.u81IXdxi001661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 18:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305222 - in head/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs 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.22 Precedence: list List-Id: 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, 01 Sep 2016 18:33:41 -0000 Author: mav Date: Thu Sep 1 18:33:39 2016 New Revision: 305222 URL: https://svnweb.freebsd.org/changeset/base/305222 Log: MFV r302993: 7104 increase indirect block size illumos/illumos-gate@4b5c8e93cab28d3c65ba9d407fd8f46e3be1db1c https://github.com/illumos/illumos-gate/commit/4b5c8e93cab28d3c65ba9d407fd8f46e3 be1db1c https://www.illumos.org/issues/7104 The current default indirect block size is 16KB. We can improve performance by increasing it to 128KB. This is especially helpful for any workload that needs to read most of the metadata, e.g. scrub/resilver, file deletion, filesystem deletion, and zfs send. We also need to fix a few space estimation errors to make the tests pass. Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Dan McDonald Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h 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 Thu Sep 1 18:25:49 2016 (r305221) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Sep 1 18:33:39 2016 (r305222) @@ -791,11 +791,17 @@ dmu_objset_create_impl(spa_t *spa, dsl_d /* * Determine the number of levels necessary for the meta-dnode - * to contain DN_MAX_OBJECT dnodes. + * to contain DN_MAX_OBJECT dnodes. Note that in order to + * ensure that we do not overflow 64 bits, there has to be + * a nlevels that gives us a number of blocks > DN_MAX_OBJECT + * but < 2^64. Therefore, + * (mdn->dn_indblkshift - SPA_BLKPTRSHIFT) (10) must be + * less than (64 - log2(DN_MAX_OBJECT)) (16). */ - while ((uint64_t)mdn->dn_nblkptr << (mdn->dn_datablkshift + + while ((uint64_t)mdn->dn_nblkptr << + (mdn->dn_datablkshift - DNODE_SHIFT + (levels - 1) * (mdn->dn_indblkshift - SPA_BLKPTRSHIFT)) < - DN_MAX_OBJECT * sizeof (dnode_phys_t)) + DN_MAX_OBJECT) levels++; mdn->dn_next_nlevels[tx->tx_txg & TXG_MASK] = 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 Thu Sep 1 18:25:49 2016 (r305221) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 1 18:33:39 2016 (r305222) @@ -411,12 +411,20 @@ zfs_deadman_init() * it is possible to run the pool completely out of space, causing it to * be permanently read-only. * + * Note that on very small pools, the slop space will be larger than + * 3.2%, in an effort to have it be at least spa_min_slop (128MB), + * but we never allow it to be more than half the pool size. + * * See also the comments in zfs_space_check_t. */ int spa_slop_shift = 5; SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_slop_shift, CTLFLAG_RWTUN, &spa_slop_shift, 0, "Shift value of reserved space (1/(2^spa_slop_shift))."); +uint64_t spa_min_slop = 128 * 1024 * 1024; +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, spa_min_slop, CTLFLAG_RWTUN, + &spa_min_slop, 0, + "Minimal value of reserved space"); /* * ========================================================================== @@ -1723,14 +1731,16 @@ spa_get_asize(spa_t *spa, uint64_t lsize /* * Return the amount of slop space in bytes. It is 1/32 of the pool (3.2%), - * or at least 32MB. + * or at least 128MB, unless that would cause it to be more than half the + * pool size. * * See the comment above spa_slop_shift for details. */ uint64_t -spa_get_slop_space(spa_t *spa) { +spa_get_slop_space(spa_t *spa) +{ uint64_t space = spa_get_dspace(spa); - return (MAX(space >> spa_slop_shift, SPA_MINDEVSIZE >> 1)); + return (MAX(space >> spa_slop_shift, MIN(space >> 1, spa_min_slop))); } uint64_t Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Thu Sep 1 18:25:49 2016 (r305221) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Thu Sep 1 18:33:39 2016 (r305222) @@ -58,7 +58,7 @@ extern "C" { */ #define DNODE_SHIFT 9 /* 512 bytes */ #define DN_MIN_INDBLKSHIFT 12 /* 4k */ -#define DN_MAX_INDBLKSHIFT 14 /* 16k */ +#define DN_MAX_INDBLKSHIFT 17 /* 128k */ #define DNODE_BLOCK_SHIFT 14 /* 16k */ #define DNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ #define DN_MAX_OBJECT_SHIFT 48 /* 256 trillion (zfs_fid_t limit) */ @@ -88,6 +88,11 @@ extern "C" { #define DNODES_PER_BLOCK_SHIFT (DNODE_BLOCK_SHIFT - DNODE_SHIFT) #define DNODES_PER_BLOCK (1ULL << DNODES_PER_BLOCK_SHIFT) + +/* + * This is inaccurate if the indblkshift of the particular object is not the + * max. But it's only used by userland to calculate the zvol reservation. + */ #define DNODES_PER_LEVEL_SHIFT (DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT) #define DNODES_PER_LEVEL (1ULL << DNODES_PER_LEVEL_SHIFT) Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Sep 1 18:25:49 2016 (r305221) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Sep 1 18:33:39 2016 (r305222) @@ -610,6 +610,8 @@ typedef struct zpool_rewind_policy { /* * This is needed in userland to report the minimum necessary device size. + * + * Note that the zfs test suite uses 64MB vdevs. */ #define SPA_MINDEVSIZE (64ULL << 20) From owner-svn-src-head@freebsd.org Thu Sep 1 18:37: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 C1079BCBC3D; Thu, 1 Sep 2016 18:37:12 +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 850F322B; Thu, 1 Sep 2016 18:37:12 +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 u81IbBh6001889; Thu, 1 Sep 2016 18:37:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81IbBPL001888; Thu, 1 Sep 2016 18:37:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609011837.u81IbBPL001888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Sep 2016 18:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305224 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 18:37:12 -0000 Author: mav Date: Thu Sep 1 18:37:11 2016 New Revision: 305224 URL: https://svnweb.freebsd.org/changeset/base/305224 Log: MFV r304158: 7136 ESC_VDEV_REMOVE_AUX ought to always include vdev information 7115 6922 generates ESC_ZFS_VDEV_REMOVE_AUX a bit too often illumos/illumos-gate@b72b6bb10ad55121a1b352c6f68ebdc8e20c9086 https://github.com/illumos/illumos-gate/commit/b72b6bb10ad55121a1b352c6f68ebdc8e 20c9086 https://www.illumos.org/issues/7136 6922 added ESC_ZFS_VDEV_REMOVE_AUX and ESC_ZFS_VDEV_REMOVE_DEV sysevents whenever an aux device gets removed from a pool. However, those sysevents will be created without the vdev_guid and vdev_path fields. It would be better to always populate those fields. https://www.illumos.org/issues/7115 The addition of spa_event_notify in vdev removal code (see #6922) causes event s to be generated even if the spare failed to be removed with EBUSY. Reviewed by: George Wilson Reviewed by: Josef 'Jeff' Sipek Approved by: Robert Mustacchi Author: Alan Somers Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.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 Thu Sep 1 18:35:37 2016 (r305223) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Sep 1 18:37:11 2016 (r305224) @@ -151,6 +151,8 @@ const zio_taskq_info_t zio_taskqs[ZIO_TY { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* IOCTL */ }; +static sysevent_t *spa_event_create(spa_t *spa, vdev_t *vd, const char *name); +static void spa_event_post(sysevent_t *ev); static void spa_sync_version(void *arg, dmu_tx_t *tx); static void spa_sync_props(void *arg, dmu_tx_t *tx); static boolean_t spa_has_active_shared_spare(spa_t *spa); @@ -5738,6 +5740,7 @@ int spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare) { vdev_t *vd; + sysevent_t *ev = NULL; metaslab_group_t *mg; nvlist_t **spares, **l2cache, *nv; uint64_t txg = 0; @@ -5761,6 +5764,9 @@ spa_vdev_remove(spa_t *spa, uint64_t gui * in this pool. */ if (vd == NULL || unspare) { + if (vd == NULL) + vd = spa_lookup_by_guid(spa, guid, B_TRUE); + ev = spa_event_create(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); spa_vdev_remove_aux(spa->spa_spares.sav_config, ZPOOL_CONFIG_SPARES, spares, nspares, nv); spa_load_spares(spa); @@ -5768,7 +5774,6 @@ spa_vdev_remove(spa_t *spa, uint64_t gui } else { error = SET_ERROR(EBUSY); } - spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); } else if (spa->spa_l2cache.sav_vdevs != NULL && nvlist_lookup_nvlist_array(spa->spa_l2cache.sav_config, ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0 && @@ -5776,11 +5781,12 @@ spa_vdev_remove(spa_t *spa, uint64_t gui /* * Cache devices can always be removed. */ + vd = spa_lookup_by_guid(spa, guid, B_TRUE); + ev = spa_event_create(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); spa_vdev_remove_aux(spa->spa_l2cache.sav_config, ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache, nv); spa_load_l2cache(spa); spa->spa_l2cache.sav_sync = B_TRUE; - spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); } else if (vd != NULL && vd->vdev_islog) { ASSERT(!locked); ASSERT(vd == vd->vdev_top); @@ -5817,9 +5823,9 @@ spa_vdev_remove(spa_t *spa, uint64_t gui /* * Clean up the vdev namespace. */ + ev = spa_event_create(spa, vd, ESC_ZFS_VDEV_REMOVE_DEV); spa_vdev_remove_from_namespace(spa, vd); - spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_DEV); } else if (vd != NULL) { /* * Normal vdevs cannot be removed (yet). @@ -5835,6 +5841,9 @@ spa_vdev_remove(spa_t *spa, uint64_t gui if (!locked) error = spa_vdev_exit(spa, NULL, txg, error); + if (ev) + spa_event_post(ev); + return (error); } @@ -7229,24 +7238,17 @@ spa_has_active_shared_spare(spa_t *spa) return (B_FALSE); } -/* - * Post a sysevent corresponding to the given event. The 'name' must be one of - * the event definitions in sys/sysevent/eventdefs.h. The payload will be - * filled in from the spa and (optionally) the vdev. This doesn't do anything - * in the userland libzpool, as we don't want consumers to misinterpret ztest - * or zdb as real changes. - */ -void -spa_event_notify(spa_t *spa, vdev_t *vd, const char *name) +static sysevent_t * +spa_event_create(spa_t *spa, vdev_t *vd, const char *name) { + sysevent_t *ev = NULL; #ifdef _KERNEL - sysevent_t *ev; sysevent_attr_list_t *attr = NULL; sysevent_value_t value; - sysevent_id_t eid; ev = sysevent_alloc(EC_ZFS, (char *)name, SUNW_KERN_PUB "zfs", SE_SLEEP); + ASSERT(ev != NULL); value.value_type = SE_DATA_TYPE_STRING; value.value.sv_string = spa_name(spa); @@ -7278,11 +7280,34 @@ spa_event_notify(spa_t *spa, vdev_t *vd, goto done; attr = NULL; - (void) log_sysevent(ev, SE_SLEEP, &eid); - done: if (attr) sysevent_free_attr(attr); + +#endif + return (ev); +} + +static void +spa_event_post(sysevent_t *ev) +{ +#ifdef _KERNEL + sysevent_id_t eid; + + (void) log_sysevent(ev, SE_SLEEP, &eid); sysevent_free(ev); #endif } + +/* + * Post a sysevent corresponding to the given event. The 'name' must be one of + * the event definitions in sys/sysevent/eventdefs.h. The payload will be + * filled in from the spa and (optionally) the vdev. This doesn't do anything + * in the userland libzpool, as we don't want consumers to misinterpret ztest + * or zdb as real changes. + */ +void +spa_event_notify(spa_t *spa, vdev_t *vd, const char *name) +{ + spa_event_post(spa_event_create(spa, vd, name)); +} From owner-svn-src-head@freebsd.org Thu Sep 1 18:41: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 74462BCBF9B; Thu, 1 Sep 2016 18:41:02 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-vk0-x229.google.com (mail-vk0-x229.google.com [IPv6:2607:f8b0:400c:c05::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 2BD668CA; Thu, 1 Sep 2016 18:41:02 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-vk0-x229.google.com with SMTP id v189so3395138vkv.1; Thu, 01 Sep 2016 11:41:02 -0700 (PDT) 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; bh=lENKJuKEg2AoqycLTnrYUgcfWeRiMkcBCJcRcmud3EM=; b=otMfT049dwXfS8kg91sYWDpAmg3G1ZfRg+czu/96+K7ZwpX8UiLOdXdLbF9L7NRAOd +MpZDMPVADy3aBdynhO1wv0eE3oUOwJ+8M1Sy4nfHrimWwf9YCTU1YAvOuTZY6xbD3g5 lxmfBMLbXzLriEjpKdh5cBmNQ92U9wvhveDBDSL1xwEWs+6EZqRqujxmshWaLzs1SdBz mYWdf6mfg5DK3jPpPVjIZz6AZIMP1zCnOOsqwo+NZ9qH0xsWomPQ5EYcUFxhRewiBL7z q4e6hS+/iWWQkZZAdBPErcYs5ojF1Mu5HWKzeyuw1xb18j36Lhze787FvWLbZgWEOL6p cWTQ== 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; bh=lENKJuKEg2AoqycLTnrYUgcfWeRiMkcBCJcRcmud3EM=; b=bmrY0tnwoy6WLjS1muxD5wzzekq30sYxMGGXwqYLIVrGidrWHQ4ZeqCX1Fx+YE2dQL VZ6EICXHRf1vOu9wTkInTvf+LMrr+9bDaaFMjwlzlirJu6BrUrWdo/TGE/p53xSzwOUz crBcHEVw/WvTU9nTwDIkPBIhOM8eVGxnYlMWHthRW25UatejJ0zCP8gbNId4fhLsYkKU Tec0Sg8wF8glL7l8Zx18DV5BJ+cJ43CMLmnLOQL4ZFbwTNJ/ifwq72aLALPRLgckqkvV BkfayWm0ndphtexMX9zt2sw8ElhnM+1ISwjXGoQ4yM+kSNs79TaFT1sqF1Wf1humef5G gcSQ== X-Gm-Message-State: AE9vXwMTEkcnWLkhm1cH7Ztj8Wlv+lyGZGSPozNPZM6fwHVEQsWAqr5ePlU2pQVEUV3ZaEnFZ2aR3PCve0uEoA== X-Received: by 10.31.99.67 with SMTP id x64mr10626739vkb.76.1472755261209; Thu, 01 Sep 2016 11:41:01 -0700 (PDT) MIME-Version: 1.0 Sender: crodr001@gmail.com Received: by 10.103.31.134 with HTTP; Thu, 1 Sep 2016 11:41:00 -0700 (PDT) In-Reply-To: <20160901165446.GE29873@spindle.one-eyed-alien.net> References: <201609010242.u812gBkP037525@repo.freebsd.org> <20160901165446.GE29873@spindle.one-eyed-alien.net> From: Craig Rodrigues Date: Thu, 1 Sep 2016 11:41:00 -0700 X-Google-Sender-Auth: dmeeq-xPx-EJecm79Eay-n1lIlo Message-ID: Subject: Re: svn commit: r305170 - head/lib/atf/libatf-c To: Brooks Davis Cc: Ngie Cooper , "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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 18:41:02 -0000 On Thursday, September 1, 2016, Brooks Davis wrote: > > > Are these the variables used to control the tests that try to compile > things? > > > You need to carefully read the source code for this particular test to understand what is going on. This test compiles a binary, and then the test runs "strings" against the binary and expects a certain output. The compiler flags make a difference for this test. -- Craig From owner-svn-src-head@freebsd.org Thu Sep 1 18:43: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 EA021BCC045; Thu, 1 Sep 2016 18:43:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::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 AF85FC67; Thu, 1 Sep 2016 18:43:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id fi15so32267247pac.1; Thu, 01 Sep 2016 11:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=sGELHQI9dYxS9dRuu+JRvQBWGy32OjqIfmYqLFnVO1M=; b=bRm9FbaQRA5O9+n8DHOKp84cL9Kk9aHVTk64naaD3A/B0cZnWD7S4a64tZ8KXiOACT 5Mt+mAKkP22a2YwQLwG77e3cHYUugGjVxokIgJXb28s7aHkBHhvIiOBrvaXKiyweEGGn qv/6TvqyFjAGEhwteuL1tGdB2flptzWsI4Iy8JZ1O0GiSjxMqEbllBrwiDI1sTOAPJUo DqeAXGPQrZicILDlCG4OgwmUmXHfWLnuth6b7T7zDx9Ywcjx8Iwen/m8M3L+U/6ONAyL EeLBriEP3V3eGfIfr4irzBCGuOW9IOQ5pbcsdU8bwEksTIF8uv2BAnZqfm9IhufcMPFr veGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=sGELHQI9dYxS9dRuu+JRvQBWGy32OjqIfmYqLFnVO1M=; b=isp7gtA/nZSVJWUeo6iu0Ux4IvAMAWI7VG9ij5UEp9co4lzWX07bls4HdbTbFn87wn Q34P78RhLCutepjcp01xQ+lXu0S1Rh9+Hhk6XjeDqSGwXHMsU3yGOFsQdJ5dYBrjsXSJ 8LB/kUXXavkNf8KtHqDPFUbSDMbchKWNX57MLfNpDh36so9Hd5gMExRieAuo0AI6E2kH UFYJ/V4I8pUgyzcVbZa1fvZV9S8cRkNtaSPoLaF/jRfQvhdX53aalvqShP0C26UHJ7UV a0NCS2+vuOReN+rZM0Ifs16ws84h91wtFIP6lprbGBJ4MrzSouM/TjlndNZRMoU/G1lB TUeg== X-Gm-Message-State: AE9vXwPM6VfzdLut370+p4/VVgNHiOuFkuAxSKnzOI5wxtkosggYSAx6ZpzDAeA477okaQ== X-Received: by 10.66.74.100 with SMTP id s4mr29572081pav.114.1472755431010; Thu, 01 Sep 2016 11:43:51 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id xx7sm9418325pac.3.2016.09.01.11.43.49 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 11:43:49 -0700 (PDT) Subject: Re: svn commit: r305170 - head/lib/atf/libatf-c Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F7959245-FED9-4E91-BA05-AD2CC9E7A40C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20160901165446.GE29873@spindle.one-eyed-alien.net> Date: Thu, 1 Sep 2016 11:43:48 -0700 Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <7204E623-223E-40FB-BED5-50A59A7622E1@gmail.com> References: <201609010242.u812gBkP037525@repo.freebsd.org> <20160901165446.GE29873@spindle.one-eyed-alien.net> To: Brooks Davis X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 18:43:52 -0000 --Apple-Mail=_F7959245-FED9-4E91-BA05-AD2CC9E7A40C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 1, 2016, at 09:54, Brooks Davis wrote: ... > Are these the variables used to control the tests that try to compile > things? Yes. > I've run into to some problems with them on CheriBSD because the > external compiler isn't available on the test target, but isn't listed > as a dependency. These tests should declare a dependency on CC, etc > as appropriate and be skipped if it isn't there. I'm not actually > convinced this shouldn't just use cc, cpp, and c++. (That would be > wrong for CheriBSD, but closer to right for current cases in FreeBSD). Agreed. I=E2=80=99ll add the necessary required.progs metadata soon. Thanks! -Ngie --Apple-Mail=_F7959245-FED9-4E91-BA05-AD2CC9E7A40C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXyHblAAoJEPWDqSZpMIYV5ewQANBilLnFncluV4ltaAAKdyOK 30ZWukmrCMRD7wfeSVJronGPirQLDXTK4GG/F7bylyK4AWcpzv3ZG8nJbW0JXQqJ CQiOfBqwLcPGYU9HvRVBiGs+Qh1KiyLhXvEBg74dpkWXv4eT8cFF2UGGntz0npQm V7hGsFK0f++MY4r5QSzCl3JKvbDnZ0dzoN/ZHeKL8Ou5PBwfWnFqqS7RyPf/ng90 BlrcCogoKQYYH1G96c3HsP1MhU7KczNKLGYgJm5bb1rIFoNYzaiVIGKR75xDGopV gHjqYZlSn4uwYO1MOA/Dyj0WmuSZJ6r3cRF+NT7EL2MV6zDUVCO5rt9pc7Yiy0Zj vMkXB1gGt7CJgIqSvO+WLNMwk/V/JYRqooTaQ+WWtQ1dl0DfL+OZcPJXJmrip+Xi iXSb6MJWvQx2xhuV2WJcQojzB4h136qzNhG6VxrMaYVRjYFQGu8ihWgnuZe8bZuc XcJp6SwjbAWlXOWU9fsM3mlwJZG7T5VGZHfk5jRwn9Tdx8Hp2pQqLlSp8EH43Tep RVqC2o24hT0k9F+LoCUcZIF2afct2+sAzZUAdf5tVNxpo6dAi7aOGuhiTMiz+oTW IpnftsCGLRJB5yIBFGwehkkrbeinYjpRpvxqpnko5+k8lxHFNpGNhtYpF8PIK25T K5uoJrx5fRLHOjhIGhFQ =3hy1 -----END PGP SIGNATURE----- --Apple-Mail=_F7959245-FED9-4E91-BA05-AD2CC9E7A40C-- From owner-svn-src-head@freebsd.org Thu Sep 1 19:03: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 494B9BCC4B7; Thu, 1 Sep 2016 19:03:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28E17AD2; Thu, 1 Sep 2016 19:03:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 119C010AF5C; Thu, 1 Sep 2016 15:03:16 -0400 (EDT) From: John Baldwin To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305178 - head/sys/boot/i386/libi386 Date: Thu, 01 Sep 2016 11:28:42 -0700 Message-ID: <1604880.G26KHQlAxI@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201609010635.u816ZDlc025340@repo.freebsd.org> References: <201609010635.u816ZDlc025340@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 01 Sep 2016 15:03:16 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 19:03:33 -0000 On Thursday, September 01, 2016 06:35:13 AM Toomas Soome wrote: > Author: tsoome > Date: Thu Sep 1 06:35:13 2016 > New Revision: 305178 > URL: https://svnweb.freebsd.org/changeset/base/305178 > > Log: > bd_int13probe() should check extended info if sector info is bad > > In some Dell systems and usb stick combinations, it is found that > int13 AH=08 is reporting back bad sector information, preventing the > boot. > > This update is allowing bd_int13probe() to use extended info call to > build disk properties. > > It also can happen the total sectors count from extended info may be > wrong, in such case, the CHS data is used to calculate total sectors. > > Reviewed by: allanjude > Approved by: allanjude (mentor) > Differential Revision: https://reviews.freebsd.org/D7718 Hmm, can you see if this fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=176748 ? -- John Baldwin From owner-svn-src-head@freebsd.org Thu Sep 1 19:18: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 25522BCC8A1; Thu, 1 Sep 2016 19:18:28 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 031AF982; Thu, 1 Sep 2016 19:18:27 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81JIRq5017759; Thu, 1 Sep 2016 19:18:27 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81JIRME017756; Thu, 1 Sep 2016 19:18:27 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609011918.u81JIRME017756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 1 Sep 2016 19:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305231 - head/sys/dev/syscons 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.22 Precedence: list List-Id: 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, 01 Sep 2016 19:18:28 -0000 Author: bde Date: Thu Sep 1 19:18:26 2016 New Revision: 305231 URL: https://svnweb.freebsd.org/changeset/base/305231 Log: The log message for the previous commit didn't mention the most the important detail that sc_cngetc() now opens and closes the keyboard on every call again. This was moved from sc_cngetc() to scn_cngrab/ ungrab() in r228644, but the change wasn't quite complete. After fixes for nesting in kbdd_poll() in ukbd and kbdmux, these opens and closes should have no significant effect if done while grabbed. They fix unusual cases when cngetc() is called while not grabbed. This commit is the main fix for screen locking in sc_cnputc(): detect deadlock or likely-deadlock and handle it by buffering the output atomically and printing it later if the deadlock condition clears (and sc_cnputc() is called). The most common deadlock is when the screen lock is held by ourself. Then it would be safe to acquire the lock recursively if the console driver is calling printf() in a safe context, but we don't know when that is. It is not safe to ignore the lock even in kdb or panic mode. But ignore it in panic mode. The only other known case of deadlock is when another thread holds the lock but is running on a stopped CPU. Detect that case approximately by using trylock and retrying for 1000 usec. On a 4 GHz CPU, 100 usec is almost long enough -- screen switches take slightly longer than that. Not retrying at all is good enough except for stress tests, and planned future versions will extend the timeout so that the stress tests work better. To see the behaviour when deadlock is detected, single step through sctty_outwakeup() (or sc_puts() to start with deadlock). Another (serial) console is needed to the buffered-only output, but the keyboard works in this context to continue or step out of the deadlocked region. The buffer is not large enough to hold all the output for this. Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Thu Sep 1 19:11:50 2016 (r305230) +++ head/sys/dev/syscons/syscons.c Thu Sep 1 19:18:26 2016 (r305231) @@ -1678,13 +1678,39 @@ sccnkbdunlock(sc_softc_t *sc, struct sc_ static void sccnscrlock(sc_softc_t *sc, struct sc_cnstate *sp) { - SC_VIDEO_LOCK(sc); + int retries; + + /** + * Locking method: + * - if kdb_active and video_mtx is not owned by anyone, then lock + * by kdb remaining active + * - if !kdb_active, try to acquire video_mtx without blocking or + * recursing; if we get it then it works normally. + * Note that video_mtx is especially unusable if we already own it, + * since then it is protecting something and syscons is not reentrant + * enough to ignore the protection even in the kdb_active case. + */ + if (kdb_active) { + sp->kdb_locked = sc->video_mtx.mtx_lock == MTX_UNOWNED || panicstr; + sp->mtx_locked = FALSE; + } else { + sp->kdb_locked = FALSE; + for (retries = 0; retries < 1000; retries++) { + sp->mtx_locked = mtx_trylock_spin_flags(&sc->video_mtx, + MTX_QUIET) != 0 || panicstr; + if (sp->mtx_locked) + break; + DELAY(1); + } + } } static void sccnscrunlock(sc_softc_t *sc, struct sc_cnstate *sp) { - SC_VIDEO_UNLOCK(sc); + if (sp->mtx_locked) + mtx_unlock_spin(&sc->video_mtx); + sp->mtx_locked = sp->kdb_locked = FALSE; } static void @@ -1721,6 +1747,8 @@ over_keyboard: ; /* The screen is opened iff locking it succeeds. */ sccnscrlock(sc, sp); + if (!sp->kdb_locked && !sp->mtx_locked) + return; sp->scr_opened = TRUE; /* The screen switch is optional. */ @@ -1797,6 +1825,10 @@ sc_cnungrab(struct consdev *cp) atomic_add_int(&sc->grab_level, -1); } +static char sc_cnputc_log[0x1000]; +static u_int sc_cnputc_loghead; +static u_int sc_cnputc_logtail; + static void sc_cnputc(struct consdev *cd, int c) { @@ -1808,12 +1840,28 @@ sc_cnputc(struct consdev *cd, int c) struct tty *tp; #endif #endif /* !SC_NO_HISTORY */ + u_int head; int s; /* assert(sc_console != NULL) */ sccnopen(scp->sc, &st, 0); + /* + * Log the output. + * + * In the unlocked case, the logging is intentionally only + * perfectly atomic for the indexes. + */ + head = atomic_fetchadd_int(&sc_cnputc_loghead, 1); + sc_cnputc_log[head % sizeof(sc_cnputc_log)] = c; + + /* + * If we couldn't open, return to defer output. + */ + if (!st.scr_opened) + return; + #ifndef SC_NO_HISTORY if (scp == scp->sc->cur_scp && scp->status & SLKED) { scp->status &= ~SLKED; @@ -1841,8 +1889,14 @@ sc_cnputc(struct consdev *cd, int c) } #endif /* !SC_NO_HISTORY */ - buf[0] = c; - sc_puts(scp, buf, 1, 1); + /* Play any output still in the log (our char may already be done). */ + while (sc_cnputc_logtail != atomic_load_acq_int(&sc_cnputc_loghead)) { + buf[0] = sc_cnputc_log[sc_cnputc_logtail++ % sizeof(sc_cnputc_log)]; + if (atomic_load_acq_int(&sc_cnputc_loghead) - sc_cnputc_logtail >= + sizeof(sc_cnputc_log)) + continue; + sc_puts(scp, buf, 1, 1); + } s = spltty(); /* block sckbdevent and scrn_timer */ sccnupdate(scp); @@ -1883,9 +1937,11 @@ sc_cngetc_locked(struct sc_cnstate *sp) * Stop the screen saver and update the screen if necessary. * What if we have been running in the screen saver code... XXX */ - sc_touch_scrn_saver(); + if (sp->scr_opened) + sc_touch_scrn_saver(); scp = sc_console->sc->cur_scp; /* XXX */ - sccnupdate(scp); + if (sp->scr_opened) + sccnupdate(scp); if (fkeycp < fkey.len) return fkey.str[fkeycp++]; Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Thu Sep 1 19:11:50 2016 (r305230) +++ head/sys/dev/syscons/syscons.h Thu Sep 1 19:18:26 2016 (r305231) @@ -191,6 +191,8 @@ struct tty; struct sc_cnstate { u_char kbd_locked; + u_char kdb_locked; + u_char mtx_locked; u_char kbd_opened; u_char scr_opened; }; From owner-svn-src-head@freebsd.org Thu Sep 1 19:51: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 9864EBCB3DD; Thu, 1 Sep 2016 19:51:36 +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 6B0A7FAB; Thu, 1 Sep 2016 19:51:36 +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 u81JpZ14030005; Thu, 1 Sep 2016 19:51:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81JpZoq030003; Thu, 1 Sep 2016 19:51:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609011951.u81JpZoq030003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Sep 2016 19:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305235 - in head: share/man/man4 sys/conf sys/modules/digi 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.22 Precedence: list List-Id: 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, 01 Sep 2016 19:51:36 -0000 Author: jhb Date: Thu Sep 1 19:51:35 2016 New Revision: 305235 URL: https://svnweb.freebsd.org/changeset/base/305235 Log: Remove the digi(4) drivers. These drivers were never updated for the new TTY changes and have been disconnected from the build since 8.0. Ok'd by: imp, peterj Deleted: head/share/man/man4/digi.4 head/sys/modules/digi/ Modified: head/share/man/man4/Makefile head/sys/conf/files Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Sep 1 19:36:39 2016 (r305234) +++ head/share/man/man4/Makefile Thu Sep 1 19:51:35 2016 (r305235) @@ -122,7 +122,6 @@ MAN= aac.4 \ ddb.4 \ de.4 \ devctl.4 \ - digi.4 \ disc.4 \ divert.4 \ ${_dpms.4} \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Sep 1 19:36:39 2016 (r305234) +++ head/sys/conf/files Thu Sep 1 19:51:35 2016 (r305235) @@ -1349,16 +1349,6 @@ dev/dcons/dcons.c optional dcons dev/dcons/dcons_crom.c optional dcons_crom dev/dcons/dcons_os.c optional dcons dev/de/if_de.c optional de pci -dev/digi/CX.c optional digi_CX -dev/digi/CX_PCI.c optional digi_CX_PCI -dev/digi/EPCX.c optional digi_EPCX -dev/digi/EPCX_PCI.c optional digi_EPCX_PCI -dev/digi/Xe.c optional digi_Xe -dev/digi/Xem.c optional digi_Xem -dev/digi/Xr.c optional digi_Xr -dev/digi/digi.c optional digi -dev/digi/digi_isa.c optional digi isa -dev/digi/digi_pci.c optional digi pci dev/dpt/dpt_eisa.c optional dpt eisa dev/dpt/dpt_pci.c optional dpt pci dev/dpt/dpt_scsi.c optional dpt From owner-svn-src-head@freebsd.org Thu Sep 1 19:55: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 61AF3BCB64E; Thu, 1 Sep 2016 19:55:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x243.google.com (mail-pa0-x243.google.com [IPv6:2607:f8b0:400e:c03::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3290A669; Thu, 1 Sep 2016 19:55:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x243.google.com with SMTP id ez1so4577486pab.3; Thu, 01 Sep 2016 12:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=82NiDJf2ErNElfCUz7D9c5DE6YVKga8CYR5tm8wXutg=; b=ua53jBxdc5mOUrRrSoQvHWXSh/KJRvZFt/m1dTC65XMw1GdKR8n04wfxEDIs1xSPN9 tBkAh61KHQAtZp9t4dXuCv8xIM6kcb+t46qsLTNXH97CNcbkPMSchlAXzOhVLw7qX+tB 5ToGI4QzZOSaaZdwvSeqxLAerw56dCSAKDGZYXOcBwsmGNdczLFtTMyaDvDlE3M5bKrN Nvu9BA3TGNx9Pmsne8S++PxQnoZFESU2EEVwdq2gtz+lwkrNc3sct7C8GglEGDY0SHdF fTXu7//ZJ7B8L+z/fAv5M7oqdcqS2hn4bPIm0mgaFeSZUKHW81zsvVGlINv33gE/NUGG seWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=82NiDJf2ErNElfCUz7D9c5DE6YVKga8CYR5tm8wXutg=; b=lBrePrZcuNL8wDCKKevGymJX8GMUTzNEg4UHdfHK4i28F/c5HbNvLJsv6y7VxPZAJj 61CqbTwFZYXutHbn+woCr7LH5SLlhcvJyCeKLG29FV76LTBGHbVpkCZGqSYuZwFMrMnq AuYdc+TUgu7TfbLuvpeZ48ze17HSDIqEiLIgh1rzsPa7/I6PDQHOUzF28CBfQWVA1qX4 7X92ih/A37xBCp50srkU1SOBz498T56cudDSMBmWBc/9c8aPUKKgEDzjqCTpNy+vJ/va nBwHnvaLccYxOwwaU0bgzCzu8JrKChjQg2nkxWWRuI939wyV+v+xvOU0EseEVQrF2hbf rdng== X-Gm-Message-State: AE9vXwOd4mRvAFa3wSNMn7DbEDi3MgUBS9GejozacbK74urznogmOL6gpjm0ezaAg5Qefw== X-Received: by 10.66.86.1 with SMTP id l1mr29710787paz.106.1472759733665; Thu, 01 Sep 2016 12:55:33 -0700 (PDT) Received: from ?IPv6:2607:fb90:80bd:bf70:7974:a84f:df69:391c? ([2607:fb90:80bd:bf70:7974:a84f:df69:391c]) by smtp.gmail.com with ESMTPSA id x66sm9505904pfb.86.2016.09.01.12.55.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 12:55:32 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r305235 - in head: share/man/man4 sys/conf sys/modules/digi From: Ngie Cooper X-Mailer: iPhone Mail (13G36) In-Reply-To: <201609011951.u81JpZoq030003@repo.freebsd.org> Date: Thu, 1 Sep 2016 12:55:30 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201609011951.u81JpZoq030003@repo.freebsd.org> To: John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 19:55:35 -0000 > On Sep 1, 2016, at 12:51, John Baldwin wrote: >=20 > Author: jhb > Date: Thu Sep 1 19:51:35 2016 > New Revision: 305235 > URL: https://svnweb.freebsd.org/changeset/base/305235 >=20 > Log: > Remove the digi(4) drivers. >=20 > These drivers were never updated for the new TTY changes and have > been disconnected from the build since 8.0. >=20 > Ok'd by: imp, peterj Are these already being handled in ObsoleteFiles.inc (not that it probab= ly matters given how far back it's been disabled, but it's kind of nice to b= e clean)? Thanks! -Ngie= From owner-svn-src-head@freebsd.org Thu Sep 1 20:42: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 99FDABCC705; Thu, 1 Sep 2016 20:42:24 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp003.me.com (st13p35im-asmtp003.me.com [17.164.199.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7260894A; Thu, 1 Sep 2016 20:42:24 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp003.me.com by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OCU00500BZEF500@st13p35im-asmtp003.me.com>; Thu, 01 Sep 2016 19:42:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1472758936; bh=ZGOXssms4NlPkq5BDa2TqWHENV9lwdpONPn0ZSgjgHY=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=HRHjq1T8U79xigtfqroyyDVTCC7xfcrXPyYnseHTlHG1+eSSpq5Wc7MhuhXFCOZqi SbiZlJy5j3wjntryUVJerWZFJQm6M1IcxRd7GNHRnZp//l64jN9qFUcqEu1b/RCD+e CfJlVY1gW42vRYQJNEW49ZXMzYjkOgtKLbXG27rRcqRnsi1Pt2c6/VbRqM56m25dYG LJmCy63rtcjeMQwg8YitmbT5lwjLnkniMk6Vg2HqhiB4L652Vm/FgT/rA2HZRWOWGU oho1wAElLPZ7dyhE+Rd6cIdzeYzvV/7U2BnYlPOhIQzfngvYQ6iyl1TQj7sLuW8lUd awAL1BxCoESXA== Received: from nazgul.lan (220-90-235-80.dyn.estpak.ee [80.235.90.220]) by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OCU008IIC2DAN10@st13p35im-asmtp003.me.com>; Thu, 01 Sep 2016 19:42:16 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-01_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1609010226 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r305178 - head/sys/boot/i386/libi386 From: Toomas Soome In-reply-to: <1604880.G26KHQlAxI@ralph.baldwin.cx> Date: Thu, 01 Sep 2016 22:42:12 +0300 Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <418639CF-EA43-4082-8A53-E085BC82F8E4@me.com> References: <201609010635.u816ZDlc025340@repo.freebsd.org> <1604880.G26KHQlAxI@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 20:42:24 -0000 > On 1. sept 2016, at 21:28, John Baldwin wrote: >=20 > On Thursday, September 01, 2016 06:35:13 AM Toomas Soome wrote: >> Author: tsoome >> Date: Thu Sep 1 06:35:13 2016 >> New Revision: 305178 >> URL: https://svnweb.freebsd.org/changeset/base/305178 >>=20 >> Log: >> bd_int13probe() should check extended info if sector info is bad >>=20 >> In some Dell systems and usb stick combinations, it is found that >> int13 AH=3D08 is reporting back bad sector information, preventing = the >> boot. >>=20 >> This update is allowing bd_int13probe() to use extended info call to >> build disk properties. >>=20 >> It also can happen the total sectors count from extended info may be >> wrong, in such case, the CHS data is used to calculate total = sectors. >>=20 >> Reviewed by: allanjude >> Approved by: allanjude (mentor) >> Differential Revision: https://reviews.freebsd.org/D7718 >=20 > Hmm, can you see if this fixes > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D176748 ? >=20 > --=20 > John Baldwin eh=E2=80=A6 well. as he was reporting about bad sector size - my patch = does not check it.. so apparently that would be good check as well=E2=80=A6= . unfortunately I don=E2=80=99t have any of such broken BIOSes handy to = verify what kind of breakage it is - are they just filling EDD with = garbage or is there any kind of logic.=20 rgds, toomas From owner-svn-src-head@freebsd.org Thu Sep 1 20:43: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 A6B1BBCC759; Thu, 1 Sep 2016 20:43:02 +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 7413AADD; Thu, 1 Sep 2016 20:43:02 +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 u81Kh1eG051882; Thu, 1 Sep 2016 20:43:01 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Kh1ZM051875; Thu, 1 Sep 2016 20:43:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609012043.u81Kh1ZM051875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 1 Sep 2016 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305240 - in head/sys: dev/cxgbe dev/cxgbe/cxgbei modules/cxgbe/cxgbei 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.22 Precedence: list List-Id: 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, 01 Sep 2016 20:43:02 -0000 Author: np Date: Thu Sep 1 20:43:01 2016 New Revision: 305240 URL: https://svnweb.freebsd.org/changeset/base/305240 Log: cxgbe/cxgbei: Retire all DDP related code from cxgbei and switch to routines available in t4_tom to manage the iSCSI DDP page pod region. This adds the ability to use multiple DDP page sizes to the iSCSI driver, among other improvements. Sponsored by: Chelsio Communications Deleted: head/sys/dev/cxgbe/cxgbei/cxgbei_ulp2_ddp.c head/sys/dev/cxgbe/cxgbei/cxgbei_ulp2_ddp.h Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/cxgbei/cxgbei.h head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/modules/cxgbe/cxgbei/Makefile Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Sep 1 20:38:59 2016 (r305239) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Sep 1 20:43:01 2016 (r305240) @@ -90,7 +90,6 @@ __FBSDID("$FreeBSD$"); #include "common/t4_regs.h" /* for PCIE_MEM_ACCESS */ #include "tom/t4_tom.h" #include "cxgbei.h" -#include "cxgbei_ulp2_ddp.h" static int worker_thread_count; static struct cxgbei_worker_thread_softc *cwt_softc; @@ -101,376 +100,6 @@ struct icl_pdu *icl_cxgbei_new_pdu(int); void icl_cxgbei_new_pdu_set_conn(struct icl_pdu *, struct icl_conn *); void icl_cxgbei_conn_pdu_free(struct icl_conn *, struct icl_pdu *); -/* - * Direct Data Placement - - * Directly place the iSCSI Data-In or Data-Out PDU's payload into pre-posted - * final destination host-memory buffers based on the Initiator Task Tag (ITT) - * in Data-In or Target Task Tag (TTT) in Data-Out PDUs. - * The host memory address is programmed into h/w in the format of pagepod - * entries. - * The location of the pagepod entry is encoded into ddp tag which is used as - * the base for ITT/TTT. - */ - -/* - * functions to program the pagepod in h/w - */ -static void inline -ppod_set(struct pagepod *ppod, - struct cxgbei_ulp2_pagepod_hdr *hdr, - struct cxgbei_ulp2_gather_list *gl, - unsigned int pidx) -{ - int i; - - memcpy(ppod, hdr, sizeof(*hdr)); - - for (i = 0; i < (PPOD_PAGES + 1); i++, pidx++) { - ppod->addr[i] = pidx < gl->nelem ? - cpu_to_be64(gl->dma_sg[pidx].phys_addr) : 0ULL; - } -} - -static void inline -ppod_clear(struct pagepod *ppod) -{ - memset(ppod, 0, sizeof(*ppod)); -} - -static inline void -ulp_mem_io_set_hdr(struct adapter *sc, int tid, struct ulp_mem_io *req, - unsigned int wr_len, unsigned int dlen, - unsigned int pm_addr) -{ - struct ulptx_idata *idata = (struct ulptx_idata *)(req + 1); - - INIT_ULPTX_WR(req, wr_len, 0, 0); - req->cmd = cpu_to_be32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | - V_ULP_MEMIO_ORDER(is_t4(sc)) | - V_T5_ULP_MEMIO_IMM(is_t5(sc))); - req->dlen = htonl(V_ULP_MEMIO_DATA_LEN(dlen >> 5)); - req->len16 = htonl(DIV_ROUND_UP(wr_len - sizeof(req->wr), 16) - | V_FW_WR_FLOWID(tid)); - req->lock_addr = htonl(V_ULP_MEMIO_ADDR(pm_addr >> 5)); - - idata->cmd_more = htonl(V_ULPTX_CMD(ULP_TX_SC_IMM)); - idata->len = htonl(dlen); -} - -#define ULPMEM_IDATA_MAX_NPPODS 1 /* 256/PPOD_SIZE */ -#define PCIE_MEMWIN_MAX_NPPODS 16 /* 1024/PPOD_SIZE */ - -static int -ppod_write_idata(struct cxgbei_data *ci, - struct cxgbei_ulp2_pagepod_hdr *hdr, - unsigned int idx, unsigned int npods, - struct cxgbei_ulp2_gather_list *gl, - unsigned int gl_pidx, struct toepcb *toep) -{ - u_int dlen = PPOD_SIZE * npods; - u_int pm_addr = idx * PPOD_SIZE + ci->llimit; - u_int wr_len = roundup(sizeof(struct ulp_mem_io) + - sizeof(struct ulptx_idata) + dlen, 16); - struct ulp_mem_io *req; - struct ulptx_idata *idata; - struct pagepod *ppod; - u_int i; - struct wrqe *wr; - struct adapter *sc = toep->vi->pi->adapter; - - wr = alloc_wrqe(wr_len, toep->ctrlq); - if (wr == NULL) { - CXGBE_UNIMPLEMENTED("ppod_write_idata: alloc_wrqe failure"); - return (ENOMEM); - } - - req = wrtod(wr); - memset(req, 0, wr_len); - ulp_mem_io_set_hdr(sc, toep->tid, req, wr_len, dlen, pm_addr); - idata = (struct ulptx_idata *)(req + 1); - - ppod = (struct pagepod *)(idata + 1); - for (i = 0; i < npods; i++, ppod++, gl_pidx += PPOD_PAGES) { - if (!hdr) /* clear the pagepod */ - ppod_clear(ppod); - else /* set the pagepod */ - ppod_set(ppod, hdr, gl, gl_pidx); - } - - t4_wrq_tx(sc, wr); - return 0; -} - -int -t4_ddp_set_map(struct cxgbei_data *ci, void *iccp, - struct cxgbei_ulp2_pagepod_hdr *hdr, u_int idx, u_int npods, - struct cxgbei_ulp2_gather_list *gl, int reply) -{ - struct icl_cxgbei_conn *icc = (struct icl_cxgbei_conn *)iccp; - struct toepcb *toep = icc->toep; - int err; - unsigned int pidx = 0, w_npods = 0, cnt; - - /* - * on T4, if we use a mix of IMMD and DSGL with ULP_MEM_WRITE, - * the order would not be guaranteed, so we will stick with IMMD - */ - gl->tid = toep->tid; - gl->port_id = toep->vi->pi->port_id; - gl->egress_dev = (void *)toep->vi->ifp; - - /* send via immediate data */ - for (; w_npods < npods; idx += cnt, w_npods += cnt, - pidx += PPOD_PAGES) { - cnt = npods - w_npods; - if (cnt > ULPMEM_IDATA_MAX_NPPODS) - cnt = ULPMEM_IDATA_MAX_NPPODS; - err = ppod_write_idata(ci, hdr, idx, cnt, gl, pidx, toep); - if (err) { - printf("%s: ppod_write_idata failed\n", __func__); - break; - } - } - return err; -} - -void -t4_ddp_clear_map(struct cxgbei_data *ci, struct cxgbei_ulp2_gather_list *gl, - u_int tag, u_int idx, u_int npods, struct icl_cxgbei_conn *icc) -{ - struct toepcb *toep = icc->toep; - int err = -1; - u_int pidx = 0; - u_int w_npods = 0; - u_int cnt; - - for (; w_npods < npods; idx += cnt, w_npods += cnt, - pidx += PPOD_PAGES) { - cnt = npods - w_npods; - if (cnt > ULPMEM_IDATA_MAX_NPPODS) - cnt = ULPMEM_IDATA_MAX_NPPODS; - err = ppod_write_idata(ci, NULL, idx, cnt, gl, 0, toep); - if (err) - break; - } -} - -static int -cxgbei_map_sg(struct cxgbei_sgl *sgl, struct ccb_scsiio *csio) -{ - unsigned int data_len = csio->dxfer_len; - unsigned int sgoffset = (uint64_t)csio->data_ptr & PAGE_MASK; - unsigned int nsge; - unsigned char *sgaddr = csio->data_ptr; - unsigned int len = 0; - - nsge = (csio->dxfer_len + sgoffset + PAGE_SIZE - 1) >> PAGE_SHIFT; - sgl->sg_addr = sgaddr; - sgl->sg_offset = sgoffset; - if (data_len < (PAGE_SIZE - sgoffset)) - len = data_len; - else - len = PAGE_SIZE - sgoffset; - - sgl->sg_length = len; - - data_len -= len; - sgaddr += len; - sgl = sgl+1; - - while (data_len > 0) { - sgl->sg_addr = sgaddr; - len = (data_len < PAGE_SIZE)? data_len: PAGE_SIZE; - sgl->sg_length = len; - sgaddr += len; - data_len -= len; - sgl = sgl + 1; - } - - return nsge; -} - -static int -cxgbei_map_sg_tgt(struct cxgbei_sgl *sgl, union ctl_io *io) -{ - unsigned int data_len, sgoffset, nsge; - unsigned char *sgaddr; - unsigned int len = 0, index = 0, ctl_sg_count, i; - struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; - - if (io->scsiio.kern_sg_entries > 0) { - ctl_sglist = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; - ctl_sg_count = io->scsiio.kern_sg_entries; - } else { - ctl_sglist = &ctl_sg_entry; - ctl_sglist->addr = io->scsiio.kern_data_ptr; - ctl_sglist->len = io->scsiio.kern_data_len; - ctl_sg_count = 1; - } - - sgaddr = sgl->sg_addr = ctl_sglist[index].addr; - sgoffset = sgl->sg_offset = (uint64_t)sgl->sg_addr & PAGE_MASK; - data_len = ctl_sglist[index].len; - - if (data_len < (PAGE_SIZE - sgoffset)) - len = data_len; - else - len = PAGE_SIZE - sgoffset; - - sgl->sg_length = len; - - data_len -= len; - sgaddr += len; - sgl = sgl+1; - - len = 0; - for (i = 0; i< ctl_sg_count; i++) - len += ctl_sglist[i].len; - nsge = (len + sgoffset + PAGE_SIZE -1) >> PAGE_SHIFT; - while (data_len > 0) { - sgl->sg_addr = sgaddr; - len = (data_len < PAGE_SIZE)? data_len: PAGE_SIZE; - sgl->sg_length = len; - sgaddr += len; - data_len -= len; - sgl = sgl + 1; - if (data_len == 0) { - if (index == ctl_sg_count - 1) - break; - index++; - sgaddr = ctl_sglist[index].addr; - data_len = ctl_sglist[index].len; - } - } - - return nsge; -} - -static int -t4_sk_ddp_tag_reserve(struct cxgbei_data *ci, struct icl_cxgbei_conn *icc, - u_int xferlen, struct cxgbei_sgl *sgl, u_int sgcnt, u_int *ddp_tag) -{ - struct cxgbei_ulp2_gather_list *gl; - int err = -EINVAL; - struct toepcb *toep = icc->toep; - - gl = cxgbei_ulp2_ddp_make_gl_from_iscsi_sgvec(xferlen, sgl, sgcnt, ci, 0); - if (gl) { - err = cxgbei_ulp2_ddp_tag_reserve(ci, icc, toep->tid, - &ci->tag_format, ddp_tag, gl, 0, 0); - if (err) { - cxgbei_ulp2_ddp_release_gl(ci, gl); - } - } - - return err; -} - -static unsigned int -cxgbei_task_reserve_itt(struct icl_conn *ic, void **prv, - struct ccb_scsiio *scmd, unsigned int *itt) -{ - struct icl_cxgbei_conn *icc = ic_to_icc(ic); - int xferlen = scmd->dxfer_len; - struct cxgbei_task_data *tdata = NULL; - struct cxgbei_sgl *sge = NULL; - struct toepcb *toep = icc->toep; - struct adapter *sc = td_adapter(toep->td); - struct cxgbei_data *ci = sc->iscsi_ulp_softc; - int err = -1; - - MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); - - tdata = (struct cxgbei_task_data *)*prv; - if (xferlen == 0 || tdata == NULL) - goto out; - if (xferlen < DDP_THRESHOLD) - goto out; - - if ((scmd->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - tdata->nsge = cxgbei_map_sg(tdata->sgl, scmd); - if (tdata->nsge == 0) { - CTR1(KTR_CXGBE, "%s: map_sg failed", __func__); - return 0; - } - sge = tdata->sgl; - - tdata->sc_ddp_tag = *itt; - - CTR3(KTR_CXGBE, "%s: *itt:0x%x sc_ddp_tag:0x%x", - __func__, *itt, tdata->sc_ddp_tag); - if (cxgbei_ulp2_sw_tag_usable(&ci->tag_format, - tdata->sc_ddp_tag)) { - err = t4_sk_ddp_tag_reserve(ci, icc, scmd->dxfer_len, - sge, tdata->nsge, &tdata->sc_ddp_tag); - } else { - CTR3(KTR_CXGBE, - "%s: itt:0x%x sc_ddp_tag:0x%x not usable", - __func__, *itt, tdata->sc_ddp_tag); - } - } -out: - if (err < 0) - tdata->sc_ddp_tag = - cxgbei_ulp2_set_non_ddp_tag(&ci->tag_format, *itt); - - return tdata->sc_ddp_tag; -} - -static unsigned int -cxgbei_task_reserve_ttt(struct icl_conn *ic, void **prv, union ctl_io *io, - unsigned int *ttt) -{ - struct icl_cxgbei_conn *icc = ic_to_icc(ic); - struct toepcb *toep = icc->toep; - struct adapter *sc = td_adapter(toep->td); - struct cxgbei_data *ci = sc->iscsi_ulp_softc; - struct cxgbei_task_data *tdata = NULL; - int xferlen, err = -1; - struct cxgbei_sgl *sge = NULL; - - MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); - - xferlen = (io->scsiio.kern_data_len - io->scsiio.ext_data_filled); - tdata = (struct cxgbei_task_data *)*prv; - if ((xferlen == 0) || (tdata == NULL)) - goto out; - if (xferlen < DDP_THRESHOLD) - goto out; - tdata->nsge = cxgbei_map_sg_tgt(tdata->sgl, io); - if (tdata->nsge == 0) { - CTR1(KTR_CXGBE, "%s: map_sg failed", __func__); - return 0; - } - sge = tdata->sgl; - - tdata->sc_ddp_tag = *ttt; - if (cxgbei_ulp2_sw_tag_usable(&ci->tag_format, tdata->sc_ddp_tag)) { - err = t4_sk_ddp_tag_reserve(ci, icc, xferlen, sge, - tdata->nsge, &tdata->sc_ddp_tag); - } else { - CTR2(KTR_CXGBE, "%s: sc_ddp_tag:0x%x not usable", - __func__, tdata->sc_ddp_tag); - } -out: - if (err < 0) - tdata->sc_ddp_tag = - cxgbei_ulp2_set_non_ddp_tag(&ci->tag_format, *ttt); - return tdata->sc_ddp_tag; -} - -static int -t4_sk_ddp_tag_release(struct icl_cxgbei_conn *icc, unsigned int ddp_tag) -{ - struct toepcb *toep = icc->toep; - struct adapter *sc = td_adapter(toep->td); - struct cxgbei_data *ci = sc->iscsi_ulp_softc; - - cxgbei_ulp2_ddp_tag_release(ci, ddp_tag, icc); - - return (0); -} - static void read_pdu_limits(struct adapter *sc, uint32_t *max_tx_pdu_len, uint32_t *max_rx_pdu_len) @@ -504,58 +133,43 @@ read_pdu_limits(struct adapter *sc, uint static int cxgbei_init(struct adapter *sc, struct cxgbei_data *ci) { - int nppods, bits, rc; - static const u_int pgsz_order[] = {0, 1, 2, 3}; + struct ppod_region *pr; + uint32_t r; + int rc; MPASS(sc->vres.iscsi.size > 0); + MPASS(ci != NULL); - ci->llimit = sc->vres.iscsi.start; - ci->ulimit = sc->vres.iscsi.start + sc->vres.iscsi.size - 1; read_pdu_limits(sc, &ci->max_tx_pdu_len, &ci->max_rx_pdu_len); - nppods = sc->vres.iscsi.size >> IPPOD_SIZE_SHIFT; - if (nppods <= 1024) - return (ENXIO); - - bits = fls(nppods); - if (bits > IPPOD_IDX_MAX_SIZE) - bits = IPPOD_IDX_MAX_SIZE; - nppods = (1 << (bits - 1)) - 1; - - rc = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR, - BUS_SPACE_MAXADDR, NULL, NULL, UINT32_MAX , 8, BUS_SPACE_MAXSIZE, - BUS_DMA_ALLOCNOW, NULL, NULL, &ci->ulp_ddp_tag); + ci->ddp_threshold = 2048; + pr = &ci->pr; + + r = t4_read_reg(sc, A_ULP_RX_ISCSI_PSZ); + rc = t4_init_ppod_region(pr, &sc->vres.iscsi, r, "iSCSI page pods"); if (rc != 0) { - device_printf(sc->dev, "%s: failed to create DMA tag: %u.\n", + device_printf(sc->dev, + "%s: failed to initialize the iSCSI page pod region: %u.\n", __func__, rc); return (rc); } - ci->colors = malloc(nppods * sizeof(char), M_CXGBE, M_NOWAIT | M_ZERO); - ci->gl_map = malloc(nppods * sizeof(struct cxgbei_ulp2_gather_list *), - M_CXGBE, M_NOWAIT | M_ZERO); - if (ci->colors == NULL || ci->gl_map == NULL) { - bus_dma_tag_destroy(ci->ulp_ddp_tag); - free(ci->colors, M_CXGBE); - free(ci->gl_map, M_CXGBE); - return (ENOMEM); + r = t4_read_reg(sc, A_ULP_RX_ISCSI_TAGMASK); + r &= V_ISCSITAGMASK(M_ISCSITAGMASK); + if (r != pr->pr_tag_mask) { + /* + * Recent firmwares are supposed to set up the the iSCSI tagmask + * but we'll do it ourselves it the computed value doesn't match + * what's in the register. + */ + device_printf(sc->dev, + "tagmask 0x%08x does not match computed mask 0x%08x.\n", r, + pr->pr_tag_mask); + t4_set_reg_field(sc, A_ULP_RX_ISCSI_TAGMASK, + V_ISCSITAGMASK(M_ISCSITAGMASK), pr->pr_tag_mask); } - mtx_init(&ci->map_lock, "ddp lock", NULL, MTX_DEF | MTX_DUPOK); - ci->nppods = nppods; - ci->idx_last = nppods; - ci->idx_bits = bits; - ci->idx_mask = (1 << bits) - 1; - ci->rsvd_tag_mask = (1 << (bits + IPPOD_IDX_SHIFT)) - 1; - - ci->tag_format.sw_bits = bits; - ci->tag_format.rsvd_bits = bits; - ci->tag_format.rsvd_shift = IPPOD_IDX_SHIFT; - ci->tag_format.rsvd_mask = ci->idx_mask; - - t4_iscsi_init(sc, ci->idx_mask << IPPOD_IDX_SHIFT, pgsz_order); - - return (rc); + return (0); } static int @@ -772,47 +386,6 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const return (0); } -/* initiator */ -void -cxgbei_conn_task_reserve_itt(void *conn, void **prv, - void *scmd, unsigned int *itt) -{ - unsigned int tag; - tag = cxgbei_task_reserve_itt(conn, prv, scmd, itt); - if (tag) - *itt = htonl(tag); - return; -} - -/* target */ -void -cxgbei_conn_transfer_reserve_ttt(void *conn, void **prv, - void *scmd, unsigned int *ttt) -{ - unsigned int tag; - tag = cxgbei_task_reserve_ttt(conn, prv, scmd, ttt); - if (tag) - *ttt = htonl(tag); - return; -} - -void -cxgbei_cleanup_task(void *conn, void *ofld_priv) -{ - struct icl_conn *ic = (struct icl_conn *)conn; - struct icl_cxgbei_conn *icc = ic_to_icc(ic); - struct cxgbei_task_data *tdata = ofld_priv; - struct adapter *sc = icc->sc; - struct cxgbei_data *ci = sc->iscsi_ulp_softc; - - MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); - MPASS(tdata != NULL); - - if (cxgbei_ulp2_is_ddp_tag(&ci->tag_format, tdata->sc_ddp_tag)) - t4_sk_ddp_tag_release(icc, tdata->sc_ddp_tag); - memset(tdata, 0, sizeof(*tdata)); -} - static int cxgbei_activate(struct adapter *sc) { @@ -834,7 +407,7 @@ cxgbei_activate(struct adapter *sc) } /* per-adapter softc for iSCSI */ - ci = malloc(sizeof(*ci), M_CXGBE, M_ZERO | M_NOWAIT); + ci = malloc(sizeof(*ci), M_CXGBE, M_ZERO | M_WAITOK); if (ci == NULL) return (ENOMEM); @@ -852,12 +425,13 @@ cxgbei_activate(struct adapter *sc) static int cxgbei_deactivate(struct adapter *sc) { + struct cxgbei_data *ci = sc->iscsi_ulp_softc; ASSERT_SYNCHRONIZED_OP(sc); - if (sc->iscsi_ulp_softc != NULL) { - cxgbei_ddp_cleanup(sc->iscsi_ulp_softc); - free(sc->iscsi_ulp_softc, M_CXGBE); + if (ci != NULL) { + t4_free_ppod_region(&ci->pr); + free(ci, M_CXGBE); sc->iscsi_ulp_softc = NULL; } Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.h ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Sep 1 20:38:59 2016 (r305239) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Sep 1 20:43:01 2016 (r305240) @@ -105,69 +105,18 @@ ip_to_icp(struct icl_pdu *ip) return (__containerof(ip, struct icl_cxgbei_pdu, ip)); } -struct cxgbei_sgl { - int sg_flag; - void *sg_addr; - void *sg_dma_addr; - size_t sg_offset; - size_t sg_length; -}; - -#define cxgbei_scsi_for_each_sg(_sgl, _sgel, _n, _i) \ - for (_i = 0, _sgel = (cxgbei_sgl*) (_sgl); _i < _n; _i++, \ - _sgel++) -#define sg_dma_addr(_sgel) _sgel->sg_dma_addr -#define sg_virt(_sgel) _sgel->sg_addr -#define sg_len(_sgel) _sgel->sg_length -#define sg_off(_sgel) _sgel->sg_offset -#define sg_next(_sgel) _sgel + 1 - -/* private data for each scsi task */ -struct cxgbei_task_data { - struct cxgbei_sgl sgl[256]; - u_int nsge; - u_int sc_ddp_tag; -}; - -struct cxgbei_ulp2_tag_format { - u_char sw_bits; - u_char rsvd_bits; - u_char rsvd_shift; - u_char filler[1]; - uint32_t rsvd_mask; -}; - struct cxgbei_data { - u_int llimit; - u_int ulimit; - u_int nppods; - u_int idx_last; - u_char idx_bits; - uint32_t idx_mask; - uint32_t rsvd_tag_mask; u_int max_tx_pdu_len; u_int max_rx_pdu_len; - struct mtx map_lock; - bus_dma_tag_t ulp_ddp_tag; - unsigned char *colors; - struct cxgbei_ulp2_gather_list **gl_map; + u_int ddp_threshold; + struct ppod_region pr; - struct cxgbei_ulp2_tag_format tag_format; }; -void cxgbei_conn_task_reserve_itt(void *, void **, void *, unsigned int *); -void cxgbei_conn_transfer_reserve_ttt(void *, void **, void *, unsigned int *); -void cxgbei_cleanup_task(void *, void *); +/* cxgbei.c */ u_int cxgbei_select_worker_thread(struct icl_cxgbei_conn *); -struct cxgbei_ulp2_pagepod_hdr; -int t4_ddp_set_map(struct cxgbei_data *, void *, - struct cxgbei_ulp2_pagepod_hdr *, u_int, u_int, - struct cxgbei_ulp2_gather_list *, int); -void t4_ddp_clear_map(struct cxgbei_data *, struct cxgbei_ulp2_gather_list *, - u_int, u_int, u_int, struct icl_cxgbei_conn *); - /* icl_cxgbei.c */ int icl_cxgbei_mod_load(void); int icl_cxgbei_mod_unload(void); Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Sep 1 20:38:59 2016 (r305239) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Sep 1 20:43:01 2016 (r305240) @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -70,6 +72,28 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "common/common.h" #include "common/t4_tcb.h" #include "tom/t4_tom.h" @@ -90,8 +114,7 @@ static int recvspace = 1048576; SYSCTL_INT(_kern_icl_cxgbei, OID_AUTO, recvspace, CTLFLAG_RWTUN, &recvspace, 0, "Default receive socket buffer size"); -static uma_zone_t icl_transfer_zone; - +static uma_zone_t prsv_zone; static volatile u_int icl_cxgbei_ncons; #define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock) @@ -242,12 +265,6 @@ icl_cxgbei_conn_pdu_data_segment_length( return (icl_pdu_data_segment_length(request)); } -static uint32_t -icl_conn_build_tasktag(struct icl_conn *ic, uint32_t tag) -{ - return tag; -} - static struct mbuf * finalize_pdu(struct icl_cxgbei_conn *icc, struct icl_cxgbei_pdu *icp) { @@ -776,55 +793,215 @@ icl_cxgbei_conn_close(struct icl_conn *i int icl_cxgbei_conn_task_setup(struct icl_conn *ic, struct icl_pdu *ip, - struct ccb_scsiio *csio, uint32_t *task_tagp, void **prvp) + struct ccb_scsiio *csio, uint32_t *ittp, void **arg) { - void *prv; + struct icl_cxgbei_conn *icc = ic_to_icc(ic); + struct toepcb *toep = icc->toep; + struct adapter *sc = icc->sc; + struct cxgbei_data *ci = sc->iscsi_ulp_softc; + struct ppod_region *pr = &ci->pr; + struct ppod_reservation *prsv; + uint32_t itt; + int rc = 0; + + /* This is for the offload driver's state. Must not be set already. */ + MPASS(arg != NULL); + MPASS(*arg == NULL); + + if ((csio->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_IN || + csio->dxfer_len < ci->ddp_threshold) { +no_ddp: + /* + * No DDP for this I/O. Allocate an ITT (based on the one + * passed in) that cannot be a valid hardware DDP tag in the + * iSCSI region. + */ + itt = *ittp & M_PPOD_TAG; + itt = V_PPOD_TAG(itt) | pr->pr_invalid_bit; + *ittp = htobe32(itt); + MPASS(*arg == NULL); /* State is maintained for DDP only. */ + return (0); + } - *task_tagp = icl_conn_build_tasktag(ic, *task_tagp); + /* + * Reserve resources for DDP, update the itt that should be used in the + * PDU, and save DDP specific state for this I/O in *arg. + */ - prv = uma_zalloc(icl_transfer_zone, M_NOWAIT | M_ZERO); - if (prv == NULL) - return (ENOMEM); + prsv = uma_zalloc(prsv_zone, M_NOWAIT); + if (prsv == NULL) { + rc = ENOMEM; + goto no_ddp; + } - *prvp = prv; + /* XXX add support for all CAM_DATA_ types */ + MPASS((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR); + rc = t4_alloc_page_pods_for_buf(pr, (vm_offset_t)csio->data_ptr, + csio->dxfer_len, prsv); + if (rc != 0) { + uma_zfree(prsv_zone, prsv); + goto no_ddp; + } - cxgbei_conn_task_reserve_itt(ic, prvp, csio, task_tagp); + rc = t4_write_page_pods_for_buf(sc, toep->ofld_txq, toep->tid, prsv, + (vm_offset_t)csio->data_ptr, csio->dxfer_len); + if (rc != 0) { + t4_free_page_pods(prsv); + uma_zfree(prsv_zone, prsv); + goto no_ddp; + } + *ittp = htobe32(prsv->prsv_tag); + *arg = prsv; return (0); } void -icl_cxgbei_conn_task_done(struct icl_conn *ic, void *prv) +icl_cxgbei_conn_task_done(struct icl_conn *ic, void *arg) { - cxgbei_cleanup_task(ic, prv); - uma_zfree(icl_transfer_zone, prv); + if (arg != NULL) { + struct ppod_reservation *prsv = arg; + + t4_free_page_pods(prsv); + uma_zfree(prsv_zone, prsv); + } } +/* XXXNP: PDU should be passed in as parameter, like on the initiator. */ +#define io_to_request_pdu(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr) +#define io_to_ppod_reservation(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr) + int icl_cxgbei_conn_transfer_setup(struct icl_conn *ic, union ctl_io *io, - uint32_t *transfer_tag, void **prvp) + uint32_t *tttp, void **arg) { - void *prv; + struct icl_cxgbei_conn *icc = ic_to_icc(ic); + struct toepcb *toep = icc->toep; + struct ctl_scsiio *ctsio = &io->scsiio; + struct adapter *sc = icc->sc; + struct cxgbei_data *ci = sc->iscsi_ulp_softc; + struct ppod_region *pr = &ci->pr; + struct ppod_reservation *prsv; + uint32_t ttt; + int xferlen, rc = 0, alias; + + /* This is for the offload driver's state. Must not be set already. */ + MPASS(arg != NULL); + MPASS(*arg == NULL); + + if (ctsio->ext_data_filled == 0) { + int first_burst; + struct icl_pdu *ip = io_to_request_pdu(io); + vm_offset_t buf; +#ifdef INVARIANTS + struct icl_cxgbei_pdu *icp = ip_to_icp(ip); + + MPASS(icp->icp_signature == CXGBEI_PDU_SIGNATURE); + MPASS(ic == ip->ip_conn); + MPASS(ip->ip_bhs_mbuf != NULL); +#endif + first_burst = icl_pdu_data_segment_length(ip); + + /* + * Note that ICL calls conn_transfer_setup even if the first + * burst had everything and there's nothing left to transfer. + */ + MPASS(ctsio->kern_data_len >= first_burst); + xferlen = ctsio->kern_data_len; + if (xferlen - first_burst < ci->ddp_threshold) { +no_ddp: + /* + * No DDP for this transfer. Allocate a TTT (based on + * the one passed in) that cannot be a valid hardware + * DDP tag in the iSCSI region. + */ + ttt = *tttp & M_PPOD_TAG; + ttt = V_PPOD_TAG(ttt) | pr->pr_invalid_bit; + *tttp = htobe32(ttt); + MPASS(io_to_ppod_reservation(io) == NULL); + return (0); + } - *transfer_tag = icl_conn_build_tasktag(ic, *transfer_tag); + if (ctsio->kern_sg_entries == 0) + buf = (vm_offset_t)ctsio->kern_data_ptr; + else if (ctsio->kern_sg_entries == 1) { + struct ctl_sg_entry *sgl = (void *)ctsio->kern_data_ptr; + + MPASS(sgl->len == xferlen); + buf = (vm_offset_t)sgl->addr; + } else { + rc = EAGAIN; /* XXX implement */ + goto no_ddp; + } - prv = uma_zalloc(icl_transfer_zone, M_NOWAIT | M_ZERO); - if (prv == NULL) - return (ENOMEM); - *prvp = prv; + /* + * Reserve resources for DDP, update the ttt that should be used + * in the PDU, and save DDP specific state for this I/O. + */ - cxgbei_conn_transfer_reserve_ttt(ic, prvp, io, transfer_tag); + MPASS(io_to_ppod_reservation(io) == NULL); + prsv = uma_zalloc(prsv_zone, M_NOWAIT); + if (prsv == NULL) { + rc = ENOMEM; + goto no_ddp; + } + + rc = t4_alloc_page_pods_for_buf(pr, buf, xferlen, prsv); + if (rc != 0) { + uma_zfree(prsv_zone, prsv); + goto no_ddp; + } + + rc = t4_write_page_pods_for_buf(sc, toep->ofld_txq, toep->tid, + prsv, buf, xferlen); + if (rc != 0) { + t4_free_page_pods(prsv); + uma_zfree(prsv_zone, prsv); + goto no_ddp; + } + + *tttp = htobe32(prsv->prsv_tag); + io_to_ppod_reservation(io) = prsv; + *arg = ctsio; + return (0); + } + + /* + * In the middle of an I/O. A non-NULL page pod reservation indicates + * that a DDP buffer is being used for the I/O. + */ + + prsv = io_to_ppod_reservation(ctsio); + if (prsv == NULL) + goto no_ddp; + + alias = (prsv->prsv_tag & pr->pr_alias_mask) >> pr->pr_alias_shift; + alias++; + prsv->prsv_tag &= ~pr->pr_alias_mask; + prsv->prsv_tag |= alias << pr->pr_alias_shift & pr->pr_alias_mask; + + *tttp = htobe32(prsv->prsv_tag); + *arg = ctsio; return (0); } void -icl_cxgbei_conn_transfer_done(struct icl_conn *ic, void *prv) +icl_cxgbei_conn_transfer_done(struct icl_conn *ic, void *arg) { - cxgbei_cleanup_task(ic, prv); - uma_zfree(icl_transfer_zone, prv); + struct ctl_scsiio *ctsio = arg; + + if (ctsio != NULL && ctsio->kern_data_len == ctsio->ext_data_filled) { + struct ppod_reservation *prsv; + + prsv = io_to_ppod_reservation(ctsio); + MPASS(prsv != NULL); + + t4_free_page_pods(prsv); + uma_zfree(prsv_zone, prsv); + } } static void @@ -882,9 +1059,12 @@ icl_cxgbei_mod_load(void) { int rc; - icl_transfer_zone = uma_zcreate("icl_transfer", - 16 * 1024, NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); + /* + * Space to track pagepod reservations. + */ + prsv_zone = uma_zcreate("Pagepod reservations", + sizeof(struct ppod_reservation), NULL, NULL, NULL, NULL, + CACHE_LINE_SIZE, 0); refcount_init(&icl_cxgbei_ncons, 0); @@ -903,7 +1083,7 @@ icl_cxgbei_mod_unload(void) icl_unregister("cxgbei", false); - uma_zdestroy(icl_transfer_zone); + uma_zdestroy(prsv_zone); return (0); } Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Sep 1 20:38:59 2016 (r305239) +++ head/sys/dev/cxgbe/offload.h Thu Sep 1 20:43:01 2016 (r305240) @@ -155,7 +155,6 @@ int t4_register_uld(struct uld_info *); int t4_unregister_uld(struct uld_info *); int t4_activate_uld(struct adapter *, int); int t4_deactivate_uld(struct adapter *, int); -void t4_iscsi_init(struct adapter *, u_int, const u_int *); int uld_active(struct adapter *, int); #endif #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Sep 1 20:38:59 2016 (r305239) +++ head/sys/dev/cxgbe/t4_main.c Thu Sep 1 20:43:01 2016 (r305240) @@ -8929,16 +8929,6 @@ t4_db_dropped(struct adapter *sc) } #ifdef TCP_OFFLOAD -void -t4_iscsi_init(struct adapter *sc, u_int tag_mask, const u_int *pgsz_order) -{ - - t4_write_reg(sc, A_ULP_RX_ISCSI_TAGMASK, tag_mask); - t4_write_reg(sc, A_ULP_RX_ISCSI_PSZ, V_HPZ0(pgsz_order[0]) | - V_HPZ1(pgsz_order[1]) | V_HPZ2(pgsz_order[2]) | - V_HPZ3(pgsz_order[3])); -} - static int toe_capability(struct vi_info *vi, int enable) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Sep 1 20:38:59 2016 (r305239) +++ head/sys/dev/cxgbe/t4_sge.c Thu Sep 1 20:43:01 2016 (r305240) @@ -575,11 +575,20 @@ t4_tweak_chip_settings(struct adapter *s V_TIMERVALUE5(us_to_core_ticks(sc, intr_timer[5])); t4_write_reg(sc, A_SGE_TIMER_VALUE_4_AND_5, v); - /* 4K, 16K, 64K, 256K DDP "page sizes" */ + /* 4K, 16K, 64K, 256K DDP "page sizes" for TDDP */ v = V_HPZ0(0) | V_HPZ1(2) | V_HPZ2(4) | V_HPZ3(6); t4_write_reg(sc, A_ULP_RX_TDDP_PSZ, v); - m = v = F_TDDPTAGTCB; + /* + * 4K, 8K, 16K, 64K DDP "page sizes" for iSCSI DDP. These have been + * chosen with MAXPHYS = 128K in mind. The largest DDP buffer that we + * may have to deal with is MAXPHYS + 1 page. + */ + v = V_HPZ0(0) | V_HPZ1(1) | V_HPZ2(2) | V_HPZ3(4); + t4_write_reg(sc, A_ULP_RX_ISCSI_PSZ, v); + + /* We use multiple DDP page sizes both in plain-TOE and ISCSI modes. */ + m = v = F_TDDPTAGTCB | F_ISCSITAGTCB; t4_set_reg_field(sc, A_ULP_RX_CTL, m, v); m = V_INDICATESIZE(M_INDICATESIZE) | F_REARMDDPOFFSET | *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Sep 1 20: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 1EC72BCC7EE; Thu, 1 Sep 2016 20:45:06 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E296DC89; Thu, 1 Sep 2016 20:45:05 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81Kj5TB052012; Thu, 1 Sep 2016 20:45:05 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Kj5hc052011; Thu, 1 Sep 2016 20:45:05 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609012045.u81Kj5hc052011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 1 Sep 2016 20:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305241 - head/lib/libc/stdio 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.22 Precedence: list List-Id: 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, 01 Sep 2016 20:45:06 -0000 Author: ache Date: Thu Sep 1 20:45:04 2016 New Revision: 305241 URL: https://svnweb.freebsd.org/changeset/base/305241 Log: fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete sequence near EOF), so we can't just check for (wc == WEOF && !__sfeof(fp)) and must relay on __sferror(fp) with __SERR clearing/restoring. MFC after: 7 days Modified: head/lib/libc/stdio/fgetwln.c Modified: head/lib/libc/stdio/fgetwln.c ============================================================================== --- head/lib/libc/stdio/fgetwln.c Thu Sep 1 20:43:01 2016 (r305240) +++ head/lib/libc/stdio/fgetwln.c Thu Sep 1 20:45:04 2016 (r305241) @@ -47,11 +47,16 @@ fgetwln_l(FILE * __restrict fp, size_t * { wint_t wc; size_t len; + int savserr; + FIX_LOCALE(locale); FLOCKFILE(fp); ORIENT(fp, 1); + savserr = fp->_flags & __SERR; + fp->_flags &= ~__SERR; + len = 0; while ((wc = __fgetwc(fp, locale)) != WEOF) { #define GROW 512 @@ -64,7 +69,12 @@ fgetwln_l(FILE * __restrict fp, size_t * if (wc == L'\n') break; } - if (len == 0 || (wc == WEOF && !__sfeof(fp))) + /* fgetwc(3) may set both __SEOF and __SERR at once. */ + if (__sferror(fp)) + goto error; + + fp->_flags |= savserr; + if (len == 0) goto error; FUNLOCKFILE(fp); From owner-svn-src-head@freebsd.org Thu Sep 1 21:15: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 7F43CBCB122; Thu, 1 Sep 2016 21:15:38 +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 5030D835; Thu, 1 Sep 2016 21:15:38 +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 u81LFbbH063020; Thu, 1 Sep 2016 21:15:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81LFbla063019; Thu, 1 Sep 2016 21:15:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609012115.u81LFbla063019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Sep 2016 21:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305244 - head/targets/pseudo/hosttools 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.22 Precedence: list List-Id: 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, 01 Sep 2016 21:15:38 -0000 Author: bdrewery Date: Thu Sep 1 21:15:37 2016 New Revision: 305244 URL: https://svnweb.freebsd.org/changeset/base/305244 Log: DIRDEPS_BUILD: Add missing crunchgen host tool. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/targets/pseudo/hosttools/Makefile.depend.host Modified: head/targets/pseudo/hosttools/Makefile.depend.host ============================================================================== --- head/targets/pseudo/hosttools/Makefile.depend.host Thu Sep 1 21:03:27 2016 (r305243) +++ head/targets/pseudo/hosttools/Makefile.depend.host Thu Sep 1 21:15:37 2016 (r305244) @@ -18,6 +18,7 @@ DIRDEPS = \ usr.bin/xlint/xlint \ usr.bin/yacc \ usr.sbin/config \ + usr.sbin/crunch/crunchgen.host \ .if ${MK_KERBEROS} != "no" DIRDEPS+= \ From owner-svn-src-head@freebsd.org Thu Sep 1 21:16: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 E4F1EBCB1B0; Thu, 1 Sep 2016 21:16:30 +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 B53619AE; Thu, 1 Sep 2016 21:16:30 +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 u81LGTlM063093; Thu, 1 Sep 2016 21:16:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81LGTiT063091; Thu, 1 Sep 2016 21:16:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609012116.u81LGTiT063091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Sep 2016 21:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305245 - in head: . release/doc/en_US.ISO8859-1/hardware 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.22 Precedence: list List-Id: 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, 01 Sep 2016 21:16:31 -0000 Author: jhb Date: Thu Sep 1 21:16:29 2016 New Revision: 305245 URL: https://svnweb.freebsd.org/changeset/base/305245 Log: Remove the digi(4) manpage and digi from the release notes. Modified: head/ObsoleteFiles.inc head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Sep 1 21:15:37 2016 (r305244) +++ head/ObsoleteFiles.inc Thu Sep 1 21:16:29 2016 (r305245) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160901: Remove digi(4) +OLD_FILES+=usr/share/man/man4/digi.4.gz # 20160819: Remove ie(4) OLD_FILES+=usr/share/man/man4/i386/ie.4.gz # 20160819: Remove spic(4) Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Sep 1 21:15:37 2016 (r305244) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Sep 1 21:16:29 2016 (r305245) @@ -1098,9 +1098,6 @@ [&arch.i386;] STB 4 port card using shared IRQ - [&arch.i386;] DigiBoard intelligent serial cards (digi - driver) - [&arch.amd64;, &arch.i386;] PCI-Based multi-port serial boards (&man.puc.4; driver) From owner-svn-src-head@freebsd.org Thu Sep 1 21:19: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 3B97CBCB2FF; Thu, 1 Sep 2016 21:19:12 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 195B4CAE; Thu, 1 Sep 2016 21:19:12 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81LJBjO063223; Thu, 1 Sep 2016 21:19:11 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81LJBWo063222; Thu, 1 Sep 2016 21:19:11 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201609012119.u81LJBWo063222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 1 Sep 2016 21:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305246 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 21:19:12 -0000 Author: jmcneill Date: Thu Sep 1 21:19:11 2016 New Revision: 305246 URL: https://svnweb.freebsd.org/changeset/base/305246 Log: Add support for setting DCDC2 voltage. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Thu Sep 1 21:16:29 2016 (r305245) +++ head/sys/arm/allwinner/axp81x.c Thu Sep 1 21:19:11 2016 (r305246) @@ -61,8 +61,13 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_AXP81X_REG, "AXP81x regulator", "AXP81x power regulator"); #define AXP_ICTYPE 0x03 +#define AXP_POWERCTL1 0x10 +#define AXP_POWERCTL1_DCDC2 (1 << 1) #define AXP_POWERCTL2 0x12 #define AXP_POWERCTL2_DC1SW (1 << 7) +#define AXP_VOLTCTL_DCDC2 0x21 +#define AXP_VOLTCTL_STATUS (1 << 7) +#define AXP_VOLTCTL_MASK 0x7f #define AXP_POWERBAT 0x32 #define AXP_POWERBAT_SHUTDOWN (1 << 7) #define AXP_IRQEN1 0x40 @@ -109,10 +114,18 @@ struct axp81x_regdef { char *supply_name; uint8_t enable_reg; uint8_t enable_mask; + uint8_t voltage_reg; + int voltage_min; + int voltage_max; + int voltage_step1; + int voltage_nstep1; + int voltage_step2; + int voltage_nstep2; }; enum axp81x_reg_id { - AXP81X_REG_ID_DC1SW + AXP81X_REG_ID_DC1SW, + AXP81X_REG_ID_DCDC2, }; static struct axp81x_regdef axp81x_regdefs[] = { @@ -122,6 +135,19 @@ static struct axp81x_regdef axp81x_regde .enable_reg = AXP_POWERCTL2, .enable_mask = AXP_POWERCTL2_DC1SW, }, + { + .id = AXP81X_REG_ID_DCDC2, + .name = "dcdc2", + .enable_reg = AXP_POWERCTL1, + .enable_mask = AXP_POWERCTL1_DCDC2, + .voltage_reg = AXP_VOLTCTL_DCDC2, + .voltage_min = 500, + .voltage_max = 1300, + .voltage_step1 = 10, + .voltage_nstep1 = 70, + .voltage_step2 = 20, + .voltage_nstep2 = 5, + }, }; struct axp81x_softc; @@ -218,17 +244,82 @@ axp81x_regnode_enable(struct regnode *re return (0); } +static void +axp81x_regnode_reg_to_voltage(struct axp81x_reg_sc *sc, uint8_t val, int *uv) +{ + if (val < sc->def->voltage_nstep1) + *uv = sc->def->voltage_min + val * sc->def->voltage_step1; + else + *uv = sc->def->voltage_min + + (sc->def->voltage_nstep1 * sc->def->voltage_step1) + + ((val - sc->def->voltage_nstep1) * sc->def->voltage_step2); + *uv *= 1000; +} + +static int +axp81x_regnode_voltage_to_reg(struct axp81x_reg_sc *sc, int min_uvolt, + int max_uvolt, uint8_t *val) +{ + uint8_t nval; + int nstep, uvolt; + + nval = 0; + uvolt = sc->def->voltage_min * 1000; + + for (nstep = 0; nstep < sc->def->voltage_nstep1 && uvolt < min_uvolt; + nstep++) { + ++nval; + uvolt += (sc->def->voltage_step1 * 1000); + } + for (nstep = 0; nstep < sc->def->voltage_nstep2 && uvolt < min_uvolt; + nstep++) { + ++nval; + uvolt += (sc->def->voltage_step2 * 1000); + } + if (uvolt > max_uvolt) + return (EINVAL); + + *val = nval; + return (0); +} + static int axp81x_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) { - return (ENXIO); + struct axp81x_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step1 || !sc->def->voltage_step2) + return (ENXIO); + + if (axp81x_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) + return (ERANGE); + + axp81x_write(sc->base_dev, sc->def->voltage_reg, val); + + *udelay = 0; + + return (0); } static int axp81x_regnode_get_voltage(struct regnode *regnode, int *uvolt) { - return (ENXIO); + struct axp81x_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step1 || !sc->def->voltage_step2) + return (ENXIO); + + axp81x_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + axp81x_regnode_reg_to_voltage(sc, val & AXP_VOLTCTL_MASK, uvolt); + + return (0); } static regnode_method_t axp81x_regnode_methods[] = { @@ -519,6 +610,10 @@ axp81x_reg_attach(device_t dev, phandle_ memset(&initdef, 0, sizeof(initdef)); regulator_parse_ofw_stdparam(dev, node, &initdef); + if (initdef.std_param.min_uvolt == 0) + initdef.std_param.min_uvolt = def->voltage_min * 1000; + if (initdef.std_param.max_uvolt == 0) + initdef.std_param.max_uvolt = def->voltage_max * 1000; initdef.id = def->id; initdef.ofw_node = node; regnode = regnode_create(dev, &axp81x_regnode_class, &initdef); From owner-svn-src-head@freebsd.org Thu Sep 1 21:20: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 F1FC8BCB3DE; Thu, 1 Sep 2016 21:20:08 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B6E45EAA; Thu, 1 Sep 2016 21:20:08 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81LK7GP063317; Thu, 1 Sep 2016 21:20:07 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81LK7rN063316; Thu, 1 Sep 2016 21:20:07 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201609012120.u81LK7rN063316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 1 Sep 2016 21:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305247 - head/sys/arm/allwinner/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.22 Precedence: list List-Id: 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, 01 Sep 2016 21:20:09 -0000 Author: jmcneill Date: Thu Sep 1 21:20:07 2016 New Revision: 305247 URL: https://svnweb.freebsd.org/changeset/base/305247 Log: Add support for changing A23 PLL1 frequency. Modified: head/sys/arm/allwinner/clk/aw_pll.c Modified: head/sys/arm/allwinner/clk/aw_pll.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c Thu Sep 1 21:19:11 2016 (r305246) +++ head/sys/arm/allwinner/clk/aw_pll.c Thu Sep 1 21:20:07 2016 (r305247) @@ -110,14 +110,14 @@ __FBSDID("$FreeBSD$"); #define A13_PLL2_PRE_DIV (0x1f << 0) #define A13_PLL2_PRE_DIV_SHIFT 0 +#define A23_PLL1_FACTOR_P (0x3 << 16) +#define A23_PLL1_FACTOR_P_SHIFT 16 #define A23_PLL1_FACTOR_N (0x1f << 8) #define A23_PLL1_FACTOR_N_SHIFT 8 #define A23_PLL1_FACTOR_K (0x3 << 4) #define A23_PLL1_FACTOR_K_SHIFT 4 #define A23_PLL1_FACTOR_M (0x3 << 0) #define A23_PLL1_FACTOR_M_SHIFT 0 -#define A23_PLL1_FACTOR_P (0x3 << 16) -#define A23_PLL1_FACTOR_P_SHIFT 16 #define A31_PLL1_LOCK (1 << 28) #define A31_PLL1_CPU_SIGMA_DELTA_EN (1 << 24) @@ -171,6 +171,24 @@ __FBSDID("$FreeBSD$"); #define CLKID_A31_PLL6 0 #define CLKID_A31_PLL6_X2 1 +struct aw_pll_factor { + unsigned int n; + unsigned int k; + unsigned int m; + unsigned int p; + uint64_t freq; +}; +#define PLLFACTOR(_n, _k, _m, _p, _freq) \ + { .n = (_n), .k = (_k), .m = (_m), .p = (_p), .freq = (_freq) } + +static struct aw_pll_factor aw_a23_pll1_factors[] = { + PLLFACTOR(16, 0, 0, 0, 408000000), + PLLFACTOR(26, 0, 0, 0, 648000000), + PLLFACTOR(16, 1, 0, 0, 816000000), + PLLFACTOR(20, 1, 0, 0, 1008000000), + PLLFACTOR(24, 1, 0, 0, 1200000000), +}; + enum aw_pll_type { AWPLL_A10_PLL1 = 1, AWPLL_A10_PLL2, @@ -557,6 +575,39 @@ a13_pll2_set_freq(struct aw_pll_sc *sc, } static int +a23_pll1_set_freq(struct aw_pll_sc *sc, uint64_t fin, uint64_t *fout, + int flags) +{ + struct aw_pll_factor *f; + uint32_t val; + int n; + + f = NULL; + for (n = 0; n < nitems(aw_a23_pll1_factors); n++) { + if (aw_a23_pll1_factors[n].freq == *fout) { + f = &aw_a23_pll1_factors[n]; + break; + } + } + if (f == NULL) + return (EINVAL); + + DEVICE_LOCK(sc); + PLL_READ(sc, &val); + val &= ~(A23_PLL1_FACTOR_N|A23_PLL1_FACTOR_K|A23_PLL1_FACTOR_M| + A23_PLL1_FACTOR_P); + val |= (f->n << A23_PLL1_FACTOR_N_SHIFT); + val |= (f->k << A23_PLL1_FACTOR_K_SHIFT); + val |= (f->m << A23_PLL1_FACTOR_M_SHIFT); + val |= (f->p << A23_PLL1_FACTOR_P_SHIFT); + PLL_WRITE(sc, val); + DEVICE_UNLOCK(sc); + + return (0); + +} + +static int a23_pll1_recalc(struct aw_pll_sc *sc, uint64_t *freq) { uint32_t val, m, n, k, p; @@ -719,7 +770,7 @@ static struct aw_pll_funcs aw_pll_func[] PLL(AWPLL_A10_PLL5, a10_pll5_recalc, NULL, NULL), PLL(AWPLL_A10_PLL6, a10_pll6_recalc, a10_pll6_set_freq, a10_pll6_init), PLL(AWPLL_A13_PLL2, a13_pll2_recalc, a13_pll2_set_freq, NULL), - PLL(AWPLL_A23_PLL1, a23_pll1_recalc, NULL, NULL), + PLL(AWPLL_A23_PLL1, a23_pll1_recalc, a23_pll1_set_freq, NULL), PLL(AWPLL_A31_PLL1, a31_pll1_recalc, NULL, NULL), PLL(AWPLL_A31_PLL6, a31_pll6_recalc, NULL, a31_pll6_init), PLL(AWPLL_A80_PLL4, a80_pll4_recalc, NULL, NULL), From owner-svn-src-head@freebsd.org Thu Sep 1 21:30: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 BDE1ABCBA5B; Thu, 1 Sep 2016 21:30: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 8DBF02BA7; Thu, 1 Sep 2016 21:30: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 u81LUC9U067189; Thu, 1 Sep 2016 21:30:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81LUCiu067188; Thu, 1 Sep 2016 21:30:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609012130.u81LUCiu067188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Sep 2016 21:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305248 - head/share/man/man9 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.22 Precedence: list List-Id: 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, 01 Sep 2016 21:30:13 -0000 Author: jhb Date: Thu Sep 1 21:30:12 2016 New Revision: 305248 URL: https://svnweb.freebsd.org/changeset/base/305248 Log: Remove warning about pci_addr_t being different sizes. pci_addr_t has always been 64-bits since r163805. MFC after: 1 week Modified: head/share/man/man9/pci.9 Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Thu Sep 1 21:20:07 2016 (r305247) +++ head/share/man/man9/pci.9 Thu Sep 1 21:30:12 2016 (r305248) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2016 +.Dd September 1, 2016 .Dt PCI 9 .Os .Sh NAME @@ -910,11 +910,6 @@ with one in the new distribution. The .Fn pci_remap_msix function will fail if this condition is not met. -.Sh IMPLEMENTATION NOTES -The -.Vt pci_addr_t -type varies according to the size of the PCI bus address -space on the target architecture. .Sh SEE ALSO .Xr pci 4 , .Xr pciconf 8 , From owner-svn-src-head@freebsd.org Thu Sep 1 21: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 CC93EBCC215; Thu, 1 Sep 2016 21:43:52 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA010BEB; Thu, 1 Sep 2016 21:43:52 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 4C8EF5A9F27; Thu, 1 Sep 2016 21:43:51 +0000 (UTC) Date: Thu, 1 Sep 2016 21:43:51 +0000 From: Brooks Davis To: "Ngie Cooper (yaneurabeya)" Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305170 - head/lib/atf/libatf-c Message-ID: <20160901214351.GF29873@spindle.one-eyed-alien.net> References: <201609010242.u812gBkP037525@repo.freebsd.org> <20160901165446.GE29873@spindle.one-eyed-alien.net> <7204E623-223E-40FB-BED5-50A59A7622E1@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VdOwlNaOFKGAtAAV" Content-Disposition: inline In-Reply-To: <7204E623-223E-40FB-BED5-50A59A7622E1@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 21:43:52 -0000 --VdOwlNaOFKGAtAAV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 01, 2016 at 11:43:48AM -0700, Ngie Cooper (yaneurabeya) wrote: >=20 > > On Sep 1, 2016, at 09:54, Brooks Davis wrote: >=20 > > I've run into to some problems with them on CheriBSD because the > > external compiler isn't available on the test target, but isn't listed > > as a dependency. These tests should declare a dependency on CC, etc > > as appropriate and be skipped if it isn't there. I'm not actually > > convinced this shouldn't just use cc, cpp, and c++. (That would be > > wrong for CheriBSD, but closer to right for current cases in FreeBSD). >=20 > Agreed. I???ll add the necessary required.progs metadata soon. Thanks. That will be helpful. -- Brooks --VdOwlNaOFKGAtAAV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJXyKEWAAoJEKzQXbSebgfA8hMH/RByAJZyd6ixEGqPdiKP7COM CCw3J+qNmWTSNwmwDCt4g+O19lyz08i+0OGMllQbXsTpSaA4+G3mFpJes8o/HA3A dRvUeN0AYgOtfvBksOiLoAWWduo7ONb29gDqDEJPp0/yNJ0WHd/1HrbypTdw9Gyq NfSIJfnBf4FNESRTxKQr887ERbrBwgt3oAnue2yuWRzH94B32pa1g0YKj4culfjf kWIFzIvoQkVEueXmO0yEYABvk+lcl+0TEEl9KTO1YKpznNXUdHMfA5SESjU2IqR7 h+8/K269buzReB6qSPTt+xEHrQARxh9TS5fWCtkibZ8SCz9hN2LDqIc3bQ0k3Zs= =ytl2 -----END PGP SIGNATURE----- --VdOwlNaOFKGAtAAV-- From owner-svn-src-head@freebsd.org Thu Sep 1 22:40: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 84652BCCF20; Thu, 1 Sep 2016 22:40:56 +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 5BA6EC70; Thu, 1 Sep 2016 22:40:56 +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 u81MetY4094238; Thu, 1 Sep 2016 22:40:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Meth4094206; Thu, 1 Sep 2016 22:40:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609012240.u81Meth4094206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 1 Sep 2016 22:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305251 - head/sys/dev/cxgbe/cxgbei 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.22 Precedence: list List-Id: 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, 01 Sep 2016 22:40:56 -0000 Author: np Date: Thu Sep 1 22:40:55 2016 New Revision: 305251 URL: https://svnweb.freebsd.org/changeset/base/305251 Log: cxgbe/cxgbei: Minor changes in the iSCSI CPL handlers. - Use m_copydata instead of bcopy. - Add new assertions. - Log some more information. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Sep 1 22:27:47 2016 (r305250) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Sep 1 22:40:55 2016 (r305251) @@ -181,15 +181,18 @@ do_rx_iscsi_hdr(struct sge_iq *iq, const struct toepcb *toep = lookup_tid(sc, tid); struct icl_pdu *ip; struct icl_cxgbei_pdu *icp; + uint16_t len_ddp = be16toh(cpl->pdu_len_ddp); + uint16_t len = be16toh(cpl->len); M_ASSERTPKTHDR(m); + MPASS(m->m_pkthdr.len == len + sizeof(*cpl)); ip = icl_cxgbei_new_pdu(M_NOWAIT); if (ip == NULL) CXGBE_UNIMPLEMENTED("PDU allocation failure"); + m_copydata(m, sizeof(*cpl), ISCSI_BHS_SIZE, (caddr_t)ip->ip_bhs); + ip->ip_data_len = G_ISCSI_PDU_LEN(len_ddp) - len; icp = ip_to_icp(ip); - bcopy(mtod(m, caddr_t) + sizeof(*cpl), icp->ip.ip_bhs, sizeof(struct - iscsi_bhs)); icp->icp_seq = ntohl(cpl->seq); icp->icp_flags = ICPF_RX_HDR; @@ -198,8 +201,8 @@ do_rx_iscsi_hdr(struct sge_iq *iq, const toep->ulpcb2 = icp; #if 0 - CTR4(KTR_CXGBE, "%s: tid %u, cpl->len hlen %u, m->m_len hlen %u", - __func__, tid, ntohs(cpl->len), m->m_len); + CTR5(KTR_CXGBE, "%s: tid %u, cpl->len %u, pdu_len_ddp 0x%04x, icp %p", + __func__, tid, len, len_ddp, icp); #endif m_freem(m); @@ -216,22 +219,23 @@ do_rx_iscsi_data(struct sge_iq *iq, cons struct icl_cxgbei_pdu *icp = toep->ulpcb2; M_ASSERTPKTHDR(m); + MPASS(m->m_pkthdr.len == be16toh(cpl->len) + sizeof(*cpl)); /* Must already have received the header (but not the data). */ MPASS(icp != NULL); MPASS(icp->icp_flags == ICPF_RX_HDR); MPASS(icp->ip.ip_data_mbuf == NULL); - MPASS(icp->ip.ip_data_len == 0); + m_adj(m, sizeof(*cpl)); + MPASS(icp->ip.ip_data_len == m->m_pkthdr.len); icp->icp_flags |= ICPF_RX_FLBUF; icp->ip.ip_data_mbuf = m; - icp->ip.ip_data_len = m->m_pkthdr.len; #if 0 - CTR4(KTR_CXGBE, "%s: tid %u, cpl->len dlen %u, m->m_len dlen %u", - __func__, tid, ntohs(cpl->len), m->m_len); + CTR3(KTR_CXGBE, "%s: tid %u, cpl->len %u", __func__, tid, + be16toh(cpl->len)); #endif return (0); @@ -259,20 +263,30 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const /* Must already be assembling a PDU. */ MPASS(icp != NULL); MPASS(icp->icp_flags & ICPF_RX_HDR); /* Data is optional. */ - ip = &icp->ip; + MPASS((icp->icp_flags & ICPF_RX_STATUS) == 0); + + pdu_len = be16toh(cpl->len); /* includes everything. */ + val = be32toh(cpl->ddpvld); + +#if 0 + CTR4(KTR_CXGBE, + "%s: tid %u, cpl->len %u, ddpvld 0x%08x, icp_flags 0x%08x", + __func__, tid, pdu_len, val, icp->icp_flags); +#endif + icp->icp_flags |= ICPF_RX_STATUS; - val = ntohl(cpl->ddpvld); + ip = &icp->ip; if (val & F_DDP_PADDING_ERR) icp->icp_flags |= ICPF_PAD_ERR; if (val & F_DDP_HDRCRC_ERR) icp->icp_flags |= ICPF_HCRC_ERR; if (val & F_DDP_DATACRC_ERR) icp->icp_flags |= ICPF_DCRC_ERR; - if (ip->ip_data_mbuf == NULL) { - /* XXXNP: what should ip->ip_data_len be, and why? */ + if (val & F_DDP_PDU && ip->ip_data_mbuf == NULL) { + MPASS((icp->icp_flags & ICPF_RX_FLBUF) == 0); + MPASS(ip->ip_data_len > 0); icp->icp_flags |= ICPF_RX_DDP; } - pdu_len = ntohs(cpl->len); /* includes everything. */ INP_WLOCK(inp); if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT))) { @@ -358,11 +372,6 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const m_freem(m); } -#if 0 - CTR4(KTR_CXGBE, "%s: tid %u, pdu_len %u, pdu_flags 0x%x", - __func__, tid, pdu_len, icp->icp_flags); -#endif - STAILQ_INSERT_TAIL(&icc->rcvd_pdus, ip, ip_next); if ((icc->rx_flags & RXF_ACTIVE) == 0) { struct cxgbei_worker_thread_softc *cwt = &cwt_softc[icc->cwt]; From owner-svn-src-head@freebsd.org Thu Sep 1 23:20: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 350B9BCC7A0; Thu, 1 Sep 2016 23:20: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 0292C154; Thu, 1 Sep 2016 23:20:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81NKtB5009252; Thu, 1 Sep 2016 23:20:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81NKtox009251; Thu, 1 Sep 2016 23:20:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609012320.u81NKtox009251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Sep 2016 23:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305253 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 23:20:56 -0000 Author: bdrewery Date: Thu Sep 1 23:20:54 2016 New Revision: 305253 URL: https://svnweb.freebsd.org/changeset/base/305253 Log: META_MODE: Don't expect .meta files for side-effect generated files. This is similar to r301285. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu Sep 1 22:58:53 2016 (r305252) +++ head/share/mk/bsd.crunchgen.mk Thu Sep 1 23:20:54 2016 (r305253) @@ -112,6 +112,7 @@ CRUNCHENV+= MK_TESTS=no \ _RECURSING_CRUNCH=1 .ORDER: ${OUTPUTS} objs ${OUTPUTS:[1]}: .META +${OUTPUTS:[2..-1]}: .NOMETA ${OUTPUTS}: ${CONF} MAKE=${MAKE} ${CRUNCHENV:NMK_AUTO_OBJ=*} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ MK_AUTO_OBJ=${MK_AUTO_OBJ} \ From owner-svn-src-head@freebsd.org Thu Sep 1 23:21: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 9014DBCC8B9; Thu, 1 Sep 2016 23:21: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 462F43E9; Thu, 1 Sep 2016 23:21: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 u81NL8qA009306; Thu, 1 Sep 2016 23:21:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81NL8Y0009304; Thu, 1 Sep 2016 23:21:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609012321.u81NL8Y0009304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Sep 2016 23:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305254 - in head: share/mk usr.sbin/crunch/crunchgen 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.22 Precedence: list List-Id: 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, 01 Sep 2016 23:21:09 -0000 Author: bdrewery Date: Thu Sep 1 23:21:08 2016 New Revision: 305254 URL: https://svnweb.freebsd.org/changeset/base/305254 Log: META_MODE/DIRDEPS_BUILD: Fix various issues with crunch builds. - DIRDEPS_BUILD: Fix crunchgen builds losing their library dependencies on a nop-rebuild. - META_MODE: Fix not rebuilding various crunch.mk targets if their .meta files warrant a rebuild. They were lacking .meta files previously. This adds .NOMETA to the crunch objects being used since they are already built. Bmake was forcing a rebuild on them since their .meta files were not in the expected place; there is no reason to rebuild them. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu Sep 1 23:20:54 2016 (r305253) +++ head/share/mk/bsd.crunchgen.mk Thu Sep 1 23:21:08 2016 (r305254) @@ -123,11 +123,13 @@ ${OUTPUTS}: ${CONF} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. -${PROG}: ${OUTPUTS} objs .META +${PROG}: ${OUTPUTS} objs .NOMETA .PHONY ${CRUNCHENV} \ CC="${CC} ${CFLAGS} ${LDFLAGS}" \ CXX="${CXX} ${CXXFLAGS} ${LDFLAGS}" \ - ${MAKE} .MAKE.MODE=normal -f ${OUTMK} exe + ${MAKE} .MAKE.MODE="${.MAKE.MODE} curdirOk=yes" \ + .MAKE.META.IGNORE_PATHS="${.MAKE.META.IGNORE_PATHS}" \ + -f ${OUTMK} exe objs: ${OUTMK} .META ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ @@ -167,3 +169,4 @@ clean: fi META_XTRAS+= ${find ${CRUNCHOBJS}${SRCTOP} -name '*.meta' 2>/dev/null || true:L:sh} +META_XTRAS+= ${PROG}.meta Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Thu Sep 1 23:20:54 2016 (r305253) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Thu Sep 1 23:21:08 2016 (r305254) @@ -1064,6 +1064,7 @@ prog_makefile_rules(FILE *outmk, prog_t } fprintf(outmk, "\n"); } + fprintf(outmk, "$(%s_OBJPATHS): .NOMETA\n", p->ident); if (p->srcdir && p->objs) { fprintf(outmk, "%s_SRCDIR=%s\n", p->ident, p->srcdir); From owner-svn-src-head@freebsd.org Thu Sep 1 23:21: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 71B18BCC8EE; Thu, 1 Sep 2016 23:21: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 4469A62C; Thu, 1 Sep 2016 23:21: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 u81NLCYr009354; Thu, 1 Sep 2016 23:21:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81NLCsO009353; Thu, 1 Sep 2016 23:21:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609012321.u81NLCsO009353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Sep 2016 23:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305255 - head/targets/pseudo/bootstrap-tools 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.22 Precedence: list List-Id: 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, 01 Sep 2016 23:21:13 -0000 Author: bdrewery Date: Thu Sep 1 23:21:12 2016 New Revision: 305255 URL: https://svnweb.freebsd.org/changeset/base/305255 Log: DIRDEPS_BUILD: Fix 'make bootstrap-tools' not using the proper tblgen binaries. This was an incomplete item from r291561. The host {clang,llvm}-tblgen binaries were used, rather than the ones built into the host stagedir by normal Makefile.depend dependencies on tblgen. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/targets/pseudo/bootstrap-tools/Makefile Modified: head/targets/pseudo/bootstrap-tools/Makefile ============================================================================== --- head/targets/pseudo/bootstrap-tools/Makefile Thu Sep 1 23:21:08 2016 (r305254) +++ head/targets/pseudo/bootstrap-tools/Makefile Thu Sep 1 23:21:12 2016 (r305255) @@ -78,6 +78,8 @@ BSTCENV= \ BSTCARGS= \ ${BSARGS:NDESTDIR=*:NOBJTOP=*:NOBJROOT=*:NMK_CROSS_COMPILER=*:NMK_CLANG=*:NMK_GCC=*} \ BUILD_DIRDEPS=yes \ + LLVM_TBLGEN=${TOOLSDIR}/usr/bin/llvm-tblgen \ + CLANG_TBLGEN=${TOOLSDIR}/usr/bin/clang-tblgen \ -DWITH_STAGING \ -DWITH_TOOLSDIR From owner-svn-src-head@freebsd.org Thu Sep 1 23:22: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 398F1BCC97C; Thu, 1 Sep 2016 23:22: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 02174A0D; Thu, 1 Sep 2016 23:22:32 +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 u81NMWTS012308; Thu, 1 Sep 2016 23:22:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81NMWQm012306; Thu, 1 Sep 2016 23:22:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609012322.u81NMWQm012306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Sep 2016 23:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305256 - in 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.22 Precedence: list List-Id: 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, 01 Sep 2016 23:22:33 -0000 Author: bdrewery Date: Thu Sep 1 23:22:31 2016 New Revision: 305256 URL: https://svnweb.freebsd.org/changeset/base/305256 Log: Bump __FreeBSD_version for crunchgen META_MODE fix in r305254. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/sys/sys/param.h Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Sep 1 23:21:12 2016 (r305255) +++ head/Makefile.inc1 Thu Sep 1 23:22:31 2016 (r305256) @@ -1628,8 +1628,10 @@ _crunchide= usr.sbin/crunch/crunchide # r285986 crunchen: use STRIPBIN rather than STRIP # 1100113: Support MK_AUTO_OBJ +# 1200006: META_MODE fixes .if ${BOOTSTRAPPING} < 1100078 || \ - (${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) + (${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) || \ + (${MK_META_MODE} == "yes" && ${BOOTSTRAPPING} < 1200006) _crunchgen= usr.sbin/crunch/crunchgen .endif Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Sep 1 23:21:12 2016 (r305255) +++ head/sys/sys/param.h Thu Sep 1 23:22:31 2016 (r305256) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200005 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200006 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Sep 1 23:52: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 0BD64BCC060; Thu, 1 Sep 2016 23:52:22 +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 CD3A98DB; Thu, 1 Sep 2016 23:52:21 +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 u81NqKLW023463; Thu, 1 Sep 2016 23:52:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81NqKlP023462; Thu, 1 Sep 2016 23:52:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609012352.u81NqKlP023462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Sep 2016 23:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305257 - 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.22 Precedence: list List-Id: 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, 01 Sep 2016 23:52:22 -0000 Author: bdrewery Date: Thu Sep 1 23:52:20 2016 New Revision: 305257 URL: https://svnweb.freebsd.org/changeset/base/305257 Log: DIRDEPS_BUILD: Include crunched object meta files for gendirdeps. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu Sep 1 23:22:31 2016 (r305256) +++ head/share/mk/bsd.crunchgen.mk Thu Sep 1 23:52:20 2016 (r305257) @@ -169,4 +169,5 @@ clean: fi META_XTRAS+= ${find ${CRUNCHOBJS}${SRCTOP} -name '*.meta' 2>/dev/null || true:L:sh} +META_XTRAS+= ${echo ${CRUNCHOBJS}/*.lo.meta 2>/dev/null || true:L:sh} META_XTRAS+= ${PROG}.meta From owner-svn-src-head@freebsd.org Thu Sep 1 23:52: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 B1C5DBCC088; Thu, 1 Sep 2016 23:52: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 7C29193C; Thu, 1 Sep 2016 23:52: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 u81NqPWs023513; Thu, 1 Sep 2016 23:52:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81NqPi4023510; Thu, 1 Sep 2016 23:52:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609012352.u81NqPi4023510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Sep 2016 23:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305258 - in head: rescue/rescue targets/pseudo/hosttools tools/bsdbox 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.22 Precedence: list List-Id: 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, 01 Sep 2016 23:52:26 -0000 Author: bdrewery Date: Thu Sep 1 23:52:25 2016 New Revision: 305258 URL: https://svnweb.freebsd.org/changeset/base/305258 Log: DIRDEPS_BUILD: Build crunchide for the host. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/rescue/rescue/Makefile.depend head/targets/pseudo/hosttools/Makefile.depend.host head/tools/bsdbox/Makefile.depend Modified: head/rescue/rescue/Makefile.depend ============================================================================== --- head/rescue/rescue/Makefile.depend Thu Sep 1 23:52:20 2016 (r305257) +++ head/rescue/rescue/Makefile.depend Thu Sep 1 23:52:25 2016 (r305258) @@ -52,6 +52,7 @@ DIRDEPS = \ usr.bin/lex/lib \ usr.bin/yacc.host \ usr.sbin/crunch/crunchgen.host \ + usr.sbin/crunch/crunchide.host \ .include Modified: head/targets/pseudo/hosttools/Makefile.depend.host ============================================================================== --- head/targets/pseudo/hosttools/Makefile.depend.host Thu Sep 1 23:52:20 2016 (r305257) +++ head/targets/pseudo/hosttools/Makefile.depend.host Thu Sep 1 23:52:25 2016 (r305258) @@ -18,7 +18,9 @@ DIRDEPS = \ usr.bin/xlint/xlint \ usr.bin/yacc \ usr.sbin/config \ - usr.sbin/crunch/crunchgen.host \ + usr.sbin/crunch/crunchgen \ + usr.sbin/crunch/crunchide \ + .if ${MK_KERBEROS} != "no" DIRDEPS+= \ Modified: head/tools/bsdbox/Makefile.depend ============================================================================== --- head/tools/bsdbox/Makefile.depend Thu Sep 1 23:52:20 2016 (r305257) +++ head/tools/bsdbox/Makefile.depend Thu Sep 1 23:52:25 2016 (r305258) @@ -47,6 +47,9 @@ DIRDEPS = \ secure/lib/libcrypto \ secure/lib/libssl \ usr.bin/lex/lib \ + usr.bin/yacc.host \ + usr.sbin/crunch/crunchgen.host \ + usr.sbin/crunch/crunchide.host \ .include From owner-svn-src-head@freebsd.org Thu Sep 1 23:56: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 4BAD1BCC1DC; Thu, 1 Sep 2016 23:56:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BEC2C21; Thu, 1 Sep 2016 23:56:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81Nu2lr023686; Thu, 1 Sep 2016 23:56:02 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81Nu2B9023685; Thu, 1 Sep 2016 23:56:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201609012356.u81Nu2B9023685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 1 Sep 2016 23:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305259 - head/sys/dev/ioat 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.22 Precedence: list List-Id: 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, 01 Sep 2016 23:56:03 -0000 Author: cem Date: Thu Sep 1 23:56:02 2016 New Revision: 305259 URL: https://svnweb.freebsd.org/changeset/base/305259 Log: ioat(4): Despam relatively common hardware reset messages Reported by: ngie@ Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Thu Sep 1 23:52:25 2016 (r305258) +++ head/sys/dev/ioat/ioat.c Thu Sep 1 23:56:02 2016 (r305259) @@ -750,13 +750,13 @@ out: * Fatal programming error on this DMA channel. Flush any outstanding * work with error status and restart the engine. */ - ioat_log_message(0, "Channel halted due to fatal programming error\n"); mtx_lock(&ioat->submit_lock); mtx_lock(&ioat->cleanup_lock); ioat->quiescing = TRUE; chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); - ioat_halted_debug(ioat, chanerr); + if (1 <= g_ioat_debug_level) + ioat_halted_debug(ioat, chanerr); ioat->stats.last_halt_chanerr = chanerr; while (ioat_get_active(ioat) > 0) { From owner-svn-src-head@freebsd.org Thu Sep 1 23:57: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 9344BBCC442; Thu, 1 Sep 2016 23:57:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7430DDA8; Thu, 1 Sep 2016 23:57:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9CAFD10AF73; Thu, 1 Sep 2016 19:57:45 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305245 - in head: . release/doc/en_US.ISO8859-1/hardware Date: Thu, 01 Sep 2016 14:50:26 -0700 Message-ID: <1629468.4Mznr3zCZh@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201609012116.u81LGTiT063091@repo.freebsd.org> References: <201609012116.u81LGTiT063091@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 01 Sep 2016 19:57:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 01 Sep 2016 23:57:47 -0000 On Thursday, September 01, 2016 09:16:29 PM John Baldwin wrote: > Author: jhb > Date: Thu Sep 1 21:16:29 2016 > New Revision: 305245 > URL: https://svnweb.freebsd.org/changeset/base/305245 > > Log: > Remove the digi(4) manpage and digi from the release notes. We still list sio(4) in the release notes even though its disconnected from the build. (Which means we've been listing it in releases since 8.0 even though it doesn't compile and isn't shipped.) We should probably make sure we aren't listing any other disconnected drivers in the hardware notes. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Sep 1 23:58: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 47A47BCC49D; Thu, 1 Sep 2016 23:58:38 +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 25A19F1A; Thu, 1 Sep 2016 23:58:38 +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 u81NwbZR023805; Thu, 1 Sep 2016 23:58:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81NwbH6023802; Thu, 1 Sep 2016 23:58:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609012358.u81NwbH6023802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 1 Sep 2016 23:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305260 - head/sys/dev/cxgbe/cxgbei 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.22 Precedence: list List-Id: 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, 01 Sep 2016 23:58:38 -0000 Author: np Date: Thu Sep 1 23:58:36 2016 New Revision: 305260 URL: https://svnweb.freebsd.org/changeset/base/305260 Log: cxgbe/cxgbei: Count various events related to iSCSI operation and make these counters available in the sysctl MIB. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/cxgbei/cxgbei.h head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Sep 1 23:56:02 2016 (r305259) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Sep 1 23:58:36 2016 (r305260) @@ -101,6 +101,50 @@ void icl_cxgbei_new_pdu_set_conn(struct void icl_cxgbei_conn_pdu_free(struct icl_conn *, struct icl_pdu *); static void +free_ci_counters(struct cxgbei_data *ci) +{ + +#define FREE_CI_COUNTER(x) do { \ + if (ci->x != NULL) { \ + counter_u64_free(ci->x); \ + ci->x = NULL; \ + } \ +} while (0) + + FREE_CI_COUNTER(ddp_setup_ok); + FREE_CI_COUNTER(ddp_setup_error); + FREE_CI_COUNTER(ddp_bytes); + FREE_CI_COUNTER(ddp_pdus); + FREE_CI_COUNTER(fl_bytes); + FREE_CI_COUNTER(fl_pdus); +#undef FREE_CI_COUNTER +} + +static int +alloc_ci_counters(struct cxgbei_data *ci) +{ + +#define ALLOC_CI_COUNTER(x) do { \ + ci->x = counter_u64_alloc(M_WAITOK); \ + if (ci->x == NULL) \ + goto fail; \ +} while (0) + + ALLOC_CI_COUNTER(ddp_setup_ok); + ALLOC_CI_COUNTER(ddp_setup_error); + ALLOC_CI_COUNTER(ddp_bytes); + ALLOC_CI_COUNTER(ddp_pdus); + ALLOC_CI_COUNTER(fl_bytes); + ALLOC_CI_COUNTER(fl_pdus); +#undef ALLOC_CI_COUNTER + + return (0); +fail: + free_ci_counters(ci); + return (ENOMEM); +} + +static void read_pdu_limits(struct adapter *sc, uint32_t *max_tx_pdu_len, uint32_t *max_rx_pdu_len) { @@ -133,6 +177,8 @@ read_pdu_limits(struct adapter *sc, uint static int cxgbei_init(struct adapter *sc, struct cxgbei_data *ci) { + struct sysctl_oid *oid; + struct sysctl_oid_list *children; struct ppod_region *pr; uint32_t r; int rc; @@ -140,6 +186,10 @@ cxgbei_init(struct adapter *sc, struct c MPASS(sc->vres.iscsi.size > 0); MPASS(ci != NULL); + rc = alloc_ci_counters(ci); + if (rc != 0) + return (rc); + read_pdu_limits(sc, &ci->max_tx_pdu_len, &ci->max_rx_pdu_len); ci->ddp_threshold = 2048; @@ -151,6 +201,7 @@ cxgbei_init(struct adapter *sc, struct c device_printf(sc->dev, "%s: failed to initialize the iSCSI page pod region: %u.\n", __func__, rc); + free_ci_counters(ci); return (rc); } @@ -169,6 +220,35 @@ cxgbei_init(struct adapter *sc, struct c V_ISCSITAGMASK(M_ISCSITAGMASK), pr->pr_tag_mask); } + sysctl_ctx_init(&ci->ctx); + oid = device_get_sysctl_tree(sc->dev); /* dev.t5nex.X */ + children = SYSCTL_CHILDREN(oid); + + oid = SYSCTL_ADD_NODE(&ci->ctx, children, OID_AUTO, "iscsi", CTLFLAG_RD, + NULL, "iSCSI ULP statistics"); + children = SYSCTL_CHILDREN(oid); + + SYSCTL_ADD_COUNTER_U64(&ci->ctx, children, OID_AUTO, "ddp_setup_ok", + CTLFLAG_RD, &ci->ddp_setup_ok, + "# of times DDP buffer was setup successfully."); + + SYSCTL_ADD_COUNTER_U64(&ci->ctx, children, OID_AUTO, "ddp_setup_error", + CTLFLAG_RD, &ci->ddp_setup_error, + "# of times DDP buffer setup failed."); + + SYSCTL_ADD_COUNTER_U64(&ci->ctx, children, OID_AUTO, "ddp_bytes", + CTLFLAG_RD, &ci->ddp_bytes, "# of bytes placed directly"); + + SYSCTL_ADD_COUNTER_U64(&ci->ctx, children, OID_AUTO, "ddp_pdus", + CTLFLAG_RD, &ci->ddp_pdus, "# of PDUs with data placed directly."); + + SYSCTL_ADD_COUNTER_U64(&ci->ctx, children, OID_AUTO, "fl_bytes", + CTLFLAG_RD, &ci->fl_bytes, "# of data bytes delivered in freelist"); + + SYSCTL_ADD_COUNTER_U64(&ci->ctx, children, OID_AUTO, "fl_pdus", + CTLFLAG_RD, &ci->fl_pdus, + "# of PDUs with data delivered in freelist"); + return (0); } @@ -213,6 +293,7 @@ static int do_rx_iscsi_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { struct adapter *sc = iq->adapter; + struct cxgbei_data *ci = sc->iscsi_ulp_softc; struct cpl_iscsi_data *cpl = mtod(m, struct cpl_iscsi_data *); u_int tid = GET_TID(cpl); struct toepcb *toep = lookup_tid(sc, tid); @@ -232,6 +313,8 @@ do_rx_iscsi_data(struct sge_iq *iq, cons icp->icp_flags |= ICPF_RX_FLBUF; icp->ip.ip_data_mbuf = m; + counter_u64_add(ci->fl_pdus, 1); + counter_u64_add(ci->fl_bytes, m->m_pkthdr.len); #if 0 CTR3(KTR_CXGBE, "%s: tid %u, cpl->len %u", __func__, tid, @@ -245,6 +328,7 @@ static int do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { struct adapter *sc = iq->adapter; + struct cxgbei_data *ci = sc->iscsi_ulp_softc; const struct cpl_rx_data_ddp *cpl = (const void *)(rss + 1); u_int tid = GET_TID(cpl); struct toepcb *toep = lookup_tid(sc, tid); @@ -286,6 +370,8 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const MPASS((icp->icp_flags & ICPF_RX_FLBUF) == 0); MPASS(ip->ip_data_len > 0); icp->icp_flags |= ICPF_RX_DDP; + counter_u64_add(ci->ddp_pdus, 1); + counter_u64_add(ci->ddp_bytes, ip->ip_data_len); } INP_WLOCK(inp); @@ -439,7 +525,9 @@ cxgbei_deactivate(struct adapter *sc) ASSERT_SYNCHRONIZED_OP(sc); if (ci != NULL) { + sysctl_ctx_free(&ci->ctx); t4_free_ppod_region(&ci->pr); + free_ci_counters(ci); free(ci, M_CXGBE); sc->iscsi_ulp_softc = NULL; } Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.h ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Sep 1 23:56:02 2016 (r305259) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Sep 1 23:58:36 2016 (r305260) @@ -112,6 +112,13 @@ struct cxgbei_data { u_int ddp_threshold; struct ppod_region pr; + struct sysctl_ctx_list ctx; /* from uld_activate to deactivate */ + counter_u64_t ddp_setup_ok; + counter_u64_t ddp_setup_error; + counter_u64_t ddp_bytes; + counter_u64_t ddp_pdus; + counter_u64_t fl_bytes; + counter_u64_t fl_pdus; }; /* cxgbei.c */ Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Sep 1 23:56:02 2016 (r305259) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Sep 1 23:58:36 2016 (r305260) @@ -820,6 +820,8 @@ no_ddp: itt = V_PPOD_TAG(itt) | pr->pr_invalid_bit; *ittp = htobe32(itt); MPASS(*arg == NULL); /* State is maintained for DDP only. */ + if (rc != 0) + counter_u64_add(ci->ddp_setup_error, 1); return (0); } @@ -853,6 +855,7 @@ no_ddp: *ittp = htobe32(prsv->prsv_tag); *arg = prsv; + counter_u64_add(ci->ddp_setup_ok, 1); return (0); } @@ -920,6 +923,8 @@ no_ddp: ttt = V_PPOD_TAG(ttt) | pr->pr_invalid_bit; *tttp = htobe32(ttt); MPASS(io_to_ppod_reservation(io) == NULL); + if (rc != 0) + counter_u64_add(ci->ddp_setup_error, 1); return (0); } @@ -965,6 +970,7 @@ no_ddp: *tttp = htobe32(prsv->prsv_tag); io_to_ppod_reservation(io) = prsv; *arg = ctsio; + counter_u64_add(ci->ddp_setup_ok, 1); return (0); } From owner-svn-src-head@freebsd.org Fri Sep 2 00:16: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 4C38DBCCBAD; Fri, 2 Sep 2016 00:16:20 +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 272262B9E; Fri, 2 Sep 2016 00:16:20 +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 u820GJk1031103; Fri, 2 Sep 2016 00:16:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u820GJcd031102; Fri, 2 Sep 2016 00:16:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201609020016.u820GJcd031102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Sep 2016 00:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305262 - 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.22 Precedence: list List-Id: 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, 02 Sep 2016 00:16:20 -0000 Author: brooks Date: Fri Sep 2 00:16:19 2016 New Revision: 305262 URL: https://svnweb.freebsd.org/changeset/base/305262 Log: Initialize lists of signals using C99 designators Reviewed by: jilles Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D7601 Modified: head/lib/libc/gen/siglist.c Modified: head/lib/libc/gen/siglist.c ============================================================================== --- head/lib/libc/gen/siglist.c Fri Sep 2 00:14:28 2016 (r305261) +++ head/lib/libc/gen/siglist.c Fri Sep 2 00:16:19 2016 (r305262) @@ -36,72 +36,72 @@ __FBSDID("$FreeBSD$"); #include const char *const sys_signame[NSIG] = { - "Signal 0", - "HUP", /* SIGHUP */ - "INT", /* SIGINT */ - "QUIT", /* SIGQUIT */ - "ILL", /* SIGILL */ - "TRAP", /* SIGTRAP */ - "ABRT", /* SIGABRT */ - "EMT", /* SIGEMT */ - "FPE", /* SIGFPE */ - "KILL", /* SIGKILL */ - "BUS", /* SIGBUS */ - "SEGV", /* SIGSEGV */ - "SYS", /* SIGSYS */ - "PIPE", /* SIGPIPE */ - "ALRM", /* SIGALRM */ - "TERM", /* SIGTERM */ - "URG", /* SIGURG */ - "STOP", /* SIGSTOP */ - "TSTP", /* SIGTSTP */ - "CONT", /* SIGCONT */ - "CHLD", /* SIGCHLD */ - "TTIN", /* SIGTTIN */ - "TTOU", /* SIGTTOU */ - "IO", /* SIGIO */ - "XCPU", /* SIGXCPU */ - "XFSZ", /* SIGXFSZ */ - "VTALRM", /* SIGVTALRM */ - "PROF", /* SIGPROF */ - "WINCH", /* SIGWINCH */ - "INFO", /* SIGINFO */ - "USR1", /* SIGUSR1 */ - "USR2" /* SIGUSR2 */ + [0] = "Signal 0", + [SIGHUP] = "HUP", + [SIGINT] = "INT", + [SIGQUIT] = "QUIT", + [SIGILL] = "ILL", + [SIGTRAP] = "TRAP", + [SIGABRT] = "ABRT", + [SIGEMT] = "EMT", + [SIGFPE] = "FPE", + [SIGKILL] = "KILL", + [SIGBUS] = "BUS", + [SIGSEGV] = "SEGV", + [SIGSYS] = "SYS", + [SIGPIPE] = "PIPE", + [SIGALRM] = "ALRM", + [SIGTERM] = "TERM", + [SIGURG] = "URG", + [SIGSTOP] = "STOP", + [SIGTSTP] = "TSTP", + [SIGCONT] = "CONT", + [SIGCHLD] = "CHLD", + [SIGTTIN] = "TTIN", + [SIGTTOU] = "TTOU", + [SIGIO] = "IO", + [SIGXCPU] = "XCPU", + [SIGXFSZ] = "XFSZ", + [SIGVTALRM] = "VTALRM", + [SIGPROF] = "PROF", + [SIGWINCH] = "WINCH", + [SIGINFO] = "INFO", + [SIGUSR1] = "USR1", + [SIGUSR2] = "USR2", }; const char *const sys_siglist[NSIG] = { - "Signal 0", - "Hangup", /* SIGHUP */ - "Interrupt", /* SIGINT */ - "Quit", /* SIGQUIT */ - "Illegal instruction", /* SIGILL */ - "Trace/BPT trap", /* SIGTRAP */ - "Abort trap", /* SIGABRT */ - "EMT trap", /* SIGEMT */ - "Floating point exception", /* SIGFPE */ - "Killed", /* SIGKILL */ - "Bus error", /* SIGBUS */ - "Segmentation fault", /* SIGSEGV */ - "Bad system call", /* SIGSYS */ - "Broken pipe", /* SIGPIPE */ - "Alarm clock", /* SIGALRM */ - "Terminated", /* SIGTERM */ - "Urgent I/O condition", /* SIGURG */ - "Suspended (signal)", /* SIGSTOP */ - "Suspended", /* SIGTSTP */ - "Continued", /* SIGCONT */ - "Child exited", /* SIGCHLD */ - "Stopped (tty input)", /* SIGTTIN */ - "Stopped (tty output)", /* SIGTTOU */ - "I/O possible", /* SIGIO */ - "Cputime limit exceeded", /* SIGXCPU */ - "Filesize limit exceeded", /* SIGXFSZ */ - "Virtual timer expired", /* SIGVTALRM */ - "Profiling timer expired", /* SIGPROF */ - "Window size changes", /* SIGWINCH */ - "Information request", /* SIGINFO */ - "User defined signal 1", /* SIGUSR1 */ - "User defined signal 2" /* SIGUSR2 */ + [0] = "Signal 0", + [SIGHUP] = "Hangup", + [SIGINT] = "Interrupt", + [SIGQUIT] = "Quit", + [SIGILL] = "Illegal instruction", + [SIGTRAP] = "Trace/BPT trap", + [SIGABRT] = "Abort trap", + [SIGEMT] = "EMT trap", + [SIGFPE] = "Floating point exception", + [SIGKILL] = "Killed", + [SIGBUS] = "Bus error", + [SIGSEGV] = "Segmentation fault", + [SIGSYS] = "Bad system call", + [SIGPIPE] = "Broken pipe", + [SIGALRM] = "Alarm clock", + [SIGTERM] = "Terminated", + [SIGURG] = "Urgent I/O condition", + [SIGSTOP] = "Suspended (signal)", + [SIGTSTP] = "Suspended", + [SIGCONT] = "Continued", + [SIGCHLD] = "Child exited", + [SIGTTIN] = "Stopped (tty input)", + [SIGTTOU] = "Stopped (tty output)", + [SIGIO] = "I/O possible", + [SIGXCPU] = "Cputime limit exceeded", + [SIGXFSZ] = "Filesize limit exceeded", + [SIGVTALRM] = "Virtual timer expired", + [SIGPROF] = "Profiling timer expired", + [SIGWINCH] = "Window size changes", + [SIGINFO] = "Information request", + [SIGUSR1] = "User defined signal 1", + [SIGUSR2] = "User defined signal 2", }; const int sys_nsig = sizeof(sys_siglist) / sizeof(sys_siglist[0]); From owner-svn-src-head@freebsd.org Fri Sep 2 00:21: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 261E2BCCD97; Fri, 2 Sep 2016 00:21:26 +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 EB08C2E44; Fri, 2 Sep 2016 00:21:25 +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 u820LPNk031916; Fri, 2 Sep 2016 00:21:25 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u820LPQX031915; Fri, 2 Sep 2016 00:21:25 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609020021.u820LPQX031915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 2 Sep 2016 00:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305263 - head/sys/dev/cxgbe/cxgbei 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.22 Precedence: list List-Id: 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, 02 Sep 2016 00:21:26 -0000 Author: np Date: Fri Sep 2 00:21:24 2016 New Revision: 305263 URL: https://svnweb.freebsd.org/changeset/base/305263 Log: cxgbe/cxgbei: Provide a knob to set the DDP threshold for iSCSI transfers. The Initiator and Target both perform zero copy receive for transfers greater than or equal to this threshold. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Fri Sep 2 00:16:19 2016 (r305262) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Fri Sep 2 00:21:24 2016 (r305263) @@ -192,9 +192,7 @@ cxgbei_init(struct adapter *sc, struct c read_pdu_limits(sc, &ci->max_tx_pdu_len, &ci->max_rx_pdu_len); - ci->ddp_threshold = 2048; pr = &ci->pr; - r = t4_read_reg(sc, A_ULP_RX_ISCSI_PSZ); rc = t4_init_ppod_region(pr, &sc->vres.iscsi, r, "iSCSI page pods"); if (rc != 0) { @@ -249,6 +247,10 @@ cxgbei_init(struct adapter *sc, struct c CTLFLAG_RD, &ci->fl_pdus, "# of PDUs with data delivered in freelist"); + ci->ddp_threshold = 2048; + SYSCTL_ADD_UINT(&ci->ctx, children, OID_AUTO, "ddp_threshold", + CTLFLAG_RW, &ci->ddp_threshold, 0, "Rx zero copy threshold"); + return (0); } From owner-svn-src-head@freebsd.org Fri Sep 2 00:27: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 3D60DBCCFAF; Fri, 2 Sep 2016 00:27:28 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0CE6924C; Fri, 2 Sep 2016 00:27:27 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u820RRIO034974; Fri, 2 Sep 2016 00:27:27 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u820RRmm034973; Fri, 2 Sep 2016 00:27:27 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201609020027.u820RRmm034973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 2 Sep 2016 00:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305264 - head/tools/tools/locale/tools 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.22 Precedence: list List-Id: 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, 02 Sep 2016 00:27:28 -0000 Author: kevlo Date: Fri Sep 2 00:27:27 2016 New Revision: 305264 URL: https://svnweb.freebsd.org/changeset/base/305264 Log: Replace %m with %_m in date_fmt for Chinese locales. This is a fix for the problem mentioned in the PR. PR: 199441 Modified: head/tools/tools/locale/tools/cldr2def.pl Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Fri Sep 2 00:21:24 2016 (r305263) +++ head/tools/tools/locale/tools/cldr2def.pl Fri Sep 2 00:27:27 2016 (r305264) @@ -243,7 +243,10 @@ sub callback_dtformat { if ($nl eq 'ja_JP') { $s =~ s/(> )(%H)/$1%A $2/; - } elsif ($nl eq 'ko_KR' || $nl eq 'zh_TW') { + } elsif ($nl eq 'ko_KR' || $nl eq 'zh_CN' || $nl eq 'zh_TW') { + if ($nl ne 'ko_KR') { + $s =~ s/%m/%_m/; + } $s =~ s/(> )(%p)/$1%A $2/; } $s =~ s/\.,/\./; From owner-svn-src-head@freebsd.org Fri Sep 2 00: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 93B01BCB49A; Fri, 2 Sep 2016 00:43:04 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7178ED13; Fri, 2 Sep 2016 00:43:04 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u820h32o042498; Fri, 2 Sep 2016 00:43:03 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u820h3FG042493; Fri, 2 Sep 2016 00:43:03 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201609020043.u820h3FG042493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 2 Sep 2016 00:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305265 - head/share/timedef 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.22 Precedence: list List-Id: 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, 02 Sep 2016 00:43:04 -0000 Author: kevlo Date: Fri Sep 2 00:43:03 2016 New Revision: 305265 URL: https://svnweb.freebsd.org/changeset/base/305265 Log: Revert r304192 to fix short month names and replace %b with %_m in date_fmt for Chinese locales. As mentioned in the commit message of r289041, nl_langinfo(ABMON_*) only returned numbers when using a Chinese locale, this causes problems in applications that put the short month name and the day of the month together. Spotted by: Ting-Wei Lan Modified: head/share/timedef/zh_CN.GB2312.src head/share/timedef/zh_CN.GBK.src head/share/timedef/zh_CN.UTF-8.src head/share/timedef/zh_CN.eucCN.src head/share/timedef/zh_TW.Big5.src head/share/timedef/zh_TW.UTF-8.src Modified: head/share/timedef/zh_CN.GB2312.src ============================================================================== --- head/share/timedef/zh_CN.GB2312.src Fri Sep 2 00:27:27 2016 (r305264) +++ head/share/timedef/zh_CN.GB2312.src Fri Sep 2 00:43:03 2016 (r305265) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -10 -11 -12 +!!#1TB +!!#2TB +!!#3TB +!!#4TB +!!#5TB +!!#6TB +!!#7TB +!!#8TB +!!#9TB +#1#0TB +#1#1TB +#1#2TB # # Long month names (as in a date) Ò»Ô @@ -63,7 +63,7 @@ ÏÂÎç # # date_fmt -%YÄê%bÔÂ%eÈÕ %A %X %Z +%YÄê%_mÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) Ò»Ô Modified: head/share/timedef/zh_CN.GBK.src ============================================================================== --- head/share/timedef/zh_CN.GBK.src Fri Sep 2 00:27:27 2016 (r305264) +++ head/share/timedef/zh_CN.GBK.src Fri Sep 2 00:43:03 2016 (r305265) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -10 -11 -12 + 1Ô + 2Ô + 3Ô + 4Ô + 5Ô + 6Ô + 7Ô + 8Ô + 9Ô +10Ô +11Ô +12Ô # # Long month names (as in a date) Ò»Ô @@ -63,7 +63,7 @@ ÏÂÎç # # date_fmt -%YÄê%bÔÂ%eÈÕ %A %X %Z +%YÄê%_mÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) Ò»Ô Modified: head/share/timedef/zh_CN.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/zh_CN.eucCN.src ============================================================================== --- head/share/timedef/zh_CN.eucCN.src Fri Sep 2 00:27:27 2016 (r305264) +++ head/share/timedef/zh_CN.eucCN.src Fri Sep 2 00:43:03 2016 (r305265) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -10 -11 -12 +¡¡£±Ô +¡¡£²Ô +¡¡£³Ô +¡¡£´Ô +¡¡£µÔ +¡¡£¶Ô +¡¡£·Ô +¡¡£¸Ô +¡¡£¹Ô +£±£°Ô +£±£±Ô +£±£²Ô # # Long month names (as in a date) Ò»Ô @@ -63,7 +63,7 @@ ÏÂÎç # # date_fmt -%YÄê%bÔÂ%eÈÕ %A %X %Z +%YÄê%_mÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) Ò»Ô Modified: head/share/timedef/zh_TW.Big5.src ============================================================================== --- head/share/timedef/zh_TW.Big5.src Fri Sep 2 00:27:27 2016 (r305264) +++ head/share/timedef/zh_TW.Big5.src Fri Sep 2 00:43:03 2016 (r305265) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -10 -11 -12 +¡@¢°¤ë +¡@¢±¤ë +¡@¢²¤ë +¡@¢³¤ë +¡@¢´¤ë +¡@¢µ¤ë +¡@¢¶¤ë +¡@¢·¤ë +¡@¢¸¤ë +¢°¢¯¤ë +¢°¢°¤ë +¢°¢±¤ë # # Long month names (as in a date) 1¤ë @@ -63,7 +63,7 @@ ¤U¤È # # date_fmt -%Y¦~%b¤ë%e¤é %A %X %Z +%Y¦~%_m¤ë%e¤é %A %X %Z # # Long month names (without case ending) 1¤ë Modified: head/share/timedef/zh_TW.UTF-8.src ============================================================================== --- head/share/timedef/zh_TW.UTF-8.src Fri Sep 2 00:27:27 2016 (r305264) +++ head/share/timedef/zh_TW.UTF-8.src Fri Sep 2 00:43:03 2016 (r305265) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -10 -11 -12 + 1月 + 2月 + 3月 + 4月 + 5月 + 6月 + 7月 + 8月 + 9月 +10月 +11月 +12月 # # Long month names (as in a date) 1月 @@ -63,7 +63,7 @@ ä¸‹åˆ # # date_fmt -%Yå¹´%b月%eæ—¥ %A %X %Z +%Yå¹´%_m月%eæ—¥ %A %X %Z # # Long month names (without case ending) 1月 From owner-svn-src-head@freebsd.org Fri Sep 2 02:05: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 4FCDABCB6C9; Fri, 2 Sep 2016 02:05:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::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 127FAED9; Fri, 2 Sep 2016 02:05:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22b.google.com with SMTP id g202so14034450pfb.0; Thu, 01 Sep 2016 19:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=kW2zkd1VOp6hN033xtHAtwNG6t8W69/Wp9Fv09N8PRU=; b=NB6TLA/BKU30DapxyN1C7qymLOKvFRgIyg5Ao6YL2dYJY+hlr94TgSHAQDsqk3jBaT 9NYunj8aTp13EAwJCVu42myvUYxRV1GgoFiclXUzkltl8LSCyqYQump7LV+3C/Bmu5BD ZS+46FReIboZWKsUQbS1dBQJq+axKGvOhbuxla8abkoqRPoyHG2YvNSYSomTDDmFjkmd /Rzi7lhBhsuaz+Lb+quUyFeViJw1okbNbkbx0JrFfQDvbLuD5lImhbkJmQ1owuaiHwh2 MGbVOeVgF1lI8CliqRVhLjLK4VG/Tbziml4PbrlVjoywnRKACA3Se2qeGqY9TKrpD+Xr A7zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=kW2zkd1VOp6hN033xtHAtwNG6t8W69/Wp9Fv09N8PRU=; b=O/YKOQ+OKyz3TsffCv3vu5DAxCU3liyYZ3ybrARG+zDg8EsH82xBqde/Se8YBzDaJp oIPh75FwwBsOToL3+PUA9tpnyQPinGyXFCfSHoXj94hL2U0liWbb4d1iOMIrrqj1TLdm eKOpFp1iLHjUKArtuPie62MM71Df8NNSWoFl5FBkNxye2zPmKlTxSqCqvI8Bacod4XEY ym3Qy3ZBh6kzm4Zq0RP5F2NO9JVxCF4KJYwAemvd74DqXll7yymLzw089vnc5jh8AJAM S1P57+RyrYCon0dhNq3Zy4+tvzftDbZzhIyWfd/nJccFhvU25za1vfrqvPoIl+KTKkpv MNnw== X-Gm-Message-State: AE9vXwOnU2fAMf0VSmbfYniyXv8lgBQ4IEs8sYl/mvqa14fQcMer60wsnpx+LF5NzWdwiA== X-Received: by 10.98.104.71 with SMTP id d68mr32141893pfc.163.1472781914461; Thu, 01 Sep 2016 19:05:14 -0700 (PDT) Received: from ?IPv6:2607:fb90:80bd:bf70:7974:a84f:df69:391c? ([2607:fb90:80bd:bf70:7974:a84f:df69:391c]) by smtp.gmail.com with ESMTPSA id g5sm10468342pfg.0.2016.09.01.19.05.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 19:05:13 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r305245 - in head: . release/doc/en_US.ISO8859-1/hardware From: Ngie Cooper X-Mailer: iPhone Mail (13G36) In-Reply-To: <1629468.4Mznr3zCZh@ralph.baldwin.cx> Date: Thu, 1 Sep 2016 19:05:11 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201609012116.u81LGTiT063091@repo.freebsd.org> <1629468.4Mznr3zCZh@ralph.baldwin.cx> To: John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 02 Sep 2016 02:05:15 -0000 > On Sep 1, 2016, at 14:50, John Baldwin wrote: >=20 >> On Thursday, September 01, 2016 09:16:29 PM John Baldwin wrote: >> Author: jhb >> Date: Thu Sep 1 21:16:29 2016 >> New Revision: 305245 >> URL: https://svnweb.freebsd.org/changeset/base/305245 >>=20 >> Log: >> Remove the digi(4) manpage and digi from the release notes. >=20 > We still list sio(4) in the release notes even though its disconnected fro= m > the build. (Which means we've been listing it in releases since 8.0 even > though it doesn't compile and isn't shipped.) We should probably make sur= e > we aren't listing any other disconnected drivers in the hardware notes. sio(4) has some gems in it that should be forward ported to uart(4). After t= hat, I vote for killing off sio(4). Thanks, -Garrett= From owner-svn-src-head@freebsd.org Fri Sep 2 03: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 C9318BCC7CF; Fri, 2 Sep 2016 03:10:31 +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 9A1D9D24; Fri, 2 Sep 2016 03:10:31 +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 u823AUUl095298; Fri, 2 Sep 2016 03:10:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u823AU6t095294; Fri, 2 Sep 2016 03:10:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609020310.u823AU6t095294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 2 Sep 2016 03:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305268 - 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.22 Precedence: list List-Id: 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, 02 Sep 2016 03:10:31 -0000 Author: sephe Date: Fri Sep 2 03:10:30 2016 New Revision: 305268 URL: https://svnweb.freebsd.org/changeset/base/305268 Log: hyperv/hn: Rework RXCSUM related bits MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7735 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Sep 2 01:41:57 2016 (r305267) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Sep 2 03:10:30 2016 (r305268) @@ -1335,28 +1335,29 @@ netvsc_recv(struct hn_rx_ring *rxr, cons do_csum = 0; /* receive side checksum offload */ - if (info->csum_info != NULL) { + if (info->csum_info != HN_NDIS_RXCSUM_INFO_INVALID) { /* IP csum offload */ - if (info->csum_info->receive.ip_csum_succeeded && do_csum) { + if ((info->csum_info & NDIS_RXCSUM_INFO_IPCS_OK) && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); rxr->hn_csum_ip++; } /* TCP/UDP csum offload */ - if ((info->csum_info->receive.tcp_csum_succeeded || - info->csum_info->receive.udp_csum_succeeded) && do_csum) { + if ((info->csum_info & (NDIS_RXCSUM_INFO_UDPCS_OK | + NDIS_RXCSUM_INFO_TCPCS_OK)) && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; - if (info->csum_info->receive.tcp_csum_succeeded) + if (info->csum_info & NDIS_RXCSUM_INFO_TCPCS_OK) rxr->hn_csum_tcp++; else rxr->hn_csum_udp++; } - if (info->csum_info->receive.ip_csum_succeeded && - info->csum_info->receive.tcp_csum_succeeded) + if ((info->csum_info & + (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) == + (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) do_lro = 1; } else { const struct ether_header *eh; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Sep 2 01:41:57 2016 (r305267) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Sep 2 03:10:30 2016 (r305268) @@ -157,7 +157,7 @@ hv_rf_find_recvinfo(const rndis_packet * uint32_t mask = 0, len; info->vlan_info = HN_NDIS_VLAN_INFO_INVALID; - info->csum_info = NULL; + info->csum_info = HN_NDIS_RXCSUM_INFO_INVALID; info->hash_info = NULL; info->hash_value = NULL; @@ -200,10 +200,9 @@ hv_rf_find_recvinfo(const rndis_packet * break; case tcpip_chksum_info: - if (__predict_false(dlen < - sizeof(rndis_tcp_ip_csum_info))) + if (__predict_false(dlen < NDIS_RXCSUM_INFO_SIZE)) return (EINVAL); - info->csum_info = data; + info->csum_info = *((const uint32_t *)data); mask |= HV_RF_RECVINFO_CSUM; break; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Fri Sep 2 01:41:57 2016 (r305267) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Fri Sep 2 03:10:30 2016 (r305268) @@ -56,10 +56,11 @@ struct ndis_8021q_info_; struct rndis_tcp_ip_csum_info_; #define HN_NDIS_VLAN_INFO_INVALID 0xffffffff +#define HN_NDIS_RXCSUM_INFO_INVALID 0 struct hn_recvinfo { uint32_t vlan_info; - const struct rndis_tcp_ip_csum_info_ *csum_info; + uint32_t csum_info; const struct rndis_hash_info *hash_info; const struct rndis_hash_value *hash_value; }; Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Fri Sep 2 01:41:57 2016 (r305267) +++ head/sys/dev/hyperv/netvsc/ndis.h Fri Sep 2 03:10:30 2016 (r305268) @@ -219,4 +219,16 @@ struct ndis_rssprm_toeplitz { #define NDIS_VLAN_INFO_CFI(inf) (((inf) & NDIS_VLAN_INFO_CFI_MASK) >> 3) #define NDIS_VLAN_INFO_PRI(inf) ((inf) & NDIS_VLAN_INFO_PRI_MASK) +/* Reception checksum */ +#define NDIS_RXCSUM_INFO_SIZE sizeof(uint32_t) +#define NDIS_RXCSUM_INFO_TCPCS_FAILED 0x0001 +#define NDIS_RXCSUM_INFO_UDPCS_FAILED 0x0002 +#define NDIS_RXCSUM_INFO_IPCS_FAILED 0x0004 +#define NDIS_RXCSUM_INFO_TCPCS_OK 0x0008 +#define NDIS_RXCSUM_INFO_UDPCS_OK 0x0010 +#define NDIS_RXCSUM_INFO_IPCS_OK 0x0020 +#define NDIS_RXCSUM_INFO_LOOPBACK 0x0040 +#define NDIS_RXCSUM_INFO_TCPCS_INVAL 0x0080 +#define NDIS_RXCSUM_INFO_IPCS_INVAL 0x0100 + #endif /* !_NET_NDIS_H_ */ From owner-svn-src-head@freebsd.org Fri Sep 2 03: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 C114DBCC978; Fri, 2 Sep 2016 03:15:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7815515D; Fri, 2 Sep 2016 03:15:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u823FsBu099003; Fri, 2 Sep 2016 03:15:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u823FsAF099001; Fri, 2 Sep 2016 03:15:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609020315.u823FsAF099001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Sep 2016 03:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305269 - in head/usr.sbin/cron: cron crontab 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.22 Precedence: list List-Id: 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, 02 Sep 2016 03:15:55 -0000 Author: emaste Date: Fri Sep 2 03:15:54 2016 New Revision: 305269 URL: https://svnweb.freebsd.org/changeset/base/305269 Log: cron: use existing maximum username constant MAXLOGNAME Previously cron had its own maximum username length limit, which was smaller than the system's MAXLOGNAME. This could lead to crontab -u updating the wrong user's crontab (if the name was truncated, and matched another user). PR: 212305 Reported by: Andrii Kuzik Reviewed by: allanjude, jilles MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7747 Modified: head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/cron/cron.h ============================================================================== --- head/usr.sbin/cron/cron/cron.h Fri Sep 2 03:10:30 2016 (r305268) +++ head/usr.sbin/cron/cron/cron.h Fri Sep 2 03:15:54 2016 (r305269) @@ -73,7 +73,6 @@ #define MAX_COMMAND 1000 /* max length of internally generated cmd */ #define MAX_ENVSTR 1000 /* max length of envvar=value\0 strings */ #define MAX_TEMPSTR 100 /* obvious */ -#define MAX_UNAME 20 /* max length of username, should be overkill */ #define ROOT_UID 0 /* don't change this, it really must be root */ #define ROOT_USER "root" /* ditto */ #define SYS_NAME "*system*" /* magic owner name for system crontab */ Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Fri Sep 2 03:10:30 2016 (r305268) +++ head/usr.sbin/cron/crontab/crontab.c Fri Sep 2 03:15:54 2016 (r305269) @@ -28,6 +28,7 @@ static const char rcsid[] = #define MAIN_PROGRAM +#include #include "cron.h" #include #include @@ -57,7 +58,7 @@ static char *Options[] = { "???", "list" static PID_T Pid; -static char User[MAX_UNAME], RealUser[MAX_UNAME]; +static char User[MAXLOGNAME], RealUser[MAXLOGNAME]; static char Filename[MAX_FNAME]; static FILE *NewCrontab; static int CheckErrorCount; From owner-svn-src-head@freebsd.org Fri Sep 2 03:19: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 DAE85BCC9F2; Fri, 2 Sep 2016 03:19:56 +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 9DA8979A; Fri, 2 Sep 2016 03:19:56 +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 u823JteL099188; Fri, 2 Sep 2016 03:19:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u823JtxG099184; Fri, 2 Sep 2016 03:19:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609020319.u823JtxG099184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 2 Sep 2016 03:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305270 - 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.22 Precedence: list List-Id: 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, 02 Sep 2016 03:19:57 -0000 Author: sephe Date: Fri Sep 2 03:19:55 2016 New Revision: 305270 URL: https://svnweb.freebsd.org/changeset/base/305270 Log: hyperv/hn: Simplify RX hash related bits. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7736 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnreg.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Sep 2 03:15:54 2016 (r305269) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Sep 2 03:19:55 2016 (r305270) @@ -1289,7 +1289,7 @@ netvsc_recv(struct hn_rx_ring *rxr, cons struct ifnet *ifp = rxr->hn_ifp; struct mbuf *m_new; int size, do_lro = 0, do_csum = 1; - int hash_type = M_HASHTYPE_OPAQUE_HASH; + int hash_type; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return (0); @@ -1421,13 +1421,13 @@ skip: m_new->m_flags |= M_VLANTAG; } - if (info->hash_info != NULL && info->hash_value != NULL) { + if (info->hash_info != HN_NDIS_HASH_INFO_INVALID) { rxr->hn_rss_pkts++; - m_new->m_pkthdr.flowid = info->hash_value->hash_value; - if ((info->hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == + m_new->m_pkthdr.flowid = info->hash_value; + hash_type = M_HASHTYPE_OPAQUE_HASH; + if ((info->hash_info & NDIS_HASH_FUNCTION_MASK) == NDIS_HASH_FUNCTION_TOEPLITZ) { - uint32_t type = - (info->hash_info->hash_info & NDIS_HASH_TYPE_MASK); + uint32_t type = (info->hash_info & NDIS_HASH_TYPE_MASK); switch (type) { case NDIS_HASH_IPV4: @@ -1456,12 +1456,8 @@ skip: } } } else { - if (info->hash_value != NULL) { - m_new->m_pkthdr.flowid = info->hash_value->hash_value; - } else { - m_new->m_pkthdr.flowid = rxr->hn_rx_idx; - hash_type = M_HASHTYPE_OPAQUE; - } + m_new->m_pkthdr.flowid = rxr->hn_rx_idx; + hash_type = M_HASHTYPE_OPAQUE; } M_HASHTYPE_SET(m_new, hash_type); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Sep 2 03:15:54 2016 (r305269) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Sep 2 03:19:55 2016 (r305270) @@ -158,8 +158,7 @@ hv_rf_find_recvinfo(const rndis_packet * info->vlan_info = HN_NDIS_VLAN_INFO_INVALID; info->csum_info = HN_NDIS_RXCSUM_INFO_INVALID; - info->hash_info = NULL; - info->hash_value = NULL; + info->hash_info = HN_NDIS_HASH_INFO_INVALID; if (rpkt->per_pkt_info_offset == 0) return (0); @@ -207,18 +206,16 @@ hv_rf_find_recvinfo(const rndis_packet * break; case nbl_hash_value: - if (__predict_false(dlen < - sizeof(struct rndis_hash_value))) + if (__predict_false(dlen < HN_NDIS_HASH_VALUE_SIZE)) return (EINVAL); - info->hash_value = data; + info->hash_value = *((const uint32_t *)data); mask |= HV_RF_RECVINFO_HASHVAL; break; case nbl_hash_info: - if (__predict_false(dlen < - sizeof(struct rndis_hash_info))) + if (__predict_false(dlen < HN_NDIS_HASH_INFO_SIZE)) return (EINVAL); - info->hash_info = data; + info->hash_info = *((const uint32_t *)data); mask |= HV_RF_RECVINFO_HASHINF; break; @@ -234,6 +231,13 @@ next: pi = (const struct rndis_pktinfo *) ((const uint8_t *)pi + pi->rm_size); } + + /* + * Final fixup. + * - If there is no hash value, invalidate the hash info. + */ + if ((mask & HV_RF_RECVINFO_HASHVAL) == 0) + info->hash_info = HN_NDIS_HASH_INFO_INVALID; return (0); } Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Sep 2 03:15:54 2016 (r305269) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Fri Sep 2 03:19:55 2016 (r305270) @@ -208,4 +208,17 @@ struct hn_nvs_rndis_ack { } __packed; CTASSERT(sizeof(struct hn_nvs_rndis_ack) >= HN_NVS_REQSIZE_MIN); +/* + * RNDIS extension + */ + +/* Per-packet hash info */ +#define HN_NDIS_HASH_INFO_SIZE sizeof(uint32_t) +#define HN_NDIS_PKTINFO_TYPE_HASHINF NDIS_PKTINFO_TYPE_ORIG_NBLIST +/* NDIS_HASH_ */ + +/* Per-packet hash value */ +#define HN_NDIS_HASH_VALUE_SIZE sizeof(uint32_t) +#define HN_NDIS_PKTINFO_TYPE_HASHVAL NDIS_PKTINFO_TYPE_PKT_CANCELID + #endif /* !_IF_HNREG_H_ */ Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Fri Sep 2 03:15:54 2016 (r305269) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Fri Sep 2 03:19:55 2016 (r305270) @@ -57,12 +57,13 @@ struct rndis_tcp_ip_csum_info_; #define HN_NDIS_VLAN_INFO_INVALID 0xffffffff #define HN_NDIS_RXCSUM_INFO_INVALID 0 +#define HN_NDIS_HASH_INFO_INVALID 0 struct hn_recvinfo { uint32_t vlan_info; uint32_t csum_info; - const struct rndis_hash_info *hash_info; - const struct rndis_hash_value *hash_value; + uint32_t hash_info; + uint32_t hash_value; }; #define HN_SEND_CTX_INITIALIZER(cb, cbarg) \ From owner-svn-src-head@freebsd.org Fri Sep 2 05:30: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 68E6BBCC406; Fri, 2 Sep 2016 05:30:39 +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 3B45CD58; Fri, 2 Sep 2016 05:30:39 +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 u825Ucjj048646; Fri, 2 Sep 2016 05:30:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u825UcSf048645; Fri, 2 Sep 2016 05:30:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609020530.u825UcSf048645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 2 Sep 2016 05:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305276 - 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.22 Precedence: list List-Id: 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, 02 Sep 2016 05:30:39 -0000 Author: sephe Date: Fri Sep 2 05:30:38 2016 New Revision: 305276 URL: https://svnweb.freebsd.org/changeset/base/305276 Log: hyperv/hn: Use the per-packet-info types defined by net/rndis.h MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7737 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Sep 2 04:27:02 2016 (r305275) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Sep 2 05:30:38 2016 (r305276) @@ -191,28 +191,28 @@ hv_rf_find_recvinfo(const rndis_packet * data = pi->rm_data; switch (pi->rm_type) { - case ieee_8021q_info: + case NDIS_PKTINFO_TYPE_VLAN: if (__predict_false(dlen < NDIS_VLAN_INFO_SIZE)) return (EINVAL); info->vlan_info = *((const uint32_t *)data); mask |= HV_RF_RECVINFO_VLAN; break; - case tcpip_chksum_info: + case NDIS_PKTINFO_TYPE_CSUM: if (__predict_false(dlen < NDIS_RXCSUM_INFO_SIZE)) return (EINVAL); info->csum_info = *((const uint32_t *)data); mask |= HV_RF_RECVINFO_CSUM; break; - case nbl_hash_value: + case HN_NDIS_PKTINFO_TYPE_HASHVAL: if (__predict_false(dlen < HN_NDIS_HASH_VALUE_SIZE)) return (EINVAL); info->hash_value = *((const uint32_t *)data); mask |= HV_RF_RECVINFO_HASHVAL; break; - case nbl_hash_info: + case HN_NDIS_PKTINFO_TYPE_HASHINF: if (__predict_false(dlen < HN_NDIS_HASH_INFO_SIZE)) return (EINVAL); info->hash_info = *((const uint32_t *)data); From owner-svn-src-head@freebsd.org Fri Sep 2 05:49: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 BE754BCC783; Fri, 2 Sep 2016 05:49:39 +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 8EE14642; Fri, 2 Sep 2016 05:49:39 +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 u825nckM056071; Fri, 2 Sep 2016 05:49:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u825ncHR056070; Fri, 2 Sep 2016 05:49:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609020549.u825ncHR056070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 2 Sep 2016 05:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305277 - 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.22 Precedence: list List-Id: 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, 02 Sep 2016 05:49:39 -0000 Author: sephe Date: Fri Sep 2 05:49:38 2016 New Revision: 305277 URL: https://svnweb.freebsd.org/changeset/base/305277 Log: net/rndis: Add comment for rndis_comp_hdr Reviewed by: hps MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7738 Modified: head/sys/net/rndis.h Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Fri Sep 2 05:30:38 2016 (r305276) +++ head/sys/net/rndis.h Fri Sep 2 05:49:38 2016 (r305277) @@ -147,6 +147,12 @@ struct rndis_pktinfo { /* * RNDIS control messages */ + +/* + * Common header for RNDIS completion messages. + * + * NOTE: It does not apply to REMOTE_NDIS_RESET_CMPLT. + */ struct rndis_comp_hdr { uint32_t rm_type; uint32_t rm_len; From owner-svn-src-head@freebsd.org Fri Sep 2 05:57: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 664BABCC996; Fri, 2 Sep 2016 05:57:14 +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 28889A88; Fri, 2 Sep 2016 05:57: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 u825vDLW059671; Fri, 2 Sep 2016 05:57:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u825vDO8059670; Fri, 2 Sep 2016 05:57:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609020557.u825vDO8059670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 2 Sep 2016 05:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305278 - 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.22 Precedence: list List-Id: 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, 02 Sep 2016 05:57:14 -0000 Author: sephe Date: Fri Sep 2 05:57:13 2016 New Revision: 305278 URL: https://svnweb.freebsd.org/changeset/base/305278 Log: net/rndis: Define common message header for RNDIS messages. And avoid RNDIS_HEADER_OFFSET hardcoding. Reviewed by: hps MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7739 Modified: head/sys/net/rndis.h Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Fri Sep 2 05:49:38 2016 (r305277) +++ head/sys/net/rndis.h Fri Sep 2 05:57:13 2016 (r305278) @@ -93,6 +93,14 @@ #define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 /* + * Common RNDIS message header. + */ +struct rndis_msghdr { + uint32_t rm_type; + uint32_t rm_len; +}; + +/* * RNDIS data message */ #define REMOTE_NDIS_PACKET_MSG 0x00000001 @@ -322,7 +330,7 @@ struct rndis_keepalive_comp { #define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000 /* RNDIS offsets */ -#define RNDIS_HEADER_OFFSET 8 /* bytes */ +#define RNDIS_HEADER_OFFSET ((uint32_t)sizeof(struct rndis_msghdr)) #define RNDIS_DATA_OFFSET \ ((uint32_t)(sizeof(struct rndis_packet_msg) - RNDIS_HEADER_OFFSET)) From owner-svn-src-head@freebsd.org Fri Sep 2 06:08: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 3173BBCCB44; Fri, 2 Sep 2016 06:08:10 +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 015F0E86; Fri, 2 Sep 2016 06:08:09 +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 u82689BG063355; Fri, 2 Sep 2016 06:08:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82689d1063354; Fri, 2 Sep 2016 06:08:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609020608.u82689d1063354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 2 Sep 2016 06:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305279 - head/sys/dev/hyperv/utilities 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.22 Precedence: list List-Id: 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, 02 Sep 2016 06:08:10 -0000 Author: sephe Date: Fri Sep 2 06:08:08 2016 New Revision: 305279 URL: https://svnweb.freebsd.org/changeset/base/305279 Log: hyperv/ic: Minor style fix. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7743 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Fri Sep 2 05:57:13 2016 (r305278) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Fri Sep 2 06:08:08 2016 (r305279) @@ -69,7 +69,7 @@ vmbus_heartbeat_cb(struct vmbus_channel if (error) return; - if (dlen < sizeof(struct vmbus_icmsg_hdr)) { + if (dlen < sizeof(*hdr)) { device_printf(sc->ic_dev, "invalid data len %d\n", dlen); return; } From owner-svn-src-head@freebsd.org Fri Sep 2 06:15: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 B6AABBCCD21; Fri, 2 Sep 2016 06:15:31 +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 91FDA319; Fri, 2 Sep 2016 06:15:31 +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 u826FUTA067120; Fri, 2 Sep 2016 06:15:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u826FU31067117; Fri, 2 Sep 2016 06:15:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609020615.u826FU31067117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 2 Sep 2016 06:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305280 - head/sys/dev/hyperv/utilities 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.22 Precedence: list List-Id: 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, 02 Sep 2016 06:15:31 -0000 Author: sephe Date: Fri Sep 2 06:15:30 2016 New Revision: 305280 URL: https://svnweb.freebsd.org/changeset/base/305280 Log: hyperv/ic: Cleanup shutdown channel callback. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7744 Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/vmbus_icreg.h Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Fri Sep 2 06:08:08 2016 (r305279) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Fri Sep 2 06:15:30 2016 (r305280) @@ -22,28 +22,23 @@ * 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$ */ -/* - * A common driver for all hyper-V util services. - */ +#include +__FBSDID("$FreeBSD$"); #include -#include #include -#include +#include #include #include -#include -#include #include #include #include -#include -#include "hv_util.h" +#include +#include + #include "vmbus_if.h" static const struct vmbus_ic_desc vmbus_shutdown_descs[] = { @@ -56,73 +51,78 @@ static const struct vmbus_ic_desc vmbus_ VMBUS_IC_DESC_END }; -/** - * Shutdown - */ static void -hv_shutdown_cb(struct vmbus_channel *channel, void *context) +vmbus_shutdown_cb(struct vmbus_channel *chan, void *xsc) { - uint8_t* buf; - uint8_t execute_shutdown = 0; - hv_vmbus_icmsg_hdr* icmsghdrp; - uint32_t recv_len; - uint64_t request_id; - int ret; - hv_vmbus_shutdown_msg_data* shutdown_msg; - hv_util_sc *softc; - - softc = (hv_util_sc*)context; - buf = softc->receive_buffer; - - recv_len = softc->ic_buflen; - ret = vmbus_chan_recv(channel, buf, &recv_len, &request_id); - KASSERT(ret != ENOBUFS, ("hvshutdown recvbuf is not large enough")); - /* XXX check recv_len to make sure that it contains enough data */ - - if ((ret == 0) && recv_len > 0) { - - icmsghdrp = (struct hv_vmbus_icmsg_hdr *) - &buf[sizeof(struct hv_vmbus_pipe_hdr)]; - - if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - int error; + struct hv_util_sc *sc = xsc; + struct vmbus_icmsg_hdr *hdr; + struct vmbus_icmsg_shutdown *msg; + int dlen, error, do_shutdown = 0; + uint64_t xactid; + void *data; + + /* + * Receive request. + */ + data = sc->receive_buffer; + dlen = sc->ic_buflen; + error = vmbus_chan_recv(chan, data, &dlen, &xactid); + KASSERT(error != ENOBUFS, ("icbuf is not large enough")); + if (error) + return; + + if (dlen < sizeof(*hdr)) { + device_printf(sc->ic_dev, "invalid data len %d\n", dlen); + return; + } + hdr = data; - error = vmbus_ic_negomsg(softc, buf, &recv_len); + /* + * Update request, which will be echoed back as response. + */ + switch (hdr->ic_type) { + case VMBUS_ICMSG_TYPE_NEGOTIATE: + error = vmbus_ic_negomsg(sc, data, &dlen); if (error) return; - } else { - shutdown_msg = - (struct hv_vmbus_shutdown_msg_data *) - &buf[sizeof(struct hv_vmbus_pipe_hdr) + - sizeof(struct hv_vmbus_icmsg_hdr)]; - - switch (shutdown_msg->flags) { - case 0: - case 1: - icmsghdrp->status = HV_S_OK; - execute_shutdown = 1; - if(bootverbose) - printf("Shutdown request received -" - " graceful shutdown initiated\n"); - break; - default: - icmsghdrp->status = HV_E_FAIL; - execute_shutdown = 0; - printf("Shutdown request received -" - " Invalid request\n"); - break; - } - } + break; - icmsghdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | - HV_ICMSGHDRFLAG_RESPONSE; + case VMBUS_ICMSG_TYPE_SHUTDOWN: + if (dlen < VMBUS_ICMSG_SHUTDOWN_SIZE_MIN) { + device_printf(sc->ic_dev, "invalid shutdown len %d\n", + dlen); + return; + } + msg = data; - vmbus_chan_send(channel, VMBUS_CHANPKT_TYPE_INBAND, 0, - buf, recv_len, request_id); + /* XXX ic_flags definition? */ + if (msg->ic_haltflags == 0 || msg->ic_haltflags == 1) { + device_printf(sc->ic_dev, "shutdown requested\n"); + hdr->ic_status = VMBUS_ICMSG_STATUS_OK; + do_shutdown = 1; + } else { + device_printf(sc->ic_dev, "unknown shutdown flags " + "0x%08x\n", msg->ic_haltflags); + hdr->ic_status = VMBUS_ICMSG_STATUS_FAIL; + } + break; + + default: + device_printf(sc->ic_dev, "got 0x%08x icmsg\n", hdr->ic_type); + break; } - if (execute_shutdown) - shutdown_nice(RB_POWEROFF); + /* + * Send response by echoing the updated request back. + */ + hdr->ic_flags = VMBUS_ICMSG_FLAG_XACT | VMBUS_ICMSG_FLAG_RESP; + error = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, 0, + data, dlen, xactid); + if (error) + device_printf(sc->ic_dev, "resp send failed: %d\n", error); + + if (do_shutdown) + shutdown_nice(RB_POWEROFF); } static int @@ -135,7 +135,8 @@ hv_shutdown_probe(device_t dev) static int hv_shutdown_attach(device_t dev) { - return hv_util_attach(dev, hv_shutdown_cb); + + return (hv_util_attach(dev, vmbus_shutdown_cb)); } static device_method_t shutdown_methods[] = { Modified: head/sys/dev/hyperv/utilities/vmbus_icreg.h ============================================================================== --- head/sys/dev/hyperv/utilities/vmbus_icreg.h Fri Sep 2 06:08:08 2016 (r305279) +++ head/sys/dev/hyperv/utilities/vmbus_icreg.h Fri Sep 2 06:15:30 2016 (r305280) @@ -91,4 +91,15 @@ struct vmbus_icmsg_heartbeat { #define VMBUS_ICMSG_HEARTBEAT_SIZE_MIN \ __offsetof(struct vmbus_icmsg_heartbeat, ic_rsvd[0]) +struct vmbus_icmsg_shutdown { + struct vmbus_icmsg_hdr ic_hdr; + uint32_t ic_code; + uint32_t ic_timeo; + uint32_t ic_haltflags; + uint8_t ic_msg[2048]; +} __packed; + +#define VMBUS_ICMSG_SHUTDOWN_SIZE_MIN \ + __offsetof(struct vmbus_icmsg_shutdown, ic_msg[0]) + #endif /* !_VMBUS_ICREG_H_ */ From owner-svn-src-head@freebsd.org Fri Sep 2 06: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 C8ED4BCCEC9; Fri, 2 Sep 2016 06:23:29 +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 7B7A1995; Fri, 2 Sep 2016 06:23:29 +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 u826NSjH070803; Fri, 2 Sep 2016 06:23:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u826NSc1070801; Fri, 2 Sep 2016 06:23:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609020623.u826NSc1070801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 2 Sep 2016 06:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305281 - head/sys/dev/hyperv/utilities 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.22 Precedence: list List-Id: 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, 02 Sep 2016 06:23:29 -0000 Author: sephe Date: Fri Sep 2 06:23:28 2016 New Revision: 305281 URL: https://svnweb.freebsd.org/changeset/base/305281 Log: hyperv/ic: Cleanup timesync channel callback. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7745 Modified: head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/vmbus_icreg.h Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Fri Sep 2 06:15:30 2016 (r305280) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Fri Sep 2 06:23:28 2016 (r305281) @@ -22,37 +22,25 @@ * 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$ */ -/* - * A common driver for all hyper-V util services. - */ +#include +__FBSDID("$FreeBSD$"); #include -#include #include -#include +#include #include -#include -#include #include -#include #include +#include #include #include -#include -#include "hv_util.h" -#include "vmbus_if.h" +#include +#include -#define HV_WLTIMEDELTA 116444736000000000L /* in 100ns unit */ -#define HV_ICTIMESYNCFLAG_PROBE 0 -#define HV_ICTIMESYNCFLAG_SYNC 1 -#define HV_ICTIMESYNCFLAG_SAMPLE 2 -#define HV_NANO_SEC_PER_SEC 1000000000 -#define HV_NANO_SEC_PER_MILLI_SEC 1000000 +#include "vmbus_if.h" static const struct vmbus_ic_desc vmbus_timesync_descs[] = { { @@ -64,135 +52,144 @@ static const struct vmbus_ic_desc vmbus_ VMBUS_IC_DESC_END }; -struct hv_ictimesync_data { - uint64_t parenttime; - uint64_t childtime; - uint64_t roundtriptime; - uint8_t flags; -} __packed; - -/* - * Globals - */ SYSCTL_NODE(_hw, OID_AUTO, hvtimesync, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Hyper-V timesync interface"); -/* Ignore the sync request when set to 1. */ -static int ignore_sync_req = 0; -SYSCTL_INT(_hw_hvtimesync, OID_AUTO, ignore_sync_req, CTLFLAG_RWTUN, - &ignore_sync_req, 0, - "Ignore the sync request when set to 1."); +static int vmbus_ts_ignore_sync = 0; +SYSCTL_INT(_hw_hvtimesync, OID_AUTO, ignore_sync, CTLFLAG_RWTUN, + &vmbus_ts_ignore_sync, 0, "Ignore the sync request."); /* * Trigger sample sync when drift exceeds threshold (ms). * Ignore the sample request when set to 0. */ -static int sample_drift = 100; -SYSCTL_INT(_hw_hvtimesync, OID_AUTO, sample_drift, CTLFLAG_RWTUN, - &sample_drift, 0, - "Threshold that makes sample request trigger the sync."); - -/** - * @brief Synchronize time with host after reboot, restore, etc. - * - * ICTIMESYNCFLAG_SYNC flag bit indicates reboot, restore events of the VM. - * After reboot the flag ICTIMESYNCFLAG_SYNC is included in the first time - * message after the timesync channel is opened. Since the hv_utils module is - * loaded after hv_vmbus, the first message is usually missed. The other - * thing is, systime is automatically set to emulated hardware clock which may - * not be UTC time or in the same time zone. So, to override these effects, we - * use the first 50 time samples for initial system time setting. - */ -static inline -void hv_adj_guesttime(hv_util_sc *sc, uint64_t hosttime, uint8_t flags) +static int vmbus_ts_sample_thresh = 100; +SYSCTL_INT(_hw_hvtimesync, OID_AUTO, sample_thresh, CTLFLAG_RWTUN, + &vmbus_ts_sample_thresh, 0, + "Threshold that makes sample request trigger the sync (unit: ms)."); + +static int vmbus_ts_sample_verbose = 0; +SYSCTL_INT(_hw_hvtimesync, OID_AUTO, sample_verbose, CTLFLAG_RWTUN, + &vmbus_ts_sample_verbose, 0, "Increase sample request verbosity."); + +static void +vmbus_timesync(struct hv_util_sc *sc, uint64_t hvtime, uint8_t tsflags) { - struct timespec guest_ts, host_ts; - uint64_t host_tns, guest_tns; - int64_t diff; - int error; - - host_tns = (hosttime - HV_WLTIMEDELTA) * 100; - host_ts.tv_sec = (time_t)(host_tns/HV_NANO_SEC_PER_SEC); - host_ts.tv_nsec = (long)(host_tns%HV_NANO_SEC_PER_SEC); + struct timespec vm_ts; + uint64_t hv_ns, vm_ns; - nanotime(&guest_ts); - guest_tns = guest_ts.tv_sec * HV_NANO_SEC_PER_SEC + guest_ts.tv_nsec; + hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE) * VMBUS_ICMSG_TS_FACTOR; + nanotime(&vm_ts); + vm_ns = (vm_ts.tv_sec * NANOSEC) + vm_ts.tv_nsec; + + if ((tsflags & VMBUS_ICMSG_TS_FLAG_SYNC) && !vmbus_ts_ignore_sync) { + struct timespec hv_ts; - if ((flags & HV_ICTIMESYNCFLAG_SYNC) != 0 && ignore_sync_req == 0) { if (bootverbose) { - device_printf(sc->ic_dev, "handle sync request " - "{host: %ju, guest: %ju}\n", - (uintmax_t)host_tns, (uintmax_t)guest_tns); + device_printf(sc->ic_dev, "apply sync request, " + "hv: %ju, vm: %ju\n", + (uintmax_t)hv_ns, (uintmax_t)vm_ns); } - - error = kern_clock_settime(curthread, CLOCK_REALTIME, - &host_ts); + hv_ts.tv_sec = hv_ns / NANOSEC; + hv_ts.tv_nsec = hv_ns % NANOSEC; + kern_clock_settime(curthread, CLOCK_REALTIME, &hv_ts); + /* Done! */ return; } - if ((flags & HV_ICTIMESYNCFLAG_SAMPLE) != 0 && sample_drift != 0) { - if (bootverbose) { - device_printf(sc->ic_dev, "handle sample request " - "{host: %ju, guest: %ju}\n", - (uintmax_t)host_tns, (uintmax_t)guest_tns); + if ((tsflags & VMBUS_ICMSG_TS_FLAG_SAMPLE) && + vmbus_ts_sample_thresh > 0) { + int64_t diff; + + if (vmbus_ts_sample_verbose) { + device_printf(sc->ic_dev, "sample request, " + "hv: %ju, vm: %ju\n", + (uintmax_t)hv_ns, (uintmax_t)vm_ns); } - diff = (int64_t)(host_tns - guest_tns) / HV_NANO_SEC_PER_MILLI_SEC; - if (diff > sample_drift || diff < -sample_drift) { - error = kern_clock_settime(curthread, CLOCK_REALTIME, - &host_ts); - if (bootverbose) - device_printf(sc->ic_dev, "trigger sample sync"); + if (hv_ns > vm_ns) + diff = hv_ns - vm_ns; + else + diff = vm_ns - hv_ns; + /* nanosec -> millisec */ + diff /= 1000000; + + if (diff > vmbus_ts_sample_thresh) { + struct timespec hv_ts; + + if (bootverbose) { + device_printf(sc->ic_dev, + "apply sample request, hv: %ju, vm: %ju\n", + (uintmax_t)hv_ns, (uintmax_t)vm_ns); + } + hv_ts.tv_sec = hv_ns / NANOSEC; + hv_ts.tv_nsec = hv_ns % NANOSEC; + kern_clock_settime(curthread, CLOCK_REALTIME, &hv_ts); } + /* Done */ return; } } -/** - * Time Sync Channel message handler - */ static void -hv_timesync_cb(struct vmbus_channel *channel, void *context) +vmbus_timesync_cb(struct vmbus_channel *chan, void *xsc) { - hv_vmbus_icmsg_hdr* icmsghdrp; - uint32_t recvlen; - uint64_t requestId; - int ret; - uint8_t* time_buf; - struct hv_ictimesync_data* timedatap; - hv_util_sc *softc; - - softc = (hv_util_sc*)context; - time_buf = softc->receive_buffer; - - recvlen = softc->ic_buflen; - ret = vmbus_chan_recv(channel, time_buf, &recvlen, &requestId); - KASSERT(ret != ENOBUFS, ("hvtimesync recvbuf is not large enough")); - /* XXX check recvlen to make sure that it contains enough data */ - - if ((ret == 0) && recvlen > 0) { - icmsghdrp = (struct hv_vmbus_icmsg_hdr *) &time_buf[ - sizeof(struct hv_vmbus_pipe_hdr)]; + struct hv_util_sc *sc = xsc; + struct vmbus_icmsg_hdr *hdr; + const struct vmbus_icmsg_timesync *msg; + int dlen, error; + uint64_t xactid; + void *data; + + /* + * Receive request. + */ + data = sc->receive_buffer; + dlen = sc->ic_buflen; + error = vmbus_chan_recv(chan, data, &dlen, &xactid); + KASSERT(error != ENOBUFS, ("icbuf is not large enough")); + if (error) + return; - if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - int error; + if (dlen < sizeof(*hdr)) { + device_printf(sc->ic_dev, "invalid data len %d\n", dlen); + return; + } + hdr = data; - error = vmbus_ic_negomsg(softc, time_buf, &recvlen); + /* + * Update request, which will be echoed back as response. + */ + switch (hdr->ic_type) { + case VMBUS_ICMSG_TYPE_NEGOTIATE: + error = vmbus_ic_negomsg(sc, data, &dlen); if (error) return; - } else { - timedatap = (struct hv_ictimesync_data *) &time_buf[ - sizeof(struct hv_vmbus_pipe_hdr) + - sizeof(struct hv_vmbus_icmsg_hdr)]; - hv_adj_guesttime(softc, timedatap->parenttime, timedatap->flags); - } + break; - icmsghdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION - | HV_ICMSGHDRFLAG_RESPONSE; - - vmbus_chan_send(channel, VMBUS_CHANPKT_TYPE_INBAND, 0, - time_buf, recvlen, requestId); + case VMBUS_ICMSG_TYPE_TIMESYNC: + if (dlen < sizeof(*msg)) { + device_printf(sc->ic_dev, "invalid timesync len %d\n", + dlen); + return; + } + msg = data; + vmbus_timesync(sc, msg->ic_hvtime, msg->ic_tsflags); + break; + + default: + device_printf(sc->ic_dev, "got 0x%08x icmsg\n", hdr->ic_type); + break; } + + /* + * Send response by echoing the updated request back. + */ + hdr->ic_flags = VMBUS_ICMSG_FLAG_XACT | VMBUS_ICMSG_FLAG_RESP; + error = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, 0, + data, dlen, xactid); + if (error) + device_printf(sc->ic_dev, "resp send failed: %d\n", error); } static int @@ -205,20 +202,15 @@ hv_timesync_probe(device_t dev) static int hv_timesync_attach(device_t dev) { - return hv_util_attach(dev, hv_timesync_cb); -} -static int -hv_timesync_detach(device_t dev) -{ - return hv_util_detach(dev); + return (hv_util_attach(dev, vmbus_timesync_cb)); } static device_method_t timesync_methods[] = { /* Device interface */ DEVMETHOD(device_probe, hv_timesync_probe), DEVMETHOD(device_attach, hv_timesync_attach), - DEVMETHOD(device_detach, hv_timesync_detach), + DEVMETHOD(device_detach, hv_util_detach), { 0, 0 } }; Modified: head/sys/dev/hyperv/utilities/vmbus_icreg.h ============================================================================== --- head/sys/dev/hyperv/utilities/vmbus_icreg.h Fri Sep 2 06:15:30 2016 (r305280) +++ head/sys/dev/hyperv/utilities/vmbus_icreg.h Fri Sep 2 06:23:28 2016 (r305281) @@ -91,6 +91,7 @@ struct vmbus_icmsg_heartbeat { #define VMBUS_ICMSG_HEARTBEAT_SIZE_MIN \ __offsetof(struct vmbus_icmsg_heartbeat, ic_rsvd[0]) +/* VMBUS_ICMSG_TYPE_SHUTDOWN */ struct vmbus_icmsg_shutdown { struct vmbus_icmsg_hdr ic_hdr; uint32_t ic_code; @@ -102,4 +103,23 @@ struct vmbus_icmsg_shutdown { #define VMBUS_ICMSG_SHUTDOWN_SIZE_MIN \ __offsetof(struct vmbus_icmsg_shutdown, ic_msg[0]) +/* VMBUS_ICMSG_TYPE_TIMESYNC */ +struct vmbus_icmsg_timesync { + struct vmbus_icmsg_hdr ic_hdr; + uint64_t ic_hvtime; + uint64_t ic_vmtime; + uint64_t ic_rtt; + uint8_t ic_tsflags; /* VMBUS_ICMSG_TS_FLAG_ */ +} __packed; + +#define VMBUS_ICMSG_TS_FLAG_SYNC 0x01 +#define VMBUS_ICMSG_TS_FLAG_SAMPLE 0x02 + +/* XXX consolidate w/ hyperv */ +#define VMBUS_ICMSG_TS_BASE 116444736000000000ULL +#define VMBUS_ICMSG_TS_FACTOR 100ULL +#ifndef NANOSEC +#define NANOSEC 1000000000ULL +#endif + #endif /* !_VMBUS_ICREG_H_ */ From owner-svn-src-head@freebsd.org Fri Sep 2 08:17: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 EB47BBCD6F5; Fri, 2 Sep 2016 08:17:44 +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 BC66DFD; Fri, 2 Sep 2016 08:17:44 +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 u828HhWg012515; Fri, 2 Sep 2016 08:17:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u828HhDj012514; Fri, 2 Sep 2016 08:17:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609020817.u828HhDj012514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 2 Sep 2016 08:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305283 - head/lib/msun/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.22 Precedence: list List-Id: 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, 02 Sep 2016 08:17:45 -0000 Author: ngie Date: Fri Sep 2 08:17:43 2016 New Revision: 305283 URL: https://svnweb.freebsd.org/changeset/base/305283 Log: Skip :test_large on i386 More assertions are failing on ^/head now. PR: 205446 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/msun/tests/ctrig_test.c Modified: head/lib/msun/tests/ctrig_test.c ============================================================================== --- head/lib/msun/tests/ctrig_test.c Fri Sep 2 06:55:32 2016 (r305282) +++ head/lib/msun/tests/ctrig_test.c Fri Sep 2 08:17:43 2016 (r305283) @@ -427,7 +427,6 @@ test_large(void) test_odd_tol(ctanh, z, CMPLXL(1.0, 8.95257245135025991216632140458264468e-309L), DBL_ULP()); -#if !defined(__i386__) z = CMPLXL(30, 0x1p1023L); test_odd_tol(ctanh, z, CMPLXL(1.0, -1.62994325413993477997492170229268382e-26L), @@ -437,7 +436,6 @@ test_large(void) CMPLXL(0.878606311888306869546254022621986509L, -0.225462792499754505792678258169527424L), DBL_ULP()); -#endif z = CMPLXL(710.6, 0.78539816339744830961566084581987572L); test_odd_tol(csinh, z, @@ -475,8 +473,12 @@ main(int argc, char *argv[]) test_small(); printf("ok 5 - ctrig small\n"); +#if defined(__i386__) + printf("ok 6 # SKIP ctrig large # fails on i386 because of bug 205446\n"); +#else test_large(); printf("ok 6 - ctrig large\n"); +#endif return (0); } From owner-svn-src-head@freebsd.org Fri Sep 2 08: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 03850BCDDB7; Fri, 2 Sep 2016 08:44:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA02CFE5; Fri, 2 Sep 2016 08:44:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u828iFGh023922; Fri, 2 Sep 2016 08:44:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u828iF3L023921; Fri, 2 Sep 2016 08:44:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609020844.u828iF3L023921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Sep 2016 08:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305284 - head/lib/libusb 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.22 Precedence: list List-Id: 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, 02 Sep 2016 08:44:16 -0000 Author: hselasky Date: Fri Sep 2 08:44:14 2016 New Revision: 305284 URL: https://svnweb.freebsd.org/changeset/base/305284 Log: Fix array size issue when using the pre-scaling feature for ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers are allocated when setting up the libusb transfer structure to support the maximum number of frames the kernel can handle. MFC after: 1 week Modified: head/lib/libusb/libusb20.c Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Fri Sep 2 08:17:43 2016 (r305283) +++ head/lib/libusb/libusb20.c Fri Sep 2 08:44:14 2016 (r305284) @@ -176,6 +176,12 @@ libusb20_tr_open_stream(struct libusb20_ return (LIBUSB20_ERROR_BUSY); if (MaxFrameCount & LIBUSB20_MAX_FRAME_PRE_SCALE) { MaxFrameCount &= ~LIBUSB20_MAX_FRAME_PRE_SCALE; + /* + * The kernel can setup 8 times more frames when + * pre-scaling ISOCHRONOUS transfers. Make sure the + * length and pointer buffers are big enough: + */ + MaxFrameCount *= 8; pre_scale = 1; } else { pre_scale = 0; @@ -200,8 +206,13 @@ libusb20_tr_open_stream(struct libusb20_ } memset(xfer->ppBuffer, 0, size); - error = xfer->pdev->methods->tr_open(xfer, MaxBufSize, - MaxFrameCount, ep_no, stream_id, pre_scale); + if (pre_scale) { + error = xfer->pdev->methods->tr_open(xfer, MaxBufSize, + MaxFrameCount / 8, ep_no, stream_id, 1); + } else { + error = xfer->pdev->methods->tr_open(xfer, MaxBufSize, + MaxFrameCount, ep_no, stream_id, 0); + } if (error) { free(xfer->ppBuffer); From owner-svn-src-head@freebsd.org Fri Sep 2 10:13: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 26ED2BCBF0C; Fri, 2 Sep 2016 10:13:53 +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 EDAFDF36; Fri, 2 Sep 2016 10:13:52 +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 u82ADq1D057986; Fri, 2 Sep 2016 10:13:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82ADqGZ057984; Fri, 2 Sep 2016 10:13:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609021013.u82ADqGZ057984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 2 Sep 2016 10:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305285 - in head/sys/arm64: arm64 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.22 Precedence: list List-Id: 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, 02 Sep 2016 10:13:53 -0000 Author: andrew Date: Fri Sep 2 10:13:51 2016 New Revision: 305285 URL: https://svnweb.freebsd.org/changeset/base/305285 Log: Add a pc_clock pcpu field and use it to implement cpu_est_clockrate. This will allow drivers that manage the clock frequency to communicate this with the reset of the kernel. Reported by: jmcneill MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/include/pcpu.h Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Fri Sep 2 08:44:14 2016 (r305284) +++ head/sys/arm64/arm64/machdep.c Fri Sep 2 10:13:51 2016 (r305285) @@ -416,8 +416,17 @@ cpu_flush_dcache(void *ptr, size_t len) int cpu_est_clockrate(int cpu_id, uint64_t *rate) { + struct pcpu *pc; - panic("ARM64TODO: cpu_est_clockrate"); + pc = pcpu_find(cpu_id); + if (pc == NULL || rate == NULL) + return (EINVAL); + + if (pc->pc_clock == 0) + return (EOPNOTSUPP); + + *rate = pc->pc_clock; + return (0); } void Modified: head/sys/arm64/include/pcpu.h ============================================================================== --- head/sys/arm64/include/pcpu.h Fri Sep 2 08:44:14 2016 (r305284) +++ head/sys/arm64/include/pcpu.h Fri Sep 2 10:13:51 2016 (r305285) @@ -38,7 +38,8 @@ #define PCPU_MD_FIELDS \ u_int pc_acpi_id; /* ACPI CPU id */ \ u_int pc_midr; /* stored MIDR value */ \ - char __pad[121] + uint64_t pc_clock; \ + char __pad[113] #ifdef _KERNEL From owner-svn-src-head@freebsd.org Fri Sep 2 18:22: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 5ECEFBCDA9A; Fri, 2 Sep 2016 18:22:57 +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 37BB1C8F; Fri, 2 Sep 2016 18:22:57 +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 u82IMuMK042930; Fri, 2 Sep 2016 18:22:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82IMuQE042929; Fri, 2 Sep 2016 18:22:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201609021822.u82IMuQE042929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Sep 2016 18:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305288 - 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.22 Precedence: list List-Id: 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, 02 Sep 2016 18:22:57 -0000 Author: brooks Date: Fri Sep 2 18:22:56 2016 New Revision: 305288 URL: https://svnweb.freebsd.org/changeset/base/305288 Log: Merge from CheriBSD: Rename sigprop-table constants to SIGPROP_ from SA_ to reduce the impression of a namespace collision. Submitted by: rwatson Reviewed by: jhb, kib (slightly different versions) Obtained from: CheriBSD (814ec5771cb1cb53deba317c561de62a91ae7684) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D7616 Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Sep 2 17:24:16 2016 (r305287) +++ head/sys/kern/kern_sig.c Fri Sep 2 18:22:56 2016 (r305288) @@ -189,46 +189,46 @@ SYSCTL_INT(_kern, OID_AUTO, coredump_dev * The array below categorizes the signals and their default actions * according to the following properties: */ -#define SA_KILL 0x01 /* terminates process by default */ -#define SA_CORE 0x02 /* ditto and coredumps */ -#define SA_STOP 0x04 /* suspend process */ -#define SA_TTYSTOP 0x08 /* ditto, from tty */ -#define SA_IGNORE 0x10 /* ignore by default */ -#define SA_CONT 0x20 /* continue if suspended */ -#define SA_CANTMASK 0x40 /* non-maskable, catchable */ +#define SIGPROP_KILL 0x01 /* terminates process by default */ +#define SIGPROP_CORE 0x02 /* ditto and coredumps */ +#define SIGPROP_STOP 0x04 /* suspend process */ +#define SIGPROP_TTYSTOP 0x08 /* ditto, from tty */ +#define SIGPROP_IGNORE 0x10 /* ignore by default */ +#define SIGPROP_CONT 0x20 /* continue if suspended */ +#define SIGPROP_CANTMASK 0x40 /* non-maskable, catchable */ static int sigproptbl[NSIG] = { - SA_KILL, /* SIGHUP */ - SA_KILL, /* SIGINT */ - SA_KILL|SA_CORE, /* SIGQUIT */ - SA_KILL|SA_CORE, /* SIGILL */ - SA_KILL|SA_CORE, /* SIGTRAP */ - SA_KILL|SA_CORE, /* SIGABRT */ - SA_KILL|SA_CORE, /* SIGEMT */ - SA_KILL|SA_CORE, /* SIGFPE */ - SA_KILL, /* SIGKILL */ - SA_KILL|SA_CORE, /* SIGBUS */ - SA_KILL|SA_CORE, /* SIGSEGV */ - SA_KILL|SA_CORE, /* SIGSYS */ - SA_KILL, /* SIGPIPE */ - SA_KILL, /* SIGALRM */ - SA_KILL, /* SIGTERM */ - SA_IGNORE, /* SIGURG */ - SA_STOP, /* SIGSTOP */ - SA_STOP|SA_TTYSTOP, /* SIGTSTP */ - SA_IGNORE|SA_CONT, /* SIGCONT */ - SA_IGNORE, /* SIGCHLD */ - SA_STOP|SA_TTYSTOP, /* SIGTTIN */ - SA_STOP|SA_TTYSTOP, /* SIGTTOU */ - SA_IGNORE, /* SIGIO */ - SA_KILL, /* SIGXCPU */ - SA_KILL, /* SIGXFSZ */ - SA_KILL, /* SIGVTALRM */ - SA_KILL, /* SIGPROF */ - SA_IGNORE, /* SIGWINCH */ - SA_IGNORE, /* SIGINFO */ - SA_KILL, /* SIGUSR1 */ - SA_KILL, /* SIGUSR2 */ + SIGPROP_KILL, /* SIGHUP */ + SIGPROP_KILL, /* SIGINT */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGQUIT */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGILL */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGTRAP */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGABRT */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGEMT */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGFPE */ + SIGPROP_KILL, /* SIGKILL */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGBUS */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGSEGV */ + SIGPROP_KILL | SIGPROP_CORE, /* SIGSYS */ + SIGPROP_KILL, /* SIGPIPE */ + SIGPROP_KILL, /* SIGALRM */ + SIGPROP_KILL, /* SIGTERM */ + SIGPROP_IGNORE, /* SIGURG */ + SIGPROP_STOP, /* SIGSTOP */ + SIGPROP_STOP | SIGPROP_TTYSTOP, /* SIGTSTP */ + SIGPROP_IGNORE | SIGPROP_CONT, /* SIGCONT */ + SIGPROP_IGNORE, /* SIGCHLD */ + SIGPROP_STOP | SIGPROP_TTYSTOP, /* SIGTTIN */ + SIGPROP_STOP | SIGPROP_TTYSTOP, /* SIGTTOU */ + SIGPROP_IGNORE, /* SIGIO */ + SIGPROP_KILL, /* SIGXCPU */ + SIGPROP_KILL, /* SIGXFSZ */ + SIGPROP_KILL, /* SIGVTALRM */ + SIGPROP_KILL, /* SIGPROF */ + SIGPROP_IGNORE, /* SIGWINCH */ + SIGPROP_IGNORE, /* SIGINFO */ + SIGPROP_KILL, /* SIGUSR1 */ + SIGPROP_KILL, /* SIGUSR2 */ }; static void reschedule_signals(struct proc *p, sigset_t block, int flags); @@ -755,7 +755,7 @@ kern_sigaction(struct thread *td, int si * have to restart the process. */ if (ps->ps_sigact[_SIG_IDX(sig)] == SIG_IGN || - (sigprop(sig) & SA_IGNORE && + (sigprop(sig) & SIGPROP_IGNORE && ps->ps_sigact[_SIG_IDX(sig)] == SIG_DFL)) { /* never to be seen again */ sigqueue_delete_proc(p, sig); @@ -923,7 +923,7 @@ siginit(p) ps = p->p_sigacts; mtx_lock(&ps->ps_mtx); for (i = 1; i <= NSIG; i++) { - if (sigprop(i) & SA_IGNORE && i != SIGCONT) { + if (sigprop(i) & SIGPROP_IGNORE && i != SIGCONT) { SIGADDSET(ps->ps_sigignore, i); } } @@ -940,7 +940,7 @@ sigdflt(struct sigacts *ps, int sig) mtx_assert(&ps->ps_mtx, MA_OWNED); SIGDELSET(ps->ps_sigcatch, sig); - if ((sigprop(sig) & SA_IGNORE) != 0 && sig != SIGCONT) + if ((sigprop(sig) & SIGPROP_IGNORE) != 0 && sig != SIGCONT) SIGADDSET(ps->ps_sigignore, sig); ps->ps_sigact[_SIG_IDX(sig)] = SIG_DFL; SIGDELSET(ps->ps_siginfo, sig); @@ -969,7 +969,7 @@ execsigs(struct proc *p) while (SIGNOTEMPTY(ps->ps_sigcatch)) { sig = sig_ffs(&ps->ps_sigcatch); sigdflt(ps, sig); - if ((sigprop(sig) & SA_IGNORE) != 0) + if ((sigprop(sig) & SIGPROP_IGNORE) != 0) sigqueue_delete_proc(p, sig); } @@ -2154,16 +2154,16 @@ tdsendsignal(struct proc *p, struct thre intrval = ERESTART; mtx_unlock(&ps->ps_mtx); - if (prop & SA_CONT) + if (prop & SIGPROP_CONT) sigqueue_delete_stopmask_proc(p); - else if (prop & SA_STOP) { + else if (prop & SIGPROP_STOP) { /* * If sending a tty stop signal to a member of an orphaned * process group, discard the signal here if the action * is default; don't stop the process below if sleeping, * and don't clear any pending SIGCONT. */ - if ((prop & SA_TTYSTOP) && + if ((prop & SIGPROP_TTYSTOP) && (p->p_pgrp->pg_jobc == 0) && (action == SIG_DFL)) { if (ksi && (ksi->ksi_flags & KSI_INS)) @@ -2188,7 +2188,7 @@ tdsendsignal(struct proc *p, struct thre * except that stopped processes must be continued by SIGCONT. */ if (action == SIG_HOLD && - !((prop & SA_CONT) && (p->p_flag & P_STOPPED_SIG))) + !((prop & SIGPROP_CONT) && (p->p_flag & P_STOPPED_SIG))) return (ret); /* * SIGKILL: Remove procfs STOPEVENTs and ptrace events. @@ -2228,7 +2228,7 @@ tdsendsignal(struct proc *p, struct thre goto runfast; } - if (prop & SA_CONT) { + if (prop & SIGPROP_CONT) { /* * If traced process is already stopped, * then no further action is necessary. @@ -2278,7 +2278,7 @@ tdsendsignal(struct proc *p, struct thre goto out; } - if (prop & SA_STOP) { + if (prop & SIGPROP_STOP) { /* * If traced process is already stopped, * then no further action is necessary. @@ -2325,7 +2325,7 @@ tdsendsignal(struct proc *p, struct thre MPASS(action == SIG_DFL); - if (prop & SA_STOP) { + if (prop & SIGPROP_STOP) { if (p->p_flag & (P_PPWAIT|P_WEXIT)) goto out; p->p_flag |= P_STOPPED_SIG; @@ -2394,7 +2394,7 @@ tdsigwakeup(struct thread *td, int sig, * priority of the idle thread, since we still allow to signal * kernel processes. */ - if (action == SIG_DFL && (prop & SA_KILL) != 0 && + if (action == SIG_DFL && (prop & SIGPROP_KILL) != 0 && td->td_priority > PUSER && !TD_IS_IDLETHREAD(td)) sched_prio(td, PUSER); if (TD_ON_SLEEPQ(td)) { @@ -2411,7 +2411,7 @@ tdsigwakeup(struct thread *td, int sig, * asleep, we are finished; the process should not * be awakened. */ - if ((prop & SA_CONT) && action == SIG_DFL) { + if ((prop & SIGPROP_CONT) && action == SIG_DFL) { thread_unlock(td); PROC_SUNLOCK(p); sigqueue_delete(&p->p_sigqueue, sig); @@ -2427,7 +2427,7 @@ tdsigwakeup(struct thread *td, int sig, * Don't awaken a sleeping thread for SIGSTOP if the * STOP signal is deferred. */ - if ((prop & SA_STOP) != 0 && (td->td_flags & (TDF_SBDRY | + if ((prop & SIGPROP_STOP) != 0 && (td->td_flags & (TDF_SBDRY | TDF_SERESTART | TDF_SEINTR)) == TDF_SBDRY) goto out; @@ -2858,10 +2858,10 @@ issignal(struct thread *td) * if process is member of an orphaned * process group, ignore tty stop signals. */ - if (prop & SA_STOP) { + if (prop & SIGPROP_STOP) { if (p->p_flag & (P_TRACED|P_WEXIT) || (p->p_pgrp->pg_jobc == 0 && - prop & SA_TTYSTOP)) + prop & SIGPROP_TTYSTOP)) break; /* == ignore */ if (TD_SBDRY_INTR(td)) { KASSERT((td->td_flags & TDF_SBDRY) != 0, @@ -2881,7 +2881,7 @@ issignal(struct thread *td) PROC_SUNLOCK(p); mtx_lock(&ps->ps_mtx); goto next; - } else if (prop & SA_IGNORE) { + } else if (prop & SIGPROP_IGNORE) { /* * Except for SIGCONT, shouldn't get here. * Default action is to ignore; drop it. @@ -2897,7 +2897,7 @@ issignal(struct thread *td) * to take action on an ignored signal other * than SIGCONT, unless process is traced. */ - if ((prop & SA_CONT) == 0 && + if ((prop & SIGPROP_CONT) == 0 && (p->p_flag & P_TRACED) == 0) printf("issignal\n"); break; /* == ignore */ @@ -3059,7 +3059,8 @@ sigexit(td, sig) * XXX If another thread attempts to single-thread before us * (e.g. via fork()), we won't get a dump at all. */ - if ((sigprop(sig) & SA_CORE) && thread_single(p, SINGLE_NO_EXIT) == 0) { + if ((sigprop(sig) & SIGPROP_CORE) && + thread_single(p, SINGLE_NO_EXIT) == 0) { p->p_sig = sig; /* * Log signals which would cause core dumps From owner-svn-src-head@freebsd.org Fri Sep 2 18: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 B8ABABCDB2B; Fri, 2 Sep 2016 18:28:15 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 863A9E96; Fri, 2 Sep 2016 18:28:15 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u82ISEAr043136; Fri, 2 Sep 2016 18:28:14 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82ISEXF043133; Fri, 2 Sep 2016 18:28:14 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201609021828.u82ISEXF043133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 2 Sep 2016 18:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305289 - head/usr.bin/w 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.22 Precedence: list List-Id: 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, 02 Sep 2016 18:28:15 -0000 Author: ume Date: Fri Sep 2 18:28:14 2016 New Revision: 305289 URL: https://svnweb.freebsd.org/changeset/base/305289 Log: When -n is specified, don't make bogus DNS queries. Instead, when -n is specified more than once, hostnames stored in utmp are attempted to resolve to display them as network addresses. PR: 212272 Modified: head/usr.bin/w/w.1 head/usr.bin/w/w.c Modified: head/usr.bin/w/w.1 ============================================================================== --- head/usr.bin/w/w.1 Fri Sep 2 18:22:56 2016 (r305288) +++ head/usr.bin/w/w.1 Fri Sep 2 18:28:14 2016 (r305289) @@ -85,6 +85,10 @@ default Do not attempt to resolve network addresses (normally .Nm interprets addresses and attempts to display them as names). +When +.Fl n +is specified more than once, hostnames stored in utmp are attempted to +resolve to display them as network addresses. .El .Pp If one or more Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Fri Sep 2 18:22:56 2016 (r305288) +++ head/usr.bin/w/w.c Fri Sep 2 18:28:14 2016 (r305289) @@ -180,7 +180,7 @@ main(int argc, char *argv[]) nlistf = optarg; break; case 'n': - nflag = 1; + nflag += 1; break; case 'f': case 'l': case 's': case 'u': case 'w': warnx("[-flsuw] no longer supported"); @@ -378,12 +378,12 @@ main(int argc, char *argv[]) lsin->sin_family = AF_INET; isaddr = 1; } - if (!nflag) { + if (nflag == 0) { /* Attempt to change an IP address into a name */ if (isaddr && realhostname_sa(fn, sizeof(fn), sa, sa->sa_len) == HOSTNAME_FOUND) p = fn; - } else if (!isaddr) { + } else if (!isaddr && nflag > 1) { /* * If a host has only one A/AAAA RR, change a * name into an IP address From owner-svn-src-head@freebsd.org Fri Sep 2 18:33: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 74B3DBCDD28; Fri, 2 Sep 2016 18:33:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41165367; Fri, 2 Sep 2016 18:33:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u82IX9Px046666; Fri, 2 Sep 2016 18:33:09 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82IX8Ag046653; Fri, 2 Sep 2016 18:33:08 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201609021833.u82IX8Ag046653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Sep 2016 18:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305290 - in head: lib lib/libifc lib/libifconfig share/examples/libifc share/examples/libifconfig 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.22 Precedence: list List-Id: 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, 02 Sep 2016 18:33:10 -0000 Author: kp Date: Fri Sep 2 18:33:08 2016 New Revision: 305290 URL: https://svnweb.freebsd.org/changeset/base/305290 Log: Renaming libifc to libifconfig in response to feedback on initial commit of this library. Sticking to 'libifconfig' (and 'ifconfig_' as function prefix) should reduce chances of namespace collisions, make it more clear what the library does, and be more in line with existing libraries. Submitted by: Marie Helene Kvello-Aune Differential Revision: https://reviews.freebsd.org/D7742 Reviewed by: cem, kp Added: head/lib/libifconfig/ - copied from r305289, head/lib/libifc/ head/lib/libifconfig/libifconfig.c - copied, changed from r305286, head/lib/libifc/libifc.c head/lib/libifconfig/libifconfig.h - copied, changed from r305286, head/lib/libifc/libifc.h head/lib/libifconfig/libifconfig_internal.c - copied, changed from r305286, head/lib/libifc/libifc_internal.c head/lib/libifconfig/libifconfig_internal.h - copied, changed from r305286, head/lib/libifc/libifc_internal.h head/share/examples/libifconfig/ - copied from r305289, head/share/examples/libifc/ Deleted: head/lib/libifc/ head/lib/libifconfig/libifc.c head/lib/libifconfig/libifc.h head/lib/libifconfig/libifc_internal.c head/lib/libifconfig/libifc_internal.h head/share/examples/libifc/ Modified: head/lib/Makefile head/lib/libifconfig/Makefile head/share/examples/libifconfig/Makefile head/share/examples/libifconfig/ifcreate.c head/share/examples/libifconfig/ifdestroy.c head/share/examples/libifconfig/setdescription.c head/share/examples/libifconfig/setmtu.c head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Sep 2 18:28:14 2016 (r305289) +++ head/lib/Makefile Fri Sep 2 18:33:08 2016 (r305290) @@ -60,7 +60,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ ${_libgssapi} \ ${_librpcsec_gss} \ ${_libiconv_modules} \ - libifc \ + libifconfig \ libipsec \ libjail \ libkiconv \ Modified: head/lib/libifconfig/Makefile ============================================================================== --- head/lib/libifc/Makefile Fri Sep 2 18:28:14 2016 (r305289) +++ head/lib/libifconfig/Makefile Fri Sep 2 18:33:08 2016 (r305290) @@ -1,18 +1,18 @@ # $FreeBSD$ PACKAGE= lib${LIB} -LIB= ifc +LIB= ifconfig # Don't build shared library, for now. NO_PIC= SHLIBDIR?= /lib SHLIB_MAJOR= 1 -SRCS= libifc.c libifc_internal.c +SRCS= libifconfig.c libifconfig_internal.c INCSDIR= ${INCLUDEDIR} -INCS= libifc.h +INCS= libifconfig.h -#MAN= libifco.3 +#MAN= libifconfig.3 CFLAGS+= -I${.CURDIR} WARNS?=6 Copied and modified: head/lib/libifconfig/libifconfig.c (from r305286, head/lib/libifc/libifc.c) ============================================================================== --- head/lib/libifc/libifc.c Fri Sep 2 17:07:52 2016 (r305286, copy source) +++ head/lib/libifconfig/libifconfig.c Fri Sep 2 18:33:08 2016 (r305290) @@ -71,16 +71,16 @@ #include #include -#include "libifc.h" -#include "libifc_internal.h" +#include "libifconfig.h" +#include "libifconfig_internal.h" -libifc_handle_t * -libifc_open(void) +ifconfig_handle_t * +ifconfig_open(void) { - struct libifc_handle *h; + struct ifconfig_handle *h; - h = calloc(1, sizeof(struct libifc_handle)); + h = calloc(1, sizeof(struct ifconfig_handle)); for (int i = 0; i <= AF_MAX; i++) { h->sockets[i] = -1; @@ -91,7 +91,7 @@ libifc_open(void) void -libifc_close(libifc_handle_t *h) +ifconfig_close(ifconfig_handle_t *h) { for (int i = 0; i <= AF_MAX; i++) { if (h->sockets[i] != -1) { @@ -102,29 +102,29 @@ libifc_close(libifc_handle_t *h) } -libifc_errtype -libifc_err_errtype(libifc_handle_t *h) +ifconfig_errtype +ifconfig_err_errtype(ifconfig_handle_t *h) { return (h->error.errtype); } int -libifc_err_errno(libifc_handle_t *h) +ifconfig_err_errno(ifconfig_handle_t *h) { return (h->error.errcode); } unsigned long -libifc_err_ioctlreq(libifc_handle_t *h) +ifconfig_err_ioctlreq(ifconfig_handle_t *h) { return (h->error.ioctl_request); } int -libifc_get_description(libifc_handle_t *h, const char *name, char **description) +ifconfig_get_description(ifconfig_handle_t *h, const char *name, char **description) { struct ifreq ifr; char *descr = NULL; @@ -141,7 +141,7 @@ libifc_get_description(libifc_handle_t * ifr.ifr_buffer.buffer = descr; ifr.ifr_buffer.length = descrlen; - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFDESCR, + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFDESCR, &ifr) != 0) { return (-1); } @@ -166,7 +166,7 @@ libifc_get_description(libifc_handle_t * int -libifc_set_description(libifc_handle_t *h, const char *name, +ifconfig_set_description(ifconfig_handle_t *h, const char *name, const char *newdescription) { struct ifreq ifr; @@ -180,7 +180,7 @@ libifc_set_description(libifc_handle_t * * TODO: Decide whether this should be an error condition instead. */ if (desclen == 0) { - return (libifc_unset_description(h, name)); + return (ifconfig_unset_description(h, name)); } (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); @@ -193,7 +193,7 @@ libifc_set_description(libifc_handle_t * return (-1); } - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFDESCR, &ifr) != 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCSIFDESCR, &ifr) != 0) { free(ifr.ifr_buffer.buffer); return (-1); } @@ -202,7 +202,7 @@ libifc_set_description(libifc_handle_t * } -int libifc_unset_description(libifc_handle_t *h, const char *name) +int ifconfig_unset_description(ifconfig_handle_t *h, const char *name) { struct ifreq ifr; @@ -211,14 +211,14 @@ int libifc_unset_description(libifc_hand ifr.ifr_buffer.length = 0; ifr.ifr_buffer.buffer = NULL; - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFDESCR, &ifr) < 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCSIFDESCR, &ifr) < 0) { return (-1); } return (0); } -int libifc_set_name(libifc_handle_t *h, const char *name, const char *newname) +int ifconfig_set_name(ifconfig_handle_t *h, const char *name, const char *newname) { struct ifreq ifr; char *tmpname; @@ -234,7 +234,7 @@ int libifc_set_name(libifc_handle_t *h, (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_data = tmpname; - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFNAME, &ifr) != 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCSIFNAME, &ifr) != 0) { free(tmpname); return (-1); } @@ -243,27 +243,27 @@ int libifc_set_name(libifc_handle_t *h, } -int libifc_set_mtu(libifc_handle_t *h, const char *name, const int mtu) +int ifconfig_set_mtu(ifconfig_handle_t *h, const char *name, const int mtu) { struct ifreq ifr; memset(&ifr, 0, sizeof(struct ifreq)); (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_mtu = mtu; - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFMTU, &ifr) < 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCSIFMTU, &ifr) < 0) { return (-1); } return (0); } -int libifc_get_mtu(libifc_handle_t *h, const char *name, int *mtu) +int ifconfig_get_mtu(ifconfig_handle_t *h, const char *name, int *mtu) { struct ifreq ifr; memset(&ifr, 0, sizeof(struct ifreq)); (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFMTU, &ifr) == -1) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFMTU, &ifr) == -1) { return (-1); } *mtu = ifr.ifr_mtu; @@ -271,27 +271,27 @@ int libifc_get_mtu(libifc_handle_t *h, c } -int libifc_set_metric(libifc_handle_t *h, const char *name, const int mtu) +int ifconfig_set_metric(ifconfig_handle_t *h, const char *name, const int mtu) { struct ifreq ifr; memset(&ifr, 0, sizeof(struct ifreq)); (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_mtu = mtu; - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFMETRIC, &ifr) < 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCSIFMETRIC, &ifr) < 0) { return (-1); } return (0); } -int libifc_get_metric(libifc_handle_t *h, const char *name, int *metric) +int ifconfig_get_metric(ifconfig_handle_t *h, const char *name, int *metric) { struct ifreq ifr; memset(&ifr, 0, sizeof(struct ifreq)); (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFMETRIC, &ifr) == -1) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFMETRIC, &ifr) == -1) { return (-1); } *metric = ifr.ifr_metric; @@ -299,16 +299,16 @@ int libifc_get_metric(libifc_handle_t *h } -int libifc_set_capability(libifc_handle_t *h, const char *name, +int ifconfig_set_capability(ifconfig_handle_t *h, const char *name, const int capability) { struct ifreq ifr; - struct libifc_capabilities ifcap; + struct ifconfig_capabilities ifcap; int flags; int value; memset(&ifr, 0, sizeof(struct ifreq)); - if (libifc_get_capability(h, name, &ifcap) != 0) { + if (ifconfig_get_capability(h, name, &ifcap) != 0) { return (-1); } @@ -329,22 +329,22 @@ int libifc_set_capability(libifc_handle_ * set for this request. */ ifr.ifr_reqcap = flags; - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFCAP, &ifr) < 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCSIFCAP, &ifr) < 0) { return (-1); } return (0); } -int libifc_get_capability(libifc_handle_t *h, const char *name, - struct libifc_capabilities *capability) +int ifconfig_get_capability(ifconfig_handle_t *h, const char *name, + struct ifconfig_capabilities *capability) { struct ifreq ifr; memset(&ifr, 0, sizeof(struct ifreq)); (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFCAP, &ifr) < 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFCAP, &ifr) < 0) { return (-1); } capability->curcap = ifr.ifr_curcap; @@ -353,21 +353,21 @@ int libifc_get_capability(libifc_handle_ } -int libifc_destroy_interface(libifc_handle_t *h, const char *name) +int ifconfig_destroy_interface(ifconfig_handle_t *h, const char *name) { struct ifreq ifr; memset(&ifr, 0, sizeof(struct ifreq)); (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCIFDESTROY, &ifr) < 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCIFDESTROY, &ifr) < 0) { return (-1); } return (0); } -int libifc_create_interface(libifc_handle_t *h, const char *name, char **ifname) +int ifconfig_create_interface(ifconfig_handle_t *h, const char *name, char **ifname) { struct ifreq ifr; @@ -389,7 +389,7 @@ int libifc_create_interface(libifc_handl /* No special handling for this interface type. */ - if (libifc_ioctlwrap(h, AF_LOCAL, SIOCIFCREATE2, &ifr) < 0) { + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCIFCREATE2, &ifr) < 0) { return (-1); } *ifname = strdup(ifr.ifr_name); Copied and modified: head/lib/libifconfig/libifconfig.h (from r305286, head/lib/libifc/libifc.h) ============================================================================== --- head/lib/libifc/libifc.h Fri Sep 2 17:07:52 2016 (r305286, copy source) +++ head/lib/libifconfig/libifconfig.h Fri Sep 2 18:33:08 2016 (r305290) @@ -34,16 +34,16 @@ typedef enum { OTHER, IOCTL, SOCKET -} libifc_errtype; +} ifconfig_errtype; /* * Opaque definition so calling application can just pass a * pointer to it for library use. */ -struct libifc_handle; -typedef struct libifc_handle libifc_handle_t; +struct ifconfig_handle; +typedef struct ifconfig_handle ifconfig_handle_t; -struct libifc_capabilities { +struct ifconfig_capabilities { /** Current capabilities (ifconfig prints this as 'options')*/ int curcap; /** Requested capabilities (ifconfig prints this as 'capabilities')*/ @@ -55,57 +55,57 @@ struct libifc_capabilities { * Example usage: *{@code * // Create state object - * libifc_handle_t *lifh = libifc_open(); + * ifconfig_handle_t *lifh = ifconfig_open(); * * // Do stuff with it * * // Dispose of the state object - * libifc_close(lifh); + * ifconfig_close(lifh); * lifh = NULL; *} */ -libifc_handle_t *libifc_open(void); +ifconfig_handle_t *ifconfig_open(void); /** Frees resources held in the provided state object. * @param h The state object to close. - * @see #libifc_open(void) + * @see #ifconfig_open(void) */ -void libifc_close(libifc_handle_t *h); +void ifconfig_close(ifconfig_handle_t *h); /** Identifies what kind of error occured. */ -libifc_errtype libifc_err_errtype(libifc_handle_t *h); +ifconfig_errtype ifconfig_err_errtype(ifconfig_handle_t *h); /** Retrieves the errno associated with the error, if any. */ -int libifc_err_errno(libifc_handle_t *h); +int ifconfig_err_errno(ifconfig_handle_t *h); /** If error type was IOCTL, this identifies which request failed. */ -unsigned long libifc_err_ioctlreq(libifc_handle_t *h); +unsigned long ifconfig_err_ioctlreq(ifconfig_handle_t *h); -int libifc_get_description(libifc_handle_t *h, const char *name, +int ifconfig_get_description(ifconfig_handle_t *h, const char *name, char **description); -int libifc_set_description(libifc_handle_t *h, const char *name, +int ifconfig_set_description(ifconfig_handle_t *h, const char *name, const char *newdescription); -int libifc_unset_description(libifc_handle_t *h, const char *name); -int libifc_set_name(libifc_handle_t *h, const char *name, const char *newname); -int libifc_set_mtu(libifc_handle_t *h, const char *name, const int mtu); -int libifc_get_mtu(libifc_handle_t *h, const char *name, int *mtu); +int ifconfig_unset_description(ifconfig_handle_t *h, const char *name); +int ifconfig_set_name(ifconfig_handle_t *h, const char *name, const char *newname); +int ifconfig_set_mtu(ifconfig_handle_t *h, const char *name, const int mtu); +int ifconfig_get_mtu(ifconfig_handle_t *h, const char *name, int *mtu); -int libifc_set_metric(libifc_handle_t *h, const char *name, const int metric); -int libifc_get_metric(libifc_handle_t *h, const char *name, int *metric); +int ifconfig_set_metric(ifconfig_handle_t *h, const char *name, const int metric); +int ifconfig_get_metric(ifconfig_handle_t *h, const char *name, int *metric); -int libifc_set_capability(libifc_handle_t *h, const char *name, +int ifconfig_set_capability(ifconfig_handle_t *h, const char *name, const int capability); -int libifc_get_capability(libifc_handle_t *h, const char *name, - struct libifc_capabilities *capability); +int ifconfig_get_capability(ifconfig_handle_t *h, const char *name, + struct ifconfig_capabilities *capability); /** Destroy a virtual interface * @param name Interface to destroy */ -int libifc_destroy_interface(libifc_handle_t *h, const char *name); +int ifconfig_destroy_interface(ifconfig_handle_t *h, const char *name); /** Creates a (virtual) interface * @param name Name of interface to create. Example: bridge or bridge42 * @param name ifname Is set to actual name of created interface */ -int libifc_create_interface(libifc_handle_t *h, const char *name, +int ifconfig_create_interface(ifconfig_handle_t *h, const char *name, char **ifname); Copied and modified: head/lib/libifconfig/libifconfig_internal.c (from r305286, head/lib/libifc/libifc_internal.c) ============================================================================== --- head/lib/libifc/libifc_internal.c Fri Sep 2 17:07:52 2016 (r305286, copy source) +++ head/lib/libifconfig/libifconfig_internal.c Fri Sep 2 18:33:08 2016 (r305290) @@ -40,11 +40,11 @@ #include -#include "libifc.h" // Needed for libifc_errstate -#include "libifc_internal.h" +#include "libifconfig.h" // Needed for ifconfig_errstate +#include "libifconfig_internal.h" int -libifc_ioctlwrap_ret(libifc_handle_t *h, unsigned long request, int rcode) +ifconfig_ioctlwrap_ret(ifconfig_handle_t *h, unsigned long request, int rcode) { if (rcode != 0) { h->error.errtype = IOCTL; @@ -56,17 +56,17 @@ libifc_ioctlwrap_ret(libifc_handle_t *h, int -libifc_ioctlwrap(libifc_handle_t *h, const int addressfamily, +ifconfig_ioctlwrap(ifconfig_handle_t *h, const int addressfamily, unsigned long request, struct ifreq *ifr) { int s; - if (libifc_socket(h, addressfamily, &s) != 0) { + if (ifconfig_socket(h, addressfamily, &s) != 0) { return (-1); } int rcode = ioctl(s, request, ifr); - return (libifc_ioctlwrap_ret(h, request, rcode)); + return (ifconfig_ioctlwrap_ret(h, request, rcode)); } @@ -74,7 +74,7 @@ libifc_ioctlwrap(libifc_handle_t *h, con * Function to get socket for the specified address family. * If the socket doesn't already exist, attempt to create it. */ -int libifc_socket(libifc_handle_t *h, const int addressfamily, int *s) +int ifconfig_socket(ifconfig_handle_t *h, const int addressfamily, int *s) { if (addressfamily > AF_MAX) { h->error.errtype = SOCKET; Copied and modified: head/lib/libifconfig/libifconfig_internal.h (from r305286, head/lib/libifc/libifc_internal.h) ============================================================================== --- head/lib/libifc/libifc_internal.h Fri Sep 2 17:07:52 2016 (r305286, copy source) +++ head/lib/libifconfig/libifconfig_internal.h Fri Sep 2 18:33:08 2016 (r305290) @@ -32,14 +32,14 @@ #pragma once -#include "libifc.h" +#include "libifconfig.h" struct errstate { /** * Type of error. */ - libifc_errtype errtype; + ifconfig_errtype errtype; /** * The error occured in this ioctl() request. @@ -53,7 +53,7 @@ struct errstate { int errcode; }; -struct libifc_handle { +struct ifconfig_handle { struct errstate error; int sockets[AF_MAX + 1]; }; @@ -69,7 +69,7 @@ struct libifc_handle { * {@code * static void myfunc() \{ * int s; - * if (libifc_socket(AF_LOCAL, &s) != 0) \{ + * if (ifconfig_socket(AF_LOCAL, &s) != 0) \{ * // Handle error state here * \} * // user code here @@ -77,11 +77,11 @@ struct libifc_handle { * } * } */ -int libifc_socket(libifc_handle_t *h, const int addressfamily, int *s); +int ifconfig_socket(ifconfig_handle_t *h, const int addressfamily, int *s); /** Function used by other wrapper functions to populate _errstate when appropriate.*/ -int libifc_ioctlwrap_ret(libifc_handle_t *h, unsigned long request, int rcode); +int ifconfig_ioctlwrap_ret(ifconfig_handle_t *h, unsigned long request, int rcode); -/** Function to wrap ioctl() and automatically populate libifc_errstate when appropriate.*/ -int libifc_ioctlwrap(libifc_handle_t *h, const int addressfamily, +/** Function to wrap ioctl() and automatically populate ifconfig_errstate when appropriate.*/ +int ifconfig_ioctlwrap(ifconfig_handle_t *h, const int addressfamily, unsigned long request, struct ifreq *ifr); Modified: head/share/examples/libifconfig/Makefile ============================================================================== --- head/share/examples/libifc/Makefile Fri Sep 2 18:28:14 2016 (r305289) +++ head/share/examples/libifconfig/Makefile Fri Sep 2 18:33:08 2016 (r305290) @@ -1,9 +1,8 @@ # $FreeBSD$ - default: - $(CC) -Wall -fPIC -lifc -g -o example_setdescription setdescription.c - $(CC) -Wall -fPIC -lifc -g -o example_setmtu setmtu.c - $(CC) -Wall -fPIC -lifc -g -o example_ifdestroy ifdestroy.c - $(CC) -Wall -fPIC -lifc -g -o example_ifcreate ifcreate.c + $(CC) -Wall -fPIC -lifconfig -g -o example_setdescription setdescription.c + $(CC) -Wall -fPIC -lifconfig -g -o example_setmtu setmtu.c + $(CC) -Wall -fPIC -lifconfig -g -o example_ifdestroy ifdestroy.c + $(CC) -Wall -fPIC -lifconfig -g -o example_ifcreate ifcreate.c clean: rm -f example_* Modified: head/share/examples/libifconfig/ifcreate.c ============================================================================== --- head/share/examples/libifc/ifcreate.c Fri Sep 2 18:28:14 2016 (r305289) +++ head/share/examples/libifconfig/ifcreate.c Fri Sep 2 18:33:08 2016 (r305290) @@ -37,7 +37,7 @@ #include #include #include -#include +#include int main(int argc, char *argv[]) @@ -55,21 +55,21 @@ int main(int argc, char *argv[]) printf("Requested interface name: %s\n", ifname); - libifc_handle_t *lifh = libifc_open(); - if (libifc_create_interface(lifh, ifname, &ifactualname) == 0) { + ifconfig_handle_t *lifh = ifconfig_open(); + if (ifconfig_create_interface(lifh, ifname, &ifactualname) == 0) { printf("Successfully created interface '%s'\n", ifactualname); - libifc_close(lifh); + ifconfig_close(lifh); lifh = NULL; free(ifname); free(ifactualname); return (0); } else { - switch (libifc_err_errtype(lifh)) { + switch (ifconfig_err_errtype(lifh)) { case SOCKET: warnx("couldn't create socket. This shouldn't happen.\n"); break; case IOCTL: - if (libifc_err_ioctlreq(lifh) == SIOCIFCREATE2) { + if (ifconfig_err_ioctlreq(lifh) == SIOCIFCREATE2) { warnx( "Failed to create interface (SIOCIFCREATE2)\n"); } @@ -79,12 +79,12 @@ int main(int argc, char *argv[]) "This is a thorough example accommodating for temporary" " 'not implemented yet' errors. That's likely what happened" " now. If not, your guess is as good as mine. ;)" - " Error code: %d\n", libifc_err_errno( + " Error code: %d\n", ifconfig_err_errno( lifh)); break; } - libifc_close(lifh); + ifconfig_close(lifh); lifh = NULL; free(ifname); free(ifactualname); Modified: head/share/examples/libifconfig/ifdestroy.c ============================================================================== --- head/share/examples/libifc/ifdestroy.c Fri Sep 2 18:28:14 2016 (r305289) +++ head/share/examples/libifconfig/ifdestroy.c Fri Sep 2 18:33:08 2016 (r305290) @@ -37,7 +37,7 @@ #include #include #include -#include +#include int main(int argc, char *argv[]) @@ -55,20 +55,20 @@ int main(int argc, char *argv[]) printf("Interface name: %s\n", ifname); - libifc_handle_t *lifh = libifc_open(); - if (libifc_destroy_interface(lifh, ifname) == 0) { + ifconfig_handle_t *lifh = ifconfig_open(); + if (ifconfig_destroy_interface(lifh, ifname) == 0) { printf("Successfully destroyed interface '%s'.", ifname); - libifc_close(lifh); + ifconfig_close(lifh); lifh = NULL; free(ifname); return (0); } else { - switch (libifc_err_errtype(lifh)) { + switch (ifconfig_err_errtype(lifh)) { case SOCKET: warnx("couldn't create socket. This shouldn't happen.\n"); break; case IOCTL: - if (libifc_err_ioctlreq(lifh) == SIOCIFDESTROY) { + if (ifconfig_err_ioctlreq(lifh) == SIOCIFDESTROY) { warnx( "Failed to destroy interface (SIOCIFDESTROY)\n"); } @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) break; } - libifc_close(lifh); + ifconfig_close(lifh); lifh = NULL; free(ifname); return (-1); Modified: head/share/examples/libifconfig/setdescription.c ============================================================================== --- head/share/examples/libifc/setdescription.c Fri Sep 2 18:28:14 2016 (r305289) +++ head/share/examples/libifconfig/setdescription.c Fri Sep 2 18:33:08 2016 (r305290) @@ -35,7 +35,7 @@ #include #include #include -#include +#include int main(int argc, char *argv[]) @@ -54,27 +54,27 @@ int main(int argc, char *argv[]) printf("Interface name: %s\n", ifname); - libifc_handle_t *lifh = libifc_open(); - if (libifc_get_description(lifh, ifname, &curdescr) == 0) { + ifconfig_handle_t *lifh = ifconfig_open(); + if (ifconfig_get_description(lifh, ifname, &curdescr) == 0) { printf("Old description: %s\n", curdescr); } printf("New description: %s\n\n", ifdescr); - if (libifc_set_description(lifh, ifname, ifdescr) == 0) { + if (ifconfig_set_description(lifh, ifname, ifdescr) == 0) { printf("New description successfully set.\n"); } else { - switch (libifc_err_errtype(lifh)) { + switch (ifconfig_err_errtype(lifh)) { case SOCKET: - err(libifc_err_errno(lifh), "Socket error"); + err(ifconfig_err_errno(lifh), "Socket error"); break; case IOCTL: - err(libifc_err_errno( + err(ifconfig_err_errno( lifh), "IOCTL(%lu) error", - libifc_err_ioctlreq(lifh)); + ifconfig_err_ioctlreq(lifh)); break; case OTHER: - err(libifc_err_errno(lifh), "Other error"); + err(ifconfig_err_errno(lifh), "Other error"); break; } } @@ -86,6 +86,6 @@ int main(int argc, char *argv[]) ifdescr = NULL; curdescr = NULL; - libifc_close(lifh); + ifconfig_close(lifh); return (0); } Modified: head/share/examples/libifconfig/setmtu.c ============================================================================== --- head/share/examples/libifc/setmtu.c Fri Sep 2 18:28:14 2016 (r305289) +++ head/share/examples/libifconfig/setmtu.c Fri Sep 2 18:33:08 2016 (r305290) @@ -37,7 +37,7 @@ #include #include #include -#include +#include int main(int argc, char *argv[]) @@ -58,26 +58,26 @@ int main(int argc, char *argv[]) printf("Interface name: %s\n", ifname); printf("New MTU: %d", mtu); - libifc_handle_t *lifh = libifc_open(); - if (libifc_set_mtu(lifh, ifname, mtu) == 0) { + ifconfig_handle_t *lifh = ifconfig_open(); + if (ifconfig_set_mtu(lifh, ifname, mtu) == 0) { printf("Successfully changed MTU of %s to %d\n", ifname, mtu); - libifc_close(lifh); + ifconfig_close(lifh); lifh = NULL; free(ifname); return (0); } else { - switch (libifc_err_errtype(lifh)) { + switch (ifconfig_err_errtype(lifh)) { case SOCKET: warnx("couldn't create socket. This shouldn't happen.\n"); break; case IOCTL: - if (libifc_err_ioctlreq(lifh) == SIOCSIFMTU) { + if (ifconfig_err_ioctlreq(lifh) == SIOCSIFMTU) { warnx("Failed to set MTU (SIOCSIFMTU)\n"); } else { warnx( "Failed to set MTU due to error in unexpected ioctl() call %lu. Error code: %i.\n", - libifc_err_ioctlreq(lifh), - libifc_err_errno(lifh)); + ifconfig_err_ioctlreq(lifh), + ifconfig_err_errno(lifh)); } break; default: @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) break; } - libifc_close(lifh); + ifconfig_close(lifh); lifh = NULL; free(ifname); return (-1); Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Fri Sep 2 18:28:14 2016 (r305289) +++ head/share/mk/bsd.libnames.mk Fri Sep 2 18:33:08 2016 (r305290) @@ -82,7 +82,7 @@ LIBIBMAD?= ${DESTDIR}${LIBDIR}/libibmad. LIBIBSDP?= ${DESTDIR}${LIBDIR}/libibsdp.a LIBIBUMAD?= ${DESTDIR}${LIBDIR}/libibumad.a LIBIBVERBS?= ${DESTDIR}${LIBDIR}/libibverbs.a -LIBIFC?= ${DESTDIR}${LIBDIR}/libifc.a +LIBIFCONFIG?= ${DESTDIR}${LIBDIR}/libifconfig.a LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Fri Sep 2 18:28:14 2016 (r305289) +++ head/share/mk/src.libnames.mk Fri Sep 2 18:33:08 2016 (r305290) @@ -105,7 +105,7 @@ _LIBRARIES= \ heimntlm \ heimsqlite \ hx509 \ - ifc \ + ifconfig \ ipsec \ jail \ kadm5clnt \ From owner-svn-src-head@freebsd.org Fri Sep 2 20:25: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 07515BCD7D4; Fri, 2 Sep 2016 20:25:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8767B25; Fri, 2 Sep 2016 20:25:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7180710AF2D; Fri, 2 Sep 2016 16:25:14 -0400 (EDT) From: John Baldwin To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305290 - in head: lib lib/libifc lib/libifconfig share/examples/libifc share/examples/libifconfig share/mk Date: Fri, 02 Sep 2016 12:24:35 -0700 Message-ID: <10028611.mxKVj2VZ5s@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201609021833.u82IX8Ag046653@repo.freebsd.org> References: <201609021833.u82IX8Ag046653@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 02 Sep 2016 16:25:14 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 02 Sep 2016 20:25:22 -0000 On Friday, September 02, 2016 06:33:08 PM Kristof Provost wrote: > Author: kp > Date: Fri Sep 2 18:33:08 2016 > New Revision: 305290 > URL: https://svnweb.freebsd.org/changeset/base/305290 > > Log: > Renaming libifc to libifconfig in response to feedback on initial commit of > this library. Sticking to 'libifconfig' (and 'ifconfig_' as function prefix) > should reduce chances of namespace collisions, make it more clear what the > library does, and be more in line with existing libraries. > > Submitted by: Marie Helene Kvello-Aune > Differential Revision: https://reviews.freebsd.org/D7742 > Reviewed by: cem, kp Thanks! -- John Baldwin From owner-svn-src-head@freebsd.org Fri Sep 2 20:41: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 90A89BCDD45; Fri, 2 Sep 2016 20:41:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FFCD794; Fri, 2 Sep 2016 20:41: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 u82KfhO4092681; Fri, 2 Sep 2016 20:41:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82KfhRB092680; Fri, 2 Sep 2016 20:41:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201609022041.u82KfhRB092680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 2 Sep 2016 20:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305303 - head/usr.sbin/ypldap 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.22 Precedence: list List-Id: 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, 02 Sep 2016 20:41:44 -0000 Author: bdrewery Date: Fri Sep 2 20:41:43 2016 New Revision: 305303 URL: https://svnweb.freebsd.org/changeset/base/305303 Log: DIRDEPS_BUILD: Update dependencies after a 'make bootstrap-tools'. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/ypldap/Makefile.depend Modified: head/usr.sbin/ypldap/Makefile.depend ============================================================================== --- head/usr.sbin/ypldap/Makefile.depend Fri Sep 2 20:07:05 2016 (r305302) +++ head/usr.sbin/ypldap/Makefile.depend Fri Sep 2 20:41:43 2016 (r305303) @@ -16,6 +16,7 @@ DIRDEPS = \ lib/libopenbsd \ lib/librpcsvc \ lib/libutil \ + usr.bin/yacc.host \ .include From owner-svn-src-head@freebsd.org Fri Sep 2 21: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 D8545BCD8D5; Fri, 2 Sep 2016 21:11:38 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8E54998D; Fri, 2 Sep 2016 21:11:38 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u82LBbkq005791; Fri, 2 Sep 2016 21:11:37 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82LBbad005790; Fri, 2 Sep 2016 21:11:37 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201609022111.u82LBbad005790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 2 Sep 2016 21:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305304 - head/tools/tools/crypto 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.22 Precedence: list List-Id: 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, 02 Sep 2016 21:11:39 -0000 Author: gnn Date: Fri Sep 2 21:11:37 2016 New Revision: 305304 URL: https://svnweb.freebsd.org/changeset/base/305304 Log: Clean up the usage message and remove dead code. Reviewed by: cem MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D7765 Modified: head/tools/tools/crypto/cryptotest.c Modified: head/tools/tools/crypto/cryptotest.c ============================================================================== --- head/tools/tools/crypto/cryptotest.c Fri Sep 2 20:41:43 2016 (r305303) +++ head/tools/tools/crypto/cryptotest.c Fri Sep 2 21:11:37 2016 (r305304) @@ -84,6 +84,7 @@ */ #include +#include #include #include #include @@ -130,9 +131,6 @@ struct alg { { "aes", 0, 16, 16, 16, CRYPTO_AES_CBC}, { "aes192", 0, 16, 24, 24, CRYPTO_AES_CBC}, { "aes256", 0, 16, 32, 32, CRYPTO_AES_CBC}, -#ifdef notdef - { "arc4", 0, 8, 1, 32, CRYPTO_ARC4 }, -#endif { "md5", 1, 8, 16, 16, CRYPTO_MD5_HMAC }, { "sha1", 1, 8, 20, 20, CRYPTO_SHA1_HMAC }, { "sha256", 1, 8, 32, 32, CRYPTO_SHA2_256_HMAC }, @@ -146,8 +144,8 @@ usage(const char* cmd) printf("usage: %s [-czsbv] [-d dev] [-a algorithm] [count] [size ...]\n", cmd); printf("where algorithm is one of:\n"); - printf(" des 3des (default) blowfish cast skipjack rij\n"); - printf(" aes aes192 aes256 arc4\n"); + printf(" null des 3des (default) blowfish cast skipjack rij\n"); + printf(" aes aes192 aes256 md5 sha1 sha256 sha384 sha512\n"); printf("count is the number of encrypt/decrypt ops to do\n"); printf("size is the number of bytes of text to encrypt+decrypt\n"); printf("\n"); @@ -158,6 +156,7 @@ usage(const char* cmd) printf("-v be verbose\n"); printf("-b mark operations for batching\n"); printf("-p profile kernel crypto operation (must be root)\n"); + printf("-t n for n threads and run tests concurrently\n"); exit(-1); } @@ -483,17 +482,10 @@ runtests(struct alg *alg, int count, int if (t) { int nops = alg->ishash ? count : 2*count; -#if 0 - t /= threads; - printf("%6.3lf sec, %7d %6s crypts, %7d bytes, %8.0lf byte/sec, %7.1lf Mb/sec\n", - t, nops, alg->name, size, (double)nops*size / t, - (double)nops*size / t * 8 / 1024 / 1024); -#else nops *= threads; printf("%8.3lf sec, %7d %6s crypts, %7d bytes, %8.0lf byte/sec, %7.1lf Mb/sec\n", t, nops, alg->name, size, (double)nops*size / t, (double)nops*size / t * 8 / 1024 / 1024); -#endif } #ifdef __FreeBSD__ if (profile) { From owner-svn-src-head@freebsd.org Fri Sep 2 21:13: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 12BABBCDC62; Fri, 2 Sep 2016 21:13:48 +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 C139DE07; Fri, 2 Sep 2016 21:13:47 +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 u82LDl5p007307; Fri, 2 Sep 2016 21:13:47 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82LDkkO007303; Fri, 2 Sep 2016 21:13:46 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201609022113.u82LDkkO007303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 2 Sep 2016 21:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305305 - head/bin/sh/tests/builtins 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.22 Precedence: list List-Id: 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, 02 Sep 2016 21:13:48 -0000 Author: jilles Date: Fri Sep 2 21:13:46 2016 New Revision: 305305 URL: https://svnweb.freebsd.org/changeset/base/305305 Log: sh: Add some tests for non-standard features of the echo builtin. MFC after: 1 week Added: head/bin/sh/tests/builtins/echo1.0 (contents, props changed) head/bin/sh/tests/builtins/echo2.0 (contents, props changed) head/bin/sh/tests/builtins/echo3.0 (contents, props changed) Modified: head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Fri Sep 2 21:11:37 2016 (r305304) +++ head/bin/sh/tests/builtins/Makefile Fri Sep 2 21:13:46 2016 (r305305) @@ -68,6 +68,9 @@ ${PACKAGE}FILES+= dot1.0 ${PACKAGE}FILES+= dot2.0 ${PACKAGE}FILES+= dot3.0 ${PACKAGE}FILES+= dot4.0 +${PACKAGE}FILES+= echo1.0 +${PACKAGE}FILES+= echo2.0 +${PACKAGE}FILES+= echo3.0 ${PACKAGE}FILES+= eval1.0 ${PACKAGE}FILES+= eval2.0 ${PACKAGE}FILES+= eval3.0 Added: head/bin/sh/tests/builtins/echo1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/echo1.0 Fri Sep 2 21:13:46 2016 (r305305) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# Not specified by POSIX. + +[ "`echo -n a b; echo c d; echo e f`" = "a bc d +e f" ] Added: head/bin/sh/tests/builtins/echo2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/echo2.0 Fri Sep 2 21:13:46 2016 (r305305) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Not specified by POSIX. + +a=`echo -e '\a\b\e\f\n\r\t\v\\\\\0041\c'; echo .` +b=`printf '\a\b\033\f\n\r\t\v\\\\!.'` +[ "$a" = "$b" ] Added: head/bin/sh/tests/builtins/echo3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/echo3.0 Fri Sep 2 21:13:46 2016 (r305305) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# Not specified by POSIX. + +[ "`echo -e 'a\cb' c; echo d`" = "ad" ] From owner-svn-src-head@freebsd.org Fri Sep 2 21:14: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 425CFBCDD2D; Fri, 2 Sep 2016 21:14:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0122CF8B; Fri, 2 Sep 2016 21:14:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u82LEUdM007376; Fri, 2 Sep 2016 21:14:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82LETjU007369; Fri, 2 Sep 2016 21:14:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201609022114.u82LETjU007369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 2 Sep 2016 21:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305306 - head/sbin/dhclient 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.22 Precedence: list List-Id: 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, 02 Sep 2016 21:14:31 -0000 Author: cem Date: Fri Sep 2 21:14:29 2016 New Revision: 305306 URL: https://svnweb.freebsd.org/changeset/base/305306 Log: dhclient: add support for interface-mtu (26) Make dhclient set interface MTU if it was provided. This version implements MTU setting in dhclient itself before it runs dhclient-script. PR: 206721 Submitted by: novel@ Reported by: Jarrod Petz Reviewed by: cem, allanjude Differential Revision: https://reviews.freebsd.org/D5675 Modified: head/sbin/dhclient/clparse.c head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h head/sbin/dhclient/dispatch.c head/sbin/dhclient/privsep.c head/sbin/dhclient/privsep.h Modified: head/sbin/dhclient/clparse.c ============================================================================== --- head/sbin/dhclient/clparse.c Fri Sep 2 21:13:46 2016 (r305305) +++ head/sbin/dhclient/clparse.c Fri Sep 2 21:14:29 2016 (r305306) @@ -102,6 +102,8 @@ read_client_conf(void) [top_level_config.requested_option_count++] = DHO_HOST_NAME; top_level_config.requested_options [top_level_config.requested_option_count++] = DHO_DOMAIN_SEARCH; + top_level_config.requested_options + [top_level_config.requested_option_count++] = DHO_INTERFACE_MTU; if ((cfile = fopen(path_dhclient_conf, "r")) != NULL) { do { Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Fri Sep 2 21:13:46 2016 (r305305) +++ head/sbin/dhclient/dhclient.c Fri Sep 2 21:14:29 2016 (r305306) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "privsep.h" #include +#include #include @@ -132,6 +133,9 @@ int fork_privchld(int, int); ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) +/* Minimum MTU is 68 as per RFC791, p. 24 */ +#define MIN_MTU 68 + static time_t scripttime; int @@ -798,9 +802,20 @@ dhcpack(struct packet *packet) void bind_lease(struct interface_info *ip) { + struct option_data *opt; + /* Remember the medium. */ ip->client->new->medium = ip->client->medium; + opt = &ip->client->new->options[DHO_INTERFACE_MTU]; + if (opt->len == sizeof(u_int16_t)) { + u_int16_t mtu = be16dec(opt->data); + if (mtu < MIN_MTU) + warning("mtu size %u < %d: ignored", (unsigned)mtu, MIN_MTU); + else + interface_set_mtu_unpriv(privfd, mtu); + } + /* Write out the new lease. */ write_client_lease(ip, ip->client->new, 0); Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Fri Sep 2 21:13:46 2016 (r305305) +++ head/sbin/dhclient/dhcpd.h Fri Sep 2 21:14:29 2016 (r305306) @@ -319,6 +319,8 @@ void cancel_timeout(void (*)(void *), vo void add_protocol(char *, int, void (*)(struct protocol *), void *); void remove_protocol(struct protocol *); int interface_link_status(char *); +void interface_set_mtu_unpriv(int, u_int16_t); +void interface_set_mtu_priv(char *, u_int16_t); /* hash.c */ struct hash_table *new_hash(void); Modified: head/sbin/dhclient/dispatch.c ============================================================================== --- head/sbin/dhclient/dispatch.c Fri Sep 2 21:13:46 2016 (r305305) +++ head/sbin/dhclient/dispatch.c Fri Sep 2 21:14:29 2016 (r305306) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "dhcpd.h" +#include "privsep.h" #include @@ -501,3 +502,46 @@ interface_link_status(char *ifname) } return (1); } + +void +interface_set_mtu_unpriv(int privfd, u_int16_t mtu) +{ + struct imsg_hdr hdr; + struct buf *buf; + int errs = 0; + + hdr.code = IMSG_SET_INTERFACE_MTU; + hdr.len = sizeof(hdr) + + sizeof(u_int16_t); + + if ((buf = buf_open(hdr.len)) == NULL) + error("buf_open: %m"); + + errs += buf_add(buf, &hdr, sizeof(hdr)); + errs += buf_add(buf, &mtu, sizeof(mtu)); + if (errs) + error("buf_add: %m"); + + if (buf_close(privfd, buf) == -1) + error("buf_close: %m"); +} + +void +interface_set_mtu_priv(char *ifname, u_int16_t mtu) +{ + struct ifreq ifr; + int sock; + + if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + error("Can't create socket"); + + memset(&ifr, 0, sizeof(ifr)); + + strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + ifr.ifr_mtu = mtu; + + if (ioctl(sock, SIOCSIFMTU, &ifr) == -1) + warning("SIOCSIFMTU failed (%d): %s", mtu, + strerror(errno)); + close(sock); +} Modified: head/sbin/dhclient/privsep.c ============================================================================== --- head/sbin/dhclient/privsep.c Fri Sep 2 21:13:46 2016 (r305305) +++ head/sbin/dhclient/privsep.c Fri Sep 2 21:14:29 2016 (r305306) @@ -111,6 +111,7 @@ dispatch_imsg(struct interface_info *ifi struct client_lease lease; int ret, i, optlen; struct buf *buf; + u_int16_t mtu; buf_read(fd, &hdr, sizeof(hdr)); @@ -235,6 +236,13 @@ dispatch_imsg(struct interface_info *ifi case IMSG_SEND_PACKET: send_packet_priv(ifi, &hdr, fd); break; + case IMSG_SET_INTERFACE_MTU: + if (hdr.len < sizeof(hdr) + sizeof(u_int16_t)) + error("corrupted message received"); + + buf_read(fd, &mtu, sizeof(u_int16_t)); + interface_set_mtu_priv(ifi->name, mtu); + break; default: error("received unknown message, code %d", hdr.code); } Modified: head/sbin/dhclient/privsep.h ============================================================================== --- head/sbin/dhclient/privsep.h Fri Sep 2 21:13:46 2016 (r305305) +++ head/sbin/dhclient/privsep.h Fri Sep 2 21:14:29 2016 (r305306) @@ -36,7 +36,8 @@ enum imsg_code { IMSG_SCRIPT_WRITE_PARAMS, IMSG_SCRIPT_GO, IMSG_SCRIPT_GO_RET, - IMSG_SEND_PACKET + IMSG_SEND_PACKET, + IMSG_SET_INTERFACE_MTU, }; struct imsg_hdr { From owner-svn-src-head@freebsd.org Fri Sep 2 21:35: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 1ED11BCD87D; Fri, 2 Sep 2016 21:35:34 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E3D74E; Fri, 2 Sep 2016 21:35:33 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u82LZXXh014838; Fri, 2 Sep 2016 21:35:33 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u82LZX7k014837; Fri, 2 Sep 2016 21:35:33 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201609022135.u82LZX7k014837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 2 Sep 2016 21:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305307 - head/tools/tools/crypto 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.22 Precedence: list List-Id: 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, 02 Sep 2016 21:35:34 -0000 Author: gnn Date: Fri Sep 2 21:35:32 2016 New Revision: 305307 URL: https://svnweb.freebsd.org/changeset/base/305307 Log: Add a runner script for cryptotest. Althought cryptotest itself has a -z mode to test all algorithms at a variety of sizes, this script allows us to be more selective. Threads and buffer sizes move in powers of two from 1, for threads, and 256 for buffer sizes. e.g. cryptorun.sh aes 4 512 Test aes with 1, 2 and 4 processes, and at sizes of 256 and 512 bytes. Sponsored by: Rubicon Communications, LLC (Netgate) Added: head/tools/tools/crypto/cryptorun.sh (contents, props changed) Added: head/tools/tools/crypto/cryptorun.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/crypto/cryptorun.sh Fri Sep 2 21:35:32 2016 (r305307) @@ -0,0 +1,32 @@ +#!/bin/sh +# +# A simple test runner for cryptotest +# +# Althought cryptotest itself has a -z mode to test all algorithms at +# a variety of sizes, this script allows us to be more selective. +# Threads and buffer sizes move in powers of two from 1, for threads, +# and 256 for buffer sizes. +# +# e.g. cryptorun.sh aes 4 512 +# +# Test aes with 1, 2 and 4 processes, and at sizes of 256 and 512 bytes. +# +# $FreeBSD$ +# + +threads=1 +size=256 +iterations=1000000 +crypto="/tank/users/gnn/Repos/svn/FreeBSD.HEAD/tools/tools/crypto/cryptotest" +max_threads=$2 +max_size=$3 + +while [ "$threads" -le "$max_threads" ]; do + echo "Testing with $threads processes." + while [ "$size" -le "$max_size" ]; do + $crypto -t $threads -a $1 $iterations $size + size=$(($size * 2)) + done + size=256 + threads=$(($threads * 2)) +done From owner-svn-src-head@freebsd.org Fri Sep 2 21:43: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 016B7BCDDF8; Fri, 2 Sep 2016 21:43:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::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 C480A985; Fri, 2 Sep 2016 21:43:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x22a.google.com with SMTP id to9so5414893pac.1; Fri, 02 Sep 2016 14:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=R2XF1E5lrw77m0h5coPA7aqGeNC4b0B8cM/hUKBwQ1M=; b=BauAykwax/uousXZ50ibeKWoOUx25xJS0KYvbR7N6vZKYC5jQxnSLLH9pH65wBkipV ri+m0Wqg0/WWro7CH5E/F4ripiXqzuiV8hfi8XGP6X1nxHmC7sgYNL+6XH5JqqI6nfbh L0fBqsgzoBdRfevYcTidq/eoUDzdsABJsve3mbQEPlBw2gVgZa1PkZIGQiXxOx+zKMvI vT12d89KaDwHqGP/eB4HybX9gHXRumvsrjpSEqpkqimWQ2RKXATkOr4HtIZZFzowAVX0 JaDt9zaGSeEYqrRZOEBgCas4AplWbDKpmjNTezb3s9c0k4/OozV2iEZzDKjzwj68rZOY mRKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=R2XF1E5lrw77m0h5coPA7aqGeNC4b0B8cM/hUKBwQ1M=; b=PTWJQTxyEKNrIgNXzWx55fMpQxKVRTGag9J1SWBnozLrjQYePGx1am6x1VoSGnrEHF 7ljN14Ya7wZfq3QyQRmrucw7ZzcdcCBjm+m0RNW2TSUzyk261bCGhEu/Vj7P1RT9ohVw snWQLIE7E0IQHvnx1uUJafn/C7yqi7nibRT2FiFgSS2AX9WGxbubMlvOI9eMu6gs5IxD fd+o+n6yK2SgDc0b9nv4ySGkG/M/jtA9uk+CBBzsywHcVeIdEbo2BFtEpJZp6li3f0/v FDPJ/erlDKeRRHUaUMG2y6bMR4uM9ZIWJas18I7zpI3nuOdZJdkNTUrg3XMpnQYhD/g/ kEeQ== X-Gm-Message-State: AE9vXwN3wG9X/Ne+3B/BY3HWU1SEdFMpHHv/Pk1dAKrI0gu8NqqTxrlxu0aD/qMjuYg+UA== X-Received: by 10.66.131.111 with SMTP id ol15mr39856037pab.105.1472852582095; Fri, 02 Sep 2016 14:43:02 -0700 (PDT) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c64sm5947134pfa.51.2016.09.02.14.43.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Sep 2016 14:43:01 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r305307 - head/tools/tools/crypto From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201609022135.u82LZX7k014837@repo.freebsd.org> Date: Fri, 2 Sep 2016 14:43:00 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201609022135.u82LZX7k014837@repo.freebsd.org> To: "George V. Neville-Neil" X-Mailer: Apple Mail (2.3124) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 02 Sep 2016 21:43:03 -0000 > On Sep 2, 2016, at 2:35 PM, George V. Neville-Neil = wrote: >=20 > Author: gnn > Date: Fri Sep 2 21:35:32 2016 > New Revision: 305307 > URL: https://svnweb.freebsd.org/changeset/base/305307 = =E2=80=A6 > = +crypto=3D"/tank/users/gnn/Repos/svn/FreeBSD.HEAD/tools/tools/crypto/crypt= otest=E2=80=9D Why is your zpool hardcoded here :)? -Ngie= From owner-svn-src-head@freebsd.org Fri Sep 2 23:29: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 CA33FBCD735 for ; Fri, 2 Sep 2016 23:29:48 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::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 55733DFB for ; Fri, 2 Sep 2016 23:29:48 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x230.google.com with SMTP id v143so52972462wmv.0 for ; Fri, 02 Sep 2016 16:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=mSvX/an9u+jA+cdejxQwgG4vMhZnI7UZ9AITpVkA0xI=; b=BQi6LTxpUGPCNhs/ncGNJCC+3ygSr68pt5gQS70e8rnDeFoMhKgzjbRay1+MznY4Vo ZlkJRf4kSdc1J6Zw+T/7BzNGA8Z6jBGWUl+JiBiMSFuzh4QmM3EuCGhgcg6jjRyWOTyd Ptu3MXFcMra0DO61T0UV79ZhW5rHDJK9fVf+qJur64kSsV10X7rJHwS6dUYpsOGM/Q3x II7Bmy/VK+AmQQqCsKPfWiZRVwPqZrzvE29ftYVtdjH7JiG7WS//yFOsSLQu6AosBNJW HPzOKPxM/ft8U014py+XS9/UaWAmej/fRnY1SjQUdrukZaHfvXmji3xKXrLuaXabNwQs LeHQ== 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-transfer-encoding; bh=mSvX/an9u+jA+cdejxQwgG4vMhZnI7UZ9AITpVkA0xI=; b=jlvJv0a7qf8cOjEs8Y0jB1PyV0mDPtUvOHT1T8KST9ITgFsRVbkZbQfp5g8cCMm1nR 6j2zzwxVhtAtPZZxPk1yIQ5zPf+rPhbgYcTw50P6iScjfbzW8VJN4BYW8WR0CnEcPws/ okOoa5583Xsj2kbSFEDEcCBaQb673BYSFVd9BPEH/TPxq7eH97VbSTFa5IVblgyZLiKZ rNxySFZlXiRLWwzJN9EJCsklABFaGfjGw8AayTPkRt3xWVt+ufo/9Ptq6KDQcxOVOcNq wBKjUOCpRTJtF7kVHTL6HSKyuRHkQ0N+X+9kh2HapuRn7fwrEPKgU5/JTcLzr55AZ1Vm kmOw== X-Gm-Message-State: AE9vXwNp4cR70rQ1W9zn13KcUVRy5uS3qJ/BM0daKA2+s31dlI89LST9zD+/+oEO+NmHg3hcuXa8CysYoh158IwM X-Received: by 10.28.214.130 with SMTP id n124mr5175873wmg.37.1472858985907; Fri, 02 Sep 2016 16:29:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.236.231 with HTTP; Fri, 2 Sep 2016 16:29:45 -0700 (PDT) In-Reply-To: <201605041348.u44Dmxd0092688@repo.freebsd.org> References: <201605041348.u44Dmxd0092688@repo.freebsd.org> From: Oliver Pinter Date: Sat, 3 Sep 2016 01:29:45 +0200 Message-ID: Subject: Re: svn commit: r299064 - head/sys/kern To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 02 Sep 2016 23:29:48 -0000 Hi! This commit never gets MFCd back to 10-STABLE. Do you still plan to do it? On 5/4/16, Roger Pau Monn=C3=A9 wrote: > Author: royger > Date: Wed May 4 13:48:59 2016 > New Revision: 299064 > URL: https://svnweb.freebsd.org/changeset/base/299064 > > Log: > rtc: fix inverted resolution check > > The current code in clock_register checks if the newly added clock has = a > resolution value higher than the current one in order to make it the > default, which is wrong. Clocks with a lower resolution value should be > better than ones with a higher resolution value, in fact with the curre= nt > code FreeBSD is always selecting the worse clock. > > Reviewed by: kib jhb jkim > Sponsored by: Citrix Systems R&D > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D6185 > > Modified: > head/sys/kern/subr_rtc.c > > Modified: head/sys/kern/subr_rtc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/subr_rtc.c Wed May 4 12:51:27 2016 (r299063) > +++ head/sys/kern/subr_rtc.c Wed May 4 13:48:59 2016 (r299064) > @@ -84,7 +84,7 @@ clock_register(device_t dev, long res) / > { > > if (clock_dev !=3D NULL) { > - if (clock_res > res) { > + if (clock_res <=3D res) { > if (bootverbose) > device_printf(dev, "not installed as " > "time-of-day clock: clock %s has higher " > _______________________________________________ > 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 Sat Sep 3 00:22: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 03314BCE324; Sat, 3 Sep 2016 00:22:44 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C4DAD849; Sat, 3 Sep 2016 00:22:43 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u830Mgos078389; Sat, 3 Sep 2016 00:22:42 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u830MgPs078388; Sat, 3 Sep 2016 00:22:42 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201609030022.u830MgPs078388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 3 Sep 2016 00:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305312 - head/tools/tools/crypto 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.22 Precedence: list List-Id: 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, 03 Sep 2016 00:22:44 -0000 Author: gnn Date: Sat Sep 3 00:22:42 2016 New Revision: 305312 URL: https://svnweb.freebsd.org/changeset/base/305312 Log: Add cpuset support to separate forked processes. Reviewed by: cem Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D7766 Modified: head/tools/tools/crypto/cryptotest.c Modified: head/tools/tools/crypto/cryptotest.c ============================================================================== --- head/tools/tools/crypto/cryptotest.c Fri Sep 2 22:47:57 2016 (r305311) +++ head/tools/tools/crypto/cryptotest.c Sat Sep 3 00:22:42 2016 (r305312) @@ -97,6 +97,7 @@ #include #include #include +#include #include #include @@ -468,6 +469,11 @@ runtests(struct alg *alg, int count, int if (threads > 1) { for (i = 0; i < threads; i++) if (fork() == 0) { + cpuset_t mask; + CPU_ZERO(&mask); + CPU_SET(i, &mask); + cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, + -1, sizeof(mask), &mask); runtest(alg, count, size, cmd, &tvp[i]); exit(0); } @@ -573,6 +579,9 @@ main(int argc, char **argv) } argc--, argv++; } + if (maxthreads > CPU_SETSIZE) + errx(EX_USAGE, "Too many threads, %d, choose fewer.", maxthreads); + if (nsizes == 0) { if (alg) sizes[nsizes++] = alg->blocksize; From owner-svn-src-head@freebsd.org Sat Sep 3 03:14: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 6D86DBCC7AA; Sat, 3 Sep 2016 03:14:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2762F34D; Sat, 3 Sep 2016 03:14:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u833EOSX042855; Sat, 3 Sep 2016 03:14:24 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u833EON5042854; Sat, 3 Sep 2016 03:14:24 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201609030314.u833EON5042854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 3 Sep 2016 03:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305319 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 03:14:25 -0000 Author: alc Date: Sat Sep 3 03:14:24 2016 New Revision: 305319 URL: https://svnweb.freebsd.org/changeset/base/305319 Log: As an optimization to the machine-independent layer, change the machine- dependent pmap_ts_referenced() so that it updates the page's dirty field if a modified bit is found while counting reference bits. This opportunistic update can be performed at low cost and can eliminate the need for some future calls to pmap_is_modified() by the machine- independent layer. MFC after: 3 weeks Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Sep 3 02:51:46 2016 (r305318) +++ head/sys/arm/arm/pmap-v6.c Sat Sep 3 03:14:24 2016 (r305319) @@ -5178,6 +5178,14 @@ pmap_is_referenced(vm_page_t m) * XXX: The exact number of bits to check and clear is a matter that * should be tested and standardized at some point in the future for * optimal aging of shared pages. + * + * As an optimization, update the page's dirty field if a modified bit is + * found while counting reference bits. This opportunistic update can be + * performed at low cost and can eliminate the need for some future calls + * to pmap_is_modified(). However, since this function stops after + * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some + * dirty pages. Those dirty pages will only be detected by a future call + * to pmap_is_modified(). */ int pmap_ts_referenced(vm_page_t m) @@ -5186,7 +5194,7 @@ pmap_ts_referenced(vm_page_t m) pv_entry_t pv, pvf; pmap_t pmap; pt1_entry_t *pte1p, opte1; - pt2_entry_t *pte2p; + pt2_entry_t *pte2p, opte2; vm_paddr_t pa; int rtval = 0; @@ -5205,6 +5213,14 @@ pmap_ts_referenced(vm_page_t m) PMAP_LOCK(pmap); pte1p = pmap_pte1(pmap, pv->pv_va); opte1 = pte1_load(pte1p); + if (pte1_is_dirty(opte1)) { + /* + * Although "opte1" is mapping a 1MB page, because + * this function is called at a 4KB page granularity, + * we only update the 4KB page under test. + */ + vm_page_dirty(m); + } if ((opte1 & PTE1_A) != 0) { /* * Since this reference bit is shared by 256 4KB pages, @@ -5253,7 +5269,10 @@ small_mappings: ("%s: not found a link in page %p's pv list", __func__, m)); pte2p = pmap_pte2_quick(pmap, pv->pv_va); - if ((pte2_load(pte2p) & PTE2_A) != 0) { + opte2 = pte2_load(pte2p); + if (pte2_is_dirty(opte2)) + vm_page_dirty(m); + if ((opte2 & PTE2_A) != 0) { pte2_clear_bit(pte2p, PTE2_A); pmap_tlb_flush(pmap, pv->pv_va); rtval++; From owner-svn-src-head@freebsd.org Sat Sep 3 04:09: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 77165BCD559; Sat, 3 Sep 2016 04:09:04 +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 3AC43AB2; Sat, 3 Sep 2016 04:09:04 +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 u83493Ag061680; Sat, 3 Sep 2016 04:09:03 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8349383061679; Sat, 3 Sep 2016 04:09:03 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201609030409.u8349383061679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 3 Sep 2016 04:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305320 - head/sys/powerpc/powerpc 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.22 Precedence: list List-Id: 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, 03 Sep 2016 04:09:04 -0000 Author: jhibbits Date: Sat Sep 3 04:09:03 2016 New Revision: 305320 URL: https://svnweb.freebsd.org/changeset/base/305320 Log: Use the right ifdef macro. "E500" is not defined, but "BOOKE_E500" is. Without this the idle hook cannot be called. MFC after: 1 week Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sat Sep 3 03:14:24 2016 (r305319) +++ head/sys/powerpc/powerpc/cpu.c Sat Sep 3 04:09:03 2016 (r305320) @@ -663,7 +663,7 @@ static void cpu_idle_booke(sbintime_t sbt) { -#ifdef E500 +#ifdef BOOKE_E500 platform_cpu_idle(PCPU_GET(cpuid)); #endif } From owner-svn-src-head@freebsd.org Sat Sep 3 04:21: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 B53D8BCD8AD; Sat, 3 Sep 2016 04:21:41 +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 84FC22696; Sat, 3 Sep 2016 04:21:41 +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 u834Le0H067162; Sat, 3 Sep 2016 04:21:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u834Lemo067161; Sat, 3 Sep 2016 04:21:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201609030421.u834Lemo067161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 3 Sep 2016 04:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305321 - head/sys/powerpc/mpc85xx 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.22 Precedence: list List-Id: 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, 03 Sep 2016 04:21:41 -0000 Author: jhibbits Date: Sat Sep 3 04:21:40 2016 New Revision: 305321 URL: https://svnweb.freebsd.org/changeset/base/305321 Log: Return a NULL pointer (0 vm_offset) on error in map_dcsr(). mpc85xx_map_dcsr() returns a vm_offset_t, not an error code. Follow-up to r304069. Modified: head/sys/powerpc/mpc85xx/mpc85xx.c Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Sat Sep 3 04:09:03 2016 (r305320) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Sat Sep 3 04:21:40 2016 (r305321) @@ -367,7 +367,7 @@ moveon: err = fdt_get_range(node, 0, &b, &s); if (err != 0) - return (err); + return (0); law_enable(OCP85XX_TGTIF_DCSR, b, 0x400000); return pmap_early_io_map(b, 0x400000); From owner-svn-src-head@freebsd.org Sat Sep 3 08:30: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 5F607BCEEDA; Sat, 3 Sep 2016 08:30:53 +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 0EB58263C; Sat, 3 Sep 2016 08:30:52 +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 u838Uqen061552; Sat, 3 Sep 2016 08:30:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u838Uqql061548; Sat, 3 Sep 2016 08:30:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609030830.u838Uqql061548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 08:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305323 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/ztest 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.22 Precedence: list List-Id: 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, 03 Sep 2016 08:30:53 -0000 Author: mav Date: Sat Sep 3 08:30:51 2016 New Revision: 305323 URL: https://svnweb.freebsd.org/changeset/base/305323 Log: MFV r302991: 6950 ARC should cache compressed data illumos/illumos-gate@dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2 https://github.com/illumos/illumos-gate/commit/dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2 https://www.illumos.org/issues/6950 When reading compressed data from disk, the ARC should keep the compressed block cached and only decompress it when consumers access the block. The uncompressed data should be short-lived allowing the ARC to cache a much larger amount of data. The DMU would also maintain a smaller cache of uncompressed blocks to minimize the impact of decompressing frequently accessed blocks. Reviewed by: Prakash Surya Reviewed by: Dan Kimmel Reviewed by: Matt Ahrens Reviewed by: Paul Dagnelie Reviewed by: Don Brady Reviewed by: Richard Elling Approved by: Richard Lowe Author: George Wilson Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Sep 3 04:53:12 2016 (r305322) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Sep 3 08:30:51 2016 (r305323) @@ -1289,7 +1289,7 @@ visit_indirect(spa_t *spa, const dnode_p } if (!err) ASSERT3U(fill, ==, BP_GET_FILL(bp)); - (void) arc_buf_remove_ref(buf, &buf); + arc_buf_destroy(buf, &buf); } return (err); Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Sep 3 04:53:12 2016 (r305322) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Sep 3 08:30:51 2016 (r305323) @@ -189,6 +189,7 @@ extern uint64_t metaslab_gang_bang; extern uint64_t metaslab_df_alloc_threshold; extern uint64_t zfs_deadman_synctime_ms; extern int metaslab_preload_limit; +extern boolean_t zfs_compressed_arc_enabled; static ztest_shared_opts_t *ztest_shared_opts; static ztest_shared_opts_t ztest_opts; @@ -5355,6 +5356,12 @@ ztest_resume_thread(void *arg) if (spa_suspended(spa)) ztest_resume(spa); (void) poll(NULL, 0, 100); + + /* + * Periodically change the zfs_compressed_arc_enabled setting. + */ + if (ztest_random(10) == 0) + zfs_compressed_arc_enabled = ztest_random(2); } return (NULL); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Sep 3 04:53:12 2016 (r305322) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Sep 3 08:30:51 2016 (r305323) @@ -120,9 +120,134 @@ * - ARC header release, as it removes from L2ARC buflists */ +/* + * ARC operation: + * + * Every block that is in the ARC is tracked by an arc_buf_hdr_t structure. + * This structure can point either to a block that is still in the cache or to + * one that is only accessible in an L2 ARC device, or it can provide + * information about a block that was recently evicted. If a block is + * only accessible in the L2ARC, then the arc_buf_hdr_t only has enough + * information to retrieve it from the L2ARC device. This information is + * stored in the l2arc_buf_hdr_t sub-structure of the arc_buf_hdr_t. A block + * that is in this state cannot access the data directly. + * + * Blocks that are actively being referenced or have not been evicted + * are cached in the L1ARC. The L1ARC (l1arc_buf_hdr_t) is a structure within + * the arc_buf_hdr_t that will point to the data block in memory. A block can + * only be read by a consumer if it has an l1arc_buf_hdr_t. The L1ARC + * caches data in two ways -- in a list of arc buffers (arc_buf_t) and + * also in the arc_buf_hdr_t's private physical data block pointer (b_pdata). + * Each arc buffer (arc_buf_t) is being actively accessed by a specific ARC + * consumer, and always contains uncompressed data. The ARC will provide + * references to this data and will keep it cached until it is no longer in + * use. Typically, the arc will try to cache only the L1ARC's physical data + * block and will aggressively evict any arc_buf_t that is no longer referenced. + * The amount of memory consumed by the arc_buf_t's can be seen via the + * "overhead_size" kstat. + * + * + * arc_buf_hdr_t + * +-----------+ + * | | + * | | + * | | + * +-----------+ + * l2arc_buf_hdr_t| | + * | | + * +-----------+ + * l1arc_buf_hdr_t| | + * | | arc_buf_t + * | b_buf +------------>+---------+ arc_buf_t + * | | |b_next +---->+---------+ + * | b_pdata +-+ |---------| |b_next +-->NULL + * +-----------+ | | | +---------+ + * | |b_data +-+ | | + * | +---------+ | |b_data +-+ + * +->+------+ | +---------+ | + * (potentially) | | | | + * compressed | | | | + * data +------+ | v + * +->+------+ +------+ + * uncompressed | | | | + * data | | | | + * +------+ +------+ + * + * The L1ARC's data pointer, however, may or may not be uncompressed. The + * ARC has the ability to store the physical data (b_pdata) associated with + * the DVA of the arc_buf_hdr_t. Since the b_pdata is a copy of the on-disk + * physical block, it will match its on-disk compression characteristics. + * If the block on-disk is compressed, then the physical data block + * in the cache will also be compressed and vice-versa. This behavior + * can be disabled by setting 'zfs_compressed_arc_enabled' to B_FALSE. When the + * compressed ARC functionality is disabled, the b_pdata will point to an + * uncompressed version of the on-disk data. + * + * When a consumer reads a block, the ARC must first look to see if the + * arc_buf_hdr_t is cached. If the hdr is cached and already has an arc_buf_t, + * then an additional arc_buf_t is allocated and the uncompressed data is + * bcopied from the existing arc_buf_t. If the hdr is cached but does not + * have an arc_buf_t, then the ARC allocates a new arc_buf_t and decompresses + * the b_pdata contents into the arc_buf_t's b_data. If the arc_buf_hdr_t's + * b_pdata is not compressed, then the block is shared with the newly + * allocated arc_buf_t. This block sharing only occurs with one arc_buf_t + * in the arc buffer chain. Sharing the block reduces the memory overhead + * required when the hdr is caching uncompressed blocks or the compressed + * arc functionality has been disabled via 'zfs_compressed_arc_enabled'. + * + * The diagram below shows an example of an uncompressed ARC hdr that is + * sharing its data with an arc_buf_t: + * + * arc_buf_hdr_t + * +-----------+ + * | | + * | | + * | | + * +-----------+ + * l2arc_buf_hdr_t| | + * | | + * +-----------+ + * l1arc_buf_hdr_t| | + * | | arc_buf_t (shared) + * | b_buf +------------>+---------+ arc_buf_t + * | | |b_next +---->+---------+ + * | b_pdata +-+ |---------| |b_next +-->NULL + * +-----------+ | | | +---------+ + * | |b_data +-+ | | + * | +---------+ | |b_data +-+ + * +->+------+ | +---------+ | + * | | | | + * uncompressed | | | | + * data +------+ | | + * ^ +->+------+ | + * | uncompressed | | | + * | data | | | + * | +------+ | + * +---------------------------------+ + * + * Writing to the arc requires that the ARC first discard the b_pdata + * since the physical block is about to be rewritten. The new data contents + * will be contained in the arc_buf_t (uncompressed). As the I/O pipeline + * performs the write, it may compress the data before writing it to disk. + * The ARC will be called with the transformed data and will bcopy the + * transformed on-disk block into a newly allocated b_pdata. + * + * When the L2ARC is in use, it will also take advantage of the b_pdata. The + * L2ARC will always write the contents of b_pdata to the L2ARC. This means + * that when compressed arc is enabled that the L2ARC blocks are identical + * to the on-disk block in the main data pool. This provides a significant + * advantage since the ARC can leverage the bp's checksum when reading from the + * L2ARC to determine if the contents are valid. However, if the compressed + * arc is disabled, then the L2ARC's block must be transformed to look + * like the physical block in the main data pool before comparing the + * checksum and determining its validity. + */ + #include #include +#include #include +#include #include #include #include @@ -155,10 +280,6 @@ static kcondvar_t arc_reclaim_thread_cv; static boolean_t arc_reclaim_thread_exit; static kcondvar_t arc_reclaim_waiters_cv; -static kmutex_t arc_user_evicts_lock; -static kcondvar_t arc_user_evicts_cv; -static boolean_t arc_user_evicts_thread_exit; - static kmutex_t arc_dnlc_evicts_lock; static kcondvar_t arc_dnlc_evicts_cv; static boolean_t arc_dnlc_evicts_thread_exit; @@ -234,13 +355,14 @@ uint64_t zfs_arc_meta_min = 0; int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; -int zfs_disable_dup_eviction = 0; uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */ u_int zfs_arc_free_target = 0; /* Absolute min for arc min / max is 16MB. */ static uint64_t arc_abs_min = 16 << 20; +boolean_t zfs_compressed_arc_enabled = B_TRUE; + static int sysctl_vfs_zfs_arc_free_target(SYSCTL_HANDLER_ARGS); static int sysctl_vfs_zfs_arc_meta_limit(SYSCTL_HANDLER_ARGS); static int sysctl_vfs_zfs_arc_max(SYSCTL_HANDLER_ARGS); @@ -270,6 +392,8 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_ave SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_shrink_shift, CTLFLAG_RW, &arc_shrink_shift, 0, "log2(fraction of arc to reclaim)"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, compressed_arc_enabled, CTLFLAG_RDTUN, + &zfs_compressed_arc_enabled, 0, "Enable compressed ARC"); /* * We don't have a tunable for arc_free_target due to the dependency on @@ -351,7 +475,7 @@ typedef struct arc_state { /* * total amount of evictable data in this state */ - uint64_t arcs_lsize[ARC_BUFC_NUMTYPES]; + refcount_t arcs_esize[ARC_BUFC_NUMTYPES]; /* * total amount of data in this state; this includes: evictable, * non-evictable, ARC_BUFC_DATA, and ARC_BUFC_METADATA. @@ -417,6 +541,26 @@ typedef struct arc_stats { kstat_named_t arcstat_c_max; kstat_named_t arcstat_size; /* + * Number of compressed bytes stored in the arc_buf_hdr_t's b_pdata. + * Note that the compressed bytes may match the uncompressed bytes + * if the block is either not compressed or compressed arc is disabled. + */ + kstat_named_t arcstat_compressed_size; + /* + * Uncompressed size of the data stored in b_pdata. If compressed + * arc is disabled then this value will be identical to the stat + * above. + */ + kstat_named_t arcstat_uncompressed_size; + /* + * Number of bytes stored in all the arc_buf_t's. This is classified + * as "overhead" since this data is typically short-lived and will + * be evicted from the arc when it becomes unreferenced unless the + * zfs_keep_uncompressed_metadata or zfs_keep_uncompressed_level + * values have been set (see comment in dbuf.c for more information). + */ + kstat_named_t arcstat_overhead_size; + /* * Number of bytes consumed by internal ARC structures necessary * for tracking purposes; these structures are not actually * backed by ARC buffers. This includes arc_buf_hdr_t structures @@ -561,16 +705,12 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_evict_reading; kstat_named_t arcstat_l2_evict_l1cached; kstat_named_t arcstat_l2_free_on_write; - kstat_named_t arcstat_l2_cdata_free_on_write; kstat_named_t arcstat_l2_abort_lowmem; kstat_named_t arcstat_l2_cksum_bad; kstat_named_t arcstat_l2_io_error; kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_asize; kstat_named_t arcstat_l2_hdr_size; - kstat_named_t arcstat_l2_compress_successes; - kstat_named_t arcstat_l2_compress_zeros; - kstat_named_t arcstat_l2_compress_failures; kstat_named_t arcstat_l2_padding_needed; kstat_named_t arcstat_l2_write_trylock_fail; kstat_named_t arcstat_l2_write_passed_headroom; @@ -585,9 +725,6 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_write_buffer_list_iter; kstat_named_t arcstat_l2_write_buffer_list_null_iter; kstat_named_t arcstat_memory_throttle_count; - kstat_named_t arcstat_duplicate_buffers; - kstat_named_t arcstat_duplicate_buffers_size; - kstat_named_t arcstat_duplicate_reads; kstat_named_t arcstat_meta_used; kstat_named_t arcstat_meta_limit; kstat_named_t arcstat_meta_max; @@ -630,6 +767,9 @@ static arc_stats_t arc_stats = { { "c_min", KSTAT_DATA_UINT64 }, { "c_max", KSTAT_DATA_UINT64 }, { "size", KSTAT_DATA_UINT64 }, + { "compressed_size", KSTAT_DATA_UINT64 }, + { "uncompressed_size", KSTAT_DATA_UINT64 }, + { "overhead_size", KSTAT_DATA_UINT64 }, { "hdr_size", KSTAT_DATA_UINT64 }, { "data_size", KSTAT_DATA_UINT64 }, { "metadata_size", KSTAT_DATA_UINT64 }, @@ -663,16 +803,12 @@ static arc_stats_t arc_stats = { { "l2_evict_reading", KSTAT_DATA_UINT64 }, { "l2_evict_l1cached", KSTAT_DATA_UINT64 }, { "l2_free_on_write", KSTAT_DATA_UINT64 }, - { "l2_cdata_free_on_write", KSTAT_DATA_UINT64 }, { "l2_abort_lowmem", KSTAT_DATA_UINT64 }, { "l2_cksum_bad", KSTAT_DATA_UINT64 }, { "l2_io_error", KSTAT_DATA_UINT64 }, { "l2_size", KSTAT_DATA_UINT64 }, { "l2_asize", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "l2_compress_successes", KSTAT_DATA_UINT64 }, - { "l2_compress_zeros", KSTAT_DATA_UINT64 }, - { "l2_compress_failures", KSTAT_DATA_UINT64 }, { "l2_padding_needed", KSTAT_DATA_UINT64 }, { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, @@ -687,9 +823,6 @@ static arc_stats_t arc_stats = { { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 }, { "memory_throttle_count", KSTAT_DATA_UINT64 }, - { "duplicate_buffers", KSTAT_DATA_UINT64 }, - { "duplicate_buffers_size", KSTAT_DATA_UINT64 }, - { "duplicate_reads", KSTAT_DATA_UINT64 }, { "arc_meta_used", KSTAT_DATA_UINT64 }, { "arc_meta_limit", KSTAT_DATA_UINT64 }, { "arc_meta_max", KSTAT_DATA_UINT64 }, @@ -762,8 +895,12 @@ static arc_state_t *arc_l2c_only; #define arc_meta_used ARCSTAT(arcstat_meta_used) /* size of metadata */ #define arc_meta_max ARCSTAT(arcstat_meta_max) /* max size of metadata */ -#define L2ARC_IS_VALID_COMPRESS(_c_) \ - ((_c_) == ZIO_COMPRESS_LZ4 || (_c_) == ZIO_COMPRESS_EMPTY) +/* compressed size of entire arc */ +#define arc_compressed_size ARCSTAT(arcstat_compressed_size) +/* uncompressed size of entire arc */ +#define arc_uncompressed_size ARCSTAT(arcstat_uncompressed_size) +/* number of bytes in the arc from arc_buf_t's */ +#define arc_overhead_size ARCSTAT(arcstat_overhead_size) static int arc_no_grow; /* Don't try to grow cache size */ static uint64_t arc_tempreserve; @@ -823,6 +960,7 @@ struct arc_write_callback { */ typedef struct l1arc_buf_hdr { kmutex_t b_freeze_lock; + zio_cksum_t *b_freeze_cksum; #ifdef ZFS_DEBUG /* * used for debugging wtih kmem_flags - by allocating and freeing @@ -833,9 +971,10 @@ typedef struct l1arc_buf_hdr { #endif arc_buf_t *b_buf; - uint32_t b_datacnt; + uint32_t b_bufcnt; /* for waiting on writes to complete */ kcondvar_t b_cv; + uint8_t b_byteswap; /* protected by arc state mutex */ arc_state_t *b_state; @@ -848,8 +987,7 @@ typedef struct l1arc_buf_hdr { refcount_t b_refcnt; arc_callback_t *b_acb; - /* temporary buffer holder for in-flight compressed or padded data */ - void *b_tmp_cdata; + void *b_pdata; } l1arc_buf_hdr_t; typedef struct l2arc_dev l2arc_dev_t; @@ -858,9 +996,6 @@ typedef struct l2arc_buf_hdr { /* protected by arc_buf_hdr mutex */ l2arc_dev_t *b_dev; /* L2ARC device */ uint64_t b_daddr; /* disk address, offset byte */ - /* real alloc'd buffer size depending on b_compress applied */ - int32_t b_asize; - uint8_t b_compress; list_node_t b_l2node; } l2arc_buf_hdr_t; @@ -869,20 +1004,37 @@ struct arc_buf_hdr { /* protected by hash lock */ dva_t b_dva; uint64_t b_birth; - /* - * Even though this checksum is only set/verified when a buffer is in - * the L1 cache, it needs to be in the set of common fields because it - * must be preserved from the time before a buffer is written out to - * L2ARC until after it is read back in. - */ - zio_cksum_t *b_freeze_cksum; + arc_buf_contents_t b_type; arc_buf_hdr_t *b_hash_next; arc_flags_t b_flags; - /* immutable */ - int32_t b_size; - uint64_t b_spa; + /* + * This field stores the size of the data buffer after + * compression, and is set in the arc's zio completion handlers. + * It is in units of SPA_MINBLOCKSIZE (e.g. 1 == 512 bytes). + * + * While the block pointers can store up to 32MB in their psize + * field, we can only store up to 32MB minus 512B. This is due + * to the bp using a bias of 1, whereas we use a bias of 0 (i.e. + * a field of zeros represents 512B in the bp). We can't use a + * bias of 1 since we need to reserve a psize of zero, here, to + * represent holes and embedded blocks. + * + * This isn't a problem in practice, since the maximum size of a + * buffer is limited to 16MB, so we never need to store 32MB in + * this field. Even in the upstream illumos code base, the + * maximum size of a buffer is limited to 16MB. + */ + uint16_t b_psize; + + /* + * This field stores the size of the data buffer before + * compression, and cannot change once set. It is in units + * of SPA_MINBLOCKSIZE (e.g. 2 == 1024 bytes) + */ + uint16_t b_lsize; /* immutable */ + uint64_t b_spa; /* immutable */ /* L2ARC fields. Undefined when not in L2ARC. */ l2arc_buf_hdr_t b_l2hdr; @@ -986,9 +1138,6 @@ sysctl_vfs_zfs_arc_min(SYSCTL_HANDLER_AR } #endif -static arc_buf_t *arc_eviction_list; -static arc_buf_hdr_t arc_eviction_hdr; - #define GHOST_STATE(state) \ ((state) == arc_mru_ghost || (state) == arc_mfu_ghost || \ (state) == arc_l2c_only) @@ -997,25 +1146,35 @@ static arc_buf_hdr_t arc_eviction_hdr; #define HDR_IO_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS) #define HDR_IO_ERROR(hdr) ((hdr)->b_flags & ARC_FLAG_IO_ERROR) #define HDR_PREFETCH(hdr) ((hdr)->b_flags & ARC_FLAG_PREFETCH) -#define HDR_FREED_IN_READ(hdr) ((hdr)->b_flags & ARC_FLAG_FREED_IN_READ) -#define HDR_BUF_AVAILABLE(hdr) ((hdr)->b_flags & ARC_FLAG_BUF_AVAILABLE) +#define HDR_COMPRESSION_ENABLED(hdr) \ + ((hdr)->b_flags & ARC_FLAG_COMPRESSED_ARC) #define HDR_L2CACHE(hdr) ((hdr)->b_flags & ARC_FLAG_L2CACHE) -#define HDR_L2COMPRESS(hdr) ((hdr)->b_flags & ARC_FLAG_L2COMPRESS) #define HDR_L2_READING(hdr) \ - (((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS) && \ - ((hdr)->b_flags & ARC_FLAG_HAS_L2HDR)) + (((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS) && \ + ((hdr)->b_flags & ARC_FLAG_HAS_L2HDR)) #define HDR_L2_WRITING(hdr) ((hdr)->b_flags & ARC_FLAG_L2_WRITING) #define HDR_L2_EVICTED(hdr) ((hdr)->b_flags & ARC_FLAG_L2_EVICTED) #define HDR_L2_WRITE_HEAD(hdr) ((hdr)->b_flags & ARC_FLAG_L2_WRITE_HEAD) +#define HDR_SHARED_DATA(hdr) ((hdr)->b_flags & ARC_FLAG_SHARED_DATA) #define HDR_ISTYPE_METADATA(hdr) \ - ((hdr)->b_flags & ARC_FLAG_BUFC_METADATA) + ((hdr)->b_flags & ARC_FLAG_BUFC_METADATA) #define HDR_ISTYPE_DATA(hdr) (!HDR_ISTYPE_METADATA(hdr)) #define HDR_HAS_L1HDR(hdr) ((hdr)->b_flags & ARC_FLAG_HAS_L1HDR) #define HDR_HAS_L2HDR(hdr) ((hdr)->b_flags & ARC_FLAG_HAS_L2HDR) +/* For storing compression mode in b_flags */ +#define HDR_COMPRESS_OFFSET (highbit64(ARC_FLAG_COMPRESS_0) - 1) + +#define HDR_GET_COMPRESS(hdr) ((enum zio_compress)BF32_GET((hdr)->b_flags, \ + HDR_COMPRESS_OFFSET, SPA_COMPRESSBITS)) +#define HDR_SET_COMPRESS(hdr, cmp) BF32_SET((hdr)->b_flags, \ + HDR_COMPRESS_OFFSET, SPA_COMPRESSBITS, (cmp)); + +#define ARC_BUF_LAST(buf) ((buf)->b_next == NULL) + /* * Other sizes */ @@ -1068,16 +1227,6 @@ uint64_t zfs_crc64_table[256]; #define L2ARC_FEED_SECS 1 /* caching interval secs */ #define L2ARC_FEED_MIN_MS 200 /* min caching interval ms */ -/* - * Used to distinguish headers that are being process by - * l2arc_write_buffers(), but have yet to be assigned to a l2arc disk - * address. This can happen when the header is added to the l2arc's list - * of buffers to write in the first stage of l2arc_write_buffers(), but - * has not yet been written out which happens in the second stage of - * l2arc_write_buffers(). - */ -#define L2ARC_ADDR_UNSET ((uint64_t)(-1)) - #define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent) #define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done) @@ -1112,41 +1261,47 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_nor SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_size, CTLFLAG_RD, &ARC_anon.arcs_size.rc_count, 0, "size of anonymous state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_metadata_lsize, CTLFLAG_RD, - &ARC_anon.arcs_lsize[ARC_BUFC_METADATA], 0, "size of anonymous state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_data_lsize, CTLFLAG_RD, - &ARC_anon.arcs_lsize[ARC_BUFC_DATA], 0, "size of anonymous state"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_metadata_esize, CTLFLAG_RD, + &ARC_anon.arcs_esize[ARC_BUFC_METADATA].rc_count, 0, + "size of anonymous state"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_data_esize, CTLFLAG_RD, + &ARC_anon.arcs_esize[ARC_BUFC_DATA].rc_count, 0, + "size of anonymous state"); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_size, CTLFLAG_RD, &ARC_mru.arcs_size.rc_count, 0, "size of mru state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_metadata_lsize, CTLFLAG_RD, - &ARC_mru.arcs_lsize[ARC_BUFC_METADATA], 0, "size of metadata in mru state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_data_lsize, CTLFLAG_RD, - &ARC_mru.arcs_lsize[ARC_BUFC_DATA], 0, "size of data in mru state"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_metadata_esize, CTLFLAG_RD, + &ARC_mru.arcs_esize[ARC_BUFC_METADATA].rc_count, 0, + "size of metadata in mru state"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_data_esize, CTLFLAG_RD, + &ARC_mru.arcs_esize[ARC_BUFC_DATA].rc_count, 0, + "size of data in mru state"); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_size, CTLFLAG_RD, &ARC_mru_ghost.arcs_size.rc_count, 0, "size of mru ghost state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_metadata_lsize, CTLFLAG_RD, - &ARC_mru_ghost.arcs_lsize[ARC_BUFC_METADATA], 0, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_metadata_esize, CTLFLAG_RD, + &ARC_mru_ghost.arcs_esize[ARC_BUFC_METADATA].rc_count, 0, "size of metadata in mru ghost state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_data_lsize, CTLFLAG_RD, - &ARC_mru_ghost.arcs_lsize[ARC_BUFC_DATA], 0, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_data_esize, CTLFLAG_RD, + &ARC_mru_ghost.arcs_esize[ARC_BUFC_DATA].rc_count, 0, "size of data in mru ghost state"); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_size, CTLFLAG_RD, &ARC_mfu.arcs_size.rc_count, 0, "size of mfu state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_metadata_lsize, CTLFLAG_RD, - &ARC_mfu.arcs_lsize[ARC_BUFC_METADATA], 0, "size of metadata in mfu state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_data_lsize, CTLFLAG_RD, - &ARC_mfu.arcs_lsize[ARC_BUFC_DATA], 0, "size of data in mfu state"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_metadata_esize, CTLFLAG_RD, + &ARC_mfu.arcs_esize[ARC_BUFC_METADATA].rc_count, 0, + "size of metadata in mfu state"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_data_esize, CTLFLAG_RD, + &ARC_mfu.arcs_esize[ARC_BUFC_DATA].rc_count, 0, + "size of data in mfu state"); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_size, CTLFLAG_RD, &ARC_mfu_ghost.arcs_size.rc_count, 0, "size of mfu ghost state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_metadata_lsize, CTLFLAG_RD, - &ARC_mfu_ghost.arcs_lsize[ARC_BUFC_METADATA], 0, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_metadata_esize, CTLFLAG_RD, + &ARC_mfu_ghost.arcs_esize[ARC_BUFC_METADATA].rc_count, 0, "size of metadata in mfu ghost state"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_data_lsize, CTLFLAG_RD, - &ARC_mfu_ghost.arcs_lsize[ARC_BUFC_DATA], 0, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_data_esize, CTLFLAG_RD, + &ARC_mfu_ghost.arcs_esize[ARC_BUFC_DATA].rc_count, 0, "size of data in mfu ghost state"); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2c_only_size, CTLFLAG_RD, @@ -1179,12 +1334,10 @@ static kmutex_t l2arc_free_on_write_mtx; static uint64_t l2arc_ndev; /* number of devices */ typedef struct l2arc_read_callback { - arc_buf_t *l2rcb_buf; /* read buffer */ - spa_t *l2rcb_spa; /* spa */ + arc_buf_hdr_t *l2rcb_hdr; /* read buffer */ blkptr_t l2rcb_bp; /* original blkptr */ zbookmark_phys_t l2rcb_zb; /* original bookmark */ int l2rcb_flags; /* original flags */ - enum zio_compress l2rcb_compress; /* applied compress */ void *l2rcb_data; /* temporary buffer */ } l2arc_read_callback_t; @@ -1197,7 +1350,7 @@ typedef struct l2arc_data_free { /* protected by l2arc_free_on_write_mtx */ void *l2df_data; size_t l2df_size; - void (*l2df_func)(void *, size_t); + arc_buf_contents_t l2df_type; list_node_t l2df_list_node; } l2arc_data_free_t; @@ -1205,21 +1358,22 @@ static kmutex_t l2arc_feed_thr_lock; static kcondvar_t l2arc_feed_thr_cv; static uint8_t l2arc_thread_exit; -static void arc_get_data_buf(arc_buf_t *); +static void *arc_get_data_buf(arc_buf_hdr_t *, uint64_t, void *); +static void arc_free_data_buf(arc_buf_hdr_t *, void *, uint64_t, void *); +static void arc_hdr_free_pdata(arc_buf_hdr_t *hdr); +static void arc_hdr_alloc_pdata(arc_buf_hdr_t *); static void arc_access(arc_buf_hdr_t *, kmutex_t *); static boolean_t arc_is_overflowing(); static void arc_buf_watch(arc_buf_t *); static arc_buf_contents_t arc_buf_type(arc_buf_hdr_t *); static uint32_t arc_bufc_to_flags(arc_buf_contents_t); +static inline void arc_hdr_set_flags(arc_buf_hdr_t *hdr, arc_flags_t flags); +static inline void arc_hdr_clear_flags(arc_buf_hdr_t *hdr, arc_flags_t flags); static boolean_t l2arc_write_eligible(uint64_t, arc_buf_hdr_t *); static void l2arc_read_done(zio_t *); -static boolean_t l2arc_transform_buf(arc_buf_hdr_t *, boolean_t); -static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); -static void l2arc_release_cdata_buf(arc_buf_hdr_t *); - static void l2arc_trim(const arc_buf_hdr_t *hdr) { @@ -1228,13 +1382,9 @@ l2arc_trim(const arc_buf_hdr_t *hdr) ASSERT(HDR_HAS_L2HDR(hdr)); ASSERT(MUTEX_HELD(&dev->l2ad_mtx)); - if (hdr->b_l2hdr.b_daddr == L2ARC_ADDR_UNSET) - return; - if (hdr->b_l2hdr.b_asize != 0) { + if (HDR_GET_PSIZE(hdr) != 0) { trim_map_free(dev->l2ad_vdev, hdr->b_l2hdr.b_daddr, - hdr->b_l2hdr.b_asize, 0); - } else { - ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_EMPTY); + HDR_GET_PSIZE(hdr), 0); } } @@ -1255,14 +1405,14 @@ buf_hash(uint64_t spa, const dva_t *dva, return (crc); } -#define BUF_EMPTY(buf) \ - ((buf)->b_dva.dva_word[0] == 0 && \ - (buf)->b_dva.dva_word[1] == 0) - -#define BUF_EQUAL(spa, dva, birth, buf) \ - ((buf)->b_dva.dva_word[0] == (dva)->dva_word[0]) && \ - ((buf)->b_dva.dva_word[1] == (dva)->dva_word[1]) && \ - ((buf)->b_birth == birth) && ((buf)->b_spa == spa) +#define HDR_EMPTY(hdr) \ + ((hdr)->b_dva.dva_word[0] == 0 && \ + (hdr)->b_dva.dva_word[1] == 0) + +#define HDR_EQUAL(spa, dva, birth, hdr) \ + ((hdr)->b_dva.dva_word[0] == (dva)->dva_word[0]) && \ + ((hdr)->b_dva.dva_word[1] == (dva)->dva_word[1]) && \ + ((hdr)->b_birth == birth) && ((hdr)->b_spa == spa) static void buf_discard_identity(arc_buf_hdr_t *hdr) @@ -1284,7 +1434,7 @@ buf_hash_find(uint64_t spa, const blkptr mutex_enter(hash_lock); for (hdr = buf_hash_table.ht_table[idx]; hdr != NULL; hdr = hdr->b_hash_next) { - if (BUF_EQUAL(spa, dva, birth, hdr)) { + if (HDR_EQUAL(spa, dva, birth, hdr)) { *lockp = hash_lock; return (hdr); } @@ -1322,13 +1472,13 @@ buf_hash_insert(arc_buf_hdr_t *hdr, kmut for (fhdr = buf_hash_table.ht_table[idx], i = 0; fhdr != NULL; fhdr = fhdr->b_hash_next, i++) { - if (BUF_EQUAL(hdr->b_spa, &hdr->b_dva, hdr->b_birth, fhdr)) + if (HDR_EQUAL(hdr->b_spa, &hdr->b_dva, hdr->b_birth, fhdr)) return (fhdr); } hdr->b_hash_next = buf_hash_table.ht_table[idx]; buf_hash_table.ht_table[idx] = hdr; - hdr->b_flags |= ARC_FLAG_IN_HASH_TABLE; + arc_hdr_set_flags(hdr, ARC_FLAG_IN_HASH_TABLE); /* collect some hash table performance data */ if (i > 0) { @@ -1356,12 +1506,12 @@ buf_hash_remove(arc_buf_hdr_t *hdr) hdrp = &buf_hash_table.ht_table[idx]; while ((fhdr = *hdrp) != hdr) { - ASSERT(fhdr != NULL); + ASSERT3P(fhdr, !=, NULL); hdrp = &fhdr->b_hash_next; } *hdrp = hdr->b_hash_next; hdr->b_hash_next = NULL; - hdr->b_flags &= ~ARC_FLAG_IN_HASH_TABLE; + arc_hdr_clear_flags(hdr, ARC_FLAG_IN_HASH_TABLE); /* collect some hash table performance data */ ARCSTAT_BUMPDOWN(arcstat_hash_elements); @@ -1447,7 +1597,7 @@ hdr_full_dest(void *vbuf, void *unused) { arc_buf_hdr_t *hdr = vbuf; - ASSERT(BUF_EMPTY(hdr)); + ASSERT(HDR_EMPTY(hdr)); cv_destroy(&hdr->b_l1hdr.b_cv); refcount_destroy(&hdr->b_l1hdr.b_refcnt); mutex_destroy(&hdr->b_l1hdr.b_freeze_lock); @@ -1461,7 +1611,7 @@ hdr_l2only_dest(void *vbuf, void *unused { arc_buf_hdr_t *hdr = vbuf; - ASSERT(BUF_EMPTY(hdr)); + ASSERT(HDR_EMPTY(hdr)); arc_space_return(HDR_L2ONLY_SIZE, ARC_SPACE_L2HDRS); } @@ -1534,166 +1684,138 @@ retry: } } -/* - * Transition between the two allocation states for the arc_buf_hdr struct. - * The arc_buf_hdr struct can be allocated with (hdr_full_cache) or without - * (hdr_l2only_cache) the fields necessary for the L1 cache - the smaller - * version is used when a cache buffer is only in the L2ARC in order to reduce - * memory usage. - */ -static arc_buf_hdr_t * -arc_hdr_realloc(arc_buf_hdr_t *hdr, kmem_cache_t *old, kmem_cache_t *new) -{ - ASSERT(HDR_HAS_L2HDR(hdr)); - - arc_buf_hdr_t *nhdr; - l2arc_dev_t *dev = hdr->b_l2hdr.b_dev; - - ASSERT((old == hdr_full_cache && new == hdr_l2only_cache) || - (old == hdr_l2only_cache && new == hdr_full_cache)); - - nhdr = kmem_cache_alloc(new, KM_PUSHPAGE); - - ASSERT(MUTEX_HELD(HDR_LOCK(hdr))); - buf_hash_remove(hdr); - - bcopy(hdr, nhdr, HDR_L2ONLY_SIZE); - - if (new == hdr_full_cache) { - nhdr->b_flags |= ARC_FLAG_HAS_L1HDR; - /* - * arc_access and arc_change_state need to be aware that a - * header has just come out of L2ARC, so we set its state to - * l2c_only even though it's about to change. - */ - nhdr->b_l1hdr.b_state = arc_l2c_only; - - /* Verify previous threads set to NULL before freeing */ - ASSERT3P(nhdr->b_l1hdr.b_tmp_cdata, ==, NULL); - } else { - ASSERT(hdr->b_l1hdr.b_buf == NULL); - ASSERT0(hdr->b_l1hdr.b_datacnt); - - /* - * If we've reached here, We must have been called from - * arc_evict_hdr(), as such we should have already been - * removed from any ghost list we were previously on - * (which protects us from racing with arc_evict_state), - * thus no locking is needed during this check. - */ - ASSERT(!multilist_link_active(&hdr->b_l1hdr.b_arc_node)); - - /* - * A buffer must not be moved into the arc_l2c_only - * state if it's not finished being written out to the - * l2arc device. Otherwise, the b_l1hdr.b_tmp_cdata field - * might try to be accessed, even though it was removed. - */ - VERIFY(!HDR_L2_WRITING(hdr)); - VERIFY3P(hdr->b_l1hdr.b_tmp_cdata, ==, NULL); +#define ARC_MINTIME (hz>>4) /* 62 ms */ -#ifdef ZFS_DEBUG - if (hdr->b_l1hdr.b_thawed != NULL) { - kmem_free(hdr->b_l1hdr.b_thawed, 1); - hdr->b_l1hdr.b_thawed = NULL; - } -#endif +static inline boolean_t +arc_buf_is_shared(arc_buf_t *buf) +{ + boolean_t shared = (buf->b_data != NULL && + buf->b_data == buf->b_hdr->b_l1hdr.b_pdata); + IMPLY(shared, HDR_SHARED_DATA(buf->b_hdr)); + return (shared); +} - nhdr->b_flags &= ~ARC_FLAG_HAS_L1HDR; +static inline void +arc_cksum_free(arc_buf_hdr_t *hdr) +{ + ASSERT(HDR_HAS_L1HDR(hdr)); + mutex_enter(&hdr->b_l1hdr.b_freeze_lock); + if (hdr->b_l1hdr.b_freeze_cksum != NULL) { + kmem_free(hdr->b_l1hdr.b_freeze_cksum, sizeof (zio_cksum_t)); + hdr->b_l1hdr.b_freeze_cksum = NULL; } - /* - * The header has been reallocated so we need to re-insert it into any - * lists it was on. - */ - (void) buf_hash_insert(nhdr, NULL); - - ASSERT(list_link_active(&hdr->b_l2hdr.b_l2node)); - - mutex_enter(&dev->l2ad_mtx); - - /* - * We must place the realloc'ed header back into the list at - * the same spot. Otherwise, if it's placed earlier in the list, - * l2arc_write_buffers() could find it during the function's - * write phase, and try to write it out to the l2arc. - */ - list_insert_after(&dev->l2ad_buflist, hdr, nhdr); - list_remove(&dev->l2ad_buflist, hdr); - - mutex_exit(&dev->l2ad_mtx); - - /* - * Since we're using the pointer address as the tag when - * incrementing and decrementing the l2ad_alloc refcount, we - * must remove the old pointer (that we're about to destroy) and - * add the new pointer to the refcount. Otherwise we'd remove - * the wrong pointer address when calling arc_hdr_destroy() later. - */ - - (void) refcount_remove_many(&dev->l2ad_alloc, - hdr->b_l2hdr.b_asize, hdr); - - (void) refcount_add_many(&dev->l2ad_alloc, - nhdr->b_l2hdr.b_asize, nhdr); - - buf_discard_identity(hdr); - hdr->b_freeze_cksum = NULL; - kmem_cache_free(old, hdr); - - return (nhdr); + mutex_exit(&hdr->b_l1hdr.b_freeze_lock); } - -#define ARC_MINTIME (hz>>4) /* 62 ms */ - static void arc_cksum_verify(arc_buf_t *buf) { + arc_buf_hdr_t *hdr = buf->b_hdr; zio_cksum_t zc; if (!(zfs_flags & ZFS_DEBUG_MODIFY)) return; - mutex_enter(&buf->b_hdr->b_l1hdr.b_freeze_lock); - if (buf->b_hdr->b_freeze_cksum == NULL || HDR_IO_ERROR(buf->b_hdr)) { - mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); + ASSERT(HDR_HAS_L1HDR(hdr)); + + mutex_enter(&hdr->b_l1hdr.b_freeze_lock); + if (hdr->b_l1hdr.b_freeze_cksum == NULL || HDR_IO_ERROR(hdr)) { + mutex_exit(&hdr->b_l1hdr.b_freeze_lock); return; } - fletcher_2_native(buf->b_data, buf->b_hdr->b_size, NULL, &zc); - if (!ZIO_CHECKSUM_EQUAL(*buf->b_hdr->b_freeze_cksum, zc)) + fletcher_2_native(buf->b_data, HDR_GET_LSIZE(hdr), NULL, &zc); + if (!ZIO_CHECKSUM_EQUAL(*hdr->b_l1hdr.b_freeze_cksum, zc)) panic("buffer modified while frozen!"); - mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); + mutex_exit(&hdr->b_l1hdr.b_freeze_lock); } -static int -arc_cksum_equal(arc_buf_t *buf) +static boolean_t +arc_cksum_is_equal(arc_buf_hdr_t *hdr, zio_t *zio) { - zio_cksum_t zc; - int equal; + enum zio_compress compress = BP_GET_COMPRESS(zio->io_bp); + boolean_t valid_cksum; - mutex_enter(&buf->b_hdr->b_l1hdr.b_freeze_lock); - fletcher_2_native(buf->b_data, buf->b_hdr->b_size, NULL, &zc); - equal = ZIO_CHECKSUM_EQUAL(*buf->b_hdr->b_freeze_cksum, zc); - mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); + ASSERT(!BP_IS_EMBEDDED(zio->io_bp)); + VERIFY3U(BP_GET_PSIZE(zio->io_bp), ==, HDR_GET_PSIZE(hdr)); + + /* + * We rely on the blkptr's checksum to determine if the block + * is valid or not. When compressed arc is enabled, the l2arc + * writes the block to the l2arc just as it appears in the pool. + * This allows us to use the blkptr's checksum to validate the + * data that we just read off of the l2arc without having to store + * a separate checksum in the arc_buf_hdr_t. However, if compressed + * arc is disabled, then the data written to the l2arc is always + * uncompressed and won't match the block as it exists in the main + * pool. When this is the case, we must first compress it if it is + * compressed on the main pool before we can validate the checksum. + */ + if (!HDR_COMPRESSION_ENABLED(hdr) && compress != ZIO_COMPRESS_OFF) { + ASSERT3U(HDR_GET_COMPRESS(hdr), ==, ZIO_COMPRESS_OFF); + uint64_t lsize = HDR_GET_LSIZE(hdr); + uint64_t csize; + + void *cbuf = zio_buf_alloc(HDR_GET_PSIZE(hdr)); + csize = zio_compress_data(compress, zio->io_data, cbuf, lsize); + ASSERT3U(csize, <=, HDR_GET_PSIZE(hdr)); + if (csize < HDR_GET_PSIZE(hdr)) { + /* + * Compressed blocks are always a multiple of the + * smallest ashift in the pool. Ideally, we would + * like to round up the csize to the next + * spa_min_ashift but that value may have changed + * since the block was last written. Instead, + * we rely on the fact that the hdr's psize + * was set to the psize of the block when it was + * last written. We set the csize to that value + * and zero out any part that should not contain + * data. + */ + bzero((char *)cbuf + csize, HDR_GET_PSIZE(hdr) - csize); + csize = HDR_GET_PSIZE(hdr); + } + zio_push_transform(zio, cbuf, csize, HDR_GET_PSIZE(hdr), NULL); + } - return (equal); + /* + * Block pointers always store the checksum for the logical data. + * If the block pointer has the gang bit set, then the checksum + * it represents is for the reconstituted data and not for an + * individual gang member. The zio pipeline, however, must be able to + * determine the checksum of each of the gang constituents so it + * treats the checksum comparison differently than what we need + * for l2arc blocks. This prevents us from using the + * zio_checksum_error() interface directly. Instead we must call the + * zio_checksum_error_impl() so that we can ensure the checksum is + * generated using the correct checksum algorithm and accounts for the + * logical I/O size and not just a gang fragment. + */ + valid_cksum = (zio_checksum_error_impl(zio->io_spa, zio->io_bp, + BP_GET_CHECKSUM(zio->io_bp), zio->io_data, zio->io_size, + zio->io_offset, NULL) == 0); + zio_pop_transforms(zio); + return (valid_cksum); } static void -arc_cksum_compute(arc_buf_t *buf, boolean_t force) +arc_cksum_compute(arc_buf_t *buf) { - if (!force && !(zfs_flags & ZFS_DEBUG_MODIFY)) + arc_buf_hdr_t *hdr = buf->b_hdr; + + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) return; + ASSERT(HDR_HAS_L1HDR(hdr)); mutex_enter(&buf->b_hdr->b_l1hdr.b_freeze_lock); - if (buf->b_hdr->b_freeze_cksum != NULL) { - mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); + if (hdr->b_l1hdr.b_freeze_cksum != NULL) { + mutex_exit(&hdr->b_l1hdr.b_freeze_lock); return; } - buf->b_hdr->b_freeze_cksum = kmem_alloc(sizeof (zio_cksum_t), KM_SLEEP); - fletcher_2_native(buf->b_data, buf->b_hdr->b_size, - NULL, buf->b_hdr->b_freeze_cksum); - mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); + hdr->b_l1hdr.b_freeze_cksum = kmem_alloc(sizeof (zio_cksum_t), + KM_SLEEP); + fletcher_2_native(buf->b_data, HDR_GET_LSIZE(hdr), NULL, + hdr->b_l1hdr.b_freeze_cksum); + mutex_exit(&hdr->b_l1hdr.b_freeze_lock); #ifdef illumos arc_buf_watch(buf); #endif @@ -1735,7 +1857,7 @@ arc_buf_watch(arc_buf_t *buf) procctl_t ctl; ctl.cmd = PCWATCH; ctl.prwatch.pr_vaddr = (uintptr_t)buf->b_data; - ctl.prwatch.pr_size = buf->b_hdr->b_size; + ctl.prwatch.pr_size = HDR_GET_LSIZE(buf->b_hdr); ctl.prwatch.pr_wflags = WA_WRITE; result = write(arc_procfd, &ctl, sizeof (ctl)); ASSERT3U(result, ==, sizeof (ctl)); @@ -1747,11 +1869,14 @@ arc_buf_watch(arc_buf_t *buf) static arc_buf_contents_t arc_buf_type(arc_buf_hdr_t *hdr) { + arc_buf_contents_t type; if (HDR_ISTYPE_METADATA(hdr)) { - return (ARC_BUFC_METADATA); + type = ARC_BUFC_METADATA; } else { - return (ARC_BUFC_DATA); + type = ARC_BUFC_DATA; } + VERIFY3U(hdr->b_type, ==, type); + return (type); } static uint32_t @@ -1773,29 +1898,29 @@ arc_bufc_to_flags(arc_buf_contents_t typ void arc_buf_thaw(arc_buf_t *buf) { + arc_buf_hdr_t *hdr = buf->b_hdr; + if (zfs_flags & ZFS_DEBUG_MODIFY) { - if (buf->b_hdr->b_l1hdr.b_state != arc_anon) + if (hdr->b_l1hdr.b_state != arc_anon) panic("modifying non-anon buffer!"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Sep 3 08:42: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 E70F1BCD25C; Sat, 3 Sep 2016 08:42:13 +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 A9E912BEE; Sat, 3 Sep 2016 08:42:13 +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 u838gC5p064627; Sat, 3 Sep 2016 08:42:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u838gCbg064624; Sat, 3 Sep 2016 08:42:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609030842.u838gCbg064624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 08:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305324 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 08:42:14 -0000 Author: mav Date: Sat Sep 3 08:42:12 2016 New Revision: 305324 URL: https://svnweb.freebsd.org/changeset/base/305324 Log: MFV r303077: 7072 zfs fails to expand if lun added when os is in shutdown state illumos/illumos-gate@c39a2aae1e2c439d156021edfc20910dad7f9891 https://github.com/illumos/illumos-gate/commit/c39a2aae1e2c439d156021edfc20910dad7f9891 https://www.illumos.org/issues/7072 upstream: 38733 zfs fails to expand if lun added when os is in shutdown state DLPX-36910 spares and caches should not display expandable space DLPX-39262 vdev_disk_open spam zfs_dbgmsg buffer Reviewed by: Igor Kozhukhov Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Alex Reece Approved by: Dan McDonald Author: George Wilson Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Sep 3 08:30:51 2016 (r305323) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Sep 3 08:42:12 2016 (r305324) @@ -468,7 +468,13 @@ metaslab_class_expandable_space(metaslab continue; } - space += tvd->vdev_max_asize - tvd->vdev_asize; + /* + * Calculate if we have enough space to add additional + * metaslabs. We report the expandable space in terms + * of the metaslab size since that's the unit of expansion. + */ + space += P2ALIGN(tvd->vdev_max_asize - tvd->vdev_asize, + 1ULL << tvd->vdev_ms_shift); } spa_config_exit(mc->mc_spa, SCL_VDEV, FTAG); return (space); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Sep 3 08:30:51 2016 (r305323) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Sep 3 08:42:12 2016 (r305324) @@ -2885,6 +2885,7 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t * { spa_t *spa = vd->vdev_spa; vdev_t *rvd = spa->spa_root_vdev; + vdev_t *tvd = vd->vdev_top; ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0); @@ -2895,8 +2896,15 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t * vs->vs_rsize = vdev_get_min_asize(vd); if (vd->vdev_ops->vdev_op_leaf) vs->vs_rsize += VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; - if (vd->vdev_max_asize != 0) - vs->vs_esize = vd->vdev_max_asize - vd->vdev_asize; + /* + * Report expandable space on top-level, non-auxillary devices only. + * The expandable space is reported in terms of metaslab sized units + * since that determines how much space the pool can expand. + */ + if (vd->vdev_aux == NULL && tvd != NULL && vd->vdev_max_asize != 0) { + vs->vs_esize = P2ALIGN(vd->vdev_max_asize - vd->vdev_asize, + 1ULL << tvd->vdev_ms_shift); + } vs->vs_configured_ashift = vd->vdev_top != NULL ? vd->vdev_top->vdev_ashift : vd->vdev_ashift; vs->vs_logical_ashift = vd->vdev_logical_ashift; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Sat Sep 3 08:30:51 2016 (r305323) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Sat Sep 3 08:42:12 2016 (r305324) @@ -241,34 +241,6 @@ vdev_disk_rele(vdev_t *vd) } } -static uint64_t -vdev_disk_get_space(vdev_t *vd, uint64_t capacity, uint_t blksz) -{ - ASSERT(vd->vdev_wholedisk); - - vdev_disk_t *dvd = vd->vdev_tsd; - dk_efi_t dk_ioc; - efi_gpt_t *efi; - uint64_t avail_space = 0; - int efisize = EFI_LABEL_SIZE * 2; - - dk_ioc.dki_data = kmem_alloc(efisize, KM_SLEEP); - dk_ioc.dki_lba = 1; - dk_ioc.dki_length = efisize; - dk_ioc.dki_data_64 = (uint64_t)(uintptr_t)dk_ioc.dki_data; - efi = dk_ioc.dki_data; - - if (ldi_ioctl(dvd->vd_lh, DKIOCGETEFI, (intptr_t)&dk_ioc, - FKIOCTL, kcred, NULL) == 0) { - uint64_t efi_altern_lba = LE_64(efi->efi_gpt_AlternateLBA); - - if (capacity > efi_altern_lba) - avail_space = (capacity - efi_altern_lba) * blksz; - } - kmem_free(dk_ioc.dki_data, efisize); - return (avail_space); -} - /* * We want to be loud in DEBUG kernels when DKIOCGMEDIAINFOEXT fails, or when * even a fallback to DKIOCGMEDIAINFO fails. @@ -559,10 +531,7 @@ skip_open: * Adjust max_psize upward accordingly since we know * we own the whole disk now. */ - *max_psize += vdev_disk_get_space(vd, capacity, blksz); - zfs_dbgmsg("capacity change: vdev %s, psize %llu, " - "max_psize %llu", vd->vdev_path, *psize, - *max_psize); + *max_psize = capacity * blksz; } /* From owner-svn-src-head@freebsd.org Sat Sep 3 08:43: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 E36DBBCD2D3; Sat, 3 Sep 2016 08:43:44 +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 BE7F42E49; Sat, 3 Sep 2016 08:43:44 +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 u838hhQ5066301; Sat, 3 Sep 2016 08:43:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u838hhGx066300; Sat, 3 Sep 2016 08:43:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609030843.u838hhGx066300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 08:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305325 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 08:43:45 -0000 Author: mav Date: Sat Sep 3 08:43:43 2016 New Revision: 305325 URL: https://svnweb.freebsd.org/changeset/base/305325 Log: MFV r303078: 7086 ztest attempts dva_get_dsize_sync on an embedded blockpointer illumos/illumos-gate@926549256b71acd595f69b236779ff6b78fa08ef https://github.com/illumos/illumos-gate/commit/926549256b71acd595f69b236779ff6b7 8fa08ef https://www.illumos.org/issues/7086 In dbuf_dirty(), we need to grab the dn_struct_rwlock before looking at the db_blkptr, to prevent it from being changed by syncing context. Otherwise we may see that ztest got a segfault from this stack: libzpool.so.1`dva_get_dsize_sync+0x98(872f000, b32b240, fed7811b, 0, b4cda20, 0) libzpool.so.1`bp_get_dsize+0x60(872f000, b32b240, 0, 97cb780, 9d4c1a8, 0) libzpool.so.1`dbuf_dirty+0x9b3(ce0a100, 97cb780, 9, fecd2530) libzpool.so.1`dmu_buf_will_dirty+0xc3(ce0a100, 97cb780, ea293d6c, 1) libzpool.so.1`zap_lockdir+0x1a0(8aaa3c0, 1, 0, 97cb780, 1, 1) libzpool.so.1`zap_remove_norm+0x30(8aaa3c0, 1, 0, 8728b10, 0, 97cb780) libzpool.so.1`zap_remove+0x29(8aaa3c0, 1, 0, 8728b10, 97cb780, a) ztest_replay_remove+0x225(ea294588, 8728ae8, 0, 38010000, 0, 0) ztest_remove+0x9f(ea294588, ea293f50, 4, 3) ztest_object_init+0x78(ea294588, ea293f50, 4e0, 1) ztest_dmu_object_alloc_free+0x71(ea294588, 13) ztest_dmu_objset_create_destroy+0x224(80cef08, 13, 0, 805d36c, 9017ad44, 0) ztest_execute+0x89(a, 807c720, 13, 0) ztest_thread+0xea(13, 0, 0, 0) libc.so.1`_thrp_setup+0x88(f0983240) libc.so.1`_lwp_start(f0983240, 0, 0, 0, 0, 0) Looking into it a bit, we see that this is an embedded blockpointer, so BP_GET_NDVAS should have returned 0: b32b240::blkptr EMBEDDED [L0 ZAP_OTHER] et=0 LZ4 size=200L/4aP birth=80L Instead, it looks like another thread is modifying this blockpointer: b32b240::ugrep | ::whatis f47a0e0c is in [ stack tid=0x19f ] ebd6ec40 is in [ stack tid=0x226 ] ea293bd0 is in [ stack tid=0x244 ] ea293be4 is in [ stack tid=0x244 ] Reviewed by: Prakash Surya Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Sep 3 08:42:12 2016 (r305324) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Sep 3 08:43:43 2016 (r305325) @@ -1662,7 +1662,20 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t dnode_setdirty(dn, tx); DB_DNODE_EXIT(db); return (dr); - } else if (do_free_accounting) { + } + + /* + * The dn_struct_rwlock prevents db_blkptr from changing + * due to a write from syncing context completing + * while we are running, so we want to acquire it before + * looking at db_blkptr. + */ + if (!RW_WRITE_HELD(&dn->dn_struct_rwlock)) { + rw_enter(&dn->dn_struct_rwlock, RW_READER); + drop_struct_lock = TRUE; + } + + if (do_free_accounting) { blkptr_t *bp = db->db_blkptr; int64_t willfree = (bp && !BP_IS_HOLE(bp)) ? bp_get_dsize(os->os_spa, bp) : db->db.db_size; @@ -1678,11 +1691,6 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t dnode_willuse_space(dn, -willfree, tx); } - if (!RW_WRITE_HELD(&dn->dn_struct_rwlock)) { - rw_enter(&dn->dn_struct_rwlock, RW_READER); - drop_struct_lock = TRUE; - } - if (db->db_level == 0) { dnode_new_blkid(dn, db->db_blkid, tx, drop_struct_lock); ASSERT(dn->dn_maxblkid >= db->db_blkid); From owner-svn-src-head@freebsd.org Sat Sep 3 08:46: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 76120BCD45A; Sat, 3 Sep 2016 08:46: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 540A71A5; Sat, 3 Sep 2016 08:46: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 u838krHN066477; Sat, 3 Sep 2016 08:46:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u838kruY066476; Sat, 3 Sep 2016 08:46:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609030846.u838kruY066476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 08:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305326 - head/cddl/contrib/opensolaris/cmd/ztest 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.22 Precedence: list List-Id: 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, 03 Sep 2016 08:46:54 -0000 Author: mav Date: Sat Sep 3 08:46:53 2016 New Revision: 305326 URL: https://svnweb.freebsd.org/changeset/base/305326 Log: MFV r303079: 7147 ztest: ztest_ddt_repair fails with ztest_pattern_match assertion illumos/illumos-gate@aab80726335c76a7cae32c7300890248d73a51e3 https://github.com/illumos/illumos-gate/commit/aab80726335c76a7cae32c7300890248d 73a51e3 https://www.illumos.org/issues/7147 Here's the dbuf we're currently reading: 966f200::dbuf addr object lvl blkid holds os 966f200 4 0 0 1 ztest/ds_3 966f200::print dmu_buf_t db_data db_data = 0x9ae0400 0x9ae0400/10J 0x9ae0400: c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d The pattern we're expecting is actually this: a34ae10b5f2db2. If we attempt to read the block on disk we find that it has matches what ztest_ddt_repair() would have written: ~c1c7ced932020d=J ff3e383126cdfdf2 966f200::print dmu_buf_impl_t db_blkptr | ::blkptr DVA0=<0:71d3c00:800> [L0 UINT64_OTHER] SHA256 OFF LE contiguous dedup single size=400L/400P birth=55L/55P fill=1 cksum=18486450d3ce8c6d:75a72f4bbf117b0f:2d3a226314eb5650:2eb0fd68648b1af0 1. zdb -U /rpool/tmp/zpool.cache -R ztest 0:71d3c00:800 | head Found vdev type: mirror 0:71d3c00:800 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 000000: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000010: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000020: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000030: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000040: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000050: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Approved by: Robert Mustacchi Author: George Wilson Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Sep 3 08:43:43 2016 (r305325) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Sep 3 08:46:53 2016 (r305326) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -5022,9 +5022,14 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ return; } + dmu_objset_stats_t dds; + dsl_pool_config_enter(dmu_objset_pool(os), FTAG); + dmu_objset_fast_stat(os, &dds); + dsl_pool_config_exit(dmu_objset_pool(os), FTAG); + object = od[0].od_object; blocksize = od[0].od_blocksize; - pattern = zs->zs_guid ^ dmu_objset_fsid_guid(os); + pattern = zs->zs_guid ^ dds.dds_guid; ASSERT(object != 0); @@ -5627,9 +5632,13 @@ ztest_run(ztest_shared_t *zs) metaslab_preload_limit = ztest_random(20) + 1; ztest_spa = spa; + dmu_objset_stats_t dds; VERIFY0(dmu_objset_own(ztest_opts.zo_pool, DMU_OST_ANY, B_TRUE, FTAG, &os)); - zs->zs_guid = dmu_objset_fsid_guid(os); + dsl_pool_config_enter(dmu_objset_pool(os), FTAG); + dmu_objset_fast_stat(os, &dds); + dsl_pool_config_exit(dmu_objset_pool(os), FTAG); + zs->zs_guid = dds.dds_guid; dmu_objset_disown(os, FTAG); spa->spa_dedup_ditto = 2 * ZIO_DEDUPDITTO_MIN; From owner-svn-src-head@freebsd.org Sat Sep 3 08:47: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 C2271BCD4C6; Sat, 3 Sep 2016 08:47:47 +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 9D65F33B; Sat, 3 Sep 2016 08:47:47 +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 u838lkaB066563; Sat, 3 Sep 2016 08:47:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u838lkAR066562; Sat, 3 Sep 2016 08:47:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609030847.u838lkAR066562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 08:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305327 - head/cddl/contrib/opensolaris/cmd/ztest 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.22 Precedence: list List-Id: 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, 03 Sep 2016 08:47:47 -0000 Author: mav Date: Sat Sep 3 08:47:46 2016 New Revision: 305327 URL: https://svnweb.freebsd.org/changeset/base/305327 Log: MFV r303080: 6451 ztest fails due to checksum errors illumos/illumos-gate@f9eb9fdf196b6ed476e4ffc69cecd8b0da3cb7e7 https://github.com/illumos/illumos-gate/commit/f9eb9fdf196b6ed476e4ffc69cecd8b0d a3cb7e7 https://www.illumos.org/issues/6451 Sometimes ztest fails because zdb detects checksum errors. e.g.: Traversing all blocks to verify checksums and verify nothing leaked ... zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 8000160> DVA0=<0:1cc2000: 180000> [L0 other uint64[]] sha256 uncompressed LE contiguou s unique single size=100000L/100000P birth=271L/271P fill=1 cksum=c5a3e27d1ed0f894:843bca3a5473c4bf:f76a19b6830a2e4:91292591613a12bf -- skipping zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 800000180> DVA0=<0:ce16800: 180000> [L0 other uint64[]] sha256 uncompressed LE contigu ous unique single size=100000L/100000P birth=840L/840P fill=1 cksum=5d018f3d061e17f3:6d1584784587bf63:2805a74a0ce37369:ba68a214806c7e75 -- skipping zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 1000000360> DVA0=<0:10d37400: 180000> [L0 other uint64[]] sha256 uncompressed LE conti guous unique single size=100000L/100000P birth=904L/904P fill=1 cksum=fa1e11d4138bd14b:86c9488c444473e3:f31e43c72e72e46b:e3446472d1174d ba -- skipping zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 400000002c0> DVA0=<0:127ef400: 180000> [L0 other uint64[]] sha256 uncompressed LE cont iguous dedup single size=100000L/100000P birth=549L/549P fill=1 cksum=30e14955ebf13522:66dc2ff8067e6810:4607e750abb9d3b3:6582b8af909fcb 58 -- skipping zdb_blkptr_cb: Got error 50 reading <657, 5, 0, 1c0> DVA0=<0:1a180400:180000> [L0 other uint64[]] fletcher4 uncompressed LE contiguou s unique single size=100000L/100000P birth=1091L/1091P fill=1 cksum=a6cf1e50: 29b3bd01c57e5:36779b914035db9a:db61cdcf6bec56f0 -- skippin g The problem is that ztest_fault_inject() can inject multiple faults into the same block. It is designed such that it can inject errors on all leafs of a RAID-Z or mirror, but for a given range of offsets, it will only inject errors Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Jorgen Lundman Approved by: Dan McDonald Author: Matthew Ahrens Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Sep 3 08:46:53 2016 (r305326) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Sep 3 08:47:46 2016 (r305327) @@ -4793,7 +4793,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 char path0[MAXPATHLEN]; char pathrand[MAXPATHLEN]; size_t fsize; - int bshift = SPA_OLD_MAXBLOCKSHIFT + 2; /* don't scrog all labels */ + int bshift = SPA_MAXBLOCKSHIFT + 2; /* don't scrog all labels */ int iters = 1000; int maxfaults; int mirror_save; @@ -4954,6 +4954,31 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 fsize = lseek(fd, 0, SEEK_END); while (--iters != 0) { + /* + * The offset must be chosen carefully to ensure that + * we do not inject a given logical block with errors + * on two different leaf devices, because ZFS can not + * tolerate that (if maxfaults==1). + * + * We divide each leaf into chunks of size + * (# leaves * SPA_MAXBLOCKSIZE * 4). Within each chunk + * there is a series of ranges to which we can inject errors. + * Each range can accept errors on only a single leaf vdev. + * The error injection ranges are separated by ranges + * which we will not inject errors on any device (DMZs). + * Each DMZ must be large enough such that a single block + * can not straddle it, so that a single block can not be + * a target in two different injection ranges (on different + * leaf vdevs). + * + * For example, with 3 leaves, each chunk looks like: + * 0 to 32M: injection range for leaf 0 + * 32M to 64M: DMZ - no injection allowed + * 64M to 96M: injection range for leaf 1 + * 96M to 128M: DMZ - no injection allowed + * 128M to 160M: injection range for leaf 2 + * 160M to 192M: DMZ - no injection allowed + */ offset = ztest_random(fsize / (leaves << bshift)) * (leaves << bshift) + (leaf << bshift) + (ztest_random(1ULL << (bshift - 1)) & -8ULL); From owner-svn-src-head@freebsd.org Sat Sep 3 08:48: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 02C66BCD530; Sat, 3 Sep 2016 08:48:53 +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 D31DB6D8; Sat, 3 Sep 2016 08:48:52 +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 u838mqDS066654; Sat, 3 Sep 2016 08:48:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u838mqGa066653; Sat, 3 Sep 2016 08:48:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609030848.u838mqGa066653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 08:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305328 - head/cddl/contrib/opensolaris/cmd/ztest 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.22 Precedence: list List-Id: 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, 03 Sep 2016 08:48:53 -0000 Author: mav Date: Sat Sep 3 08:48:51 2016 New Revision: 305328 URL: https://svnweb.freebsd.org/changeset/base/305328 Log: MFV r303081: 7163 ztest failures due to excess error injection illumos/illumos-gate@f34284d835bc555f987c1310df46c034c3101155 https://github.com/illumos/illumos-gate/commit/f34284d835bc555f987c1310df46c034c 3101155 https://www.illumos.org/issues/7163 Running zloop from zfs-precommit hit this assertion: *panicstr/s 0xfffffd7fd7419370: assertion failed for thread 0xfffffd7fe29ed240, thread-id 577: parent != NULL, file ../../../uts/common/fs/zfs/dbuf.c, line 1827 $c libc.so.1`_lwp_kill+0xa() libc.so.1`_assfail+0x182(fffffd7ffb1c29fa, fffffd7ffb1cc028, 723) libc.so.1`assfail+0x19(fffffd7ffb1c29fa, fffffd7ffb1cc028, 723) libzpool.so.1`dbuf_dirty+0xc69(10e3bc10, 3601700) libzpool.so.1`dbuf_dirty+0x61e(10c73640, 3601700) libzpool.so.1`dbuf_dirty+0x61e(10e28280, 3601700) libzpool.so.1`dmu_buf_will_fill+0x64(10e28280, 3601700) libzpool.so.1`dmu_write+0x1b6(2c7e640, d, 400000002e000000, 200, 3717b40, 3601700) ztest_replay_write+0x568(4950d0, 3717a80, 0) ztest_write+0x125(4950d0, d, 400000002e000000, 200, 413f000) ztest_io+0x1bb(4950d0, d, 400000002e000000) ztest_dmu_write_parallel+0xaa(4950d0, 6) ztest_execute+0x83(1, 420c98, 6) ztest_thread+0xf4(6) libc.so.1`_thrp_setup+0x8a(fffffd7fe29ed240) libc.so.1`_lwp_start() This is another manifestation of ECKSUM in ztest: The lowest level ancestor that’s in memory is the L8 (topmost). The L7 ancestor is blkid 0x10: ::dbufs -O 0x2c7e640 -o d -l 7 |::dbuf addr object lvl blkid holds os 600be50 d 7 4 1 ztest/ds_6 719d880 d 7 0 4 ztest/ds_6 Reviewed by: George Wilson Reviewed by: Paul Dagnelie Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Sep 3 08:47:46 2016 (r305327) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Sep 3 08:48:51 2016 (r305328) @@ -4793,7 +4793,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 char path0[MAXPATHLEN]; char pathrand[MAXPATHLEN]; size_t fsize; - int bshift = SPA_MAXBLOCKSHIFT + 2; /* don't scrog all labels */ + int bshift = SPA_MAXBLOCKSHIFT + 2; int iters = 1000; int maxfaults; int mirror_save; @@ -4983,7 +4983,29 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 (leaves << bshift) + (leaf << bshift) + (ztest_random(1ULL << (bshift - 1)) & -8ULL); - if (offset >= fsize) + /* + * Only allow damage to the labels at one end of the vdev. + * + * If all labels are damaged, the device will be totally + * inaccessible, which will result in loss of data, + * because we also damage (parts of) the other side of + * the mirror/raidz. + * + * Additionally, we will always have both an even and an + * odd label, so that we can handle crashes in the + * middle of vdev_config_sync(). + */ + if ((leaf & 1) == 0 && offset < VDEV_LABEL_START_SIZE) + continue; + + /* + * The two end labels are stored at the "end" of the disk, but + * the end of the disk (vdev_psize) is aligned to + * sizeof (vdev_label_t). + */ + uint64_t psize = P2ALIGN(fsize, sizeof (vdev_label_t)); + if ((leaf & 1) == 1 && + offset + sizeof (bad) > psize - VDEV_LABEL_END_SIZE) continue; VERIFY(mutex_lock(&ztest_vdev_lock) == 0); From owner-svn-src-head@freebsd.org Sat Sep 3 10:04: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 D3DF9BCEC03; Sat, 3 Sep 2016 10:04:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 786E0128; Sat, 3 Sep 2016 10:04:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83A4cwT097116; Sat, 3 Sep 2016 10:04:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83A4bI0097105; Sat, 3 Sep 2016 10:04:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609031004.u83A4bI0097105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 10:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305331 - in head/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs 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.22 Precedence: list List-Id: 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, 03 Sep 2016 10:04:40 -0000 Author: mav Date: Sat Sep 3 10:04:37 2016 New Revision: 305331 URL: https://svnweb.freebsd.org/changeset/base/305331 Log: MFV r304155: 7090 zfs should improve allocation order and throttle allocations illumos/illumos-gate@0f7643c7376dd69a08acbfc9d1d7d548b10c846a https://github.com/illumos/illumos-gate/commit/0f7643c7376dd69a08acbfc9d1d7d548b 10c846a https://www.illumos.org/issues/7090 When write I/Os are issued, they are issued in block order but the ZIO pipelin e will drive them asynchronously through the allocation stage which can result i n blocks being allocated out-of-order. It would be nice to preserve as much of the logical order as possible. In addition, the allocations are equally scattered across all top-level VDEVs but not all top-level VDEVs are created equally. The pipeline should be able t o detect devices that are more capable of handling allocations and should allocate more blocks to those devices. This allows for dynamic allocation distribution when devices are imbalanced as fuller devices will tend to be slower than empty devices. The change includes a new pool-wide allocation queue which would throttle and order allocations in the ZIO pipeline. The queue would be ordered by issued time and offset and would provide an initial amount of allocation of work to each top-level vdev. The allocation logic utilizes a reservation system to reserve allocations that will be performed by the allocator. Once an allocatio n is successfully completed it's scheduled on a given top-level vdev. Each top- level vdev maintains a maximum number of allocations that it can handle (mg_alloc_queue_depth). The pool-wide reserved allocations (top-levels * mg_alloc_queue_depth) are distributed across the top-level vdevs metaslab groups and round robin across all eligible metaslab groups to distribute the work. As top-levels complete their work, they receive additional work from the pool-wide allocation queue until the allocation queue is emptied. Reviewed by: Adam Leventhal Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Prakash Surya Reviewed by: Sebastien Roy Approved by: Robert Mustacchi Author: George Wilson Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Sep 3 10:04:37 2016 (r305331) @@ -38,17 +38,8 @@ SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); -/* - * Allow allocations to switch to gang blocks quickly. We do this to - * avoid having to load lots of space_maps in a given txg. There are, - * however, some cases where we want to avoid "fast" ganging and instead - * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang, slog, or dump device related allocations - * to "fast" gang. - */ -#define CAN_FASTGANG(flags) \ - (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ - METASLAB_GANG_AVOID))) +#define GANG_ALLOCATION(flags) \ + ((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER)) #define METASLAB_WEIGHT_PRIMARY (1ULL << 63) #define METASLAB_WEIGHT_SECONDARY (1ULL << 62) @@ -256,6 +247,8 @@ metaslab_class_create(spa_t *spa, metasl mc->mc_spa = spa; mc->mc_rotor = NULL; mc->mc_ops = ops; + mutex_init(&mc->mc_lock, NULL, MUTEX_DEFAULT, NULL); + refcount_create_tracked(&mc->mc_alloc_slots); return (mc); } @@ -269,6 +262,8 @@ metaslab_class_destroy(metaslab_class_t ASSERT(mc->mc_space == 0); ASSERT(mc->mc_dspace == 0); + refcount_destroy(&mc->mc_alloc_slots); + mutex_destroy(&mc->mc_lock); kmem_free(mc, sizeof (metaslab_class_t)); } @@ -512,9 +507,10 @@ metaslab_compare(const void *x1, const v /* * Update the allocatable flag and the metaslab group's capacity. * The allocatable flag is set to true if the capacity is below - * the zfs_mg_noalloc_threshold. If a metaslab group transitions - * from allocatable to non-allocatable or vice versa then the metaslab - * group's class is updated to reflect the transition. + * the zfs_mg_noalloc_threshold or has a fragmentation value that is + * greater than zfs_mg_fragmentation_threshold. If a metaslab group + * transitions from allocatable to non-allocatable or vice versa then the + * metaslab group's class is updated to reflect the transition. */ static void metaslab_group_alloc_update(metaslab_group_t *mg) @@ -523,22 +519,45 @@ metaslab_group_alloc_update(metaslab_gro metaslab_class_t *mc = mg->mg_class; vdev_stat_t *vs = &vd->vdev_stat; boolean_t was_allocatable; + boolean_t was_initialized; ASSERT(vd == vd->vdev_top); mutex_enter(&mg->mg_lock); was_allocatable = mg->mg_allocatable; + was_initialized = mg->mg_initialized; mg->mg_free_capacity = ((vs->vs_space - vs->vs_alloc) * 100) / (vs->vs_space + 1); + mutex_enter(&mc->mc_lock); + + /* + * If the metaslab group was just added then it won't + * have any space until we finish syncing out this txg. + * At that point we will consider it initialized and available + * for allocations. We also don't consider non-activated + * metaslab groups (e.g. vdevs that are in the middle of being removed) + * to be initialized, because they can't be used for allocation. + */ + mg->mg_initialized = metaslab_group_initialized(mg); + if (!was_initialized && mg->mg_initialized) { + mc->mc_groups++; + } else if (was_initialized && !mg->mg_initialized) { + ASSERT3U(mc->mc_groups, >, 0); + mc->mc_groups--; + } + if (mg->mg_initialized) + mg->mg_no_free_space = B_FALSE; + /* * A metaslab group is considered allocatable if it has plenty * of free space or is not heavily fragmented. We only take * fragmentation into account if the metaslab group has a valid * fragmentation metric (i.e. a value between 0 and 100). */ - mg->mg_allocatable = (mg->mg_free_capacity > zfs_mg_noalloc_threshold && + mg->mg_allocatable = (mg->mg_activation_count > 0 && + mg->mg_free_capacity > zfs_mg_noalloc_threshold && (mg->mg_fragmentation == ZFS_FRAG_INVALID || mg->mg_fragmentation <= zfs_mg_fragmentation_threshold)); @@ -561,6 +580,7 @@ metaslab_group_alloc_update(metaslab_gro mc->mc_alloc_groups--; else if (!was_allocatable && mg->mg_allocatable) mc->mc_alloc_groups++; + mutex_exit(&mc->mc_lock); mutex_exit(&mg->mg_lock); } @@ -577,6 +597,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_vd = vd; mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_initialized = B_FALSE; + mg->mg_no_free_space = B_TRUE; + refcount_create_tracked(&mg->mg_alloc_queue_depth); mg->mg_taskq = taskq_create("metaslab_group_taskq", metaslab_load_pct, minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); @@ -599,6 +622,7 @@ metaslab_group_destroy(metaslab_group_t taskq_destroy(mg->mg_taskq); avl_destroy(&mg->mg_metaslab_tree); mutex_destroy(&mg->mg_lock); + refcount_destroy(&mg->mg_alloc_queue_depth); kmem_free(mg, sizeof (metaslab_group_t)); } @@ -670,6 +694,15 @@ metaslab_group_passivate(metaslab_group_ metaslab_class_minblocksize_update(mc); } +boolean_t +metaslab_group_initialized(metaslab_group_t *mg) +{ + vdev_t *vd = mg->mg_vd; + vdev_stat_t *vs = &vd->vdev_stat; + + return (vs->vs_space != 0 && mg->mg_activation_count > 0); +} + uint64_t metaslab_group_get_space(metaslab_group_t *mg) { @@ -839,30 +872,97 @@ metaslab_group_fragmentation(metaslab_gr * group should avoid allocations if its free capacity is less than the * zfs_mg_noalloc_threshold or its fragmentation metric is greater than * zfs_mg_fragmentation_threshold and there is at least one metaslab group - * that can still handle allocations. + * that can still handle allocations. If the allocation throttle is enabled + * then we skip allocations to devices that have reached their maximum + * allocation queue depth unless the selected metaslab group is the only + * eligible group remaining. */ static boolean_t -metaslab_group_allocatable(metaslab_group_t *mg) +metaslab_group_allocatable(metaslab_group_t *mg, metaslab_group_t *rotor, + uint64_t psize) { - vdev_t *vd = mg->mg_vd; - spa_t *spa = vd->vdev_spa; + spa_t *spa = mg->mg_vd->vdev_spa; metaslab_class_t *mc = mg->mg_class; /* - * We use two key metrics to determine if a metaslab group is - * considered allocatable -- free space and fragmentation. If - * the free space is greater than the free space threshold and - * the fragmentation is less than the fragmentation threshold then - * consider the group allocatable. There are two case when we will - * not consider these key metrics. The first is if the group is - * associated with a slog device and the second is if all groups - * in this metaslab class have already been consider ineligible + * We can only consider skipping this metaslab group if it's + * in the normal metaslab class and there are other metaslab + * groups to select from. Otherwise, we always consider it eligible * for allocations. */ - return ((mg->mg_free_capacity > zfs_mg_noalloc_threshold && - (mg->mg_fragmentation == ZFS_FRAG_INVALID || - mg->mg_fragmentation <= zfs_mg_fragmentation_threshold)) || - mc != spa_normal_class(spa) || mc->mc_alloc_groups == 0); + if (mc != spa_normal_class(spa) || mc->mc_groups <= 1) + return (B_TRUE); + + /* + * If the metaslab group's mg_allocatable flag is set (see comments + * in metaslab_group_alloc_update() for more information) and + * the allocation throttle is disabled then allow allocations to this + * device. However, if the allocation throttle is enabled then + * check if we have reached our allocation limit (mg_alloc_queue_depth) + * to determine if we should allow allocations to this metaslab group. + * If all metaslab groups are no longer considered allocatable + * (mc_alloc_groups == 0) or we're trying to allocate the smallest + * gang block size then we allow allocations on this metaslab group + * regardless of the mg_allocatable or throttle settings. + */ + if (mg->mg_allocatable) { + metaslab_group_t *mgp; + int64_t qdepth; + uint64_t qmax = mg->mg_max_alloc_queue_depth; + + if (!mc->mc_alloc_throttle_enabled) + return (B_TRUE); + + /* + * If this metaslab group does not have any free space, then + * there is no point in looking further. + */ + if (mg->mg_no_free_space) + return (B_FALSE); + + qdepth = refcount_count(&mg->mg_alloc_queue_depth); + + /* + * If this metaslab group is below its qmax or it's + * the only allocatable metasable group, then attempt + * to allocate from it. + */ + if (qdepth < qmax || mc->mc_alloc_groups == 1) + return (B_TRUE); + ASSERT3U(mc->mc_alloc_groups, >, 1); + + /* + * Since this metaslab group is at or over its qmax, we + * need to determine if there are metaslab groups after this + * one that might be able to handle this allocation. This is + * racy since we can't hold the locks for all metaslab + * groups at the same time when we make this check. + */ + for (mgp = mg->mg_next; mgp != rotor; mgp = mgp->mg_next) { + qmax = mgp->mg_max_alloc_queue_depth; + + qdepth = refcount_count(&mgp->mg_alloc_queue_depth); + + /* + * If there is another metaslab group that + * might be able to handle the allocation, then + * we return false so that we skip this group. + */ + if (qdepth < qmax && !mgp->mg_no_free_space) + return (B_FALSE); + } + + /* + * We didn't find another group to handle the allocation + * so we can't skip this metaslab group even though + * we are at or over our qmax. + */ + return (B_TRUE); + + } else if (mc->mc_alloc_groups == 0 || psize == SPA_MINBLOCKSIZE) { + return (B_TRUE); + } + return (B_FALSE); } /* @@ -2130,8 +2230,57 @@ metaslab_distance(metaslab_t *msp, dva_t return (0); } +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + +static void +metaslab_group_alloc_increment(spa_t *spa, uint64_t vdev, void *tag, int flags) +{ + if (!(flags & METASLAB_ASYNC_ALLOC) || + flags & METASLAB_DONT_THROTTLE) + return; + + metaslab_group_t *mg = vdev_lookup_top(spa, vdev)->vdev_mg; + if (!mg->mg_class->mc_alloc_throttle_enabled) + return; + + (void) refcount_add(&mg->mg_alloc_queue_depth, tag); +} + +void +metaslab_group_alloc_decrement(spa_t *spa, uint64_t vdev, void *tag, int flags) +{ + if (!(flags & METASLAB_ASYNC_ALLOC) || + flags & METASLAB_DONT_THROTTLE) + return; + + metaslab_group_t *mg = vdev_lookup_top(spa, vdev)->vdev_mg; + if (!mg->mg_class->mc_alloc_throttle_enabled) + return; + + (void) refcount_remove(&mg->mg_alloc_queue_depth, tag); +} + +void +metaslab_group_alloc_verify(spa_t *spa, const blkptr_t *bp, void *tag) +{ +#ifdef ZFS_DEBUG + const dva_t *dva = bp->blk_dva; + int ndvas = BP_GET_NDVAS(bp); + + for (int d = 0; d < ndvas; d++) { + uint64_t vdev = DVA_GET_VDEV(&dva[d]); + metaslab_group_t *mg = vdev_lookup_top(spa, vdev)->vdev_mg; + VERIFY(refcount_not_held(&mg->mg_alloc_queue_depth, tag)); + } +#endif +} + static uint64_t -metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, +metaslab_group_alloc(metaslab_group_t *mg, uint64_t asize, uint64_t txg, uint64_t min_distance, dva_t *dva, int d) { spa_t *spa = mg->mg_vd->vdev_spa; @@ -2158,10 +2307,10 @@ metaslab_group_alloc(metaslab_group_t *m if (msp->ms_weight < asize) { spa_dbgmsg(spa, "%s: failed to meet weight " "requirement: vdev %llu, txg %llu, mg %p, " - "msp %p, psize %llu, asize %llu, " + "msp %p, asize %llu, " "weight %llu", spa_name(spa), mg->mg_vd->vdev_id, txg, - mg, msp, psize, asize, msp->ms_weight); + mg, msp, asize, msp->ms_weight); mutex_exit(&mg->mg_lock); return (-1ULL); } @@ -2243,7 +2392,6 @@ metaslab_group_alloc(metaslab_group_t *m msp->ms_access_txg = txg + metaslab_unload_delay; mutex_exit(&msp->ms_lock); - return (offset); } @@ -2260,7 +2408,6 @@ metaslab_alloc_dva(spa_t *spa, metaslab_ int all_zero; int zio_lock = B_FALSE; boolean_t allocatable; - uint64_t offset = -1ULL; uint64_t asize; uint64_t distance; @@ -2330,7 +2477,6 @@ top: all_zero = B_TRUE; do { ASSERT(mg->mg_activation_count == 1); - vd = mg->mg_vd; /* @@ -2346,24 +2492,23 @@ top: /* * Determine if the selected metaslab group is eligible - * for allocations. If we're ganging or have requested - * an allocation for the smallest gang block size - * then we don't want to avoid allocating to the this - * metaslab group. If we're in this condition we should - * try to allocate from any device possible so that we - * don't inadvertently return ENOSPC and suspend the pool + * for allocations. If we're ganging then don't allow + * this metaslab group to skip allocations since that would + * inadvertently return ENOSPC and suspend the pool * even though space is still available. */ - if (allocatable && CAN_FASTGANG(flags) && - psize > SPA_GANGBLOCKSIZE) - allocatable = metaslab_group_allocatable(mg); + if (allocatable && !GANG_ALLOCATION(flags) && !zio_lock) { + allocatable = metaslab_group_allocatable(mg, rotor, + psize); + } if (!allocatable) goto next; + ASSERT(mg->mg_initialized); + /* - * Avoid writing single-copy data to a failing vdev - * unless the user instructs us that it is okay. + * Avoid writing single-copy data to a failing vdev. */ if ((vd->vdev_stat.vs_write_errors > 0 || vd->vdev_state < VDEV_STATE_HEALTHY) && @@ -2383,8 +2528,32 @@ top: asize = vdev_psize_to_asize(vd, psize); ASSERT(P2PHASE(asize, 1ULL << vd->vdev_ashift) == 0); - offset = metaslab_group_alloc(mg, psize, asize, txg, distance, - dva, d); + uint64_t offset = metaslab_group_alloc(mg, asize, txg, + distance, dva, d); + + mutex_enter(&mg->mg_lock); + if (offset == -1ULL) { + mg->mg_failed_allocations++; + if (asize == SPA_GANGBLOCKSIZE) { + /* + * This metaslab group was unable to allocate + * the minimum gang block size so it must be + * out of space. We must notify the allocation + * throttle to start skipping allocation + * attempts to this metaslab group until more + * space becomes available. + * + * Note: this failure cannot be caused by the + * allocation throttle since the allocation + * throttle is only responsible for skipping + * devices and not failing block allocations. + */ + mg->mg_no_free_space = B_TRUE; + } + } + mg->mg_allocations++; + mutex_exit(&mg->mg_lock); + if (offset != -1ULL) { /* * If we've just selected this metaslab group, @@ -2565,9 +2734,57 @@ metaslab_claim_dva(spa_t *spa, const dva return (0); } +/* + * Reserve some allocation slots. The reservation system must be called + * before we call into the allocator. If there aren't any available slots + * then the I/O will be throttled until an I/O completes and its slots are + * freed up. The function returns true if it was successful in placing + * the reservation. + */ +boolean_t +metaslab_class_throttle_reserve(metaslab_class_t *mc, int slots, zio_t *zio, + int flags) +{ + uint64_t available_slots = 0; + boolean_t slot_reserved = B_FALSE; + + ASSERT(mc->mc_alloc_throttle_enabled); + mutex_enter(&mc->mc_lock); + + uint64_t reserved_slots = refcount_count(&mc->mc_alloc_slots); + if (reserved_slots < mc->mc_alloc_max_slots) + available_slots = mc->mc_alloc_max_slots - reserved_slots; + + if (slots <= available_slots || GANG_ALLOCATION(flags)) { + /* + * We reserve the slots individually so that we can unreserve + * them individually when an I/O completes. + */ + for (int d = 0; d < slots; d++) { + reserved_slots = refcount_add(&mc->mc_alloc_slots, zio); + } + zio->io_flags |= ZIO_FLAG_IO_ALLOCATING; + slot_reserved = B_TRUE; + } + + mutex_exit(&mc->mc_lock); + return (slot_reserved); +} + +void +metaslab_class_throttle_unreserve(metaslab_class_t *mc, int slots, zio_t *zio) +{ + ASSERT(mc->mc_alloc_throttle_enabled); + mutex_enter(&mc->mc_lock); + for (int d = 0; d < slots; d++) { + (void) refcount_remove(&mc->mc_alloc_slots, zio); + } + mutex_exit(&mc->mc_lock); +} + int metaslab_alloc(spa_t *spa, metaslab_class_t *mc, uint64_t psize, blkptr_t *bp, - int ndvas, uint64_t txg, blkptr_t *hintbp, int flags) + int ndvas, uint64_t txg, blkptr_t *hintbp, int flags, zio_t *zio) { dva_t *dva = bp->blk_dva; dva_t *hintdva = hintbp->blk_dva; @@ -2593,11 +2810,21 @@ metaslab_alloc(spa_t *spa, metaslab_clas if (error != 0) { for (d--; d >= 0; d--) { metaslab_free_dva(spa, &dva[d], txg, B_TRUE); + metaslab_group_alloc_decrement(spa, + DVA_GET_VDEV(&dva[d]), zio, flags); bzero(&dva[d], sizeof (dva_t)); } spa_config_exit(spa, SCL_ALLOC, FTAG); return (error); + } else { + /* + * Update the metaslab group's queue depth + * based on the newly allocated dva. + */ + metaslab_group_alloc_increment(spa, + DVA_GET_VDEV(&dva[d]), zio, flags); } + } ASSERT(error == 0); ASSERT(BP_GET_NDVAS(bp) == ndvas); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Sat Sep 3 10:04:37 2016 (r305331) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #include @@ -73,6 +73,13 @@ refcount_create(refcount_t *rc) } void +refcount_create_tracked(refcount_t *rc) +{ + refcount_create(rc); + rc->rc_tracked = B_TRUE; +} + +void refcount_create_untracked(refcount_t *rc) { refcount_create(rc); @@ -255,4 +262,60 @@ refcount_transfer_ownership(refcount_t * ASSERT(found); mutex_exit(&rc->rc_mtx); } + +/* + * If tracking is enabled, return true if a reference exists that matches + * the "holder" tag. If tracking is disabled, then return true if a reference + * might be held. + */ +boolean_t +refcount_held(refcount_t *rc, void *holder) +{ + reference_t *ref; + + mutex_enter(&rc->rc_mtx); + + if (!rc->rc_tracked) { + mutex_exit(&rc->rc_mtx); + return (rc->rc_count > 0); + } + + for (ref = list_head(&rc->rc_list); ref; + ref = list_next(&rc->rc_list, ref)) { + if (ref->ref_holder == holder) { + mutex_exit(&rc->rc_mtx); + return (B_TRUE); + } + } + mutex_exit(&rc->rc_mtx); + return (B_FALSE); +} + +/* + * If tracking is enabled, return true if a reference does not exist that + * matches the "holder" tag. If tracking is disabled, always return true + * since the reference might not be held. + */ +boolean_t +refcount_not_held(refcount_t *rc, void *holder) +{ + reference_t *ref; + + mutex_enter(&rc->rc_mtx); + + if (!rc->rc_tracked) { + mutex_exit(&rc->rc_mtx); + return (B_TRUE); + } + + for (ref = list_head(&rc->rc_list); ref; + ref = list_next(&rc->rc_list, ref)) { + if (ref->ref_holder == holder) { + mutex_exit(&rc->rc_mtx); + return (B_FALSE); + } + } + mutex_exit(&rc->rc_mtx); + return (B_TRUE); +} #endif /* ZFS_DEBUG */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Sep 3 10:04:37 2016 (r305331) @@ -1332,7 +1332,6 @@ spa_unload(spa_t *spa) ddt_unload(spa); - /* * Drop and purge level 2 cache */ @@ -3720,6 +3719,7 @@ spa_create(const char *pool, nvlist_t *n spa->spa_uberblock.ub_txg = txg - 1; spa->spa_uberblock.ub_version = version; spa->spa_ubsync = spa->spa_uberblock; + spa->spa_load_state = SPA_LOAD_CREATE; /* * Create "The Godfather" zio to hold all async IOs @@ -3905,6 +3905,7 @@ spa_create(const char *pool, nvlist_t *n */ spa_evicting_os_wait(spa); spa->spa_minref = refcount_count(&spa->spa_refcount); + spa->spa_load_state = SPA_LOAD_NONE; mutex_exit(&spa_namespace_lock); @@ -5615,7 +5616,7 @@ spa_nvlist_lookup_by_guid(nvlist_t **nvp static void spa_vdev_remove_aux(nvlist_t *config, char *name, nvlist_t **dev, int count, - nvlist_t *dev_to_remove) + nvlist_t *dev_to_remove) { nvlist_t **newdev = NULL; @@ -6830,6 +6831,8 @@ spa_sync(spa_t *spa, uint64_t txg) vdev_t *vd; dmu_tx_t *tx; int error; + uint32_t max_queue_depth = zfs_vdev_async_write_max_active * + zfs_vdev_queue_depth_pct / 100; VERIFY(spa_writeable(spa)); @@ -6841,6 +6844,10 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_syncing_txg = txg; spa->spa_sync_pass = 0; + mutex_enter(&spa->spa_alloc_lock); + VERIFY0(avl_numnodes(&spa->spa_alloc_tree)); + mutex_exit(&spa->spa_alloc_lock); + /* * If there are any pending vdev state changes, convert them * into config changes that go out with this transaction group. @@ -6900,6 +6907,38 @@ spa_sync(spa_t *spa, uint64_t txg) } /* + * Set the top-level vdev's max queue depth. Evaluate each + * top-level's async write queue depth in case it changed. + * The max queue depth will not change in the middle of syncing + * out this txg. + */ + uint64_t queue_depth_total = 0; + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + if (mg == NULL || mg->mg_class != spa_normal_class(spa) || + !metaslab_group_initialized(mg)) + continue; + + /* + * It is safe to do a lock-free check here because only async + * allocations look at mg_max_alloc_queue_depth, and async + * allocations all happen from spa_sync(). + */ + ASSERT0(refcount_count(&mg->mg_alloc_queue_depth)); + mg->mg_max_alloc_queue_depth = max_queue_depth; + queue_depth_total += mg->mg_max_alloc_queue_depth; + } + metaslab_class_t *mc = spa_normal_class(spa); + ASSERT0(refcount_count(&mc->mc_alloc_slots)); + mc->mc_alloc_max_slots = queue_depth_total; + mc->mc_alloc_throttle_enabled = zio_dva_throttle_enabled; + + ASSERT3U(mc->mc_alloc_max_slots, <=, + max_queue_depth * rvd->vdev_children); + + /* * Iterate to convergence. */ do { @@ -7056,6 +7095,10 @@ spa_sync(spa_t *spa, uint64_t txg) dsl_pool_sync_done(dp, txg); + mutex_enter(&spa->spa_alloc_lock); + VERIFY0(avl_numnodes(&spa->spa_alloc_tree)); + mutex_exit(&spa->spa_alloc_lock); + /* * Update usable space statistics. */ 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 Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Sep 3 10:04:37 2016 (r305331) @@ -657,6 +657,7 @@ spa_add(const char *name, nvlist_t *conf mutex_init(&spa->spa_scrub_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_suspend_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_vdev_top_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&spa->spa_alloc_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&spa->spa_async_cv, NULL, CV_DEFAULT, NULL); cv_init(&spa->spa_evicting_os_cv, NULL, CV_DEFAULT, NULL); @@ -713,6 +714,9 @@ spa_add(const char *name, nvlist_t *conf spa_active_count++; } + avl_create(&spa->spa_alloc_tree, zio_timestamp_compare, + sizeof (zio_t), offsetof(zio_t, io_alloc_node)); + /* * Every pool starts with the default cachefile */ @@ -791,6 +795,7 @@ spa_remove(spa_t *spa) kmem_free(dp, sizeof (spa_config_dirent_t)); } + avl_destroy(&spa->spa_alloc_tree); list_destroy(&spa->spa_config_list); nvlist_free(spa->spa_label_features); @@ -824,6 +829,7 @@ spa_remove(spa_t *spa) cv_destroy(&spa->spa_scrub_io_cv); cv_destroy(&spa->spa_suspend_cv); + mutex_destroy(&spa->spa_alloc_lock); mutex_destroy(&spa->spa_async_lock); mutex_destroy(&spa->spa_errlist_lock); mutex_destroy(&spa->spa_errlog_lock); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Sat Sep 3 10:04:37 2016 (r305331) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_H @@ -55,14 +55,15 @@ void metaslab_sync_done(metaslab_t *, ui void metaslab_sync_reassess(metaslab_group_t *); uint64_t metaslab_block_maxsize(metaslab_t *); -#define METASLAB_HINTBP_FAVOR 0x0 -#define METASLAB_HINTBP_AVOID 0x1 -#define METASLAB_GANG_HEADER 0x2 -#define METASLAB_GANG_CHILD 0x4 -#define METASLAB_GANG_AVOID 0x8 +#define METASLAB_HINTBP_FAVOR 0x0 +#define METASLAB_HINTBP_AVOID 0x1 +#define METASLAB_GANG_HEADER 0x2 +#define METASLAB_GANG_CHILD 0x4 +#define METASLAB_ASYNC_ALLOC 0x8 +#define METASLAB_DONT_THROTTLE 0x10 int metaslab_alloc(spa_t *, metaslab_class_t *, uint64_t, - blkptr_t *, int, uint64_t, blkptr_t *, int); + blkptr_t *, int, uint64_t, blkptr_t *, int, zio_t *); void metaslab_free(spa_t *, const blkptr_t *, uint64_t, boolean_t); int metaslab_claim(spa_t *, const blkptr_t *, uint64_t); void metaslab_check_free(spa_t *, const blkptr_t *); @@ -73,6 +74,9 @@ int metaslab_class_validate(metaslab_cla void metaslab_class_histogram_verify(metaslab_class_t *); uint64_t metaslab_class_fragmentation(metaslab_class_t *); uint64_t metaslab_class_expandable_space(metaslab_class_t *); +boolean_t metaslab_class_throttle_reserve(metaslab_class_t *, int, + zio_t *, int); +void metaslab_class_throttle_unreserve(metaslab_class_t *, int, zio_t *); void metaslab_class_space_update(metaslab_class_t *, int64_t, int64_t, int64_t, int64_t); @@ -86,10 +90,13 @@ metaslab_group_t *metaslab_group_create( void metaslab_group_destroy(metaslab_group_t *); void metaslab_group_activate(metaslab_group_t *); void metaslab_group_passivate(metaslab_group_t *); +boolean_t metaslab_group_initialized(metaslab_group_t *); uint64_t metaslab_group_get_space(metaslab_group_t *); void metaslab_group_histogram_verify(metaslab_group_t *); uint64_t metaslab_group_fragmentation(metaslab_group_t *); void metaslab_group_histogram_remove(metaslab_group_t *, metaslab_t *); +void metaslab_group_alloc_decrement(spa_t *, uint64_t, void *, int); +void metaslab_group_alloc_verify(spa_t *, const blkptr_t *, void *); #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Sat Sep 3 10:04:37 2016 (r305331) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H @@ -59,11 +59,42 @@ extern "C" { * to use a block allocator that best suits that class. */ struct metaslab_class { + kmutex_t mc_lock; spa_t *mc_spa; metaslab_group_t *mc_rotor; metaslab_ops_t *mc_ops; uint64_t mc_aliquot; + + /* + * Track the number of metaslab groups that have been initialized + * and can accept allocations. An initialized metaslab group is + * one has been completely added to the config (i.e. we have + * updated the MOS config and the space has been added to the pool). + */ + uint64_t mc_groups; + + /* + * Toggle to enable/disable the allocation throttle. + */ + boolean_t mc_alloc_throttle_enabled; + + /* + * The allocation throttle works on a reservation system. Whenever + * an asynchronous zio wants to perform an allocation it must + * first reserve the number of blocks that it wants to allocate. + * If there aren't sufficient slots available for the pending zio + * then that I/O is throttled until more slots free up. The current + * number of reserved allocations is maintained by the mc_alloc_slots + * refcount. The mc_alloc_max_slots value determines the maximum + * number of allocations that the system allows. Gang blocks are + * allowed to reserve slots even if we've reached the maximum + * number of allocations allowed. + */ + uint64_t mc_alloc_max_slots; + refcount_t mc_alloc_slots; + uint64_t mc_alloc_groups; /* # of allocatable groups */ + uint64_t mc_alloc; /* total allocated space */ uint64_t mc_deferred; /* total deferred frees */ uint64_t mc_space; /* total space (alloc + free) */ @@ -86,6 +117,15 @@ struct metaslab_group { avl_tree_t mg_metaslab_tree; uint64_t mg_aliquot; boolean_t mg_allocatable; /* can we allocate? */ + + /* + * A metaslab group is considered to be initialized only after + * we have updated the MOS config and added the space to the pool. + * We only allow allocation attempts to a metaslab group if it + * has been initialized. + */ + boolean_t mg_initialized; + uint64_t mg_free_capacity; /* percentage free */ int64_t mg_bias; int64_t mg_activation_count; @@ -94,6 +134,27 @@ struct metaslab_group { taskq_t *mg_taskq; metaslab_group_t *mg_prev; metaslab_group_t *mg_next; + + /* + * Each metaslab group can handle mg_max_alloc_queue_depth allocations + * which are tracked by mg_alloc_queue_depth. It's possible for a + * metaslab group to handle more allocations than its max. This + * can occur when gang blocks are required or when other groups + * are unable to handle their share of allocations. + */ + uint64_t mg_max_alloc_queue_depth; + refcount_t mg_alloc_queue_depth; + + /* + * A metalab group that can no longer allocate the minimum block + * size will set mg_no_free_space. Once a metaslab group is out + * of space then its share of work must be distributed to other + * groups. + */ + boolean_t mg_no_free_space; + + uint64_t mg_allocations; + uint64_t mg_failed_allocations; uint64_t mg_fragmentation; uint64_t mg_histogram[RANGE_TREE_HISTOGRAM_SIZE]; }; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h Sat Sep 3 10:04:37 2016 (r305331) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_REFCOUNT_H @@ -64,6 +64,7 @@ typedef struct refcount { void refcount_create(refcount_t *rc); void refcount_create_untracked(refcount_t *rc); +void refcount_create_tracked(refcount_t *rc); void refcount_destroy(refcount_t *rc); void refcount_destroy_many(refcount_t *rc, uint64_t number); int refcount_is_zero(refcount_t *rc); @@ -74,6 +75,8 @@ int64_t refcount_add_many(refcount_t *rc int64_t refcount_remove_many(refcount_t *rc, uint64_t number, void *holder_tag); void refcount_transfer(refcount_t *dst, refcount_t *src); void refcount_transfer_ownership(refcount_t *, void *, void *); +boolean_t refcount_held(refcount_t *, void *); +boolean_t refcount_not_held(refcount_t *, void *); void refcount_sysinit(void); void refcount_fini(void); @@ -86,6 +89,7 @@ typedef struct refcount { #define refcount_create(rc) ((rc)->rc_count = 0) #define refcount_create_untracked(rc) ((rc)->rc_count = 0) +#define refcount_create_tracked(rc) ((rc)->rc_count = 0) #define refcount_destroy(rc) ((rc)->rc_count = 0) #define refcount_destroy_many(rc, number) ((rc)->rc_count = 0) #define refcount_is_zero(rc) ((rc)->rc_count == 0) @@ -102,6 +106,8 @@ typedef struct refcount { atomic_add_64(&(dst)->rc_count, __tmp); \ } #define refcount_transfer_ownership(rc, current_holder, new_holder) +#define refcount_held(rc, holder) ((rc)->rc_count > 0) +#define refcount_not_held(rc, holder) (B_TRUE) #define refcount_sysinit() #define refcount_fini() Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Sep 3 10:04:37 2016 (r305331) @@ -165,6 +165,8 @@ struct spa { uint64_t spa_last_synced_guid; /* last synced guid */ list_t spa_config_dirty_list; /* vdevs with dirty config */ list_t spa_state_dirty_list; /* vdevs with dirty state */ + kmutex_t spa_alloc_lock; + avl_tree_t spa_alloc_tree; spa_aux_vdev_t spa_spares; /* hot spares */ spa_aux_vdev_t spa_l2cache; /* L2ARC cache devices */ nvlist_t *spa_label_features; /* Features for reading MOS */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sat Sep 3 10:04:37 2016 (r305331) @@ -53,6 +53,9 @@ typedef struct vdev_queue vdev_queue_t; typedef struct vdev_cache vdev_cache_t; typedef struct vdev_cache_entry vdev_cache_entry_t; +extern int zfs_vdev_queue_depth_pct; +extern uint32_t zfs_vdev_async_write_max_active; + /* * Virtual device operations */ @@ -190,10 +193,21 @@ struct vdev { uint64_t vdev_deflate_ratio; /* deflation ratio (x512) */ uint64_t vdev_islog; /* is an intent log device */ uint64_t vdev_removing; /* device is being removed? */ - boolean_t vdev_ishole; /* is a hole in the namespace */ + boolean_t vdev_ishole; /* is a hole in the namespace */ + kmutex_t vdev_queue_lock; /* protects vdev_queue_depth */ uint64_t vdev_top_zap; /* + * The queue depth parameters determine how many async writes are + * still pending (i.e. allocated by net yet issued to disk) per + * top-level (vdev_async_write_queue_depth) and the maximum allowed + * (vdev_max_async_write_queue_depth). These values only apply to + * top-level vdevs. + */ + uint64_t vdev_async_write_queue_depth; + uint64_t vdev_max_async_write_queue_depth; + + /* * Leaf vdev state. */ range_tree_t *vdev_dtl[DTL_TYPES]; /* dirty time logs */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Sep 3 09:24:33 2016 (r305330) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Sep 3 10:04:37 2016 (r305331) @@ -175,6 +175,7 @@ enum zio_flag { ZIO_FLAG_DONT_CACHE = 1 << 11, ZIO_FLAG_NODATA = 1 << 12, ZIO_FLAG_INDUCE_DAMAGE = 1 << 13, + ZIO_FLAG_IO_ALLOCATING = 1 << 14, #define ZIO_FLAG_DDT_INHERIT (ZIO_FLAG_IO_RETRY - 1) #define ZIO_FLAG_GANG_INHERIT (ZIO_FLAG_IO_RETRY - 1) @@ -182,27 +183,27 @@ enum zio_flag { /* * Flags inherited by vdev children. */ - ZIO_FLAG_IO_RETRY = 1 << 14, /* must be first for INHERIT */ - ZIO_FLAG_PROBE = 1 << 15, - ZIO_FLAG_TRYHARD = 1 << 16, - ZIO_FLAG_OPTIONAL = 1 << 17, + ZIO_FLAG_IO_RETRY = 1 << 15, /* must be first for INHERIT */ + ZIO_FLAG_PROBE = 1 << 16, + ZIO_FLAG_TRYHARD = 1 << 17, + ZIO_FLAG_OPTIONAL = 1 << 18, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Sep 3 10:07: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 26D64BCEE28; Sat, 3 Sep 2016 10:07:47 +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 04CFF383; Sat, 3 Sep 2016 10:07:46 +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 u83A7k8H097281; Sat, 3 Sep 2016 10:07:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83A7kfw097280; Sat, 3 Sep 2016 10:07:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609031007.u83A7kfw097280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 10:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305332 - head/cddl/contrib/opensolaris/cmd/zdb 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.22 Precedence: list List-Id: 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, 03 Sep 2016 10:07:47 -0000 Author: mav Date: Sat Sep 3 10:07:46 2016 New Revision: 305332 URL: https://svnweb.freebsd.org/changeset/base/305332 Log: MFV r304159: 7277 zdb should be able to print zfs_dbgmsg's illumos/illumos-gate@29bdd2f916366ece37c4748bca6b3d61f57a223b https://github.com/illumos/illumos-gate/commit/29bdd2f916366ece37c4748bca6b3d61f 57a223b https://www.illumos.org/issues/7277 ztest always prints the debug messages (zfs_dbgmsg()) by calling zfs_dbgmsg_print(). We should add a flag to zdb to make it do this as well before exiting. Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Igor Kozhukhov Approved by: Dan McDonald Author: Pavel Zakharov Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Sep 3 10:04:37 2016 (r305331) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Sep 3 10:07:46 2016 (r305332) @@ -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 (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -117,7 +117,7 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumMdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " + "Usage: %s [-CumMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " "[-U config] [-I inflight I/Os] [-x dumpdir] poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " "[object...]\n" @@ -178,12 +178,23 @@ usage(void) (void) fprintf(stderr, " -I -- " "specify the maximum number of " "checksumming I/Os [default is 200]\n"); + (void) fprintf(stderr, " -G dump zfs_dbgmsg buffer before " + "exiting\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); exit(1); } +static void +dump_debug_buffer() +{ + if (dump_opt['G']) { + (void) printf("\n"); + zfs_dbgmsg_print("zdb"); + } +} + /* * Called for usage errors that are discovered after a call to spa_open(), * dmu_bonus_hold(), or pool_match(). abort() is called for other errors. @@ -200,6 +211,8 @@ fatal(const char *fmt, ...) va_end(ap); (void) fprintf(stderr, "\n"); + dump_debug_buffer(); + exit(1); } @@ -3103,8 +3116,10 @@ dump_zpool(spa_t *spa) if (dump_opt['h']) dump_history(spa); - if (rc != 0) + if (rc != 0) { + dump_debug_buffer(); exit(rc); + } } #define ZDB_FLAG_CHECKSUM 0x0001 @@ -3575,7 +3590,7 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:PG")) != -1) { switch (c) { case 'b': case 'c': @@ -3591,6 +3606,7 @@ main(int argc, char **argv) case 'M': case 'R': case 'S': + case 'G': dump_opt[c]++; dump_all = 0; break; @@ -3826,6 +3842,8 @@ main(int argc, char **argv) fuid_table_destroy(); sa_loaded = B_FALSE; + dump_debug_buffer(); + libzfs_fini(g_zfs); kernel_fini(); From owner-svn-src-head@freebsd.org Sat Sep 3 10:09: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 490B7BCEEED; Sat, 3 Sep 2016 10:09:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F33D1816; Sat, 3 Sep 2016 10:09: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 u83A9OqY097386; Sat, 3 Sep 2016 10:09:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83A9OmE097384; Sat, 3 Sep 2016 10:09:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609031009.u83A9OmE097384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 10:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305333 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 10:09:25 -0000 Author: mav Date: Sat Sep 3 10:09:23 2016 New Revision: 305333 URL: https://svnweb.freebsd.org/changeset/base/305333 Log: MFV r304156: 7235 remove unused func dsl_dataset_set_blkptr illumos/illumos-gate@bd56f80007857b960e0981ed0797ad8ec844a96b https://github.com/illumos/illumos-gate/commit/bd56f80007857b960e0981ed0797ad8ec 844a96b https://www.illumos.org/issues/7235 The function dsl_dataset_set_blkptr() is unused. We should remove it. Reviewed by: George Wilson Reviewed by: Alex Reece Reviewed by: Prakash Surya Reviewed by: Igor Kozhukhov Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Sep 3 10:07:46 2016 (r305332) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Sep 3 10:09:23 2016 (r305333) @@ -1060,19 +1060,6 @@ dsl_dataset_get_blkptr(dsl_dataset_t *ds return (&dsl_dataset_phys(ds)->ds_bp); } -void -dsl_dataset_set_blkptr(dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx) -{ - ASSERT(dmu_tx_is_syncing(tx)); - /* If it's the meta-objset, set dp_meta_rootbp */ - if (ds == NULL) { - tx->tx_pool->dp_meta_rootbp = *bp; - } else { - dmu_buf_will_dirty(ds->ds_dbuf, tx); - dsl_dataset_phys(ds)->ds_bp = *bp; - } -} - spa_t * dsl_dataset_get_spa(dsl_dataset_t *ds) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Sat Sep 3 10:07:46 2016 (r305332) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Sat Sep 3 10:09:23 2016 (r305333) @@ -272,7 +272,6 @@ int dsl_dataset_snapshot_tmp(const char minor_t cleanup_minor, const char *htag); blkptr_t *dsl_dataset_get_blkptr(dsl_dataset_t *ds); -void dsl_dataset_set_blkptr(dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx); spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds); From owner-svn-src-head@freebsd.org Sat Sep 3 10:11: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 25EAEBCEF69; Sat, 3 Sep 2016 10:11: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 019469E1; Sat, 3 Sep 2016 10:10: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 u83AAxDP098187; Sat, 3 Sep 2016 10:10:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83AAxEu098185; Sat, 3 Sep 2016 10:10:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609031010.u83AAxEu098185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 10:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305334 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 10:11:00 -0000 Author: mav Date: Sat Sep 3 10:10:58 2016 New Revision: 305334 URL: https://svnweb.freebsd.org/changeset/base/305334 Log: MFV r304157: 7230 add assertions to dmu_send_impl() to verify that stream includes BEGIN and END records illumos/illumos-gate@12b90ee2d3b10689fc45f4930d2392f5fe1d9cfa https://github.com/illumos/illumos-gate/commit/12b90ee2d3b10689fc45f4930d2392f5f e1d9cfa https://www.illumos.org/issues/7230 A test failure occurred where a send stream had only a BEGIN record. This should not be possible if the send returns without error. Prevented this from happening in the future by adding an assertion to dmu_send_impl() to verify that if the function returns 0 (success) both a BEGIN and END record are present. Did this by adding flags to dmu_sendarg_t (indicating whether BEGIN o r END records sent), having dump_record() set flags appropriately, adding VERIFY statement to dmu_send_impl(). Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Igor Kozhukhov Approved by: Robert Mustacchi Author: Matt Krantz Modified: 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 Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) 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 Sat Sep 3 10:09:23 2016 (r305333) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Sep 3 10:10:58 2016 (r305334) @@ -160,11 +160,16 @@ dump_record(dmu_sendarg_t *dsp, void *pa fletcher_4_incremental_native(dsp->dsa_drr, offsetof(dmu_replay_record_t, drr_u.drr_checksum.drr_checksum), &dsp->dsa_zc); - if (dsp->dsa_drr->drr_type != DRR_BEGIN) { + if (dsp->dsa_drr->drr_type == DRR_BEGIN) { + dsp->dsa_sent_begin = B_TRUE; + } else { ASSERT(ZIO_CHECKSUM_IS_ZERO(&dsp->dsa_drr->drr_u. drr_checksum.drr_checksum)); dsp->dsa_drr->drr_u.drr_checksum.drr_checksum = dsp->dsa_zc; } + if (dsp->dsa_drr->drr_type == DRR_END) { + dsp->dsa_sent_end = B_TRUE; + } fletcher_4_incremental_native(&dsp->dsa_drr-> drr_u.drr_checksum.drr_checksum, sizeof (zio_cksum_t), &dsp->dsa_zc); @@ -912,6 +917,8 @@ out: list_remove(&to_ds->ds_sendstreams, dsp); mutex_exit(&to_ds->ds_sendstream_lock); + VERIFY(err != 0 || (dsp->dsa_sent_begin && dsp->dsa_sent_end)); + kmem_free(drr, sizeof (dmu_replay_record_t)); kmem_free(dsp, sizeof (dmu_sendarg_t)); 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 Sat Sep 3 10:09:23 2016 (r305333) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Sat Sep 3 10:10:58 2016 (r305334) @@ -301,6 +301,8 @@ typedef struct dmu_sendarg { uint64_t dsa_last_data_offset; uint64_t dsa_resume_object; uint64_t dsa_resume_offset; + boolean_t dsa_sent_begin; + boolean_t dsa_sent_end; } dmu_sendarg_t; void dmu_object_zapify(objset_t *, uint64_t, dmu_object_type_t, dmu_tx_t *); From owner-svn-src-head@freebsd.org Sat Sep 3 10:58: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 CC6A7BCBEBC; Sat, 3 Sep 2016 10:58: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 91B92A52; Sat, 3 Sep 2016 10:58: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 u83AwEDb016420; Sat, 3 Sep 2016 10:58:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83AwECX016415; Sat, 3 Sep 2016 10:58:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609031058.u83AwECX016415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 10:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305338 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 10:58:15 -0000 Author: mav Date: Sat Sep 3 10:58:14 2016 New Revision: 305338 URL: https://svnweb.freebsd.org/changeset/base/305338 Log: MFV r305335: 7003 zap_lockdir() should tag hold zap_lockdir() / zap_unlockdir() should take a "void *tag" argument which tags the hold on the zap. This will help diagnose programming errors which misuse the hold on the ZAP. Sponsored by: Intel Corp. Closes #108 Reviewed by: Pavel Zakharov Reviewed by: Steve Gonczi Reviewed by: George Wilson Reviewed by: Brian Behlendorf Author: Matthew Ahrens openzfs/openzfs@0780b3eab5a2c13e04328b39ecd2a6d0d3c4f7cb Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Sep 3 10:54:56 2016 (r305337) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Sep 3 10:58:14 2016 (r305338) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -2903,6 +2903,13 @@ dmu_buf_get_blkptr(dmu_buf_t *db) return (dbi->db_blkptr); } +objset_t * +dmu_buf_get_objset(dmu_buf_t *db) +{ + dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db; + return (dbi->db_objset); +} + static void dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Sep 3 10:54:56 2016 (r305337) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Sep 3 10:58:14 2016 (r305338) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright 2013 DEY Storage Systems, Inc. @@ -617,6 +617,8 @@ void *dmu_buf_remove_user(dmu_buf_t *db, */ void *dmu_buf_get_user(dmu_buf_t *db); +objset_t *dmu_buf_get_objset(dmu_buf_t *db); + /* Block until any in-progress dmu buf user evictions complete. */ void dmu_buf_user_evict_wait(void); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h Sat Sep 3 10:54:56 2016 (r305337) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h Sat Sep 3 10:58:14 2016 (r305338) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -197,8 +197,8 @@ typedef struct zap_name { boolean_t zap_match(zap_name_t *zn, const char *matchname); int zap_lockdir(objset_t *os, uint64_t obj, dmu_tx_t *tx, - krw_t lti, boolean_t fatreader, boolean_t adding, zap_t **zapp); -void zap_unlockdir(zap_t *zap); + krw_t lti, boolean_t fatreader, boolean_t adding, void *tag, zap_t **zapp); +void zap_unlockdir(zap_t *zap, void *tag); void zap_evict(void *dbu); zap_name_t *zap_name_alloc(zap_t *zap, const char *key, matchtype_t mt); void zap_name_free(zap_name_t *zn); @@ -217,9 +217,10 @@ void fzap_prefetch(zap_name_t *zn); int fzap_count_write(zap_name_t *zn, int add, refcount_t *towrite, refcount_t *tooverwrite); int fzap_add(zap_name_t *zn, uint64_t integer_size, uint64_t num_integers, - const void *val, dmu_tx_t *tx); + const void *val, void *tag, dmu_tx_t *tx); int fzap_update(zap_name_t *zn, - int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx); + int integer_size, uint64_t num_integers, const void *val, + void *tag, dmu_tx_t *tx); int fzap_length(zap_name_t *zn, uint64_t *integer_size, uint64_t *num_integers); int fzap_remove(zap_name_t *zn, dmu_tx_t *tx); @@ -229,7 +230,7 @@ void zap_put_leaf(struct zap_leaf *l); int fzap_add_cd(zap_name_t *zn, uint64_t integer_size, uint64_t num_integers, - const void *val, uint32_t cd, dmu_tx_t *tx); + const void *val, uint32_t cd, void *tag, dmu_tx_t *tx); void fzap_upgrade(zap_t *zap, dmu_tx_t *tx, zap_flags_t flags); int fzap_cursor_move_to_key(zap_cursor_t *zc, zap_name_t *zn); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Sat Sep 3 10:54:56 2016 (r305337) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Sat Sep 3 10:58:14 2016 (r305338) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -596,7 +596,8 @@ zap_deref_leaf(zap_t *zap, uint64_t h, d } static int -zap_expand_leaf(zap_name_t *zn, zap_leaf_t *l, dmu_tx_t *tx, zap_leaf_t **lp) +zap_expand_leaf(zap_name_t *zn, zap_leaf_t *l, + void *tag, dmu_tx_t *tx, zap_leaf_t **lp) { zap_t *zap = zn->zn_zap; uint64_t hash = zn->zn_hash; @@ -618,9 +619,9 @@ zap_expand_leaf(zap_name_t *zn, zap_leaf uint64_t object = zap->zap_object; zap_put_leaf(l); - zap_unlockdir(zap); + zap_unlockdir(zap, tag); err = zap_lockdir(os, object, tx, RW_WRITER, - FALSE, FALSE, &zn->zn_zap); + FALSE, FALSE, tag, &zn->zn_zap); zap = zn->zn_zap; if (err) return (err); @@ -683,7 +684,8 @@ zap_expand_leaf(zap_name_t *zn, zap_leaf } static void -zap_put_leaf_maybe_grow_ptrtbl(zap_name_t *zn, zap_leaf_t *l, dmu_tx_t *tx) +zap_put_leaf_maybe_grow_ptrtbl(zap_name_t *zn, zap_leaf_t *l, + void *tag, dmu_tx_t *tx) { zap_t *zap = zn->zn_zap; int shift = zap_f_phys(zap)->zap_ptrtbl.zt_shift; @@ -703,9 +705,9 @@ zap_put_leaf_maybe_grow_ptrtbl(zap_name_ objset_t *os = zap->zap_objset; uint64_t zapobj = zap->zap_object; - zap_unlockdir(zap); + zap_unlockdir(zap, tag); err = zap_lockdir(os, zapobj, tx, - RW_WRITER, FALSE, FALSE, &zn->zn_zap); + RW_WRITER, FALSE, FALSE, tag, &zn->zn_zap); zap = zn->zn_zap; if (err) return; @@ -795,7 +797,7 @@ fzap_lookup(zap_name_t *zn, int fzap_add_cd(zap_name_t *zn, uint64_t integer_size, uint64_t num_integers, - const void *val, uint32_t cd, dmu_tx_t *tx) + const void *val, uint32_t cd, void *tag, dmu_tx_t *tx) { zap_leaf_t *l; int err; @@ -824,7 +826,7 @@ retry: if (err == 0) { zap_increment_num_entries(zap, 1, tx); } else if (err == EAGAIN) { - err = zap_expand_leaf(zn, l, tx, &l); + err = zap_expand_leaf(zn, l, tag, tx, &l); zap = zn->zn_zap; /* zap_expand_leaf() may change zap */ if (err == 0) goto retry; @@ -832,26 +834,27 @@ retry: out: if (zap != NULL) - zap_put_leaf_maybe_grow_ptrtbl(zn, l, tx); + zap_put_leaf_maybe_grow_ptrtbl(zn, l, tag, tx); return (err); } int fzap_add(zap_name_t *zn, uint64_t integer_size, uint64_t num_integers, - const void *val, dmu_tx_t *tx) + const void *val, void *tag, dmu_tx_t *tx) { int err = fzap_check(zn, integer_size, num_integers); if (err != 0) return (err); return (fzap_add_cd(zn, integer_size, num_integers, - val, ZAP_NEED_CD, tx)); + val, ZAP_NEED_CD, tag, tx)); } int fzap_update(zap_name_t *zn, - int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx) + int integer_size, uint64_t num_integers, const void *val, + void *tag, dmu_tx_t *tx) { zap_leaf_t *l; int err, create; @@ -881,14 +884,14 @@ retry: } if (err == EAGAIN) { - err = zap_expand_leaf(zn, l, tx, &l); + err = zap_expand_leaf(zn, l, tag, tx, &l); zap = zn->zn_zap; /* zap_expand_leaf() may change zap */ if (err == 0) goto retry; } if (zap != NULL) - zap_put_leaf_maybe_grow_ptrtbl(zn, l, tx); + zap_put_leaf_maybe_grow_ptrtbl(zn, l, tag, tx); return (err); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sat Sep 3 10:54:56 2016 (r305337) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sat Sep 3 10:58:14 2016 (r305338) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -43,7 +43,8 @@ extern inline mzap_phys_t *zap_m_phys(zap_t *zap); -static int mzap_upgrade(zap_t **zapp, dmu_tx_t *tx, zap_flags_t flags); +static int mzap_upgrade(zap_t **zapp, + void *tag, dmu_tx_t *tx, zap_flags_t flags); uint64_t zap_getflags(zap_t *zap) @@ -468,20 +469,18 @@ handle_winner: return (winner); } -int -zap_lockdir(objset_t *os, uint64_t obj, dmu_tx_t *tx, +static int +zap_lockdir_impl(dmu_buf_t *db, void *tag, dmu_tx_t *tx, krw_t lti, boolean_t fatreader, boolean_t adding, zap_t **zapp) { zap_t *zap; - dmu_buf_t *db; krw_t lt; - int err; - *zapp = NULL; + ASSERT0(db->db_offset); + objset_t *os = dmu_buf_get_objset(db); + uint64_t obj = db->db_object; - err = dmu_buf_hold(os, obj, 0, NULL, &db, DMU_READ_NO_PREFETCH); - if (err) - return (err); + *zapp = NULL; #ifdef ZFS_DEBUG { @@ -499,7 +498,6 @@ zap_lockdir(objset_t *os, uint64_t obj, * mzap_open() didn't like what it saw on-disk. * Check for corruption! */ - dmu_buf_rele(db, NULL); return (SET_ERROR(EIO)); } } @@ -538,10 +536,12 @@ zap_lockdir(objset_t *os, uint64_t obj, dprintf("upgrading obj %llu: num_entries=%u\n", obj, zap->zap_m.zap_num_entries); *zapp = zap; - return (mzap_upgrade(zapp, tx, 0)); + int err = mzap_upgrade(zapp, tag, tx, 0); + if (err != 0) + rw_exit(&zap->zap_rwlock); + return (err); } - err = dmu_object_set_blocksize(os, obj, newsz, 0, tx); - ASSERT0(err); + VERIFY0(dmu_object_set_blocksize(os, obj, newsz, 0, tx)); zap->zap_m.zap_num_chunks = db->db_size / MZAP_ENT_LEN - 1; } @@ -550,15 +550,31 @@ zap_lockdir(objset_t *os, uint64_t obj, return (0); } +int +zap_lockdir(objset_t *os, uint64_t obj, dmu_tx_t *tx, + krw_t lti, boolean_t fatreader, boolean_t adding, void *tag, zap_t **zapp) +{ + dmu_buf_t *db; + int err; + + err = dmu_buf_hold(os, obj, 0, tag, &db, DMU_READ_NO_PREFETCH); + if (err != 0) + return (err); + err = zap_lockdir_impl(db, tag, tx, lti, fatreader, adding, zapp); + if (err != 0) + dmu_buf_rele(db, tag); + return (err); +} + void -zap_unlockdir(zap_t *zap) +zap_unlockdir(zap_t *zap, void *tag) { rw_exit(&zap->zap_rwlock); - dmu_buf_rele(zap->zap_dbuf, NULL); + dmu_buf_rele(zap->zap_dbuf, tag); } static int -mzap_upgrade(zap_t **zapp, dmu_tx_t *tx, zap_flags_t flags) +mzap_upgrade(zap_t **zapp, void *tag, dmu_tx_t *tx, zap_flags_t flags) { mzap_phys_t *mzp; int i, sz, nchunks; @@ -596,7 +612,8 @@ mzap_upgrade(zap_t **zapp, dmu_tx_t *tx, dprintf("adding %s=%llu\n", mze->mze_name, mze->mze_value); zn = zap_name_alloc(zap, mze->mze_name, MT_EXACT); - err = fzap_add_cd(zn, 8, 1, &mze->mze_value, mze->mze_cd, tx); + err = fzap_add_cd(zn, 8, 1, &mze->mze_value, mze->mze_cd, + tag, tx); zap = zn->zn_zap; /* fzap_add_cd() may change zap */ zap_name_free(zn); if (err) @@ -635,9 +652,9 @@ mzap_create_impl(objset_t *os, uint64_t zap_t *zap; /* Only fat zap supports flags; upgrade immediately. */ VERIFY(0 == zap_lockdir(os, obj, tx, RW_WRITER, - B_FALSE, B_FALSE, &zap)); - VERIFY3U(0, ==, mzap_upgrade(&zap, tx, flags)); - zap_unlockdir(zap); + B_FALSE, B_FALSE, FTAG, &zap)); + VERIFY3U(0, ==, mzap_upgrade(&zap, FTAG, tx, flags)); + zap_unlockdir(zap, FTAG); } } @@ -732,7 +749,7 @@ zap_count(objset_t *os, uint64_t zapobj, zap_t *zap; int err; - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap); + err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); if (err) return (err); if (!zap->zap_ismicro) { @@ -740,7 +757,7 @@ zap_count(objset_t *os, uint64_t zapobj, } else { *count = zap->zap_m.zap_num_entries; } - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -797,25 +814,19 @@ zap_lookup(objset_t *os, uint64_t zapobj num_integers, buf, MT_EXACT, NULL, 0, NULL)); } -int -zap_lookup_norm(objset_t *os, uint64_t zapobj, const char *name, +static int +zap_lookup_impl(zap_t *zap, const char *name, uint64_t integer_size, uint64_t num_integers, void *buf, matchtype_t mt, char *realname, int rn_len, boolean_t *ncp) { - zap_t *zap; - int err; + int err = 0; mzap_ent_t *mze; zap_name_t *zn; - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap); - if (err) - return (err); zn = zap_name_alloc(zap, name, mt); - if (zn == NULL) { - zap_unlockdir(zap); + if (zn == NULL) return (SET_ERROR(ENOTSUP)); - } if (!zap->zap_ismicro) { err = fzap_lookup(zn, integer_size, num_integers, buf, @@ -842,7 +853,24 @@ zap_lookup_norm(objset_t *os, uint64_t z } } zap_name_free(zn); - zap_unlockdir(zap); + return (err); +} + +int +zap_lookup_norm(objset_t *os, uint64_t zapobj, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf, + matchtype_t mt, char *realname, int rn_len, + boolean_t *ncp) +{ + zap_t *zap; + int err; + + err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); + if (err != 0) + return (err); + err = zap_lookup_impl(zap, name, integer_size, + num_integers, buf, mt, realname, rn_len, ncp); + zap_unlockdir(zap, FTAG); return (err); } @@ -854,18 +882,18 @@ zap_prefetch_uint64(objset_t *os, uint64 int err; zap_name_t *zn; - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap); + err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc_uint64(zap, key, key_numints); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } fzap_prefetch(zn); zap_name_free(zn); - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -877,19 +905,19 @@ zap_lookup_uint64(objset_t *os, uint64_t int err; zap_name_t *zn; - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap); + err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc_uint64(zap, key, key_numints); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } err = fzap_lookup(zn, integer_size, num_integers, buf, NULL, 0, NULL); zap_name_free(zn); - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -912,12 +940,12 @@ zap_length(objset_t *os, uint64_t zapobj mzap_ent_t *mze; zap_name_t *zn; - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap); + err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc(zap, name, MT_EXACT); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } if (!zap->zap_ismicro) { @@ -934,7 +962,7 @@ zap_length(objset_t *os, uint64_t zapobj } } zap_name_free(zn); - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -946,17 +974,17 @@ zap_length_uint64(objset_t *os, uint64_t int err; zap_name_t *zn; - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap); + err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc_uint64(zap, key, key_numints); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } err = fzap_length(zn, integer_size, num_integers); zap_name_free(zn); - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -1015,22 +1043,24 @@ zap_add(objset_t *os, uint64_t zapobj, c const uint64_t *intval = val; zap_name_t *zn; - err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, &zap); + err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc(zap, key, MT_EXACT); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } if (!zap->zap_ismicro) { - err = fzap_add(zn, integer_size, num_integers, val, tx); + err = fzap_add(zn, integer_size, num_integers, val, FTAG, tx); zap = zn->zn_zap; /* fzap_add() may change zap */ } else if (integer_size != 8 || num_integers != 1 || strlen(key) >= MZAP_NAME_LEN) { - err = mzap_upgrade(&zn->zn_zap, tx, 0); - if (err == 0) - err = fzap_add(zn, integer_size, num_integers, val, tx); + err = mzap_upgrade(&zn->zn_zap, FTAG, tx, 0); + if (err == 0) { + err = fzap_add(zn, integer_size, num_integers, val, + FTAG, tx); + } zap = zn->zn_zap; /* fzap_add() may change zap */ } else { mze = mze_find(zn); @@ -1043,7 +1073,7 @@ zap_add(objset_t *os, uint64_t zapobj, c ASSERT(zap == zn->zn_zap); zap_name_free(zn); if (zap != NULL) /* may be NULL if fzap_add() failed */ - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -1056,19 +1086,19 @@ zap_add_uint64(objset_t *os, uint64_t za int err; zap_name_t *zn; - err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, &zap); + err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc_uint64(zap, key, key_numints); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } - err = fzap_add(zn, integer_size, num_integers, val, tx); + err = fzap_add(zn, integer_size, num_integers, val, FTAG, tx); zap = zn->zn_zap; /* fzap_add() may change zap */ zap_name_free(zn); if (zap != NULL) /* may be NULL if fzap_add() failed */ - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -1092,25 +1122,27 @@ zap_update(objset_t *os, uint64_t zapobj (void) zap_lookup(os, zapobj, name, 8, 1, &oldval); #endif - err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, &zap); + err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc(zap, name, MT_EXACT); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } if (!zap->zap_ismicro) { - err = fzap_update(zn, integer_size, num_integers, val, tx); + err = fzap_update(zn, integer_size, num_integers, val, + FTAG, tx); zap = zn->zn_zap; /* fzap_update() may change zap */ } else if (integer_size != 8 || num_integers != 1 || strlen(name) >= MZAP_NAME_LEN) { dprintf("upgrading obj %llu: intsz=%u numint=%llu name=%s\n", zapobj, integer_size, num_integers, name); - err = mzap_upgrade(&zn->zn_zap, tx, 0); - if (err == 0) + err = mzap_upgrade(&zn->zn_zap, FTAG, tx, 0); + if (err == 0) { err = fzap_update(zn, integer_size, num_integers, - val, tx); + val, FTAG, tx); + } zap = zn->zn_zap; /* fzap_update() may change zap */ } else { mze = mze_find(zn); @@ -1124,7 +1156,7 @@ zap_update(objset_t *os, uint64_t zapobj ASSERT(zap == zn->zn_zap); zap_name_free(zn); if (zap != NULL) /* may be NULL if fzap_upgrade() failed */ - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -1137,19 +1169,19 @@ zap_update_uint64(objset_t *os, uint64_t zap_name_t *zn; int err; - err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, &zap); + err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc_uint64(zap, key, key_numints); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } - err = fzap_update(zn, integer_size, num_integers, val, tx); + err = fzap_update(zn, integer_size, num_integers, val, FTAG, tx); zap = zn->zn_zap; /* fzap_update() may change zap */ zap_name_free(zn); if (zap != NULL) /* may be NULL if fzap_upgrade() failed */ - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -1168,12 +1200,12 @@ zap_remove_norm(objset_t *os, uint64_t z mzap_ent_t *mze; zap_name_t *zn; - err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, FALSE, &zap); + err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, FALSE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc(zap, name, mt); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } if (!zap->zap_ismicro) { @@ -1190,7 +1222,7 @@ zap_remove_norm(objset_t *os, uint64_t z } } zap_name_free(zn); - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -1202,17 +1234,17 @@ zap_remove_uint64(objset_t *os, uint64_t int err; zap_name_t *zn; - err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, FALSE, &zap); + err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, FALSE, FTAG, &zap); if (err) return (err); zn = zap_name_alloc_uint64(zap, key, key_numints); if (zn == NULL) { - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); } err = fzap_remove(zn, tx); zap_name_free(zn); - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } @@ -1244,7 +1276,7 @@ zap_cursor_fini(zap_cursor_t *zc) { if (zc->zc_zap) { rw_enter(&zc->zc_zap->zap_rwlock, RW_READER); - zap_unlockdir(zc->zc_zap); + zap_unlockdir(zc->zc_zap, NULL); zc->zc_zap = NULL; } if (zc->zc_leaf) { @@ -1291,7 +1323,7 @@ zap_cursor_retrieve(zap_cursor_t *zc, za if (zc->zc_zap == NULL) { int hb; err = zap_lockdir(zc->zc_objset, zc->zc_zapobj, NULL, - RW_READER, TRUE, FALSE, &zc->zc_zap); + RW_READER, TRUE, FALSE, NULL, &zc->zc_zap); if (err) return (err); @@ -1395,7 +1427,7 @@ zap_get_stats(objset_t *os, uint64_t zap int err; zap_t *zap; - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap); + err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); if (err) return (err); @@ -1408,7 +1440,7 @@ zap_get_stats(objset_t *os, uint64_t zap } else { fzap_get_stats(zap, zs); } - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (0); } @@ -1427,7 +1459,7 @@ zap_count_write(objset_t *os, uint64_t z * - 2 blocks for possibly split leaves, * - 2 grown ptrtbl blocks * - * This also accomodates the case where an add operation to a fairly + * This also accommodates the case where an add operation to a fairly * large microzap results in a promotion to fatzap. */ if (name == NULL) { @@ -1440,10 +1472,11 @@ zap_count_write(objset_t *os, uint64_t z * We lock the zap with adding == FALSE. Because, if we pass * the actual value of add, it could trigger a mzap_upgrade(). * At present we are just evaluating the possibility of this operation - * and hence we donot want to trigger an upgrade. + * and hence we do not want to trigger an upgrade. */ - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap); - if (err) + err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, + FTAG, &zap); + if (err != 0) return (err); if (!zap->zap_ismicro) { @@ -1489,6 +1522,6 @@ zap_count_write(objset_t *os, uint64_t z } } - zap_unlockdir(zap); + zap_unlockdir(zap, FTAG); return (err); } From owner-svn-src-head@freebsd.org Sat Sep 3 10:59: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 A31D6BCBF39; Sat, 3 Sep 2016 10:59:06 +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 7DB41BE1; Sat, 3 Sep 2016 10:59:06 +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 u83Ax54c016509; Sat, 3 Sep 2016 10:59:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83Ax5YX016508; Sat, 3 Sep 2016 10:59:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609031059.u83Ax5YX016508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 10:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305339 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 10:59:06 -0000 Author: mav Date: Sat Sep 3 10:59:05 2016 New Revision: 305339 URL: https://svnweb.freebsd.org/changeset/base/305339 Log: MFV r305336: 7247 zfs receive of deduplicated stream fails This resolves two 'zfs recv' issues. First, when receiving into an existing filesystem, a snapshot created during the receive process is not added to the guid->dataset map for the stream, resulting in failed lookups for deduped streams when a WRITE_BYREF record refers to a snapshot received earlier in the stream. Second, the newly created snapshot was also not set properly, referencing the snapshot before the new receiving dataset rather than the existing filesystem. Closes #159 Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Author: Chris Williamson openzfs/openzfs@b09697c8c18be68abfe538de9809938239402ae8 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) 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 Sat Sep 3 10:58:14 2016 (r305338) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Sep 3 10:59:05 2016 (r305339) @@ -3113,6 +3113,9 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t dsl_dataset_phys(origin_head)->ds_flags &= ~DS_FLAG_INCONSISTENT; + drc->drc_newsnapobj = + dsl_dataset_phys(origin_head)->ds_prev_snap_obj; + dsl_dataset_rele(origin_head, FTAG); dsl_destroy_head_sync_impl(drc->drc_ds, tx); @@ -3148,8 +3151,9 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t (void) zap_remove(dp->dp_meta_objset, ds->ds_object, DS_FIELD_RESUME_TONAME, tx); } + drc->drc_newsnapobj = + dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj; } - drc->drc_newsnapobj = dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj; /* * Release the hold from dmu_recv_begin. This must be done before * we return to open context, so that when we free the dataset's dnode, @@ -3191,8 +3195,6 @@ static int dmu_recv_end_modified_blocks static int dmu_recv_existing_end(dmu_recv_cookie_t *drc) { - int error; - #ifdef _KERNEL /* * We will be destroying the ds; make sure its origin is unmounted if @@ -3203,23 +3205,30 @@ dmu_recv_existing_end(dmu_recv_cookie_t zfs_destroy_unmount_origin(name); #endif - error = dsl_sync_task(drc->drc_tofs, + return (dsl_sync_task(drc->drc_tofs, dmu_recv_end_check, dmu_recv_end_sync, drc, - dmu_recv_end_modified_blocks, ZFS_SPACE_CHECK_NORMAL); - - if (error != 0) - dmu_recv_cleanup_ds(drc); - return (error); + dmu_recv_end_modified_blocks, ZFS_SPACE_CHECK_NORMAL)); } static int dmu_recv_new_end(dmu_recv_cookie_t *drc) { + return (dsl_sync_task(drc->drc_tofs, + dmu_recv_end_check, dmu_recv_end_sync, drc, + dmu_recv_end_modified_blocks, ZFS_SPACE_CHECK_NORMAL)); +} + +int +dmu_recv_end(dmu_recv_cookie_t *drc, void *owner) +{ int error; - error = dsl_sync_task(drc->drc_tofs, - dmu_recv_end_check, dmu_recv_end_sync, drc, - dmu_recv_end_modified_blocks, ZFS_SPACE_CHECK_NORMAL); + drc->drc_owner = owner; + + if (drc->drc_newfs) + error = dmu_recv_new_end(drc); + else + error = dmu_recv_existing_end(drc); if (error != 0) { dmu_recv_cleanup_ds(drc); @@ -3231,17 +3240,6 @@ dmu_recv_new_end(dmu_recv_cookie_t *drc) return (error); } -int -dmu_recv_end(dmu_recv_cookie_t *drc, void *owner) -{ - drc->drc_owner = owner; - - if (drc->drc_newfs) - return (dmu_recv_new_end(drc)); - else - return (dmu_recv_existing_end(drc)); -} - /* * Return TRUE if this objset is currently being received into. */ From owner-svn-src-head@freebsd.org Sat Sep 3 11:00: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 C6854BCE008; Sat, 3 Sep 2016 11:00:30 +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 986D5D7C; Sat, 3 Sep 2016 11:00:30 +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 u83B0TOh016659; Sat, 3 Sep 2016 11:00:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83B0TW7016651; Sat, 3 Sep 2016 11:00:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609031100.u83B0TW7016651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 11:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305340 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 11:00:30 -0000 Author: mav Date: Sat Sep 3 11:00:29 2016 New Revision: 305340 URL: https://svnweb.freebsd.org/changeset/base/305340 Log: MFC r305337: 7004 dmu_tx_hold_zap() does dnode_hold() 7x on same object Using a benchmark which has 32 threads creating 2 million files in the same directory, on a machine with 16 CPU cores, I observed poor performance. I noticed that dmu_tx_hold_zap() was using about 30% of all CPU, and doing dnode_hold() 7 times on the same object (the ZAP object that is being held). dmu_tx_hold_zap() keeps a hold on the dnode_t the entire time it is running, in dmu_tx_hold_t:txh_dnode, so it would be nice to use the dnode_t that we already have in hand, rather than repeatedly calling dnode_hold(). To do this, we need to pass the dnode_t down through all the intermediate calls that dmu_tx_hold_zap() makes, making these routines take the dnode_t* rather than an objset_t* and a uint64_t object number. In particular, the following routines will need to have analogous *_by_dnode() variants created: dmu_buf_hold_noread() dmu_buf_hold() zap_lookup() zap_lookup_norm() zap_count_write() zap_lockdir() zap_count_write() This can improve performance on the benchmark described above by 100%, from 30,000 file creations per second to 60,000. (This improvement is on top of that provided by working around the object allocation issue. Peak performance of ~90,000 creations per second was observed with 8 CPUs; adding CPUs past that decreased performance due to lock contention.) The CPU used by dmu_tx_hold_zap() was reduced by 88%, from 340 CPU-seconds to 40 CPU-seconds. Sponsored by: Intel Corp. Closes #109 Reviewed by: Steve Gonczi Reviewed by: George Wilson Reviewed by: Pavel Zakharov Reviewed by: Ned Bass Reviewed by: Brian Behlendorf Author: Matthew Ahrens openzfs/openzfs@d3e523d489a169ab36f9ec1b2a111a60a5563a9f Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Sep 3 10:59:05 2016 (r305339) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Sep 3 11:00:29 2016 (r305340) @@ -2910,6 +2910,21 @@ dmu_buf_get_objset(dmu_buf_t *db) return (dbi->db_objset); } +dnode_t * +dmu_buf_dnode_enter(dmu_buf_t *db) +{ + dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db; + DB_DNODE_ENTER(dbi); + return (DB_DNODE(dbi)); +} + +void +dmu_buf_dnode_exit(dmu_buf_t *db) +{ + dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db; + DB_DNODE_EXIT(dbi); +} + static void dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Sep 3 10:59:05 2016 (r305339) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Sep 3 11:00:29 2016 (r305340) @@ -131,6 +131,26 @@ const dmu_object_byteswap_info_t dmu_ot_ }; int +dmu_buf_hold_noread_by_dnode(dnode_t *dn, uint64_t offset, + void *tag, dmu_buf_t **dbp) +{ + uint64_t blkid; + dmu_buf_impl_t *db; + + blkid = dbuf_whichblock(dn, 0, offset); + rw_enter(&dn->dn_struct_rwlock, RW_READER); + db = dbuf_hold(dn, blkid, tag); + rw_exit(&dn->dn_struct_rwlock); + + if (db == NULL) { + *dbp = NULL; + return (SET_ERROR(EIO)); + } + + *dbp = &db->db; + return (0); +} +int dmu_buf_hold_noread(objset_t *os, uint64_t object, uint64_t offset, void *tag, dmu_buf_t **dbp) { @@ -158,6 +178,29 @@ dmu_buf_hold_noread(objset_t *os, uint64 } int +dmu_buf_hold_by_dnode(dnode_t *dn, uint64_t offset, + void *tag, dmu_buf_t **dbp, int flags) +{ + int err; + int db_flags = DB_RF_CANFAIL; + + if (flags & DMU_READ_NO_PREFETCH) + db_flags |= DB_RF_NOPREFETCH; + + err = dmu_buf_hold_noread_by_dnode(dn, offset, tag, dbp); + if (err == 0) { + dmu_buf_impl_t *db = (dmu_buf_impl_t *)(*dbp); + err = dbuf_read(db, NULL, db_flags); + if (err != 0) { + dbuf_rele(db, tag); + *dbp = NULL; + } + } + + return (err); +} + +int dmu_buf_hold(objset_t *os, uint64_t object, uint64_t offset, void *tag, dmu_buf_t **dbp, int flags) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sat Sep 3 10:59:05 2016 (r305339) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sat Sep 3 11:00:29 2016 (r305340) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -808,15 +808,14 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o * access the name in this fat-zap so that we'll check * for i/o errors to the leaf blocks, etc. */ - err = zap_lookup(dn->dn_objset, dn->dn_object, name, - 8, 0, NULL); + err = zap_lookup_by_dnode(dn, name, 8, 0, NULL); if (err == EIO) { tx->tx_err = err; return; } } - err = zap_count_write(dn->dn_objset, dn->dn_object, name, add, + err = zap_count_write_by_dnode(dn, name, add, &txh->txh_space_towrite, &txh->txh_space_tooverwrite); /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Sep 3 10:59:05 2016 (r305339) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Sep 3 11:00:29 2016 (r305340) @@ -78,6 +78,7 @@ struct file; typedef struct objset objset_t; typedef struct dmu_tx dmu_tx_t; typedef struct dsl_dir dsl_dir_t; +typedef struct dnode dnode_t; typedef enum dmu_object_byteswap { DMU_BSWAP_UINT8, @@ -419,7 +420,7 @@ dmu_write_embedded(objset_t *os, uint64_ #define WP_DMU_SYNC 0x2 #define WP_SPILL 0x4 -void dmu_write_policy(objset_t *os, struct dnode *dn, int level, int wp, +void dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, struct zio_prop *zp); /* * The bonus data is accessed more or less like a regular buffer. @@ -445,7 +446,7 @@ int dmu_rm_spill(objset_t *, uint64_t, d */ int dmu_spill_hold_by_bonus(dmu_buf_t *bonus, void *tag, dmu_buf_t **dbp); -int dmu_spill_hold_by_dnode(struct dnode *dn, uint32_t flags, +int dmu_spill_hold_by_dnode(dnode_t *dn, uint32_t flags, void *tag, dmu_buf_t **dbp); int dmu_spill_hold_existing(dmu_buf_t *bonus, void *tag, dmu_buf_t **dbp); @@ -465,6 +466,8 @@ int dmu_spill_hold_existing(dmu_buf_t *b */ int dmu_buf_hold(objset_t *os, uint64_t object, uint64_t offset, void *tag, dmu_buf_t **, int flags); +int dmu_buf_hold_by_dnode(dnode_t *dn, uint64_t offset, + void *tag, dmu_buf_t **dbp, int flags); /* * Add a reference to a dmu buffer that has already been held via @@ -618,6 +621,8 @@ void *dmu_buf_remove_user(dmu_buf_t *db, void *dmu_buf_get_user(dmu_buf_t *db); objset_t *dmu_buf_get_objset(dmu_buf_t *db); +dnode_t *dmu_buf_dnode_enter(dmu_buf_t *db); +void dmu_buf_dnode_exit(dmu_buf_t *db); /* Block until any in-progress dmu buf user evictions complete. */ void dmu_buf_user_evict_wait(void); @@ -801,7 +806,7 @@ extern const dmu_object_byteswap_info_t */ int dmu_object_info(objset_t *os, uint64_t object, dmu_object_info_t *doi); /* Like dmu_object_info, but faster if you have a held dnode in hand. */ -void dmu_object_info_from_dnode(struct dnode *dn, dmu_object_info_t *doi); +void dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi); /* Like dmu_object_info, but faster if you have a held dbuf in hand. */ void dmu_object_info_from_db(dmu_buf_t *db, dmu_object_info_t *doi); /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sat Sep 3 10:59:05 2016 (r305339) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sat Sep 3 11:00:29 2016 (r305340) @@ -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, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -149,7 +149,7 @@ typedef struct dnode_phys { blkptr_t dn_spill; } dnode_phys_t; -typedef struct dnode { +struct dnode { /* * Protects the structure of the dnode, including the number of levels * of indirection (dn_nlevels), dn_maxblkid, and dn_next_* @@ -247,7 +247,7 @@ typedef struct dnode { /* holds prefetch structure */ struct zfetch dn_zfetch; -} dnode_t; +}; /* * Adds a level of indirection between the dbuf and the dnode to avoid Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Sat Sep 3 10:59:05 2016 (r305339) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Sat Sep 3 11:00:29 2016 (r305340) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #ifndef _SYS_ZAP_H @@ -216,8 +216,14 @@ int zap_lookup_uint64(objset_t *os, uint int zap_contains(objset_t *ds, uint64_t zapobj, const char *name); int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key, int key_numints); +int zap_lookup_by_dnode(dnode_t *dn, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf); +int zap_lookup_norm_by_dnode(dnode_t *dn, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf, + matchtype_t mt, char *realname, int rn_len, + boolean_t *ncp); -int zap_count_write(objset_t *os, uint64_t zapobj, const char *name, +int zap_count_write_by_dnode(dnode_t *dn, const char *name, int add, refcount_t *towrite, refcount_t *tooverwrite); /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Sat Sep 3 10:59:05 2016 (r305339) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Sat Sep 3 11:00:29 2016 (r305340) @@ -270,6 +270,7 @@ zap_table_load(zap_t *zap, zap_table_phy uint64_t blk, off; int err; dmu_buf_t *db; + dnode_t *dn; int bs = FZAP_BLOCK_SHIFT(zap); ASSERT(RW_LOCK_HELD(&zap->zap_rwlock)); @@ -277,8 +278,15 @@ zap_table_load(zap_t *zap, zap_table_phy blk = idx >> (bs-3); off = idx & ((1<<(bs-3))-1); - err = dmu_buf_hold(zap->zap_objset, zap->zap_object, + /* + * Note: this is equivalent to dmu_buf_hold(), but we use + * _dnode_enter / _by_dnode because it's faster because we don't + * have to hold the dnode. + */ + dn = dmu_buf_dnode_enter(zap->zap_dbuf); + err = dmu_buf_hold_by_dnode(dn, (tbl->zt_blk + blk) << bs, FTAG, &db, DMU_READ_NO_PREFETCH); + dmu_buf_dnode_exit(zap->zap_dbuf); if (err) return (err); *valp = ((uint64_t *)db->db_data)[off]; @@ -292,9 +300,11 @@ zap_table_load(zap_t *zap, zap_table_phy */ blk = (idx*2) >> (bs-3); - err = dmu_buf_hold(zap->zap_objset, zap->zap_object, + dn = dmu_buf_dnode_enter(zap->zap_dbuf); + err = dmu_buf_hold_by_dnode(dn, (tbl->zt_nextblk + blk) << bs, FTAG, &db, DMU_READ_NO_PREFETCH); + dmu_buf_dnode_exit(zap->zap_dbuf); if (err == 0) dmu_buf_rele(db, FTAG); } @@ -505,8 +515,10 @@ zap_get_leaf_byblk(zap_t *zap, uint64_t ASSERT(RW_LOCK_HELD(&zap->zap_rwlock)); - err = dmu_buf_hold(zap->zap_objset, zap->zap_object, + dnode_t *dn = dmu_buf_dnode_enter(zap->zap_dbuf); + err = dmu_buf_hold_by_dnode(dn, blkid << bs, NULL, &db, DMU_READ_NO_PREFETCH); + dmu_buf_dnode_exit(zap->zap_dbuf); if (err) return (err); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sat Sep 3 10:59:05 2016 (r305339) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sat Sep 3 11:00:29 2016 (r305340) @@ -550,6 +550,24 @@ zap_lockdir_impl(dmu_buf_t *db, void *ta return (0); } +static int +zap_lockdir_by_dnode(dnode_t *dn, dmu_tx_t *tx, + krw_t lti, boolean_t fatreader, boolean_t adding, void *tag, zap_t **zapp) +{ + dmu_buf_t *db; + int err; + + err = dmu_buf_hold_by_dnode(dn, 0, tag, &db, DMU_READ_NO_PREFETCH); + if (err != 0) { + return (err); + } + err = zap_lockdir_impl(db, tag, tx, lti, fatreader, adding, zapp); + if (err != 0) { + dmu_buf_rele(db, tag); + } + return (err); +} + int zap_lockdir(objset_t *os, uint64_t obj, dmu_tx_t *tx, krw_t lti, boolean_t fatreader, boolean_t adding, void *tag, zap_t **zapp) @@ -875,6 +893,33 @@ zap_lookup_norm(objset_t *os, uint64_t z } int +zap_lookup_by_dnode(dnode_t *dn, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf) +{ + return (zap_lookup_norm_by_dnode(dn, name, integer_size, + num_integers, buf, MT_EXACT, NULL, 0, NULL)); +} + +int +zap_lookup_norm_by_dnode(dnode_t *dn, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf, + matchtype_t mt, char *realname, int rn_len, + boolean_t *ncp) +{ + zap_t *zap; + int err; + + err = zap_lockdir_by_dnode(dn, NULL, RW_READER, TRUE, FALSE, + FTAG, &zap); + if (err != 0) + return (err); + err = zap_lookup_impl(zap, name, integer_size, + num_integers, buf, mt, realname, rn_len, ncp); + zap_unlockdir(zap, FTAG); + return (err); +} + +int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key, int key_numints) { @@ -1445,7 +1490,7 @@ zap_get_stats(objset_t *os, uint64_t zap } int -zap_count_write(objset_t *os, uint64_t zapobj, const char *name, int add, +zap_count_write_by_dnode(dnode_t *dn, const char *name, int add, refcount_t *towrite, refcount_t *tooverwrite) { zap_t *zap; @@ -1474,7 +1519,7 @@ zap_count_write(objset_t *os, uint64_t z * At present we are just evaluating the possibility of this operation * and hence we do not want to trigger an upgrade. */ - err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, + err = zap_lockdir_by_dnode(dn, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); if (err != 0) return (err); From owner-svn-src-head@freebsd.org Sat Sep 3 11:17: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 DC896BCE612; Sat, 3 Sep 2016 11:17:34 +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 ACCCCA2D; Sat, 3 Sep 2016 11:17:34 +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 u83BHXSA024378; Sat, 3 Sep 2016 11:17:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83BHXhC024377; Sat, 3 Sep 2016 11:17:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201609031117.u83BHXhC024377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Sep 2016 11:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305342 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 11:17:35 -0000 Author: mav Date: Sat Sep 3 11:17:33 2016 New Revision: 305342 URL: https://svnweb.freebsd.org/changeset/base/305342 Log: Missed FreeBSD-specific piece of r305338. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sat Sep 3 11:09:47 2016 (r305341) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Sat Sep 3 11:17:33 2016 (r305342) @@ -1435,7 +1435,7 @@ zap_cursor_move_to_key(zap_cursor_t *zc, if (zc->zc_zap == NULL) { err = zap_lockdir(zc->zc_objset, zc->zc_zapobj, NULL, - RW_READER, TRUE, FALSE, &zc->zc_zap); + RW_READER, TRUE, FALSE, FTAG, &zc->zc_zap); if (err) return (err); } else { From owner-svn-src-head@freebsd.org Sat Sep 3 13: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 AFAECBCB267; Sat, 3 Sep 2016 13:01:38 +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 7D1773F9; Sat, 3 Sep 2016 13:01:38 +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 u83D1bnf062053; Sat, 3 Sep 2016 13:01:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83D1b5j062052; Sat, 3 Sep 2016 13:01:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609031301.u83D1b5j062052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 3 Sep 2016 13:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305343 - head/sys/boot/mips/uboot 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.22 Precedence: list List-Id: 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, 03 Sep 2016 13:01:38 -0000 Author: emaste Date: Sat Sep 3 13:01:37 2016 New Revision: 305343 URL: https://svnweb.freebsd.org/changeset/base/305343 Log: remove CONSTRUCTORS from MIPS uboot linker script The linker script CONSTRUCTORS keyword is only meaningful "when linking object file formats which do not support arbitrary sections, such as ECOFF and XCOFF"[1] and is ignored for other object file formats. LLVM's lld does not yet accept (and ignore) CONSTRUCTORS, so just remove CONSTRUCTORS from the linker script as it has no effect. [1] https://sourceware.org/binutils/docs/ld/Output-Section-Keywords.html Modified: head/sys/boot/mips/uboot/ldscript.mips Modified: head/sys/boot/mips/uboot/ldscript.mips ============================================================================== --- head/sys/boot/mips/uboot/ldscript.mips Sat Sep 3 11:17:33 2016 (r305342) +++ head/sys/boot/mips/uboot/ldscript.mips Sat Sep 3 13:01:37 2016 (r305343) @@ -55,7 +55,6 @@ SECTIONS { *(.data) *(.gnu.linkonce.d*) - CONSTRUCTORS } .data1 : { *(.data1) } .got1 : { *(.got1) } From owner-svn-src-head@freebsd.org Sat Sep 3 13:33: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 A47B1BCB93C; Sat, 3 Sep 2016 13:33:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72737379; Sat, 3 Sep 2016 13:33:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83DXSeR075880; Sat, 3 Sep 2016 13:33:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83DXS77075879; Sat, 3 Sep 2016 13:33:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609031333.u83DXS77075879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Sep 2016 13:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305344 - head/sys/dev/drm2 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.22 Precedence: list List-Id: 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, 03 Sep 2016 13:33:29 -0000 Author: dim Date: Sat Sep 3 13:33:28 2016 New Revision: 305344 URL: https://svnweb.freebsd.org/changeset/base/305344 Log: Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and portable way. Reviewed by: dumbbell MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7770 Modified: head/sys/dev/drm2/drmP.h Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Sat Sep 3 13:01:37 2016 (r305343) +++ head/sys/dev/drm2/drmP.h Sat Sep 3 13:33:28 2016 (r305344) @@ -103,8 +103,16 @@ __FBSDID("$FreeBSD$"); #include -#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) -#define __OS_HAS_MTRR (defined(CONFIG_MTRR)) +#if defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)) +#define __OS_HAS_AGP 1 +#else +#define __OS_HAS_AGP 0 +#endif +#if defined(CONFIG_MTRR) +#define __OS_HAS_MTRR 1 +#else +#define __OS_HAS_MTRR 0 +#endif struct drm_file; struct drm_device; From owner-svn-src-head@freebsd.org Sat Sep 3 13:48: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 C7133BCBE44; Sat, 3 Sep 2016 13:48:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0A84D85; Sat, 3 Sep 2016 13:48:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83DmiRo079702; Sat, 3 Sep 2016 13:48:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83DmimZ079699; Sat, 3 Sep 2016 13:48:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609031348.u83DmimZ079699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Sep 2016 13:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305345 - head/sys/dev/ppbus 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.22 Precedence: list List-Id: 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, 03 Sep 2016 13:48:45 -0000 Author: dim Date: Sat Sep 3 13:48:44 2016 New Revision: 305345 URL: https://svnweb.freebsd.org/changeset/base/305345 Log: With clang 3.9.0, compiling ppbus(4) results in the following warnings: sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int' to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion] if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) { ~~~~~~~~~~~~~~~~~~ ~~~~~~~^~~~~~~ sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int' to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion] if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY, ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int' to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion] nACK | SELECT | PERROR | nBUSY)) { ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ This is because nBUSY is 0x80, so the plain char argument is wrapped to a negative value. Fix this in a minimal fashion, by using uint8_t in a few places. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7771 Modified: head/sys/dev/ppbus/ppb_1284.c head/sys/dev/ppbus/ppb_base.c head/sys/dev/ppbus/ppbconf.h Modified: head/sys/dev/ppbus/ppb_1284.c ============================================================================== --- head/sys/dev/ppbus/ppb_1284.c Sat Sep 3 13:33:28 2016 (r305344) +++ head/sys/dev/ppbus/ppb_1284.c Sat Sep 3 13:48:44 2016 (r305345) @@ -57,13 +57,13 @@ __FBSDID("$FreeBSD$"); * Wait for the peripherial up to 40ms */ static int -do_1284_wait(device_t bus, char mask, char status) +do_1284_wait(device_t bus, uint8_t mask, uint8_t status) { return (ppb_poll_bus(bus, 4, mask, status, PPB_NOINTR | PPB_POLL)); } static int -do_peripheral_wait(device_t bus, char mask, char status) +do_peripheral_wait(device_t bus, uint8_t mask, uint8_t status) { return (ppb_poll_bus(bus, 100, mask, status, PPB_NOINTR | PPB_POLL)); } Modified: head/sys/dev/ppbus/ppb_base.c ============================================================================== --- head/sys/dev/ppbus/ppb_base.c Sat Sep 3 13:33:28 2016 (r305344) +++ head/sys/dev/ppbus/ppb_base.c Sat Sep 3 13:48:44 2016 (r305345) @@ -54,11 +54,11 @@ MODULE_VERSION(ppbus, 1); */ int ppb_poll_bus(device_t bus, int max, - char mask, char status, int how) + uint8_t mask, uint8_t status, int how) { struct ppb_data *ppb = DEVTOSOFTC(bus); int i, j, error; - char r; + uint8_t r; ppb_assert_locked(bus); @@ -186,7 +186,7 @@ ppb_ecp_sync(device_t bus) int ppb_get_status(device_t bus, struct ppb_status *status) { - register char r; + uint8_t r; ppb_assert_locked(bus); Modified: head/sys/dev/ppbus/ppbconf.h ============================================================================== --- head/sys/dev/ppbus/ppbconf.h Sat Sep 3 13:33:28 2016 (r305344) +++ head/sys/dev/ppbus/ppbconf.h Sat Sep 3 13:48:44 2016 (r305345) @@ -263,7 +263,7 @@ extern void _ppb_assert_locked(device_t, extern void ppb_init_callout(device_t, struct callout *, int); extern int ppb_sleep(device_t, void *, int, const char *, int); extern int ppb_get_status(device_t, struct ppb_status *); -extern int ppb_poll_bus(device_t, int, char, char, int); +extern int ppb_poll_bus(device_t, int, uint8_t, uint8_t, int); extern int ppb_reset_epp_timeout(device_t); extern int ppb_ecp_sync(device_t); extern int ppb_get_epp_protocol(device_t); From owner-svn-src-head@freebsd.org Sat Sep 3 15:22: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 83B98BCE42E; Sat, 3 Sep 2016 15:22:51 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 30666A34; Sat, 3 Sep 2016 15:22:51 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83FMox7017037; Sat, 3 Sep 2016 15:22:50 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83FMoLe017036; Sat, 3 Sep 2016 15:22:50 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201609031522.u83FMoLe017036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 3 Sep 2016 15:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305349 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 15:22:51 -0000 Author: jmcneill Date: Sat Sep 3 15:22:50 2016 New Revision: 305349 URL: https://svnweb.freebsd.org/changeset/base/305349 Log: Add support for reading root key on A83T/A64. Modified: head/sys/arm/allwinner/aw_sid.c Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Sat Sep 3 15:08:46 2016 (r305348) +++ head/sys/arm/allwinner/aw_sid.c Sat Sep 3 15:22:50 2016 (r305349) @@ -52,6 +52,11 @@ __FBSDID("$FreeBSD$"); #define SID_THERMAL_CALIB0 (SID_SRAM + 0x34) #define SID_THERMAL_CALIB1 (SID_SRAM + 0x38) +#define A10_ROOT_KEY_OFF 0x0 +#define A83T_ROOT_KEY_OFF SID_SRAM + +#define ROOT_KEY_SIZE 4 + enum sid_type { A10_SID = 1, A20_SID, @@ -67,7 +72,8 @@ static struct ofw_compat_data compat_dat struct aw_sid_softc { struct resource *res; - int type; + int type; + bus_size_t root_key_off; }; static struct aw_sid_softc *aw_sid_sc; @@ -81,9 +87,6 @@ enum sid_keys { AW_SID_ROOT_KEY, }; -#define ROOT_KEY_OFF 0x0 -#define ROOT_KEY_SIZE 4 - #define RD4(sc, reg) bus_read_4((sc)->res, (reg)) #define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) @@ -118,17 +121,20 @@ aw_sid_attach(device_t dev) sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; switch (sc->type) { - case A10_SID: - case A20_SID: - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "rootkey", - CTLTYPE_STRING | CTLFLAG_RD, - dev, AW_SID_ROOT_KEY, aw_sid_sysctl, "A", "Root Key"); + case A83T_SID: + sc->root_key_off = A83T_ROOT_KEY_OFF; break; default: + sc->root_key_off = A10_ROOT_KEY_OFF; break; } + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "rootkey", + CTLTYPE_STRING | CTLFLAG_RD, + dev, AW_SID_ROOT_KEY, aw_sid_sysctl, "A", "Root Key"); + return (0); } @@ -159,11 +165,9 @@ aw_sid_get_rootkey(u_char *out) sc = aw_sid_sc; if (sc == NULL) return (ENXIO); - if (sc->type != A10_SID && sc->type != A20_SID) - return (ENXIO); for (i = 0; i < ROOT_KEY_SIZE ; i++) { - tmp = RD4(aw_sid_sc, ROOT_KEY_OFF + (i * 4)); + tmp = RD4(aw_sid_sc, aw_sid_sc->root_key_off + (i * 4)); be32enc(&out[i * 4], tmp); } From owner-svn-src-head@freebsd.org Sat Sep 3 15: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 93BDEBCE4A2; Sat, 3 Sep 2016 15:24:00 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6356FBC4; Sat, 3 Sep 2016 15:24:00 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83FNxda017115; Sat, 3 Sep 2016 15:23:59 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83FNxuZ017114; Sat, 3 Sep 2016 15:23:59 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201609031523.u83FNxuZ017114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 3 Sep 2016 15:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305350 - head/sys/boot/fdt/dts/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.22 Precedence: list List-Id: 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, 03 Sep 2016 15:24:00 -0000 Author: jmcneill Date: Sat Sep 3 15:23:59 2016 New Revision: 305350 URL: https://svnweb.freebsd.org/changeset/base/305350 Log: Add SID, THS, and CPU operating points. Modified: head/sys/boot/fdt/dts/arm64/a64.dtsi Modified: head/sys/boot/fdt/dts/arm64/a64.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm64/a64.dtsi Sat Sep 3 15:22:50 2016 (r305349) +++ head/sys/boot/fdt/dts/arm64/a64.dtsi Sat Sep 3 15:23:59 2016 (r305350) @@ -27,6 +27,21 @@ */ / { + cpus { + cpu@0 { + clocks = <&cpu>; + clock-latency = <2000000>; + operating-points = < + /* kHz uV */ + 1200000 1300000 + 1008000 1200000 + 816000 1100000 + 648000 1040000 + 408000 1040000 + >; + }; + }; + clocks { pll_hsic: clk@01c20044 { #clock-cells = <0>; @@ -49,6 +64,14 @@ "usb_hsic_pll", "usb_hsic_12m", "usb_otg_ohci", "usb_ohci0"; }; + + ths_clk: clk@01c20074 { + #clock-cells = <0>; + compatible = "allwinner,sun50i-a64-ths-clk"; + reg = <0x01c20074 0x4>; + clocks = <&osc24M>; + clock-output-names = "ths"; + }; }; soc { @@ -79,6 +102,21 @@ #size-cells = <0>; }; + sid: eeprom@01c14000 { + compatible = "allwinner,sun8i-a83t-sid"; + reg = <0x01c14000 0x400>; + }; + + rtp: rtp@01c25000 { + compatible = "allwinner,sun50i-a64-ts"; + reg = <0x01c25000 0x400>; + interrupts = ; + clocks = <&bus_gates 72>, <&ths_clk>; + clock-names = "ahb", "ths"; + resets = <&ahb_rst 136>; + #thermal-sensor-cells = <0>; + }; + usbphy: phy@01c19400 { compatible = "allwinner,sun50i-a64-usb-phy"; reg = <0x01c19400 0x24 0x01c1a800 0x4 0x01c1b800 0x4>; From owner-svn-src-head@freebsd.org Sat Sep 3 15:24: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 3036BBCE4FA; Sat, 3 Sep 2016 15:24:31 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 01483D32; Sat, 3 Sep 2016 15:24:30 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83FOUQT017178; Sat, 3 Sep 2016 15:24:30 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83FOUUO017177; Sat, 3 Sep 2016 15:24:30 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201609031524.u83FOUUO017177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 3 Sep 2016 15:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305351 - head/sys/boot/fdt/dts/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.22 Precedence: list List-Id: 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, 03 Sep 2016 15:24:31 -0000 Author: jmcneill Date: Sat Sep 3 15:24:30 2016 New Revision: 305351 URL: https://svnweb.freebsd.org/changeset/base/305351 Log: Add cpu-supply xref to cpu@0 Modified: head/sys/boot/fdt/dts/arm64/pine64_plus.dts Modified: head/sys/boot/fdt/dts/arm64/pine64_plus.dts ============================================================================== --- head/sys/boot/fdt/dts/arm64/pine64_plus.dts Sat Sep 3 15:23:59 2016 (r305350) +++ head/sys/boot/fdt/dts/arm64/pine64_plus.dts Sat Sep 3 15:24:30 2016 (r305351) @@ -31,6 +31,14 @@ #include +/ { + cpus { + cpu@0 { + cpu-supply = <®_dcdc2>; + }; + }; +}; + &pio { emac_phy_reset_pin_pine64_plus: emac_phy_reset_pin@0 { allwinner,pins = "PD14"; @@ -64,6 +72,10 @@ reg_dc1dc: dc1sw { regulator-name = "dc1sw"; }; + + reg_dcdc2: dcdc2 { + regulator-name = "dcdc2"; + }; }; }; }; From owner-svn-src-head@freebsd.org Sat Sep 3 15:26: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 4899EBCE5E0; Sat, 3 Sep 2016 15:26:02 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 13891EFF; Sat, 3 Sep 2016 15:26:02 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83FQ1Zg017294; Sat, 3 Sep 2016 15:26:01 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83FQ1DD017290; Sat, 3 Sep 2016 15:26:01 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201609031526.u83FQ1DD017290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 3 Sep 2016 15:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305352 - in head/sys: arm/allwinner arm/allwinner/clk arm64/conf 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.22 Precedence: list List-Id: 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, 03 Sep 2016 15:26:02 -0000 Author: jmcneill Date: Sat Sep 3 15:26:00 2016 New Revision: 305352 URL: https://svnweb.freebsd.org/changeset/base/305352 Log: Add support for Allwinner A64 thermal sensors. Added: head/sys/arm/allwinner/clk/aw_thsclk.c (contents, props changed) Modified: head/sys/arm/allwinner/aw_thermal.c head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- head/sys/arm/allwinner/aw_thermal.c Sat Sep 3 15:24:30 2016 (r305351) +++ head/sys/arm/allwinner/aw_thermal.c Sat Sep 3 15:26:00 2016 (r305352) @@ -39,15 +39,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include +#include + #include #define THS_CTRL0 0x00 +#define THS_CTRL1 0x04 +#define ADC_CALI_EN (1 << 17) #define THS_CTRL2 0x40 #define SENSOR_ACQ1_SHIFT 16 #define SENSOR2_EN (1 << 2) @@ -55,8 +61,16 @@ __FBSDID("$FreeBSD$"); #define SENSOR0_EN (1 << 0) #define THS_INTC 0x44 #define THS_INTS 0x48 +#define THS2_DATA_IRQ_STS (1 << 10) +#define THS1_DATA_IRQ_STS (1 << 9) +#define THS0_DATA_IRQ_STS (1 << 8) +#define SHUT_INT2_STS (1 << 6) +#define SHUT_INT1_STS (1 << 5) +#define SHUT_INT0_STS (1 << 4) +#define ALARM_INT2_STS (1 << 2) +#define ALARM_INT1_STS (1 << 1) +#define ALARM_INT0_STS (1 << 0) #define THS_FILTER 0x70 -#define FILTER_EN (1 << 2) #define THS_CALIB0 0x74 #define THS_CALIB1 0x78 #define THS_DATA0 0x80 @@ -64,38 +78,93 @@ __FBSDID("$FreeBSD$"); #define THS_DATA2 0x88 #define DATA_MASK 0xfff -#define TEMP_BASE 2719 -#define TEMP_MUL 1000 -#define TEMP_DIV 14186 -#define TEMP_TO_K 273 -#define ADC_ACQUIRE_TIME (24 - 1) +#define A83T_ADC_ACQUIRE_TIME 0x17 +#define A83T_FILTER 0x4 +#define A83T_INTC 0x1000 +#define A83T_TEMP_BASE 2719000 +#define A83T_TEMP_DIV 14186 +#define A83T_CLK_RATE 24000000 + +#define A64_ADC_ACQUIRE_TIME 0x190 +#define A64_FILTER 0x6 +#define A64_INTC 0x18000 +#define A64_TEMP_BASE 2170000 +#define A64_TEMP_DIV 8560 +#define A64_CLK_RATE 4000000 + +#define TEMP_C_TO_K 273 #define SENSOR_ENABLE_ALL (SENSOR0_EN|SENSOR1_EN|SENSOR2_EN) +#define SHUT_INT_ALL (SHUT_INT0_STS|SHUT_INT1_STS|SHUT_INT2_STS) -enum aw_thermal_sensor { - THS_SENSOR_CPU_CLUSTER0, - THS_SENSOR_CPU_CLUSTER1, - THS_SENSOR_GPU, - THS_SENSOR_END = -1 -}; +#define MAX_SENSORS 3 -struct aw_thermal_sensor_config { - enum aw_thermal_sensor sensor; +struct aw_thermal_sensor { const char *name; const char *desc; }; -static const struct aw_thermal_sensor_config a83t_sensor_config[] = { - { .sensor = THS_SENSOR_CPU_CLUSTER0, - .name = "cluster0", .desc = "CPU cluster 0 temperature" }, - { .sensor = THS_SENSOR_CPU_CLUSTER1, - .name = "cluster1", .desc = "CPU cluster 1 temperature" }, - { .sensor = THS_SENSOR_GPU, - .name = "gpu", .desc = "GPU temperature" }, - { .sensor = THS_SENSOR_END } +struct aw_thermal_config { + struct aw_thermal_sensor sensors[MAX_SENSORS]; + int nsensors; + uint64_t clk_rate; + uint32_t adc_acquire_time; + uint32_t filter; + uint32_t intc; + uint32_t temp_base; + uint32_t temp_div; +}; + +static const struct aw_thermal_config a83t_config = { + .nsensors = 3, + .sensors = { + [0] = { + .name = "cluster0", + .desc = "CPU cluster 0 temperature", + }, + [1] = { + .name = "cluster1", + .desc = "CPU cluster 1 temperature", + }, + [2] = { + .name = "gpu", + .desc = "GPU temperature", + }, + }, + .clk_rate = A83T_CLK_RATE, + .adc_acquire_time = A83T_ADC_ACQUIRE_TIME, + .filter = A83T_FILTER, + .intc = A83T_INTC, + .temp_base = A83T_TEMP_BASE, + .temp_div = A83T_TEMP_DIV, +}; + +static const struct aw_thermal_config a64_config = { + .nsensors = 3, + .sensors = { + [0] = { + .name = "cpu", + .desc = "CPU temperature", + }, + [1] = { + .name = "gpu1", + .desc = "GPU temperature 1", + }, + [2] = { + .name = "gpu2", + .desc = "GPU temperature 2", + }, + }, + .clk_rate = A64_CLK_RATE, + .adc_acquire_time = A64_ADC_ACQUIRE_TIME, + .filter = A64_FILTER, + .intc = A64_INTC, + .temp_base = A64_TEMP_BASE, + .temp_div = A64_TEMP_DIV, }; static struct ofw_compat_data compat_data[] = { - { "allwinner,sun8i-a83t-ts", (uintptr_t)&a83t_sensor_config }, + { "allwinner,sun8i-a83t-ts", (uintptr_t)&a83t_config }, + { "allwinner,sun50i-a64-ts", (uintptr_t)&a64_config }, { NULL, (uintptr_t)NULL } }; @@ -103,17 +172,18 @@ static struct ofw_compat_data compat_dat (void *)ofw_bus_search_compatible((d), compat_data)->ocd_data struct aw_thermal_softc { - struct resource *res; - struct aw_thermal_sensor_config *conf; + struct resource *res[2]; + struct aw_thermal_config *conf; }; static struct resource_spec aw_thermal_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, { -1, 0 } }; -#define RD4(sc, reg) bus_read_4((sc)->res, (reg)) -#define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) +#define RD4(sc, reg) bus_read_4((sc)->res[0], (reg)) +#define WR4(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) static int aw_thermal_init(struct aw_thermal_softc *sc) @@ -131,44 +201,73 @@ aw_thermal_init(struct aw_thermal_softc WR4(sc, THS_CALIB1, calib1); /* Configure ADC acquire time (CLK_IN/(N+1)) and enable sensors */ - WR4(sc, THS_CTRL0, ADC_ACQUIRE_TIME); - WR4(sc, THS_CTRL2, (ADC_ACQUIRE_TIME << SENSOR_ACQ1_SHIFT) | - SENSOR_ENABLE_ALL); + WR4(sc, THS_CTRL1, ADC_CALI_EN); + WR4(sc, THS_CTRL0, sc->conf->adc_acquire_time); + WR4(sc, THS_CTRL2, sc->conf->adc_acquire_time << SENSOR_ACQ1_SHIFT); + + /* Enable average filter */ + WR4(sc, THS_FILTER, sc->conf->filter); - /* Disable interrupts */ - WR4(sc, THS_INTC, 0); + /* Enable interrupts */ WR4(sc, THS_INTS, RD4(sc, THS_INTS)); + WR4(sc, THS_INTC, sc->conf->intc | SHUT_INT_ALL); - /* Enable average filter */ - WR4(sc, THS_FILTER, RD4(sc, THS_FILTER) | FILTER_EN); + /* Enable sensors */ + WR4(sc, THS_CTRL2, RD4(sc, THS_CTRL2) | SENSOR_ENABLE_ALL); return (0); } static int -aw_thermal_gettemp(uint32_t val) +aw_thermal_reg_to_temp(struct aw_thermal_softc *sc, uint32_t val) +{ + return ((sc->conf->temp_base - val * 1000) / sc->conf->temp_div); +} + +static int +aw_thermal_gettemp(struct aw_thermal_softc *sc, int sensor) { - int raw; + uint32_t val; + + val = RD4(sc, THS_DATA0 + (sensor * 4)); - raw = val & DATA_MASK; - return (((TEMP_BASE - raw) * TEMP_MUL) / TEMP_DIV) + TEMP_TO_K; + return (aw_thermal_reg_to_temp(sc, val) + TEMP_C_TO_K); } static int aw_thermal_sysctl(SYSCTL_HANDLER_ARGS) { struct aw_thermal_softc *sc; - enum aw_thermal_sensor sensor; - int val; + int sensor, val; sc = arg1; sensor = arg2; - val = aw_thermal_gettemp(RD4(sc, THS_DATA0 + (sensor * 4))); + val = aw_thermal_gettemp(sc, sensor); return sysctl_handle_opaque(oidp, &val, sizeof(val), req); } +static void +aw_thermal_intr(void *arg) +{ + struct aw_thermal_softc *sc; + device_t dev; + uint32_t ints; + + dev = arg; + sc = device_get_softc(dev); + + ints = RD4(sc, THS_INTS); + WR4(sc, THS_INTS, ints); + + if ((ints & SHUT_INT_ALL) != 0) { + device_printf(dev, + "WARNING - current temperature exceeds safe limits\n"); + shutdown_nice(RB_POWEROFF); + } +} + static int aw_thermal_probe(device_t dev) { @@ -186,29 +285,82 @@ static int aw_thermal_attach(device_t dev) { struct aw_thermal_softc *sc; - int i; + clk_t clk_ahb, clk_ths; + hwreset_t rst; + int i, error; + void *ih; sc = device_get_softc(dev); + clk_ahb = clk_ths = NULL; + rst = NULL; + ih = NULL; sc->conf = THS_CONF(dev); - if (bus_alloc_resources(dev, aw_thermal_spec, &sc->res) != 0) { + if (bus_alloc_resources(dev, aw_thermal_spec, sc->res) != 0) { device_printf(dev, "cannot allocate resources for device\n"); return (ENXIO); } + if (clk_get_by_ofw_name(dev, 0, "ahb", &clk_ahb) == 0) { + error = clk_enable(clk_ahb); + if (error != 0) { + device_printf(dev, "cannot enable ahb clock\n"); + goto fail; + } + } + if (clk_get_by_ofw_name(dev, 0, "ths", &clk_ths) == 0) { + error = clk_set_freq(clk_ths, sc->conf->clk_rate, 0); + if (error != 0) { + device_printf(dev, "cannot set ths clock rate\n"); + goto fail; + } + error = clk_enable(clk_ths); + if (error != 0) { + device_printf(dev, "cannot enable ths clock\n"); + goto fail; + } + } + if (hwreset_get_by_ofw_idx(dev, 0, 0, &rst) == 0) { + error = hwreset_deassert(rst); + if (error != 0) { + device_printf(dev, "cannot de-assert reset\n"); + goto fail; + } + } + + error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, aw_thermal_intr, dev, &ih); + if (error != 0) { + device_printf(dev, "cannot setup interrupt handler\n"); + goto fail; + } + if (aw_thermal_init(sc) != 0) - return (ENXIO); + goto fail; - for (i = 0; sc->conf[i].sensor != THS_SENSOR_END; i++) + for (i = 0; i < sc->conf->nsensors; i++) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, sc->conf[i].name, + OID_AUTO, sc->conf->sensors[i].name, CTLTYPE_INT | CTLFLAG_RD, - sc, sc->conf[i].sensor, aw_thermal_sysctl, "IK0", - sc->conf[i].desc); + sc, i, aw_thermal_sysctl, "IK0", + sc->conf->sensors[i].desc); return (0); + +fail: + if (ih != NULL) + bus_teardown_intr(dev, sc->res[1], ih); + if (rst != NULL) + hwreset_release(rst); + if (clk_ahb != NULL) + clk_release(clk_ahb); + if (clk_ths != NULL) + clk_release(clk_ths); + bus_release_resources(dev, aw_thermal_spec, sc->res); + + return (ENXIO); } static device_method_t aw_thermal_methods[] = { Added: head/sys/arm/allwinner/clk/aw_thsclk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clk/aw_thsclk.c Sat Sep 3 15:26:00 2016 (r305352) @@ -0,0 +1,320 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * 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$ + */ + +/* + * Allwinner THS clocks + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "clkdev_if.h" + +#define SCLK_GATING (1 << 31) +#define CLK_SRC_SEL (0x3 << 24) +#define CLK_SRC_SEL_SHIFT 24 +#define CLK_SRC_SEL_MAX 1 +#define CLK_DIV_RATIO (0x3 << 0) +#define CLK_DIV_RATIO_SHIFT 0 +#define CLK_DIV_RATIO_MAX 3 + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun50i-a64-ths-clk", 1 }, + { NULL, 0 } +}; + +struct aw_thsclk_sc { + device_t clkdev; + bus_addr_t reg; +}; + +#define THSCLK_READ(sc, val) CLKDEV_READ_4((sc)->clkdev, (sc)->reg, (val)) +#define THSCLK_WRITE(sc, val) CLKDEV_WRITE_4((sc)->clkdev, (sc)->reg, (val)) +#define DEVICE_LOCK(sc) CLKDEV_DEVICE_LOCK((sc)->clkdev) +#define DEVICE_UNLOCK(sc) CLKDEV_DEVICE_UNLOCK((sc)->clkdev) + +static int +aw_thsclk_init(struct clknode *clk, device_t dev) +{ + struct aw_thsclk_sc *sc; + uint32_t val, index; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(sc); + THSCLK_READ(sc, &val); + DEVICE_UNLOCK(sc); + + index = (val & CLK_SRC_SEL) >> CLK_SRC_SEL_SHIFT; + + clknode_init_parent_idx(clk, index); + return (0); +} + +static int +aw_thsclk_set_mux(struct clknode *clk, int index) +{ + struct aw_thsclk_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if (index < 0 || index >= CLK_SRC_SEL_MAX) + return (ERANGE); + + DEVICE_LOCK(sc); + THSCLK_READ(sc, &val); + val &= ~CLK_SRC_SEL; + val |= (index << CLK_SRC_SEL_SHIFT); + THSCLK_WRITE(sc, val); + DEVICE_UNLOCK(sc); + + return (0); +} + +static int +aw_thsclk_set_gate(struct clknode *clk, bool enable) +{ + struct aw_thsclk_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(sc); + THSCLK_READ(sc, &val); + if (enable) + val |= SCLK_GATING; + else + val &= ~SCLK_GATING; + THSCLK_WRITE(sc, val); + DEVICE_UNLOCK(sc); + + return (0); +} + +static int +aw_thsclk_recalc_freq(struct clknode *clk, uint64_t *freq) +{ + struct aw_thsclk_sc *sc; + uint32_t val, div; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(sc); + THSCLK_READ(sc, &val); + DEVICE_UNLOCK(sc); + + switch (val & CLK_DIV_RATIO) { + case 3: + div = 6; + break; + default: + div = 1 << (val & CLK_DIV_RATIO); + break; + } + + *freq = *freq / div; + + return (0); +} + +static int +aw_thsclk_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, + int flags, int *stop) +{ + struct aw_thsclk_sc *sc; + uint32_t val, div, n, best_div, best_n; + uint64_t cur_freq; + int64_t best_diff, cur_diff; + + sc = clknode_get_softc(clk); + best_diff = (int64_t)*fout; + best_n = 0; + + for (div = 0; div <= CLK_DIV_RATIO_MAX; div++) { + n = (div == 3) ? 6 : (1 << div); + cur_freq = fin / n; + cur_diff = (int64_t)*fout - cur_freq; + if (cur_diff >= 0 && cur_diff < best_diff) { + best_diff = cur_diff; + best_div = div; + best_n = n; + } + } + + if (best_diff == (int64_t)*fout || best_n == 0) + return (ERANGE); + + DEVICE_LOCK(sc); + THSCLK_READ(sc, &val); + val &= ~CLK_DIV_RATIO; + val |= (best_div << CLK_DIV_RATIO_SHIFT); + THSCLK_WRITE(sc, val); + DEVICE_UNLOCK(sc); + + *fout = fin / best_n; + *stop = 1; + + return (0); +} + +static clknode_method_t aw_thsclk_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, aw_thsclk_init), + CLKNODEMETHOD(clknode_set_gate, aw_thsclk_set_gate), + CLKNODEMETHOD(clknode_set_mux, aw_thsclk_set_mux), + CLKNODEMETHOD(clknode_recalc_freq, aw_thsclk_recalc_freq), + CLKNODEMETHOD(clknode_set_freq, aw_thsclk_set_freq), + CLKNODEMETHOD_END +}; +DEFINE_CLASS_1(aw_thsclk_clknode, aw_thsclk_clknode_class, + aw_thsclk_clknode_methods, sizeof(struct aw_thsclk_sc), clknode_class); + +static int +aw_thsclk_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner THS Clock"); + return (BUS_PROBE_DEFAULT); +} + +static int +aw_thsclk_attach(device_t dev) +{ + struct clknode_init_def def; + struct aw_thsclk_sc *sc; + struct clkdom *clkdom; + struct clknode *clk; + clk_t clk_parent; + bus_addr_t paddr; + bus_size_t psize; + phandle_t node; + int error, ncells, i; + + node = ofw_bus_get_node(dev); + + if (ofw_reg_to_paddr(node, 0, &paddr, &psize, NULL) != 0) { + device_printf(dev, "cannot parse 'reg' property\n"); + return (ENXIO); + } + + error = ofw_bus_parse_xref_list_get_length(node, "clocks", + "#clock-cells", &ncells); + if (error != 0) { + device_printf(dev, "cannot get clock count\n"); + return (error); + } + + clkdom = clkdom_create(dev); + + memset(&def, 0, sizeof(def)); + error = clk_parse_ofw_clk_name(dev, node, &def.name); + if (error != 0) { + device_printf(dev, "cannot parse clock name\n"); + error = ENXIO; + goto fail; + } + def.id = 1; + def.parent_names = malloc(sizeof(char *) * ncells, M_OFWPROP, M_WAITOK); + for (i = 0; i < ncells; i++) { + error = clk_get_by_ofw_index(dev, 0, i, &clk_parent); + if (error != 0) { + device_printf(dev, "cannot get clock %d\n", i); + goto fail; + } + def.parent_names[i] = clk_get_name(clk_parent); + clk_release(clk_parent); + } + def.parent_cnt = ncells; + + clk = clknode_create(clkdom, &aw_thsclk_clknode_class, &def); + if (clk == NULL) { + device_printf(dev, "cannot create clknode\n"); + error = ENXIO; + goto fail; + } + + sc = clknode_get_softc(clk); + sc->reg = paddr; + sc->clkdev = device_get_parent(dev); + + clknode_register(clkdom, clk); + + if (clkdom_finit(clkdom) != 0) { + device_printf(dev, "cannot finalize clkdom initialization\n"); + error = ENXIO; + goto fail; + } + + if (bootverbose) + clkdom_dump(clkdom); + + return (0); + +fail: + return (error); +} + +static device_method_t aw_thsclk_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, aw_thsclk_probe), + DEVMETHOD(device_attach, aw_thsclk_attach), + + DEVMETHOD_END +}; + +static driver_t aw_thsclk_driver = { + "aw_thsclk", + aw_thsclk_methods, + 0 +}; + +static devclass_t aw_thsclk_devclass; + +EARLY_DRIVER_MODULE(aw_thsclk, simplebus, aw_thsclk_driver, + aw_thsclk_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Sep 3 15:24:30 2016 (r305351) +++ head/sys/arm64/conf/GENERIC Sat Sep 3 15:26:00 2016 (r305352) @@ -167,6 +167,12 @@ device aw_wdog # Allwinner Watchdog # Power management controllers device axp81x # X-Powers AXP81x PMIC +# EFUSE +device aw_sid # Allwinner Secure ID EFUSE + +# Thermal sensors +device aw_thermal # Allwinner Thermal Sensor Controller + # Pseudo devices. device loop # Network loopback device random # Entropy device Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Sep 3 15:24:30 2016 (r305351) +++ head/sys/conf/files.arm64 Sat Sep 3 15:26:00 2016 (r305352) @@ -22,6 +22,8 @@ arm/allwinner/aw_nmi.c optional aw_nmi arm/allwinner/aw_reset.c optional aw_ccu arm/allwinner/aw_rsb.c optional aw_rsb arm/allwinner/aw_rtc.c optional aw_rtc +arm/allwinner/aw_sid.c optional aw_sid +arm/allwinner/aw_thermal.c optional aw_thermal arm/allwinner/aw_usbphy.c optional ehci aw_usbphy arm/allwinner/aw_wdog.c optional aw_wdog arm/allwinner/axp81x.c optional axp81x @@ -33,6 +35,7 @@ arm/allwinner/clk/aw_gate.c optional aw_ arm/allwinner/clk/aw_modclk.c optional aw_ccu arm/allwinner/clk/aw_pll.c optional aw_ccu \ compile-with "${NORMAL_C} -I$S/gnu/dts/include" +arm/allwinner/clk/aw_thsclk.c optional aw_ccu arm/allwinner/clk/aw_usbclk.c optional aw_ccu arm/allwinner/if_awg.c optional awg arm/arm/generic_timer.c standard From owner-svn-src-head@freebsd.org Sat Sep 3 15:26: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 7C6EABCE639; Sat, 3 Sep 2016 15:26:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A547BD; Sat, 3 Sep 2016 15:26:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83FQUqT017371; Sat, 3 Sep 2016 15:26:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83FQSCZ017350; Sat, 3 Sep 2016 15:26:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201609031526.u83FQSCZ017350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 3 Sep 2016 15:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305353 - in head/sys/boot: i386 i386/boot0 i386/boot2 i386/btx/btx i386/btx/btxldr i386/cdboot i386/gptboot i386/gptzfsboot i386/mbr i386/pmbr i386/pxeldr i386/zfsboot pc98 pc98/boot0 ... 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.22 Precedence: list List-Id: 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, 03 Sep 2016 15:26:31 -0000 Author: imp Date: Sat Sep 3 15:26:28 2016 New Revision: 305353 URL: https://svnweb.freebsd.org/changeset/base/305353 Log: Don't use -N to set the OMAGIC with data and text writeable and data not page aligned. To do this, use the ld script gnu ld installs on my system. This is imperfect: LDFLAGS_BIN and LD_FLAGS_BIN describe different things. The loader script could be better named and take into account other architectures. And having two different mechanisms to do basically the same thing needs study. However, it's blocking forward progress on lld, so I'll work in parallel to sort these out. Differential Revision: https://reviews.freebsd.org/D7409 Reviewed by: emaste Added: head/sys/boot/i386/boot.ldscript (contents, props changed) Modified: head/sys/boot/i386/Makefile.inc head/sys/boot/i386/boot0/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/btx/btx/Makefile head/sys/boot/i386/btx/btxldr/Makefile head/sys/boot/i386/cdboot/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/mbr/Makefile head/sys/boot/i386/pmbr/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/pc98/Makefile.inc head/sys/boot/pc98/boot0/Makefile head/sys/boot/pc98/boot2/Makefile head/sys/boot/pc98/btx/btx/Makefile head/sys/boot/pc98/btx/btxldr/Makefile head/sys/boot/pc98/cdboot/Makefile Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/Makefile.inc Sat Sep 3 15:26:28 2016 (r305353) @@ -28,4 +28,9 @@ BTXLDR= ${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx BTXCRT= ${BTXDIR}/lib/crt0.o +# compact binary with no padding between text, data, bss +LDSCRIPT= ${SRCTOP}/sys/boot/i386/boot.ldscript +LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary +LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections + .include "../Makefile.inc" Added: head/sys/boot/i386/boot.ldscript ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/boot.ldscript Sat Sep 3 15:26:28 2016 (r305353) @@ -0,0 +1,11 @@ +/* $FreeBSD$ */ +/* Merge text, data and bss together almost no padding */ +OUTPUT_FORMAT("elf32-i386-freebsd") +OUTPUT_ARCH(i386) +ENTRY(_start) +SECTIONS { + . = 0x08048000 + SIZEOF_HEADERS; + .text : { *(.text) } =0x90909090 /* Pad with nops, if needed */ + .data : { *(.data) } _edata = .; + .bss : { *(.bss) } _end = .; +} Modified: head/sys/boot/i386/boot0/Makefile ============================================================================== --- head/sys/boot/i386/boot0/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/boot0/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -40,6 +40,7 @@ BOOT_BOOT0_TICKS?= 0xb6 # The base address that we the boot0 code to to run it. Don't change this # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x600 +ORG=${BOOT_BOOT0_ORG} # Comm settings for boot0sio. # Bit(s) Description @@ -74,7 +75,7 @@ CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ -DTICKS=${BOOT_BOOT0_TICKS} \ -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} -LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/boot2/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -48,7 +48,7 @@ CFLAGS.gcc+= -mno-align-long-strings CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} -LD_FLAGS=-static -N --gc-sections +LD_FLAGS=${LD_FLAGS_BIN} # Pick up ../Makefile.inc early. .include Modified: head/sys/boot/i386/btx/btx/Makefile ============================================================================== --- head/sys/boot/i386/btx/btx/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/btx/btx/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -25,7 +25,7 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COM ORG= 0x9000 -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/i386/btx/btxldr/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/btx/btxldr/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -12,7 +12,8 @@ CFLAGS+=-I${.CURDIR}/../../common CFLAGS+=-DBTXLDR_VERBOSE .endif -LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary +ORG=${LOADER_ADDRESS} +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/cdboot/Makefile ============================================================================== --- head/sys/boot/i386/cdboot/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/cdboot/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -10,7 +10,7 @@ CFLAGS+=-I${.CURDIR}/../common ORG= 0x7c00 -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/gptboot/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -47,7 +47,7 @@ LIBGELIBOOT= ${.OBJDIR}/../../geli/libge OPENCRYPTO_XTS= xform_aes_xts.o .endif -LD_FLAGS=-static -N --gc-sections +LD_FLAGS=${LD_FLAGS_BIN} LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/gptzfsboot/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -46,7 +46,7 @@ OPENCRYPTO_XTS= xform_aes_xts.o CFLAGS.gcc+= --param max-inline-insns-single=100 -LD_FLAGS=-static -N --gc-sections +LD_FLAGS=${LD_FLAGS_BIN} LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a Modified: head/sys/boot/i386/mbr/Makefile ============================================================================== --- head/sys/boot/i386/mbr/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/mbr/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -12,6 +12,6 @@ BOOT_MBR_FLAGS?= 0x80 ORG= 0x600 AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS} -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/pmbr/Makefile ============================================================================== --- head/sys/boot/i386/pmbr/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/pmbr/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -9,6 +9,6 @@ SRCS= ${PROG}.s ORG= 0x600 AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS} -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/pxeldr/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -34,7 +34,7 @@ ${BOOT}: ${LDR} ${LOADER} dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none rm ${.TARGET}.tmp -LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS+=${LDFLAGS_BIN} CLEANFILES+= ${LOADER} Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/i386/zfsboot/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -36,7 +36,7 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ CFLAGS.gcc+= --param max-inline-insns-single=100 -LD_FLAGS=-static -N --gc-sections +LD_FLAGS=${LD_FLAGS_BIN} LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a Modified: head/sys/boot/pc98/Makefile.inc ============================================================================== --- head/sys/boot/pc98/Makefile.inc Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/pc98/Makefile.inc Sat Sep 3 15:26:28 2016 (r305353) @@ -21,4 +21,9 @@ BTXLDR= ${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx BTXCRT= ${BTXDIR}/lib/crt0.o +# compact binary with no padding between text, data, bss +LDSCRIPT= ${SRCTOP}/sys/boot/i386/boot.ldscript +LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary +LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections + .include "../Makefile.inc" Modified: head/sys/boot/pc98/boot0/Makefile ============================================================================== --- head/sys/boot/pc98/boot0/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/pc98/boot0/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -1,6 +1,6 @@ # $FreeBSD$ -PROG= ${BOOT}.out +PROG= ${BOOT} INTERNALPROG= FILES= ${BOOT} MAN= @@ -12,10 +12,8 @@ BOOT= boot0 # The base address that we the boot0 code to to run it. Don't change this # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x0000 +ORG=${BOOT_BOOT0_ORG} -LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N - -${BOOT}: ${BOOT}.out - ${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET} +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/pc98/boot2/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -52,7 +52,7 @@ CFLAGS.gcc+= -mno-align-long-strings CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} -LD_FLAGS=-static -N --gc-sections +LD_FLAGS=${LD_FLAGS_BIN} # Pick up ../Makefile.inc early. .include Modified: head/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- head/sys/boot/pc98/btx/btx/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/pc98/btx/btx/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -25,7 +25,7 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COM ORG= 0x9000 -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/pc98/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/pc98/btx/btxldr/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/pc98/btx/btxldr/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -12,7 +12,8 @@ CFLAGS+=-I${.CURDIR}/../../../i386/commo CFLAGS+=-DBTXLDR_VERBOSE .endif -LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary +ORG=${LOADER_ADDRESS} +LDFLAGS=${LDFLAGS_BIN} .include Modified: head/sys/boot/pc98/cdboot/Makefile ============================================================================== --- head/sys/boot/pc98/cdboot/Makefile Sat Sep 3 15:26:00 2016 (r305352) +++ head/sys/boot/pc98/cdboot/Makefile Sat Sep 3 15:26:28 2016 (r305353) @@ -10,7 +10,7 @@ CFLAGS+=-I${.CURDIR}/../../i386/common ORG= 0x0000 -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include From owner-svn-src-head@freebsd.org Sat Sep 3 15:28: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 8B7BEBCE69E; Sat, 3 Sep 2016 15:28:10 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5E5C123F; Sat, 3 Sep 2016 15:28:10 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83FS93m017462; Sat, 3 Sep 2016 15:28:09 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83FS91u017461; Sat, 3 Sep 2016 15:28:09 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201609031528.u83FS91u017461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 3 Sep 2016 15:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305354 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 15:28:10 -0000 Author: jmcneill Date: Sat Sep 3 15:28:09 2016 New Revision: 305354 URL: https://svnweb.freebsd.org/changeset/base/305354 Log: Use the root key in the Security ID EFUSE (when valid) to generate a MAC address instead of creating a random one each boot. Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:26:28 2016 (r305353) +++ head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:28:09 2016 (r305354) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -1277,6 +1278,7 @@ awg_get_eaddr(device_t dev, uint8_t *ead { struct awg_softc *sc; uint32_t maclo, machi, rnd; + u_char rootkey[16]; sc = device_get_softc(dev); @@ -1285,9 +1287,19 @@ awg_get_eaddr(device_t dev, uint8_t *ead if (maclo == 0xffffffff && machi == 0xffff) { /* MAC address in hardware is invalid, create one */ - rnd = arc4random(); - maclo = 0x00f2 | (rnd & 0xffff0000); - machi = rnd & 0xffff; + if (aw_sid_get_rootkey(rootkey) == 0 && + (rootkey[3] | rootkey[12] | rootkey[13] | rootkey[14] | + rootkey[15]) != 0) { + /* MAC address is derived from the root key in SID */ + maclo = (rootkey[13] << 24) | (rootkey[12] << 16) | + (rootkey[3] << 8) | 0x02; + machi = (rootkey[15] << 8) | rootkey[14]; + } else { + /* Create one */ + rnd = arc4random(); + maclo = 0x00f2 | (rnd & 0xffff0000); + machi = rnd & 0xffff; + } } eaddr[0] = maclo & 0xff; From owner-svn-src-head@freebsd.org Sat Sep 3 15:47: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 58D4FBCEB9F for ; Sat, 3 Sep 2016 15:47:13 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8CA4F13 for ; Sat, 3 Sep 2016 15:47:12 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x235.google.com with SMTP id v143so17116391wmv.0 for ; Sat, 03 Sep 2016 08:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+HUBMQqm03+L9Xj/IIojdokRjx7hD6AxuJlpkXKn/rk=; b=a/IKIMbaEZULYvLtd8W5MS3fpK0qJVI7oijt/IwJ58H6Q+rdrpWxnUf30qXBdxk27T C1qjh1eZKYtorAJX2VkGsid0UwpBQZgeupzDeijD6+z14NjVKMaVydHqjgBs54B+zacS rJdtkBNuvZH5h1eiIkaRZ9YuyPOkV9+orjB8XmmNluitw67FM6cfa+9+PdFjyikGgLp+ iN80ZFj2F/Vk33dOVLWKQmk5WII/xG7gIx53IiguLzw7lq35kpUT+iVpRmKPq1URvx8I BOYASIdjypBtcqwlzIGCe/WtvncPgZAmF/2aB4UNHUaL2JfspQ0V9fihUzz/qvv6VS8H Jjeg== 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; bh=+HUBMQqm03+L9Xj/IIojdokRjx7hD6AxuJlpkXKn/rk=; b=I7/BIV5k9zVGAxnmoGTNNZTuSO6hDKvttN8oyGJuJ7m3EdIlWfVVyrE8/0CUw02uJi 9kq+BapPZoI++0LXboSIYgieb+Z9TofA1TBCkOlDR7A5z4Y3XAXSnF7EBy9Vc72mwyIt eU0kjiy6hKdEqCSOcruY6RxJyXQkoPdpRdwZVhbVxXWIUcQUjtFnt9VeUuKIbl0GdIhN 708SAlP+PvFtVeY0uH+/K+HzDJYrHzZs0o9wGgXGQgIEe/ot55/xbxku7WLVPqtazl61 DE/ww16JkggES8jR0X2xPLS00ymqqAHennghIyOF7p7H2/1FzXaSe8Qtq9Ho+YM0wSKl mV/Q== X-Gm-Message-State: AE9vXwNFZm6UZQ7ebqT8q0EaOANcESbcrCDOOkV54mjUzwmNWbC4rYRBepQ963tH2vnC5KbECRBUmbIcyvOLfKRp X-Received: by 10.28.94.85 with SMTP id s82mr7757622wmb.24.1472917631484; Sat, 03 Sep 2016 08:47:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.236.231 with HTTP; Sat, 3 Sep 2016 08:47:11 -0700 (PDT) In-Reply-To: <201609031528.u83FS91u017461@repo.freebsd.org> References: <201609031528.u83FS91u017461@repo.freebsd.org> From: Oliver Pinter Date: Sat, 3 Sep 2016 17:47:11 +0200 Message-ID: Subject: Re: svn commit: r305354 - head/sys/arm/allwinner To: Jared McNeill 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.22 Precedence: list List-Id: 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, 03 Sep 2016 15:47:13 -0000 Hi! On 9/3/16, Jared McNeill wrote: > Author: jmcneill > Date: Sat Sep 3 15:28:09 2016 > New Revision: 305354 > URL: https://svnweb.freebsd.org/changeset/base/305354 > > Log: > Use the root key in the Security ID EFUSE (when valid) to generate a > MAC address instead of creating a random one each boot. Could you please describe a little more about this root key? What is it? What's the main purpose? Is is a crypto root key? > > Modified: > head/sys/arm/allwinner/if_awg.c > > Modified: head/sys/arm/allwinner/if_awg.c > ============================================================================== > --- head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:26:28 2016 (r305353) > +++ head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:28:09 2016 (r305354) > @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > #include > > @@ -1277,6 +1278,7 @@ awg_get_eaddr(device_t dev, uint8_t *ead > { > struct awg_softc *sc; > uint32_t maclo, machi, rnd; > + u_char rootkey[16]; > > sc = device_get_softc(dev); > > @@ -1285,9 +1287,19 @@ awg_get_eaddr(device_t dev, uint8_t *ead > > if (maclo == 0xffffffff && machi == 0xffff) { > /* MAC address in hardware is invalid, create one */ > - rnd = arc4random(); > - maclo = 0x00f2 | (rnd & 0xffff0000); > - machi = rnd & 0xffff; > + if (aw_sid_get_rootkey(rootkey) == 0 && > + (rootkey[3] | rootkey[12] | rootkey[13] | rootkey[14] | > + rootkey[15]) != 0) { > + /* MAC address is derived from the root key in SID */ > + maclo = (rootkey[13] << 24) | (rootkey[12] << 16) | > + (rootkey[3] << 8) | 0x02; > + machi = (rootkey[15] << 8) | rootkey[14]; > + } else { > + /* Create one */ > + rnd = arc4random(); > + maclo = 0x00f2 | (rnd & 0xffff0000); > + machi = rnd & 0xffff; > + } > } > > eaddr[0] = maclo & 0xff; > _______________________________________________ > 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 Sat Sep 3 17:06: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 C3C99BCED93; Sat, 3 Sep 2016 17:06:56 +0000 (UTC) (envelope-from jmcneill@invisible.ca) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EBF8E43; Sat, 3 Sep 2016 17:06:56 +0000 (UTC) (envelope-from jmcneill@invisible.ca) Received: from mfilter35-d.gandi.net (mfilter35-d.gandi.net [217.70.178.166]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id DFA86A80D7; Sat, 3 Sep 2016 19:06:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter35-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter35-d.gandi.net (mfilter35-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id EehAjvPaI2Bs; Sat, 3 Sep 2016 19:06:52 +0200 (CEST) X-Originating-IP: 156.57.52.82 Received: from dis (stjhnbsu1kw-156057052082.dhcp-dynamic.FibreOp.nb.bellaliant.net [156.57.52.82]) (Authenticated sender: jmcneill@invisible.ca) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 12041A80CE; Sat, 3 Sep 2016 19:06:50 +0200 (CEST) Date: Sat, 3 Sep 2016 14:06:37 -0300 (ADT) From: Jared McNeill To: Oliver Pinter cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305354 - head/sys/arm/allwinner In-Reply-To: Message-ID: References: <201609031528.u83FS91u017461@repo.freebsd.org> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 03 Sep 2016 17:06:56 -0000 Hi Oliver -- It's really just a serial number. The Allwinner A20 datasheet refers to it as a root key, later ones such as A83T refer to it as chip ID. U-Boot uses the same process to generate MAC addresses for all Allwinner boards. Cheers, Jared On Sat, 3 Sep 2016, Oliver Pinter wrote: > Hi! > > On 9/3/16, Jared McNeill wrote: >> Author: jmcneill >> Date: Sat Sep 3 15:28:09 2016 >> New Revision: 305354 >> URL: https://svnweb.freebsd.org/changeset/base/305354 >> >> Log: >> Use the root key in the Security ID EFUSE (when valid) to generate a >> MAC address instead of creating a random one each boot. > > Could you please describe a little more about this root key? What is > it? What's the main purpose? Is is a crypto root key? > >> >> Modified: >> head/sys/arm/allwinner/if_awg.c >> >> Modified: head/sys/arm/allwinner/if_awg.c >> ============================================================================== >> --- head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:26:28 2016 (r305353) >> +++ head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:28:09 2016 (r305354) >> @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); >> #include >> >> #include >> +#include >> #include >> #include >> >> @@ -1277,6 +1278,7 @@ awg_get_eaddr(device_t dev, uint8_t *ead >> { >> struct awg_softc *sc; >> uint32_t maclo, machi, rnd; >> + u_char rootkey[16]; >> >> sc = device_get_softc(dev); >> >> @@ -1285,9 +1287,19 @@ awg_get_eaddr(device_t dev, uint8_t *ead >> >> if (maclo == 0xffffffff && machi == 0xffff) { >> /* MAC address in hardware is invalid, create one */ >> - rnd = arc4random(); >> - maclo = 0x00f2 | (rnd & 0xffff0000); >> - machi = rnd & 0xffff; >> + if (aw_sid_get_rootkey(rootkey) == 0 && >> + (rootkey[3] | rootkey[12] | rootkey[13] | rootkey[14] | >> + rootkey[15]) != 0) { >> + /* MAC address is derived from the root key in SID */ >> + maclo = (rootkey[13] << 24) | (rootkey[12] << 16) | >> + (rootkey[3] << 8) | 0x02; >> + machi = (rootkey[15] << 8) | rootkey[14]; >> + } else { >> + /* Create one */ >> + rnd = arc4random(); >> + maclo = 0x00f2 | (rnd & 0xffff0000); >> + machi = rnd & 0xffff; >> + } >> } >> >> eaddr[0] = maclo & 0xff; >> _______________________________________________ >> 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 Sat Sep 3 17:23: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 9F21ABCE2CB; Sat, 3 Sep 2016 17:23:25 +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 61E8885D; Sat, 3 Sep 2016 17:23:25 +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 u83HNOVu062213; Sat, 3 Sep 2016 17:23:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83HNOjX062212; Sat, 3 Sep 2016 17:23:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609031723.u83HNOjX062212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Sep 2016 17:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305355 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 17:23:25 -0000 Author: andrew Date: Sat Sep 3 17:23:24 2016 New Revision: 305355 URL: https://svnweb.freebsd.org/changeset/base/305355 Log: Explicitly include all .rodata.* sections in the kernel .rodata. This helps link the kernel with lld as it will then put all these into a single .rodata section. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/conf/ldscript.arm64 Modified: head/sys/conf/ldscript.arm64 ============================================================================== --- head/sys/conf/ldscript.arm64 Sat Sep 3 15:28:09 2016 (r305354) +++ head/sys/conf/ldscript.arm64 Sat Sep 3 17:23:24 2016 (r305355) @@ -18,7 +18,7 @@ SECTIONS _etext = .; PROVIDE (etext = .); .fini : { *(.fini) } =0x9090 - .rodata : { *(.rodata) *(.gnu.linkonce.r*) } + .rodata : { *(.rodata*) *(.gnu.linkonce.r*) } .rodata1 : { *(.rodata1) } .interp : { *(.interp) } .hash : { *(.hash) } From owner-svn-src-head@freebsd.org Sat Sep 3 17:24: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 87ADBBCE32C; Sat, 3 Sep 2016 17:24:03 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D0A19D9; Sat, 3 Sep 2016 17:24:01 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 277859ca; Sat, 3 Sep 2016 19:17:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=18/3zrX5Dx7hZLvpb8YRjcFr91k=; b=hvpSDBE2QT+A8WDq90qJxcmQU7hA e2WlbmqJ2dDb1VyVTOmdm3BB9IuMlt4jNKOFVRSEdqOXMReLcYnB9qPAiPgBm3tn +r83JXgBlqRYosv8815LT+g614B6dwpjArRiIc5b1RM1/5HlbO1Nz611btHPI3ni 4l7DkjCysn/1+HU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=j+0PJYSYHUP1gNifBJ9VcKVQ7qbZ0PS1rIe5e/qvaGYOFsqfZBnU01Fa q+wOgfB+8gJk/lKT/iABjYd8pPr9wnlHa66LDq8iJProLFVWtQo58oKgALJug3AW EZmtjhMxhOhKxuPrY5F+4TAG1PMm5MMwgGh2YCagNohOeFpEq3c= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id a3e34022 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sat, 3 Sep 2016 19:17:19 +0200 (CEST) Date: Sat, 3 Sep 2016 19:17:17 +0200 From: Emmanuel Vadot To: Jared McNeill Cc: Oliver Pinter , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305354 - head/sys/arm/allwinner Message-Id: <20160903191717.437e45cb8d0d612211bdc0c5@bidouilliste.com> In-Reply-To: References: <201609031528.u83FS91u017461@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.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.22 Precedence: list List-Id: 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, 03 Sep 2016 17:24:03 -0000 I'll add that everybody uses this as a serial number. Since thoses are efuses, you can't change it unless a specific voltage is applied to a certain pin (which is tied to GND on every board), but no one have tried to do that. There might be some way do restrict reading that key a there is also some configuration fuses but the documentation doesn't say much about this peripheral. You can check http://linux-sunxi.org/SID for (a little) more information. On Sat, 3 Sep 2016 14:06:37 -0300 (ADT) Jared McNeill wrote: > Hi Oliver -- > > It's really just a serial number. The Allwinner A20 datasheet refers to it > as a root key, later ones such as A83T refer to it as chip ID. U-Boot > uses the same process to generate MAC addresses for all Allwinner boards. > > Cheers, > Jared > > > On Sat, 3 Sep 2016, Oliver Pinter wrote: > > > Hi! > > > > On 9/3/16, Jared McNeill wrote: > >> Author: jmcneill > >> Date: Sat Sep 3 15:28:09 2016 > >> New Revision: 305354 > >> URL: https://svnweb.freebsd.org/changeset/base/305354 > >> > >> Log: > >> Use the root key in the Security ID EFUSE (when valid) to generate a > >> MAC address instead of creating a random one each boot. > > > > Could you please describe a little more about this root key? What is > > it? What's the main purpose? Is is a crypto root key? > > > >> > >> Modified: > >> head/sys/arm/allwinner/if_awg.c > >> > >> Modified: head/sys/arm/allwinner/if_awg.c > >> ============================================================================== > >> --- head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:26:28 2016 (r305353) > >> +++ head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:28:09 2016 (r305354) > >> @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); > >> #include > >> > >> #include > >> +#include > >> #include > >> #include > >> > >> @@ -1277,6 +1278,7 @@ awg_get_eaddr(device_t dev, uint8_t *ead > >> { > >> struct awg_softc *sc; > >> uint32_t maclo, machi, rnd; > >> + u_char rootkey[16]; > >> > >> sc = device_get_softc(dev); > >> > >> @@ -1285,9 +1287,19 @@ awg_get_eaddr(device_t dev, uint8_t *ead > >> > >> if (maclo == 0xffffffff && machi == 0xffff) { > >> /* MAC address in hardware is invalid, create one */ > >> - rnd = arc4random(); > >> - maclo = 0x00f2 | (rnd & 0xffff0000); > >> - machi = rnd & 0xffff; > >> + if (aw_sid_get_rootkey(rootkey) == 0 && > >> + (rootkey[3] | rootkey[12] | rootkey[13] | rootkey[14] | > >> + rootkey[15]) != 0) { > >> + /* MAC address is derived from the root key in SID */ > >> + maclo = (rootkey[13] << 24) | (rootkey[12] << 16) | > >> + (rootkey[3] << 8) | 0x02; > >> + machi = (rootkey[15] << 8) | rootkey[14]; > >> + } else { > >> + /* Create one */ > >> + rnd = arc4random(); > >> + maclo = 0x00f2 | (rnd & 0xffff0000); > >> + machi = rnd & 0xffff; > >> + } > >> } > >> > >> eaddr[0] = maclo & 0xff; > >> _______________________________________________ > >> 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" > >> > > > > -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Sat Sep 3 17:31: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 ECFFEBCE524; Sat, 3 Sep 2016 17:31:14 +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 BB02ED58; Sat, 3 Sep 2016 17:31:14 +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 u83HVDUO062518; Sat, 3 Sep 2016 17:31:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83HVDZR062517; Sat, 3 Sep 2016 17:31:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609031731.u83HVDZR062517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Sep 2016 17:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305356 - head/tests/sys/acl 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.22 Precedence: list List-Id: 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, 03 Sep 2016 17:31:15 -0000 Author: ngie Date: Sat Sep 3 17:31:13 2016 New Revision: 305356 URL: https://svnweb.freebsd.org/changeset/base/305356 Log: Add a missing "Bail out!" if zpool create fails This will make the exit info more meaningful if/when zpool create fails, and establishes parity with the other 2 zfs acl testcases (01, 03). MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/acl/04.sh Modified: head/tests/sys/acl/04.sh ============================================================================== --- head/tests/sys/acl/04.sh Sat Sep 3 17:23:24 2016 (r305355) +++ head/tests/sys/acl/04.sh Sat Sep 3 17:31:13 2016 (r305356) @@ -50,6 +50,7 @@ MNT=`mktemp -dt acltools` zpool create -m $MNT acltools /dev/$MD if [ $? -ne 0 ]; then echo "not ok 1 - 'zpool create' failed." + echo 'Bail out!' exit 1 fi From owner-svn-src-head@freebsd.org Sat Sep 3 17:59: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 8911BBCEA0B; Sat, 3 Sep 2016 17:59:47 +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 3844A926; Sat, 3 Sep 2016 17:59:47 +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 u83HxklB073534; Sat, 3 Sep 2016 17:59:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83HxkTI073533; Sat, 3 Sep 2016 17:59:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609031759.u83HxkTI073533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Sep 2016 17:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305357 - head/tests/sys/mac/bsdextended 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.22 Precedence: list List-Id: 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, 03 Sep 2016 17:59:47 -0000 Author: ngie Date: Sat Sep 3 17:59:46 2016 New Revision: 305357 URL: https://svnweb.freebsd.org/changeset/base/305357 Log: Skip testcases 9/10 if jail(8) isn't installed These testcases require jail support MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/mac/bsdextended/matches_test.sh Modified: head/tests/sys/mac/bsdextended/matches_test.sh ============================================================================== --- head/tests/sys/mac/bsdextended/matches_test.sh Sat Sep 3 17:31:13 2016 (r305356) +++ head/tests/sys/mac/bsdextended/matches_test.sh Sat Sep 3 17:59:46 2016 (r305357) @@ -144,30 +144,36 @@ else fail $desc fi -# -# Subject Match on jail -# -rm -f $playground/test-jail - -desc="subject matching jailid" -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` -ugidfw set 1 subject jailid $jailid object mode rasx -sleep 10 - -if [ -f $playground/test-jail ]; then - fail "TODO $desc: this testcase fails (see bug # 205481)" -else - pass $desc -fi - -rm -f $playground/test-jail -desc="subject nonmatching jailid" -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` -sleep 10 -if [ -f $playground/test-jail ]; then - pass $desc -else - fail $desc +if which jail >/dev/null; then + # + # Subject Match on jail + # + rm -f $playground/test-jail + + desc="subject matching jailid" + jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` + ugidfw set 1 subject jailid $jailid object mode rasx + sleep 10 + + if [ -f $playground/test-jail ]; then + fail "TODO $desc: this testcase fails (see bug # 205481)" + else + pass $desc + fi + + rm -f $playground/test-jail + desc="subject nonmatching jailid" + jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` + sleep 10 + if [ -f $playground/test-jail ]; then + pass $desc + else + fail $desc + fi +else + # XXX: kyua is too dumb to parse skip ranges, still.. + pass "skip jail(8) not installed" + pass "skip jail(8) not installed" fi # From owner-svn-src-head@freebsd.org Sat Sep 3 18:11: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 222BFBCEDCF; Sat, 3 Sep 2016 18:11: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 D35DEF33; Sat, 3 Sep 2016 18:11: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 u83IBorj080809; Sat, 3 Sep 2016 18:11:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83IBnmt080798; Sat, 3 Sep 2016 18:11:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201609031811.u83IBnmt080798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Sep 2016 18:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305358 - in head: bin/cat/tests contrib/netbsd-tests contrib/netbsd-tests/bin/cat contrib/netbsd-tests/bin/sh contrib/netbsd-tests/bin/sh/dotcmd contrib/netbsd-tests/crypto/opencrypto ... 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.22 Precedence: list List-Id: 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, 03 Sep 2016 18:11:51 -0000 Author: ngie Date: Sat Sep 3 18:11:48 2016 New Revision: 305358 URL: https://svnweb.freebsd.org/changeset/base/305358 Log: Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. MFC after: 2 months Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox Sponsored by: EMC / Isilon Storage Division Added: head/contrib/netbsd-tests/bin/cat/d_se_output.in - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.in head/contrib/netbsd-tests/bin/cat/d_se_output.out - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.out head/contrib/netbsd-tests/bin/sh/t_arith.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_arith.sh head/contrib/netbsd-tests/bin/sh/t_cmdsub.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_cmdsub.sh head/contrib/netbsd-tests/bin/sh/t_option.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_option.sh head/contrib/netbsd-tests/bin/sh/t_redir.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_redir.sh head/contrib/netbsd-tests/bin/sh/t_redircloexec.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_redircloexec.sh head/contrib/netbsd-tests/bin/sh/t_shift.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_shift.sh head/contrib/netbsd-tests/bin/sh/t_varval.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/sh/t_varval.sh head/contrib/netbsd-tests/dev/fss/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/dev/fss/ head/contrib/netbsd-tests/dev/usb/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/dev/usb/ head/contrib/netbsd-tests/include/sys/t_pslist.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/include/sys/t_pslist.c head/contrib/netbsd-tests/kernel/kqueue/t_vnode.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/kernel/kqueue/t_vnode.c head/contrib/netbsd-tests/lib/libc/db/h_lfsr.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/db/h_lfsr.c head/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c head/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c head/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c head/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c head/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc head/contrib/netbsd-tests/lib/libc/sys/t_bind.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sys/t_bind.c head/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c head/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c head/contrib/netbsd-tests/lib/libc/sys/t_wait.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/sys/t_wait.c head/contrib/netbsd-tests/lib/libm/t_fenv.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libm/t_fenv.c head/contrib/netbsd-tests/lib/libm/t_hypot.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libm/t_hypot.c head/contrib/netbsd-tests/lib/libusbhid/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libusbhid/ head/contrib/netbsd-tests/net/arp/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/arp/ head/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh head/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh head/contrib/netbsd-tests/net/if/ifconf.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if/ifconf.c head/contrib/netbsd-tests/net/if/t_ifconf.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if/t_ifconf.sh head/contrib/netbsd-tests/net/if/t_ifconfig.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if/t_ifconfig.sh head/contrib/netbsd-tests/net/if_gif/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if_gif/ head/contrib/netbsd-tests/net/if_pppoe/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if_pppoe/ head/contrib/netbsd-tests/net/if_tap/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/if_tap/ head/contrib/netbsd-tests/net/in_cksum/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/in_cksum/ head/contrib/netbsd-tests/net/mcast/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/mcast/ head/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh head/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh head/contrib/netbsd-tests/net/ndp/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/ndp/ head/contrib/netbsd-tests/net/net/t_forwarding.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/net/t_forwarding.sh head/contrib/netbsd-tests/net/net/t_ipaddress.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/net/t_ipaddress.sh head/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh head/contrib/netbsd-tests/net/net/t_ipv6address.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/net/t_ipv6address.sh head/contrib/netbsd-tests/net/route/t_flags.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/route/t_flags.sh head/contrib/netbsd-tests/net/route/t_flags6.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/route/t_flags6.sh head/contrib/netbsd-tests/net/route/t_route.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/net/route/t_route.sh head/contrib/netbsd-tests/sbin/gpt/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sbin/gpt/ head/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh head/contrib/netbsd-tests/sys/net/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sys/net/ head/contrib/netbsd-tests/sys/netatalk/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sys/netatalk/ head/contrib/netbsd-tests/sys/netinet/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sys/netinet/ head/contrib/netbsd-tests/sys/netinet6/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/sys/netinet6/ head/contrib/netbsd-tests/usr.bin/config/d_min - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/config/d_min head/contrib/netbsd-tests/usr.bin/gdb/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/gdb/ head/contrib/netbsd-tests/usr.bin/ld/ - copied from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/ld/ head/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c - copied unchanged from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c head/lib/libc/tests/stdio/open_memstream2_test.c - copied unchanged from r305318, projects/netbsd-tests-update-12/lib/libc/tests/stdio/open_memstream2_test.c Deleted: head/contrib/netbsd-tests/bin/sh/t_compexit.sh head/contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c head/contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c head/lib/libc/tests/stdio/open_memstream_test.c Modified: head/bin/cat/tests/Makefile head/contrib/netbsd-tests/bin/cat/d_align.in head/contrib/netbsd-tests/bin/cat/d_align.out head/contrib/netbsd-tests/bin/cat/t_cat.sh head/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command head/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh head/contrib/netbsd-tests/bin/sh/t_evaltested.sh head/contrib/netbsd-tests/bin/sh/t_exit.sh head/contrib/netbsd-tests/bin/sh/t_expand.sh head/contrib/netbsd-tests/bin/sh/t_fsplit.sh head/contrib/netbsd-tests/bin/sh/t_here.sh head/contrib/netbsd-tests/bin/sh/t_set_e.sh head/contrib/netbsd-tests/bin/sh/t_ulimit.sh head/contrib/netbsd-tests/bin/sh/t_varquote.sh head/contrib/netbsd-tests/bin/sh/t_wait.sh head/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh head/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue head/contrib/netbsd-tests/dev/dm/h_dm.c head/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh head/contrib/netbsd-tests/dev/sysmon/t_swwdog.c head/contrib/netbsd-tests/fs/common/fstest_lfs.c head/contrib/netbsd-tests/fs/common/h_fsmacros.h head/contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c head/contrib/netbsd-tests/fs/nfs/t_rquotad.sh head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh head/contrib/netbsd-tests/fs/vfs/t_io.c head/contrib/netbsd-tests/fs/vfs/t_renamerace.c head/contrib/netbsd-tests/fs/vfs/t_unpriv.c head/contrib/netbsd-tests/fs/vfs/t_vnops.c head/contrib/netbsd-tests/games/t_factor.sh head/contrib/netbsd-tests/h_macros.h head/contrib/netbsd-tests/include/sys/t_bitops.c head/contrib/netbsd-tests/include/sys/t_cdefs.c head/contrib/netbsd-tests/include/sys/t_socket.c head/contrib/netbsd-tests/include/t_paths.c head/contrib/netbsd-tests/ipf/expected/n14 head/contrib/netbsd-tests/ipf/expected/n14_6 head/contrib/netbsd-tests/ipf/t_filter_parse.sh head/contrib/netbsd-tests/ipf/t_nat_exec.sh head/contrib/netbsd-tests/kernel/kqueue/t_ioctl.c head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c head/contrib/netbsd-tests/kernel/kqueue/t_proc2.c head/contrib/netbsd-tests/kernel/kqueue/t_proc3.c head/contrib/netbsd-tests/kernel/t_rnd.c head/contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c head/contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S head/contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S head/contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S head/contrib/netbsd-tests/lib/libc/db/t_db.sh head/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c head/contrib/netbsd-tests/lib/libc/gen/isqemu.h head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c head/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c head/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c head/contrib/netbsd-tests/lib/libc/gen/t_randomid.c head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c head/contrib/netbsd-tests/lib/libc/gen/t_time.c head/contrib/netbsd-tests/lib/libc/gen/t_vis.c head/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c head/contrib/netbsd-tests/lib/libc/net/t_servent.sh head/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c head/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c head/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c head/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c head/contrib/netbsd-tests/lib/libc/string/t_memset.c head/contrib/netbsd-tests/lib/libc/sys/t_connect.c head/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c head/contrib/netbsd-tests/lib/libc/sys/t_kevent.c head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c head/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c head/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c head/contrib/netbsd-tests/lib/libc/time/t_strptime.c head/contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y head/contrib/netbsd-tests/lib/libm/t_exp.c head/contrib/netbsd-tests/lib/libm/t_fmod.c head/contrib/netbsd-tests/lib/libm/t_log.c head/contrib/netbsd-tests/lib/libm/t_pow.c head/contrib/netbsd-tests/lib/libpthread/t_cond.c head/contrib/netbsd-tests/lib/libpthread/t_mutex.c head/contrib/netbsd-tests/lib/libpthread/t_rwlock.c head/contrib/netbsd-tests/lib/librumpclient/t_exec.sh head/contrib/netbsd-tests/lib/librumpclient/t_fd.c head/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh head/contrib/netbsd-tests/lib/libutil/t_parsedate.c head/contrib/netbsd-tests/net/bpfilter/t_bpfilter.c head/contrib/netbsd-tests/net/bpfjit/t_bpfjit.c head/contrib/netbsd-tests/net/icmp/t_forward.c head/contrib/netbsd-tests/net/icmp/t_ping.c head/contrib/netbsd-tests/net/icmp/t_ping2.sh head/contrib/netbsd-tests/net/if_bridge/t_bridge.sh head/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh head/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh head/contrib/netbsd-tests/net/mpls/t_rfc4182.sh head/contrib/netbsd-tests/net/net/t_tcp.c head/contrib/netbsd-tests/net/route/t_change.sh head/contrib/netbsd-tests/rump/modautoload/t_modautoload.c head/contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c head/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c head/contrib/netbsd-tests/rump/rumpkern/t_sp.sh head/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh head/contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c head/contrib/netbsd-tests/sbin/resize_ffs/common.sh head/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh head/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh head/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh head/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh head/contrib/netbsd-tests/sbin/sysctl/t_perm.sh head/contrib/netbsd-tests/share/mk/t_lib.sh head/contrib/netbsd-tests/share/mk/t_prog.sh head/contrib/netbsd-tests/share/mk/t_test.sh head/contrib/netbsd-tests/usr.bin/cc/t_hello.sh head/contrib/netbsd-tests/usr.bin/config/support/conf/files head/contrib/netbsd-tests/usr.bin/config/t_config.sh head/contrib/netbsd-tests/usr.bin/make/t_make.sh head/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh head/contrib/netbsd-tests/usr.bin/sed/t_sed.sh head/contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt (contents, props changed) head/contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt (contents, props changed) head/contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt (contents, props changed) head/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh head/lib/libc/tests/db/Makefile head/lib/libc/tests/hash/Makefile head/lib/libc/tests/inet/Makefile head/lib/libc/tests/stdio/Makefile head/lib/libc/tests/stdlib/Makefile head/lib/libc/tests/sys/Makefile head/lib/msun/tests/Makefile Directory Properties: head/ (props changed) head/contrib/netbsd-tests/ (props changed) Modified: head/bin/cat/tests/Makefile ============================================================================== --- head/bin/cat/tests/Makefile Sat Sep 3 17:59:46 2016 (r305357) +++ head/bin/cat/tests/Makefile Sat Sep 3 18:11:48 2016 (r305358) @@ -6,7 +6,15 @@ NETBSD_ATF_TESTS_SH= cat_test ${PACKAGE}FILES+= d_align.in ${PACKAGE}FILES+= d_align.out +${PACKAGE}FILES+= d_se_output.in +${PACKAGE}FILES+= d_se_output.out .include +d_align.out: ${TESTSRC}/d_align.out + sed -E -e 's,^[[:space:]]{7}\$$$$,\$$,' < ${.ALLSRC} > ${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} + +CLEANFILES+= d_align.out d_align.out.tmp + .include Modified: head/contrib/netbsd-tests/bin/cat/d_align.in ============================================================================== --- head/contrib/netbsd-tests/bin/cat/d_align.in Sat Sep 3 17:59:46 2016 (r305357) +++ head/contrib/netbsd-tests/bin/cat/d_align.in Sat Sep 3 18:11:48 2016 (r305358) @@ -1,3 +1,5 @@ a b c + 1 2 3 + x y z Modified: head/contrib/netbsd-tests/bin/cat/d_align.out ============================================================================== --- head/contrib/netbsd-tests/bin/cat/d_align.out Sat Sep 3 17:59:46 2016 (r305357) +++ head/contrib/netbsd-tests/bin/cat/d_align.out Sat Sep 3 18:11:48 2016 (r305358) @@ -1,3 +1,5 @@ 1 a b c$ + $ 2 1 2 3$ + $ 3 x y z$ Copied: head/contrib/netbsd-tests/bin/cat/d_se_output.in (from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/netbsd-tests/bin/cat/d_se_output.in Sat Sep 3 18:11:48 2016 (r305358, copy of r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.in) @@ -0,0 +1,3 @@ + +Of course it runs NetBSD + Copied: head/contrib/netbsd-tests/bin/cat/d_se_output.out (from r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/netbsd-tests/bin/cat/d_se_output.out Sat Sep 3 18:11:48 2016 (r305358, copy of r305318, projects/netbsd-tests-update-12/contrib/netbsd-tests/bin/cat/d_se_output.out) @@ -0,0 +1,3 @@ +$ +Of course it runs NetBSD$ +$ Modified: head/contrib/netbsd-tests/bin/cat/t_cat.sh ============================================================================== --- head/contrib/netbsd-tests/bin/cat/t_cat.sh Sat Sep 3 17:59:46 2016 (r305357) +++ head/contrib/netbsd-tests/bin/cat/t_cat.sh Sat Sep 3 18:11:48 2016 (r305358) @@ -1,4 +1,4 @@ -# $NetBSD: t_cat.sh,v 1.2 2012/03/27 17:57:02 jruoho Exp $ +# $NetBSD: t_cat.sh,v 1.3 2016/06/16 01:04:58 sevan Exp $ # # Copyright (c) 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -52,8 +52,20 @@ nonexistent_body() { -x "cat /some/name/that/does/not/exist" } +atf_test_case se_output +se_output_head() { + atf_set "descr" "Test that cat(1) prints a $ sign " \ + "on blank lines with options '-se' (PR bin/51250)" +} + +se_output_body() { + atf_check -s ignore -o file:$(atf_get_srcdir)/d_se_output.out \ + -x "cat -se $(atf_get_srcdir)/d_se_output.in" +} + atf_init_test_cases() { atf_add_test_case align atf_add_test_case nonexistent + atf_add_test_case se_output } Modified: head/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command ============================================================================== --- head/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command Sat Sep 3 17:59:46 2016 (r305357) +++ head/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command Sat Sep 3 18:11:48 2016 (r305358) @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: scoped_command,v 1.1 2014/05/31 14:29:06 christos Exp $ +# $NetBSD: scoped_command,v 1.2 2016/03/27 14:57:50 christos Exp $ # # Copyright (c) 2014 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,6 +30,27 @@ # POSSIBILITY OF SUCH DAMAGE. # +: ${TEST_SH:=/bin/sh} + +sane_sh() +{ + set -- ${TEST_SH} + case "$#" in + (0) set /bin/sh;; + (1|2) ;; + (*) set "$1";; # Just ignore options if we cannot make them work + esac + + case "$1" in + /*) TEST_SH="$1${2+ }$2";; + ./*) TEST_SH="${PWD}${1#.}${2+ }$2";; + */*) TEST_SH="${PWD}/$1${2+ }$2";; + *) TEST_SH="$( command -v "$1" )${2+ }$2";; + esac +} + +sane_sh + set -e # USAGE: @@ -52,7 +73,7 @@ cmd="echo 'before ${3}' ${2} echo 'after ${3}, return value:' ${?}" -echo "#!/bin/sh" +echo "#!${TEST_SH}" [ 'func' = "${1}" ] && cat </dev/null + then + # 16 bits or less, or hex unsupported, just give up... + return + fi + test $( ${TEST_SH} -c 'echo $(( 0x1FFFF ))' ) = 131071 || return + + # when attempting to exceed the number of available bits + # the shell may react in any of 3 (rational) ways + # 1. syntax error (maybe even core dump...) and fail + # 2. represent a positive number input as negative value + # 3. keep the number positive, but not the value expected + # (perhaps pegged at the max possible value) + # any of those may be accompanied by a message to stderr + + # Must check all 3 possibilities for each plausible size + # Tests do not use 0x8000... because that value can have weird + # other side effects that are not relevant to discover here. + # But we do want to try and force the sign bit set. + + if ! ${TEST_SH} -c ': $(( 0xC0000000 ))' 2>/dev/null + then + # proobably shell detected overflow and complained + ARITH_BITS=32 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c 'case $(( 0xC0000000 )); in (-*) exit 0;; esac; exit 1' + then + ARITH_BITS=32 + return + fi + if ${TEST_SH} -c '[ $(( 0xC0000000 )) != 3221225472 ]' 2>/dev/null + then + ARITH_BITS=32 + return + fi + + if ! ${TEST_SH} -c ': $(( 0xC000000000000000 ))' 2>/dev/null + then + ARITH_BITS=64 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c 'case $(( 0xC000000000000000 )); in (-*) exit 0;; esac; exit 1' + then + ARITH_BITS=64 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c '[ $((0xC000000000000000)) != 13835058055282163712 ]' + then + ARITH_BITS=64 + return + fi + + if ${TEST_SH} 2>/dev/null -c \ + '[ $((0x123456781234567812345678)) = 5634002657842756053938493048 ]' + then + # just assume... (for now anyway, revisit when it happens...) + ARITH_BITS=96 + return + fi +} + +atf_test_case constants +constants_head() +{ + atf_set "descr" "Tests that arithmetic expansion can handle constants" +} +constants_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((0x0))' + + # atf_expect_fail "PR bin/50959" + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((0X0))' + # atf_expect_pass + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((000))' + + atf_check -s exit:0 -o inline:'1\n' -e empty \ + ${TEST_SH} -c 'echo $(( 000000001 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x000000 ))' + + atf_check -s exit:0 -o inline:'99999\n' -e empty \ + ${TEST_SH} -c 'echo $((99999))' + + [ ${ARITH_BITS} -gt 44 ] && + atf_check -s exit:0 -o inline:'9191919191919\n' -e empty \ + ${TEST_SH} -c 'echo $((9191919191919))' + + atf_check -s exit:0 -o inline:'13\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xD ))' + atf_check -s exit:0 -o inline:'11\n' -e empty ${TEST_SH} -c \ + 'echo $(( 013 ))' + atf_check -s exit:0 -o inline:'7\n' -e empty ${TEST_SH} -c \ + 'x=7;echo $(($x))' + atf_check -s exit:0 -o inline:'9\n' -e empty ${TEST_SH} -c \ + 'x=9;echo $((x))' + + atf_check -s exit:0 -o inline:'11\n' -e empty \ + ${TEST_SH} -c 'x=0xB; echo $(( $x ))' + atf_check -s exit:0 -o inline:'27\n' -e empty \ + ${TEST_SH} -c 'x=0X1B; echo $(( x ))' + atf_check -s exit:0 -o inline:'27\n' -e empty \ + ${TEST_SH} -c 'X=033; echo $(( $X ))' + atf_check -s exit:0 -o inline:'219\n' -e empty \ + ${TEST_SH} -c 'X=0333; echo $(( X ))' + atf_check -s exit:0 -o inline:'0\n' -e empty \ + ${TEST_SH} -c 'NULL=; echo $(( NULL ))' + + # Not clear if this is 0, nothing, or an error, so omit for now + # atf_check -s exit:0 -o inline:'0\n' -e empty \ + # ${TEST_SH} -c 'echo $(( ))' + + # not clear whether this should return 0 or an error, so omit for now + # atf_check -s exit:0 -o inline:'0\n' -e empty \ + # ${TEST_SH} -c 'echo $(( UNDEFINED_VAR ))' +} + + +atf_test_case do_unary_plus +do_unary_plus_head() +{ + atf_set "descr" "Tests that unary plus works as expected" +} +do_unary_plus_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( +0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( +1 ))' + atf_check -s exit:0 -o inline:'6\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 6 ))' + atf_check -s exit:0 -o inline:'4321\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 4321 ))' + atf_check -s exit:0 -o inline:'17185\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 0x4321 ))' +} + +atf_test_case do_unary_minus +do_unary_minus_head() +{ + atf_set "descr" "Tests that unary minus works as expected" +} +do_unary_minus_body() +{ + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 0 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 1 ))' + atf_check -s exit:0 -o inline:'-6\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 6 ))' + atf_check -s exit:0 -o inline:'-4321\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 4321 ))' + atf_check -s exit:0 -o inline:'-2257\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 04321 ))' + atf_check -s exit:0 -o inline:'-7\n' -e empty ${TEST_SH} -c \ + 'echo $((-7))' +} + +atf_test_case do_unary_not +do_unary_not_head() +{ + atf_set "descr" "Tests that unary not (boolean) works as expected" +} +do_unary_not_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 0 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( !1234 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( !0xFFFF ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 000000 ))' +} + +atf_test_case do_unary_tilde +do_unary_tilde_head() +{ + atf_set "descr" "Tests that unary not (bitwise) works as expected" +} +do_unary_tilde_body() +{ + # definitely 2's complement arithmetic here... + + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~ 0 ))' + atf_check -s exit:0 -o inline:'-2\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~ 1 ))' + + atf_check -s exit:0 -o inline:'-1235\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~1234 ))' + atf_check -s exit:0 -o inline:'-256\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~0xFF ))' +} + +atf_test_case elementary_add +elementary_add_head() +{ + atf_set "descr" "Tests that simple addition works as expected" +} +elementary_add_body() +{ + # some of these tests actually test unary ops & op precedence... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 + 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 + 1 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 1 ))' + atf_check -s exit:0 -o inline:'10\n' -e empty ${TEST_SH} -c \ + 'echo $(( 4 + 6 ))' + atf_check -s exit:0 -o inline:'10\n' -e empty ${TEST_SH} -c \ + 'echo $(( 6 + 4 ))' + atf_check -s exit:0 -o inline:'5555\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 + 4321 ))' + atf_check -s exit:0 -o inline:'3333\n' -e empty ${TEST_SH} -c \ + 'echo $((1111+2222))' + atf_check -s exit:0 -o inline:'5555\n' -e empty ${TEST_SH} -c \ + 'echo $((+3333+2222))' + atf_check -s exit:0 -o inline:'7777\n' -e empty ${TEST_SH} -c \ + 'echo $((+3333 + +4444))' + atf_check -s exit:0 -o inline:'-7777\n' -e empty ${TEST_SH} -c \ + 'echo -$((+4125+ +3652))' +} + +atf_test_case elementary_sub +elementary_sub_head() +{ + atf_set "descr" "Tests that simple subtraction works as expected" +} +elementary_sub_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 - 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 - 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 - 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 - 1 ))' + atf_check -s exit:0 -o inline:'488\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1066 - 578 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016-5678 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016+-5678 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016-+5678 ))' + atf_check -s exit:0 -o inline:'-7694\n' -e empty ${TEST_SH} -c \ + 'echo $(( -2016-5678 ))' + atf_check -s exit:0 -o inline:'--1\n' -e empty ${TEST_SH} -c \ + 'echo -$(( -1018 - -1017 ))' +} + +atf_test_case elementary_mul +elementary_mul_head() +{ + atf_set "descr" "Tests that simple multiplication works as expected" +} +elementary_mul_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 * 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 * 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 * 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * -1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 * -1 ))' + atf_check -s exit:0 -o inline:'391\n' -e empty ${TEST_SH} -c \ + 'echo $(( 17 * 23 ))' + atf_check -s exit:0 -o inline:'169\n' -e empty ${TEST_SH} -c \ + 'echo $(( 13*13 ))' + atf_check -s exit:0 -o inline:'-11264\n' -e empty ${TEST_SH} -c \ + 'echo $(( -11 *1024 ))' + atf_check -s exit:0 -o inline:'-16983\n' -e empty ${TEST_SH} -c \ + 'echo $(( 17* -999 ))' + atf_check -s exit:0 -o inline:'9309\n' -e empty ${TEST_SH} -c \ + 'echo $(( -29*-321 ))' +} + +atf_test_case elementary_div +elementary_div_head() +{ + atf_set "descr" "Tests that simple division works as expected" +} +elementary_div_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 / 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 / 1 ))' + test ${ARITH_BITS} -ge 38 && + atf_check -s exit:0 -o inline:'99999999999\n' -e empty \ + ${TEST_SH} -c 'echo $(( 99999999999 / 1 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 / 1 ))' + + atf_check -s exit:0 -o inline:'3\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 4 ))' + + atf_check -s exit:0 -o inline:'173\n' -e empty ${TEST_SH} -c \ + 'echo $(( 123456 / 713 ))' + atf_check -s exit:0 -o inline:'13\n' -e empty ${TEST_SH} -c \ + 'echo $(( 169 / 13 ))' +} + +atf_test_case elementary_rem +elementary_rem_head() +{ + atf_set "descr" "Tests that simple modulus works as expected" +} +elementary_rem_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 9999 % 1 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 2 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF % 2 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 3 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 3 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 % 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3123 % 3 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 9999 % 2 ))' + + atf_check -s exit:0 -o inline:'107\n' -e empty ${TEST_SH} -c \ + 'echo $(( 123456%173 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((169%13))' +} + +atf_test_case elementary_shl +elementary_shl_head() +{ + atf_set "descr" "Tests that simple shift left works as expected" +} +elementary_shl_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 17 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 0 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 1 ))' + atf_check -s exit:0 -o inline:'131072\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 17 ))' + + atf_check -s exit:0 -o inline:'2021161080\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x3C3C3C3C << 1 ))' + + test "${ARITH_BITS}" -ge 40 && + atf_check -s exit:0 -o inline:'129354309120\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x3C3C3C3C << 7 ))' + test "${ARITH_BITS}" -ge 72 && + atf_check -s exit:0 -o inline:'1111145054534149079040\n' \ + -e empty ${TEST_SH} -c 'echo $(( 0x3C3C3C3C << 40 ))' + + return 0 +} + +atf_test_case elementary_shr +elementary_shr_head() +{ + atf_set "descr" "Tests that simple shift right works as expected" +} +elementary_shr_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 17 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >> 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >> 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 >> 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 >> 1 ))' + + atf_check -s exit:0 -o inline:'4\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x10 >> 2 ))' + atf_check -s exit:0 -o inline:'4\n' -e empty ${TEST_SH} -c \ + 'echo $(( 022 >> 2 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 131072 >> 17 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'8\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x4000000000 >> 35 ))' + test ${ARITH_BITS} -ge 80 && + atf_check -s exit:0 -o inline:'4464\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x93400FACE005C871000 >> 64 ))' + + return 0 +} + +atf_test_case elementary_eq +elementary_eq_head() +{ + atf_set "descr" "Tests that simple equality test works as expected" +} +elementary_eq_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0000 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0x00 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 == 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=30; Y=0x1E; echo $(( X == Y ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 == 4660 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 == 011064 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0000000000000001 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0x10000000000000 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 == 2 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=3; Y=7; echo $(( X == Y ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 == 0x4660 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 01234 == 0x11064 ))' +} +atf_test_case elementary_ne +elementary_ne_head() +{ + atf_set "descr" "Tests that simple inequality test works as expected" +} +elementary_ne_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 != 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x71 != 17 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 != 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 != 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=3; echo $(( X != 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=3; Y=0x11; echo $(( X != Y ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 != 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 != 0x0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA != 012 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=1; echo $(( X != 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=0xC; Y=014; echo $(( X != Y ))' +} +atf_test_case elementary_lt +elementary_lt_head() +{ + atf_set "descr" "Tests that simple less than test works as expected" +} +elementary_lt_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 < 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 10 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 100 < 101 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 < 200 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 0 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1BEEFF00D < 0x1FACECAFE ))' + + return 0 +} +atf_test_case elementary_le +elementary_le_head() +{ + atf_set "descr" "Tests that simple less or equal test works as expected" +} +elementary_le_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 <= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 10 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 100 <= 101 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 <= 161 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 <= 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -100 <= -200 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'cost=; AUD=; echo $(( $cost 0x2FEEDBABE <= $AUD 12866927294 ))' + + return 0 +} +atf_test_case elementary_gt +elementary_gt_head() +{ + atf_set "descr" "Tests that simple greater than works as expected" +} +elementary_gt_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 > 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 > -1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 11 > 012 ))' + + # atf_expect_fail "PR bin/50959" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2147483647 > 0X7FFFFF0 ))' + # atf_expect_pass + + test ${ARITH_BITS} -gt 32 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x80000000 > 0x7FFFFFFF ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 > 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 10 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2015 > 2016 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 > 200 ))' + + test ${ARITH_BITS} -ge 44 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x7F07F07F0 > 34099628014 ))' + + return 0 +} +atf_test_case elementary_ge +elementary_ge_head() +{ + atf_set "descr" "Tests that simple greater or equal works as expected" +} +elementary_ge_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -100 >= -101 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 >= 0 ))' +} + +atf_test_case fiddle_bits_and +fiddle_bits_and_head() +{ + atf_set "descr" "Test bitwise and operations in arithmetic expressions" +} +fiddle_bits_and_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 & 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 & 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 & 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 & 1 ))' + + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFF & 0xFF ))' + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF & 0377 ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'70377641607203\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 & 0x42871357BAB3 ))' + + return 0 +} +atf_test_case fiddle_bits_or +fiddle_bits_or_head() +{ + atf_set "descr" "Test bitwise or operations in arithmetic expressions" +} +fiddle_bits_or_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 | 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 | 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 | 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 | 1 ))' + + atf_check -s exit:0 -o inline:'4369\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 | 0x1111 ))' + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xAA | 0125 ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'95348271856563\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 | 0x42871357BAB3 ))' + + return 0 +} +atf_test_case fiddle_bits_xor +fiddle_bits_xor_head() +{ + atf_set "descr" "Test bitwise xor operations in arithmetic expressions" +} +fiddle_bits_xor_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ^ 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ^ 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ^ 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ^ 1 ))' + + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xF0 ^ 0x0F ))' + atf_check -s exit:0 -o inline:'15\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xF0 ^ 0xFF ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'24970630249360\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 ^ 0x42871357BAB3 ))' + + return 0 +} + +atf_test_case logical_and +logical_and_head() +{ + atf_set "descr" "Test logical and operations in arithmetic expressions" +} +logical_and_body() +{ + # cannot test short-circuit eval until sh implements side effects... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 && 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 && 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 && 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 && 1 ))' + + # atf_expect_fail "PR bin/50960" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 && 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF && 0xF0F0 ))' +} +atf_test_case logical_or +logical_or_head() +{ + atf_set "descr" "Test logical or operations in arithmetic expressions" +} +logical_or_body() +{ + # cannot test short-circuit eval until sh implements side effects... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 || 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 || 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 || 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 || 1 ))' + + # atf_expect_fail "PR bin/50960" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 || 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x33 || 0xF0F0 ))' +} + +atf_test_case make_selection +make_selection_head() +{ + atf_set "descr" "Test ?: operator in arithmetic expressions" +} +make_selection_body() +{ + # atf_expect_fail "PR bin/50958" + + atf_check -s exit:0 -o inline:'3\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ? 2 : 3 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ? 2 : 3 ))' + + atf_check -s exit:0 -o inline:'111\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 ? 111 : 222 ))' + + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 2 ? -1 : 1 > 2 ? 1 : 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 1 ? -1 : 1 > 1 ? 1 : 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 < 1 ? -1 : 2 > 1 ? 1 : 0 ))' +} + +atf_test_case operator_precedence +operator_precedence_head() +{ + atf_set "descr" "Test operator precedence without parentheses" +} +operator_precedence_body() +{ + # NB: apart from $(( )) ** NO ** parentheses in the expressions. + + atf_check -s exit:0 -o inline:'6\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 2 + 3 ))' *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Sep 3 18:54: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 8AF76BCEB12; Sat, 3 Sep 2016 18:54:27 +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 5E02D7C2; Sat, 3 Sep 2016 18:54:27 +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 u83IsQfn095747; Sat, 3 Sep 2016 18:54:26 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83IsQ4H095746; Sat, 3 Sep 2016 18:54:26 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609031854.u83IsQ4H095746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Sep 2016 18:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305359 - head/sys/dev/cxgbe/cxgbei 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.22 Precedence: list List-Id: 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, 03 Sep 2016 18:54:27 -0000 Author: np Date: Sat Sep 3 18:54:26 2016 New Revision: 305359 URL: https://svnweb.freebsd.org/changeset/base/305359 Log: Use correct CTR variant. Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Sat Sep 3 18:11:48 2016 (r305358) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Sat Sep 3 18:54:26 2016 (r305359) @@ -355,7 +355,7 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const val = be32toh(cpl->ddpvld); #if 0 - CTR4(KTR_CXGBE, + CTR5(KTR_CXGBE, "%s: tid %u, cpl->len %u, ddpvld 0x%08x, icp_flags 0x%08x", __func__, tid, pdu_len, val, icp->icp_flags); #endif From owner-svn-src-head@freebsd.org Sat Sep 3 19:01: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 72875BCEBFC; Sat, 3 Sep 2016 19:01:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB4FAE4; Sat, 3 Sep 2016 19:01:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83J1Brk096053; Sat, 3 Sep 2016 19:01:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83J1BW9096052; Sat, 3 Sep 2016 19:01:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201609031901.u83J1BW9096052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Sep 2016 19:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305360 - head/sys/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.22 Precedence: list List-Id: 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, 03 Sep 2016 19:01:12 -0000 Author: dim Date: Sat Sep 3 19:01:11 2016 New Revision: 305360 URL: https://svnweb.freebsd.org/changeset/base/305360 Log: With clang 3.9.0, compiling cxgb results in the following warning: sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion] *mtod(m, char *) = CPL_ASYNC_NOTIF; ~ ^~~~~~~~~~~~~~~ This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is wrapped to a negative value. Fix this by using uint8_t instead. Reviewed by: np MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7772 Modified: head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Sep 3 18:54:26 2016 (r305359) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Sep 3 19:01:11 2016 (r305360) @@ -2870,7 +2870,7 @@ process_responses(adapter_t *adap, struc memcpy(mtod(m, char *), r, AN_PKT_SIZE); m->m_len = m->m_pkthdr.len = AN_PKT_SIZE; - *mtod(m, char *) = CPL_ASYNC_NOTIF; + *mtod(m, uint8_t *) = CPL_ASYNC_NOTIF; opcode = CPL_ASYNC_NOTIF; eop = 1; rspq->async_notif++; From owner-svn-src-head@freebsd.org Sat Sep 3 19: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 5E673BCE199 for ; Sat, 3 Sep 2016 19:16:54 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::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 EC74634F for ; Sat, 3 Sep 2016 19:16:53 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22b.google.com with SMTP id c133so71596563wmd.1 for ; Sat, 03 Sep 2016 12:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IRGa1oz5jruMBwRS/e6RcXfcfP/VmMTJwQNVTi0LT0M=; b=03vQUrhh+CFPK9ch+1uCCZh4NM/PEdjw5m1lx+Ubv8kMGoBJSIk6YcOZ0uvh3CIniy Tb0o5GQnmCL2Ijp0kdShL8Mi2TEUos0Ggv7FOncVvFyJlmgDBj4ckeK8FsEJRj7bxjhp E+FpgctubzaB3RGpKFEe9GRTTeENns76P0Cgz6jnBXlFw/PwHHLvxBgX3611zNEO0PjL QFyuRrySmzZklyEuEbZmEcAZMfw9tgL/vb/+CidGHR6tqQ9vFgu8flyieW5WUJxoVUF0 yD8f15qmBnih9sKsdyOqGMMc6/hElYsVnp5HFI3mhOT2Ev0bogHXeteIGszz/j1dm5mT HIVA== 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; bh=IRGa1oz5jruMBwRS/e6RcXfcfP/VmMTJwQNVTi0LT0M=; b=JrenJLF1eZUwu0yE9IZzjbrwHP2aXMq+My+22b9Df+5Ihogvt3pxIjpLASwiQIQCHl 79IWcd1k85EudpRp79WUGLn0RuRPgxau+Voxkb692TJ4MVXr+1vbKRHRf31sSPhpYSyD 5cLRHa+2LklgocxDKDAZDhQRMcyHaeAg5MMv1t5c9QptjWOJHCfEYP53w9B4blRlpPYu retajogWSgisiCQapmLHWQXsY94V5KPV3VWXMWbA5BwXmMbnxxsBLTQrSZRCBq0+yKty UZGBPPMqkJdVVrlQOKWeEuL8zFTWqKBpCN4E2827lvJMKEL9UVX7XFFUp+2iJHFDb6Na 15Wg== X-Gm-Message-State: AE9vXwP+Ntb4Vx0wWBPwa2EPCvdkmQuysd5Fyq3ARkSdLKMLp53LeSRT48qVwCh4rhgWwbsXPn1ZAG/t8AIZm2Kr X-Received: by 10.194.144.114 with SMTP id sl18mr24828466wjb.123.1472930212473; Sat, 03 Sep 2016 12:16:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.236.231 with HTTP; Sat, 3 Sep 2016 12:16:51 -0700 (PDT) In-Reply-To: References: <201609031528.u83FS91u017461@repo.freebsd.org> From: Oliver Pinter Date: Sat, 3 Sep 2016 21:16:51 +0200 Message-ID: Subject: Re: svn commit: r305354 - head/sys/arm/allwinner To: Jared McNeill 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.22 Precedence: list List-Id: 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, 03 Sep 2016 19:16:54 -0000 Hi! Thanks for explanation. The feature's name is very misleading... On 9/3/16, Jared McNeill wrote: > Hi Oliver -- > > It's really just a serial number. The Allwinner A20 datasheet refers to it > as a root key, later ones such as A83T refer to it as chip ID. U-Boot > uses the same process to generate MAC addresses for all Allwinner boards. > > Cheers, > Jared > > > On Sat, 3 Sep 2016, Oliver Pinter wrote: > >> Hi! >> >> On 9/3/16, Jared McNeill wrote: >>> Author: jmcneill >>> Date: Sat Sep 3 15:28:09 2016 >>> New Revision: 305354 >>> URL: https://svnweb.freebsd.org/changeset/base/305354 >>> >>> Log: >>> Use the root key in the Security ID EFUSE (when valid) to generate a >>> MAC address instead of creating a random one each boot. >> >> Could you please describe a little more about this root key? What is >> it? What's the main purpose? Is is a crypto root key? >> >>> >>> Modified: >>> head/sys/arm/allwinner/if_awg.c >>> >>> Modified: head/sys/arm/allwinner/if_awg.c >>> ============================================================================== >>> --- head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:26:28 2016 (r305353) >>> +++ head/sys/arm/allwinner/if_awg.c Sat Sep 3 15:28:09 2016 (r305354) >>> @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); >>> #include >>> >>> #include >>> +#include >>> #include >>> #include >>> >>> @@ -1277,6 +1278,7 @@ awg_get_eaddr(device_t dev, uint8_t *ead >>> { >>> struct awg_softc *sc; >>> uint32_t maclo, machi, rnd; >>> + u_char rootkey[16]; >>> >>> sc = device_get_softc(dev); >>> >>> @@ -1285,9 +1287,19 @@ awg_get_eaddr(device_t dev, uint8_t *ead >>> >>> if (maclo == 0xffffffff && machi == 0xffff) { >>> /* MAC address in hardware is invalid, create one */ >>> - rnd = arc4random(); >>> - maclo = 0x00f2 | (rnd & 0xffff0000); >>> - machi = rnd & 0xffff; >>> + if (aw_sid_get_rootkey(rootkey) == 0 && >>> + (rootkey[3] | rootkey[12] | rootkey[13] | rootkey[14] | >>> + rootkey[15]) != 0) { >>> + /* MAC address is derived from the root key in SID */ >>> + maclo = (rootkey[13] << 24) | (rootkey[12] << 16) | >>> + (rootkey[3] << 8) | 0x02; >>> + machi = (rootkey[15] << 8) | rootkey[14]; >>> + } else { >>> + /* Create one */ >>> + rnd = arc4random(); >>> + maclo = 0x00f2 | (rnd & 0xffff0000); >>> + machi = rnd & 0xffff; >>> + } >>> } >>> >>> eaddr[0] = maclo & 0xff; >>> _______________________________________________ >>> 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 Sat Sep 3 20:38: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 37741BCE949; Sat, 3 Sep 2016 20:38:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 078D1C53; Sat, 3 Sep 2016 20:38:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83KcGlY033386; Sat, 3 Sep 2016 20:38:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83KcDYA033362; Sat, 3 Sep 2016 20:38:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201609032038.u83KcDYA033362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 3 Sep 2016 20:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305362 - in head: share/man/man9 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/i386/i386 sys/i386/include sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/powerpc/powerpc... 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.22 Precedence: list List-Id: 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, 03 Sep 2016 20:38:17 -0000 Author: markj Date: Sat Sep 3 20:38:13 2016 New Revision: 305362 URL: https://svnweb.freebsd.org/changeset/base/305362 Log: Remove support for idle page zeroing. Idle page zeroing has been disabled by default on all architectures since r170816 and has some bugs that make it seemingly unusable. Specifically, the idle-priority pagezero thread exacerbates contention for the free page lock, and yields the CPU without releasing it in non-preemptive kernels. The pagezero thread also does not behave correctly when superpage reservations are enabled: its target is a function of v_free_count, which includes reserved-but-free pages, but it is only able to zero pages belonging to the physical memory allocator. Reviewed by: alc, imp, kib Differential Revision: https://reviews.freebsd.org/D7714 Deleted: head/sys/vm/vm_zeroidle.c Modified: head/share/man/man9/Makefile head/share/man/man9/pmap.9 head/share/man/man9/pmap_zero_page.9 head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v4.c head/sys/arm/arm/pmap-v6.c head/sys/arm64/arm64/pmap.c head/sys/conf/files head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/riscv/riscv/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/pmap.h head/sys/vm/vm_meter.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Sep 3 19:09:01 2016 (r305361) +++ head/share/man/man9/Makefile Sat Sep 3 20:38:13 2016 (r305362) @@ -1391,8 +1391,7 @@ MLINKS+=pmap_quick_enter_page.9 pmap_qui MLINKS+=pmap_remove.9 pmap_remove_all.9 \ pmap_remove.9 pmap_remove_pages.9 MLINKS+=pmap_resident_count.9 pmap_wired_count.9 -MLINKS+=pmap_zero_page.9 pmap_zero_area.9 \ - pmap_zero_page.9 pmap_zero_idle.9 +MLINKS+=pmap_zero_page.9 pmap_zero_area.9 MLINKS+=printf.9 log.9 \ printf.9 tprintf.9 \ printf.9 uprintf.9 Modified: head/share/man/man9/pmap.9 ============================================================================== --- head/share/man/man9/pmap.9 Sat Sep 3 19:09:01 2016 (r305361) +++ head/share/man/man9/pmap.9 Sat Sep 3 20:38:13 2016 (r305362) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2014 +.Dd August 30, 2016 .Dt PMAP 9 .Os .Sh NAME @@ -121,7 +121,6 @@ operation. .Xr pmap_unwire 9 , .Xr pmap_wired_count 9 , .Xr pmap_zero_area 9 , -.Xr pmap_zero_idle 9 , .Xr pmap_zero_page 9 , .Xr vm_map 9 .Sh AUTHORS Modified: head/share/man/man9/pmap_zero_page.9 ============================================================================== --- head/share/man/man9/pmap_zero_page.9 Sat Sep 3 19:09:01 2016 (r305361) +++ head/share/man/man9/pmap_zero_page.9 Sat Sep 3 20:38:13 2016 (r305362) @@ -25,13 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2003 +.Dd August 30, 2016 .Dt PMAP_ZERO 9 .Os .Sh NAME .Nm pmap_zero_page , .Nm pmap_zero_area , -.Nm pmap_zero_idle .Nd zero-fill a page using machine-dependent optimizations .Sh SYNOPSIS .In sys/param.h @@ -41,8 +40,6 @@ .Fn pmap_zero_page "vm_page_t m" .Ft void .Fn pmap_zero_page_area "vm_page_t m" "int off" "int size" -.Ft void -.Fn pmap_zero_page_idle "vm_page_t m" .Sh DESCRIPTION The .Fn pmap_zero_page @@ -53,14 +50,6 @@ function is used to zero-fill an area of The range specified must not cross a page boundary; it must be contained entirely within a single page. .Pp -The -.Fn pmap_zero_page_idle -interface is used by the -.Nm vm_pagezero -process. -The system-wide -.Va Giant -lock should not be required to be held in order to call this interface. .Sh IMPLEMENTATION NOTES This function is required to be implemented for each architecture supported by .Fx . Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/amd64/amd64/pmap.c Sat Sep 3 20:38:13 2016 (r305362) @@ -5179,19 +5179,6 @@ pmap_zero_page_area(vm_page_t m, int off } /* - * Zero the specified hardware page in a way that minimizes cache thrashing. - * This is intended to be called from the vm_pagezero process only and - * outside of Giant. - */ -void -pmap_zero_page_idle(vm_page_t m) -{ - vm_offset_t va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - - sse2_pagezero((void *)va); -} - -/* * Copy 1 specified hardware page to another. */ void Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/arm/arm/pmap-v4.c Sat Sep 3 20:38:13 2016 (r305362) @@ -4079,19 +4079,6 @@ pmap_zero_page_area(vm_page_t m, int off } -/* - * pmap_zero_page_idle zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. This - * is intended to be called from the vm_pagezero process only and - * outside of Giant. - */ -void -pmap_zero_page_idle(vm_page_t m) -{ - - pmap_zero_page(m); -} - #if 0 /* * pmap_clean_page() Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/arm/arm/pmap-v6.c Sat Sep 3 20:38:13 2016 (r305362) @@ -306,8 +306,6 @@ struct sysmaps { 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 = NULL; /* XXX move it to machdep.c */ @@ -1176,7 +1174,6 @@ pmap_bootstrap(vm_offset_t firstaddr) /* * Local CMAP1/CMAP2 are used for zeroing and copying pages. * Local CMAP3 is used for data cache cleaning. - * Global CMAP3 is used for the idle process page zeroing. */ for (i = 0; i < MAXCPU; i++) { sysmaps = &sysmaps_pcpu[i]; @@ -1185,7 +1182,6 @@ pmap_bootstrap(vm_offset_t firstaddr) SYSMAP(caddr_t, sysmaps->CMAP2, sysmaps->CADDR2, 1); SYSMAP(caddr_t, sysmaps->CMAP3, sysmaps->CADDR3, 1); } - SYSMAP(caddr_t, CMAP3, CADDR3, 1); /* * Crashdump maps. @@ -5805,27 +5801,6 @@ pmap_zero_page_area(vm_page_t m, int off } /* - * pmap_zero_page_idle zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. This - * is intended to be called from the vm_pagezero process only and - * outside of Giant. - */ -void -pmap_zero_page_idle(vm_page_t m) -{ - - if (pte2_load(CMAP3) != 0) - panic("%s: CMAP3 busy", __func__); - sched_pin(); - pte2_store(CMAP3, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW, - vm_page_pte2_attr(m))); - pagezero(CADDR3); - pte2_clear(CMAP3); - tlb_flush((vm_offset_t)CADDR3); - sched_unpin(); -} - -/* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using * bcopy to copy the page, one machine dependent page at a Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/arm64/arm64/pmap.c Sat Sep 3 20:38:13 2016 (r305362) @@ -3264,20 +3264,6 @@ pmap_zero_page_area(vm_page_t m, int off } /* - * pmap_zero_page_idle zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. This - * is intended to be called from the vm_pagezero process only and - * outside of Giant. - */ -void -pmap_zero_page_idle(vm_page_t m) -{ - vm_offset_t va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - - pagezero((void *)va); -} - -/* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using * bcopy to copy the page, one machine dependent page at a Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/conf/files Sat Sep 3 20:38:13 2016 (r305362) @@ -4369,7 +4369,6 @@ vm/vm_radix.c standard vm/vm_reserv.c standard vm/vm_domain.c standard vm/vm_unix.c standard -vm/vm_zeroidle.c standard vm/vnode_pager.c standard xen/features.c optional xenhvm xen/xenbus/xenbus_if.m optional xenhvm Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/i386/i386/pmap.c Sat Sep 3 20:38:13 2016 (r305362) @@ -444,7 +444,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * CMAP1/CMAP2 are used for zeroing and copying pages. - * CMAP3 is used for the idle process page zeroing. + * CMAP3 is used for the boot-time memory test. */ for (i = 0; i < MAXCPU; i++) { sysmaps = &sysmaps_pcpu[i]; @@ -452,7 +452,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) SYSMAP(caddr_t, sysmaps->CMAP1, sysmaps->CADDR1, 1) SYSMAP(caddr_t, sysmaps->CMAP2, sysmaps->CADDR2, 1) } - SYSMAP(caddr_t, CMAP3, CADDR3, 1) + SYSMAP(caddr_t, CMAP3, CADDR3, 1); /* * Crashdump maps. @@ -4242,26 +4242,6 @@ pmap_zero_page_area(vm_page_t m, int off } /* - * Zero the specified hardware page in a way that minimizes cache thrashing. - * This is intended to be called from the vm_pagezero process only and - * outside of Giant. - */ -void -pmap_zero_page_idle(vm_page_t m) -{ - - if (*CMAP3) - panic("pmap_zero_page_idle: CMAP3 busy"); - sched_pin(); - *CMAP3 = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | PG_A | PG_M | - pmap_cache_bits(m->md.pat_mode, 0); - invlcaddr(CADDR3); - pagezero(CADDR3); - *CMAP3 = 0; - sched_unpin(); -} - -/* * Copy 1 specified hardware page to another. */ void Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/i386/include/pmap.h Sat Sep 3 20:38:13 2016 (r305362) @@ -353,7 +353,7 @@ struct pv_chunk { #ifdef _KERNEL -extern caddr_t CADDR3; +extern caddr_t CADDR3; extern pt_entry_t *CMAP3; extern vm_paddr_t phys_avail[]; extern vm_paddr_t dump_avail[]; Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/mips/mips/pmap.c Sat Sep 3 20:38:13 2016 (r305362) @@ -2558,24 +2558,6 @@ pmap_zero_page_area(vm_page_t m, int off } } -void -pmap_zero_page_idle(vm_page_t m) -{ - vm_offset_t va; - vm_paddr_t phys = VM_PAGE_TO_PHYS(m); - - if (MIPS_DIRECT_MAPPABLE(phys)) { - va = MIPS_PHYS_TO_DIRECT(phys); - bzero((caddr_t)va, PAGE_SIZE); - mips_dcache_wbinv_range(va, PAGE_SIZE); - } else { - va = pmap_lmem_map1(phys); - bzero((caddr_t)va, PAGE_SIZE); - mips_dcache_wbinv_range(va, PAGE_SIZE); - pmap_lmem_unmap(); - } -} - /* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/powerpc/aim/mmu_oea.c Sat Sep 3 20:38:13 2016 (r305362) @@ -300,7 +300,6 @@ void moea_remove_write(mmu_t, vm_page_t) void moea_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); void moea_zero_page(mmu_t, vm_page_t); void moea_zero_page_area(mmu_t, vm_page_t, int, int); -void moea_zero_page_idle(mmu_t, vm_page_t); void moea_activate(mmu_t, struct thread *); void moea_deactivate(mmu_t, struct thread *); void moea_cpu_bootstrap(mmu_t, int); @@ -349,7 +348,6 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_unwire, moea_unwire), MMUMETHOD(mmu_zero_page, moea_zero_page), MMUMETHOD(mmu_zero_page_area, moea_zero_page_area), - MMUMETHOD(mmu_zero_page_idle, moea_zero_page_idle), MMUMETHOD(mmu_activate, moea_activate), MMUMETHOD(mmu_deactivate, moea_deactivate), MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), @@ -1081,13 +1079,6 @@ moea_zero_page_area(mmu_t mmu, vm_page_t bzero(va, size); } -void -moea_zero_page_idle(mmu_t mmu, vm_page_t m) -{ - - moea_zero_page(mmu, m); -} - vm_offset_t moea_quick_enter_page(mmu_t mmu, vm_page_t m) { Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Sep 3 20:38:13 2016 (r305362) @@ -265,7 +265,6 @@ void moea64_remove_write(mmu_t, vm_page_ void moea64_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); void moea64_zero_page(mmu_t, vm_page_t); void moea64_zero_page_area(mmu_t, vm_page_t, int, int); -void moea64_zero_page_idle(mmu_t, vm_page_t); void moea64_activate(mmu_t, struct thread *); void moea64_deactivate(mmu_t, struct thread *); void *moea64_mapdev(mmu_t, vm_paddr_t, vm_size_t); @@ -314,7 +313,6 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_unwire, moea64_unwire), MMUMETHOD(mmu_zero_page, moea64_zero_page), MMUMETHOD(mmu_zero_page_area, moea64_zero_page_area), - MMUMETHOD(mmu_zero_page_idle, moea64_zero_page_idle), MMUMETHOD(mmu_activate, moea64_activate), MMUMETHOD(mmu_deactivate, moea64_deactivate), MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), @@ -1230,13 +1228,6 @@ moea64_zero_page(mmu_t mmu, vm_page_t m) mtx_unlock(&moea64_scratchpage_mtx); } -void -moea64_zero_page_idle(mmu_t mmu, vm_page_t m) -{ - - moea64_zero_page(mmu, m); -} - vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m) { Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/powerpc/booke/pmap.c Sat Sep 3 20:38:13 2016 (r305362) @@ -130,12 +130,6 @@ static struct mtx zero_page_mutex; static struct mtx tlbivax_mutex; -/* - * Reserved KVA space for mmu_booke_zero_page_idle. This is used - * by idle thred only, no lock required. - */ -static vm_offset_t zero_page_idle_va; - /* Reserved KVA space and mutex for mmu_booke_copy_page. */ static vm_offset_t copy_page_src_va; static vm_offset_t copy_page_dst_va; @@ -312,7 +306,6 @@ static void mmu_booke_remove_write(mmu_ static void mmu_booke_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); static void mmu_booke_zero_page(mmu_t, vm_page_t); static void mmu_booke_zero_page_area(mmu_t, vm_page_t, int, int); -static void mmu_booke_zero_page_idle(mmu_t, vm_page_t); static void mmu_booke_activate(mmu_t, struct thread *); static void mmu_booke_deactivate(mmu_t, struct thread *); static void mmu_booke_bootstrap(mmu_t, vm_offset_t, vm_offset_t); @@ -371,7 +364,6 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_unwire, mmu_booke_unwire), MMUMETHOD(mmu_zero_page, mmu_booke_zero_page), MMUMETHOD(mmu_zero_page_area, mmu_booke_zero_page_area), - MMUMETHOD(mmu_zero_page_idle, mmu_booke_zero_page_idle), MMUMETHOD(mmu_activate, mmu_booke_activate), MMUMETHOD(mmu_deactivate, mmu_booke_deactivate), MMUMETHOD(mmu_quick_enter_page, mmu_booke_quick_enter_page), @@ -1147,14 +1139,11 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Allocate KVA space for page zero/copy operations. */ zero_page_va = virtual_avail; virtual_avail += PAGE_SIZE; - zero_page_idle_va = virtual_avail; - virtual_avail += PAGE_SIZE; copy_page_src_va = virtual_avail; virtual_avail += PAGE_SIZE; copy_page_dst_va = virtual_avail; virtual_avail += PAGE_SIZE; debugf("zero_page_va = 0x%08x\n", zero_page_va); - debugf("zero_page_idle_va = 0x%08x\n", zero_page_idle_va); debugf("copy_page_src_va = 0x%08x\n", copy_page_src_va); debugf("copy_page_dst_va = 0x%08x\n", copy_page_dst_va); @@ -2326,23 +2315,6 @@ mmu_booke_copy_pages(mmu_t mmu, vm_page_ mtx_unlock(©_page_mutex); } -/* - * mmu_booke_zero_page_idle zeros the specified hardware page by mapping it - * into virtual memory and using bzero to clear its contents. This is intended - * to be called from the vm_pagezero process only and outside of Giant. No - * lock is required. - */ -static void -mmu_booke_zero_page_idle(mmu_t mmu, vm_page_t m) -{ - vm_offset_t va; - - va = zero_page_idle_va; - mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); - bzero((caddr_t)va, PAGE_SIZE); - mmu_booke_kremove(mmu, va); -} - static vm_offset_t mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) { Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/powerpc/powerpc/mmu_if.m Sat Sep 3 20:38:13 2016 (r305362) @@ -659,18 +659,6 @@ METHOD void zero_page_area { /** - * @brief Called from the idle loop to zero pages. XXX I think locking - * constraints might be different here compared to zero_page. - * - * @param _pg physical page - */ -METHOD void zero_page_idle { - mmu_t _mmu; - vm_page_t _pg; -}; - - -/** * @brief Extract mincore(2) information from a mapping. * * @param _pmap physical map Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Sat Sep 3 20:38:13 2016 (r305362) @@ -380,14 +380,6 @@ pmap_zero_page_area(vm_page_t m, int off MMU_ZERO_PAGE_AREA(mmu_obj, m, off, size); } -void -pmap_zero_page_idle(vm_page_t m) -{ - - CTR2(KTR_PMAP, "%s(%p)", __func__, m); - MMU_ZERO_PAGE_IDLE(mmu_obj, m); -} - int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/riscv/riscv/pmap.c Sat Sep 3 20:38:13 2016 (r305362) @@ -2538,20 +2538,6 @@ pmap_zero_page_area(vm_page_t m, int off } /* - * pmap_zero_page_idle zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. This - * is intended to be called from the vm_pagezero process only and - * outside of Giant. - */ -void -pmap_zero_page_idle(vm_page_t m) -{ - vm_offset_t va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - - pagezero((void *)va); -} - -/* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using * bcopy to copy the page, one machine dependent page at a Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/sparc64/sparc64/pmap.c Sat Sep 3 20:38:13 2016 (r305362) @@ -223,10 +223,6 @@ PMAP_STATS_VAR(pmap_nzero_page_area); PMAP_STATS_VAR(pmap_nzero_page_area_c); PMAP_STATS_VAR(pmap_nzero_page_area_oc); PMAP_STATS_VAR(pmap_nzero_page_area_nc); -PMAP_STATS_VAR(pmap_nzero_page_idle); -PMAP_STATS_VAR(pmap_nzero_page_idle_c); -PMAP_STATS_VAR(pmap_nzero_page_idle_oc); -PMAP_STATS_VAR(pmap_nzero_page_idle_nc); PMAP_STATS_VAR(pmap_ncopy_page); PMAP_STATS_VAR(pmap_ncopy_page_c); PMAP_STATS_VAR(pmap_ncopy_page_oc); @@ -1849,35 +1845,6 @@ pmap_zero_page_area(vm_page_t m, int off } void -pmap_zero_page_idle(vm_page_t m) -{ - struct tte *tp; - vm_offset_t va; - vm_paddr_t pa; - - KASSERT((m->flags & PG_FICTITIOUS) == 0, - ("pmap_zero_page_idle: fake page")); - PMAP_STATS_INC(pmap_nzero_page_idle); - pa = VM_PAGE_TO_PHYS(m); - if (dcache_color_ignore != 0 || m->md.color == DCACHE_COLOR(pa)) { - PMAP_STATS_INC(pmap_nzero_page_idle_c); - va = TLB_PHYS_TO_DIRECT(pa); - cpu_block_zero((void *)va, PAGE_SIZE); - } else if (m->md.color == -1) { - PMAP_STATS_INC(pmap_nzero_page_idle_nc); - aszero(ASI_PHYS_USE_EC, pa, PAGE_SIZE); - } else { - PMAP_STATS_INC(pmap_nzero_page_idle_oc); - va = pmap_idle_map + (m->md.color * PAGE_SIZE); - tp = tsb_kvtotte(va); - tp->tte_data = TD_V | TD_8K | TD_PA(pa) | TD_CP | TD_CV | TD_W; - tp->tte_vpn = TV_VPN(va, TS_8K); - cpu_block_zero((void *)va, PAGE_SIZE); - tlb_page_demap(kernel_pmap, va); - } -} - -void pmap_copy_page(vm_page_t msrc, vm_page_t mdst) { vm_offset_t vdst; Modified: head/sys/vm/pmap.h ============================================================================== --- head/sys/vm/pmap.h Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/vm/pmap.h Sat Sep 3 20:38:13 2016 (r305362) @@ -153,7 +153,6 @@ boolean_t pmap_ts_referenced(vm_page_t void pmap_unwire(pmap_t pmap, vm_offset_t start, vm_offset_t end); void pmap_zero_page(vm_page_t); void pmap_zero_page_area(vm_page_t, int off, int size); -void pmap_zero_page_idle(vm_page_t); #define pmap_resident_count(pm) ((pm)->pm_stats.resident_count) #define pmap_wired_count(pm) ((pm)->pm_stats.wired_count) Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/vm/vm_meter.c Sat Sep 3 20:38:13 2016 (r305362) @@ -306,6 +306,3 @@ VM_STATS_VM(v_forkpages, "VM pages affec VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); - -SYSCTL_INT(_vm_stats_misc, OID_AUTO, zero_page_count, CTLFLAG_RD, - &vm_page_zero_count, 0, "Number of zero-ed free pages"); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/vm/vm_page.c Sat Sep 3 20:38:13 2016 (r305362) @@ -134,7 +134,6 @@ struct mtx_padalign pa_lock[PA_LOCK_COUN vm_page_t vm_page_array; long vm_page_array_size; long first_page; -int vm_page_zero_count; static int boot_pages = UMA_BOOT_PAGES; SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, @@ -1735,8 +1734,6 @@ vm_page_alloc(vm_object_t object, vm_pin KASSERT(m->valid == 0, ("vm_page_alloc: free page %p is valid", m)); vm_phys_freecnt_adj(m, -1); - if ((m->flags & PG_ZERO) != 0) - vm_page_zero_count--; } mtx_unlock(&vm_page_queue_free_mtx); @@ -2042,8 +2039,6 @@ vm_page_alloc_init(vm_page_t m) KASSERT(m->valid == 0, ("vm_page_alloc_init: free page %p is valid", m)); vm_phys_freecnt_adj(m, -1); - if ((m->flags & PG_ZERO) != 0) - vm_page_zero_count--; } return (drop); } @@ -2597,7 +2592,6 @@ cached: #endif vm_phys_free_pages(m, 0); } while ((m = SLIST_FIRST(&free)) != NULL); - vm_page_zero_idle_wakeup(); vm_page_free_wakeup(); mtx_unlock(&vm_page_queue_free_mtx); } @@ -3041,10 +3035,6 @@ vm_page_free_toq(vm_page_t m) if (TRUE) #endif vm_phys_free_pages(m, 0); - if ((m->flags & PG_ZERO) != 0) - ++vm_page_zero_count; - else - vm_page_zero_idle_wakeup(); vm_page_free_wakeup(); mtx_unlock(&vm_page_queue_free_mtx); } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/vm/vm_page.h Sat Sep 3 20:38:13 2016 (r305362) @@ -504,7 +504,6 @@ void vm_page_test_dirty (vm_page_t); vm_page_bits_t vm_page_bits(int base, int size); void vm_page_zero_invalid(vm_page_t m, boolean_t setvalid); void vm_page_free_toq(vm_page_t m); -void vm_page_zero_idle_wakeup(void); void vm_page_dirty_KBI(vm_page_t m); void vm_page_lock_KBI(vm_page_t m, const char *file, int line); Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/vm/vm_phys.c Sat Sep 3 20:38:13 2016 (r305362) @@ -132,10 +132,6 @@ CTASSERT(VM_ISADMA_BOUNDARY < VM_LOWMEM_ CTASSERT(VM_LOWMEM_BOUNDARY < VM_DMA32_BOUNDARY); #endif -static int cnt_prezero; -SYSCTL_INT(_vm_stats_misc, OID_AUTO, cnt_prezero, CTLFLAG_RD, - &cnt_prezero, 0, "The number of physical pages prezeroed at idle time"); - static int sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS); SYSCTL_OID(_vm, OID_AUTO, phys_free, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_vm_phys_free, "A", "Phys Free Info"); @@ -1298,53 +1294,6 @@ vm_phys_unfree_page(vm_page_t m) } /* - * Try to zero one physical page. Used by an idle priority thread. - */ -boolean_t -vm_phys_zero_pages_idle(void) -{ - static struct vm_freelist *fl; - static int flind, oind, pind; - vm_page_t m, m_tmp; - int domain; - - domain = vm_rr_selectdomain(); - fl = vm_phys_free_queues[domain][0][0]; - mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); - for (;;) { - TAILQ_FOREACH_REVERSE(m, &fl[oind].pl, pglist, plinks.q) { - for (m_tmp = m; m_tmp < &m[1 << oind]; m_tmp++) { - if ((m_tmp->flags & (PG_CACHED | PG_ZERO)) == 0) { - vm_phys_unfree_page(m_tmp); - vm_phys_freecnt_adj(m, -1); - mtx_unlock(&vm_page_queue_free_mtx); - pmap_zero_page_idle(m_tmp); - m_tmp->flags |= PG_ZERO; - mtx_lock(&vm_page_queue_free_mtx); - vm_phys_freecnt_adj(m, 1); - vm_phys_free_pages(m_tmp, 0); - vm_page_zero_count++; - cnt_prezero++; - return (TRUE); - } - } - } - oind++; - if (oind == VM_NFREEORDER) { - oind = 0; - pind++; - if (pind == VM_NFREEPOOL) { - pind = 0; - flind++; - if (flind == vm_nfreelists) - flind = 0; - } - fl = vm_phys_free_queues[domain][flind][pind]; - } - } -} - -/* * Allocate a contiguous set of physical pages of the given size * "npages" from the free lists. All of the physical pages must be at * or above the given physical address "low" and below the given Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Sat Sep 3 19:09:01 2016 (r305361) +++ head/sys/vm/vm_phys.h Sat Sep 3 20:38:13 2016 (r305362) @@ -88,7 +88,6 @@ vm_page_t vm_phys_scan_contig(u_long npa u_long alignment, vm_paddr_t boundary, int options); void vm_phys_set_pool(int pool, vm_page_t m, int order); boolean_t vm_phys_unfree_page(vm_page_t m); -boolean_t vm_phys_zero_pages_idle(void); int vm_phys_mem_affinity(int f, int t); /* From owner-svn-src-head@freebsd.org Sat Sep 3 20: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 C242CBCEC71; Sat, 3 Sep 2016 20:44:00 +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 9AE1A21C; Sat, 3 Sep 2016 20:44:00 +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 u83Khx3h036908; Sat, 3 Sep 2016 20:43:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83Khxxb036907; Sat, 3 Sep 2016 20:43:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201609032043.u83Khxxb036907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 3 Sep 2016 20:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305363 - 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.22 Precedence: list List-Id: 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, 03 Sep 2016 20:44:00 -0000 Author: markj Date: Sat Sep 3 20:43:59 2016 New Revision: 305363 URL: https://svnweb.freebsd.org/changeset/base/305363 Log: Remove redefinitions of some kernel types from mbuf.d. These override the kernel's definitions and do not match in some cases, which can break scripts that use these types. With r305055, dtrace is able to trace fields of struct mbuf's anonymous structs and unions, so there is no need to redefine types already defined in CTF. MFC after: 3 days Modified: head/share/dtrace/mbuf.d Modified: head/share/dtrace/mbuf.d ============================================================================== --- head/share/dtrace/mbuf.d Sat Sep 3 20:38:13 2016 (r305362) +++ head/share/dtrace/mbuf.d Sat Sep 3 20:43:59 2016 (r305363) @@ -26,7 +26,6 @@ * $FreeBSD$ * * Translators and flags for the mbuf structure. FreeBSD specific code. - * */ #pragma D depends_on module kernel @@ -110,89 +109,6 @@ inline string mbufflags_string[uint32_t flags & M_PROTO12 ? "M_PROTO12" : "none" ; -/* - * Packet tag structure (see below for details). - */ -typedef struct m_tag { - u_int16_t m_tag_id; /* Tag ID */ - u_int16_t m_tag_len; /* Length of data */ - u_int32_t m_tag_cookie; /* ABI/Module ID */ -} m_tag_t; - -/* - * Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set. - * Size ILP32: 48 - * LP64: 56 - * Compile-time assertions in uipc_mbuf.c test these values to ensure that - * they are correct. - */ -typedef struct pkthdr { -/* struct ifnet *rcvif; */ /* rcv interface */ - int32_t len; /* total packet length */ - - /* Layer crossing persistent information. */ - uint32_t flowid; /* packet's 4-tuple system */ - uint64_t csum_flags; /* checksum and offload features */ - uint16_t fibnum; /* this packet should use this fib */ - uint8_t cosqos; /* class/quality of service */ - uint8_t rsstype; /* hash type */ -} pkthdr_t; - -/* - * Description of external storage mapped into mbuf; valid only if M_EXT is - * set. - * Size ILP32: 28 - * LP64: 48 - * Compile-time assertions in uipc_mbuf.c test these values to ensure that - * they are correct. - */ -typedef struct m_ext { - volatile u_int *ext_cnt; /* pointer to ref count info */ - caddr_t ext_buf; /* start of buffer */ - uint32_t ext_size; /* size of buffer, for ext_free */ - uint32_t ext_type:8, /* type of external storage */ - ext_flags:24; /* external storage mbuf flags */ - void *ext_arg1; /* optional argument pointer */ - void *ext_arg2; /* optional argument pointer */ -} m_ext_t; - -/* - * The core of the mbuf object along with some shortcut defines for practical - * purposes. - */ -struct mbuf { - uintptr_t mbuf_addr; - /* - * Header present at the beginning of every mbuf. - * Size ILP32: 24 - * LP64: 32 - * Compile-time assertions in uipc_mbuf.c test these values to ensure - * that they are correct. - */ - caddr_t m_data; /* location of data */ - int32_t m_len; /* amount of data in this mbuf */ - uint32_t m_type:8, /* type of data in this mbuf */ - m_flags:24; /* flags; see below */ - /* - * A set of optional headers (packet header, external storage header) - * and internal data storage. Historically, these arrays were sized - * to MHLEN (space left after a packet header) and MLEN (space left - * after only a regular mbuf header); they are now variable size in - * order to support future work on variable-size mbufs. - */ - /* union { */ - /* struct { */ - /* struct pkthdr m_pkthdr; */ - /* union { */ - /* struct m_ext m_ext; */ - /* char m_pktdat[0]; */ - /* }; */ - /* }; */ - /* char m_dat[0]; */ - /* }; */ - char *m_dat; -}; - typedef struct mbufinfo { uintptr_t mbuf_addr; caddr_t m_data; From owner-svn-src-head@freebsd.org Sat Sep 3 23:04: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 9972BBCEF57; Sat, 3 Sep 2016 23:04:57 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6A32E9FD; Sat, 3 Sep 2016 23:04:57 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83N4uUS089335; Sat, 3 Sep 2016 23:04:56 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83N4une089334; Sat, 3 Sep 2016 23:04:56 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609032304.u83N4une089334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sat, 3 Sep 2016 23:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305365 - head/contrib/one-true-awk 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.22 Precedence: list List-Id: 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, 03 Sep 2016 23:04:57 -0000 Author: ache Date: Sat Sep 3 23:04:56 2016 New Revision: 305365 URL: https://svnweb.freebsd.org/changeset/base/305365 Log: The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The patch skips NUL as a quick fix. PR: 195792 Submitted by: kdrakehp@zoho.com Approved by: bwk@cs.princeton.edu (the author) MFC after: 3 days Modified: head/contrib/one-true-awk/b.c Modified: head/contrib/one-true-awk/b.c ============================================================================== --- head/contrib/one-true-awk/b.c Sat Sep 3 21:41:29 2016 (r305364) +++ head/contrib/one-true-awk/b.c Sat Sep 3 23:04:56 2016 (r305365) @@ -841,7 +841,7 @@ int relex(void) /* lexical analyzer for if (cc->cc_name != NULL && prestr[1 + cc->cc_namelen] == ':' && prestr[2 + cc->cc_namelen] == ']') { prestr += cc->cc_namelen + 3; - for (i = 0; i < NCHARS; i++) { + for (i = 1; i < NCHARS; i++) { if (!adjbuf((char **) &buf, &bufsz, bp-buf+1, 100, (char **) &bp, "relex2")) FATAL("out of space for reg expr %.10s...", lastre); if (cc->cc_func(i)) { From owner-svn-src-head@freebsd.org Sat Sep 3 23:57: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 8C12DBCF7E5; Sat, 3 Sep 2016 23:57:19 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2EE33D54; Sat, 3 Sep 2016 23:57:19 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u83NvIB8008196; Sat, 3 Sep 2016 23:57:18 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u83NvIxf008190; Sat, 3 Sep 2016 23:57:18 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201609032357.u83NvIxf008190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 3 Sep 2016 23:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305366 - in head/sys: conf dev/bhnd dev/bhnd/bcma dev/bhnd/bhndb dev/bhnd/siba mips/broadcom modules/bhnd modules/bhnd/bcma modules/bhnd/bcma_bhndb modules/bhnd/siba modules/bhnd/siba_... 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.22 Precedence: list List-Id: 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, 03 Sep 2016 23:57:19 -0000 Author: landonf Date: Sat Sep 3 23:57:17 2016 New Revision: 305366 URL: https://svnweb.freebsd.org/changeset/base/305366 Log: Implement a generic bhnd(4) device enumeration table API. This defines a new bhnd_erom_if API, providing a common interface to device enumeration on siba(4) and bcma(4) devices, for use both in the bhndb bridge and SoC early boot contexts, and migrates mips/broadcom over to the new API. This also replaces the previous adhoc device enumeration support implemented for mips/broadcom. Migration of bhndb to the new API will be implemented in a follow-up commit. - Defined new bhnd_erom_if interface for bhnd(4) device enumeration, along with bcma(4) and siba(4)-specific implementations. - Fixed a minor bug in bhndb that logged an error when we attempted to map the full siba(4) bus space (18000000-17FFFFFF) in the siba EROM parser. - Reverted use of the resource's start address as the ChipCommon enum_addr in bhnd_read_chipid(). When called from bhndb, this address is found within the host address space, resulting in an invalid bridged enum_addr. - Added support for falling back on standard bus_activate_resource() in bhnd_bus_generic_activate_resource(), enabling allocation of the bhnd_erom's bhnd_resource directly from a nexus-attached bhnd(4) device. - Removed BHND_BUS_GET_CORE_TABLE(); it has been replaced by the erom API. - Added support for statically initializing bhnd_erom instances, for use prior to malloc availability. The statically allocated buffer size is verified both at runtime, and via a compile-time assertion (see BHND_EROM_STATIC_BYTES). - bhnd_erom classes are registered within a module via a linker set, allowing mips/broadcom to probe available EROM parser instances without creating a strong reference to bcma/siba-specific symbols. - Migrated mips/broadcom to bhnd_erom_if, replacing the previous MIPS-specific device enumeration implementation. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7748 Added: head/sys/dev/bhnd/bhnd_erom.c (contents, props changed) head/sys/dev/bhnd/bhnd_erom.h (contents, props changed) head/sys/dev/bhnd/bhnd_erom_if.m (contents, props changed) head/sys/dev/bhnd/bhnd_erom_types.h (contents, props changed) head/sys/dev/bhnd/siba/siba_erom.c (contents, props changed) Deleted: head/sys/mips/broadcom/bcm_bcma.c head/sys/mips/broadcom/bcm_siba.c Modified: head/sys/conf/files head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bcma/bcma.h head/sys/dev/bhnd/bcma/bcma_bhndb.c head/sys/dev/bhnd/bcma/bcma_erom.c head/sys/dev/bhnd/bcma/bcma_eromvar.h head/sys/dev/bhnd/bcma/bcma_nexus.c head/sys/dev/bhnd/bcma/bcmavar.h head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba.h head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bhnd/siba/sibareg.h head/sys/dev/bhnd/siba/sibavar.h head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/broadcom/bcm_machdep.h head/sys/mips/broadcom/bcm_pmu.c head/sys/mips/broadcom/files.broadcom head/sys/modules/bhnd/Makefile head/sys/modules/bhnd/bcma/Makefile head/sys/modules/bhnd/bcma_bhndb/Makefile head/sys/modules/bhnd/siba/Makefile head/sys/modules/bhnd/siba_bhndb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Sep 3 23:04:56 2016 (r305365) +++ head/sys/conf/files Sat Sep 3 23:57:17 2016 (r305366) @@ -1140,6 +1140,8 @@ dev/bce/if_bce.c optional bce dev/bfe/if_bfe.c optional bfe dev/bge/if_bge.c optional bge dev/bhnd/bhnd.c optional bhnd +dev/bhnd/bhnd_erom.c optional bhnd +dev/bhnd/bhnd_erom_if.m optional bhnd dev/bhnd/bhnd_nexus.c optional bhnd siba_nexus | \ bhnd bcma_nexus dev/bhnd/bhnd_subr.c optional bhnd @@ -1188,6 +1190,7 @@ dev/bhnd/nvram/bhnd_sprom.c optional bh dev/bhnd/nvram/bhnd_sprom_parser.c optional bhnd dev/bhnd/siba/siba.c optional siba bhnd dev/bhnd/siba/siba_bhndb.c optional siba bhnd bhndb +dev/bhnd/siba/siba_erom.c optional siba bhnd dev/bhnd/siba/siba_nexus.c optional siba_nexus siba bhnd dev/bhnd/siba/siba_subr.c optional siba bhnd # Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Sat Sep 3 23:04:56 2016 (r305365) +++ head/sys/dev/bhnd/bcma/bcma.c Sat Sep 3 23:57:17 2016 (r305366) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include "bcma_eromvar.h" #include +/* RID used when allocating EROM table */ +#define BCMA_EROM_RID 0 + int bcma_probe(device_t dev) { @@ -492,76 +495,35 @@ bcma_free_bhnd_dinfo(device_t dev, struc bcma_free_dinfo(dev, (struct bcma_devinfo *)dinfo); } - -static int -bcma_get_core_table(device_t dev, device_t child, struct bhnd_core_info **cores, - u_int *num_cores) -{ - struct bcma_softc *sc; - struct bcma_erom erom; - const struct bhnd_chipid *cid; - struct resource *r; - int error; - int rid; - - sc = device_get_softc(dev); - - /* Map the EROM table. */ - cid = BHND_BUS_GET_CHIPID(dev, dev); - rid = 0; - r = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, cid->enum_addr, - cid->enum_addr + BCMA_EROM_TABLE_SIZE, BCMA_EROM_TABLE_SIZE, - RF_ACTIVE); - if (r == NULL) { - device_printf(dev, "failed to allocate EROM resource\n"); - return (ENXIO); - } - - /* Enumerate all declared cores */ - if ((error = bcma_erom_open(&erom, r, BCMA_EROM_TABLE_START))) - goto cleanup; - - error = bcma_erom_get_core_info(&erom, cores, num_cores); - -cleanup: - bus_release_resource(dev, SYS_RES_MEMORY, rid, r); - return (error); -} - /** - * Scan a device enumeration ROM table, adding all valid discovered cores to + * Scan the device enumeration ROM table, adding all valid discovered cores to * the bus. * * @param bus The bcma bus. - * @param erom_res An active resource mapping the EROM core. - * @param erom_offset Base offset of the EROM core's register mapping. */ int -bcma_add_children(device_t bus, struct resource *erom_res, bus_size_t erom_offset) +bcma_add_children(device_t bus) { - struct bcma_erom erom; - struct bcma_corecfg *corecfg; - struct bcma_devinfo *dinfo; - device_t child; - int error; + bhnd_erom_t *erom; + struct bcma_erom *bcma_erom; + const struct bhnd_chipid *cid; + struct bcma_corecfg *corecfg; + struct bcma_devinfo *dinfo; + device_t child; + int error; + cid = BHND_BUS_GET_CHIPID(bus, bus); corecfg = NULL; - /* Initialize our reader */ - error = bcma_erom_open(&erom, erom_res, erom_offset); - if (error) - return (error); + /* Allocate our EROM parser */ + erom = bhnd_erom_alloc(&bcma_erom_parser, bus, BCMA_EROM_RID, + cid->enum_addr); + if (erom == NULL) + return (ENODEV); /* Add all cores. */ - while (!error) { - /* Parse next core */ - error = bcma_erom_parse_corecfg(&erom, &corecfg); - if (error && error == ENOENT) { - return (0); - } else if (error) { - goto failed; - } - + bcma_erom = (struct bcma_erom *)erom; + while ((error = bcma_erom_next_corecfg(bcma_erom, &corecfg)) == 0) { /* Add the child device */ child = BUS_ADD_CHILD(bus, 0, NULL, -1); if (child == NULL) { @@ -588,9 +550,11 @@ bcma_add_children(device_t bus, struct r /* Hit EOF parsing cores? */ if (error == ENOENT) - return (0); + error = 0; failed: + bhnd_erom_free(erom); + if (corecfg != NULL) bcma_free_corecfg(corecfg); @@ -613,7 +577,6 @@ static device_method_t bcma_methods[] = DEVMETHOD(bhnd_bus_find_hostb_device, bcma_find_hostb_device), DEVMETHOD(bhnd_bus_alloc_devinfo, bcma_alloc_bhnd_dinfo), DEVMETHOD(bhnd_bus_free_devinfo, bcma_free_bhnd_dinfo), - DEVMETHOD(bhnd_bus_get_core_table, bcma_get_core_table), DEVMETHOD(bhnd_bus_reset_core, bcma_reset_core), DEVMETHOD(bhnd_bus_suspend_core, bcma_suspend_core), DEVMETHOD(bhnd_bus_read_config, bcma_read_config), Modified: head/sys/dev/bhnd/bcma/bcma.h ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.h Sat Sep 3 23:04:56 2016 (r305365) +++ head/sys/dev/bhnd/bcma/bcma.h Sat Sep 3 23:57:17 2016 (r305366) @@ -45,5 +45,6 @@ */ DECLARE_CLASS(bcma_driver); +DECLARE_CLASS(bcma_erom_parser); -#endif /* _BCMA_BCMA_H_ */ \ No newline at end of file +#endif /* _BCMA_BCMA_H_ */ Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_bhndb.c Sat Sep 3 23:04:56 2016 (r305365) +++ head/sys/dev/bhnd/bcma/bcma_bhndb.c Sat Sep 3 23:57:17 2016 (r305366) @@ -73,29 +73,12 @@ static int bcma_bhndb_attach(device_t dev) { struct bcma_softc *sc; - const struct bhnd_chipid *cid; - struct resource *erom_res; int error; - int rid; sc = device_get_softc(dev); - /* Map the EROM resource and enumerate our children. */ - cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); - rid = 0; - erom_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, cid->enum_addr, - cid->enum_addr + BCMA_EROM_TABLE_SIZE, BCMA_EROM_TABLE_SIZE, - RF_ACTIVE); - if (erom_res == NULL) { - device_printf(dev, "failed to allocate EROM resource\n"); - return (ENXIO); - } - - error = bcma_add_children(dev, erom_res, BCMA_EROM_TABLE_START); - - /* Clean up */ - bus_release_resource(dev, SYS_RES_MEMORY, rid, erom_res); - if (error) + /* Enumerate our children. */ + if ((error = bcma_add_children(dev))) return (error); /* Initialize full bridge configuration */ Modified: head/sys/dev/bhnd/bcma/bcma_erom.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_erom.c Sat Sep 3 23:04:56 2016 (r305365) +++ head/sys/dev/bhnd/bcma/bcma_erom.c Sat Sep 3 23:57:17 2016 (r305366) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "bcma_eromreg.h" #include "bcma_eromvar.h" @@ -56,17 +58,43 @@ __FBSDID("$FreeBSD$"); * marker. */ -static const char *erom_entry_type_name (uint8_t entry); -static int erom_read32(struct bcma_erom *erom, uint32_t *entry); -static int erom_skip32(struct bcma_erom *erom); - -static int erom_skip_core(struct bcma_erom *erom); -static int erom_skip_mport(struct bcma_erom *erom); -static int erom_skip_sport_region(struct bcma_erom *erom); - -static int erom_seek_next(struct bcma_erom *erom, uint8_t etype); -static int erom_region_to_port_type(struct bcma_erom *erom, - uint8_t region_type, bhnd_port_type *port_type); +static const char *bcma_erom_entry_type_name (uint8_t entry); +static int bcma_erom_read32(struct bcma_erom *erom, + uint32_t *entry); +static int bcma_erom_skip32(struct bcma_erom *erom); + +static int bcma_erom_skip_core(struct bcma_erom *erom); +static int bcma_erom_skip_mport(struct bcma_erom *erom); +static int bcma_erom_skip_sport_region(struct bcma_erom *erom); + +static int bcma_erom_seek_next(struct bcma_erom *erom, + uint8_t etype); +static int bcma_erom_region_to_port_type(struct bcma_erom *erom, + uint8_t region_type, bhnd_port_type *port_type); + +static int bcma_erom_peek32(struct bcma_erom *erom, + uint32_t *entry); +static bus_size_t bcma_erom_tell(struct bcma_erom *erom); +static void bcma_erom_seek(struct bcma_erom *erom, + bus_size_t offset); +static void bcma_erom_reset(struct bcma_erom *erom); + +static int bcma_erom_seek_matching_core(struct bcma_erom *sc, + const struct bhnd_core_match *desc, + struct bhnd_core_info *core); + +static int bcma_erom_parse_core(struct bcma_erom *erom, + struct bcma_erom_core *core); + +static int bcma_erom_parse_mport(struct bcma_erom *erom, + struct bcma_erom_mport *mport); + +static int bcma_erom_parse_sport_region(struct bcma_erom *erom, + struct bcma_erom_sport_region *region); + +static void bcma_erom_to_core_info(const struct bcma_erom_core *core, + u_int core_idx, int core_unit, + struct bhnd_core_info *info); #define EROM_LOG(erom, fmt, ...) do { \ if (erom->dev != NULL) { \ @@ -78,58 +106,10 @@ static int erom_region_to_port_type(st } \ } while(0) -/** - * Open an EROM table for reading. - * - * @param[out] erom On success, will be populated with a valid EROM - * read state. - * @param r An active resource mapping the EROM core. - * @param offset Offset of the EROM core within @p resource. - * - * @retval 0 success - * @retval non-zero if the erom table could not be opened. - */ -int -bcma_erom_open(struct bcma_erom *erom, struct resource *r, - bus_size_t offset) -{ - return (bhnd_erom_bus_space_open(erom, rman_get_device(r), - rman_get_bustag(r), rman_get_bushandle(r), offset)); - - return (0); -} - -/** - * Open an EROM table for reading using the provided bus space tag and - * handle. - * - * @param[out] erom On success, will be populated with a valid EROM - * read state. - * @param dev The owning device, or NULL if none. - * @param bst EROM table bus space tag. - * @param bsh EROM table bus space handle. - * @param offset Offset of the EROM core from @p resource. - * - * @retval 0 success - * @retval non-zero if the erom table could not be opened. - */ -int -bhnd_erom_bus_space_open(struct bcma_erom *erom, device_t dev, - bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t offset) -{ - /* Initialize the EROM reader */ - erom->dev = dev; - erom->bst = bst; - erom->bsh = bsh; - erom->start = offset + BCMA_EROM_TABLE_START; - erom->offset = 0; - - return (0); -} /** Return the type name for an EROM entry */ static const char * -erom_entry_type_name (uint8_t entry) +bcma_erom_entry_type_name (uint8_t entry) { switch (BCMA_EROM_GET_ATTR(entry, ENTRY_TYPE)) { case BCMA_EROM_ENTRY_TYPE_CORE: @@ -143,10 +123,340 @@ erom_entry_type_name (uint8_t entry) } } +static int +bcma_erom_init(bhnd_erom_t *erom, device_t parent, int rid, bus_addr_t enum_addr) +{ + struct bcma_erom *sc = (struct bcma_erom *)erom; + + sc->dev = parent; + + sc->rid = rid; + sc->res = bhnd_alloc_resource(parent, SYS_RES_MEMORY, &sc->rid, + enum_addr, enum_addr + BCMA_EROM_TABLE_SIZE - 1, + BCMA_EROM_TABLE_SIZE, RF_ACTIVE|RF_SHAREABLE); + if (sc->res == NULL) + return (ENOMEM); + + sc->start = BCMA_EROM_TABLE_START; + sc->offset = 0; + + return (0); +} + +static int +bcma_erom_probe_static(bhnd_erom_class_t *cls, bus_space_tag_t bst, + bus_space_handle_t bsh, bus_addr_t paddr, struct bhnd_chipid *cid) +{ + uint32_t idreg, eaddr; + uint8_t chip_type; + + idreg = bus_space_read_4(bst, bsh, CHIPC_ID); + chip_type = CHIPC_GET_BITS(idreg, CHIPC_ID_BUS); + + /* Fetch EROM physical address */ + if (!BHND_CHIPTYPE_HAS_EROM(chip_type)) + return (ENXIO); + + eaddr = bus_space_read_4(bst, bsh, CHIPC_EROMPTR); + + /* Parse chip identifier */ + *cid = bhnd_parse_chipid(idreg, eaddr); + + /* Verify chip type */ + switch (chip_type) { + case BHND_CHIPTYPE_BCMA: + return (BUS_PROBE_DEFAULT); + + case BHND_CHIPTYPE_BCMA_ALT: + case BHND_CHIPTYPE_UBUS: + return (BUS_PROBE_GENERIC); + + default: + return (ENXIO); + } +} + +static int +bcma_erom_init_static(bhnd_erom_t *erom, bus_space_tag_t bst, + bus_space_handle_t bsh) +{ + struct bcma_erom *sc = (struct bcma_erom *)erom; + + sc->dev = NULL; + sc->rid = -1; + sc->res = NULL; + sc->bst = bst; + sc->bsh = bsh; + sc->start = BCMA_EROM_TABLE_START; + sc->offset = 0; + + return (0); +} + +static void +bcma_erom_fini(bhnd_erom_t *erom) +{ + struct bcma_erom *sc = (struct bcma_erom *)erom; + + if (sc->res != NULL) { + bhnd_release_resource(sc->dev, SYS_RES_MEMORY, sc->rid, + sc->res); + + sc->res = NULL; + sc->rid = -1; + } +} + +static int +bcma_erom_lookup_core(bhnd_erom_t *erom, const struct bhnd_core_match *desc, + struct bhnd_core_info *core) +{ + struct bcma_erom *sc = (struct bcma_erom *)erom; + + /* Search for the first matching core */ + return (bcma_erom_seek_matching_core(sc, desc, core)); +} + +static int +bcma_erom_lookup_core_addr(bhnd_erom_t *erom, const struct bhnd_core_match *desc, + bhnd_port_type port_type, u_int port_num, u_int region_num, + struct bhnd_core_info *core, bhnd_addr_t *addr, bhnd_size_t *size) +{ + struct bcma_erom *sc; + struct bcma_erom_core ec; + uint32_t entry; + uint8_t region_port, region_type; + bool found; + int error; + + sc = (struct bcma_erom *)erom; + + /* Seek to the first matching core and provide the core info + * to the caller */ + if ((error = bcma_erom_seek_matching_core(sc, desc, core))) + return (error); + + if ((error = bcma_erom_parse_core(sc, &ec))) + return (error); + + /* Skip master ports */ + for (u_long i = 0; i < ec.num_mport; i++) { + if ((error = bcma_erom_skip_mport(sc))) + return (error); + } + + /* Seek to the region block for the given port type */ + found = false; + while (1) { + bhnd_port_type p_type; + uint8_t r_type; + + if ((error = bcma_erom_peek32(sc, &entry))) + return (error); + + if (!BCMA_EROM_ENTRY_IS(entry, REGION)) + return (ENOENT); + + /* Expected region type? */ + r_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); + error = bcma_erom_region_to_port_type(sc, r_type, &p_type); + if (error) + return (error); + + if (p_type == port_type) { + found = true; + break; + } + + /* Skip to next entry */ + if ((error = bcma_erom_skip_sport_region(sc))) + return (error); + } + + if (!found) + return (ENOENT); + + /* Found the appropriate port type block; now find the region records + * for the given port number */ + found = false; + for (u_int i = 0; i <= port_num; i++) { + bhnd_port_type p_type; + + if ((error = bcma_erom_peek32(sc, &entry))) + return (error); + + if (!BCMA_EROM_ENTRY_IS(entry, REGION)) + return (ENOENT); + + /* Fetch the type/port of the first region entry */ + region_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); + region_port = BCMA_EROM_GET_ATTR(entry, REGION_PORT); + + /* Have we found the region entries for the desired port? */ + if (i == port_num) { + error = bcma_erom_region_to_port_type(sc, region_type, + &p_type); + if (error) + return (error); + + if (p_type == port_type) + found = true; + + break; + } + + /* Otherwise, seek to next block of region records */ + while (1) { + uint8_t next_type, next_port; + + if ((error = bcma_erom_skip_sport_region(sc))) + return (error); + + if ((error = bcma_erom_peek32(sc, &entry))) + return (error); + + if (!BCMA_EROM_ENTRY_IS(entry, REGION)) + return (ENOENT); + + next_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); + next_port = BCMA_EROM_GET_ATTR(entry, REGION_PORT); + + if (next_type != region_type || + next_port != region_port) + break; + } + } + + if (!found) + return (ENOENT); + + /* Finally, search for the requested region number */ + for (u_int i = 0; i <= region_num; i++) { + struct bcma_erom_sport_region region; + uint8_t next_port, next_type; + + if ((error = bcma_erom_peek32(sc, &entry))) + return (error); + + if (!BCMA_EROM_ENTRY_IS(entry, REGION)) + return (ENOENT); + + /* Check for the end of the region block */ + next_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); + next_port = BCMA_EROM_GET_ATTR(entry, REGION_PORT); + + if (next_type != region_type || + next_port != region_port) + break; + + /* Parse the region */ + if ((error = bcma_erom_parse_sport_region(sc, ®ion))) + return (error); + + /* Is this our target region_num? */ + if (i == region_num) { + /* Found */ + *addr = region.base_addr; + *size = region.size; + return (0); + } + } + + /* Not found */ + return (ENOENT); +}; + +static int +bcma_erom_get_core_table(bhnd_erom_t *erom, struct bhnd_core_info **cores, + u_int *num_cores) +{ + struct bcma_erom *sc; + struct bhnd_core_info *buffer; + bus_size_t initial_offset; + u_int count; + int error; + + sc = (struct bcma_erom *)erom; + + buffer = NULL; + initial_offset = bcma_erom_tell(sc); + + /* Determine the core count */ + bcma_erom_reset(sc); + for (count = 0, error = 0; !error; count++) { + struct bcma_erom_core core; + + /* Seek to the first readable core entry */ + error = bcma_erom_seek_next(sc, BCMA_EROM_ENTRY_TYPE_CORE); + if (error == ENOENT) + break; + else if (error) + goto cleanup; + + /* Read past the core descriptor */ + if ((error = bcma_erom_parse_core(sc, &core))) + goto cleanup; + } + + /* Allocate our output buffer */ + buffer = malloc(sizeof(struct bhnd_core_info) * count, M_BHND, + M_NOWAIT); + if (buffer == NULL) { + error = ENOMEM; + goto cleanup; + } + + /* Parse all core descriptors */ + bcma_erom_reset(sc); + for (u_int i = 0; i < count; i++) { + struct bcma_erom_core core; + int unit; + + /* Parse the core */ + error = bcma_erom_seek_next(sc, BCMA_EROM_ENTRY_TYPE_CORE); + if (error) + goto cleanup; + + error = bcma_erom_parse_core(sc, &core); + if (error) + goto cleanup; + + /* Determine the unit number */ + unit = 0; + for (u_int j = 0; j < i; j++) { + if (buffer[i].vendor == buffer[j].vendor && + buffer[i].device == buffer[j].device) + unit++; + } + + /* Convert to a bhnd info record */ + bcma_erom_to_core_info(&core, i, unit, &buffer[i]); + } + +cleanup: + if (!error) { + *cores = buffer; + *num_cores = count; + } else { + if (buffer != NULL) + free(buffer, M_BHND); + } + + /* Restore the initial position */ + bcma_erom_seek(sc, initial_offset); + return (error); +} + +static void +bcma_erom_free_core_table(bhnd_erom_t *erom, struct bhnd_core_info *cores) +{ + free(cores, M_BHND); +} + /** * Return the current read position. */ -bus_size_t +static bus_size_t bcma_erom_tell(struct bcma_erom *erom) { return (erom->offset); @@ -155,7 +465,7 @@ bcma_erom_tell(struct bcma_erom *erom) /** * Seek to an absolute read position. */ -void +static void bcma_erom_seek(struct bcma_erom *erom, bus_size_t offset) { erom->offset = offset; @@ -171,16 +481,22 @@ bcma_erom_seek(struct bcma_erom *erom, b * @retval ENOENT The end of the EROM table was reached. * @retval non-zero The read could not be completed. */ -int +static int bcma_erom_peek32(struct bcma_erom *erom, uint32_t *entry) { + bus_size_t off; + if (erom->offset >= BCMA_EROM_TABLE_SIZE) { EROM_LOG(erom, "BCMA EROM table missing terminating EOF\n"); return (EINVAL); } - *entry = bus_space_read_4(erom->bst, erom->bsh, - erom->start + erom->offset); + off = erom->start + erom->offset; + if (erom->res != NULL) + *entry = bhnd_bus_read_4(erom->res, off); + else + *entry = bus_space_read_4(erom->bst, erom->bsh, off); + return (0); } @@ -194,7 +510,7 @@ bcma_erom_peek32(struct bcma_erom *erom, * @retval non-zero The read could not be completed. */ static int -erom_read32(struct bcma_erom *erom, uint32_t *entry) +bcma_erom_read32(struct bcma_erom *erom, uint32_t *entry) { int error; @@ -213,11 +529,11 @@ erom_read32(struct bcma_erom *erom, uint * @retval non-zero The read could not be completed. */ static int -erom_skip32(struct bcma_erom *erom) +bcma_erom_skip32(struct bcma_erom *erom) { uint32_t entry; - return erom_read32(erom, &entry); + return bcma_erom_read32(erom, &entry); } /** @@ -229,7 +545,7 @@ erom_skip32(struct bcma_erom *erom) * @retval non-zero The read could not be completed. */ static int -erom_skip_core(struct bcma_erom *erom) +bcma_erom_skip_core(struct bcma_erom *erom) { struct bcma_erom_core core; return (bcma_erom_parse_core(erom, &core)); @@ -244,7 +560,7 @@ erom_skip_core(struct bcma_erom *erom) * @retval non-zero The read could not be completed. */ static int -erom_skip_mport(struct bcma_erom *erom) +bcma_erom_skip_mport(struct bcma_erom *erom) { struct bcma_erom_mport mp; return (bcma_erom_parse_mport(erom, &mp)); @@ -259,7 +575,7 @@ erom_skip_mport(struct bcma_erom *erom) * @retval non-zero The read could not be completed. */ static int -erom_skip_sport_region(struct bcma_erom *erom) +bcma_erom_skip_sport_region(struct bcma_erom *erom) { struct bcma_erom_sport_region r; return (bcma_erom_parse_sport_region(erom, &r)); @@ -276,7 +592,7 @@ erom_skip_sport_region(struct bcma_erom * @retval non-zero Reading or parsing the descriptor failed. */ static int -erom_seek_next(struct bcma_erom *erom, uint8_t etype) +bcma_erom_seek_next(struct bcma_erom *erom, uint8_t etype) { uint32_t entry; int error; @@ -298,19 +614,19 @@ erom_seek_next(struct bcma_erom *erom, u /* Skip non-matching entry types. */ switch (BCMA_EROM_GET_ATTR(entry, ENTRY_TYPE)) { case BCMA_EROM_ENTRY_TYPE_CORE: - if ((error = erom_skip_core(erom))) + if ((error = bcma_erom_skip_core(erom))) return (error); break; case BCMA_EROM_ENTRY_TYPE_MPORT: - if ((error = erom_skip_mport(erom))) + if ((error = bcma_erom_skip_mport(erom))) return (error); break; case BCMA_EROM_ENTRY_TYPE_REGION: - if ((error = erom_skip_sport_region(erom))) + if ((error = bcma_erom_skip_sport_region(erom))) return (error); break; @@ -328,62 +644,100 @@ erom_seek_next(struct bcma_erom *erom, u * * @param erom EROM read state. */ -void +static void bcma_erom_reset(struct bcma_erom *erom) { erom->offset = 0; } /** - * Seek to the next core entry. - * - * @param erom EROM read state. - * @retval 0 success - * @retval ENOENT The end of the EROM table was reached. - * @retval non-zero Reading or parsing failed. - */ -int -bcma_erom_seek_next_core(struct bcma_erom *erom) -{ - return (erom_seek_next(erom, BCMA_EROM_ENTRY_TYPE_CORE)); -} - -/** - * Seek to the requested core entry. + * Seek to the first core entry matching @p desc. * * @param erom EROM read state. - * @param core_index Index of the core to seek to. + * @param desc The core match descriptor. + * @param[out] core On success, the matching core info. If the core info + * is not desired, a NULL pointer may be provided. * @retval 0 success * @retval ENOENT The end of the EROM table was reached before @p index was * found. * @retval non-zero Reading or parsing failed. */ -int -bcma_erom_seek_core_index(struct bcma_erom *erom, u_int core_index) +static int +bcma_erom_seek_matching_core(struct bcma_erom *sc, + const struct bhnd_core_match *desc, struct bhnd_core_info *core) { - int error; + struct bhnd_core_match imatch; + bus_size_t core_offset, next_offset; + int error; - /* Start search at top of EROM */ - bcma_erom_reset(erom); + /* Seek to table start. */ + bcma_erom_reset(sc); - /* Skip core descriptors till we hit the requested entry */ - for (u_int i = 0; i < core_index; i++) { - struct bcma_erom_core core; + /* We can't determine a core's unit number during the initial scan. */ + imatch = *desc; + imatch.m.match.core_unit = 0; + + /* Locate the first matching core */ + for (u_int i = 0; i < UINT_MAX; i++) { + struct bcma_erom_core ec; + struct bhnd_core_info ci; - /* Read past the core descriptor */ - if ((error = bcma_erom_parse_core(erom, &core))) + /* Seek to the next core */ + error = bcma_erom_seek_next(sc, BCMA_EROM_ENTRY_TYPE_CORE); + if (error) return (error); - /* Seek to the next readable core entry */ - error = erom_seek_next(erom, BCMA_EROM_ENTRY_TYPE_CORE); - if (error) + /* Save the core offset */ + core_offset = bcma_erom_tell(sc); + + /* Parse the core */ + if ((error = bcma_erom_parse_core(sc, &ec))) return (error); + + bcma_erom_to_core_info(&ec, i, 0, &ci); + + /* Check for initial match */ + if (!bhnd_core_matches(&ci, &imatch)) + continue; + + /* Re-scan preceding cores to determine the unit number. */ + next_offset = bcma_erom_tell(sc); + bcma_erom_reset(sc); + for (u_int j = 0; j < i; j++) { + /* Parse the core */ + error = bcma_erom_seek_next(sc, + BCMA_EROM_ENTRY_TYPE_CORE); + if (error) + return (error); + + if ((error = bcma_erom_parse_core(sc, &ec))) + return (error); + + /* Bump the unit number? */ + if (ec.vendor == ci.vendor && ec.device == ci.device) + ci.unit++; + } + + /* Check for full match against now-valid unit number */ + if (!bhnd_core_matches(&ci, desc)) { + /* Reposition to allow reading the next core */ + bcma_erom_seek(sc, next_offset); + continue; + } + + /* Found; seek to the core's initial offset and provide + * the core info to the caller */ + bcma_erom_seek(sc, core_offset); + if (core != NULL) + *core = ci; + + return (0); } - return (0); + /* Not found, or a parse error occured */ + return (error); } - /** * Read the next core descriptor from the EROM table. * @@ -394,14 +748,14 @@ bcma_erom_seek_core_index(struct bcma_er * @retval ENOENT The end of the EROM table was reached. * @retval non-zero Reading or parsing the core descriptor failed. */ -int +static int bcma_erom_parse_core(struct bcma_erom *erom, struct bcma_erom_core *core) { uint32_t entry; int error; /* Parse CoreDescA */ - if ((error = erom_read32(erom, &entry))) + if ((error = bcma_erom_read32(erom, &entry))) return (error); /* Handle EOF */ @@ -410,7 +764,7 @@ bcma_erom_parse_core(struct bcma_erom *e if (!BCMA_EROM_ENTRY_IS(entry, CORE)) { EROM_LOG(erom, "Unexpected EROM entry 0x%x (type=%s)\n", - entry, erom_entry_type_name(entry)); + entry, bcma_erom_entry_type_name(entry)); return (EINVAL); } @@ -419,7 +773,7 @@ bcma_erom_parse_core(struct bcma_erom *e core->device = BCMA_EROM_GET_ATTR(entry, COREA_ID); /* Parse CoreDescB */ - if ((error = erom_read32(erom, &entry))) + if ((error = bcma_erom_read32(erom, &entry))) return (error); if (!BCMA_EROM_ENTRY_IS(entry, CORE)) { @@ -436,153 +790,6 @@ bcma_erom_parse_core(struct bcma_erom *e } /** - * Seek to a region record associated with @p core_index. - * - * @param erom EROM read state. - * @param core_index The index of the core record to be searched. - * @param port_type The port type to search for. - * @param port_num The port number to search for. - * @param region_num The region number to search for. - * @retval 0 success - * @retval ENOENT The requested region was not found. - * @retval non-zero Reading or parsing failed. - */ -int -bcma_erom_seek_core_sport_region(struct bcma_erom *erom, u_int core_index, - bhnd_port_type port_type, u_int port_num, u_int region_num) -{ - struct bcma_erom_core core; - uint32_t entry; - uint8_t region_port, region_type; - bool found; - int error; - - if ((error = bcma_erom_seek_core_index(erom, core_index))) - return (error); - - if ((error = bcma_erom_parse_core(erom, &core))) - return (error); - - /* Skip master ports */ - for (u_long i = 0; i < core.num_mport; i++) { - if ((error = erom_skip_mport(erom))) - return (error); - } - - /* Seek to the region block for the given port type */ - found = false; - while (1) { - bhnd_port_type p_type; - uint8_t r_type; - - if ((error = bcma_erom_peek32(erom, &entry))) - return (error); - - if (!BCMA_EROM_ENTRY_IS(entry, REGION)) - return (ENOENT); - - /* Expected region type? */ - r_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); - if ((error = erom_region_to_port_type(erom, r_type, &p_type))) - return (error); - - if (p_type == port_type) { - found = true; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***