From owner-svn-src-head@freebsd.org Sun Feb 25 00:25:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D21C5F2FF66; Sun, 25 Feb 2018 00:25:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com [209.85.214.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 739017F4A6; Sun, 25 Feb 2018 00:25:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f48.google.com with SMTP id j7so5861081ita.3; Sat, 24 Feb 2018 16:25:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=qXyHZ8Ho/SHh9CMk212gFxsL3pXjB7nuGHSTf8efBy0=; b=e+Psllo1fhkCIVUf9v1O706YH5vuzuEKfK5U9w6KrDUqDPQMqkmwHYS4pv625KRdHQ ITgiaw4ca1pUqhYtK3czvVl1MEVjEWtuxmimyOF6hcSr4DRYhrmC8piCxQ3K/d0ueh9q ouwjvcGGkXC2f9DxUy8OYWzg/sXMZ9q82K3dhg6dTo9o3BlOo5mLZEBByTtKvNuho4jp llURX3s7PK5ygtbYKi8kUz1C5ZiaHgv6OJioRnNDVr1ze2C3p5gDgvbrS9TvSCE2PjbE R7mTwINp1t1aFnwJfqBj7FHfYkC/xDOuBGEUKvCuFcrYygpC2xkb+l5I+TbYkFZFUHpy C4lw== X-Gm-Message-State: APf1xPA86CdeZYYWa/W0M/PI2z2HoVbOCXiwCME6ajTX78mJWIvZiw5H kRvm8nJZ9IgR1cwY+kuojwqRKCxL X-Google-Smtp-Source: AG47ELu6Lah5hUE5ktBk8gDEi0Kv0LY29EObs3y5YLR5aApp/qfnebysRWoKyh/ycUkFExyu3LojsQ== X-Received: by 10.36.41.84 with SMTP id p81mr3043344itp.105.1519517993436; Sat, 24 Feb 2018 16:19:53 -0800 (PST) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com. [209.85.214.51]) by smtp.gmail.com with ESMTPSA id k76sm3314178ita.32.2018.02.24.16.19.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 16:19:53 -0800 (PST) Received: by mail-it0-f51.google.com with SMTP id p204so6953578itc.4; Sat, 24 Feb 2018 16:19:53 -0800 (PST) X-Received: by 10.36.80.83 with SMTP id m80mr3038094itb.58.1519517993164; Sat, 24 Feb 2018 16:19:53 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sat, 24 Feb 2018 16:19:52 -0800 (PST) In-Reply-To: References: <201802211551.w1LFpn57042314@repo.freebsd.org> From: Conrad Meyer Date: Sat, 24 Feb 2018 16:19:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329722 - head/cddl/usr.sbin/zdb To: Alan Somers 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.25 Precedence: list List-Id: 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, 25 Feb 2018 00:25:53 -0000 On Wed, Feb 21, 2018 at 8:40 PM, Alan Somers wrote: > On Wed, Feb 21, 2018 at 8:51 AM, Alan Somers wrote: >> >> Author: asomers >> Date: Wed Feb 21 15:51:48 2018 >> New Revision: 329722 >> URL: https://svnweb.freebsd.org/changeset/base/329722 >> >> Log: >> zdb: raise WARNS from 0 to 2 >> >> This has only been possible since r329694 and r329508 >> >> MFC after: 3 weeks >> X-MFC-With: 329694 >> X-MFC-With: 329508 >> Sponsored by: Spectra Logic >> >> Modified: >> head/cddl/usr.sbin/zdb/Makefile >> > > Looks like I broke the build with GCC-6. Yep, I can confirm it's broken. I don't see a flag we can just turn off for the GCC warning, though, so the solution might have to be CFLAGS.gcc += -Wno-error. > I'll fix it, as soon as I can get > the toolchain setup. The easy way is just: $ pkg install amd64-xtoolchain-gcc $ make -sj$(sysctl -n hw.ncpu) buildworld CROSS_TOOLCHAIN=amd64-gcc Thanks, Conrad From owner-svn-src-head@freebsd.org Sun Feb 25 00:35:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B349EF3081B; Sun, 25 Feb 2018 00:35:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66A957FAF5; Sun, 25 Feb 2018 00:35:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C93F2CF2F; Sun, 25 Feb 2018 00:35:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P0ZMJE009956; Sun, 25 Feb 2018 00:35:22 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P0ZMI1009955; Sun, 25 Feb 2018 00:35:22 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802250035.w1P0ZMI1009955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 25 Feb 2018 00:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329943 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 00:35:22 -0000 Author: jeff Date: Sun Feb 25 00:35:21 2018 New Revision: 329943 URL: https://svnweb.freebsd.org/changeset/base/329943 Log: Fix issues with sparse cpu allocation. Consistently use mp_maxid + 1. Reported by: pho Reviewed by: markj Sponsored by: Netflix, Dell/EMC Isilon Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Feb 25 00:32:42 2018 (r329942) +++ head/sys/kern/vfs_bio.c Sun Feb 25 00:35:21 2018 (r329943) @@ -1041,7 +1041,7 @@ bufinit(void) bp->b_wcred = NOCRED; bp->b_qindex = QUEUE_NONE; bp->b_domain = -1; - bp->b_subqueue = mp_ncpus; + bp->b_subqueue = mp_maxid + 1; bp->b_xflags = 0; bp->b_data = bp->b_kvabase = unmapped_buf; LIST_INIT(&bp->b_dep); @@ -1716,8 +1716,8 @@ bd_init(struct bufdomain *bd) int i; domain = bd - bdclean; - bd->bd_cleanq = &bd->bd_subq[mp_ncpus]; - bq_init(bd->bd_cleanq, QUEUE_CLEAN, mp_ncpus, "bufq clean lock"); + bd->bd_cleanq = &bd->bd_subq[mp_maxid + 1]; + bq_init(bd->bd_cleanq, QUEUE_CLEAN, mp_maxid + 1, "bufq clean lock"); for (i = 0; i <= mp_maxid; i++) bq_init(&bd->bd_subq[i], QUEUE_CLEAN, i, "bufq clean subqueue lock"); @@ -1765,7 +1765,7 @@ bd_flush(struct bufdomain *bd, struct bufqueue *bq) TAILQ_REMOVE(&bq->bq_queue, bp, b_freelist); TAILQ_INSERT_TAIL(&bd->bd_cleanq->bq_queue, bp, b_freelist); - bp->b_subqueue = mp_ncpus; + bp->b_subqueue = bd->bd_cleanq->bq_subqueue; } bd->bd_cleanq->bq_len += bq->bq_len; bq->bq_len = 0; @@ -1788,7 +1788,7 @@ bd_flushall(struct bufdomain *bd) if (bd->bd_lim == 0) return (0); flushed = 0; - for (i = 0; i < mp_maxid; i++) { + for (i = 0; i <= mp_maxid; i++) { bq = &bd->bd_subq[i]; if (bq->bq_len == 0) continue; @@ -5202,7 +5202,7 @@ DB_SHOW_COMMAND(bufqueues, bufqueues) db_printf("\twakeup\t\t%d\n", bd->bd_wanted); db_printf("\tlim\t\t%d\n", bd->bd_lim); db_printf("\tCPU "); - for (j = 0; j < mp_maxid + 1; j++) + for (j = 0; j <= mp_maxid; j++) db_printf("%d, ", bd->bd_subq[j].bq_len); db_printf("\n"); } From owner-svn-src-head@freebsd.org Sun Feb 25 00:57:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D8A9F31B66; Sun, 25 Feb 2018 00:57:49 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com [IPv6:2a00:1450:4010:c07::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6FEF8066E; Sun, 25 Feb 2018 00:57:48 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22f.google.com with SMTP id 37so17383876lfs.7; Sat, 24 Feb 2018 16:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ng/jOK1eFDGgDQYpH2/Y2nQjhNsY/L9Dqta4WgxI0AA=; b=JWL+Q4j78ZVctle/GRNIzWGHy/5JD6S4tX8HEcOpSxjNEJfMOWWCW7b5Widhy1lbm2 OJKgx9hh2b88m4mnIi7mLH76hb0F8Nv54OjielOt3o+FYgZASCtl5R7kPX89Xg4DjblA pVH2kYRpsm+HLzg2LEuilFEad57GDRDPkfSZFnS3q8oLL1bmz0IdkEOuD+YwSit7WBMy E+taa1ZFDoLOVpSMaxS3GZcrOC/XoxhS20xrAOlo8u4nkWMaQEZT9qWvQ2Be/WqToo0G O5FG9fkkWxYYKKM0wYgwykz9KXF8x6BFiBt4AjOUGb+Mxc1fQ1VMk79a441RQjCZ45RT T4TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Ng/jOK1eFDGgDQYpH2/Y2nQjhNsY/L9Dqta4WgxI0AA=; b=BDijwXYG8yA4CFCy+UUbYE4uT1TZsOqWtn3GE+nUsv+eBoQ6tBaKQuhZN4fHyAuyqw mgxaZVYq4KkZNXjs5lnvsGDiQGFihj/MR4p9SHb1wbFDqYyAcNyEoyEjavhbZUqCD/Ix Cd0jseqhDpEFPtCJEfQyCVmdUf0hrq6cNMGEXdIjLYJ3JwluaIMdy5ghIsJgfdRPRYpM iluVn1zIgX26c+Ve5hGhTulbgKMEp7H8eeXbBFFPKhvuB54s475bXDjbpjDFtsKEqrk3 1Ipj3k/9aFO8j2ICz6blry/bU3cMcsXKp1l+8v3wnDcsgDLZPjgE27+vnscdR+KJspGF 0mkQ== X-Gm-Message-State: APf1xPAfP5qJUK5SaHth9DqrL9vXNqa7azpy7krk3B53d/FdJXFO8jwg UTxBGVmQe0A1SRdqzF7nBFxO8WygcIDtry6oG18= X-Google-Smtp-Source: AH8x226/yXBA4OuJ/fDU07esR4SV9Vzhg6CtiTDuUSLziOjrhkorfG3pIP1U8bFwGxFsPdmbSXu6mupyg0Fp6SF2P8s= X-Received: by 10.46.77.197 with SMTP id c66mr4598264ljd.116.1519520267222; Sat, 24 Feb 2018 16:57:47 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.30.66 with HTTP; Sat, 24 Feb 2018 16:57:46 -0800 (PST) In-Reply-To: References: <201802211551.w1LFpn57042314@repo.freebsd.org> From: Alan Somers Date: Sat, 24 Feb 2018 17:57:46 -0700 X-Google-Sender-Auth: 07LddJxA6h9sfWn0d4sUK7Ftup8 Message-ID: Subject: Re: svn commit: r329722 - head/cddl/usr.sbin/zdb To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 00:57:49 -0000 On Sat, Feb 24, 2018 at 5:19 PM, Conrad Meyer wrote: > On Wed, Feb 21, 2018 at 8:40 PM, Alan Somers wrote: > > On Wed, Feb 21, 2018 at 8:51 AM, Alan Somers > wrote: > >> > >> Author: asomers > >> Date: Wed Feb 21 15:51:48 2018 > >> New Revision: 329722 > >> URL: https://svnweb.freebsd.org/changeset/base/329722 > >> > >> Log: > >> zdb: raise WARNS from 0 to 2 > >> > >> This has only been possible since r329694 and r329508 > >> > >> MFC after: 3 weeks > >> X-MFC-With: 329694 > >> X-MFC-With: 329508 > >> Sponsored by: Spectra Logic > >> > >> Modified: > >> head/cddl/usr.sbin/zdb/Makefile > >> > > > > Looks like I broke the build with GCC-6. > > Yep, I can confirm it's broken. I don't see a flag we can just turn > off for the GCC warning, though, so the solution might have to be > CFLAGS.gcc += -Wno-error. > > > I'll fix it, as soon as I can get > > the toolchain setup. > > The easy way is just: > > $ pkg install amd64-xtoolchain-gcc > $ make -sj$(sysctl -n hw.ncpu) buildworld CROSS_TOOLCHAIN=amd64-gcc > > Thanks, > Conrad > There seem to be 3 problems: CTASSERT, assfail, and array bounds. I've already committed a fix for CTASSERT and I'm testing an assfail fix now. The array bounds problem is harder, though. The logic is complicated, but I think it's sound. I don't know why GCC is complaining, unless maybe it thinks that an enum type is signed. If I can't find a good solution, I'll set -Wno-error as you suggest. -Alan From owner-svn-src-head@freebsd.org Sun Feb 25 01:02:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B02F3207A; Sun, 25 Feb 2018 01:02:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9531980B7B; Sun, 25 Feb 2018 01:02:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f178.google.com with SMTP id e30so3123891ioc.3; Sat, 24 Feb 2018 17:02:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=yMVQ1JtTwwCBl3p4pS1C/TaKmqJUu10P3yrspRW+n6w=; b=nChsX/H0BUlKyBGi06KX8kTgwvU3q0EYmBTQn4QnDzoDtPoOt5CrYm2D2PKZVBVdY7 URUS1Wvk+VkOFjzrTsUi0gLyotxIy8M4vkDlsloFuSImX/lj+ZBsHm6HnOfsZtsAPhGB nSkKCws+iQvX5TlWQ/nHPwMBqxbmzbJlkTz2TIzrkryrLz2txNHVB4qR+b//FWpM5Xj2 xULHDZmEWZHOKIVjTBay1ldWycOEjJFjlta5w0hbRp6qRvX0lV9Zf95tpFE951mJa6ka xMnKiSx8RyckF5BJjfsuKMCbs5iNQSQ9Lt5eAb6kF3TWxePtFWXqoHKlwhr/yN/h5QCs 3d+g== X-Gm-Message-State: APf1xPB5kYKblIgdukNnBgtGT2nQQeOSh/Df+Mfb3ggDL+8AvH6MFdTE A5s1VbNiwG7O9/jPTLc53z8rH/Bf X-Google-Smtp-Source: AG47ELsGyMQuwqthT0n/B2lARXX+eIk9xYT1ziY1WGSPUX4WBAAAsopahDJtUJI2Bc+W5lttguLBVg== X-Received: by 10.107.132.227 with SMTP id o96mr7368340ioi.58.1519520519830; Sat, 24 Feb 2018 17:01:59 -0800 (PST) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com. [209.85.214.47]) by smtp.gmail.com with ESMTPSA id 5sm3231441itb.36.2018.02.24.17.01.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 17:01:59 -0800 (PST) Received: by mail-it0-f47.google.com with SMTP id k79so4347025ita.2; Sat, 24 Feb 2018 17:01:59 -0800 (PST) X-Received: by 10.36.92.205 with SMTP id q196mr7920263itb.135.1519520519588; Sat, 24 Feb 2018 17:01:59 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sat, 24 Feb 2018 17:01:59 -0800 (PST) In-Reply-To: References: <201802211551.w1LFpn57042314@repo.freebsd.org> From: Conrad Meyer Date: Sat, 24 Feb 2018 17:01:59 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329722 - head/cddl/usr.sbin/zdb To: Alan Somers 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.25 Precedence: list List-Id: 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, 25 Feb 2018 01:02:07 -0000 I did not see the array bounds error, but perhaps my build failed before it got to that point. Thanks for taking a look at it. Conrad On Sat, Feb 24, 2018 at 4:57 PM, Alan Somers wrote: > On Sat, Feb 24, 2018 at 5:19 PM, Conrad Meyer wrote: >> >> On Wed, Feb 21, 2018 at 8:40 PM, Alan Somers wrote: >> > On Wed, Feb 21, 2018 at 8:51 AM, Alan Somers >> > wrote: >> >> >> >> Author: asomers >> >> Date: Wed Feb 21 15:51:48 2018 >> >> New Revision: 329722 >> >> URL: https://svnweb.freebsd.org/changeset/base/329722 >> >> >> >> Log: >> >> zdb: raise WARNS from 0 to 2 >> >> >> >> This has only been possible since r329694 and r329508 >> >> >> >> MFC after: 3 weeks >> >> X-MFC-With: 329694 >> >> X-MFC-With: 329508 >> >> Sponsored by: Spectra Logic >> >> >> >> Modified: >> >> head/cddl/usr.sbin/zdb/Makefile >> >> >> > >> > Looks like I broke the build with GCC-6. >> >> Yep, I can confirm it's broken. I don't see a flag we can just turn >> off for the GCC warning, though, so the solution might have to be >> CFLAGS.gcc += -Wno-error. >> >> > I'll fix it, as soon as I can get >> > the toolchain setup. >> >> The easy way is just: >> >> $ pkg install amd64-xtoolchain-gcc >> $ make -sj$(sysctl -n hw.ncpu) buildworld CROSS_TOOLCHAIN=amd64-gcc >> >> Thanks, >> Conrad > > > > There seem to be 3 problems: CTASSERT, assfail, and array bounds. I've > already committed a fix for CTASSERT and I'm testing an assfail fix now. > The array bounds problem is harder, though. The logic is complicated, but I > think it's sound. I don't know why GCC is complaining, unless maybe it > thinks that an enum type is signed. If I can't find a good solution, I'll > set -Wno-error as you suggest. > > -Alan > From owner-svn-src-head@freebsd.org Sun Feb 25 03:33:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D983DF38E5C; Sun, 25 Feb 2018 03:33:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE9686B47; Sun, 25 Feb 2018 03:33:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88B0F2F1DC; Sun, 25 Feb 2018 03:33:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P3XPxr002754; Sun, 25 Feb 2018 03:33:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P3XPGV002753; Sun, 25 Feb 2018 03:33:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802250333.w1P3XPGV002753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Feb 2018 03:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329945 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 03:33:26 -0000 Author: kevans Date: Sun Feb 25 03:33:25 2018 New Revision: 329945 URL: https://svnweb.freebsd.org/changeset/base/329945 Log: lualoader: menu: Terminate final values in tables with a comma Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sun Feb 25 03:30:24 2018 (r329944) +++ head/stand/lua/menu.lua Sun Feb 25 03:33:25 2018 (r329945) @@ -159,7 +159,7 @@ menu.boot_options = { name = "Load System " .. color.highlight("D") .. "efaults", func = core.setDefaults, - alias = {"d", "D"} + alias = {"d", "D"}, }, { entry_type = core.MENU_SEPARATOR, @@ -177,7 +177,7 @@ menu.boot_options = { "CPI :", core.acpi) end, func = core.setACPI, - alias = {"a", "A"} + alias = {"a", "A"}, }, -- safe mode { @@ -187,7 +187,7 @@ menu.boot_options = { "ode :", core.sm) end, func = core.setSafeMode, - alias = {"m", "M"} + alias = {"m", "M"}, }, -- single user { @@ -197,7 +197,7 @@ menu.boot_options = { "ingle user:", core.su) end, func = core.setSingleUser, - alias = {"s", "S"} + alias = {"s", "S"}, }, -- verbose boot { @@ -207,7 +207,7 @@ menu.boot_options = { "erbose :", core.verbose) end, func = core.setVerbose, - alias = {"v", "V"} + alias = {"v", "V"}, }, }, } @@ -249,7 +249,7 @@ menu.welcome = { core.setSingleUser(false) core.boot() end, - alias = {"b", "B"} + alias = {"b", "B"}, }, -- boot single user { @@ -262,7 +262,7 @@ menu.welcome = { core.setSingleUser(true) core.boot() end, - alias = {"s", "S"} + alias = {"s", "S"}, }, -- escape to interpreter { @@ -271,7 +271,7 @@ menu.welcome = { func = function() loader.setenv("autoboot_delay", "NO") end, - alias = {core.KEYSTR_ESCAPE} + alias = {core.KEYSTR_ESCAPE}, }, -- reboot { @@ -280,7 +280,7 @@ menu.welcome = { func = function() loader.perform("reboot") end, - alias = {"r", "R"} + alias = {"r", "R"}, }, { entry_type = core.MENU_SEPARATOR, @@ -317,14 +317,14 @@ menu.welcome = { func = function(_, choice, _) config.selectKernel(choice) end, - alias = {"k", "K"} + alias = {"k", "K"}, }, -- boot options { entry_type = core.MENU_SUBMENU, name = "Boot " .. color.highlight("O") .. "ptions", submenu = menu.boot_options, - alias = {"o", "O"} + alias = {"o", "O"}, }, -- boot environments { From owner-svn-src-head@freebsd.org Sun Feb 25 03:30:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D37F38B2B; Sun, 25 Feb 2018 03:30:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34FAD8650B; Sun, 25 Feb 2018 03:30:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13DDB2F03E; Sun, 25 Feb 2018 03:30:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P3UOhV097590; Sun, 25 Feb 2018 03:30:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P3UOLP097589; Sun, 25 Feb 2018 03:30:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802250330.w1P3UOLP097589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Feb 2018 03:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329944 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 03:30:25 -0000 Author: kevans Date: Sun Feb 25 03:30:24 2018 New Revision: 329944 URL: https://svnweb.freebsd.org/changeset/base/329944 Log: lualoader: Don't explicitly index tables without reason These indices were assigned the same values as they would've been implicitly assigned anyways. While here, throw terminating commas after the last value of tables. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sun Feb 25 00:35:21 2018 (r329943) +++ head/stand/lua/config.lua Sun Feb 25 03:30:24 2018 (r329944) @@ -33,95 +33,94 @@ local config = {} local modules = {} -local pattern_table local carousel_choices = {} -pattern_table = { - [1] = { +local pattern_table = { + { str = "^%s*(#.*)", - process = function(_, _) end + process = function(_, _) end, }, -- module_load="value" - [2] = { + { str = "^%s*([%w_]+)_load%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) if modules[k] == nil then modules[k] = {} end modules[k].load = v:upper() - end + end, }, -- module_name="value" - [3] = { + { str = "^%s*([%w_]+)_name%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) config.setKey(k, "name", v) - end + end, }, -- module_type="value" - [4] = { + { str = "^%s*([%w_]+)_type%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) config.setKey(k, "type", v) - end + end, }, -- module_flags="value" - [5] = { + { str = "^%s*([%w_]+)_flags%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) config.setKey(k, "flags", v) - end + end, }, -- module_before="value" - [6] = { + { str = "^%s*([%w_]+)_before%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) config.setKey(k, "before", v) - end + end, }, -- module_after="value" - [7] = { + { str = "^%s*([%w_]+)_after%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) config.setKey(k, "after", v) - end + end, }, -- module_error="value" - [8] = { + { str = "^%s*([%w_]+)_error%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) config.setKey(k, "error", v) - end + end, }, -- exec="command" - [9] = { + { str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, _) if loader.perform(k) ~= 0 then print("Failed to exec '" .. k .. "'") end - end + end, }, -- env_var="value" - [10] = { + { str = "^%s*([%w%p]+)%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) if config.setenv(k, v) ~= 0 then print("Failed to set '" .. k .. "' with value: " .. v .. "") end - end + end, }, -- env_var=num - [11] = { + { str = "^%s*([%w%p]+)%s*=%s*(%d+)%s*(.*)", process = function(k, v) if config.setenv(k, v) ~= 0 then print("Failed to set '" .. k .. "' with value: " .. v .. "") end - end - } + end, + }, } local function readFile(name, silent) From owner-svn-src-head@freebsd.org Sun Feb 25 04:11:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9A81F003A6; Sun, 25 Feb 2018 04:11:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FC8F6817B; Sun, 25 Feb 2018 04:11:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71EB32F77A; Sun, 25 Feb 2018 04:11:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P4B8RR018457; Sun, 25 Feb 2018 04:11:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P4B83s018456; Sun, 25 Feb 2018 04:11:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802250411.w1P4B83s018456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Feb 2018 04:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329946 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 04:11:09 -0000 Author: kevans Date: Sun Feb 25 04:11:08 2018 New Revision: 329946 URL: https://svnweb.freebsd.org/changeset/base/329946 Log: lualoader: Clean up menu handling a little bit This is driven by an urge to separate out the bits that really only need to happen when the menu system starts up. Key points: - menu.process now does the bulk of menu handling. It retains autoboot handling for dubious reasons, and it no longer accepts a 'nil' menu to process as 'the default'. Its return value is insignificant. - The MENU_SUBMENU handler now returns nothing. If menu.process has exited, then we continue processing menu items on the parent menu as expected. - menu.run is now the entry point of the menu system. It checks whether the menu should be skipped, processes the default menu, then returns. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sun Feb 25 03:33:25 2018 (r329945) +++ head/stand/lua/menu.lua Sun Feb 25 04:11:08 2018 (r329946) @@ -81,7 +81,7 @@ menu.handlers = { end, [core.MENU_SUBMENU] = function(_, entry) -- recurse - return menu.run(entry.submenu) + menu.process(entry.submenu) end, [core.MENU_RETURN] = function(_, entry) -- allow entry to have a function/side effect @@ -342,29 +342,24 @@ menu.welcome = { menu.default = menu.welcome -function menu.run(m) - - if menu.skip() then - core.autoboot() - return false - end - - if m == nil then - m = menu.default - end - +function menu.process(m) + assert(m ~= nil) -- redraw screen screen.clear() screen.defcursor() local alias_table = drawer.drawscreen(m) - -- Might return nil, that's ok + -- autoboot processing likely belongs better in menu.run, but we want + -- to draw the menu once before we do any autoboot prompting. We also + -- collect the alias table from the drawer, which generates the table + -- based on all of the 'alias' entries along with effective line numbers + -- that each entry is drawn at. This makes it cleaner to handle here, + -- for the time being. local autoboot_key; if m == menu.default then autoboot_key = menu.autoboot() end - local cont = true - while cont do + while true do local key = autoboot_key or io.getchar() autoboot_key = nil @@ -391,12 +386,11 @@ function menu.run(m) -- Get menu handler local handler = menu.handlers[sel_entry.entry_type] if handler ~= nil then - -- The handler's return value indicates whether - -- we need to exit this menu. An omitted return - -- value means "continue" by default. - cont = handler(m, sel_entry) - if cont == nil then - cont = true + -- The handler's return value indicates if we + -- need to exit this menu. An omitted or true + -- return value means to continue. + if handler(m, sel_entry) == false then + return end end -- if we got an alias key the screen is out of date: @@ -405,14 +399,18 @@ function menu.run(m) alias_table = drawer.drawscreen(m) end end +end - if m == menu.default then - screen.defcursor() - print("Exiting menu!") - return false +function menu.run() + if menu.skip() then + core.autoboot() + return end - return true + menu.process(menu.default) + + screen.defcursor() + print("Exiting menu!") end function menu.skip() From owner-svn-src-head@freebsd.org Sun Feb 25 04:44:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C7D3F03D28; Sun, 25 Feb 2018 04:44:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E824692AB; Sun, 25 Feb 2018 04:44:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 297882FE2C; Sun, 25 Feb 2018 04:44:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P4ikqZ037926; Sun, 25 Feb 2018 04:44:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P4ikVh037925; Sun, 25 Feb 2018 04:44:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802250444.w1P4ikVh037925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Feb 2018 04:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329947 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 04:44:46 -0000 Author: kevans Date: Sun Feb 25 04:44:45 2018 New Revision: 329947 URL: https://svnweb.freebsd.org/changeset/base/329947 Log: lualoader: Pull menu redrawing specifics out of menu.process In general, every menu redraw is going to require a screen clear and cursor reset. Each redraw also has the potential to invalidate the alias table, so we move the alias table being used out into a module variable. This allows third party consumers to also inspect or update the alias table if they need to. While here, stop searching the alias table once we've found a match. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sun Feb 25 04:11:08 2018 (r329946) +++ head/stand/lua/menu.lua Sun Feb 25 04:44:45 2018 (r329947) @@ -341,14 +341,24 @@ menu.welcome = { } menu.default = menu.welcome +-- current_alias_table will be used to keep our alias table consistent across +-- screen redraws, instead of relying on whatever triggered the redraw to update +-- the local alias_table in menu.process. +menu.current_alias_table = {} -function menu.process(m) - assert(m ~= nil) +function menu.redraw(m) -- redraw screen screen.clear() screen.defcursor() - local alias_table = drawer.drawscreen(m) + menu.current_alias_table = drawer.drawscreen(m) +end +function menu.process(m) + assert(m ~= nil) + + -- Trigger a redraw if we've not been drawn + menu.redraw(m) + -- autoboot processing likely belongs better in menu.run, but we want -- to draw the menu once before we do any autoboot prompting. We also -- collect the alias table from the drawer, which generates the table @@ -375,9 +385,10 @@ function menu.process(m) key = string.char(key) -- check to see if key is an alias local sel_entry = nil - for k, v in pairs(alias_table) do + for k, v in pairs(menu.current_alias_table) do if key == k then sel_entry = v + break end end @@ -387,16 +398,15 @@ function menu.process(m) local handler = menu.handlers[sel_entry.entry_type] if handler ~= nil then -- The handler's return value indicates if we - -- need to exit this menu. An omitted or true + -- need to exit this menu. An omitted or true -- return value means to continue. if handler(m, sel_entry) == false then return end end - -- if we got an alias key the screen is out of date: - screen.clear() - screen.defcursor() - alias_table = drawer.drawscreen(m) + -- If we got an alias key the screen is out of date... + -- redraw it. + menu.redraw(m) end end end From owner-svn-src-head@freebsd.org Sun Feb 25 05:14:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B31AF04C44; Sun, 25 Feb 2018 05:14:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E96B6A1AB; Sun, 25 Feb 2018 05:14:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28E033E0; Sun, 25 Feb 2018 05:14:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P5E7a5053102; Sun, 25 Feb 2018 05:14:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P5E7Cj053101; Sun, 25 Feb 2018 05:14:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802250514.w1P5E7Cj053101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Feb 2018 05:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329949 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 05:14:07 -0000 Author: kevans Date: Sun Feb 25 05:14:06 2018 New Revision: 329949 URL: https://svnweb.freebsd.org/changeset/base/329949 Log: lualoader: Explain deviation from naming guidelines cli_execute is likely the only exception that we should make, due to it being a global. We don't really need other globals, so this won't really end up an epidemic. Modified: head/stand/lua/cli.lua Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Sun Feb 25 05:00:54 2018 (r329948) +++ head/stand/lua/cli.lua Sun Feb 25 05:14:06 2018 (r329949) @@ -69,6 +69,10 @@ end -- Declares a global function cli_execute that attempts to dispatch the -- arguments passed as a lua function. This gives lua a chance to intercept -- builtin CLI commands like "boot" +-- This function intentionally does not follow our general naming guideline for +-- functions. This is global pollution, but the clearly separated 'cli' looks +-- more like a module indicator to serve as a hint of where to look for the +-- corresponding definition. function cli_execute(...) local argv = {...} -- Just in case... From owner-svn-src-head@freebsd.org Sun Feb 25 05:00:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E562F04596; Sun, 25 Feb 2018 05:00:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE9569B9A; Sun, 25 Feb 2018 05:00:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FA9718D; Sun, 25 Feb 2018 05:00:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P50sEi043316; Sun, 25 Feb 2018 05:00:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P50sZ7043315; Sun, 25 Feb 2018 05:00:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802250500.w1P50sZ7043315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Feb 2018 05:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329948 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 05:00:55 -0000 Author: kevans Date: Sun Feb 25 05:00:54 2018 New Revision: 329948 URL: https://svnweb.freebsd.org/changeset/base/329948 Log: lualoader: Pull autoboot handling out into menu.run() There's no reason for autoboot handling to be mixed in with menu processing. It is a distinct process that should only be done once when entering the menu system. menu.process has been modified to take an initial keypress to process and to only draw the screen initially if it's been invalidated. The keypress is kind of a kludge, although it could be argued to be a potentially useful kludge if there are other processes that may need to feed a keypress into the menu system. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sun Feb 25 04:44:45 2018 (r329947) +++ head/stand/lua/menu.lua Sun Feb 25 05:00:54 2018 (r329948) @@ -38,6 +38,8 @@ local drawer = require("drawer") local menu = {} +local screen_invalid = true + local function OnOff(str, b) if b then return str .. color.escapef(color.GREEN) .. "On" .. @@ -80,7 +82,7 @@ menu.handlers = { end end, [core.MENU_SUBMENU] = function(_, entry) - -- recurse + screen_invalid = true menu.process(entry.submenu) end, [core.MENU_RETURN] = function(_, entry) @@ -351,27 +353,23 @@ function menu.redraw(m) screen.clear() screen.defcursor() menu.current_alias_table = drawer.drawscreen(m) + screen_invalid = false end -function menu.process(m) +-- 'keypress' allows the caller to indicate that a key has been pressed that we +-- should process as our initial input. +function menu.process(m, keypress) assert(m ~= nil) - -- Trigger a redraw if we've not been drawn - menu.redraw(m) - - -- autoboot processing likely belongs better in menu.run, but we want - -- to draw the menu once before we do any autoboot prompting. We also - -- collect the alias table from the drawer, which generates the table - -- based on all of the 'alias' entries along with effective line numbers - -- that each entry is drawn at. This makes it cleaner to handle here, - -- for the time being. - local autoboot_key; - if m == menu.default then - autoboot_key = menu.autoboot() + -- Trigger a redraw if we've been invalidated. Otherwise, we assume + -- that this menu has already been drawn. + if screen_invalid then + menu.redraw(m) end + while true do - local key = autoboot_key or io.getchar() - autoboot_key = nil + local key = keypress or io.getchar() + keypress = nil -- Special key behaviors if (key == core.KEY_BACKSPACE or key == core.KEY_DELETE) and @@ -417,7 +415,10 @@ function menu.run() return end - menu.process(menu.default) + menu.redraw(menu.default) + local autoboot_key = menu.autoboot() + + menu.process(menu.default, autoboot_key) screen.defcursor() print("Exiting menu!") From owner-svn-src-head@freebsd.org Sun Feb 25 08:56:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25DF8F228A9; Sun, 25 Feb 2018 08:56:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C904F721E0; Sun, 25 Feb 2018 08:56:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C41442868; Sun, 25 Feb 2018 08:56:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P8uiAN066841; Sun, 25 Feb 2018 08:56:44 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P8uifJ066839; Sun, 25 Feb 2018 08:56:44 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201802250856.w1P8uifJ066839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 25 Feb 2018 08:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329950 - in head/sys: net netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys: net netpfil/pf X-SVN-Commit-Revision: 329950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 08:56:45 -0000 Author: kp Date: Sun Feb 25 08:56:44 2018 New Revision: 329950 URL: https://svnweb.freebsd.org/changeset/base/329950 Log: pf: Cope with overly large net.pf.states_hashsize If the user configures a states_hashsize or source_nodes_hashsize value we may not have enough memory to allocate this. This used to lock up pf, because these allocations used M_WAITOK. Cope with this by attempting the allocation with M_NOWAIT and falling back to the default sizes (with M_WAITOK) if these fail. PR: 209475 Submitted by: Fehmi Noyan Isi MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14367 Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Feb 25 05:14:06 2018 (r329949) +++ head/sys/net/pfvar.h Sun Feb 25 08:56:44 2018 (r329950) @@ -1467,6 +1467,7 @@ struct pf_idhash { extern u_long pf_hashmask; extern u_long pf_srchashmask; #define PF_HASHSIZ (32768) +#define PF_SRCHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); VNET_DECLARE(struct pf_idhash *, pf_idhash); #define V_pf_keyhash VNET(pf_keyhash) Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Feb 25 05:14:06 2018 (r329949) +++ head/sys/netpfil/pf/pf.c Sun Feb 25 08:56:44 2018 (r329950) @@ -790,7 +790,7 @@ pf_initialize() if (pf_hashsize == 0 || !powerof2(pf_hashsize)) pf_hashsize = PF_HASHSIZ; if (pf_srchashsize == 0 || !powerof2(pf_srchashsize)) - pf_srchashsize = PF_HASHSIZ / 4; + pf_srchashsize = PF_SRCHASHSIZ; V_pf_hashseed = arc4random(); @@ -804,10 +804,25 @@ pf_initialize() V_pf_state_key_z = uma_zcreate("pf state keys", sizeof(struct pf_state_key), pf_state_key_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - V_pf_keyhash = malloc(pf_hashsize * sizeof(struct pf_keyhash), - M_PFHASH, M_WAITOK | M_ZERO); - V_pf_idhash = malloc(pf_hashsize * sizeof(struct pf_idhash), - M_PFHASH, M_WAITOK | M_ZERO); + + V_pf_keyhash = mallocarray(pf_hashsize, sizeof(struct pf_keyhash), + M_PFHASH, M_NOWAIT | M_ZERO); + V_pf_idhash = mallocarray(pf_hashsize, sizeof(struct pf_idhash), + M_PFHASH, M_NOWAIT | M_ZERO); + if (V_pf_keyhash == NULL || V_pf_idhash == NULL) { + printf("pf: Unable to allocate memory for " + "state_hashsize %lu.\n", pf_hashsize); + + free(V_pf_keyhash, M_PFHASH); + free(V_pf_idhash, M_PFHASH); + + pf_hashsize = PF_HASHSIZ; + V_pf_keyhash = mallocarray(pf_hashsize, + sizeof(struct pf_keyhash), M_PFHASH, M_WAITOK | M_ZERO); + V_pf_idhash = mallocarray(pf_hashsize, + sizeof(struct pf_idhash), M_PFHASH, M_WAITOK | M_ZERO); + } + pf_hashmask = pf_hashsize - 1; for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; i++, kh++, ih++) { @@ -822,8 +837,18 @@ pf_initialize() V_pf_limits[PF_LIMIT_SRC_NODES].zone = V_pf_sources_z; uma_zone_set_max(V_pf_sources_z, PFSNODE_HIWAT); uma_zone_set_warning(V_pf_sources_z, "PF source nodes limit reached"); - V_pf_srchash = malloc(pf_srchashsize * sizeof(struct pf_srchash), - M_PFHASH, M_WAITOK|M_ZERO); + + V_pf_srchash = mallocarray(pf_srchashsize, + sizeof(struct pf_srchash), M_PFHASH, M_NOWAIT | M_ZERO); + if (V_pf_srchash == NULL) { + printf("pf: Unable to allocate memory for " + "source_hashsize %lu.\n", pf_srchashsize); + + pf_srchashsize = PF_SRCHASHSIZ; + V_pf_srchash = mallocarray(pf_srchashsize, + sizeof(struct pf_srchash), M_PFHASH, M_WAITOK | M_ZERO); + } + pf_srchashmask = pf_srchashsize - 1; for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) mtx_init(&sh->lock, "pf_srchash", NULL, MTX_DEF); From owner-svn-src-head@freebsd.org Sun Feb 25 14:18:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A636BF30139; Sun, 25 Feb 2018 14:18:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::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 27B8B7E692; Sun, 25 Feb 2018 14:18:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id f75so13565007lfg.6; Sun, 25 Feb 2018 06:18:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GL7W2o5RtvEUVV0w4nQOeTPCxUzWQUOEtNfHpS9DuVo=; b=SUD3fKfZaDuA2tuiki4a5Zxq2iGm7+4KMhd9OJgtRNdOVh82uA4jSo6/Nrkz8/tmj2 FYyHXPR44p68S9Gx8EJW+0JmxgCNl/hFMEwEhWFcINKBrPv4hhCcfRdd1vzMcuV/Wc4N ThcHZpxPweDung2obqrBd6dJMo32HQS9DOH9auqxaftg19ouNeZOMzCERNoMHMnO+0DE JBx8NW5rn9XTWT+zeAwJiARBnMZGfos8sZ1N5qEyx6KN31lZ4YAnAig9STFROCrp3wFy WnLFAPxuymcMUZb0hbTbgY8GdMr5tRqGK6CUqypFbcl6x0gDS8j6UMqJUKA2RSQnxTls 96ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GL7W2o5RtvEUVV0w4nQOeTPCxUzWQUOEtNfHpS9DuVo=; b=mUNVWWq7xiNDTUf/V/KGchBni5ltKUw19Ko6FIw6rwSxkDMo8ugjHAzE1PLEMAWYL0 KxQyHTYj82v0s+yYanWMavU9a+EzVvngImrwzCtVh0Ue9cDnswx8qcrHaqBU4TQWgKQO 25lokh9laWuU6/uTZi2aY1ljmedjqq6pyymvo2yZ6IyXdLozm/jt77xXP7Zit1Ic8gwG UtHceTqyZsFJ7uGWOg4AuW0rmQIsmdsVv13JdI7exeoY3RStdO5uvqpb72A7Hx5hqb5M /TDOy2DtIgzzYXFumWEgUlFqygUIxQPMdz+/lVWOE6U+Es1FSdg1X5VNFDTykdKTMRAG 5wqg== X-Gm-Message-State: APf1xPB2uwZWvbv00ONGr5k2ToiZOUea3d2Cr6ktB11ku/whPs6xxM2C KUPw6PJ20pvaRN9qr+dw2cUovZVZvmmKDcio2CI= X-Google-Smtp-Source: AG47ELujdV7nQxPKtTwRlPqn0J9Gl932Zl/f9BM50tfY69QP2upLhCU7/qvRnKFqhWmwgWCMcE/VibwI9Zmz6V6pTPM= X-Received: by 10.25.119.27 with SMTP id s27mr3352094lfc.138.1519568316248; Sun, 25 Feb 2018 06:18:36 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.30.66 with HTTP; Sun, 25 Feb 2018 06:18:35 -0800 (PST) In-Reply-To: References: <201802241601.w1OG1LQ3043733@repo.freebsd.org> From: Alan Somers Date: Sun, 25 Feb 2018 07:18:35 -0700 X-Google-Sender-Auth: wlepparW2KtjkeF-btKgZMnwEYs Message-ID: Subject: Re: svn commit: r329910 - head/sys/cddl/contrib/opensolaris/uts/common/sys To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 14:18:38 -0000 On Sun, Feb 25, 2018 at 6:52 AM, Dimitry Andric wrote: > On 24 Feb 2018, at 17:01, Alan Somers wrote: > > > > Author: asomers > > Date: Sat Feb 24 16:01:21 2018 > > New Revision: 329910 > > URL: https://svnweb.freebsd.org/changeset/base/329910 > > > > Log: > > Implement CTASSERT using _Static_assert > > > > Prevents warnings about "unused typedef" with GCC-6 > > > > Reported by: GCC-6 > > MFC after: 18 days > > X-MFC-With: 329722 > > > > Modified: > > head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h > > > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h > > ============================================================ > ================== > > --- head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Sat Feb > 24 15:13:20 2018 (r329909) > > +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Sat Feb > 24 16:01:21 2018 (r329910) > > @@ -133,8 +133,8 @@ _NOTE(CONSTCOND) } while (0) > > #ifndef CTASSERT > > #define CTASSERT(x) _CTASSERT(x, __LINE__) > > #define _CTASSERT(x, y) __CTASSERT(x, y) > > -#define __CTASSERT(x, y) \ > > - typedef char __compile_time_assertion__ ## y [(x) ? 1 : -1] > > +#define __CTASSERT(x, y) \ > > + _Static_assert((x), "Static assert failed at " #y) > > #endif > > > > #ifdef _KERNEL > > Note that the trick with the negatively indexed array is to support > older versions of gcc, which did not yet recognize _Static_assert. It > looks like this was added in gcc 4.6. > > -Dimitry > > sys/cdefs.h defines _Static_assert similarly on GCC 4.3-4.5, and defines it to nothingness on GCC-4.2. So we should be covered for all compilers that we care about. -Alan From owner-svn-src-head@freebsd.org Sun Feb 25 13:20:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06078F2E97A; Sun, 25 Feb 2018 13:20:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A484D7CFB0; Sun, 25 Feb 2018 13:20:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8625F56B8; Sun, 25 Feb 2018 13:20:34 +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 w1PDKYbO000590; Sun, 25 Feb 2018 13:20:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PDKWUt000570; Sun, 25 Feb 2018 13:20:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802251320.w1PDKWUt000570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 25 Feb 2018 13:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329983 - in head: contrib/llvm/include/llvm/Bitcode contrib/llvm/include/llvm/MC contrib/llvm/include/llvm/Transforms/Utils contrib/llvm/lib/Analysis contrib/llvm/lib/Bitcode/Reader co... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/include/llvm/Bitcode contrib/llvm/include/llvm/MC contrib/llvm/include/llvm/Transforms/Utils contrib/llvm/lib/Analysis contrib/llvm/lib/Bitcode/Reader contrib/llvm/lib/Bitcode/Wr... X-SVN-Commit-Revision: 329983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 13:20:35 -0000 Author: dim Date: Sun Feb 25 13:20:32 2018 New Revision: 329983 URL: https://svnweb.freebsd.org/changeset/base/329983 Log: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r325932). This corresponds to 6.0.0 rc3. MFC after: 3 months X-MFC-With: r327952 PR: 224669 Modified: head/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h head/contrib/llvm/include/llvm/MC/MCAsmMacro.h head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/lld/ELF/Driver.cpp head/contrib/llvm/tools/lld/ELF/Options.td head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/lld/Common/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h ============================================================================== --- head/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h Sun Feb 25 13:20:32 2018 (r329983) @@ -395,6 +395,20 @@ enum OverflowingBinaryOperatorOptionalFlags { OBO_NO_SIGNED_WRAP = 1 }; +/// FastMath Flags +/// This is a fixed layout derived from the bitcode emitted by LLVM 5.0 +/// intended to decouple the in-memory representation from the serialization. +enum FastMathMap { + UnsafeAlgebra = (1 << 0), // Legacy + NoNaNs = (1 << 1), + NoInfs = (1 << 2), + NoSignedZeros = (1 << 3), + AllowReciprocal = (1 << 4), + AllowContract = (1 << 5), + ApproxFunc = (1 << 6), + AllowReassoc = (1 << 7) +}; + /// PossiblyExactOperatorOptionalFlags - Flags for serializing /// PossiblyExactOperator's SubclassOptionalData contents. enum PossiblyExactOperatorOptionalFlags { PEO_EXACT = 0 }; Modified: head/contrib/llvm/include/llvm/MC/MCAsmMacro.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCAsmMacro.h Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/include/llvm/MC/MCAsmMacro.h Sun Feb 25 13:20:32 2018 (r329983) @@ -33,6 +33,6 @@ struct MCAsmMacro { (public) MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P) : Name(N), Body(B), Parameters(std::move(P)) {} }; -}; // namespace llvm +} // namespace llvm #endif Modified: head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h ============================================================================== --- head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h Sun Feb 25 13:20:32 2018 (r329983) @@ -21,6 +21,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/DemandedBits.h" #include "llvm/Analysis/EHPersonalities.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/Dominators.h" @@ -172,15 +173,25 @@ class RecurrenceDescriptor { (public) Value *Left, Value *Right); /// Returns true if Phi is a reduction of type Kind and adds it to the - /// RecurrenceDescriptor. + /// RecurrenceDescriptor. If either \p DB is non-null or \p AC and \p DT are + /// non-null, the minimal bit width needed to compute the reduction will be + /// computed. static bool AddReductionVar(PHINode *Phi, RecurrenceKind Kind, Loop *TheLoop, bool HasFunNoNaNAttr, - RecurrenceDescriptor &RedDes); + RecurrenceDescriptor &RedDes, + DemandedBits *DB = nullptr, + AssumptionCache *AC = nullptr, + DominatorTree *DT = nullptr); - /// Returns true if Phi is a reduction in TheLoop. The RecurrenceDescriptor is - /// returned in RedDes. + /// Returns true if Phi is a reduction in TheLoop. The RecurrenceDescriptor + /// is returned in RedDes. If either \p DB is non-null or \p AC and \p DT are + /// non-null, the minimal bit width needed to compute the reduction will be + /// computed. static bool isReductionPHI(PHINode *Phi, Loop *TheLoop, - RecurrenceDescriptor &RedDes); + RecurrenceDescriptor &RedDes, + DemandedBits *DB = nullptr, + AssumptionCache *AC = nullptr, + DominatorTree *DT = nullptr); /// Returns true if Phi is a first-order recurrence. A first-order recurrence /// is a non-reduction recurrence relation in which the value of the @@ -217,24 +228,6 @@ class RecurrenceDescriptor { (public) /// Returns true if the recurrence kind is an arithmetic kind. static bool isArithmeticRecurrenceKind(RecurrenceKind Kind); - - /// Determines if Phi may have been type-promoted. If Phi has a single user - /// that ANDs the Phi with a type mask, return the user. RT is updated to - /// account for the narrower bit width represented by the mask, and the AND - /// instruction is added to CI. - static Instruction *lookThroughAnd(PHINode *Phi, Type *&RT, - SmallPtrSetImpl &Visited, - SmallPtrSetImpl &CI); - - /// Returns true if all the source operands of a recurrence are either - /// SExtInsts or ZExtInsts. This function is intended to be used with - /// lookThroughAnd to determine if the recurrence has been type-promoted. The - /// source operands are added to CI, and IsSigned is updated to indicate if - /// all source operands are SExtInsts. - static bool getSourceExtensionKind(Instruction *Start, Instruction *Exit, - Type *RT, bool &IsSigned, - SmallPtrSetImpl &Visited, - SmallPtrSetImpl &CI); /// Returns the type of the recurrence. This type can be narrower than the /// actual type of the Phi if the recurrence has been type-promoted. Modified: head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -205,6 +205,11 @@ static cl::opt cl::desc("Max coefficients in AddRec during evolving"), cl::init(16)); +static cl::opt VersionUnknown( + "scev-version-unknown", cl::Hidden, + cl::desc("Use predicated scalar evolution to version SCEVUnknowns"), + cl::init(false)); + //===----------------------------------------------------------------------===// // SCEV class definitions //===----------------------------------------------------------------------===// @@ -11467,6 +11472,8 @@ class SCEVPredicateRewriter : public SCEVRewriteVisito // couldn't create an AddRec for it, or couldn't add the predicate), we just // return \p Expr. const SCEV *convertToAddRecWithPreds(const SCEVUnknown *Expr) { + if (!VersionUnknown) + return Expr; if (!isa(Expr->getValue())) return Expr; Optional>> Modified: head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp ============================================================================== --- head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -1046,19 +1046,21 @@ static Comdat::SelectionKind getDecodedComdatSelection static FastMathFlags getDecodedFastMathFlags(unsigned Val) { FastMathFlags FMF; - if (0 != (Val & FastMathFlags::AllowReassoc)) + if (0 != (Val & bitc::UnsafeAlgebra)) + FMF.setFast(); + if (0 != (Val & bitc::AllowReassoc)) FMF.setAllowReassoc(); - if (0 != (Val & FastMathFlags::NoNaNs)) + if (0 != (Val & bitc::NoNaNs)) FMF.setNoNaNs(); - if (0 != (Val & FastMathFlags::NoInfs)) + if (0 != (Val & bitc::NoInfs)) FMF.setNoInfs(); - if (0 != (Val & FastMathFlags::NoSignedZeros)) + if (0 != (Val & bitc::NoSignedZeros)) FMF.setNoSignedZeros(); - if (0 != (Val & FastMathFlags::AllowReciprocal)) + if (0 != (Val & bitc::AllowReciprocal)) FMF.setAllowReciprocal(); - if (0 != (Val & FastMathFlags::AllowContract)) + if (0 != (Val & bitc::AllowContract)) FMF.setAllowContract(true); - if (0 != (Val & FastMathFlags::ApproxFunc)) + if (0 != (Val & bitc::ApproxFunc)) FMF.setApproxFunc(); return FMF; } Modified: head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp ============================================================================== --- head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -1330,19 +1330,19 @@ static uint64_t getOptimizationFlags(const Value *V) { Flags |= 1 << bitc::PEO_EXACT; } else if (const auto *FPMO = dyn_cast(V)) { if (FPMO->hasAllowReassoc()) - Flags |= FastMathFlags::AllowReassoc; + Flags |= bitc::AllowReassoc; if (FPMO->hasNoNaNs()) - Flags |= FastMathFlags::NoNaNs; + Flags |= bitc::NoNaNs; if (FPMO->hasNoInfs()) - Flags |= FastMathFlags::NoInfs; + Flags |= bitc::NoInfs; if (FPMO->hasNoSignedZeros()) - Flags |= FastMathFlags::NoSignedZeros; + Flags |= bitc::NoSignedZeros; if (FPMO->hasAllowReciprocal()) - Flags |= FastMathFlags::AllowReciprocal; + Flags |= bitc::AllowReciprocal; if (FPMO->hasAllowContract()) - Flags |= FastMathFlags::AllowContract; + Flags |= bitc::AllowContract; if (FPMO->hasApproxFunc()) - Flags |= FastMathFlags::ApproxFunc; + Flags |= bitc::ApproxFunc; } return Flags; @@ -3183,7 +3183,7 @@ void ModuleBitcodeWriter::writeBlockInfo() { Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LHS Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // RHS Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // opc - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); // flags + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); // flags if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID, Abbv) != FUNCTION_INST_BINOP_FLAGS_ABBREV) llvm_unreachable("Unexpected abbrev ordering!"); Modified: head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -133,16 +133,21 @@ AArch64InstructionSelector::AArch64InstructionSelector // for each class in the bank. static const TargetRegisterClass * getRegClassForTypeOnBank(LLT Ty, const RegisterBank &RB, - const RegisterBankInfo &RBI) { + const RegisterBankInfo &RBI, + bool GetAllRegSet = false) { if (RB.getID() == AArch64::GPRRegBankID) { if (Ty.getSizeInBits() <= 32) - return &AArch64::GPR32RegClass; + return GetAllRegSet ? &AArch64::GPR32allRegClass + : &AArch64::GPR32RegClass; if (Ty.getSizeInBits() == 64) - return &AArch64::GPR64RegClass; + return GetAllRegSet ? &AArch64::GPR64allRegClass + : &AArch64::GPR64RegClass; return nullptr; } if (RB.getID() == AArch64::FPRRegBankID) { + if (Ty.getSizeInBits() <= 16) + return &AArch64::FPR16RegClass; if (Ty.getSizeInBits() == 32) return &AArch64::FPR32RegClass; if (Ty.getSizeInBits() == 64) @@ -310,19 +315,46 @@ static unsigned selectLoadStoreUIOp(unsigned GenericOp return GenericOpc; } +static bool selectFP16CopyFromGPR32(MachineInstr &I, const TargetInstrInfo &TII, + MachineRegisterInfo &MRI, unsigned SrcReg) { + // Copies from gpr32 to fpr16 need to use a sub-register copy. + unsigned CopyReg = MRI.createVirtualRegister(&AArch64::FPR32RegClass); + BuildMI(*I.getParent(), I, I.getDebugLoc(), TII.get(AArch64::COPY)) + .addDef(CopyReg) + .addUse(SrcReg); + unsigned SubRegCopy = MRI.createVirtualRegister(&AArch64::FPR16RegClass); + BuildMI(*I.getParent(), I, I.getDebugLoc(), TII.get(TargetOpcode::COPY)) + .addDef(SubRegCopy) + .addUse(CopyReg, 0, AArch64::hsub); + + MachineOperand &RegOp = I.getOperand(1); + RegOp.setReg(SubRegCopy); + return true; +} + static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII, MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI) { unsigned DstReg = I.getOperand(0).getReg(); + unsigned SrcReg = I.getOperand(1).getReg(); + if (TargetRegisterInfo::isPhysicalRegister(DstReg)) { + if (TRI.getRegClass(AArch64::FPR16RegClassID)->contains(DstReg) && + !TargetRegisterInfo::isPhysicalRegister(SrcReg)) { + const RegisterBank &RegBank = *RBI.getRegBank(SrcReg, MRI, TRI); + const TargetRegisterClass *SrcRC = getRegClassForTypeOnBank( + MRI.getType(SrcReg), RegBank, RBI, /* GetAllRegSet */ true); + if (SrcRC == &AArch64::GPR32allRegClass) + return selectFP16CopyFromGPR32(I, TII, MRI, SrcReg); + } assert(I.isCopy() && "Generic operators do not allow physical registers"); return true; } const RegisterBank &RegBank = *RBI.getRegBank(DstReg, MRI, TRI); const unsigned DstSize = MRI.getType(DstReg).getSizeInBits(); - unsigned SrcReg = I.getOperand(1).getReg(); + (void)DstSize; const unsigned SrcSize = RBI.getSizeInBits(SrcReg, MRI, TRI); (void)SrcSize; assert((!TargetRegisterInfo::isPhysicalRegister(SrcReg) || I.isCopy()) && @@ -340,26 +372,38 @@ static bool selectCopy(MachineInstr &I, const TargetIn "Copy with different width?!"); assert((DstSize <= 64 || RegBank.getID() == AArch64::FPRRegBankID) && "GPRs cannot get more than 64-bit width values"); - const TargetRegisterClass *RC = nullptr; - if (RegBank.getID() == AArch64::FPRRegBankID) { - if (DstSize <= 16) - RC = &AArch64::FPR16RegClass; - else if (DstSize <= 32) - RC = &AArch64::FPR32RegClass; - else if (DstSize <= 64) - RC = &AArch64::FPR64RegClass; - else if (DstSize <= 128) - RC = &AArch64::FPR128RegClass; - else { - DEBUG(dbgs() << "Unexpected bitcast size " << DstSize << '\n'); - return false; + const TargetRegisterClass *RC = getRegClassForTypeOnBank( + MRI.getType(DstReg), RegBank, RBI, /* GetAllRegSet */ true); + if (!RC) { + DEBUG(dbgs() << "Unexpected bitcast size " << DstSize << '\n'); + return false; + } + + if (!TargetRegisterInfo::isPhysicalRegister(SrcReg)) { + const RegClassOrRegBank &RegClassOrBank = MRI.getRegClassOrRegBank(SrcReg); + const TargetRegisterClass *SrcRC = + RegClassOrBank.dyn_cast(); + const RegisterBank *RB = nullptr; + if (!SrcRC) { + RB = RegClassOrBank.get(); + SrcRC = getRegClassForTypeOnBank(MRI.getType(SrcReg), *RB, RBI, true); } - } else { - assert(RegBank.getID() == AArch64::GPRRegBankID && - "Bitcast for the flags?"); - RC = - DstSize <= 32 ? &AArch64::GPR32allRegClass : &AArch64::GPR64allRegClass; + // Copies from fpr16 to gpr32 need to use SUBREG_TO_REG. + if (RC == &AArch64::GPR32allRegClass && SrcRC == &AArch64::FPR16RegClass) { + unsigned PromoteReg = MRI.createVirtualRegister(&AArch64::FPR32RegClass); + BuildMI(*I.getParent(), I, I.getDebugLoc(), + TII.get(AArch64::SUBREG_TO_REG)) + .addDef(PromoteReg) + .addImm(0) + .addUse(SrcReg) + .addImm(AArch64::hsub); + MachineOperand &RegOp = I.getOperand(1); + RegOp.setReg(PromoteReg); + } else if (RC == &AArch64::FPR16RegClass && + SrcRC == &AArch64::GPR32allRegClass) { + selectFP16CopyFromGPR32(I, TII, MRI, SrcReg); + } } // No need to constrain SrcReg. It will get constrained when @@ -795,15 +839,23 @@ bool AArch64InstructionSelector::select(MachineInstr & } case TargetOpcode::G_EXTRACT: { LLT SrcTy = MRI.getType(I.getOperand(1).getReg()); + LLT DstTy = MRI.getType(I.getOperand(0).getReg()); + unsigned SrcSize = SrcTy.getSizeInBits(); // Larger extracts are vectors, same-size extracts should be something else // by now (either split up or simplified to a COPY). if (SrcTy.getSizeInBits() > 64 || Ty.getSizeInBits() > 32) return false; - I.setDesc(TII.get(AArch64::UBFMXri)); + I.setDesc(TII.get(SrcSize == 64 ? AArch64::UBFMXri : AArch64::UBFMWri)); MachineInstrBuilder(MF, I).addImm(I.getOperand(2).getImm() + Ty.getSizeInBits() - 1); + if (SrcSize < 64) { + assert(SrcSize == 32 && DstTy.getSizeInBits() == 16 && + "unexpected G_EXTRACT types"); + return constrainSelectedInstRegOperands(I, TII, TRI, RBI); + } + unsigned DstReg = MRI.createGenericVirtualRegister(LLT::scalar(64)); BuildMI(MBB, std::next(I.getIterator()), I.getDebugLoc(), TII.get(AArch64::COPY)) @@ -818,16 +870,25 @@ bool AArch64InstructionSelector::select(MachineInstr & case TargetOpcode::G_INSERT: { LLT SrcTy = MRI.getType(I.getOperand(2).getReg()); + LLT DstTy = MRI.getType(I.getOperand(0).getReg()); + unsigned DstSize = DstTy.getSizeInBits(); + (void)DstSize; // Larger inserts are vectors, same-size ones should be something else by // now (split up or turned into COPYs). if (Ty.getSizeInBits() > 64 || SrcTy.getSizeInBits() > 32) return false; - I.setDesc(TII.get(AArch64::BFMXri)); + I.setDesc(TII.get(DstSize == 64 ? AArch64::BFMXri : AArch64::BFMWri)); unsigned LSB = I.getOperand(3).getImm(); unsigned Width = MRI.getType(I.getOperand(2).getReg()).getSizeInBits(); - I.getOperand(3).setImm((64 - LSB) % 64); + I.getOperand(3).setImm((DstSize - LSB) % DstSize); MachineInstrBuilder(MF, I).addImm(Width - 1); + + if (DstSize < 64) { + assert(DstSize == 32 && SrcTy.getSizeInBits() == 16 && + "unexpected G_INSERT types"); + return constrainSelectedInstRegOperands(I, TII, TRI, RBI); + } unsigned SrcReg = MRI.createGenericVirtualRegister(LLT::scalar(64)); BuildMI(MBB, I.getIterator(), I.getDebugLoc(), Modified: head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -3797,7 +3797,8 @@ void SIInstrInfo::moveToVALU(MachineInstr &TopInst) co } } - BuildMI(*MBB, Inst, Inst.getDebugLoc(), + MachineInstr *NewInstr = + BuildMI(*MBB, Inst, Inst.getDebugLoc(), get(AMDGPU::BUFFER_LOAD_DWORD_OFFEN), VDst) .add(*VAddr) // vaddr .add(*getNamedOperand(Inst, AMDGPU::OpName::sbase)) // srsrc @@ -3806,12 +3807,17 @@ void SIInstrInfo::moveToVALU(MachineInstr &TopInst) co .addImm(getNamedOperand(Inst, AMDGPU::OpName::glc)->getImm()) .addImm(0) // slc .addImm(0) // tfe - .setMemRefs(Inst.memoperands_begin(), Inst.memoperands_end()); + .setMemRefs(Inst.memoperands_begin(), Inst.memoperands_end()) + .getInstr(); MRI.replaceRegWith(getNamedOperand(Inst, AMDGPU::OpName::sdst)->getReg(), VDst); addUsersToMoveToVALUWorklist(VDst, MRI, Worklist); Inst.eraseFromParent(); + + // Legalize all operands other than the offset. Notably, convert the srsrc + // into SGPRs using v_readfirstlane if needed. + legalizeOperands(*NewInstr); continue; } } Modified: head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -454,13 +454,16 @@ bool PPCCTRLoops::mightUseCTR(BasicBlock *BB) { return true; } + // FREM is always a call. + if (J->getOpcode() == Instruction::FRem) + return true; + if (STI->useSoftFloat()) { switch(J->getOpcode()) { case Instruction::FAdd: case Instruction::FSub: case Instruction::FMul: case Instruction::FDiv: - case Instruction::FRem: case Instruction::FPTrunc: case Instruction::FPExt: case Instruction::FPToUI: Modified: head/contrib/llvm/lib/Target/X86/X86.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86.td Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Target/X86/X86.td Sun Feb 25 13:20:32 2018 (r329983) @@ -740,7 +740,13 @@ class SkylakeServerProc : ProcModel; def : SkylakeServerProc<"skx">; // Legacy alias. -def CNLFeatures : ProcessorFeaturesgetOpcode()) { + default: + return true; + case Instruction::SRem: + case Instruction::URem: + case Instruction::SDiv: + case Instruction::UDiv: + return false; + } + }; + // Try to simplify a binop sandwiched between 2 selects with the same // condition. // select(C, binop(select(C, X, Y), W), Z) -> select(C, binop(X, W), Z) BinaryOperator *TrueBO; - if (match(TrueVal, m_OneUse(m_BinOp(TrueBO)))) { + if (match(TrueVal, m_OneUse(m_BinOp(TrueBO))) && + canMergeSelectThroughBinop(TrueBO)) { if (auto *TrueBOSI = dyn_cast(TrueBO->getOperand(0))) { if (TrueBOSI->getCondition() == CondVal) { TrueBO->setOperand(0, TrueBOSI->getTrueValue()); @@ -1666,7 +1680,8 @@ Instruction *InstCombiner::visitSelectInst(SelectInst // select(C, Z, binop(select(C, X, Y), W)) -> select(C, Z, binop(Y, W)) BinaryOperator *FalseBO; - if (match(FalseVal, m_OneUse(m_BinOp(FalseBO)))) { + if (match(FalseVal, m_OneUse(m_BinOp(FalseBO))) && + canMergeSelectThroughBinop(FalseBO)) { if (auto *FalseBOSI = dyn_cast(FalseBO->getOperand(0))) { if (FalseBOSI->getCondition() == CondVal) { FalseBO->setOperand(0, FalseBOSI->getFalseValue()); Modified: head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -97,7 +97,7 @@ static bool hoist(Instruction &I, const DominatorTree const LoopSafetyInfo *SafetyInfo, OptimizationRemarkEmitter *ORE); static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT, - const Loop *CurLoop, const LoopSafetyInfo *SafetyInfo, + const Loop *CurLoop, LoopSafetyInfo *SafetyInfo, OptimizationRemarkEmitter *ORE, bool FreeInLoop); static bool isSafeToExecuteUnconditionally(Instruction &Inst, const DominatorTree *DT, @@ -855,10 +855,16 @@ static Instruction *sinkThroughTriviallyReplacablePHI( return New; } -static bool canSplitPredecessors(PHINode *PN) { +static bool canSplitPredecessors(PHINode *PN, LoopSafetyInfo *SafetyInfo) { BasicBlock *BB = PN->getParent(); if (!BB->canSplitPredecessors()) return false; + // It's not impossible to split EHPad blocks, but if BlockColors already exist + // it require updating BlockColors for all offspring blocks accordingly. By + // skipping such corner case, we can make updating BlockColors after splitting + // predecessor fairly simple. + if (!SafetyInfo->BlockColors.empty() && BB->getFirstNonPHI()->isEHPad()) + return false; for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) { BasicBlock *BBPred = *PI; if (isa(BBPred->getTerminator())) @@ -868,7 +874,8 @@ static bool canSplitPredecessors(PHINode *PN) { } static void splitPredecessorsOfLoopExit(PHINode *PN, DominatorTree *DT, - LoopInfo *LI, const Loop *CurLoop) { + LoopInfo *LI, const Loop *CurLoop, + LoopSafetyInfo *SafetyInfo) { #ifndef NDEBUG SmallVector ExitBlocks; CurLoop->getUniqueExitBlocks(ExitBlocks); @@ -910,13 +917,21 @@ static void splitPredecessorsOfLoopExit(PHINode *PN, D // LE: // %p = phi [%p1, %LE.split], [%p2, %LE.split2] // + auto &BlockColors = SafetyInfo->BlockColors; SmallSetVector PredBBs(pred_begin(ExitBB), pred_end(ExitBB)); while (!PredBBs.empty()) { BasicBlock *PredBB = *PredBBs.begin(); assert(CurLoop->contains(PredBB) && "Expect all predecessors are in the loop"); - if (PN->getBasicBlockIndex(PredBB) >= 0) - SplitBlockPredecessors(ExitBB, PredBB, ".split.loop.exit", DT, LI, true); + if (PN->getBasicBlockIndex(PredBB) >= 0) { + BasicBlock *NewPred = SplitBlockPredecessors( + ExitBB, PredBB, ".split.loop.exit", DT, LI, true); + // Since we do not allow splitting EH-block with BlockColors in + // canSplitPredecessors(), we can simply assign predecessor's color to + // the new block. + if (!BlockColors.empty()) + BlockColors[NewPred] = BlockColors[PredBB]; + } PredBBs.remove(PredBB); } } @@ -927,7 +942,7 @@ static void splitPredecessorsOfLoopExit(PHINode *PN, D /// position, and may either delete it or move it to outside of the loop. /// static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT, - const Loop *CurLoop, const LoopSafetyInfo *SafetyInfo, + const Loop *CurLoop, LoopSafetyInfo *SafetyInfo, OptimizationRemarkEmitter *ORE, bool FreeInLoop) { DEBUG(dbgs() << "LICM sinking instruction: " << I << "\n"); ORE->emit([&]() { @@ -975,12 +990,12 @@ static bool sink(Instruction &I, LoopInfo *LI, Dominat if (isTriviallyReplacablePHI(*PN, I)) continue; - if (!canSplitPredecessors(PN)) + if (!canSplitPredecessors(PN, SafetyInfo)) return Changed; // Split predecessors of the PHI so that we can make users trivially // replacable. - splitPredecessorsOfLoopExit(PN, DT, LI, CurLoop); + splitPredecessorsOfLoopExit(PN, DT, LI, CurLoop, SafetyInfo); // Should rebuild the iterators, as they may be invalidated by // splitPredecessorsOfLoopExit(). Modified: head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -23,6 +23,7 @@ #include "llvm/Analysis/ScalarEvolutionExpander.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/Analysis/TargetTransformInfo.h" +#include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" @@ -30,6 +31,7 @@ #include "llvm/IR/ValueHandle.h" #include "llvm/Pass.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/KnownBits.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" using namespace llvm; @@ -77,10 +79,13 @@ bool RecurrenceDescriptor::isArithmeticRecurrenceKind( return false; } -Instruction * -RecurrenceDescriptor::lookThroughAnd(PHINode *Phi, Type *&RT, - SmallPtrSetImpl &Visited, - SmallPtrSetImpl &CI) { +/// Determines if Phi may have been type-promoted. If Phi has a single user +/// that ANDs the Phi with a type mask, return the user. RT is updated to +/// account for the narrower bit width represented by the mask, and the AND +/// instruction is added to CI. +static Instruction *lookThroughAnd(PHINode *Phi, Type *&RT, + SmallPtrSetImpl &Visited, + SmallPtrSetImpl &CI) { if (!Phi->hasOneUse()) return Phi; @@ -101,70 +106,92 @@ RecurrenceDescriptor::lookThroughAnd(PHINode *Phi, Typ return Phi; } -bool RecurrenceDescriptor::getSourceExtensionKind( - Instruction *Start, Instruction *Exit, Type *RT, bool &IsSigned, - SmallPtrSetImpl &Visited, - SmallPtrSetImpl &CI) { +/// Compute the minimal bit width needed to represent a reduction whose exit +/// instruction is given by Exit. +static std::pair computeRecurrenceType(Instruction *Exit, + DemandedBits *DB, + AssumptionCache *AC, + DominatorTree *DT) { + bool IsSigned = false; + const DataLayout &DL = Exit->getModule()->getDataLayout(); + uint64_t MaxBitWidth = DL.getTypeSizeInBits(Exit->getType()); + if (DB) { + // Use the demanded bits analysis to determine the bits that are live out + // of the exit instruction, rounding up to the nearest power of two. If the + // use of demanded bits results in a smaller bit width, we know the value + // must be positive (i.e., IsSigned = false), because if this were not the + // case, the sign bit would have been demanded. + auto Mask = DB->getDemandedBits(Exit); + MaxBitWidth = Mask.getBitWidth() - Mask.countLeadingZeros(); + } + + if (MaxBitWidth == DL.getTypeSizeInBits(Exit->getType()) && AC && DT) { + // If demanded bits wasn't able to limit the bit width, we can try to use + // value tracking instead. This can be the case, for example, if the value + // may be negative. + auto NumSignBits = ComputeNumSignBits(Exit, DL, 0, AC, nullptr, DT); + auto NumTypeBits = DL.getTypeSizeInBits(Exit->getType()); + MaxBitWidth = NumTypeBits - NumSignBits; + KnownBits Bits = computeKnownBits(Exit, DL); + if (!Bits.isNonNegative()) { + // If the value is not known to be non-negative, we set IsSigned to true, + // meaning that we will use sext instructions instead of zext + // instructions to restore the original type. + IsSigned = true; + if (!Bits.isNegative()) + // If the value is not known to be negative, we don't known what the + // upper bit is, and therefore, we don't know what kind of extend we + // will need. In this case, just increase the bit width by one bit and + // use sext. + ++MaxBitWidth; + } + } + if (!isPowerOf2_64(MaxBitWidth)) + MaxBitWidth = NextPowerOf2(MaxBitWidth); + + return std::make_pair(Type::getIntNTy(Exit->getContext(), MaxBitWidth), + IsSigned); +} + +/// Collect cast instructions that can be ignored in the vectorizer's cost +/// model, given a reduction exit value and the minimal type in which the +/// reduction can be represented. +static void collectCastsToIgnore(Loop *TheLoop, Instruction *Exit, + Type *RecurrenceType, + SmallPtrSetImpl &Casts) { + SmallVector Worklist; - bool FoundOneOperand = false; - unsigned DstSize = RT->getPrimitiveSizeInBits(); + SmallPtrSet Visited; Worklist.push_back(Exit); - // Traverse the instructions in the reduction expression, beginning with the - // exit value. while (!Worklist.empty()) { - Instruction *I = Worklist.pop_back_val(); - for (Use &U : I->operands()) { - - // Terminate the traversal if the operand is not an instruction, or we - // reach the starting value. - Instruction *J = dyn_cast(U.get()); - if (!J || J == Start) + Instruction *Val = Worklist.pop_back_val(); + Visited.insert(Val); + if (auto *Cast = dyn_cast(Val)) + if (Cast->getSrcTy() == RecurrenceType) { + // If the source type of a cast instruction is equal to the recurrence + // type, it will be eliminated, and should be ignored in the vectorizer + // cost model. + Casts.insert(Cast); continue; - - // Otherwise, investigate the operation if it is also in the expression. - if (Visited.count(J)) { - Worklist.push_back(J); - continue; } - // If the operand is not in Visited, it is not a reduction operation, but - // it does feed into one. Make sure it is either a single-use sign- or - // zero-extend instruction. - CastInst *Cast = dyn_cast(J); - bool IsSExtInst = isa(J); - if (!Cast || !Cast->hasOneUse() || !(isa(J) || IsSExtInst)) - return false; - - // Ensure the source type of the extend is no larger than the reduction - // type. It is not necessary for the types to be identical. - unsigned SrcSize = Cast->getSrcTy()->getPrimitiveSizeInBits(); - if (SrcSize > DstSize) - return false; - - // Furthermore, ensure that all such extends are of the same kind. - if (FoundOneOperand) { - if (IsSigned != IsSExtInst) - return false; - } else { - FoundOneOperand = true; - IsSigned = IsSExtInst; - } - - // Lastly, if the source type of the extend matches the reduction type, - // add the extend to CI so that we can avoid accounting for it in the - // cost model. - if (SrcSize == DstSize) - CI.insert(Cast); - } + // Add all operands to the work list if they are loop-varying values that + // we haven't yet visited. + for (Value *O : cast(Val)->operands()) + if (auto *I = dyn_cast(O)) + if (TheLoop->contains(I) && !Visited.count(I)) + Worklist.push_back(I); } - return true; } bool RecurrenceDescriptor::AddReductionVar(PHINode *Phi, RecurrenceKind Kind, Loop *TheLoop, bool HasFunNoNaNAttr, - RecurrenceDescriptor &RedDes) { + RecurrenceDescriptor &RedDes, + DemandedBits *DB, + AssumptionCache *AC, + DominatorTree *DT) { if (Phi->getNumIncomingValues() != 2) return false; @@ -353,14 +380,49 @@ bool RecurrenceDescriptor::AddReductionVar(PHINode *Ph if (!FoundStartPHI || !FoundReduxOp || !ExitInstruction) return false; - // If we think Phi may have been type-promoted, we also need to ensure that - // all source operands of the reduction are either SExtInsts or ZEstInsts. If - // so, we will be able to evaluate the reduction in the narrower bit width. - if (Start != Phi) - if (!getSourceExtensionKind(Start, ExitInstruction, RecurrenceType, - IsSigned, VisitedInsts, CastInsts)) + if (Start != Phi) { + // If the starting value is not the same as the phi node, we speculatively + // looked through an 'and' instruction when evaluating a potential + // arithmetic reduction to determine if it may have been type-promoted. + // + // We now compute the minimal bit width that is required to represent the + // reduction. If this is the same width that was indicated by the 'and', we + // can represent the reduction in the smaller type. The 'and' instruction + // will be eliminated since it will essentially be a cast instruction that + // can be ignore in the cost model. If we compute a different type than we + // did when evaluating the 'and', the 'and' will not be eliminated, and we + // will end up with different kinds of operations in the recurrence + // expression (e.g., RK_IntegerAND, RK_IntegerADD). We give up if this is + // the case. + // + // The vectorizer relies on InstCombine to perform the actual + // type-shrinking. It does this by inserting instructions to truncate the + // exit value of the reduction to the width indicated by RecurrenceType and + // then extend this value back to the original width. If IsSigned is false, + // a 'zext' instruction will be generated; otherwise, a 'sext' will be + // used. + // + // TODO: We should not rely on InstCombine to rewrite the reduction in the + // smaller type. We should just generate a correctly typed expression + // to begin with. + Type *ComputedType; + std::tie(ComputedType, IsSigned) = + computeRecurrenceType(ExitInstruction, DB, AC, DT); + if (ComputedType != RecurrenceType) return false; + // The recurrence expression will be represented in a narrower type. If + // there are any cast instructions that will be unnecessary, collect them + // in CastInsts. Note that the 'and' instruction was already included in + // this list. + // + // TODO: A better way to represent this may be to tag in some way all the + // instructions that are a part of the reduction. The vectorizer cost + // model could then apply the recurrence type to these instructions, + // without needing a white list of instructions to ignore. + collectCastsToIgnore(TheLoop, ExitInstruction, RecurrenceType, CastInsts); + } + // We found a reduction var if we have reached the original phi node and we // only have a single instruction with out-of-loop users. @@ -480,47 +542,57 @@ bool RecurrenceDescriptor::hasMultipleUsesOf( return false; } bool RecurrenceDescriptor::isReductionPHI(PHINode *Phi, Loop *TheLoop, - RecurrenceDescriptor &RedDes) { + RecurrenceDescriptor &RedDes, + DemandedBits *DB, AssumptionCache *AC, + DominatorTree *DT) { BasicBlock *Header = TheLoop->getHeader(); Function &F = *Header->getParent(); bool HasFunNoNaNAttr = F.getFnAttribute("no-nans-fp-math").getValueAsString() == "true"; - if (AddReductionVar(Phi, RK_IntegerAdd, TheLoop, HasFunNoNaNAttr, RedDes)) { + if (AddReductionVar(Phi, RK_IntegerAdd, TheLoop, HasFunNoNaNAttr, RedDes, DB, + AC, DT)) { DEBUG(dbgs() << "Found an ADD reduction PHI." << *Phi << "\n"); return true; } - if (AddReductionVar(Phi, RK_IntegerMult, TheLoop, HasFunNoNaNAttr, RedDes)) { + if (AddReductionVar(Phi, RK_IntegerMult, TheLoop, HasFunNoNaNAttr, RedDes, DB, + AC, DT)) { DEBUG(dbgs() << "Found a MUL reduction PHI." << *Phi << "\n"); return true; } - if (AddReductionVar(Phi, RK_IntegerOr, TheLoop, HasFunNoNaNAttr, RedDes)) { + if (AddReductionVar(Phi, RK_IntegerOr, TheLoop, HasFunNoNaNAttr, RedDes, DB, + AC, DT)) { DEBUG(dbgs() << "Found an OR reduction PHI." << *Phi << "\n"); return true; } - if (AddReductionVar(Phi, RK_IntegerAnd, TheLoop, HasFunNoNaNAttr, RedDes)) { + if (AddReductionVar(Phi, RK_IntegerAnd, TheLoop, HasFunNoNaNAttr, RedDes, DB, + AC, DT)) { DEBUG(dbgs() << "Found an AND reduction PHI." << *Phi << "\n"); return true; } - if (AddReductionVar(Phi, RK_IntegerXor, TheLoop, HasFunNoNaNAttr, RedDes)) { + if (AddReductionVar(Phi, RK_IntegerXor, TheLoop, HasFunNoNaNAttr, RedDes, DB, + AC, DT)) { DEBUG(dbgs() << "Found a XOR reduction PHI." << *Phi << "\n"); return true; } - if (AddReductionVar(Phi, RK_IntegerMinMax, TheLoop, HasFunNoNaNAttr, - RedDes)) { + if (AddReductionVar(Phi, RK_IntegerMinMax, TheLoop, HasFunNoNaNAttr, RedDes, + DB, AC, DT)) { DEBUG(dbgs() << "Found a MINMAX reduction PHI." << *Phi << "\n"); return true; } - if (AddReductionVar(Phi, RK_FloatMult, TheLoop, HasFunNoNaNAttr, RedDes)) { + if (AddReductionVar(Phi, RK_FloatMult, TheLoop, HasFunNoNaNAttr, RedDes, DB, + AC, DT)) { DEBUG(dbgs() << "Found an FMult reduction PHI." << *Phi << "\n"); return true; } - if (AddReductionVar(Phi, RK_FloatAdd, TheLoop, HasFunNoNaNAttr, RedDes)) { + if (AddReductionVar(Phi, RK_FloatAdd, TheLoop, HasFunNoNaNAttr, RedDes, DB, + AC, DT)) { DEBUG(dbgs() << "Found an FAdd reduction PHI." << *Phi << "\n"); return true; } - if (AddReductionVar(Phi, RK_FloatMinMax, TheLoop, HasFunNoNaNAttr, RedDes)) { + if (AddReductionVar(Phi, RK_FloatMinMax, TheLoop, HasFunNoNaNAttr, RedDes, DB, + AC, DT)) { DEBUG(dbgs() << "Found an float MINMAX reduction PHI." << *Phi << "\n"); return true; } Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -1542,9 +1542,10 @@ class LoopVectorizationLegality { (public) const TargetTransformInfo *TTI, std::function *GetLAA, LoopInfo *LI, OptimizationRemarkEmitter *ORE, LoopVectorizationRequirements *R, - LoopVectorizeHints *H) + LoopVectorizeHints *H, DemandedBits *DB, AssumptionCache *AC) : TheLoop(L), PSE(PSE), TLI(TLI), TTI(TTI), DT(DT), GetLAA(GetLAA), - ORE(ORE), InterleaveInfo(PSE, L, DT, LI), Requirements(R), Hints(H) {} + ORE(ORE), InterleaveInfo(PSE, L, DT, LI), Requirements(R), Hints(H), + DB(DB), AC(AC) {} /// ReductionList contains the reduction descriptors for all /// of the reductions that were found in the loop. @@ -1833,6 +1834,14 @@ class LoopVectorizationLegality { (public) /// Used to emit an analysis of any legality issues. LoopVectorizeHints *Hints; + /// The demanded bits analsyis is used to compute the minimum type size in + /// which a reduction can be computed. + DemandedBits *DB; + + /// The assumption cache analysis is used to compute the minimum type size in + /// which a reduction can be computed. + AssumptionCache *AC; + /// While vectorizing these instructions we have to generate a /// call to the appropriate masked intrinsic SmallPtrSet MaskedOp; @@ -5300,7 +5309,8 @@ bool LoopVectorizationLegality::canVectorizeInstrs() { } RecurrenceDescriptor RedDes; - if (RecurrenceDescriptor::isReductionPHI(Phi, TheLoop, RedDes)) { + if (RecurrenceDescriptor::isReductionPHI(Phi, TheLoop, RedDes, DB, AC, + DT)) { if (RedDes.hasUnsafeAlgebra()) Requirements->addUnsafeAlgebraInst(RedDes.getUnsafeAlgebraInst()); AllowedExit.insert(RedDes.getLoopExitInstr()); @@ -8514,7 +8524,7 @@ bool LoopVectorizePass::processLoop(Loop *L) { // Check if it is legal to vectorize the loop. LoopVectorizationRequirements Requirements(*ORE); LoopVectorizationLegality LVL(L, PSE, DT, TLI, AA, F, TTI, GetLAA, LI, ORE, - &Requirements, &Hints); + &Requirements, &Hints, DB, AC); if (!LVL.canVectorize()) { DEBUG(dbgs() << "LV: Not vectorizing: Cannot prove legality.\n"); emitMissedWarning(F, L, Hints, ORE); Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -152,7 +152,8 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "avx512bw", true); setFeatureEnabledImpl(Features, "avx512vl", true); setFeatureEnabledImpl(Features, "pku", true); - setFeatureEnabledImpl(Features, "clwb", true); + if (Kind != CK_Cannonlake) // CNL inherits all SKX features, except CLWB + setFeatureEnabledImpl(Features, "clwb", true); LLVM_FALLTHROUGH; case CK_SkylakeClient: setFeatureEnabledImpl(Features, "xsavec", true); Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -14926,7 +14926,8 @@ static void DoMarkVarDeclReferenced(Sema &SemaRef, Sou if (RefersToEnclosingScope) { LambdaScopeInfo *const LSI = SemaRef.getCurLambda(/*IgnoreNonLambdaCapturingScope=*/true); - if (LSI && !LSI->CallOperator->Encloses(Var->getDeclContext())) { + if (LSI && (!LSI->CallOperator || + !LSI->CallOperator->Encloses(Var->getDeclContext()))) { // If a variable could potentially be odr-used, defer marking it so // until we finish analyzing the full expression for any // lvalue-to-rvalue Modified: head/contrib/llvm/tools/lld/ELF/Driver.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Driver.cpp Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/tools/lld/ELF/Driver.cpp Sun Feb 25 13:20:32 2018 (r329983) @@ -638,7 +638,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args Config->Optimize = args::getInteger(Args, OPT_O, 1); Config->OrphanHandling = getOrphanHandling(Args); Config->OutputFile = Args.getLastArgValue(OPT_o); - Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false); + Config->Pie = Args.hasFlag(OPT_pie, OPT_nopie, false); Config->PrintGcSections = Args.hasFlag(OPT_print_gc_sections, OPT_no_print_gc_sections, false); Config->Rpath = getRpath(Args); @@ -1061,7 +1061,12 @@ template void LinkerDriver::link(opt::Inp addReservedSymbols(); // Apply version scripts. - Symtab->scanVersionScript(); + // + // For a relocatable output, version scripts don't make sense, and + // parsing a symbol version string (e.g. dropping "@ver1" from a symbol + // name "foo@ver1") rather do harm, so we don't call this if -r is given. + if (!Config->Relocatable) + Symtab->scanVersionScript(); // Create wrapped symbols for -wrap option. for (auto *Arg : Args.filtered(OPT_wrap)) Modified: head/contrib/llvm/tools/lld/ELF/Options.td ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Options.td Sun Feb 25 11:29:55 2018 (r329982) +++ head/contrib/llvm/tools/lld/ELF/Options.td Sun Feb 25 13:20:32 2018 (r329983) @@ -202,8 +202,6 @@ def no_gnu_unique: F<"no-gnu-unique">, def no_merge_exidx_entries: F<"no-merge-exidx-entries">, HelpText<"Disable merging .ARM.exidx entries">; -def no_pie: F<"no-pie">, HelpText<"Do not create a position independent executable">; - def no_threads: F<"no-threads">, HelpText<"Do not run the linker multi-threaded">; @@ -212,6 +210,8 @@ def no_whole_archive: F<"no-whole-archive">, def noinhibit_exec: F<"noinhibit-exec">, HelpText<"Retain the executable output file whenever it is still usable">; + +def nopie: F<"nopie">, HelpText<"Do not create a position independent executable">; def no_omagic: Flag<["--"], "no-omagic">, MetaVarName<"">, HelpText<"Do not set the text data sections to be writable">; Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Sun Feb 25 11:29:55 2018 (r329982) +++ head/lib/clang/include/clang/Basic/Version.inc Sun Feb 25 13:20:32 2018 (r329983) @@ -8,4 +8,4 @@ #define CLANG_VENDOR "FreeBSD " -#define SVN_REVISION "325330" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Feb 25 17:02:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1CDF3A766; Sun, 25 Feb 2018 17:02:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BD7486ED3; Sun, 25 Feb 2018 17:02:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CB3E7B78; Sun, 25 Feb 2018 17:02:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PH2p3c015646; Sun, 25 Feb 2018 17:02:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PH2pIk015645; Sun, 25 Feb 2018 17:02:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802251702.w1PH2pIk015645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Feb 2018 17:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329987 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 17:02:52 -0000 Author: kevans Date: Sun Feb 25 17:02:50 2018 New Revision: 329987 URL: https://svnweb.freebsd.org/changeset/base/329987 Log: lualoader: Track the menu currently drawn, instead of validity This cleans up the odd approach to menu drawing. Instead of tracking validity, we track the menu that was drawn on the screen. Whenever we draw a menu, we'll set this to that menu. Anything that invalidates the screen should go ahead and trigger an explicit redraw, rather than finding a wy to set screen_invalid. The currently drawn menu is then reset in menu.run as we exit the menu system, so that dropping to the loader prompt or leaving menu.run() will just behave as expected without doing redundant work every time we leave a menu. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sun Feb 25 16:29:02 2018 (r329986) +++ head/stand/lua/menu.lua Sun Feb 25 17:02:50 2018 (r329987) @@ -38,7 +38,7 @@ local drawer = require("drawer") local menu = {} -local screen_invalid = true +local drawn_menu local function OnOff(str, b) if b then @@ -82,7 +82,6 @@ menu.handlers = { end end, [core.MENU_SUBMENU] = function(_, entry) - screen_invalid = true menu.process(entry.submenu) end, [core.MENU_RETURN] = function(_, entry) @@ -348,12 +347,12 @@ menu.default = menu.welcome -- the local alias_table in menu.process. menu.current_alias_table = {} -function menu.redraw(m) - -- redraw screen +function menu.draw(m) + -- Clear the screen, reset the cursor, then draw screen.clear() screen.defcursor() menu.current_alias_table = drawer.drawscreen(m) - screen_invalid = false + drawn_menu = m end -- 'keypress' allows the caller to indicate that a key has been pressed that we @@ -361,10 +360,8 @@ end function menu.process(m, keypress) assert(m ~= nil) - -- Trigger a redraw if we've been invalidated. Otherwise, we assume - -- that this menu has already been drawn. - if screen_invalid then - menu.redraw(m) + if drawn_menu ~= m then + menu.draw(m) end while true do @@ -404,13 +401,9 @@ function menu.process(m, keypress) end -- If we got an alias key the screen is out of date... -- redraw it. - menu.redraw(m) + menu.draw(m) end end - -- Invalidate the screen upon exit so that it gets redrawn upon - -- processing a new menu, assuming it won't be redrawn after leaving - -- this menu - screen_invalid = false end function menu.run() @@ -419,10 +412,11 @@ function menu.run() return end - menu.redraw(menu.default) + menu.draw(menu.default) local autoboot_key = menu.autoboot() menu.process(menu.default, autoboot_key) + drawn_menu = nil screen.defcursor() print("Exiting menu!") From owner-svn-src-head@freebsd.org Sun Feb 25 15:16:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FCF5F336B4; Sun, 25 Feb 2018 15:16:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE8CF80FC1; Sun, 25 Feb 2018 15:16:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D00F769E8; Sun, 25 Feb 2018 15:16:58 +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 w1PFGwlM060392; Sun, 25 Feb 2018 15:16:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PFGw7K060391; Sun, 25 Feb 2018 15:16:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201802251516.w1PFGw7K060391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 25 Feb 2018 15:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329985 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 329985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 15:16:59 -0000 Author: mjg Date: Sun Feb 25 15:16:58 2018 New Revision: 329985 URL: https://svnweb.freebsd.org/changeset/base/329985 Log: Don't generate data in sysctl_out_proc unless we intend to copy out. The first call is used to gauge how much spaces is needed. Just computing the size instead of generating the output allows to not take the proctree lock. Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Feb 25 14:29:43 2018 (r329984) +++ head/sys/kern/kern_proc.c Sun Feb 25 15:16:58 2018 (r329985) @@ -1347,6 +1347,32 @@ freebsd32_kinfo_proc_out(const struct kinfo_proc *ki, } #endif +static ssize_t +kern_proc_out_size(struct proc *p, int flags) +{ + ssize_t size = 0; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + if ((flags & KERN_PROC_NOTHREADS) != 0) { +#ifdef COMPAT_FREEBSD32 + if ((flags & KERN_PROC_MASK32) != 0) { + size += sizeof(struct kinfo_proc32); + } else +#endif + size += sizeof(struct kinfo_proc); + } else { +#ifdef COMPAT_FREEBSD32 + if ((flags & KERN_PROC_MASK32) != 0) + size += sizeof(struct kinfo_proc32) * p->p_numthreads; + else +#endif + size += sizeof(struct kinfo_proc) * p->p_numthreads; + } + PROC_UNLOCK(p); + return (size); +} + int kern_proc_out(struct proc *p, struct sbuf *sb, int flags) { @@ -1399,6 +1425,9 @@ sysctl_out_proc(struct proc *p, struct sysctl_req *req struct kinfo_proc ki; int error, error2; + if (req->oldptr == NULL) + return (SYSCTL_OUT(req, 0, kern_proc_out_size(p, flags))); + sbuf_new_for_sysctl(&sb, (char *)&ki, sizeof(ki), req); sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = kern_proc_out(p, &sb, flags); @@ -1461,16 +1490,22 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) break; } - if (!req->oldptr) { + if (req->oldptr == NULL) { /* overestimate by 5 procs */ error = SYSCTL_OUT(req, 0, sizeof (struct kinfo_proc) * 5); if (error) return (error); + } else { + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + /* + * This lock is only needed to safely grab the parent of a + * traced process. Only grab it if we are producing any + * data to begin with. + */ + sx_slock(&proctree_lock); } - error = sysctl_wire_old_buffer(req, 0); - if (error != 0) - return (error); - sx_slock(&proctree_lock); sx_slock(&allproc_lock); for (doingzomb=0 ; doingzomb < 2 ; doingzomb++) { if (!doingzomb) @@ -1571,16 +1606,15 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } error = sysctl_out_proc(p, req, flags); - if (error) { - sx_sunlock(&allproc_lock); - sx_sunlock(&proctree_lock); - return (error); - } + if (error) + goto out; } } +out: sx_sunlock(&allproc_lock); - sx_sunlock(&proctree_lock); - return (0); + if (req->oldptr != NULL) + sx_sunlock(&proctree_lock); + return (error); } struct pargs * From owner-svn-src-head@freebsd.org Sun Feb 25 16:29:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8923BF3890F; Sun, 25 Feb 2018 16:29:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37EE985139; Sun, 25 Feb 2018 16:29:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E24A7515; Sun, 25 Feb 2018 16:29:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PGT3Aq095393; Sun, 25 Feb 2018 16:29:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PGT3Mx095392; Sun, 25 Feb 2018 16:29:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802251629.w1PGT3Mx095392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Feb 2018 16:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329986 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 16:29:03 -0000 Author: kevans Date: Sun Feb 25 16:29:02 2018 New Revision: 329986 URL: https://svnweb.freebsd.org/changeset/base/329986 Log: lualoader: Invalidate the screen from menu perspective upon mnu exit In the common case, this will effectively do nothing as the menu will get redrawn as we leave submenus regardless of whether the screen has been marked invalid or not However, upon escape to the loader prompt, one could do either of the following to re-enter the menu system: -- Method 1 require('menu').run() -- Method 2 require('menu').process(menu.default) With method 1, the menu will get redrawn anyways as we do this before autoboot checking upon entry. With method 2, however, the menu will not be redrawn without this invalidation. Both methods are acceptable for re-entering the menu system, although the latter method in the local module for processing new and interesting menus is more expected. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sun Feb 25 15:16:58 2018 (r329985) +++ head/stand/lua/menu.lua Sun Feb 25 16:29:02 2018 (r329986) @@ -407,6 +407,10 @@ function menu.process(m, keypress) menu.redraw(m) end end + -- Invalidate the screen upon exit so that it gets redrawn upon + -- processing a new menu, assuming it won't be redrawn after leaving + -- this menu + screen_invalid = false end function menu.run() From owner-svn-src-head@freebsd.org Sun Feb 25 13:52:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAEB7F2F677; Sun, 25 Feb 2018 13:52:27 +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 1B2A07DE49; Sun, 25 Feb 2018 13:52:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 877B48256; Sun, 25 Feb 2018 14:52:15 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_92DF56FF-F7D7-45FA-AFB1-0CB893F50C11"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r329910 - head/sys/cddl/contrib/opensolaris/uts/common/sys Date: Sun, 25 Feb 2018 14:52:14 +0100 In-Reply-To: <201802241601.w1OG1LQ3043733@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Alan Somers References: <201802241601.w1OG1LQ3043733@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 13:52:27 -0000 --Apple-Mail=_92DF56FF-F7D7-45FA-AFB1-0CB893F50C11 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 24 Feb 2018, at 17:01, Alan Somers wrote: >=20 > Author: asomers > Date: Sat Feb 24 16:01:21 2018 > New Revision: 329910 > URL: https://svnweb.freebsd.org/changeset/base/329910 >=20 > Log: > Implement CTASSERT using _Static_assert >=20 > Prevents warnings about "unused typedef" with GCC-6 >=20 > Reported by: GCC-6 > MFC after: 18 days > X-MFC-With: 329722 >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Sat Feb = 24 15:13:20 2018 (r329909) > +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Sat Feb = 24 16:01:21 2018 (r329910) > @@ -133,8 +133,8 @@ _NOTE(CONSTCOND) } while (0) > #ifndef CTASSERT > #define CTASSERT(x) _CTASSERT(x, __LINE__) > #define _CTASSERT(x, y) __CTASSERT(x, y) > -#define __CTASSERT(x, y) \ > - typedef char __compile_time_assertion__ ## y [(x) ? 1 : -1] > +#define __CTASSERT(x, y) \ > + _Static_assert((x), "Static assert failed at " #y) > #endif >=20 > #ifdef _KERNEL Note that the trick with the negatively indexed array is to support older versions of gcc, which did not yet recognize _Static_assert. It looks like this was added in gcc 4.6. -Dimitry --Apple-Mail=_92DF56FF-F7D7-45FA-AFB1-0CB893F50C11 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWpK/jgAKCRCwXqMKLiCW o+8tAJwPPAed5zndBo1SRqEESLTJ4vvtXQCeN/dAJzO9qx/8/e39YDV6/Hp1hp0= =emDq -----END PGP SIGNATURE----- --Apple-Mail=_92DF56FF-F7D7-45FA-AFB1-0CB893F50C11-- From owner-svn-src-head@freebsd.org Sun Feb 25 14:52:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20097F31DB8; Sun, 25 Feb 2018 14:52:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 754507FCE4; Sun, 25 Feb 2018 14:52:51 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22c.google.com with SMTP id g72so18640554lfg.5; Sun, 25 Feb 2018 06:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=DLij4xbwrPAX2LE7emlQk6SIelBhrun/qTyo020Wre0=; b=L80ZS5AFWae16f+DxNBcz5sMDmmEw8FYdIiOVbrwBOCbEZlunUFVNeHsCZoaOKYn4g csTWYZ2CaktvuD1xYYpiCjKR98f1YjlXkUEgtHXest/pZ/6H+e2nhCWyIW3cJk/0ye0x +Cg0oj3mO03nZzYJVnjs5HkftaWZt3dWuAJ1WbP3PsPdNclDMwkmoPUxg0dyATPf9QA7 gr/CkCunGgoyQsf2hUseVn33WgPqCykbrOjONoTK1idlU+MrlwUCJuNCQbj9H0SolIAh OXweWsKeW7wDaib2J2vkF4KRet5a9KJZTKOUE16yPiFOdwPmU44mp5KUHBgf2E48Kvca zkUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=DLij4xbwrPAX2LE7emlQk6SIelBhrun/qTyo020Wre0=; b=Zv2sV+IwuDQrvU488P+1ZEYahkRyNLrWktWA40NHeEZ0+O0+JYrdyLs4gNcJ9SpaCS wuKFaT8ewuIKj48WDncRVAUGQw/+hT23J0CVOGG/oSr8jVCMaVQ4ej7/ZZI3qq3L+nc1 1kHrvpoPEpIPlU+JkwXHiNN0OJUGytNuxxUvJI2g7Gxwe/laoYlbSDEY6oQD0E+qHFeD I867VoOa74dlQY5XsQNIq7EwcZBpJvbU9UzwLShMYxCfwPZN8DO56sIAGPcpvvvKkI9/ xBjY25wgmL0XButWPd4i5pozqNgDCTWW+z4PuA8ePuwqCfH+dGw/Ek1WknEvYzoZW3Jn VxXg== X-Gm-Message-State: APf1xPDZYkgcPhOhk2RGi/RdOgSDadXwW4vY5wtugVPDmaQYT6QKJJ8G vo5mPLtFwtJoaV4m0d26EAFYRDpoSYCkDmVCSHg= X-Google-Smtp-Source: AG47ELuxhXu/XpUnWydjA6STwS7WPvyFh1gbTxuSD1MfUSJ7QHhTK2EmU8B2Jwy2uKAUxH2TCYHvb7ZtriYgc1gdMfw= X-Received: by 10.46.20.30 with SMTP id u30mr5708538ljd.12.1519570369860; Sun, 25 Feb 2018 06:52:49 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.30.66 with HTTP; Sun, 25 Feb 2018 06:52:49 -0800 (PST) In-Reply-To: References: <201801310305.w0V35EU4090569@repo.freebsd.org> From: Alan Somers Date: Sun, 25 Feb 2018 07:52:49 -0700 X-Google-Sender-Auth: 3kQjtqJzeauMAENgoInGPhrVweA Message-ID: Subject: Re: svn commit: r328612 - head/lib/libc/stdlib To: Warner Losh Cc: Steve Wills , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 14:52:52 -0000 I'm seeing the same error during the build of usr.sbin/nologin for riscv.riscv64sf. Has anybody figured out a solution yet? On Thu, Feb 1, 2018 at 9:09 PM, Warner Losh wrote: > > > On Thu, Feb 1, 2018 at 8:34 PM, Steve Wills wrote: > >> This, somehow, seems to have broken the mips64 build: >> >> https://ci.freebsd.org/job/FreeBSD-head-mips64-build/216/consoleFull >> >> The previous rev works. >> > > This breaks devd, of all things, with > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > function `__gedf2': > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:96: multiple > definition of `__gedf2' > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(gedf2.o):/ > usr/src/lib/libc/softfloat/gedf2.c:18: first defined here > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > function `__eqdf2': > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:126: multiple > definition of `__eqdf2' > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(eqdf2.o):/ > usr/src/lib/libc/softfloat/eqdf2.c:18: first defined here > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > function `__ltdf2': > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:131: multiple > definition of `__ltdf2' > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(ltdf2.o):/ > usr/src/lib/libc/softfloat/ltdf2.c:18: first defined here > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > function `__nedf2': > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:136: multiple > definition of `__nedf2' > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(nedf2.o):/ > usr/src/lib/libc/softfloat/nedf2.c:18: first defined here > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > function `__gtdf2': > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:141: multiple > definition of `__gtdf2' > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(gtdf2.o):/ > usr/src/lib/libc/softfloat/gtdf2.c:18: first defined here > > undefined.... devd doesn't even use strtodl. > > (looks like the code to associate make output with the right commands is > broken, since I had to dig for it. > > Warner > > >> Steve >> >> >> On 01/30/2018 22:05, Warner Losh wrote: >> >>> Author: imp >>> Date: Wed Jan 31 03:05:14 2018 >>> New Revision: 328612 >>> URL: https://svnweb.freebsd.org/changeset/base/328612 >>> >>> Log: >>> Move strtold wrapper from strtol.c to its own strtold.c. This code >>> was written by theraven@ (David Chisnall) entirely, there's no >>> original Berkeley code left here so just copy his copyright over. >>> >>> > From owner-svn-src-head@freebsd.org Sun Feb 25 14:29:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 250DAF3086D; Sun, 25 Feb 2018 14:29:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C93A37EBB7; Sun, 25 Feb 2018 14:29:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFBC761F1; Sun, 25 Feb 2018 14:29:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PEThKe035305; Sun, 25 Feb 2018 14:29:43 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PEThjY035303; Sun, 25 Feb 2018 14:29:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802251429.w1PEThjY035303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 25 Feb 2018 14:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329984 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys X-SVN-Commit-Revision: 329984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 14:29:44 -0000 Author: asomers Date: Sun Feb 25 14:29:43 2018 New Revision: 329984 URL: https://svnweb.freebsd.org/changeset/base/329984 Log: Don't declare __assfail as static It gets called by dmu_buf_init_user, which is inline but not static. So it needs global linkage itself. Reported by: GCC-6 MFC after: 17 days X-MFC-With: 329722 Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c head/sys/cddl/compat/opensolaris/sys/assfail.h Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Sun Feb 25 13:20:32 2018 (r329983) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Sun Feb 25 14:29:43 2018 (r329984) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/cddl/compat/opensolaris/sys/assfail.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/assfail.h Sun Feb 25 13:20:32 2018 (r329983) +++ head/sys/cddl/compat/opensolaris/sys/assfail.h Sun Feb 25 14:29:43 2018 (r329984) @@ -48,7 +48,9 @@ void assfail3(const char *, uintmax_t, const char *, u #ifndef HAVE_ASSFAIL extern int aok; -static __inline int +__inline int __assfail(const char *expr, const char *file, int line); + +__inline int __assfail(const char *expr, const char *file, int line) { From owner-svn-src-head@freebsd.org Sun Feb 25 18:26:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9266F091F9; Sun, 25 Feb 2018 18:26:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F0856A701; Sun, 25 Feb 2018 18:26:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5565F1082F; Sun, 25 Feb 2018 18:26:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PIQp8U056096; Sun, 25 Feb 2018 18:26:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PIQpGg056094; Sun, 25 Feb 2018 18:26:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802251826.w1PIQpGg056094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 25 Feb 2018 18:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329988 - in head/sys/modules/i2c: . iicbus ofw_iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/modules/i2c: . iicbus ofw_iicbus X-SVN-Commit-Revision: 329988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 18:26:51 -0000 Author: ian Date: Sun Feb 25 18:26:50 2018 New Revision: 329988 URL: https://svnweb.freebsd.org/changeset/base/329988 Log: Instead of building ofw_iicbus as a separate module, just compile it in to the iicbus module for FDT-based systems. The primary motivation for this is that host controller drivers which declare DRIVER_MODULE(ofw_iicbus, thisdriver, etc, etc) now only need a single MODULE_DEPEND(thisdriver, ofw_iicbus) for runtime linking to resolve all the symbols. With ofw_iicbus and iicbus in separate modules, drivers would need to declare a MODULE_DEPEND() on both, because symbol lookup is non-recursive through the dependency chain. Requiring a driver to have MODULE_DEPENDS() on both amounts to requiring the drivers to understand the kobj inheritence details of how ofw_iicbus is implemented, which seems like something they shouldn't have to know (and could even change some day). Also, this is somewhat analogous to how the drivers get built when compiled into the kernel. You don't have to ask for ofw_iicbus separately, it just gets built in along with iicbus when option FDT is in effect. Deleted: head/sys/modules/i2c/ofw_iicbus/ Modified: head/sys/modules/i2c/Makefile head/sys/modules/i2c/iicbus/Makefile Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Sun Feb 25 17:02:50 2018 (r329987) +++ head/sys/modules/i2c/Makefile Sun Feb 25 18:26:50 2018 (r329988) @@ -21,8 +21,4 @@ SUBDIR = \ smb \ smbus \ -.if !empty(OPT_FDT) -SUBDIR += ofw_iicbus -.endif - .include Modified: head/sys/modules/i2c/iicbus/Makefile ============================================================================== --- head/sys/modules/i2c/iicbus/Makefile Sun Feb 25 17:02:50 2018 (r329987) +++ head/sys/modules/i2c/iicbus/Makefile Sun Feb 25 18:26:50 2018 (r329988) @@ -14,4 +14,8 @@ SRCS= \ iiconf.c \ iiconf.h \ +.if !empty(OPT_FDT) +SRCS+= ofw_iicbus.c ofw_bus_if.h +.endif + .include From owner-svn-src-head@freebsd.org Sun Feb 25 18:43:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0BB4F0A700; Sun, 25 Feb 2018 18:43:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 519246B0AD; Sun, 25 Feb 2018 18:43:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C6BE10B4E; Sun, 25 Feb 2018 18:43:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PIh0Qa065511; Sun, 25 Feb 2018 18:43:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PIh0j9065508; Sun, 25 Feb 2018 18:43:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802251843.w1PIh0j9065508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 25 Feb 2018 18:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329989 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 329989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 18:43:00 -0000 Author: ian Date: Sun Feb 25 18:42:59 2018 New Revision: 329989 URL: https://svnweb.freebsd.org/changeset/base/329989 Log: Add support for booting into kdb on arm platforms when the RB_KDB is set (using "boot -d" at the loader propmt or setting boot_ddb in loader.conf). Submitted by: Thomas Skibo Differential Revision: https://reviews.freebsd.org/D14428 Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/machdep_boot.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Feb 25 18:26:50 2018 (r329988) +++ head/sys/arm/arm/machdep.c Sun Feb 25 18:42:59 2018 (r329989) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -785,7 +786,17 @@ set_stackptrs(int cpu) } #endif +static void +arm_kdb_init(void) +{ + kdb_init(); +#ifdef KDB + if (boothowto & RB_KDB) + kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); +#endif +} + #ifdef FDT #if __ARM_ARCH < 6 void * @@ -1054,7 +1065,7 @@ initarm(struct arm_boot_params *abp) init_param2(physmem); dbg_monitor_init(); - kdb_init(); + arm_kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); @@ -1263,7 +1274,7 @@ initarm(struct arm_boot_params *abp) /* Init message buffer. */ msgbufinit(msgbufp, msgbufsize); dbg_monitor_init(); - kdb_init(); + arm_kdb_init(); /* Apply possible BP hardening. */ cpuinfo_init_bp_hardening(); return ((void *)STACKALIGN(thread0.td_pcb)); Modified: head/sys/arm/arm/machdep_boot.c ============================================================================== --- head/sys/arm/arm/machdep_boot.c Sun Feb 25 18:26:50 2018 (r329988) +++ head/sys/arm/arm/machdep_boot.c Sun Feb 25 18:42:59 2018 (r329989) @@ -27,6 +27,7 @@ */ #include "opt_platform.h" +#include "opt_ddb.h" #include __FBSDID("$FreeBSD$"); @@ -55,6 +56,10 @@ __FBSDID("$FreeBSD$"); #ifdef EFI #include +#endif + +#ifdef DDB +#include #endif #ifdef DEBUG From owner-svn-src-head@freebsd.org Sun Feb 25 19:33:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F4C1F21E16; Sun, 25 Feb 2018 19:33:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8D86CDC9; Sun, 25 Feb 2018 19:33:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0613111398; Sun, 25 Feb 2018 19:33:28 +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 w1PJXRKA090188; Sun, 25 Feb 2018 19:33:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PJXRIh090187; Sun, 25 Feb 2018 19:33:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802251933.w1PJXRIh090187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 25 Feb 2018 19:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329990 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 329990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 19:33:28 -0000 Author: andrew Date: Sun Feb 25 19:33:27 2018 New Revision: 329990 URL: https://svnweb.freebsd.org/changeset/base/329990 Log: Rename the FDT compat_data array to a bus-specific name. Sponsored by: DARPA, AFRL Modified: head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Sun Feb 25 18:42:59 2018 (r329989) +++ head/sys/dev/uart/uart_dev_pl011.c Sun Feb 25 19:33:27 2018 (r329990) @@ -323,11 +323,11 @@ static struct uart_class uart_pl011_class = { #ifdef FDT -static struct ofw_compat_data compat_data[] = { +static struct ofw_compat_data fdt_compat_data[] = { {"arm,pl011", (uintptr_t)&uart_pl011_class}, {NULL, (uintptr_t)NULL}, }; -UART_FDT_CLASS_AND_DEVICE(compat_data); +UART_FDT_CLASS_AND_DEVICE(fdt_compat_data); #endif #ifdef DEV_ACPI From owner-svn-src-head@freebsd.org Sun Feb 25 19:43:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1746F22B70; Sun, 25 Feb 2018 19:43:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8307F6D65D; Sun, 25 Feb 2018 19:43:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DEBC11548; Sun, 25 Feb 2018 19:43:00 +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 w1PJh0IC095706; Sun, 25 Feb 2018 19:43:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PJh0R6095705; Sun, 25 Feb 2018 19:43:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802251943.w1PJh0R6095705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 25 Feb 2018 19:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329991 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 329991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 19:43:01 -0000 Author: andrew Date: Sun Feb 25 19:43:00 2018 New Revision: 329991 URL: https://svnweb.freebsd.org/changeset/base/329991 Log: Teach the Arm pl011 driver to attach to a SBSA uart. This is defined in the Server Base System Architecture to be a subset of the pl011 r1p5. As we don't use the removed features it is safe to just attach to the existing driver as is. Sponsored by: DARPA, AFRL Modified: head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Sun Feb 25 19:33:27 2018 (r329990) +++ head/sys/dev/uart/uart_dev_pl011.c Sun Feb 25 19:43:00 2018 (r329991) @@ -333,6 +333,7 @@ UART_FDT_CLASS_AND_DEVICE(fdt_compat_data); #ifdef DEV_ACPI static struct acpi_uart_compat_data acpi_compat_data[] = { {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC}, {NULL, NULL, 0}, }; UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data); From owner-svn-src-head@freebsd.org Sun Feb 25 20:15:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB75CF24EB0; Sun, 25 Feb 2018 20:15:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 963996E7B9; Sun, 25 Feb 2018 20:15:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8775611A17; Sun, 25 Feb 2018 20:15:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PKF6Af010962; Sun, 25 Feb 2018 20:15:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PKF6Ea010961; Sun, 25 Feb 2018 20:15:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802252015.w1PKF6Ea010961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 25 Feb 2018 20:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329992 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 329992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 20:15:07 -0000 Author: trasz Date: Sun Feb 25 20:15:06 2018 New Revision: 329992 URL: https://svnweb.freebsd.org/changeset/base/329992 Log: Prevent getty(8) from looping indefinitely if the device node doesn't exist. This behaviour makes no sense for eg USB serial adapters, or USB device-side serial templates. This mostly reverts to pre-r135941 behaviour. Reviewed by: imp@ Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14198 Modified: head/libexec/getty/main.c Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Sun Feb 25 19:43:00 2018 (r329991) +++ head/libexec/getty/main.c Sun Feb 25 20:15:06 2018 (r329992) @@ -427,15 +427,17 @@ main(int argc, char *argv[]) static int opentty(const char *tty, int flags) { - int i; - int failopenlogged = 0; + int failopenlogged = 0, i, saved_errno; while ((i = open(tty, flags)) == -1) { + saved_errno = errno; if (!failopenlogged) { syslog(LOG_ERR, "open %s: %m", tty); failopenlogged = 1; } + if (saved_errno == ENOENT) + return 0; sleep(60); } if (login_tty(i) < 0) { From owner-svn-src-head@freebsd.org Sun Feb 25 20:21:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D7C7F2550B; Sun, 25 Feb 2018 20:21:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEAA36EAF7; Sun, 25 Feb 2018 20:21:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9A2511A63; Sun, 25 Feb 2018 20:21:30 +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 w1PKLUot012130; Sun, 25 Feb 2018 20:21:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PKLUgd012129; Sun, 25 Feb 2018 20:21:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802252021.w1PKLUgd012129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 25 Feb 2018 20:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329993 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 329993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 20:21:31 -0000 Author: brooks Date: Sun Feb 25 20:21:30 2018 New Revision: 329993 URL: https://svnweb.freebsd.org/changeset/base/329993 Log: Allow CROSS_TOOLCHAIN to be a path to a file. This allows working with custom cross toolchains without the need to create files in /usr/local/share/toolchains. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14178 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Feb 25 20:15:06 2018 (r329992) +++ head/Makefile.inc1 Sun Feb 25 20:21:30 2018 (r329993) @@ -56,7 +56,13 @@ LOCALBASE?= /usr/local # Cross toolchain changes must be in effect before bsd.compiler.mk # so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. .if defined(CROSS_TOOLCHAIN) +.if exists(${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk) .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" +.elif exists(${CROSS_TOOLCHAIN}) +.include "${CROSS_TOOLCHAIN}" +.else +.error CROSS_TOOLCHAIN is '${CROSS_TOOLCHAIN}' which is invalid +.endif CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}" .endif .if defined(CROSS_TOOLCHAIN_PREFIX) From owner-svn-src-head@freebsd.org Sun Feb 25 23:10:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB855F31502; Sun, 25 Feb 2018 23:10:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A214975A0E; Sun, 25 Feb 2018 23:10:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9748713557; Sun, 25 Feb 2018 23:10:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PNAD1F097379; Sun, 25 Feb 2018 23:10:13 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PNADFn097378; Sun, 25 Feb 2018 23:10:13 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201802252310.w1PNADFn097378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sun, 25 Feb 2018 23:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329994 - head/sys/security/mac_portacl X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/security/mac_portacl X-SVN-Commit-Revision: 329994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 23:10:14 -0000 Author: eugen Date: Sun Feb 25 23:10:13 2018 New Revision: 329994 URL: https://svnweb.freebsd.org/changeset/base/329994 Log: mac_portacl(4): stop panicing INVARIANTS-enabled kernel by loading .ko when kernel already has options MAC_PORTACL. PR: 183817 Approved by: avg (mentor) MFC after: 1 week Modified: head/sys/security/mac_portacl/mac_portacl.c Modified: head/sys/security/mac_portacl/mac_portacl.c ============================================================================== --- head/sys/security/mac_portacl/mac_portacl.c Sun Feb 25 20:21:30 2018 (r329993) +++ head/sys/security/mac_portacl/mac_portacl.c Sun Feb 25 23:10:13 2018 (r329994) @@ -487,3 +487,4 @@ static struct mac_policy_ops portacl_ops = MAC_POLICY_SET(&portacl_ops, mac_portacl, "TrustedBSD MAC/portacl", MPC_LOADTIME_FLAG_UNLOADOK, NULL); +MODULE_VERSION(mac_portacl, 1); From owner-svn-src-head@freebsd.org Sun Feb 25 23:52:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D261AF33D86 for ; Sun, 25 Feb 2018 23:52:38 +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 5E96377687 for ; Sun, 25 Feb 2018 23:52:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id a75so8786438itd.0 for ; Sun, 25 Feb 2018 15:52:38 -0800 (PST) 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=KGLRmLyrOAq7DGIaWcoKKMccDSXSAx4rg0V2suRKHJg=; b=2OFQ5JkrerYZV+oGiKuiLh9uFsKixa9HqKJyCxoK1EAWzDh1A2ncdxcw9bXuXV0VOJ K5u/8ggsLq3w9HJiMxHFvI1NewAswsisVMvlUNmY/mg3kJ6hWiP3PRW7P5C05yVFLHCi 9VlS+zRFJuHrWzOP+Cjw32taekT5BEs5leP/IqGWpN8NJX6Bbvb0kMQbbSk6FxraNbni i/DO+SH8LFPvRcZmiL5ucsv1LyW1/OcowijFRjpSseisz0et9eq+DMKa0TABzz9SffeL uFVqptKNmdBL83FEZU5/6KcWamkGMuGz67gkFXXNMEwIXR2AzPIzzV2+3Gtw9RERms+W jR7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=KGLRmLyrOAq7DGIaWcoKKMccDSXSAx4rg0V2suRKHJg=; b=IqoIPnpr6EHfaNay0UZIkpb7AgGPRRX/qbnsLHvyi5DUI7sVIz+P9wkdWKod6DYY0Z aYOGR2ZkVM7XVJgW7Y7ZHwwkBNhKlEOgvWvaiGf73etUi59GYLK56XMBnh47BqD3TDcR luFRzpRayjhvXIgX6E61EiQqwWdioM6l2fs+GV2tRHKSbNXAWgMWhRqmxwL8CezT+Ld1 7I1LgQ9NKnXWEXxASolnjXEiWS7ds8SXqT5J0bKc4w/Ba/r5D+ExkSeIt+NQTSe4d3Ev VGeG37MoU9meP7tA1xxpBZcHXNRDLc6pORbEgC65bnxSQOt4sF5DOarktYf3RHDrnY7m kvjA== X-Gm-Message-State: APf1xPDFjvyfGRY0bsZFEKPxvWfyflnHpPvqfh1DdjqnEaeyhihNUFx4 QPNeClZiplWKKkrI0kTtwetePeB3Ggeh4aPH+3aURQ== X-Google-Smtp-Source: AH8x22473JbxgjLB6PkVDFclo9uqqeSVgSXLO6/+aaiub9yBBfnPIIWVt+yb3u4BnoIkEvuGYsa5v+LEYRVD37/0fYU= X-Received: by 10.36.111.4 with SMTP id x4mr10942009itb.51.1519602757472; Sun, 25 Feb 2018 15:52:37 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 25 Feb 2018 15:52:36 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201801310305.w0V35EU4090569@repo.freebsd.org> From: Warner Losh Date: Sun, 25 Feb 2018 16:52:36 -0700 X-Google-Sender-Auth: sxN28wt1Xgqdu1clhXZwVrWKPa0 Message-ID: Subject: Re: svn commit: r328612 - head/lib/libc/stdlib To: Alan Somers Cc: Steve Wills , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 23:52:39 -0000 I "fixed" this with r328768: On Sun, Feb 25, 2018 at 7:52 AM, Alan Somers wrote: > I'm seeing the same error during the build of usr.sbin/nologin for > riscv.riscv64sf. Has anybody figured out a solution yet? > > On Thu, Feb 1, 2018 at 9:09 PM, Warner Losh wrote: > >> >> >> On Thu, Feb 1, 2018 at 8:34 PM, Steve Wills wrote: >> >>> This, somehow, seems to have broken the mips64 build: >>> >>> https://ci.freebsd.org/job/FreeBSD-head-mips64-build/216/consoleFull >>> >>> The previous rev works. >>> >> >> This breaks devd, of all things, with >> >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__gedf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:96: multiple >> definition of `__gedf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(gedf2.o):/us >> r/src/lib/libc/softfloat/gedf2.c:18: first defined here >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__eqdf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:126: multiple >> definition of `__eqdf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(eqdf2.o):/us >> r/src/lib/libc/softfloat/eqdf2.c:18: first defined here >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__ltdf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:131: multiple >> definition of `__ltdf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(ltdf2.o):/us >> r/src/lib/libc/softfloat/ltdf2.c:18: first defined here >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__nedf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:136: multiple >> definition of `__nedf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(nedf2.o):/us >> r/src/lib/libc/softfloat/nedf2.c:18: first defined here >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__gtdf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:141: multiple >> definition of `__gtdf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(gtdf2.o):/us >> r/src/lib/libc/softfloat/gtdf2.c:18: first defined here >> >> undefined.... devd doesn't even use strtodl. >> >> (looks like the code to associate make output with the right commands is >> broken, since I had to dig for it. >> >> Warner >> >> >>> Steve >>> >>> >>> On 01/30/2018 22:05, Warner Losh wrote: >>> >>>> Author: imp >>>> Date: Wed Jan 31 03:05:14 2018 >>>> New Revision: 328612 >>>> URL: https://svnweb.freebsd.org/changeset/base/328612 >>>> >>>> Log: >>>> Move strtold wrapper from strtol.c to its own strtold.c. This code >>>> was written by theraven@ (David Chisnall) entirely, there's no >>>> original Berkeley code left here so just copy his copyright over. >>>> >>>> >> > From owner-svn-src-head@freebsd.org Sun Feb 25 23:54:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C18EAF33FAC for ; Sun, 25 Feb 2018 23:54:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::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 4B8037791A for ; Sun, 25 Feb 2018 23:54:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id g21so15332347ioj.5 for ; Sun, 25 Feb 2018 15:54:46 -0800 (PST) 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=hU4svuu+ZD3vumMWwoIfXqRcQdldLJSaDbhSebLDO/g=; b=BMFgc4B+e90lJUKLNTvqWMCZ7Nhd/LrHdV4FeV5szdvfJb4479uym83IY1vxo/X4ff rTrq2ln+thnAMFAG0lFpcFMwlk5IPDl2jz07ZMBzsQGLolOIXi6RrfF/uOlrcLiNQaPw P5FYD4AG3PvyECP39lK1hAIe3FyuK5E3ZPNj18qrvUGJ0VEFwAEHrVpiI0GlKEHdTfdC 6hzXuGDLjIiAx4Xki7t9SgWEEaPTyuCpO+vbYLjUwN25NCnOp/SzEzQxKiX3oKS7Eysk zSlmKhfo29It0p50w0GE5a13HwQcKDpHrEb21TnJJ4zthQSA0oqYGY5RBuBfd1QOK6mc BPvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hU4svuu+ZD3vumMWwoIfXqRcQdldLJSaDbhSebLDO/g=; b=P58e2ExIKWHPGdEpS9pvyTc6V+AcOcslio4dcFH3R2/eX2zZ4UJWVUOWYFl01o1bsI En6JJbWtogLaTp4yqqpen96c1B/Xa9sl3JB79UTyJQB/7aTkmtWU2zEJ78hsMXm7+mrp 0Wa76j5QZqkZ/uvUSG76DGV3NRb4sssHIPQF4zrH6u89JVPOCn/+KjQoUDbIpo/GSi2g e0dYOSedbNWIYT49Qf6PgArWGRVeo5vlkEeOLKGN+CDX3nwav//ahio9m8dfd3TFwzUR YaD3lnNachfFHqPm6ojmer9BbovcZWOvwhgf0XV09wqdcYe4AYbvx1ExCCXCI2CpTVRd k+GQ== X-Gm-Message-State: APf1xPA96L9KeHm3fSdIH4L+DGiO4oyKTfMsj4rnVg/RomF84s2NpwD4 AMHOrl6BaGjScQIZSbCt6OyRu7I4xL1OJWu7e2sCpw== X-Google-Smtp-Source: AG47ELv//OjJGvCA8B3DdRZ31r/fWx1snt/W4ElkuS8sZaJqk9Da3kBHRGJ2gXviyaby0wfQLjZEJZJzHvOtPvLdtJ4= X-Received: by 10.107.2.6 with SMTP id 6mr9709248ioc.117.1519602885547; Sun, 25 Feb 2018 15:54:45 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 25 Feb 2018 15:54:44 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201801310305.w0V35EU4090569@repo.freebsd.org> From: Warner Losh Date: Sun, 25 Feb 2018 16:54:44 -0700 X-Google-Sender-Auth: aECPsEhSj-ErbKHRYk43aLKUydg Message-ID: Subject: Re: svn commit: r328612 - head/lib/libc/stdlib To: Alan Somers Cc: Steve Wills , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 23:54:47 -0000 Sorry for top posting... I fixed this with r328768 Author: imp Date: Fri Feb 2 05:04:43 2018 +0000 The routines defined in comparedf2 and comparesf2 are defined in libc for softfloat mips. No need to include them here. lib/libcompiler_rt/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) John Baldwin says this may be a bogus fix, but we've come to no better one in the interim. He's not wrong to say this is bogus, but it does fix the immediate compile issue. Warner On Sun, Feb 25, 2018 at 7:52 AM, Alan Somers wrote: > I'm seeing the same error during the build of usr.sbin/nologin for > riscv.riscv64sf. Has anybody figured out a solution yet? > > On Thu, Feb 1, 2018 at 9:09 PM, Warner Losh wrote: > >> >> >> On Thu, Feb 1, 2018 at 8:34 PM, Steve Wills wrote: >> >>> This, somehow, seems to have broken the mips64 build: >>> >>> https://ci.freebsd.org/job/FreeBSD-head-mips64-build/216/consoleFull >>> >>> The previous rev works. >>> >> >> This breaks devd, of all things, with >> >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__gedf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:96: multiple >> definition of `__gedf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(gedf2.o):/us >> r/src/lib/libc/softfloat/gedf2.c:18: first defined here >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__eqdf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:126: multiple >> definition of `__eqdf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(eqdf2.o):/us >> r/src/lib/libc/softfloat/eqdf2.c:18: first defined here >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__ltdf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:131: multiple >> definition of `__ltdf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(ltdf2.o):/us >> r/src/lib/libc/softfloat/ltdf2.c:18: first defined here >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__nedf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:136: multiple >> definition of `__nedf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(nedf2.o):/us >> r/src/lib/libc/softfloat/nedf2.c:18: first defined here >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In >> function `__gtdf2': >> /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:141: multiple >> definition of `__gtdf2' >> /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(gtdf2.o):/us >> r/src/lib/libc/softfloat/gtdf2.c:18: first defined here >> >> undefined.... devd doesn't even use strtodl. >> >> (looks like the code to associate make output with the right commands is >> broken, since I had to dig for it. >> >> Warner >> >> >>> Steve >>> >>> >>> On 01/30/2018 22:05, Warner Losh wrote: >>> >>>> Author: imp >>>> Date: Wed Jan 31 03:05:14 2018 >>>> New Revision: 328612 >>>> URL: https://svnweb.freebsd.org/changeset/base/328612 >>>> >>>> Log: >>>> Move strtold wrapper from strtol.c to its own strtold.c. This code >>>> was written by theraven@ (David Chisnall) entirely, there's no >>>> original Berkeley code left here so just copy his copyright over. >>>> >>>> >> > From owner-svn-src-head@freebsd.org Sun Feb 25 23:59:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6988F34577; Sun, 25 Feb 2018 23:59:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5556B77B5A; Sun, 25 Feb 2018 23:59:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3189D13D4D; Sun, 25 Feb 2018 23:59:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PNxliV022664; Sun, 25 Feb 2018 23:59:47 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PNxlvT022663; Sun, 25 Feb 2018 23:59:47 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802252359.w1PNxlvT022663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 25 Feb 2018 23:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329995 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 329995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Feb 2018 23:59:48 -0000 Author: dteske Date: Sun Feb 25 23:59:47 2018 New Revision: 329995 URL: https://svnweb.freebsd.org/changeset/base/329995 Log: Updates and enhancements to signal.d to aid DTrace scripting + Add missing signals SIGTHR (32) and SIGLIBRT (33) + Add inline for converting SIG* int to string + Add inline for converting CLD_* int to string Reviewed by: markj Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D14497 Modified: head/cddl/lib/libdtrace/signal.d Modified: head/cddl/lib/libdtrace/signal.d ============================================================================== --- head/cddl/lib/libdtrace/signal.d Sun Feb 25 23:10:13 2018 (r329994) +++ head/cddl/lib/libdtrace/signal.d Sun Feb 25 23:59:47 2018 (r329995) @@ -20,6 +20,7 @@ * CDDL HEADER END * * Portions Copyright 2008 John Birrell jb@freebsd.org + * Portions Copyright 2018 Devin Teske dteske@freebsd.org * * $FreeBSD$ */ @@ -86,7 +87,48 @@ inline int SIGUSR1 = 30; #pragma D binding "1.0" SIGUSR1 inline int SIGUSR2 = 31; #pragma D binding "1.0" SIGUSR2 +inline int SIGTHR = 32; +#pragma D binding "1.13" SIGTHR +inline int SIGLIBRT = 33; +#pragma D binding "1.13" SIGLIBRT +#pragma D binding "1.13" signal_string +inline string signal_string[int signal] = + signal == SIGHUP ? "SIGHUP" : + signal == SIGINT ? "SIGINT" : + signal == SIGQUIT ? "SIGQUIT" : + signal == SIGILL ? "SIGILL": + signal == SIGTRAP ? "SIGTRAP" : + signal == SIGABRT ? "SIGABRT" : + signal == SIGEMT ? "SIGEMT" : + signal == SIGFPE ? "SIGFPE" : + signal == SIGKILL ? "SIGKILL" : + signal == SIGBUS ? "SIGBUS" : + signal == SIGSEGV ? "SIGSEGV" : + signal == SIGSYS ? "SIGSYS" : + signal == SIGPIPE ? "SIGPIPE" : + signal == SIGALRM ? "SIGALRM" : + signal == SIGTERM ? "SIGTERM" : + signal == SIGURG ? "SIGURG" : + signal == SIGSTOP ? "SIGSTOP" : + signal == SIGTSTP ? "SIGTSTP" : + signal == SIGCONT ? "SIGCONT" : + signal == SIGCHLD ? "SIGCHLD" : + signal == SIGTTIN ? "SIGTTIN" : + signal == SIGTTOU ? "SIGTTOU" : + signal == SIGIO ? "SIGIO" : + signal == SIGXCPU ? "SIGXCPU" : + signal == SIGXFSZ ? "SIGXFSZ" : + signal == SIGVTALRM ? "SIGVTALRM" : + signal == SIGPROF ? "SIGPROF" : + signal == SIGWINCH ? "SIGWINCH" : + signal == SIGINFO ? "SIGINFO" : + signal == SIGUSR1 ? "SIGUSR1" : + signal == SIGUSR2 ? "SIGUSR2" : + signal == SIGTHR ? "SIGTHR" : + signal == SIGLIBRT ? "SIGLIBRT" : + "UNKNOWN"; + inline int CLD_EXITED = 1; #pragma D binding "1.0" CLD_EXITED inline int CLD_KILLED = 2; @@ -99,3 +141,13 @@ inline int CLD_STOPPED = 5; #pragma D binding "1.0" CLD_STOPPED inline int CLD_CONTINUED = 6; #pragma D binding "1.0" CLD_CONTINUED + +#pragma D binding "1.13" child_signal_string +inline string child_signal_string[int child_signal] = + child_signal == CLD_EXITED ? "child exited" : + child_signal == CLD_KILLED ? "child terminated abnormally" : + child_signal == CLD_DUMPED ? "child core dumped" : + child_signal == CLD_TRAPPED ? "traced child trapped" : + child_signal == CLD_STOPPED ? "child stopped" : + child_signal == CLD_CONTINUED ? "stopped child continued" : + strjoin("Unknown SIGCHLD code (", strjoin(lltostr(child_signal), ")")); From owner-svn-src-head@freebsd.org Mon Feb 26 00:04:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9364BF34CB9; Mon, 26 Feb 2018 00:04:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48F39780DF; Mon, 26 Feb 2018 00:04:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4373D13EEE; Mon, 26 Feb 2018 00:04:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q04MKW027442; Mon, 26 Feb 2018 00:04:22 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q04Mh5027441; Mon, 26 Feb 2018 00:04:22 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201802260004.w1Q04Mh5027441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 26 Feb 2018 00:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329996 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 329996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 00:04:22 -0000 Author: dteske Date: Mon Feb 26 00:04:21 2018 New Revision: 329996 URL: https://svnweb.freebsd.org/changeset/base/329996 Log: Consistent casing for fallback SIGCHLD (s/Unknown/unknown/) Modified: head/cddl/lib/libdtrace/signal.d Modified: head/cddl/lib/libdtrace/signal.d ============================================================================== --- head/cddl/lib/libdtrace/signal.d Sun Feb 25 23:59:47 2018 (r329995) +++ head/cddl/lib/libdtrace/signal.d Mon Feb 26 00:04:21 2018 (r329996) @@ -150,4 +150,4 @@ inline string child_signal_string[int child_signal] = child_signal == CLD_TRAPPED ? "traced child trapped" : child_signal == CLD_STOPPED ? "child stopped" : child_signal == CLD_CONTINUED ? "stopped child continued" : - strjoin("Unknown SIGCHLD code (", strjoin(lltostr(child_signal), ")")); + strjoin("unknown SIGCHLD code (", strjoin(lltostr(child_signal), ")")); From owner-svn-src-head@freebsd.org Mon Feb 26 00:34:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7A81F36A6F; Mon, 26 Feb 2018 00:34:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C571791DD; Mon, 26 Feb 2018 00:34:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97100143D2; Mon, 26 Feb 2018 00:34:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q0YunY042255; Mon, 26 Feb 2018 00:34:56 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q0YuGP042254; Mon, 26 Feb 2018 00:34:56 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802260034.w1Q0YuGP042254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 26 Feb 2018 00:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329997 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 329997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 00:34:57 -0000 Author: mckusick Date: Mon Feb 26 00:34:56 2018 New Revision: 329997 URL: https://svnweb.freebsd.org/changeset/base/329997 Log: Use a more straight-forward approach to relaxing the location restraints when validating one of the backup superblocks. Modified: head/sys/ufs/ffs/ffs_subr.c Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Mon Feb 26 00:04:21 2018 (r329996) +++ head/sys/ufs/ffs/ffs_subr.c Mon Feb 26 00:34:56 2018 (r329997) @@ -140,7 +140,7 @@ ffs_load_inode(struct buf *bp, struct inode *ip, struc * the superblock and its associated data. */ static off_t sblock_try[] = SBLOCKSEARCH; -static int readsuper(void *, struct fs **, off_t, +static int readsuper(void *, struct fs **, off_t, int, int (*)(void *, off_t, void **, int)); /* @@ -174,11 +174,12 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc *fsp = NULL; if (altsblock != -1) { - if ((error = readsuper(devfd, fsp, -altsblock, readfunc)) != 0) + if ((error = readsuper(devfd, fsp, altsblock, 1, + readfunc)) != 0) return (error); } else { for (i = 0; sblock_try[i] != -1; i++) { - if ((error = readsuper(devfd, fsp, sblock_try[i], + if ((error = readsuper(devfd, fsp, sblock_try[i], 0, readfunc)) == 0) break; if (error == ENOENT) @@ -238,17 +239,12 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc * Return zero on success or an errno on failure. */ static int -readsuper(void *devfd, struct fs **fsp, off_t sblockloc, +readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, int (*readfunc)(void *devfd, off_t loc, void **bufp, int size)) { struct fs *fs; - int error, altblk; + int error; - altblk = 0; - if (sblockloc < 0) { - altblk = 1; - sblockloc = - sblockloc; - } error = (*readfunc)(devfd, sblockloc, (void **)fsp, SBLOCKSIZE); if (*fsp != NULL) (*fsp)->fs_csp = NULL; /* Not yet any summary information */ @@ -257,9 +253,9 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo fs = *fsp; if (fs->fs_magic == FS_BAD_MAGIC) return (EINVAL); - if (((fs->fs_magic == FS_UFS1_MAGIC && (altblk || + if (((fs->fs_magic == FS_UFS1_MAGIC && (isaltsblk || sblockloc <= SBLOCK_UFS1)) || - (fs->fs_magic == FS_UFS2_MAGIC && (altblk || + (fs->fs_magic == FS_UFS2_MAGIC && (isaltsblk || sblockloc == fs->fs_sblockloc))) && fs->fs_ncg >= 1 && fs->fs_bsize >= MINBSIZE && From owner-svn-src-head@freebsd.org Mon Feb 26 02:28:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19C00F1E211; Mon, 26 Feb 2018 02:28:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B277D7CA7D; Mon, 26 Feb 2018 02:28:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4CA4155A6; Mon, 26 Feb 2018 02:28:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q2SXS5096380; Mon, 26 Feb 2018 02:28:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q2SW0l096371; Mon, 26 Feb 2018 02:28:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802260228.w1Q2SW0l096371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 26 Feb 2018 02:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329999 - in head/sys: arm/freescale/imx modules/imx modules/imx/imx_spi X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/freescale/imx modules/imx modules/imx/imx_spi X-SVN-Commit-Revision: 329999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 02:28:34 -0000 Author: ian Date: Mon Feb 26 02:28:32 2018 New Revision: 329999 URL: https://svnweb.freebsd.org/changeset/base/329999 Log: Add a SPI driver for imx5 and imx6. It can be compiled into the kernel with "device imx_spi" or loaded as a module, which is also named "imx_spi". Added: head/sys/arm/freescale/imx/imx_spi.c (contents, props changed) head/sys/modules/imx/imx_spi/ head/sys/modules/imx/imx_spi/Makefile (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx5 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx51_ccm.c head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h head/sys/arm/freescale/imx/imx_ccmvar.h head/sys/modules/imx/Makefile Modified: head/sys/arm/freescale/imx/files.imx5 ============================================================================== --- head/sys/arm/freescale/imx/files.imx5 Mon Feb 26 02:12:09 2018 (r329998) +++ head/sys/arm/freescale/imx/files.imx5 Mon Feb 26 02:28:32 2018 (r329999) @@ -52,3 +52,6 @@ dev/vt/hw/fb/vt_early_fb.c optional vt # Fast Ethernet Controller dev/ffec/if_ffec.c optional ffec +# SPI +arm/freescale/imx/imx_spi.c optional imx_spi + Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Mon Feb 26 02:12:09 2018 (r329998) +++ head/sys/arm/freescale/imx/files.imx6 Mon Feb 26 02:28:32 2018 (r329999) @@ -22,6 +22,7 @@ arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c optional imx_gpt arm/freescale/imx/imx_gpio.c optional gpio arm/freescale/imx/imx_i2c.c optional fsliic +arm/freescale/imx/imx_spi.c optional imx_spi arm/freescale/imx/imx6_sdma.c optional fslsdma arm/freescale/imx/imx6_audmux.c optional sound arm/freescale/imx/imx6_ssi.c optional sound Modified: head/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccm.c Mon Feb 26 02:12:09 2018 (r329998) +++ head/sys/arm/freescale/imx/imx51_ccm.c Mon Feb 26 02:28:32 2018 (r329999) @@ -621,6 +621,13 @@ imx_ccm_usbphy_enable(device_t dev) } uint32_t +imx_ccm_ecspi_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_CSPI_CLK_ROOT)); +} + +uint32_t imx_ccm_ipg_hz(void) { @@ -654,3 +661,4 @@ imx_ccm_ahb_hz(void) return (imx51_get_clock(IMX51CLK_AHB_CLK_ROOT)); } + Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Mon Feb 26 02:12:09 2018 (r329998) +++ head/sys/arm/freescale/imx/imx6_ccm.c Mon Feb 26 02:28:32 2018 (r329999) @@ -96,8 +96,9 @@ ccm_init_gates(struct ccm_softc *sc) reg = CCGR0_AIPS_TZ1 | CCGR0_AIPS_TZ2 | CCGR0_ABPHDMA; WR4(sc, CCM_CCGR0, reg); - /* enet, epit, gpt */ - reg = CCGR1_ENET | CCGR1_EPIT1 | CCGR1_GPT; + /* enet, epit, gpt, spi */ + reg = CCGR1_ENET | CCGR1_EPIT1 | CCGR1_GPT | CCGR1_ECSPI1 | + CCGR1_ECSPI2 | CCGR1_ECSPI3 | CCGR1_ECSPI4 | CCGR1_ECSPI5; WR4(sc, CCM_CCGR1, reg); /* ipmux & ipsync (bridges), iomux, i2c */ @@ -349,6 +350,13 @@ imx6_ccm_sata_enable(void) WR4(ccm_sc, CCM_ANALOG_PLL_ENET, v); return 0; +} + +uint32_t +imx_ccm_ecspi_hz(void) +{ + + return (60000000); } uint32_t Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Mon Feb 26 02:12:09 2018 (r329998) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Mon Feb 26 02:28:32 2018 (r329999) @@ -80,9 +80,15 @@ #define CCGR0_AIPS_TZ2 (0x3 << 2) #define CCGR0_ABPHDMA (0x3 << 4) #define CCM_CCGR1 0x06C +#define CCGR1_ECSPI1 (0x3 << 0) +#define CCGR1_ECSPI2 (0x3 << 2) +#define CCGR1_ECSPI3 (0x3 << 4) +#define CCGR1_ECSPI4 (0x3 << 6) +#define CCGR1_ECSPI5 (0x3 << 8) #define CCGR1_ENET (0x3 << 10) #define CCGR1_EPIT1 (0x3 << 12) #define CCGR1_EPIT2 (0x3 << 14) +#define CCGR1_ESAI (0x3 << 16) #define CCGR1_GPT (0x3 << 20) #define CCGR1_GPT_SERIAL (0x3 << 22) #define CCM_CCGR2 0x070 Modified: head/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx_ccmvar.h Mon Feb 26 02:12:09 2018 (r329998) +++ head/sys/arm/freescale/imx/imx_ccmvar.h Mon Feb 26 02:28:32 2018 (r329999) @@ -43,6 +43,7 @@ * board setup code has to handle those things. */ +uint32_t imx_ccm_ecspi_hz(void); uint32_t imx_ccm_ipg_hz(void); uint32_t imx_ccm_perclk_hz(void); uint32_t imx_ccm_sdhci_hz(void); Added: head/sys/arm/freescale/imx/imx_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_spi.c Mon Feb 26 02:28:32 2018 (r329999) @@ -0,0 +1,604 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Ian Lepore + * 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$"); + +/* + * Driver for imx Enhanced Configurable SPI; master-mode only. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "spibus_if.h" + +#define ECSPI_RXDATA 0x00 +#define ECSPI_TXDATA 0x04 +#define ECSPI_CTLREG 0x08 +#define CTLREG_BLEN_SHIFT 20 +#define CTLREG_BLEN_MASK 0x0fff +#define CTLREG_CSEL_SHIFT 18 +#define CTLREG_CSEL_MASK 0x03 +#define CTLREG_DRCTL_SHIFT 16 +#define CTLREG_DRCTL_MASK 0x03 +#define CTLREG_PREDIV_SHIFT 12 +#define CTLREG_PREDIV_MASK 0x0f +#define CTLREG_POSTDIV_SHIFT 8 +#define CTLREG_POSTDIV_MASK 0x0f +#define CTLREG_CMODE_SHIFT 4 +#define CTLREG_CMODE_MASK 0x0f +#define CTLREG_CMODES_MASTER (CTLREG_CMODE_MASK << CTLREG_CMODE_SHIFT) +#define CTLREG_SMC (1u << 3) +#define CTLREG_XCH (1u << 2) +#define CTLREG_HT (1u << 1) +#define CTLREG_EN (1u << 0) +#define ECSPI_CFGREG 0x0c +#define CFGREG_HTLEN_SHIFT 24 +#define CFGREG_SCLKCTL_SHIFT 20 +#define CFGREG_DATACTL_SHIFT 16 +#define CFGREG_SSPOL_SHIFT 12 +#define CFGREG_SSCTL_SHIFT 8 +#define CFGREG_SCLKPOL_SHIFT 4 +#define CFGREG_SCLKPHA_SHIFT 0 +#define CFGREG_MASK 0x0f /* all CFGREG fields are 4 bits */ +#define ECSPI_INTREG 0x10 +#define INTREG_TCEN (1u << 7) +#define INTREG_ROEN (1u << 6) +#define INTREG_RFEN (1u << 5) +#define INTREG_RDREN (1u << 4) +#define INTREG_RREN (1u << 3) +#define INTREG_TFEN (1u << 2) +#define INTREG_TDREN (1u << 1) +#define INTREG_TEEN (1u << 0) +#define ECSPI_DMAREG 0x14 +#define DMA_RX_THRESH_SHIFT 16 +#define DMA_RX_THRESH_MASK 0x3f +#define DMA_TX_THRESH_SHIFT 0 +#define DMA_TX_THRESH_MASK 0x3f +#define ECSPI_STATREG 0x18 +#define SREG_TC (1u << 7) +#define SREG_RO (1u << 6) +#define SREG_RF (1u << 5) +#define SREG_RDR (1u << 4) +#define SREG_RR (1u << 3) +#define SREG_TF (1u << 2) +#define SREG_TDR (1u << 1) +#define SREG_TE (1u << 0) +#define ECSPI_PERIODREG 0x1c +#define ECSPI_TESTREG 0x20 + +#define CS_MAX 4 /* Max number of chip selects. */ +#define CS_MASK 0x03 /* Mask flag bits out of chipsel. */ + +#define FIFO_SIZE 64 +#define FIFO_RXTHRESH 32 +#define FIFO_TXTHRESH 32 + +struct spi_softc { + device_t dev; + device_t spibus; + struct mtx mtx; + struct resource *memres; + struct resource *intres; + void *inthandle; + gpio_pin_t cspins[CS_MAX]; + u_int debug; + u_int basefreq; + uint32_t ctlreg; + uint32_t intreg; + uint32_t fifocnt; + uint8_t *rxbuf; + uint32_t rxidx; + uint32_t rxlen; + uint8_t *txbuf; + uint32_t txidx; + uint32_t txlen; +}; + +static struct ofw_compat_data compat_data[] = { + {"fsl,imx51-ecspi", true}, + {"fsl,imx53-ecspi", true}, + {"fsl,imx6dl-ecspi", true}, + {"fsl,imx6q-ecspi", true}, + {"fsl,imx6sx-ecspi", true}, + {"fsl,imx6ul-ecspi", true}, + {NULL, false} +}; + +static inline uint32_t +RD4(struct spi_softc *sc, bus_size_t offset) +{ + + return (bus_read_4(sc->memres, offset)); +} + +static inline void +WR4(struct spi_softc *sc, bus_size_t offset, uint32_t value) +{ + + bus_write_4(sc->memres, offset, value); +} + +static u_int +spi_calc_clockdiv(struct spi_softc *sc, u_int busfreq) +{ + u_int post, pre; + + /* Returning 0 effectively sets both dividers to 1. */ + if (sc->basefreq <= busfreq) + return (0); + + /* + * Brute-force this; all real-world bus speeds are going to be found on + * the 1st or 2nd time through this loop. + */ + for (post = 0; post < 16; ++post) { + pre = ((sc->basefreq >> post) / busfreq) - 1; + if (pre < 16) + break; + } + if (post == 16) { + /* The lowest we can go is ~115 Hz. */ + pre = 15; + post = 15; + } + + if (sc->debug >= 2) { + device_printf(sc->dev, + "base %u bus %u; pre %u, post %u; actual busfreq %u\n", + sc->basefreq, busfreq, pre, post, + (sc->basefreq / (pre + 1)) / (1 << post)); + } + + return (pre << CTLREG_PREDIV_SHIFT) | (post << CTLREG_POSTDIV_SHIFT); +} + +static void +spi_set_chipsel(struct spi_softc *sc, u_int cs, bool active) +{ + bool pinactive; + + /* + * This is kinda crazy... the gpio pins for chipsel are defined as + * active-high in the dts, but are supposed to be treated as active-low + * by this driver. So to turn on chipsel we have to invert the value + * passed to gpio_pin_set_active(). Then, to make it more fun, any + * slave can say its chipsel is active-high, so if that option is + * on, we have to invert the value again. + */ + pinactive = !active ^ (bool)(cs & SPIBUS_CS_HIGH); + + if (sc->debug >= 2) { + device_printf(sc->dev, "chipsel %u changed to %u\n", + (cs & ~SPIBUS_CS_HIGH), pinactive); + } + + /* + * Change the pin, then do a dummy read of its current state to ensure + * that the state change reaches the hardware before proceeding. + */ + gpio_pin_set_active(sc->cspins[cs & ~SPIBUS_CS_HIGH], pinactive); + gpio_pin_is_active(sc->cspins[cs & ~SPIBUS_CS_HIGH], &pinactive); +} + +static void +spi_hw_setup(struct spi_softc *sc, u_int cs, u_int mode, u_int freq) +{ + uint32_t reg; + + /* + * Set up control register, and write it first to bring the device out + * of reset. + */ + sc->ctlreg = CTLREG_EN | CTLREG_CMODES_MASTER | CTLREG_SMC; + sc->ctlreg |= spi_calc_clockdiv(sc, freq); + sc->ctlreg |= 7 << CTLREG_BLEN_SHIFT; /* XXX byte at a time */ + WR4(sc, ECSPI_CTLREG, sc->ctlreg); + + /* + * Set up the config register. Note that we do all transfers with the + * SPI hardware's chip-select set to zero. The actual chip select is + * handled with a gpio pin. + */ + reg = 0; + if (cs & SPIBUS_CS_HIGH) + reg |= 1u << CFGREG_SSPOL_SHIFT; + if (mode & SPIBUS_MODE_CPHA) + reg |= 1u << CFGREG_SCLKPHA_SHIFT; + if (mode & SPIBUS_MODE_CPOL) { + reg |= 1u << CFGREG_SCLKPOL_SHIFT; + reg |= 1u << CFGREG_SCLKCTL_SHIFT; + } + WR4(sc, ECSPI_CFGREG, reg); + + /* + * Set up the rx/tx FIFO interrupt thresholds. + */ + reg = (FIFO_RXTHRESH << DMA_RX_THRESH_SHIFT); + reg |= (FIFO_TXTHRESH << DMA_TX_THRESH_SHIFT); + WR4(sc, ECSPI_DMAREG, reg); + + /* + * Do a dummy read, to make sure the preceding writes reach the spi + * hardware before we assert any gpio chip select. + */ + (void)RD4(sc, ECSPI_CFGREG); +} + +static void +spi_empty_rxfifo(struct spi_softc *sc) +{ + + while (sc->rxidx < sc->rxlen && (RD4(sc, ECSPI_STATREG) & SREG_RR)) { + sc->rxbuf[sc->rxidx++] = (uint8_t)RD4(sc, ECSPI_RXDATA); + --sc->fifocnt; + } +} + +static void +spi_fill_txfifo(struct spi_softc *sc) +{ + + while (sc->txidx < sc->txlen && sc->fifocnt < FIFO_SIZE) { + WR4(sc, ECSPI_TXDATA, sc->txbuf[sc->txidx++]); + ++sc->fifocnt; + } + + /* + * If we're out of data, disable tx data ready (threshold) interrupts, + * and enable tx fifo empty interrupts. + */ + if (sc->txidx == sc->txlen) + sc->intreg = (sc->intreg & ~INTREG_TDREN) | INTREG_TEEN; +} + +static void +spi_intr(void *arg) +{ + struct spi_softc *sc = arg; + uint32_t intreg, status; + + mtx_lock(&sc->mtx); + + sc = arg; + intreg = sc->intreg; + status = RD4(sc, ECSPI_STATREG); + WR4(sc, ECSPI_STATREG, status); /* Clear w1c bits. */ + + /* + * If we get an overflow error, just signal that the transfer is done + * and wakeup the waiting thread, which will see that txidx != txlen and + * return an IO error to the caller. + */ + if (__predict_false(status & SREG_RO)) { + if (sc->debug || bootverbose) { + device_printf(sc->dev, "rxoverflow rxidx %u txidx %u\n", + sc->rxidx, sc->txidx); + } + sc->intreg = 0; + wakeup(sc); + mtx_unlock(&sc->mtx); + return; + } + + if (status & SREG_RR) + spi_empty_rxfifo(sc); + + if (status & SREG_TDR) + spi_fill_txfifo(sc); + + /* + * If we're out of bytes to send... + * - If Transfer Complete is set (shift register is empty) and we've + * received everything we expect, we're all done. + * - Else if Tx Fifo Empty is set, we need to stop waiting for that and + * switch to waiting for Transfer Complete (wait for shift register + * to empty out), and also for Receive Ready (last of incoming data). + */ + if (sc->txidx == sc->txlen) { + if ((status & SREG_TC) && sc->fifocnt == 0) { + sc->intreg = 0; + wakeup(sc); + } else if (status & SREG_TE) { + sc->intreg &= ~(sc->intreg & ~INTREG_TEEN); + sc->intreg |= INTREG_TCEN | INTREG_RREN; + } + } + + /* + * If interrupt flags changed, write the new flags to the hardware and + * do a dummy readback to ensure the changes reach the hardware before + * we exit the isr. + */ + if (sc->intreg != intreg) { + WR4(sc, ECSPI_INTREG, sc->intreg); + (void)RD4(sc, ECSPI_INTREG); + } + + if (sc->debug >= 3) { + device_printf(sc->dev, + "spi_intr, sreg 0x%08x intreg was 0x%08x now 0x%08x\n", + status, intreg, sc->intreg); + } + + mtx_unlock(&sc->mtx); +} + +static int +spi_xfer_buf(struct spi_softc *sc, void *rxbuf, void *txbuf, uint32_t len) +{ + int err; + + if (sc->debug >= 1) { + device_printf(sc->dev, + "spi_xfer_buf, rxbuf %p txbuf %p len %u\n", + rxbuf, txbuf, len); + } + + if (len == 0) + return (0); + + sc->rxbuf = rxbuf; + sc->rxlen = len; + sc->rxidx = 0; + sc->txbuf = txbuf; + sc->txlen = len; + sc->txidx = 0; + sc->intreg = INTREG_RDREN | INTREG_TDREN; + spi_fill_txfifo(sc); + + /* Enable interrupts last; spi_fill_txfifo() can change sc->intreg */ + WR4(sc, ECSPI_INTREG, sc->intreg); + + err = 0; + while (err == 0 && sc->intreg != 0) + err = msleep(sc, &sc->mtx, 0, "imxspi", 10 * hz); + + if (sc->rxidx != sc->rxlen || sc->txidx != sc->txlen) + err = EIO; + + return (err); +} + +static int +spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct spi_softc *sc = device_get_softc(dev); + uint32_t cs, mode, clock; + int err; + + spibus_get_cs(child, &cs); + spibus_get_clock(child, &clock); + spibus_get_mode(child, &mode); + + if (cs > CS_MAX || sc->cspins[cs] == NULL) { + if (sc->debug || bootverbose) + device_printf(sc->dev, "Invalid chip select %u\n", cs); + return (EINVAL); + } + + mtx_lock(&sc->mtx); + + if (sc->debug >= 1) { + device_printf(sc->dev, + "spi_transfer, cs 0x%x clock %u mode %u\n", + cs, clock, mode); + } + + /* Set up the hardware and select the device. */ + spi_hw_setup(sc, cs, mode, clock); + spi_set_chipsel(sc, cs, true); + + /* Transfer command then data bytes. */ + err = 0; + if (cmd->tx_cmd_sz > 0) + err = spi_xfer_buf(sc, cmd->rx_cmd, cmd->tx_cmd, + cmd->tx_cmd_sz); + if (cmd->tx_data_sz > 0 && err == 0) + err = spi_xfer_buf(sc, cmd->rx_data, cmd->tx_data, + cmd->tx_data_sz); + + /* Deselect the device, turn off (and reset) hardware. */ + spi_set_chipsel(sc, cs, false); + WR4(sc, ECSPI_CTLREG, 0); + + mtx_unlock(&sc->mtx); + + return (err); +} + +static phandle_t +spi_get_node(device_t bus, device_t dev) +{ + + /* + * Share our controller node with our spibus child; it instantiates + * devices by walking the children contained within our node. + */ + return ofw_bus_get_node(bus); +} + +static int +spi_detach(device_t dev) +{ + struct spi_softc *sc = device_get_softc(dev); + int idx; + + mtx_lock(&sc->mtx); + + bus_generic_detach(sc->dev); + if (sc->spibus != NULL) + device_delete_child(dev, sc->spibus); + + for (idx = 0; idx < nitems(sc->cspins); ++idx) { + if (sc->cspins[idx] != NULL) + gpio_pin_release(sc->cspins[idx]); + } + + if (sc->inthandle != NULL) + bus_teardown_intr(sc->dev, sc->intres, sc->inthandle); + if (sc->intres != NULL) + bus_release_resource(sc->dev, SYS_RES_IRQ, 0, sc->intres); + if (sc->memres != NULL) + bus_release_resource(sc->dev, SYS_RES_MEMORY, 0, sc->memres); + + mtx_unlock(&sc->mtx); + mtx_destroy(&sc->mtx); + + return (0); +} + +static int +spi_attach(device_t dev) +{ + struct spi_softc *sc = device_get_softc(dev); + phandle_t node; + int err, idx, rid; + + sc->dev = dev; + sc->basefreq = imx_ccm_ecspi_hz(); + + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + /* Set up debug-enable sysctl. */ + SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "debug", CTLFLAG_RWTUN, &sc->debug, 0, + "Enable debug, higher values = more info"); + + /* Allocate mmio register access resources. */ + rid = 0; + sc->memres = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->memres == NULL) { + device_printf(sc->dev, "could not allocate registers\n"); + spi_detach(sc->dev); + return (ENXIO); + } + + /* Allocate interrupt resources and set up handler. */ + rid = 0; + sc->intres = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->intres == NULL) { + device_printf(sc->dev, "could not allocate interrupt\n"); + device_detach(sc->dev); + return (ENXIO); + } + err = bus_setup_intr(sc->dev, sc->intres, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, spi_intr, sc, &sc->inthandle); + if (err != 0) { + device_printf(sc->dev, "could not setup interrupt handler"); + device_detach(sc->dev); + return (ENXIO); + } + + /* Allocate gpio pins for configured chip selects. */ + node = ofw_bus_get_node(sc->dev); + for (err = 0, idx = 0; err == 0 && idx < nitems(sc->cspins); ++idx) { + err = gpio_pin_get_by_ofw_propidx(sc->dev, node, "cs-gpios", + idx, &sc->cspins[idx]); + if (err == 0) { + gpio_pin_setflags(sc->cspins[idx], GPIO_PIN_OUTPUT); + } else if (sc->debug >= 2) { + device_printf(sc->dev, + "cannot configure gpio for chip select %u\n", idx); + } + } + + /* + * Hardware init: put all channels into Master mode, turn off the enable + * bit (gates off clocks); we only enable the hardware while xfers run. + */ + WR4(sc, ECSPI_CTLREG, CTLREG_CMODES_MASTER); + + /* Attach the bus driver. */ + sc->spibus = device_add_child(dev, "spibus", -1); + return (bus_generic_attach(sc->dev)); +} + +static int +spi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "i.MX ECSPI Master"); + return (BUS_PROBE_DEFAULT); +} + +static device_method_t spi_methods[] = { + DEVMETHOD(device_probe, spi_probe), + DEVMETHOD(device_attach, spi_attach), + DEVMETHOD(device_detach, spi_detach), + + /* spibus_if */ + DEVMETHOD(spibus_transfer, spi_transfer), + + /* ofw_bus_if */ + DEVMETHOD(ofw_bus_get_node, spi_get_node), + + DEVMETHOD_END +}; + +static driver_t spi_driver = { + "imx_spi", + spi_methods, + sizeof(struct spi_softc), +}; + +static devclass_t spi_devclass; + +DRIVER_MODULE(imx_spi, simplebus, spi_driver, spi_devclass, 0, 0); +DRIVER_MODULE(ofw_spibus, imx_spi, ofw_spibus_driver, ofw_spibus_devclass, 0, 0); +MODULE_DEPEND(imx_spi, ofw_spibus, 1, 1, 1); Modified: head/sys/modules/imx/Makefile ============================================================================== --- head/sys/modules/imx/Makefile Mon Feb 26 02:12:09 2018 (r329998) +++ head/sys/modules/imx/Makefile Mon Feb 26 02:28:32 2018 (r329999) @@ -4,5 +4,6 @@ SUBDIR = \ ../ffec \ imx_i2c \ + imx_spi \ .include Added: head/sys/modules/imx/imx_spi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/imx/imx_spi/Makefile Mon Feb 26 02:28:32 2018 (r329999) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/freescale/imx + +KMOD= imx_spi +SRCS= imx_spi.c + +# Generated files... +SRCS+= \ + bus_if.h \ + device_if.h \ + ofw_bus_if.h \ + opt_platform.h \ + spibus_if.h \ + +.include From owner-svn-src-head@freebsd.org Mon Feb 26 02:43:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39B37F21275; Mon, 26 Feb 2018 02:43:27 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCB297D31E; Mon, 26 Feb 2018 02:43:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D611D158D9; Mon, 26 Feb 2018 02:43:26 +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 w1Q2hQEM006228; Mon, 26 Feb 2018 02:43:26 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q2hQBc006227; Mon, 26 Feb 2018 02:43:26 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201802260243.w1Q2hQBc006227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Mon, 26 Feb 2018 02:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330000 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 330000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 02:43:27 -0000 Author: pkelsey Date: Mon Feb 26 02:43:26 2018 New Revision: 330000 URL: https://svnweb.freebsd.org/changeset/base/330000 Log: Fix harmless locking bug in tfp_fastopen_check_cookie(). The keylist lock was not being acquired early enough. The only side effect of this bug is that the effective add time of a new key could be slightly later than it would have been otherwise, as seen by a TFO client. Reviewed by: tuexen MFC after: 1 month Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14046 Modified: head/sys/netinet/tcp_fastopen.c Modified: head/sys/netinet/tcp_fastopen.c ============================================================================== --- head/sys/netinet/tcp_fastopen.c Mon Feb 26 02:28:32 2018 (r329999) +++ head/sys/netinet/tcp_fastopen.c Mon Feb 26 02:43:26 2018 (r330000) @@ -313,6 +313,7 @@ tcp_fastopen_check_cookie(struct in_conninfo *inc, uin { struct rm_priotracker tracker; unsigned int i, key_index; + int rv; uint64_t cur_cookie; if (V_tcp_fastopen_acceptany) { @@ -320,21 +321,22 @@ tcp_fastopen_check_cookie(struct in_conninfo *inc, uin return (1); } + TCP_FASTOPEN_KEYS_RLOCK(&tracker); if (len != TCP_FASTOPEN_COOKIE_LEN) { if (V_tcp_fastopen_numkeys > 0) { *latest_cookie = tcp_fastopen_make_cookie( V_tcp_fastopen_keys.key[V_tcp_fastopen_keys.newest], inc); - return (0); - } - return (-1); + rv = 0; + } else + rv = -1; + goto out; } /* * Check against each available key, from newest to oldest. */ - TCP_FASTOPEN_KEYS_RLOCK(&tracker); key_index = V_tcp_fastopen_keys.newest; for (i = 0; i < V_tcp_fastopen_numkeys; i++) { cur_cookie = @@ -343,17 +345,19 @@ tcp_fastopen_check_cookie(struct in_conninfo *inc, uin if (i == 0) *latest_cookie = cur_cookie; if (memcmp(cookie, &cur_cookie, TCP_FASTOPEN_COOKIE_LEN) == 0) { - TCP_FASTOPEN_KEYS_RUNLOCK(&tracker); - return (1); + rv = 1; + goto out; } if (key_index == 0) key_index = TCP_FASTOPEN_MAX_KEYS - 1; else key_index--; } - TCP_FASTOPEN_KEYS_RUNLOCK(&tracker); + rv = 0; - return (0); +out: + TCP_FASTOPEN_KEYS_RUNLOCK(&tracker); + return (rv); } static int From owner-svn-src-head@freebsd.org Mon Feb 26 02:53:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F270F21C9D; Mon, 26 Feb 2018 02:53:23 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 396377D867; Mon, 26 Feb 2018 02:53:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BCA515A84; Mon, 26 Feb 2018 02:53:23 +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 w1Q2rNbm011130; Mon, 26 Feb 2018 02:53:23 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q2rMLc011126; Mon, 26 Feb 2018 02:53:22 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201802260253.w1Q2rMLc011126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Mon, 26 Feb 2018 02:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330001 - in head/sys: conf netinet X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: in head/sys: conf netinet X-SVN-Commit-Revision: 330001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 02:53:24 -0000 Author: pkelsey Date: Mon Feb 26 02:53:22 2018 New Revision: 330001 URL: https://svnweb.freebsd.org/changeset/base/330001 Log: This is an implementation of the client side of TCP Fast Open (TFO) [RFC7413]. It also includes a pre-shared key mode of operation in which the server requires the client to be in possession of a shared secret in order to successfully open TFO connections with that server. The names of some existing fastopen sysctls have changed (e.g., net.inet.tcp.fastopen.enabled -> net.inet.tcp.fastopen.server_enable). Reviewed by: tuexen MFC after: 1 month Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14047 Modified: head/sys/conf/options head/sys/netinet/tcp.h head/sys/netinet/tcp_fastopen.c head/sys/netinet/tcp_fastopen.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Feb 26 02:43:26 2018 (r330000) +++ head/sys/conf/options Mon Feb 26 02:53:22 2018 (r330001) @@ -456,6 +456,7 @@ TCP_HHOOK opt_inet.h TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading TCP_RFC7413 opt_inet.h TCP_RFC7413_MAX_KEYS opt_inet.h +TCP_RFC7413_MAX_PSKS opt_inet.h TCP_SIGNATURE opt_ipsec.h VLAN_ARRAY opt_vlan.h XBONEHACK Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Mon Feb 26 02:43:26 2018 (r330000) +++ head/sys/netinet/tcp.h Mon Feb 26 02:53:22 2018 (r330001) @@ -101,8 +101,6 @@ struct tcphdr { #define TCPOLEN_SIGNATURE 18 #define TCPOPT_FAST_OPEN 34 #define TCPOLEN_FAST_OPEN_EMPTY 2 -#define TCPOLEN_FAST_OPEN_MIN 6 -#define TCPOLEN_FAST_OPEN_MAX 18 /* Miscellaneous constants */ #define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at receiver side */ @@ -152,6 +150,10 @@ struct tcphdr { #define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ #define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) /* max space left for options */ + +#define TCP_FASTOPEN_MIN_COOKIE_LEN 4 /* Per RFC7413 */ +#define TCP_FASTOPEN_MAX_COOKIE_LEN 16 /* Per RFC7413 */ +#define TCP_FASTOPEN_PSK_LEN 16 /* Same as TCP_FASTOPEN_KEY_LEN */ #endif /* __BSD_VISIBLE */ /* @@ -251,6 +253,16 @@ struct tcp_info { /* Padding to grow without breaking ABI. */ u_int32_t __tcpi_pad[26]; /* Padding. */ +}; + +/* + * If this structure is provided when setting the TCP_FASTOPEN socket + * option, and the enable member is non-zero, a subsequent connect will use + * pre-shared key (PSK) mode using the provided key. + */ +struct tcp_fastopen { + int enable; + uint8_t psk[TCP_FASTOPEN_PSK_LEN]; }; #endif #define TCP_FUNCTION_NAME_LEN_MAX 32 Modified: head/sys/netinet/tcp_fastopen.c ============================================================================== --- head/sys/netinet/tcp_fastopen.c Mon Feb 26 02:43:26 2018 (r330000) +++ head/sys/netinet/tcp_fastopen.c Mon Feb 26 02:53:22 2018 (r330001) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Patrick Kelsey + * Copyright (c) 2015-2017 Patrick Kelsey * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,23 +25,44 @@ */ /* - * This is a server-side implementation of TCP Fast Open (TFO) [RFC7413]. + * This is an implementation of TCP Fast Open (TFO) [RFC7413]. To include + * this code, add the following line to your kernel config: * - * This implementation is currently considered to be experimental and is not - * included in kernel builds by default. To include this code, add the - * following line to your kernel config: - * * options TCP_RFC7413 * + * * The generated TFO cookies are the 64-bit output of - * SipHash24(<16-byte-key>). Multiple concurrent valid keys are - * supported so that time-based rolling cookie invalidation policies can be - * implemented in the system. The default number of concurrent keys is 2. - * This can be adjusted in the kernel config as follows: + * SipHash24(key=<16-byte-key>, msg=). Multiple concurrent valid + * keys are supported so that time-based rolling cookie invalidation + * policies can be implemented in the system. The default number of + * concurrent keys is 2. This can be adjusted in the kernel config as + * follows: * * options TCP_RFC7413_MAX_KEYS= * * + * In addition to the facilities defined in RFC7413, this implementation + * supports a pre-shared key (PSK) mode of operation in which the TFO server + * requires the client to be in posession of a shared secret in order for + * the client to be able to successfully open TFO connections with the + * server. This is useful, for example, in environments where TFO servers + * are exposed to both internal and external clients and only wish to allow + * TFO connections from internal clients. + * + * In the PSK mode of operation, the server generates and sends TFO cookies + * to requesting clients as usual. However, when validating cookies + * received in TFO SYNs from clients, the server requires the + * client-supplied cookie to equal SipHash24(key=<16-byte-psk>, + * msg=). + * + * Multiple concurrent valid pre-shared keys are supported so that + * time-based rolling PSK invalidation policies can be implemented in the + * system. The default number of concurrent pre-shared keys is 2. This can + * be adjusted in the kernel config as follows: + * + * options TCP_RFC7413_MAX_PSKS= + * + * * The following TFO-specific sysctls are defined: * * net.inet.tcp.fastopen.acceptany (RW, default 0) @@ -49,32 +70,73 @@ * be valid. * * net.inet.tcp.fastopen.autokey (RW, default 120) - * When this and net.inet.tcp.fastopen.enabled are non-zero, a new key - * will be automatically generated after this many seconds. + * When this and net.inet.tcp.fastopen.server_enable are non-zero, a new + * key will be automatically generated after this many seconds. * - * net.inet.tcp.fastopen.enabled (RW, default 0) - * When zero, no new TFO connections can be created. On the transition - * from enabled to disabled, all installed keys are removed. On the - * transition from disabled to enabled, if net.inet.tcp.fastopen.autokey - * is non-zero and there are no keys installed, a new key will be - * generated immediately. The transition from enabled to disabled does - * not affect any TFO connections in progress; it only prevents new ones - * from being made. + * net.inet.tcp.fastopen.ccache_bucket_limit + * (RWTUN, default TCP_FASTOPEN_CCACHE_BUCKET_LIMIT_DEFAULT) + * The maximum number of entries in a client cookie cache bucket. * - * net.inet.tcp.fastopen.keylen (RO) + * net.inet.tcp.fastopen.ccache_buckets + * (RDTUN, default TCP_FASTOPEN_CCACHE_BUCKETS_DEFAULT) + * The number of client cookie cache buckets. + * + * net.inet.tcp.fastopen.client_enable (RW, default 0) + * When zero, no new active (i.e., client) TFO connections can be + * created. On the transition from enabled to disabled, the client + * cookie cache is cleared and disabled. The transition from enabled to + * disabled does not affect any active TFO connections in progress; it + * only prevents new ones from being made. + * + * net.inet.tcp.fastopen.keylen (RD) * The key length in bytes. * - * net.inet.tcp.fastopen.maxkeys (RO) + * net.inet.tcp.fastopen.maxkeys (RD) * The maximum number of keys supported. * - * net.inet.tcp.fastopen.numkeys (RO) + * net.inet.tcp.fastopen.maxpsks (RD) + * The maximum number of pre-shared keys supported. + * + * net.inet.tcp.fastopen.numkeys (RD) * The current number of keys installed. * - * net.inet.tcp.fastopen.setkey (WO) - * Install a new key by writing net.inet.tcp.fastopen.keylen bytes to this - * sysctl. + * net.inet.tcp.fastopen.numpsks (RD) + * The current number of pre-shared keys installed. * + * net.inet.tcp.fastopen.path_disable_time + * (RW, default TCP_FASTOPEN_PATH_DISABLE_TIME_DEFAULT) + * When a failure occurs while trying to create a new active (i.e., + * client) TFO connection, new active connections on the same path, as + * determined by the tuple {client_ip, server_ip, server_port}, will be + * forced to be non-TFO for this many seconds. Note that the path + * disable mechanism relies on state stored in client cookie cache + * entries, so it is possible for the disable time for a given path to + * be reduced if the corresponding client cookie cache entry is reused + * due to resource pressure before the disable period has elapsed. * + * net.inet.tcp.fastopen.psk_enable (RW, default 0) + * When non-zero, pre-shared key (PSK) mode is enabled for all TFO + * servers. On the transition from enabled to disabled, all installed + * pre-shared keys are removed. + * + * net.inet.tcp.fastopen.server_enable (RW, default 0) + * When zero, no new passive (i.e., server) TFO connections can be + * created. On the transition from enabled to disabled, all installed + * keys and pre-shared keys are removed. On the transition from + * disabled to enabled, if net.inet.tcp.fastopen.autokey is non-zero and + * there are no keys installed, a new key will be generated immediately. + * The transition from enabled to disabled does not affect any passive + * TFO connections in progress; it only prevents new ones from being + * made. + * + * net.inet.tcp.fastopen.setkey (WR) + * Install a new key by writing net.inet.tcp.fastopen.keylen bytes to + * this sysctl. + * + * net.inet.tcp.fastopen.setpsk (WR) + * Install a new pre-shared key by writing net.inet.tcp.fastopen.keylen + * bytes to this sysctl. + * * In order for TFO connections to be created via a listen socket, that * socket must have the TCP_FASTOPEN socket option set on it. This option * can be set on the socket either before or after the listen() is invoked. @@ -105,6 +167,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -119,21 +182,56 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #define TCP_FASTOPEN_KEY_LEN SIPHASH_KEY_LENGTH +#if TCP_FASTOPEN_PSK_LEN != TCP_FASTOPEN_KEY_LEN +#error TCP_FASTOPEN_PSK_LEN must be equal to TCP_FASTOPEN_KEY_LEN +#endif + +/* + * Because a PSK-mode setsockopt() uses tcpcb.t_tfo_cookie.client to hold + * the PSK until the connect occurs. + */ +#if TCP_FASTOPEN_MAX_COOKIE_LEN < TCP_FASTOPEN_PSK_LEN +#error TCP_FASTOPEN_MAX_COOKIE_LEN must be >= TCP_FASTOPEN_PSK_LEN +#endif + +#define TCP_FASTOPEN_CCACHE_BUCKET_LIMIT_DEFAULT 16 +#define TCP_FASTOPEN_CCACHE_BUCKETS_DEFAULT 2048 /* must be power of 2 */ + +#define TCP_FASTOPEN_PATH_DISABLE_TIME_DEFAULT 900 /* seconds */ + #if !defined(TCP_RFC7413_MAX_KEYS) || (TCP_RFC7413_MAX_KEYS < 1) #define TCP_FASTOPEN_MAX_KEYS 2 #else #define TCP_FASTOPEN_MAX_KEYS TCP_RFC7413_MAX_KEYS #endif +#if TCP_FASTOPEN_MAX_KEYS > 10 +#undef TCP_FASTOPEN_MAX_KEYS +#define TCP_FASTOPEN_MAX_KEYS 10 +#endif + +#if !defined(TCP_RFC7413_MAX_PSKS) || (TCP_RFC7413_MAX_PSKS < 1) +#define TCP_FASTOPEN_MAX_PSKS 2 +#else +#define TCP_FASTOPEN_MAX_PSKS TCP_RFC7413_MAX_PSKS +#endif + +#if TCP_FASTOPEN_MAX_PSKS > 10 +#undef TCP_FASTOPEN_MAX_PSKS +#define TCP_FASTOPEN_MAX_PSKS 10 +#endif + struct tcp_fastopen_keylist { unsigned int newest; + unsigned int newest_psk; uint8_t key[TCP_FASTOPEN_MAX_KEYS][TCP_FASTOPEN_KEY_LEN]; + uint8_t psk[TCP_FASTOPEN_MAX_PSKS][TCP_FASTOPEN_KEY_LEN]; }; struct tcp_fastopen_callout { @@ -141,6 +239,16 @@ struct tcp_fastopen_callout { struct vnet *v; }; +static struct tcp_fastopen_ccache_entry *tcp_fastopen_ccache_lookup( + struct in_conninfo *, struct tcp_fastopen_ccache_bucket **); +static struct tcp_fastopen_ccache_entry *tcp_fastopen_ccache_create( + struct tcp_fastopen_ccache_bucket *, struct in_conninfo *, uint16_t, uint8_t, + uint8_t *); +static void tcp_fastopen_ccache_bucket_trim(struct tcp_fastopen_ccache_bucket *, + unsigned int); +static void tcp_fastopen_ccache_entry_drop(struct tcp_fastopen_ccache_entry *, + struct tcp_fastopen_ccache_bucket *); + SYSCTL_NODE(_net_inet_tcp, OID_AUTO, fastopen, CTLFLAG_RW, 0, "TCP Fast Open"); static VNET_DEFINE(int, tcp_fastopen_acceptany) = 0; @@ -157,12 +265,25 @@ SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, autokey, &sysctl_net_inet_tcp_fastopen_autokey, "IU", "Number of seconds between auto-generation of a new key; zero disables"); -VNET_DEFINE(unsigned int, tcp_fastopen_enabled) = 0; -static int sysctl_net_inet_tcp_fastopen_enabled(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, enabled, +static int sysctl_net_inet_tcp_fastopen_ccache_bucket_limit(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, ccache_bucket_limit, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RWTUN, NULL, 0, + &sysctl_net_inet_tcp_fastopen_ccache_bucket_limit, "IU", + "Max entries per bucket in client cookie cache"); + +static VNET_DEFINE(unsigned int, tcp_fastopen_ccache_buckets) = + TCP_FASTOPEN_CCACHE_BUCKETS_DEFAULT; +#define V_tcp_fastopen_ccache_buckets VNET(tcp_fastopen_ccache_buckets) +SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, ccache_buckets, + CTLFLAG_VNET | CTLFLAG_RDTUN, &VNET_NAME(tcp_fastopen_ccache_buckets), 0, + "Client cookie cache number of buckets (power of 2)"); + +VNET_DEFINE(unsigned int, tcp_fastopen_client_enable) = 0; +static int sysctl_net_inet_tcp_fastopen_client_enable(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, client_enable, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, - &sysctl_net_inet_tcp_fastopen_enabled, "IU", - "Enable/disable TCP Fast Open processing"); + &sysctl_net_inet_tcp_fastopen_client_enable, "IU", + "Enable/disable TCP Fast Open client functionality"); SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, keylen, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, TCP_FASTOPEN_KEY_LEN, @@ -172,18 +293,56 @@ SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, maxkeys, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, TCP_FASTOPEN_MAX_KEYS, "Maximum number of keys supported"); +SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, maxpsks, + CTLFLAG_RD, SYSCTL_NULL_INT_PTR, TCP_FASTOPEN_MAX_PSKS, + "Maximum number of pre-shared keys supported"); + static VNET_DEFINE(unsigned int, tcp_fastopen_numkeys) = 0; #define V_tcp_fastopen_numkeys VNET(tcp_fastopen_numkeys) SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, numkeys, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_fastopen_numkeys), 0, "Number of keys installed"); +static VNET_DEFINE(unsigned int, tcp_fastopen_numpsks) = 0; +#define V_tcp_fastopen_numpsks VNET(tcp_fastopen_numpsks) +SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, numpsks, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_fastopen_numpsks), 0, + "Number of pre-shared keys installed"); + +static VNET_DEFINE(unsigned int, tcp_fastopen_path_disable_time) = + TCP_FASTOPEN_PATH_DISABLE_TIME_DEFAULT; +#define V_tcp_fastopen_path_disable_time VNET(tcp_fastopen_path_disable_time) +SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, path_disable_time, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_fastopen_path_disable_time), 0, + "Seconds a TFO failure disables a {client_ip, server_ip, server_port} path"); + +static VNET_DEFINE(unsigned int, tcp_fastopen_psk_enable) = 0; +#define V_tcp_fastopen_psk_enable VNET(tcp_fastopen_psk_enable) +static int sysctl_net_inet_tcp_fastopen_psk_enable(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, psk_enable, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, + &sysctl_net_inet_tcp_fastopen_psk_enable, "IU", + "Enable/disable TCP Fast Open server pre-shared key mode"); + +VNET_DEFINE(unsigned int, tcp_fastopen_server_enable) = 0; +static int sysctl_net_inet_tcp_fastopen_server_enable(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, server_enable, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, + &sysctl_net_inet_tcp_fastopen_server_enable, "IU", + "Enable/disable TCP Fast Open server functionality"); + static int sysctl_net_inet_tcp_fastopen_setkey(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, setkey, CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_WR, NULL, 0, &sysctl_net_inet_tcp_fastopen_setkey, "", "Install a new key"); +static int sysctl_net_inet_tcp_fastopen_setpsk(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, setpsk, + CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_WR, NULL, 0, + &sysctl_net_inet_tcp_fastopen_setpsk, "", + "Install a new pre-shared key"); + static VNET_DEFINE(struct rmlock, tcp_fastopen_keylock); #define V_tcp_fastopen_keylock VNET(tcp_fastopen_keylock) @@ -201,9 +360,21 @@ static VNET_DEFINE(struct tcp_fastopen_callout, tcp_fa static VNET_DEFINE(uma_zone_t, counter_zone); #define V_counter_zone VNET(counter_zone) +static MALLOC_DEFINE(M_TCP_FASTOPEN_CCACHE, "tfo_ccache", "TFO client cookie cache buckets"); + +static VNET_DEFINE(struct tcp_fastopen_ccache, tcp_fastopen_ccache); +#define V_tcp_fastopen_ccache VNET(tcp_fastopen_ccache) + +#define CCB_LOCK(ccb) mtx_lock(&(ccb)->ccb_mtx) +#define CCB_UNLOCK(ccb) mtx_unlock(&(ccb)->ccb_mtx) +#define CCB_LOCK_ASSERT(ccb) mtx_assert(&(ccb)->ccb_mtx, MA_OWNED) + + void tcp_fastopen_init(void) { + unsigned int i; + V_counter_zone = uma_zcreate("tfo", sizeof(unsigned int), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); rm_init(&V_tcp_fastopen_keylock, "tfo_keylock"); @@ -211,11 +382,67 @@ tcp_fastopen_init(void) &V_tcp_fastopen_keylock, 0); V_tcp_fastopen_autokey_ctx.v = curvnet; V_tcp_fastopen_keys.newest = TCP_FASTOPEN_MAX_KEYS - 1; + V_tcp_fastopen_keys.newest_psk = TCP_FASTOPEN_MAX_PSKS - 1; + + /* May already be non-zero if kernel tunable was set */ + if (V_tcp_fastopen_ccache.bucket_limit == 0) + V_tcp_fastopen_ccache.bucket_limit = + TCP_FASTOPEN_CCACHE_BUCKET_LIMIT_DEFAULT; + + /* May already be non-zero if kernel tunable was set */ + if ((V_tcp_fastopen_ccache_buckets == 0) || + !powerof2(V_tcp_fastopen_ccache_buckets)) + V_tcp_fastopen_ccache.buckets = + TCP_FASTOPEN_CCACHE_BUCKETS_DEFAULT; + else + V_tcp_fastopen_ccache.buckets = V_tcp_fastopen_ccache_buckets; + + V_tcp_fastopen_ccache.mask = V_tcp_fastopen_ccache.buckets - 1; + V_tcp_fastopen_ccache.secret = arc4random(); + + V_tcp_fastopen_ccache.base = malloc(V_tcp_fastopen_ccache.buckets * + sizeof(struct tcp_fastopen_ccache_bucket), M_TCP_FASTOPEN_CCACHE, + M_WAITOK | M_ZERO); + + for (i = 0; i < V_tcp_fastopen_ccache.buckets; i++) { + TAILQ_INIT(&V_tcp_fastopen_ccache.base[i].ccb_entries); + mtx_init(&V_tcp_fastopen_ccache.base[i].ccb_mtx, "tfo_ccache_bucket", + NULL, MTX_DEF); + V_tcp_fastopen_ccache.base[i].ccb_num_entries = -1; /* bucket disabled */ + V_tcp_fastopen_ccache.base[i].ccb_ccache = &V_tcp_fastopen_ccache; + } + + /* + * Note that while the total number of entries in the cookie cache + * is limited by the table management logic to + * V_tcp_fastopen_ccache.buckets * + * V_tcp_fastopen_ccache.bucket_limit, the total number of items in + * this zone can exceed that amount by the number of CPUs in the + * system times the maximum number of unallocated items that can be + * present in each UMA per-CPU cache for this zone. + */ + V_tcp_fastopen_ccache.zone = uma_zcreate("tfo_ccache_entries", + sizeof(struct tcp_fastopen_ccache_entry), NULL, NULL, NULL, NULL, + UMA_ALIGN_CACHE, 0); } void tcp_fastopen_destroy(void) { + struct tcp_fastopen_ccache_bucket *ccb; + unsigned int i; + + for (i = 0; i < V_tcp_fastopen_ccache.buckets; i++) { + ccb = &V_tcp_fastopen_ccache.base[i]; + tcp_fastopen_ccache_bucket_trim(ccb, 0); + mtx_destroy(&ccb->ccb_mtx); + } + + KASSERT(uma_zone_get_cur(V_tcp_fastopen_ccache.zone) == 0, + ("%s: TFO ccache zone allocation count not 0", __func__)); + uma_zdestroy(V_tcp_fastopen_ccache.zone); + free(V_tcp_fastopen_ccache.base, M_TCP_FASTOPEN_CCACHE); + callout_drain(&V_tcp_fastopen_autokey_ctx.c); rm_destroy(&V_tcp_fastopen_keylock); uma_zdestroy(V_counter_zone); @@ -254,6 +481,19 @@ tcp_fastopen_addkey_locked(uint8_t *key) } static void +tcp_fastopen_addpsk_locked(uint8_t *psk) +{ + + V_tcp_fastopen_keys.newest_psk++; + if (V_tcp_fastopen_keys.newest_psk == TCP_FASTOPEN_MAX_PSKS) + V_tcp_fastopen_keys.newest_psk = 0; + memcpy(V_tcp_fastopen_keys.psk[V_tcp_fastopen_keys.newest_psk], psk, + TCP_FASTOPEN_KEY_LEN); + if (V_tcp_fastopen_numpsks < TCP_FASTOPEN_MAX_PSKS) + V_tcp_fastopen_numpsks++; +} + +static void tcp_fastopen_autokey_locked(void) { uint8_t newkey[TCP_FASTOPEN_KEY_LEN]; @@ -300,7 +540,50 @@ tcp_fastopen_make_cookie(uint8_t key[SIPHASH_KEY_LENGT return (siphash); } +static uint64_t +tcp_fastopen_make_psk_cookie(uint8_t *psk, uint8_t *cookie, uint8_t cookie_len) +{ + SIPHASH_CTX ctx; + uint64_t psk_cookie; + SipHash24_Init(&ctx); + SipHash_SetKey(&ctx, psk); + SipHash_Update(&ctx, cookie, cookie_len); + SipHash_Final((u_int8_t *)&psk_cookie, &ctx); + + return (psk_cookie); +} + +static int +tcp_fastopen_find_cookie_match_locked(uint8_t *wire_cookie, uint64_t *cur_cookie) +{ + unsigned int i, psk_index; + uint64_t psk_cookie; + + if (V_tcp_fastopen_psk_enable) { + psk_index = V_tcp_fastopen_keys.newest_psk; + for (i = 0; i < V_tcp_fastopen_numpsks; i++) { + psk_cookie = + tcp_fastopen_make_psk_cookie( + V_tcp_fastopen_keys.psk[psk_index], + (uint8_t *)cur_cookie, + TCP_FASTOPEN_COOKIE_LEN); + + if (memcmp(wire_cookie, &psk_cookie, + TCP_FASTOPEN_COOKIE_LEN) == 0) + return (1); + + if (psk_index == 0) + psk_index = TCP_FASTOPEN_MAX_PSKS - 1; + else + psk_index--; + } + } else if (memcmp(wire_cookie, cur_cookie, TCP_FASTOPEN_COOKIE_LEN) == 0) + return (1); + + return (0); +} + /* * Return values: * -1 the cookie is invalid and no valid cookie is available @@ -344,10 +627,9 @@ tcp_fastopen_check_cookie(struct in_conninfo *inc, uin inc); if (i == 0) *latest_cookie = cur_cookie; - if (memcmp(cookie, &cur_cookie, TCP_FASTOPEN_COOKIE_LEN) == 0) { - rv = 1; + rv = tcp_fastopen_find_cookie_match_locked(cookie, &cur_cookie); + if (rv) goto out; - } if (key_index == 0) key_index = TCP_FASTOPEN_MAX_KEYS - 1; else @@ -355,7 +637,7 @@ tcp_fastopen_check_cookie(struct in_conninfo *inc, uin } rv = 0; -out: + out: TCP_FASTOPEN_KEYS_RUNLOCK(&tracker); return (rv); } @@ -373,7 +655,7 @@ sysctl_net_inet_tcp_fastopen_autokey(SYSCTL_HANDLER_AR return (EINVAL); TCP_FASTOPEN_KEYS_WLOCK(); - if (V_tcp_fastopen_enabled) { + if (V_tcp_fastopen_server_enable) { if (V_tcp_fastopen_autokey && !new) callout_stop(&V_tcp_fastopen_autokey_ctx.c); else if (new) @@ -389,24 +671,54 @@ sysctl_net_inet_tcp_fastopen_autokey(SYSCTL_HANDLER_AR } static int -sysctl_net_inet_tcp_fastopen_enabled(SYSCTL_HANDLER_ARGS) +sysctl_net_inet_tcp_fastopen_psk_enable(SYSCTL_HANDLER_ARGS) { int error; unsigned int new; - new = V_tcp_fastopen_enabled; + new = V_tcp_fastopen_psk_enable; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr) { - if (V_tcp_fastopen_enabled && !new) { + if (V_tcp_fastopen_psk_enable && !new) { /* enabled -> disabled */ TCP_FASTOPEN_KEYS_WLOCK(); + V_tcp_fastopen_numpsks = 0; + V_tcp_fastopen_keys.newest_psk = + TCP_FASTOPEN_MAX_PSKS - 1; + V_tcp_fastopen_psk_enable = 0; + TCP_FASTOPEN_KEYS_WUNLOCK(); + } else if (!V_tcp_fastopen_psk_enable && new) { + /* disabled -> enabled */ + TCP_FASTOPEN_KEYS_WLOCK(); + V_tcp_fastopen_psk_enable = 1; + TCP_FASTOPEN_KEYS_WUNLOCK(); + } + } + return (error); +} + +static int +sysctl_net_inet_tcp_fastopen_server_enable(SYSCTL_HANDLER_ARGS) +{ + int error; + unsigned int new; + + new = V_tcp_fastopen_server_enable; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if (V_tcp_fastopen_server_enable && !new) { + /* enabled -> disabled */ + TCP_FASTOPEN_KEYS_WLOCK(); V_tcp_fastopen_numkeys = 0; V_tcp_fastopen_keys.newest = TCP_FASTOPEN_MAX_KEYS - 1; if (V_tcp_fastopen_autokey) callout_stop(&V_tcp_fastopen_autokey_ctx.c); - V_tcp_fastopen_enabled = 0; + V_tcp_fastopen_numpsks = 0; + V_tcp_fastopen_keys.newest_psk = + TCP_FASTOPEN_MAX_PSKS - 1; + V_tcp_fastopen_server_enable = 0; TCP_FASTOPEN_KEYS_WUNLOCK(); - } else if (!V_tcp_fastopen_enabled && new) { + } else if (!V_tcp_fastopen_server_enable && new) { /* disabled -> enabled */ TCP_FASTOPEN_KEYS_WLOCK(); if (V_tcp_fastopen_autokey && @@ -417,7 +729,7 @@ sysctl_net_inet_tcp_fastopen_enabled(SYSCTL_HANDLER_AR tcp_fastopen_autokey_callout, &V_tcp_fastopen_autokey_ctx); } - V_tcp_fastopen_enabled = 1; + V_tcp_fastopen_server_enable = 1; TCP_FASTOPEN_KEYS_WUNLOCK(); } } @@ -446,3 +758,369 @@ sysctl_net_inet_tcp_fastopen_setkey(SYSCTL_HANDLER_ARG return (0); } + +static int +sysctl_net_inet_tcp_fastopen_setpsk(SYSCTL_HANDLER_ARGS) +{ + int error; + uint8_t newpsk[TCP_FASTOPEN_KEY_LEN]; + + if (req->oldptr != NULL || req->oldlen != 0) + return (EINVAL); + if (req->newptr == NULL) + return (EPERM); + if (req->newlen != sizeof(newpsk)) + return (EINVAL); + error = SYSCTL_IN(req, newpsk, sizeof(newpsk)); + if (error) + return (error); + + TCP_FASTOPEN_KEYS_WLOCK(); + tcp_fastopen_addpsk_locked(newpsk); + TCP_FASTOPEN_KEYS_WUNLOCK(); + + return (0); +} + +static int +sysctl_net_inet_tcp_fastopen_ccache_bucket_limit(SYSCTL_HANDLER_ARGS) +{ + struct tcp_fastopen_ccache_bucket *ccb; + int error; + unsigned int new; + unsigned int i; + + new = V_tcp_fastopen_ccache.bucket_limit; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if ((new == 0) || (new > INT_MAX)) + error = EINVAL; + else { + if (new < V_tcp_fastopen_ccache.bucket_limit) { + for (i = 0; i < V_tcp_fastopen_ccache.buckets; + i++) { + ccb = &V_tcp_fastopen_ccache.base[i]; + tcp_fastopen_ccache_bucket_trim(ccb, new); + } + } + V_tcp_fastopen_ccache.bucket_limit = new; + } + + } + return (error); +} + +static int +sysctl_net_inet_tcp_fastopen_client_enable(SYSCTL_HANDLER_ARGS) +{ + struct tcp_fastopen_ccache_bucket *ccb; + int error; + unsigned int new, i; + + new = V_tcp_fastopen_client_enable; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if (V_tcp_fastopen_client_enable && !new) { + /* enabled -> disabled */ + for (i = 0; i < V_tcp_fastopen_ccache.buckets; i++) { + ccb = &V_tcp_fastopen_ccache.base[i]; + tcp_fastopen_ccache_bucket_trim(ccb, 0); + } + V_tcp_fastopen_client_enable = 0; + } else if (!V_tcp_fastopen_client_enable && new) { + /* disabled -> enabled */ + for (i = 0; i < V_tcp_fastopen_ccache.buckets; i++) { + ccb = &V_tcp_fastopen_ccache.base[i]; + CCB_LOCK(ccb); + KASSERT(TAILQ_EMPTY(&ccb->ccb_entries), + ("%s: ccb->ccb_entries not empty", __func__)); + KASSERT(ccb->ccb_num_entries == -1, + ("%s: ccb->ccb_num_entries %d not -1", __func__, + ccb->ccb_num_entries)); + ccb->ccb_num_entries = 0; /* enable bucket */ + CCB_UNLOCK(ccb); + } + V_tcp_fastopen_client_enable = 1; + } + } + return (error); +} + +void +tcp_fastopen_connect(struct tcpcb *tp) +{ + struct inpcb *inp; + struct tcp_fastopen_ccache_bucket *ccb; + struct tcp_fastopen_ccache_entry *cce; + sbintime_t now; + uint16_t server_mss; + uint64_t psk_cookie; + + inp = tp->t_inpcb; + cce = tcp_fastopen_ccache_lookup(&inp->inp_inc, &ccb); + if (cce) { + if (cce->disable_time == 0) { + if ((cce->cookie_len > 0) && + (tp->t_tfo_client_cookie_len == + TCP_FASTOPEN_PSK_LEN)) { + psk_cookie = + tcp_fastopen_make_psk_cookie( + tp->t_tfo_cookie.client, + cce->cookie, cce->cookie_len); + } else { + tp->t_tfo_client_cookie_len = cce->cookie_len; + memcpy(tp->t_tfo_cookie.client, cce->cookie, + cce->cookie_len); + } + server_mss = cce->server_mss; + CCB_UNLOCK(ccb); + if (tp->t_tfo_client_cookie_len == + TCP_FASTOPEN_PSK_LEN) { + tp->t_tfo_client_cookie_len = + TCP_FASTOPEN_COOKIE_LEN; + memcpy(tp->t_tfo_cookie.client, &psk_cookie, + TCP_FASTOPEN_COOKIE_LEN); + } + tcp_mss(tp, server_mss ? server_mss : -1); + tp->snd_wnd = tp->t_maxseg; + } else { + /* + * The path is disabled. Check the time and + * possibly re-enable. + */ + now = getsbinuptime(); + if (now - cce->disable_time > + ((sbintime_t)V_tcp_fastopen_path_disable_time << 32)) { + /* + * Re-enable path. Force a TFO cookie + * request. Forget the old MSS as it may be + * bogus now, and we will rediscover it in + * the SYN|ACK. + */ + cce->disable_time = 0; + cce->server_mss = 0; + cce->cookie_len = 0; + /* + * tp->t_tfo... cookie details are already + * zero from the tcpcb init. + */ + } else { + /* + * Path is disabled, so disable TFO on this + * connection. + */ + tp->t_flags &= ~TF_FASTOPEN; + } + CCB_UNLOCK(ccb); + tcp_mss(tp, -1); + /* + * snd_wnd is irrelevant since we are either forcing + * a TFO cookie request or disabling TFO - either + * way, no data with the SYN. + */ + } + } else { + /* + * A new entry for this path will be created when a SYN|ACK + * comes back, or the attempt otherwise fails. + */ + CCB_UNLOCK(ccb); + tcp_mss(tp, -1); + /* + * snd_wnd is irrelevant since we are forcing a TFO cookie + * request. + */ + } +} + +void +tcp_fastopen_disable_path(struct tcpcb *tp) +{ + struct in_conninfo *inc = &tp->t_inpcb->inp_inc; + struct tcp_fastopen_ccache_bucket *ccb; + struct tcp_fastopen_ccache_entry *cce; + + cce = tcp_fastopen_ccache_lookup(inc, &ccb); + if (cce) { + cce->server_mss = 0; + cce->cookie_len = 0; + /* + * Preserve the existing disable time if it is already + * disabled. + */ + if (cce->disable_time == 0) + cce->disable_time = getsbinuptime(); + } else /* use invalid cookie len to create disabled entry */ + tcp_fastopen_ccache_create(ccb, inc, 0, + TCP_FASTOPEN_MAX_COOKIE_LEN + 1, NULL); + + CCB_UNLOCK(ccb); + tp->t_flags &= ~TF_FASTOPEN; +} + +void +tcp_fastopen_update_cache(struct tcpcb *tp, uint16_t mss, + uint8_t cookie_len, uint8_t *cookie) +{ + struct in_conninfo *inc = &tp->t_inpcb->inp_inc; + struct tcp_fastopen_ccache_bucket *ccb; + struct tcp_fastopen_ccache_entry *cce; + + cce = tcp_fastopen_ccache_lookup(inc, &ccb); + if (cce) { + if ((cookie_len >= TCP_FASTOPEN_MIN_COOKIE_LEN) && + (cookie_len <= TCP_FASTOPEN_MAX_COOKIE_LEN) && + ((cookie_len & 0x1) == 0)) { + cce->server_mss = mss; + cce->cookie_len = cookie_len; + memcpy(cce->cookie, cookie, cookie_len); + cce->disable_time = 0; + } else { + /* invalid cookie length, disable entry */ + cce->server_mss = 0; + cce->cookie_len = 0; + /* + * Preserve the existing disable time if it is + * already disabled. + */ + if (cce->disable_time == 0) + cce->disable_time = getsbinuptime(); + } + } else + tcp_fastopen_ccache_create(ccb, inc, mss, cookie_len, cookie); + + CCB_UNLOCK(ccb); +} + +static struct tcp_fastopen_ccache_entry * +tcp_fastopen_ccache_lookup(struct in_conninfo *inc, + struct tcp_fastopen_ccache_bucket **ccbp) +{ + struct tcp_fastopen_ccache_bucket *ccb; + struct tcp_fastopen_ccache_entry *cce; + uint32_t last_word; + uint32_t hash; + + hash = jenkins_hash32((uint32_t *)&inc->inc_ie.ie_dependladdr, 4, + V_tcp_fastopen_ccache.secret); + hash = jenkins_hash32((uint32_t *)&inc->inc_ie.ie_dependfaddr, 4, + hash); + last_word = inc->inc_fport; + hash = jenkins_hash32(&last_word, 1, hash); + ccb = &V_tcp_fastopen_ccache.base[hash & V_tcp_fastopen_ccache.mask]; + *ccbp = ccb; + CCB_LOCK(ccb); + + /* + * Always returns with locked bucket. + */ + TAILQ_FOREACH(cce, &ccb->ccb_entries, cce_link) + if ((!(cce->af == AF_INET6) == !(inc->inc_flags & INC_ISIPV6)) && + (cce->server_port == inc->inc_ie.ie_fport) && + (((cce->af == AF_INET) && + (cce->cce_client_ip.v4.s_addr == inc->inc_laddr.s_addr) && + (cce->cce_server_ip.v4.s_addr == inc->inc_faddr.s_addr)) || + ((cce->af == AF_INET6) && + IN6_ARE_ADDR_EQUAL(&cce->cce_client_ip.v6, &inc->inc6_laddr) && + IN6_ARE_ADDR_EQUAL(&cce->cce_server_ip.v6, &inc->inc6_faddr)))) + break; + + return (cce); +} + +static struct tcp_fastopen_ccache_entry * +tcp_fastopen_ccache_create(struct tcp_fastopen_ccache_bucket *ccb, + struct in_conninfo *inc, uint16_t mss, uint8_t cookie_len, uint8_t *cookie) +{ + struct tcp_fastopen_ccache_entry *cce; + + /* + * 1. Create a new entry, or + * 2. Reclaim an existing entry, or + * 3. Fail + */ + + CCB_LOCK_ASSERT(ccb); + + cce = NULL; + if (ccb->ccb_num_entries < V_tcp_fastopen_ccache.bucket_limit) + cce = uma_zalloc(V_tcp_fastopen_ccache.zone, M_NOWAIT); + + if (cce == NULL) { + /* + * At bucket limit, or out of memory - reclaim last + * entry in bucket. + */ + cce = TAILQ_LAST(&ccb->ccb_entries, bucket_entries); + if (cce == NULL) { + /* XXX count this event */ + return (NULL); + } + + TAILQ_REMOVE(&ccb->ccb_entries, cce, cce_link); + } else + ccb->ccb_num_entries++; + + TAILQ_INSERT_HEAD(&ccb->ccb_entries, cce, cce_link); + cce->af = (inc->inc_flags & INC_ISIPV6) ? AF_INET6 : AF_INET; + if (cce->af == AF_INET) { + cce->cce_client_ip.v4 = inc->inc_laddr; + cce->cce_server_ip.v4 = inc->inc_faddr; + } else { + cce->cce_client_ip.v6 = inc->inc6_laddr; + cce->cce_server_ip.v6 = inc->inc6_faddr; + } + cce->server_port = inc->inc_fport; + if ((cookie_len <= TCP_FASTOPEN_MAX_COOKIE_LEN) && + ((cookie_len & 0x1) == 0)) { + cce->server_mss = mss; + cce->cookie_len = cookie_len; + memcpy(cce->cookie, cookie, cookie_len); + cce->disable_time = 0; + } else { + /* invalid cookie length, disable cce */ + cce->server_mss = 0; + cce->cookie_len = 0; + cce->disable_time = getsbinuptime(); + } + + return (cce); +} + +static void +tcp_fastopen_ccache_bucket_trim(struct tcp_fastopen_ccache_bucket *ccb, + unsigned int limit) +{ + struct tcp_fastopen_ccache_entry *cce, *cce_tmp; + unsigned int entries; + + CCB_LOCK(ccb); + entries = 0; + TAILQ_FOREACH_SAFE(cce, &ccb->ccb_entries, cce_link, cce_tmp) { + entries++; + if (entries > limit) + tcp_fastopen_ccache_entry_drop(cce, ccb); + } + KASSERT(ccb->ccb_num_entries <= limit, + ("%s: ccb->ccb_num_entries %d exceeds limit %d", __func__, + ccb->ccb_num_entries, limit)); + if (limit == 0) { + KASSERT(TAILQ_EMPTY(&ccb->ccb_entries), + ("%s: ccb->ccb_entries not empty", __func__)); + ccb->ccb_num_entries = -1; /* disable bucket */ + } + CCB_UNLOCK(ccb); +} + +static void +tcp_fastopen_ccache_entry_drop(struct tcp_fastopen_ccache_entry *cce, + struct tcp_fastopen_ccache_bucket *ccb) +{ + + CCB_LOCK_ASSERT(ccb); + + TAILQ_REMOVE(&ccb->ccb_entries, cce, cce_link); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 26 03:03:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94218F22A1C; Mon, 26 Feb 2018 03:03:42 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CEA7E19E; Mon, 26 Feb 2018 03:03:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A8A315C7C; Mon, 26 Feb 2018 03:03:42 +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 w1Q33gA5017376; Mon, 26 Feb 2018 03:03:42 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q33f27017366; Mon, 26 Feb 2018 03:03:41 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201802260303.w1Q33f27017366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Mon, 26 Feb 2018 03:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330002 - in head/sys: amd64/conf arm64/conf netinet X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: in head/sys: amd64/conf arm64/conf netinet X-SVN-Commit-Revision: 330002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 03:03:43 -0000 Author: pkelsey Date: Mon Feb 26 03:03:41 2018 New Revision: 330002 URL: https://svnweb.freebsd.org/changeset/base/330002 Log: Greatly reduce the number of #ifdefs supporting the TCP_RFC7413 kernel option. The conditional compilation support is now centralized in tcp_fastopen.h and tcp_var.h. This doesn't provide the minimum theoretical code/data footprint when TCP_RFC7413 is disabled, but nearly all the TFO code should wind up being removed by the optimizer, the additional footprint in the syncache entries is a single pointer, and the additional overhead in the tcpcb is at the end of the structure. This enables the TCP_RFC7413 kernel option by default in amd64 and arm64 GENERIC. Reviewed by: hiren MFC after: 1 month Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14048 Modified: head/sys/amd64/conf/GENERIC head/sys/arm64/conf/GENERIC head/sys/netinet/tcp_fastopen.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/amd64/conf/GENERIC Mon Feb 26 03:03:41 2018 (r330002) @@ -33,6 +33,7 @@ options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_OFFLOAD # TCP offload options TCP_HHOOK # hhook(9) framework for TCP +options TCP_RFC7413 # TCP Fast Open options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/arm64/conf/GENERIC Mon Feb 26 03:03:41 2018 (r330002) @@ -33,6 +33,7 @@ options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload +options TCP_RFC7413 # TCP Fast Open options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/netinet/tcp_fastopen.h ============================================================================== --- head/sys/netinet/tcp_fastopen.h Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/netinet/tcp_fastopen.h Mon Feb 26 03:03:41 2018 (r330002) @@ -31,13 +31,20 @@ #ifdef _KERNEL +#include "opt_inet.h" + #define TCP_FASTOPEN_COOKIE_LEN 8 /* SipHash24 64-bit output */ +#ifdef TCP_RFC7413 VNET_DECLARE(unsigned int, tcp_fastopen_client_enable); #define V_tcp_fastopen_client_enable VNET(tcp_fastopen_client_enable) VNET_DECLARE(unsigned int, tcp_fastopen_server_enable); #define V_tcp_fastopen_server_enable VNET(tcp_fastopen_server_enable) +#else +#define V_tcp_fastopen_client_enable 0 +#define V_tcp_fastopen_server_enable 0 +#endif /* TCP_RFC7413 */ union tcp_fastopen_ip_addr { struct in_addr v4; @@ -74,6 +81,7 @@ struct tcp_fastopen_ccache { uint32_t secret; }; +#ifdef TCP_RFC7413 void tcp_fastopen_init(void); void tcp_fastopen_destroy(void); unsigned int *tcp_fastopen_alloc_counter(void); @@ -84,6 +92,17 @@ void tcp_fastopen_connect(struct tcpcb *); void tcp_fastopen_disable_path(struct tcpcb *); void tcp_fastopen_update_cache(struct tcpcb *, uint16_t, uint8_t, uint8_t *); +#else +#define tcp_fastopen_init() ((void)0) +#define tcp_fastopen_destroy() ((void)0) +#define tcp_fastopen_alloc_counter() NULL +#define tcp_fastopen_decrement_counter(c) ((void)0) +#define tcp_fastopen_check_cookie(i, c, l, lc) (-1) +#define tcp_fastopen_connect(t) ((void)0) +#define tcp_fastopen_disable_path(t) ((void)0) +#define tcp_fastopen_update_cache(t, m, l, c) ((void)0) +#endif /* TCP_RFC7413 */ + #endif /* _KERNEL */ #endif /* _TCP_FASTOPEN_H_ */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/netinet/tcp_input.c Mon Feb 26 03:03:41 2018 (r330002) @@ -108,9 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef TCP_RFC7413 #include -#endif #ifdef TCPPCAP #include #endif @@ -1130,9 +1128,7 @@ relocked: rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } -#ifdef TCP_RFC7413 tfo_socket_result: -#endif if (so == NULL) { /* * We completed the 3-way handshake @@ -1375,12 +1371,9 @@ tfo_socket_result: #endif TCP_PROBE3(debug__input, tp, th, m); tcp_dooptions(&to, optp, optlen, TO_SYN); -#ifdef TCP_RFC7413 if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL)) goto tfo_socket_result; -#else - syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL); -#endif + /* * Entry added to syncache and mbuf consumed. * Only the listen socket is unlocked by syncache_add(). @@ -1550,9 +1543,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru struct in_conninfo *inc; struct mbuf *mfree; struct tcpopt to; -#ifdef TCP_RFC7413 int tfo_syn; -#endif #ifdef TCPDEBUG /* @@ -1717,7 +1708,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; -#ifdef TCP_RFC7413 if (IS_FASTOPEN(tp->t_flags)) { if (to.to_flags & TOF_FASTOPEN) tcp_fastopen_update_cache(tp, to.to_mss, @@ -1725,7 +1715,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru else tcp_fastopen_disable_path(tp); } -#endif } /* @@ -1983,7 +1972,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } -#ifdef TCP_RFC7413 if (IS_FASTOPEN(tp->t_flags)) { /* * When a TFO connection is in SYN_RECEIVED, the @@ -2004,7 +1992,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru goto drop; } } -#endif break; /* @@ -2423,13 +2410,11 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru if ((thflags & TH_ACK) == 0) { if (tp->t_state == TCPS_SYN_RECEIVED || (tp->t_flags & TF_NEEDSYN)) { -#ifdef TCP_RFC7413 if (tp->t_state == TCPS_SYN_RECEIVED && IS_FASTOPEN(tp->t_flags)) { tp->snd_wnd = tiwin; cc_conn_init(tp); } -#endif goto step6; } else if (tp->t_flags & TF_ACKNOW) goto dropafterack; @@ -2470,8 +2455,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(accept__established, NULL, tp, m, tp, th); -#ifdef TCP_RFC7413 - if (tp->t_tfo_pending) { + if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) { tcp_fastopen_decrement_counter(tp->t_tfo_pending); tp->t_tfo_pending = NULL; @@ -2489,7 +2473,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru * is retransmitted. */ if (!IS_FASTOPEN(tp->t_flags)) -#endif cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } @@ -3055,12 +3038,8 @@ dodata: /* XXX */ * case PRU_RCVD). If a FIN has already been received on this * connection then we just ignore the text. */ -#ifdef TCP_RFC7413 tfo_syn = ((tp->t_state == TCPS_SYN_RECEIVED) && IS_FASTOPEN(tp->t_flags)); -#else -#define tfo_syn (false) -#endif if ((tlen || (thflags & TH_FIN) || tfo_syn) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { tcp_seq save_start = th->th_seq; @@ -3284,9 +3263,6 @@ drop: if (tp != NULL) INP_WUNLOCK(tp->t_inpcb); m_freem(m); -#ifndef TCP_RFC7413 -#undef tfo_syn -#endif } /* @@ -3440,7 +3416,6 @@ tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, to->to_sacks = cp + 2; TCPSTAT_INC(tcps_sack_rcv_blocks); break; -#ifdef TCP_RFC7413 case TCPOPT_FAST_OPEN: /* * Cookie length validation is performed by the @@ -3456,7 +3431,6 @@ tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, to->to_tfo_len = optlen - 2; to->to_tfo_cookie = to->to_tfo_len ? cp + 2 : NULL; break; -#endif default: continue; } Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/netinet/tcp_output.c Mon Feb 26 03:03:41 2018 (r330002) @@ -79,9 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef TCP_RFC7413 #include -#endif #ifdef TCPPCAP #include #endif @@ -212,10 +210,8 @@ tcp_output(struct tcpcb *tp) struct sackhole *p; int tso, mtu; struct tcpopt to; -#ifdef TCP_RFC7413 unsigned int wanted_cookie = 0; unsigned int dont_sendalot = 0; -#endif #if 0 int maxburst = TCP_MAXBURST; #endif @@ -233,7 +229,6 @@ tcp_output(struct tcpcb *tp) return (tcp_offload_output(tp)); #endif -#ifdef TCP_RFC7413 /* * For TFO connections in SYN_RECEIVED, only allow the initial * SYN|ACK and those sent by the retransmit timer. @@ -243,7 +238,7 @@ tcp_output(struct tcpcb *tp) SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN|ACK sent */ (tp->snd_nxt != tp->snd_una)) /* not a retransmit */ return (0); -#endif + /* * Determine length of data that should be transmitted, * and flags that will be used. @@ -429,7 +424,6 @@ after_sack_rexmit: if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) { if (tp->t_state != TCPS_SYN_RECEIVED) flags &= ~TH_SYN; -#ifdef TCP_RFC7413 /* * When sending additional segments following a TFO SYN|ACK, * do not include the SYN bit. @@ -437,7 +431,6 @@ after_sack_rexmit: if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED)) flags &= ~TH_SYN; -#endif off--, len++; } @@ -451,7 +444,6 @@ after_sack_rexmit: flags &= ~TH_FIN; } -#ifdef TCP_RFC7413 /* * On TFO sockets, ensure no data is sent in the following cases: * @@ -470,7 +462,6 @@ after_sack_rexmit: (tp->t_tfo_client_cookie_len == 0)) || (flags & TH_RST))) len = 0; -#endif if (len <= 0) { /* * If FIN has been sent but not acked, @@ -774,7 +765,7 @@ send: tp->snd_nxt = tp->iss; to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc); to.to_flags |= TOF_MSS; -#ifdef TCP_RFC7413 + /* * On SYN or SYN|ACK transmits on TFO connections, * only include the TFO option if it is not a @@ -807,7 +798,6 @@ send: dont_sendalot = 1; } } -#endif } /* Window scaling. */ if ((flags & TH_SYN) && (tp->t_flags & TF_REQ_SCALE)) { @@ -851,7 +841,6 @@ send: /* Processing the options. */ hdrlen += optlen = tcp_addoptions(&to, opt); -#ifdef TCP_RFC7413 /* * If we wanted a TFO option to be added, but it was unable * to fit, ensure no data is sent. @@ -859,7 +848,6 @@ send: if (IS_FASTOPEN(tp->t_flags) && wanted_cookie && !(to.to_flags & TOF_FASTOPEN)) len = 0; -#endif } /* @@ -1004,10 +992,8 @@ send: } else { len = tp->t_maxseg - optlen - ipoptlen; sendalot = 1; -#ifdef TCP_RFC7413 if (dont_sendalot) sendalot = 0; -#endif } } else tso = 0; @@ -1811,7 +1797,6 @@ tcp_addoptions(struct tcpopt *to, u_char *optp) TCPSTAT_INC(tcps_sack_send_blocks); break; } -#ifdef TCP_RFC7413 case TOF_FASTOPEN: { int total_len; @@ -1831,7 +1816,6 @@ tcp_addoptions(struct tcpopt *to, u_char *optp) optlen += total_len; break; } -#endif default: panic("%s: unknown TCP option type", __func__); break; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/netinet/tcp_subr.c Mon Feb 26 03:03:41 2018 (r330002) @@ -104,9 +104,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#ifdef TCP_RFC7413 #include -#endif #ifdef TCPPCAP #include #endif @@ -755,9 +753,7 @@ tcp_init(void) V_sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); -#ifdef TCP_RFC7413 tcp_fastopen_init(); -#endif /* Skip initialization of globals for non-default instances. */ if (!IS_DEFAULT_VNET(curvnet)) @@ -844,13 +840,11 @@ tcp_destroy(void *unused __unused) uma_zdestroy(V_sack_hole_zone); uma_zdestroy(V_tcpcb_zone); -#ifdef TCP_RFC7413 /* * Cannot free the zone until all tcpcbs are released as we attach * the allocations to them. */ tcp_fastopen_destroy(); -#endif #ifdef TCP_HHOOK error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_IN]); @@ -1647,7 +1641,6 @@ tcp_close(struct tcpcb *tp) if (tp->t_state == TCPS_LISTEN) tcp_offload_listen_stop(tp); #endif -#ifdef TCP_RFC7413 /* * This releases the TFO pending counter resource for TFO listen * sockets as well as passively-created TFO sockets that transition @@ -1657,7 +1650,6 @@ tcp_close(struct tcpcb *tp) tcp_fastopen_decrement_counter(tp->t_tfo_pending); tp->t_tfo_pending = NULL; } -#endif in_pcbdrop(inp); TCPSTAT_INC(tcps_closed); if (tp->t_state != TCPS_CLOSED) @@ -2407,10 +2399,8 @@ tcp_drop_syn_sent(struct inpcb *inp, int errno) if (tp->t_state != TCPS_SYN_SENT) return (inp); -#ifdef TCP_RFC7413 if (IS_FASTOPEN(tp->t_flags)) tcp_fastopen_disable_path(tp); -#endif tp = tcp_drop(tp, errno); if (tp != NULL) Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/netinet/tcp_syncache.c Mon Feb 26 03:03:41 2018 (r330002) @@ -83,9 +83,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#ifdef TCP_RFC7413 #include -#endif #include #include #include @@ -1176,7 +1174,6 @@ failed: return (0); } -#ifdef TCP_RFC7413 static void syncache_tfo_expand(struct syncache *sc, struct socket **lsop, struct mbuf *m, uint64_t response_cookie) @@ -1208,7 +1205,6 @@ syncache_tfo_expand(struct syncache *sc, struct socket TCPSTAT_INC(tcps_sc_completed); } } -#endif /* TCP_RFC7413 */ /* * Given a LISTEN socket and an inbound SYN request, add @@ -1251,12 +1247,10 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t #endif struct syncache scs; struct ucred *cred; -#ifdef TCP_RFC7413 uint64_t tfo_response_cookie; unsigned int *tfo_pending = NULL; int tfo_cookie_valid = 0; int tfo_response_cookie_valid = 0; -#endif INP_WLOCK_ASSERT(inp); /* listen socket */ KASSERT((th->th_flags & (TH_RST|TH_ACK|TH_SYN)) == TH_SYN, @@ -1281,7 +1275,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t win = so->sol_sbrcv_hiwat; ltflags = (tp->t_flags & (TF_NOOPT | TF_SIGNATURE)); -#ifdef TCP_RFC7413 if (V_tcp_fastopen_server_enable && IS_FASTOPEN(tp->t_flags) && (tp->t_tfo_pending != NULL) && (to->to_flags & TOF_FASTOPEN)) { @@ -1308,7 +1301,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t */ tfo_pending = tp->t_tfo_pending; } -#endif /* By the time we drop the lock these should no longer be used. */ so = NULL; @@ -1321,9 +1313,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t } else mac_syncache_create(maclabel, inp); #endif -#ifdef TCP_RFC7413 if (!tfo_cookie_valid) -#endif INP_WUNLOCK(inp); /* @@ -1369,10 +1359,8 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t sc = syncache_lookup(inc, &sch); /* returns locked entry */ SCH_LOCK_ASSERT(sch); if (sc != NULL) { -#ifdef TCP_RFC7413 if (tfo_cookie_valid) INP_WUNLOCK(inp); -#endif TCPSTAT_INC(tcps_sc_dupsyn); if (ipopts) { /* @@ -1415,13 +1403,11 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t goto done; } -#ifdef TCP_RFC7413 if (tfo_cookie_valid) { bzero(&scs, sizeof(scs)); sc = &scs; goto skip_alloc; } -#endif sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { @@ -1449,11 +1435,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t } } -#ifdef TCP_RFC7413 skip_alloc: if (!tfo_cookie_valid && tfo_response_cookie_valid) sc->sc_tfo_cookie = &tfo_response_cookie; -#endif /* * Fill in the syncache values. @@ -1562,14 +1546,12 @@ skip_alloc: #endif SCH_UNLOCK(sch); -#ifdef TCP_RFC7413 if (tfo_cookie_valid) { syncache_tfo_expand(sc, lsop, m, tfo_response_cookie); /* INP_WUNLOCK(inp) will be performed by the caller */ rv = 1; goto tfo_expanded; } -#endif /* * Do a standard 3-way handshake. @@ -1592,7 +1574,6 @@ done: *lsop = NULL; m_freem(m); } -#ifdef TCP_RFC7413 /* * If tfo_pending is not NULL here, then a TFO SYN that did not * result in a new socket was processed and the associated pending @@ -1603,7 +1584,6 @@ done: tcp_fastopen_decrement_counter(tfo_pending); tfo_expanded: -#endif if (cred != NULL) crfree(cred); #ifdef MAC @@ -1740,7 +1720,6 @@ syncache_respond(struct syncache *sc, struct syncache_ if (sc->sc_flags & SCF_SIGNATURE) to.to_flags |= TOF_SIGNATURE; #endif -#ifdef TCP_RFC7413 if (sc->sc_tfo_cookie) { to.to_flags |= TOF_FASTOPEN; to.to_tfo_len = TCP_FASTOPEN_COOKIE_LEN; @@ -1748,7 +1727,6 @@ syncache_respond(struct syncache *sc, struct syncache_ /* don't send cookie again when retransmitting response */ sc->sc_tfo_cookie = NULL; } -#endif optlen = tcp_addoptions(&to, (u_char *)(th + 1)); /* Adjust headers by option size. */ Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/netinet/tcp_syncache.h Mon Feb 26 03:03:41 2018 (r330002) @@ -75,9 +75,7 @@ struct syncache { #endif struct label *sc_label; /* MAC label reference */ struct ucred *sc_cred; /* cred cache for jail checks */ -#ifdef TCP_RFC7413 void *sc_tfo_cookie; /* for TCP Fast Open response */ -#endif void *sc_pspare; /* TCP_SIGNATURE */ u_int32_t sc_spare[2]; /* UTO */ }; Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/netinet/tcp_usrreq.c Mon Feb 26 03:03:41 2018 (r330002) @@ -92,9 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef TCP_RFC7413 #include -#endif #ifdef TCPPCAP #include #endif @@ -430,10 +428,9 @@ tcp_usr_listen(struct socket *so, int backlog, struct } SOCK_UNLOCK(so); -#ifdef TCP_RFC7413 if (IS_FASTOPEN(tp->t_flags)) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); -#endif + out: TCPDEBUG2(PRU_LISTEN); TCP_PROBE2(debug__user, tp, PRU_LISTEN); @@ -480,10 +477,9 @@ tcp6_usr_listen(struct socket *so, int backlog, struct } SOCK_UNLOCK(so); -#ifdef TCP_RFC7413 if (IS_FASTOPEN(tp->t_flags)) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); -#endif + out: TCPDEBUG2(PRU_LISTEN); TCP_PROBE2(debug__user, tp, PRU_LISTEN); @@ -848,7 +844,6 @@ tcp_usr_rcvd(struct socket *so, int flags) } tp = intotcpcb(inp); TCPDEBUG1(); -#ifdef TCP_RFC7413 /* * For passively-created TFO connections, don't attempt a window * update while still in SYN_RECEIVED as this may trigger an early @@ -859,7 +854,6 @@ tcp_usr_rcvd(struct socket *so, int flags) if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED)) goto out; -#endif #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) tcp_offload_rcvd(tp); @@ -950,12 +944,9 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf #endif if (error) goto out; -#ifdef TCP_RFC7413 if (IS_FASTOPEN(tp->t_flags)) tcp_fastopen_connect(tp); - else -#endif - { + else { tp->snd_wnd = TTCP_CLIENT_SND_WND; tcp_mss(tp, -1); } @@ -1004,13 +995,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf * initialize window to default value, and * initialize maxseg using peer's cached MSS. */ -#ifdef TCP_RFC7413 + /* * Not going to contemplate SYN|URG */ if (IS_FASTOPEN(tp->t_flags)) tp->t_flags &= ~TF_FASTOPEN; -#endif #ifdef INET6 if (isipv6) error = tcp6_connect(tp, nam, td); @@ -1782,7 +1772,6 @@ unlock_and_done: goto unlock_and_done; #endif -#ifdef TCP_RFC7413 case TCP_FASTOPEN: { struct tcp_fastopen tfo_optval; @@ -1829,7 +1818,6 @@ unlock_and_done: tp->t_flags &= ~TF_FASTOPEN; goto unlock_and_done; } -#endif default: INP_WUNLOCK(inp); @@ -1911,14 +1899,11 @@ unlock_and_done: error = sooptcopyout(sopt, &optval, sizeof optval); break; #endif - -#ifdef TCP_RFC7413 case TCP_FASTOPEN: optval = tp->t_flags & TF_FASTOPEN; INP_WUNLOCK(inp); error = sooptcopyout(sopt, &optval, sizeof optval); break; -#endif default: INP_WUNLOCK(inp); error = ENOPROTOOPT; Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Feb 26 02:53:22 2018 (r330001) +++ head/sys/netinet/tcp_var.h Mon Feb 26 03:03:41 2018 (r330002) @@ -191,14 +191,12 @@ struct tcpcb { u_int t_flags2; /* More tcpcb flags storage */ struct tcp_function_block *t_fb;/* TCP function call block */ void *t_fb_ptr; /* Pointer to t_fb specific data */ -#ifdef TCP_RFC7413 uint8_t t_tfo_client_cookie_len; /* TCP Fast Open client cookie length */ unsigned int *t_tfo_pending; /* TCP Fast Open server pending counter */ union { uint8_t client[TCP_FASTOPEN_MAX_COOKIE_LEN]; uint64_t server; } t_tfo_cookie; /* TCP Fast Open cookie to send */ -#endif #ifdef TCPPCAP struct mbufq t_inpkts; /* List of saved input packets. */ struct mbufq t_outpkts; /* List of saved output packets. */ From owner-svn-src-head@freebsd.org Mon Feb 26 03:05:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42422F22C76; Mon, 26 Feb 2018 03:05:37 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E72BC7E380; Mon, 26 Feb 2018 03:05:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E126115C80; Mon, 26 Feb 2018 03:05:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q35ami017498; Mon, 26 Feb 2018 03:05:36 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q35aeH017497; Mon, 26 Feb 2018 03:05:36 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802260305.w1Q35aeH017497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 26 Feb 2018 03:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330003 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 330003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 03:05:37 -0000 Author: jhibbits Date: Mon Feb 26 03:05:36 2018 New Revision: 330003 URL: https://svnweb.freebsd.org/changeset/base/330003 Log: Correct a copy&paste-o -- altivec assist interrupt, not watchdog Modified: head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Mon Feb 26 03:03:41 2018 (r330002) +++ head/sys/powerpc/booke/trap_subr.S Mon Feb 26 03:05:36 2018 (r330003) @@ -638,7 +638,7 @@ INTERRUPT(int_vec) /***************************************************************************** - * Watchdog interrupt + * Altivec Assist interrupt ****************************************************************************/ INTERRUPT(int_vecast) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) From owner-svn-src-head@freebsd.org Mon Feb 26 03:16:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FF25F23701; Mon, 26 Feb 2018 03:16:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1EB37E93D; Mon, 26 Feb 2018 03:16:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD5E15E30; Mon, 26 Feb 2018 03:16:05 +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 w1Q3G5xE022322; Mon, 26 Feb 2018 03:16:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q3G4vc022314; Mon, 26 Feb 2018 03:16:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802260316.w1Q3G4vc022314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 26 Feb 2018 03:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . arm efi forth i386 mips powerpc sparc64 X-SVN-Commit-Revision: 330004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 03:16:06 -0000 Author: imp Date: Mon Feb 26 03:16:04 2018 New Revision: 330004 URL: https://svnweb.freebsd.org/changeset/base/330004 Log: Add NO_OBJ to those directories that don't make anything. For directories that don't many anything, add NO_OBJ=t just before we include bsd.init.mk. This prevents them from creating an OBJ directory. In addition, prevent defs.mk from creating the machine related links in these cases. They aren't needed and break, at least on stable, the read-only src tree build. Modified: head/stand/arm/Makefile head/stand/defs.mk head/stand/efi/Makefile head/stand/forth/Makefile head/stand/i386/Makefile head/stand/mips/Makefile head/stand/powerpc/Makefile head/stand/sparc64/Makefile Modified: head/stand/arm/Makefile ============================================================================== --- head/stand/arm/Makefile Mon Feb 26 03:05:36 2018 (r330003) +++ head/stand/arm/Makefile Mon Feb 26 03:16:04 2018 (r330004) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + SUBDIR= uboot .include Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Mon Feb 26 03:05:36 2018 (r330003) +++ head/stand/defs.mk Mon Feb 26 03:16:04 2018 (r330004) @@ -163,6 +163,7 @@ CLEANFILES+=${_ILINKS} all: ${PROG} +.if !defined(NO_OBJ) beforedepend: ${_ILINKS} beforebuild: ${_ILINKS} @@ -190,5 +191,5 @@ ${_ILINKS}: path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} - +.endif .endif # __BOOT_DEFS_MK__ Modified: head/stand/efi/Makefile ============================================================================== --- head/stand/efi/Makefile Mon Feb 26 03:05:36 2018 (r330003) +++ head/stand/efi/Makefile Mon Feb 26 03:16:04 2018 (r330004) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer Modified: head/stand/forth/Makefile ============================================================================== --- head/stand/forth/Makefile Mon Feb 26 03:05:36 2018 (r330003) +++ head/stand/forth/Makefile Mon Feb 26 03:16:04 2018 (r330004) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include MAN+= beastie.4th.8 \ Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Mon Feb 26 03:05:36 2018 (r330003) +++ head/stand/i386/Makefile Mon Feb 26 03:16:04 2018 (r330004) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ Modified: head/stand/mips/Makefile ============================================================================== --- head/stand/mips/Makefile Mon Feb 26 03:05:36 2018 (r330003) +++ head/stand/mips/Makefile Mon Feb 26 03:16:04 2018 (r330004) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + SUBDIR= uboot # Modified: head/stand/powerpc/Makefile ============================================================================== --- head/stand/powerpc/Makefile Mon Feb 26 03:05:36 2018 (r330003) +++ head/stand/powerpc/Makefile Mon Feb 26 03:16:04 2018 (r330004) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= boot1.chrp ofw uboot Modified: head/stand/sparc64/Makefile ============================================================================== --- head/stand/sparc64/Makefile Mon Feb 26 03:05:36 2018 (r330003) +++ head/stand/sparc64/Makefile Mon Feb 26 03:16:04 2018 (r330004) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= boot1 loader From owner-svn-src-head@freebsd.org Mon Feb 26 03:16:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CE74F237C3; Mon, 26 Feb 2018 03:16:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6C417EA5E; Mon, 26 Feb 2018 03:16:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C197E15E32; Mon, 26 Feb 2018 03:16:48 +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 w1Q3GmPr022400; Mon, 26 Feb 2018 03:16:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q3Gmnn022395; Mon, 26 Feb 2018 03:16:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802260316.w1Q3Gmnn022395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 26 Feb 2018 03:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330005 - in head/stand: . arm/loader defaults forth mips/uboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . arm/loader defaults forth mips/uboot X-SVN-Commit-Revision: 330005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 03:16:49 -0000 Author: imp Date: Mon Feb 26 03:16:47 2018 New Revision: 330005 URL: https://svnweb.freebsd.org/changeset/base/330005 Log: Go back to one loader.conf We really only need one loader.conf. The other loader.conf was created because the current one took forever to parse in FORTH. That will be fixed in the next commit. Added: head/stand/defaults/ head/stand/defaults/Makefile (contents, props changed) head/stand/defaults/loader.conf (contents, props changed) - copied, changed from r330004, head/stand/forth/loader.conf head/stand/defaults/loader.conf.5 (contents, props changed) - copied, changed from r330004, head/stand/forth/loader.conf.5 Deleted: head/stand/arm/loader/loader.conf head/stand/forth/loader.conf head/stand/forth/loader.conf.5 head/stand/mips/uboot/loader.conf Modified: head/stand/Makefile head/stand/forth/Makefile Modified: head/stand/Makefile ============================================================================== --- head/stand/Makefile Mon Feb 26 03:16:04 2018 (r330004) +++ head/stand/Makefile Mon Feb 26 03:16:47 2018 (r330005) @@ -13,6 +13,7 @@ SUBDIR+= liblua SUBDIR+= lua .endif +SUBDIR+= defaults SUBDIR+= man .include Added: head/stand/defaults/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/defaults/Makefile Mon Feb 26 03:16:47 2018 (r330005) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +NO_OBJ=t + +.include + +FILES+= loader.conf +FILES+= loader.conf.5 + +FILESDIR_loader.conf= /boot/defaults + +.include Copied and modified: head/stand/defaults/loader.conf (from r330004, head/stand/forth/loader.conf) ============================================================================== Copied and modified: head/stand/defaults/loader.conf.5 (from r330004, head/stand/forth/loader.conf.5) ============================================================================== Modified: head/stand/forth/Makefile ============================================================================== --- head/stand/forth/Makefile Mon Feb 26 03:16:04 2018 (r330004) +++ head/stand/forth/Makefile Mon Feb 26 03:16:47 2018 (r330005) @@ -9,7 +9,6 @@ MAN+= beastie.4th.8 \ check-password.4th.8 \ color.4th.8 \ delay.4th.8 \ - loader.conf.5 \ loader.4th.8 \ menu.4th.8 \ menusets.4th.8 \ @@ -35,10 +34,9 @@ FILES+= screen.4th FILES+= shortcuts.4th FILES+= support.4th FILES+= version.4th -FILESDIR_loader.conf= /boot/defaults # Allow machine specific loader.rc to be installed. -.for f in loader.rc menu.rc loader.conf +.for f in loader.rc menu.rc .if exists(${BOOTSRC}/${MACHINE:C/amd64/i386/}/loader/${f}) FILES+= ${BOOTSRC}/${MACHINE:C/amd64/i386/}/loader/${f} .else From owner-svn-src-head@freebsd.org Mon Feb 26 03:16:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E431F23809; Mon, 26 Feb 2018 03:16:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A32207EA9D; Mon, 26 Feb 2018 03:16:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72C0C15E33; Mon, 26 Feb 2018 03:16: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 w1Q3GrVb022454; Mon, 26 Feb 2018 03:16:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q3GrRh022453; Mon, 26 Feb 2018 03:16:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802260316.w1Q3GrRh022453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 26 Feb 2018 03:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330006 - head/stand/defaults X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/defaults X-SVN-Commit-Revision: 330006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 03:16:55 -0000 Author: imp Date: Mon Feb 26 03:16:53 2018 New Revision: 330006 URL: https://svnweb.freebsd.org/changeset/base/330006 Log: Take a meat cleaver to defaults/loader.conf Remove almost all of the _load=XXX options (kept only those relevant to splash screens, since there were other settings). Remove the excessively cutesy comment blocks. Remove excessive comments and replace with similar content Remove gratuitous blank lines (while leaving some) We have too many modules to list them all here. There's no purpose in doing so and it's a giant hassle to maintain. In addition the extra ~500 lines slow this down on small platforms. It slowed it down so much small platforms forked, which caused other issues... This is a compromise between those two extremes. Modified: head/stand/defaults/loader.conf Modified: head/stand/defaults/loader.conf ============================================================================== --- head/stand/defaults/loader.conf Mon Feb 26 03:16:47 2018 (r330005) +++ head/stand/defaults/loader.conf Mon Feb 26 03:16:53 2018 (r330006) @@ -8,27 +8,18 @@ # # $FreeBSD$ -############################################################## ### Basic configuration options ############################ -############################################################## - exec="echo Loading /boot/defaults/loader.conf" kernel="kernel" # /boot sub-directory containing kernel and modules bootfile="kernel" # Kernel name (possibly absolute path) kernel_options="" # Flags to be passed to the kernel - loader_conf_files="/boot/device.hints /boot/loader.conf /boot/loader.conf.local" nextboot_conf="/boot/nextboot.conf" nextboot_enable="NO" - verbose_loading="NO" # Set to YES for verbose loader output - -############################################################## ### Splash screen configuration ############################ -############################################################## - splash_bmp_load="NO" # Set this to YES for bmp splash screen! splash_pcx_load="NO" # Set this to YES for pcx splash screen! splash_txt_load="NO" # Set this to YES for TheDraw splash screen! @@ -37,14 +28,14 @@ bitmap_load="NO" # Set this to YES if you want splash bitmap_name="splash.bmp" # Set this to the name of the file bitmap_type="splash_image_data" # and place it on the module_path +### Screen saver modules ################################### +# This is best done in rc.conf +screensave_load="NO" # Set to YES to load a screensaver module +screensave_name="green_saver" # Set to the name of the screensaver module -############################################################## ### Random number generator configuration ################## -############################################################## - # See rc.conf(5). The entropy_boot_file config variable must agree with the # settings below. - entropy_cache_load="YES" # Set this to NO to disable loading # entropy at boot time entropy_cache_name="/boot/entropy" # Set this to the name of the file @@ -53,11 +44,7 @@ entropy_cache_type="boot_entropy_cache" # Required for # must not change value even if the # _name above does change! - -############################################################## ### RAM Blacklist configuration ############################ -############################################################## - ram_blacklist_load="NO" # Set this to YES to load a file # containing a list of addresses to # exclude from the running system. @@ -65,28 +52,24 @@ ram_blacklist_name="/boot/blacklist.txt" # Set this to ram_blacklist_type="ram_blacklist" # Required for the kernel to find # the blacklist module +### ACPI settings ########################################## +acpi_dsdt_load="NO" # DSDT Overriding +acpi_dsdt_type="acpi_dsdt" # Don't change this +acpi_dsdt_name="/boot/acpi_dsdt.aml" + # Override DSDT in BIOS by this file +acpi_video_load="NO" # Load the ACPI video extension driver -############################################################## ### Initial memory disk settings ########################### -############################################################## - #mdroot_load="YES" # The "mdroot" prefix is arbitrary. #mdroot_type="md_image" # Create md(4) disk at boot. #mdroot_name="/boot/root.img" # Path to a file containing the image. #rootdev="ufs:/dev/md0" # Set the root filesystem to md(4) device. - -############################################################## ### Loader settings ######################################## -############################################################## - #loader_delay="3" # Delay in seconds before loading anything. # Default is unset and disabled (no delay). #autoboot_delay="10" # Delay in seconds before autobooting, - # set to -1 if you don't want user to be - # allowed to interrupt autoboot process and - # escape to the loader prompt, set to - # "NO" to disable autobooting + # -1 for now user interrupts, NO to disable #password="" # Prevent changes to boot options #bootlock_password="" # Prevent booting (see check-password.4th(8)) #geom_eli_passphrase_prompt="NO" # Prompt for geli(8) passphrase to mount root @@ -104,20 +87,13 @@ module_path="/boot/modules;/boot/dtb;/boot/overlays" # #dumpdev="disk1s1b" # Set a dump device early in the boot process #tftp.blksize="1428" # Set the RFC 2348 TFTP block size. # If the TFTP server does not support RFC 2348, - # the block size is set to 512. If the value - # is out of range ( < 8 || > 9008 ) an error is - # returned. + # the block size is set to 512. Valid: (8,9007) #twiddle_divisor="1" # >1 means slow down the progress indicator. - -############################################################## ### Kernel settings ######################################## -############################################################## - # The following boot_ variables are enabled by setting them to any value. # Their presence in the kernel environment (see kenv(1)) has the same # effect as setting the given boot flag (see boot(8)). - #boot_askname="" # -a: Prompt the user for the name of the root device #boot_cdrom="" # -C: Attempt to mount root file system from CD-ROM #boot_ddb="" # -d: Instructs the kernel to start in the DDB debugger @@ -135,11 +111,7 @@ module_path="/boot/modules;/boot/dtb;/boot/overlays" # #init_script="" # Initial script to run by init(8) before chrooting. #init_chroot="" # Directory for init(8) to chroot into. - -############################################################## ### Kernel tunables ######################################## -############################################################## - #hw.physmem="1G" # Limit physical memory. See loader(8) #kern.dfldsiz="" # Set the initial data size limit #kern.dflssiz="" # Set the initial stack size limit @@ -164,401 +136,14 @@ module_path="/boot/modules;/boot/dtb;/boot/overlays" # #kern.ipc.nmbclusters="" # Set the number of mbuf clusters #kern.ipc.nsfbufs="" # Set the number of sendfile(2) bufs #net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE -#vfs.root.mountfrom="" # Specify root partition in a way the - # kernel understands +#vfs.root.mountfrom="" # Specify root partition #vm.kmem_size="" # Sets the size of kernel memory (bytes) #debug.kdb.break_to_debugger="0" # Allow console to break into debugger. #debug.ktr.cpumask="0xf" # Bitmask of CPUs to enable KTR on #debug.ktr.mask="0x1200" # Bitmask of KTR events to enable #debug.ktr.verbose="1" # Enable console dump of KTR events -#net.graph.maxalloc="128" # Maximum number of queue items to allocate - -############################################################## -### ATA modules ############################################ -############################################################## - -ataacard_load="NO" # ACARD -ataacerlabs_load="NO" # Acer Labs Inc. (ALI) -ataamd_load="NO" # American Micro Devices (AMD) -ataati_load="NO" # ATI -atacenatek_load="NO" # Cenatek -atacypress_load="NO" # Cypress -atacyrix_load="NO" # Cyrix -atahighpoint_load="NO" # HighPoint -ataintel_load="NO" # Intel -ataite_load="NO" # Integrated Technology Inc. (ITE) -atajmicron_load="NO" # JMicron -atamarvell_load="NO" # Marvell -atamicron_load="NO" # Micron -atanational_load="NO" # National -atanetcell_load="NO" # NetCell -atanvidia_load="NO" # nVidia -atapromise_load="NO" # Promise -ataserverworks_load="NO" # ServerWorks -atasiliconimage_load="NO" # Silicon Image Inc. (SiI) (formerly CMD) -atasis_load="NO" # Silicon Integrated Systems Corp.(SiS) -atavia_load="NO" # VIA Technologies Inc. - - -############################################################## -### Filesystem and related modules ######################### -############################################################## - -# Filesystems - -cd9660_load="NO" # ISO 9660 filesystem -fdescfs_load="NO" # Filedescriptors filesystem -linprocfs_load="NO" # Linux compatibility process filesystem -linsysfs_load="NO" # Linux compatibility system filesystem -msdosfs_load="NO" # FAT-12/16/32 -nfsclient_load="NO" # NFS client -nfsserver_load="NO" # NFS server -nullfs_load="NO" # Null filesystem -procfs_load="NO" # Process filesystem -unionfs_load="NO" # Union filesystem -zfs_load="NO" # ZFS - -# Related stuff - -geom_bde_load="NO" # Disk encryption driver (see gbde(4,8)) -geom_ccd_load="NO" # Concatenated disk driver (see ccd(4), - # ccdconfig(8)) -geom_concat_load="NO" # Concatenated disk driver (see gconcat(8)) -geom_eli_load="NO" # Disk encryption driver (see geli(8)) -geom_gate_load="NO" # Userland disk driver (see geom_gate(4), - # ggatec(8), ggated(8), ggatel(8)) -geom_journal_load="NO" # Journaled filesystem driver (see gjournal(8)) -geom_label_load="NO" # File system labels (see glabel(8)) -geom_md_load="NO" # Memory disk driver (vnode/swap/malloc) (see - # md(4), mdconfig(8)) -geom_mirror_load="NO" # RAID1 disk driver (see gmirror(8)) -geom_mountver_load="NO" # Mount verification disk driver -geom_nop_load="NO" # Transparent disk driver (see gnop(8)) -geom_raid3_load="NO" # RAID3 disk driver (see graid3(8)) -geom_shsec_load="NO" # Shared secret disk driver (see gshsec(8)) -geom_stripe_load="NO" # RAID0 disk driver (see gstripe(8)) -geom_uzip_load="NO" # Compressed disk images driver (see mkuzip(8)) -geom_vinum_load="NO" # Concatenated/mirror/raid driver (see vinum(4)) - - -############################################################## -### FireWire modules ####################################### -############################################################## - -firewire_load="NO" # IEEE1394 High-performance Serial Bus -fwe_load="NO" # Ethernet emulation driver for FireWire -fwip_load="NO" # IP over FireWire driver -fwohci_load="NO" # OHCI FireWire chipset device driver -sbp_load="NO" # SBP-2 Mass Storage Devices driver -sbp_targ_load="NO" # SBP-2 Target mode - - -############################################################## -### Screen saver modules ################################### -############################################################## - -# This is best done in rc.conf - -screensave_load="NO" # Set to YES to load a screensaver module -screensave_name="green_saver" # Set to the name of the screensaver module - - -############################################################## -### Emulation modules ###################################### -############################################################## - -cloudabi_load="NO" # Platform independent CloudABI support -cloudabi64_load="NO" # 64-bit CloudABI executables support -ibcs2_load="NO" # IBCS2 (SCO) emulation -ibcs2_coff_load="NO" -linux_load="NO" # Linux emulation - - -############################################################## -### Networking modules ##################################### -############################################################## - -if_disc_load="NO" # Discard device -if_ef_load="NO" # pseudo-device providing support for multiple - # ethernet frame types -if_epair_load="NO" # Virtual b-t-b Ethernet-like interface pair -if_gif_load="NO" # generic tunnel interface -if_gre_load="NO" # encapsulating network device -if_stf_load="NO" # 6to4 tunnel interface -if_tap_load="NO" # Ethernet tunnel software network interface -if_tun_load="NO" # Tunnel driver (user process ppp) -if_vlan_load="NO" # IEEE 802.1Q VLAN network interface -ipfw_load="NO" # Firewall -pf_load="NO" # packet filter - - -############################################################## -### Networking drivers ##################################### -############################################################## - -bridgestp_load="NO" # if_bridge(4) support -miibus_load="NO" # miibus support, needed for some drivers -carp_load="NO" # carp(4) protocol -if_ae_load="NO" # Attansic/Atheros L2 FastEthernet -if_age_load="NO" # Attansic/Atheros L1 Gigabit Ethernet -if_alc_load="NO" # Atheros AR8131/AR8132 Ethernet -if_ale_load="NO" # Atheros AR8121/AR8113/AR8114 Ethernet -if_an_load="NO" # Aironet 4500/4800 802.11 wireless NICs -if_ath_load="NO" # Atheros IEEE 802.11 wireless NICs -if_aue_load="NO" # ADMtek AN986 Pegasus USB Ethernet -if_axe_load="NO" # ASIX Electronics AX88172 USB Ethernet -if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet -if_bfe_load="NO" # Broadcom BCM4401 -if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet -if_bnxt_load="NO" # Broadcom NetXtreme-C/NetXtreme-E -if_bridge_load="NO" # if_bridge(4) devices -if_bwi_load="NO" # Broadcom BCM53xx IEEE 802.11b/g wireness NICs -if_bwn_load="NO" # Broadcom BCM43xx IEEE 802.11 wireless NICs -if_bxe_load="NO" # Broadcom NetXtreme II 10Gb Ethernet -if_cas_load="NO" # Sun Cassini/Cassini+ and NS DP83065 Saturn -if_cm_load="NO" # SMC (90c26, 90c56, 90c66) -if_cs_load="NO" # Crystal Semiconductor CS8920 -if_cue_load="NO" # CATC USB-EL1210A USB Ethernet -if_cxgb_load="NO" # Chelsio T3 10 Gigabit Ethernet -if_cxgbe_load="NO" # Chelsio T4/T5/T6 1/10/25/40/100 Gigabit Ethernet -if_dc_load="NO" # DEC/Intel 21143 and various workalikes -if_de_load="NO" # DEC DC21x4x Ethernet -if_ed_load="NO" # National Semiconductor DS8390/WD83C690 - # Ethernet -if_em_load="NO" # Intel(R) PRO/1000 Gigabit Ethernet -if_ep_load="NO" # 3Com Etherlink III (3c5x9) -if_et_load="NO" # Agere ET1310 10/100/Gigabit Ethernet -if_ex_load="NO" # Intel EtherExpress Pro/10 Ethernet -if_fe_load="NO" # Fujitsu MB86960A/MB86965A based Ethernet - # adapters -if_fxp_load="NO" # Intel EtherExpress PRO/100B (82557, 82558) -if_gem_load="NO" # Sun GEM/Sun ERI/Apple GMAC -if_hme_load="NO" # Sun Microelectronics STP2002-STQ Ethernet -if_ie_load="NO" # Intel 82586 -if_ipw_load="NO" # Intel PRO/Wireless 2100 wireless -if_iwi_load="NO" # Intel PRO/Wireless 2200BG/2225BG/2915ABG - # wireless -if_iwn_load="NO" # Intel Wireless WiFi Link 802.11n wireless -if_ixgb_load="NO" # Intel PRO/10Gb Ethernet -if_ixgbe_load="NO" # Intel PRO/10Gb Ethernet PCI Express -if_ixl_load="NO" # Intel XL710 Ethernet 40Gb Base driver -if_ixlv_load="NO" # Intel XL710 Ethernet 40Gb VF driver -if_jme_load="NO" # JMicron JMC250 Gigabit/JMC260 Fast Ethernet -if_lagg_load="NO" # lagg(4) devices -if_le_load="NO" # AMD Am7900 LANCE and Am79C9xx PCnet -if_lge_load="NO" # Level 1 LXT1001 NetCellerator PCI Gigabit - # Ethernet -if_malo_load="NO" # Marvell Libertas 88W8335 802.11 wireless - # adapter -if_msk_load="NO" # Marvell/SysKonnect Yukon II Gigabit Ethernet -if_mxge_load="NO" # Myricom Myri10GE 10Gb Ethernet -if_my_load="NO" # Myson PCI Fast Ethernet -if_nfe_load="NO" # NVIDIA nForce MCP Networking Adapter -if_nge_load="NO" # National Semiconductor PCI Gigabit Ethernet -if_nxge_load="NO" # Neterion Xframe 10Gb Ethernet -if_pcn_load="NO" # AMD PCnet PCI -if_ral_load="NO" # Ralink Technology wireless -if_re_load="NO" # RealTek 8139C+/8169/8169S/8110S -if_rl_load="NO" # RealTek 8129/8139 -if_rue_load="NO" # RealTek RTL8150 USB to Fast Ethernet -if_rum_load="NO" # Ralink Technology USB 802.11a/b/g wireless -if_run_load="NO" # Ralink Technology USB 802.11a/g/n wireless -if_sbni_load="NO" # Granch SBNI12 leased line adapters -if_sf_load="NO" # Adaptec Duralink PCI (AIC-6915 "starfire") -if_sge_load="NO" # Silicon Integrated Systems SiS 190/191 -if_sis_load="NO" # Silicon Integrated Systems SiS 900/7016 -if_sk_load="NO" # SysKonnect SK-984x series PCI Gigabit Ethernet -if_sn_load="NO" # SMC 91Cxx -if_ste_load="NO" # Sundance Technologies ST201 Fast Ethernet -if_stge_load="NO" # Sundance/Tamarack TC9021 Gigabit Ethernet -if_ti_load="NO" # Alteon Networks Tigon 1 and Tigon 2 -if_tl_load="NO" # Texas Instruments TNETE100 ("ThunderLAN") -if_tx_load="NO" # SMC 83c17x Fast Ethernet -if_txp_load="NO" # 3Com 3XP Typhoon/Sidewinder (3CR990) -if_vge_load="NO" # VIA VT6122 PCI Gigabit Ethernet -if_vte_load="NO" # DM&P Vortex86 RDC R6040 Fast Ethernet -if_uath_load="NO" # Atheros USB wireless for AR5005UG & AR5005UX -if_udav_load="NO" # Davicom DM9601 USB Ethernet -if_upgt_load="NO" # Conexant/Intersil PrismGT USB wireless -if_ural_load="NO" # Ralink Technology USB wireless -if_urtw_load="NO" # Realtek 8187L USB wireless -if_vr_load="NO" # VIA Rhine I and Rhine II -if_vx_load="NO" # 3Com 3C590 family -if_wb_load="NO" # Winbond W89C840F -if_wi_load="NO" # WaveLAN/IEEE 802.11 wireless NICs -if_wpi_load="NO" # Intel 3945ABG Wireless LAN IEEE 802.11 -if_xe_load="NO" # Xircom CreditCard PCMCIA -if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B) -sfxge_load="NO" # Solarflare 10Gb Ethernet adapter driver - - -############################################################## -### Netgraph modules ####################################### -############################################################## - -ng_UI_load="NO" # UI netgraph node type -ng_async_load="NO" # asynchronous framing netgraph node type -ng_bpf_load="NO" # Berkeley packet filter netgraph node type -ng_bridge_load="NO" # Ethernet bridging netgraph node type -ng_cisco_load="NO" # Cisco HDLC protocol netgraph node type -ng_echo_load="NO" # Netgraph echo node type -ng_eiface_load="NO" # generic Ethernet interface netgraph node type -ng_etf_load="NO" # Ethertype filtering netgraph node type -ng_ether_load="NO" # Ethernet netgraph node type -ng_frame_relay_load="NO" # frame relay netgraph node type -ng_gif_load="NO" # generic tunnel interface netgraph node type -ng_gif_demux_load="NO" # demultiplexer for packets from ng_gif(4) nodes -ng_hole_load="NO" # Netgraph discard node type -ng_hub_load="NO" # packet distribution netgraph node type -ng_iface_load="NO" # interface Netgraph node type -ng_ip_input_load="NO" # netgraph IP input node type -ng_ksocket_load="NO" # kernel socket netgraph node type -ng_l2tp_load="NO" # L2TP protocol netgraph node type -ng_lmi_load="NO" # frame relay LMI protocol netgraph node type -ng_mppc_load="NO" # Microsoft MPPC/MPPE compression and - # encryption netgraph node type -ng_netflow_load="NO" # Cisco's NetFlow netgraph node type -ng_one2many_load="NO" # packet multiplexing netgraph node type -ng_ppp_load="NO" # PPP protocol netgraph node type -ng_pppoe_load="NO" # RFC 2516 PPPOE protocol netgraph node type -ng_pptpgre_load="NO" # PPTP GRE protocol netgraph node type -ng_rfc1490_load="NO" # RFC 1490 netgraph node type -ng_socket_load="NO" # Netgraph socket node type -ng_split_load="NO" # netgraph node to separate incoming and - # outgoing flows -ng_sppp_load="NO" # sppp netgraph node type -ng_tee_load="NO" # Netgraph ``tee'' node type -ng_tty_load="NO" # Netgraph node type that is also a line - # discipline -ng_vjc_load="NO" # Van Jacobsen compression netgraph node type -ng_vlan_load="NO" # IEEE 802.1Q VLAN tagging netgraph node type - - -############################################################## -### Sound modules ########################################## -############################################################## - -sound_load="NO" # Digital sound subsystem -snd_ad1816_load="NO" # ad1816 -snd_als4000_load="NO" # als4000 -snd_atiixp_load="NO" # atiixp -snd_cmi_load="NO" # cmi -snd_cs4281_load="NO" # cs4281 -snd_csa_load="NO" # csa -snd_ds1_load="NO" # ds1 -snd_emu10k1_load="NO" # Creative Sound Blaster Live -snd_emu10kx_load="NO" # Creative SoundBlaster Live! and Audigy -snd_envy24_load="NO" # VIA Envy24 -snd_envy24ht_load="NO" # VIA Envy24HT -snd_es137x_load="NO" # es137x -snd_ess_load="NO" # ess -snd_fm801_load="NO" # fm801 -snd_hda_load="NO" # Intel High Definition Audio (Controller) -snd_ich_load="NO" # Intel ICH -snd_maestro_load="NO" # Maestro -snd_maestro3_load="NO" # Maestro3 -snd_mss_load="NO" # Mss -snd_neomagic_load="NO" # Neomagic -snd_sb16_load="NO" # Sound Blaster 16 -snd_sb8_load="NO" # Sound Blaster Pro -snd_sbc_load="NO" # Sbc -snd_solo_load="NO" # Solo -snd_spicds_load="NO" # SPI codecs -snd_t4dwave_load="NO" # t4dwave -snd_via8233_load="NO" # via8233 -snd_via82c686_load="NO" # via82c686 -snd_vibes_load="NO" # vibes -snd_driver_load="NO" # All sound drivers - - -############################################################## -### USB modules ############################################ -############################################################## - -usb_load="NO" # USB subsystem -udbp_load="NO" # USB double bulk pipe host 2 host cables -ugen_load="NO" # USB generic device, if all else fails ... -ucycom_load="NO" # Cyprus USB serial adapters -ufm_load="NO" # Fm Radio -uhid_load="NO" # Human Interface Devices -ukbd_load="NO" # Keyboard -ulpt_load="NO" # Printer -ums_load="NO" # Mouse -umass_load="NO" # Mass Storage Devices -umct_load="NO" # Magic Control Technology USB-RS232 -umodem_load="NO" # Modems -uplcom_load="NO" # Prolific USB serial adapters -urio_load="NO" # Rio MP3 players -uvisor_load="NO" # PalmOS based PDAs -if_aue_load="NO" # ADMtek USB ethernet -if_axe_load="NO" # ASIX Electronics AX88172 USB ethernet -if_cdce_load="NO" # Ethernet over USB (CDC) -if_cue_load="NO" # CATC USB ethernet -if_kue_load="NO" # Kawasaki LSI USB ethernet -if_rae_load="NO" # Realtek RTL8150 USB adapter. -if_rum_load="NO" # Ralink USB 802.11 wireless adapter -if_uath_load="NO" # Atheros AR5523 wireless adapter -if_run_load="NO" # Ralink USB 802.11 wireless adapter -if_ural_load="NO" # Ralink RT2500USB 802.11 wireless adapter -if_zyd_load="NO" # ZyDAS ZD1211(B) USB 802.11 wireless adapter -snd_uaudio_load="NO" # USB audio - - -############################################################## -### Other modules ########################################## -############################################################## - -aio_load="NO" # Asynchronous I/O -bktr_load="NO" # Brooktree Bt848/Bt878 TV/Video Capture Card -ispfw_load="NO" # Qlogic ISP Firmware -agp_load="NO" # agp module -accf_data_load="NO" # Wait for data accept filter -accf_dns_load="NO" # Wait for full DNS request accept filter -accf_http_load="NO" # Wait for full HTTP request accept filter -ppi_load="NO" # Interface to ppbus parallel 'geek' port -pps_load="NO" # Pulse per second devices -puc_load="NO" # PCI "Universal" Communications driver -random_load="NO" # Random device -speaker_load="NO" # AT speaker module -coretemp_load="NO" # Intel Core CPU temperature monitor -vkbd_load="NO" # Virtual AT keyboard interface -vpd_load="NO" # Vital Product Data kernel interface -vpo_load="NO" # Parallel to SCSI interface driver -amdsmn_load="NO" # AMD Family 17h System Management Network -amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor -tpm_load="NO" # Trusted Platform Module -wbwd_load="NO" # Winbond watchdog - - -############################################################## -### ACPI settings ########################################## -############################################################## - -acpi_dsdt_load="NO" # DSDT Overriding -acpi_dsdt_type="acpi_dsdt" # Don't change this -acpi_dsdt_name="/boot/acpi_dsdt.aml" - # Override DSDT in BIOS by this file -acpi_video_load="NO" # Load the ACPI video extension driver - - -############################################################## -### TrustedBSD MAC settings ################################ -############################################################## - -mac_biba_load="NO" # Biba MAC policy -mac_bsdextended_load="NO" # BSD/extended MAC policy -mac_ifoff="NO" # Interface silencing policy -mac_mls_load="NO" # MLS MAC policy -mac_none_load="NO" # Null MAC policy -mac_partition_load="NO" # Partition MAC policy -mac_seeotheruids_load="NO" # UID visbility MAC policy - - -############################################################## ### Module loading syntax example ########################## -############################################################## - #module_load="YES" # loads module "module" #module_name="realname" # uses "realname" instead of "module" #module_type="type" # passes "-t type" to load From owner-svn-src-head@freebsd.org Mon Feb 26 03:16:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E4F9F23830; Mon, 26 Feb 2018 03:16:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B7177EB50; Mon, 26 Feb 2018 03:16:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35A9415E34; Mon, 26 Feb 2018 03:16:58 +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 w1Q3Gvav022506; Mon, 26 Feb 2018 03:16:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q3GvfY022505; Mon, 26 Feb 2018 03:16:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802260316.w1Q3GvfY022505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 26 Feb 2018 03:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330007 - head/stand/defaults X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/defaults X-SVN-Commit-Revision: 330007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 03:16:58 -0000 Author: imp Date: Mon Feb 26 03:16:57 2018 New Revision: 330007 URL: https://svnweb.freebsd.org/changeset/base/330007 Log: loader.conf is loader agnostic, so remove 4th references. Modified: head/stand/defaults/loader.conf.5 Modified: head/stand/defaults/loader.conf.5 ============================================================================== --- head/stand/defaults/loader.conf.5 Mon Feb 26 03:16:53 2018 (r330006) +++ head/stand/defaults/loader.conf.5 Mon Feb 26 03:16:57 2018 (r330007) @@ -39,18 +39,6 @@ it, and additional modules to be loaded; and generally described in .Xr loader 8 . .Pp -The file -.Pa /boot/loader.rc -must contain the following two lines for -.Nm -to be automatically processed: -.Pp -.Dl include /boot/loader.4th -.Dl start -.Pp -If no -.Pa /boot/loader.rc -exists at installworld time, one with the above lines will be installed. .Sh SYNTAX Though .Nm Ns 's @@ -294,16 +282,10 @@ boot-time entropy cache file. .Bl -tag -width /boot/defaults/loader.conf -compact .It Pa /boot/defaults/loader.conf default settings -- do not change this file. -.It Pa /boot/loader.4th -defines the commands used by loader to read and process -.Nm . .It Pa /boot/loader.conf user defined settings. .It Pa /boot/loader.conf.local machine-specific settings for sites with a common loader.conf. -.It Pa /boot/loader.rc -contains the instructions to automatically process -.Nm . .El .Sh SEE ALSO .Xr rc.conf 5 , From owner-svn-src-head@freebsd.org Mon Feb 26 03:46:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DF89F25982; Mon, 26 Feb 2018 03:46:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E48C07FD6C; Mon, 26 Feb 2018 03:46:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF88B16303; Mon, 26 Feb 2018 03:46:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q3kH1t037822; Mon, 26 Feb 2018 03:46:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q3kHN5037821; Mon, 26 Feb 2018 03:46:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802260346.w1Q3kHN5037821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 03:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330008 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 03:46:18 -0000 Author: kevans Date: Mon Feb 26 03:46:17 2018 New Revision: 330008 URL: https://svnweb.freebsd.org/changeset/base/330008 Log: lualoader: A little more general menu cleanup Instead of a single-letter parameter ('m'), use something a little more descriptive and meaningful: 'menudef' ("menu definition") -- these functions expect to be passed a menudef, so call it what it is. While here, throw an assertion in that we have a handler for the selected menu item. This is more of a debugging aide so that it's more obvious when one is testing a menudef that they've added an entry item that we don't handle. This is an improvement over the past behavior of ignoring the unknown menu entry. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Mon Feb 26 03:16:57 2018 (r330007) +++ head/stand/lua/menu.lua Mon Feb 26 03:46:17 2018 (r330008) @@ -347,21 +347,21 @@ menu.default = menu.welcome -- the local alias_table in menu.process. menu.current_alias_table = {} -function menu.draw(m) +function menu.draw(menudef) -- Clear the screen, reset the cursor, then draw screen.clear() screen.defcursor() - menu.current_alias_table = drawer.drawscreen(m) - drawn_menu = m + menu.current_alias_table = drawer.drawscreen(menudef) + drawn_menu = menudef end -- 'keypress' allows the caller to indicate that a key has been pressed that we -- should process as our initial input. -function menu.process(m, keypress) - assert(m ~= nil) +function menu.process(menudef, keypress) + assert(menudef ~= nil) - if drawn_menu ~= m then - menu.draw(m) + if drawn_menu ~= menudef then + menu.draw(menudef) end while true do @@ -370,7 +370,7 @@ function menu.process(m, keypress) -- Special key behaviors if (key == core.KEY_BACKSPACE or key == core.KEY_DELETE) and - m ~= menu.default then + menudef ~= menu.default then break elseif key == core.KEY_ENTER then core.boot() @@ -389,19 +389,17 @@ function menu.process(m, keypress) -- if we have an alias do the assigned action: if sel_entry ~= nil then - -- Get menu handler local handler = menu.handlers[sel_entry.entry_type] - if handler ~= nil then - -- The handler's return value indicates if we - -- need to exit this menu. An omitted or true - -- return value means to continue. - if handler(m, sel_entry) == false then - return - end + assert(handler ~= nil) + -- The handler's return value indicates if we + -- need to exit this menu. An omitted or true + -- return value means to continue. + if handler(menudef, sel_entry) == false then + return end -- If we got an alias key the screen is out of date... -- redraw it. - menu.draw(m) + menu.draw(menudef) end end end From owner-svn-src-head@freebsd.org Mon Feb 26 03:56:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C12F2670E; Mon, 26 Feb 2018 03:56:32 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEAEA804DE; Mon, 26 Feb 2018 03:56:31 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 158BF14A2F; Mon, 26 Feb 2018 03:56:25 +0000 (UTC) Subject: Re: svn commit: r315449 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201703171234.v2HCYvgd026429@repo.freebsd.org> From: Allan Jude Cc: Mike Geiger , Andriy Gapon , Josh Paetzel , Alexander Motin Message-ID: <6bf452f9-fd55-1ea9-196a-1cfcf97d06f4@freebsd.org> Date: Sun, 25 Feb 2018 22:56:27 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201703171234.v2HCYvgd026429@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 03:56:32 -0000 On 2017-03-17 08:34, Steven Hartland wrote: > Author: smh > Date: Fri Mar 17 12:34:57 2017 > New Revision: 315449 > URL: https://svnweb.freebsd.org/changeset/base/315449 > > Log: > Reduce ARC fragmentation threshold > > As ZFS can request up to SPA_MAXBLOCKSIZE memory block e.g. during zfs recv, > update the threshold at which we start agressive reclamation to use > SPA_MAXBLOCKSIZE (16M) instead of the lower zfs_max_recordsize which > defaults to 1M. > > PR: 194513 > Reviewed by: avg, mav > MFC after: 1 month > Sponsored by: Multiplay > Differential Revision: https://reviews.freebsd.org/D10012 > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Mar 17 12:34:56 2017 (r315448) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Mar 17 12:34:57 2017 (r315449) > @@ -3978,7 +3978,7 @@ arc_available_memory(void) > * Start aggressive reclamation if too little sequential KVA left. > */ > if (lowest > 0) { > - n = (vmem_size(heap_arena, VMEM_MAXFREE) < zfs_max_recordsize) ? > + n = (vmem_size(heap_arena, VMEM_MAXFREE) < SPA_MAXBLOCKSIZE) ? > -((int64_t)vmem_size(heap_arena, VMEM_ALLOC) >> 4) : > INT64_MAX; > if (n < lowest) { > I have some users reporting excessive ARC shrinking in 11.1 vs 11.0 due to this change. Memory seems quite fragmented, and this change makes it much more sensitive to that, but the problem seems to be that is can get to aggressive. The most recent case, the machine has 128GB of ram, and no other major processes running, just ZFS zvols being served over iSCIS by ctld. arc_max set to 85GB, rather conservative. After running for a few days, fragmentation seems to trip this line, when there are no 16mb contiguous blocks, and it shrinks the ARC by 1/16th of memory, but this does not result in a 16mb contiguous chunk, so it shrinks the ARC by another 1/16th, and again until it hits arc_min. Apparently eventually the ARC does regrow, but then crashes again later. You can see the ARC oscillating between arc_max and arc_min, with some long periods pinned at arc_min: https://imgur.com/a/emztF [root@ZFS-AF ~]# vmstat -z | tail +3 | awk -F '[:,] *' 'BEGIN { total=0; cache=0; used=0 } {u = $2 * $4; c = $2 * $5; t = u + c; cache += c; used += u; total += t; name=$1; gsub(" ", "_", name); print t, name, u, c} END { print total, "TOTAL", used, cache } ' | sort -n | perl -a -p -e 'while (($j, $_) = each(@F)) { 1 while s/^(-?\d+)(\d{3})/$1,$2/; print $_, " "} print "\n"' | column -t | tail 1,723,367,424 zio_data_buf_49152 1,722,875,904 491,520 1,827,057,664 zio_buf_4096 1,826,848,768 208,896 2,289,459,200 zio_data_buf_40960 2,289,090,560 368,640 3,642,736,640 zio_data_buf_81920 3,642,408,960 327,680 6,713,180,160 zio_data_buf_98304 6,712,688,640 491,520 9,388,195,840 zio_buf_8192 9,388,064,768 131,072 11,170,152,448 zio_data_buf_114688 11,168,890,880 1,261,568 29,607,329,792 zio_data_buf_131072 29,606,674,432 655,360 32,944,750,592 zio_buf_65536 32,943,833,088 917,504 114,235,296,752 TOTAL 111,787,212,900 2,448,083,852 [root@ZFS-AF ~]# vmstat -z | tail +3 | awk -F '[:,] *' 'BEGIN { total=0; cache=0; used=0 } {u = $2 * $4; c = $2 * $5; t = u + c; cache += c; used += u; total += t; name=$1; gsub(" ", "_", name); print t, name, u, c} END { print total, "TOTAL", used, cache } ' | sort -n +3 | perl -a -p -e 'while (($j, $_) = each(@F)) { 1 while s/^(-?\d+)(\d{3})/$1,$2/; print $_, " "} print "\n"' | column -t | tail 71,565,312 cblk15 0 71,565,312 72,220,672 cblk16 0 72,220,672 72,351,744 cblk18 131,072 72,220,672 72,744,960 cblk3 0 72,744,960 75,497,472 cblk8 0 75,497,472 76,283,904 cblk22 0 76,283,904 403,696,384 128 286,225,792 117,470,592 229,519,360 mbuf_jumbo_page 67,043,328 162,476,032 1,196,795,160 arc_buf_hdr_t_l2only 601,620,624 595,174,536 114,220,354,544 TOTAL 111,778,349,508 2,442,005,036 Maybe the right thing to do is call the new kmem_cache_reap_soon() or other functions that might actually reduce fragmentation, or rate limit how quickly the ARC will shrink? What kind of tools do we have to look at why memory is so fragmented that ZFS feels the need to tank the ARC? I know this block and the FMR_ZIO_FRAG reason have been removed from -CURRENT as part of the NUMA work, but I am worried about addressing this issue for the upcoming 11.2-RELEASE. -- Allan Jude From owner-svn-src-head@freebsd.org Mon Feb 26 04:08:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D7DDF2736F; Mon, 26 Feb 2018 04:08:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B510580B49; Mon, 26 Feb 2018 04:08:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABAC816647; Mon, 26 Feb 2018 04:08:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q48tma047689; Mon, 26 Feb 2018 04:08:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q48tVa047684; Mon, 26 Feb 2018 04:08:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802260408.w1Q48tVa047684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 04:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330009 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 04:08:56 -0000 Author: kevans Date: Mon Feb 26 04:08:54 2018 New Revision: 330009 URL: https://svnweb.freebsd.org/changeset/base/330009 Log: lualoader: More argument name expansion, part 2 screen also has some instances, but it also has other cleanup to go with it. Because of this, I will be committing the screen changes separately. Modified: head/stand/lua/color.lua head/stand/lua/config.lua head/stand/lua/core.lua head/stand/lua/drawer.lua head/stand/lua/menu.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Mon Feb 26 03:46:17 2018 (r330008) +++ head/stand/lua/color.lua Mon Feb 26 04:08:54 2018 (r330009) @@ -58,30 +58,31 @@ end color.disabled = not color.isEnabled() -function color.escapef(c) +function color.escapef(color_value) if color.disabled then - return c + return color_value end - return "\027[3" .. c .. "m" + return "\027[3" .. color_value .. "m" end -function color.escapeb(c) +function color.escapeb(color_value) if color.disabled then - return c + return color_value end - return "\027[4" .. c .. "m" + return "\027[4" .. color_value .. "m" end -function color.escape(fg, bg, att) +function color.escape(fg_color, bg_color, attribute) if color.disabled then return "" end - if not att then - att = "" + if attribute == nil then + attribute = "" else - att = att .. ";" + attribute = attribute .. ";" end - return "\027[" .. att .. "3" .. fg .. ";4" .. bg .. "m" + return "\027[" .. attribute .. + "3" .. fg_color .. ";4" .. bg_color .. "m" end function color.default() Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Mon Feb 26 03:46:17 2018 (r330008) +++ head/stand/lua/config.lua Mon Feb 26 04:08:54 2018 (r330009) @@ -228,22 +228,25 @@ function config.restoreEnv() config.env_restore = {} end -function config.setenv(k, v) +function config.setenv(key, value) -- Track the original value for this if we haven't already - if config.env_restore[k] == nil then - config.env_restore[k] = {value = loader.getenv(k)} + if config.env_restore[key] == nil then + config.env_restore[key] = {value = loader.getenv(key)} end - config.env_changed[k] = v + config.env_changed[key] = value - return loader.setenv(k, v) + return loader.setenv(key, value) end -function config.setKey(k, n, v) - if modules[k] == nil then - modules[k] = {} +-- name here is one of 'name', 'type', flags', 'before', 'after', or 'error.' +-- These are set from lines in loader.conf(5): ${key}_${name}="${value}" where +-- ${key} is a module name. +function config.setKey(key, name, value) + if modules[key] == nil then + modules[key] = {} end - modules[k][n] = v + modules[key][name] = value end function config.lsModules() @@ -255,11 +258,11 @@ function config.lsModules() end -function config.isValidComment(c) - if c ~= nil then - local s = c:match("^%s*#.*") +function config.isValidComment(line) + if line ~= nil then + local s = line:match("^%s*#.*") if s == nil then - s = c:match("^%s*$") + s = line:match("^%s*$") end if s == nil then return false Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Mon Feb 26 03:46:17 2018 (r330008) +++ head/stand/lua/core.lua Mon Feb 26 04:08:54 2018 (r330009) @@ -54,37 +54,37 @@ core.MENU_SEPARATOR = "separator" core.MENU_SUBMENU = "submenu" core.MENU_CAROUSEL_ENTRY = "carousel_entry" -function core.setVerbose(b) - if b == nil then - b = not core.verbose +function core.setVerbose(verbose) + if verbose == nil then + verbose = not core.verbose end - if b then + if verbose then loader.setenv("boot_verbose", "YES") else loader.unsetenv("boot_verbose") end - core.verbose = b + core.verbose = verbose end -function core.setSingleUser(b) - if b == nil then - b = not core.su +function core.setSingleUser(single_user) + if single_user == nil then + single_user = not core.su end - if b then + if single_user then loader.setenv("boot_single", "YES") else loader.unsetenv("boot_single") end - core.su = b + core.su = single_user end -function core.getACPIPresent(checkingSystemDefaults) +function core.getACPIPresent(checking_system_defaults) local c = loader.getenv("hint.acpi.0.rsdp") if c ~= nil then - if checkingSystemDefaults then + if checking_system_defaults then return true end -- Otherwise, respect disabled if it's set @@ -94,12 +94,12 @@ function core.getACPIPresent(checkingSystemDefaults) return false end -function core.setACPI(b) - if b == nil then - b = not core.acpi +function core.setACPI(acpi) + if acpi == nil then + acpi = not core.acpi end - if b then + if acpi then loader.setenv("acpi_load", "YES") loader.setenv("hint.acpi.0.disabled", "0") loader.unsetenv("loader.acpi_disabled_by_user") @@ -108,14 +108,14 @@ function core.setACPI(b) loader.setenv("hint.acpi.0.disabled", "1") loader.setenv("loader.acpi_disabled_by_user", "1") end - core.acpi = b + core.acpi = acpi end -function core.setSafeMode(b) - if b == nil then - b = not core.sm +function core.setSafeMode(safe_mode) + if safe_mode == nil then + safe_mode = not core.sm end - if b then + if safe_mode then loader.setenv("kern.smp.disabled", "1") loader.setenv("hw.ata.ata_dma", "0") loader.setenv("hw.ata.atapi_dma", "0") @@ -132,7 +132,7 @@ function core.setSafeMode(b) loader.unsetenv("kern.eventtimer.periodic") loader.unsetenv("kern.geom.part.check_integrity") end - core.sm = b + core.sm = safe_mode end function core.kernelList() Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Mon Feb 26 03:46:17 2018 (r330008) +++ head/stand/lua/drawer.lua Mon Feb 26 04:08:54 2018 (r330009) @@ -265,14 +265,14 @@ function drawer.drawscreen(menu_opts) return drawer.drawmenu(menu_opts) end -function drawer.drawmenu(m) +function drawer.drawmenu(menudef) local x = drawer.menu_position.x local y = drawer.menu_position.y -- print the menu and build the alias table local alias_table = {} local entry_num = 0 - local menu_entries = m.entries + local menu_entries = menudef.entries local effective_line_num = 0 if type(menu_entries) == "function" then menu_entries = menu_entries() @@ -288,7 +288,7 @@ function drawer.drawmenu(m) entry_num = entry_num + 1 screen.setcursor(x, y + effective_line_num) - print(entry_num .. ". " .. menuEntryName(m, e)) + print(entry_num .. ". " .. menuEntryName(menudef, e)) -- fill the alias table alias_table[tostring(entry_num)] = e @@ -299,7 +299,7 @@ function drawer.drawmenu(m) end else screen.setcursor(x, y + effective_line_num) - print(menuEntryName(m, e)) + print(menuEntryName(menudef, e)) end ::continue:: end Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Mon Feb 26 03:46:17 2018 (r330008) +++ head/stand/lua/menu.lua Mon Feb 26 04:08:54 2018 (r330009) @@ -40,8 +40,8 @@ local menu = {} local drawn_menu -local function OnOff(str, b) - if b then +local function OnOff(str, value) + if value then return str .. color.escapef(color.GREEN) .. "On" .. color.escapef(color.WHITE) else From owner-svn-src-head@freebsd.org Mon Feb 26 04:12:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528FFF27821; Mon, 26 Feb 2018 04:12:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 046F180F87; Mon, 26 Feb 2018 04:12:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3B7B167D5; Mon, 26 Feb 2018 04:12:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q4CshO052646; Mon, 26 Feb 2018 04:12:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q4Csam052645; Mon, 26 Feb 2018 04:12:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802260412.w1Q4Csam052645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 04:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330010 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 04:12:55 -0000 Author: kevans Date: Mon Feb 26 04:12:54 2018 New Revision: 330010 URL: https://svnweb.freebsd.org/changeset/base/330010 Log: lualoader: screen argument fixes screen was also guilty of not-so-great argument names, but it was also guilty of handling color sequences on its own. Change those bits to using the color module instead. As a side note, between color and screen, I'm not 100% sure that returning the color_value is the right thing to do if we won't generate the escape sequences. This should be re-evaluated at a later time, and they should likely return nil instead. Modified: head/stand/lua/screen.lua Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Mon Feb 26 04:08:54 2018 (r330009) +++ head/stand/lua/screen.lua Mon Feb 26 04:12:54 2018 (r330010) @@ -49,18 +49,18 @@ function screen.setcursor(x, y) loader.printc("\027[" .. y .. ";" .. x .. "H") end -function screen.setforeground(c) +function screen.setforeground(color_value) if color.disabled then - return c + return color_value end - loader.printc("\027[3" .. c .. "m") + loader.printc(color.escapef(color_value)) end -function screen.setbackground(c) +function screen.setbackground(color_value) if color.disabled then - return c + return color_value end - loader.printc("\027[4" .. c .. "m") + loader.printc(color.escapeb(color_value)) end function screen.defcolor() From owner-svn-src-head@freebsd.org Mon Feb 26 04:33:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA728F28FAE; Mon, 26 Feb 2018 04:33:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7699981BC0; Mon, 26 Feb 2018 04:33:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7187C16B09; Mon, 26 Feb 2018 04:33:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q4X5oD062189; Mon, 26 Feb 2018 04:33:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q4X5YY062188; Mon, 26 Feb 2018 04:33:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802260433.w1Q4X5YY062188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 04:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330011 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 330011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 04:33:06 -0000 Author: kevans Date: Mon Feb 26 04:33:05 2018 New Revision: 330011 URL: https://svnweb.freebsd.org/changeset/base/330011 Log: Add MAINTAINERS note for lualoader (stand/lua, specifically) While it's a work in progress, at least, I would like a chance to review any lua that goes into the tree for lualoader. I am also willing to help others get started writing features or fixing any bugs wandered across. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Feb 26 04:12:54 2018 (r330010) +++ head/MAINTAINERS Mon Feb 26 04:33:05 2018 (r330011) @@ -86,6 +86,7 @@ sh(1) jilles Pre-commit review requested. This also share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. stand/forth dteske Pre-commit review requested. +stand/lua kevans Pre-commit review requested sys/compat/linuxkpi hselasky If in doubt, ask. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. From owner-svn-src-head@freebsd.org Mon Feb 26 04:55:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A7C2F2A6B8; Mon, 26 Feb 2018 04:55:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 086368293A; Mon, 26 Feb 2018 04:55:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F328F16E24; Mon, 26 Feb 2018 04:55:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q4t844072388; Mon, 26 Feb 2018 04:55:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q4t8tO072387; Mon, 26 Feb 2018 04:55:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802260455.w1Q4t8tO072387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 04:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330012 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 330012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 04:55:09 -0000 Author: kevans Date: Mon Feb 26 04:55:08 2018 New Revision: 330012 URL: https://svnweb.freebsd.org/changeset/base/330012 Log: style.lua(9): Add some additional notes about naming and commas camelCase tends to be preferred for function identifiers, while internal_underscores are preferred for variable identifiers. This convention makes it a little bit easier to eyeball whether variable/function usage is correct. The optional commas for final table values are preferred to reduce chances for error. Modified: head/share/man/man9/style.lua.9 Modified: head/share/man/man9/style.lua.9 ============================================================================== --- head/share/man/man9/style.lua.9 Mon Feb 26 04:33:05 2018 (r330011) +++ head/share/man/man9/style.lua.9 Mon Feb 26 04:55:08 2018 (r330012) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2018 +.Dd February 25, 2018 .Dt STYLE.LUA 9 .Os .Sh NAME @@ -83,6 +83,30 @@ Single-line conditional statements and loops should be .Pp .Ic local variables should be preferred to global variables in module scope. +internal_underscores tend to be preferred for variable identifiers, while +camelCase tends to be preferred for function identifiers. +.Pp +If a table definition spans multiple lines, then the final value in the table +should include the optional terminating comma. +For example: +.Bd -literal +-- No terminating comma needed for trivial table definitions +local trivial_table = {1, 2, 3, 4} + +local complex_table = { + { + id = "foo", + func = foo_function, -- Trailing comma preferred + }, + { + id = "bar", + func = bar_function, + }, -- Trailing comma preferred +} +.Ed +.Pp +This reduces the chance for errors to be introduced when modifying more complex +tables. .Pp Multiple local variables should not be declared .Sy and From owner-svn-src-head@freebsd.org Mon Feb 26 08:45:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E977F35277; Mon, 26 Feb 2018 08:45:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5F556A23F; Mon, 26 Feb 2018 08:45:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCC63192D3; Mon, 26 Feb 2018 08:45:38 +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 w1Q8jcaB087183; Mon, 26 Feb 2018 08:45:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q8jc3E087182; Mon, 26 Feb 2018 08:45:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802260845.w1Q8jc3E087182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 26 Feb 2018 08:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330016 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 330016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 08:45:39 -0000 Author: andrew Date: Mon Feb 26 08:45:38 2018 New Revision: 330016 URL: https://svnweb.freebsd.org/changeset/base/330016 Log: Check all entries in the ACPI uart compat table and not just the first. Sponsored by: DARPA, AFRL Modified: head/sys/dev/uart/uart_cpu_arm64.c Modified: head/sys/dev/uart/uart_cpu_arm64.c ============================================================================== --- head/sys/dev/uart/uart_cpu_arm64.c Mon Feb 26 08:00:01 2018 (r330015) +++ head/sys/dev/uart/uart_cpu_arm64.c Mon Feb 26 08:45:38 2018 (r330016) @@ -83,16 +83,23 @@ uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b static struct acpi_uart_compat_data * uart_cpu_acpi_scan(uint8_t interface_type) { - struct acpi_uart_compat_data **cd; + struct acpi_uart_compat_data **cd, *curcd; + int i; SET_FOREACH(cd, uart_acpi_class_and_device_set) { - if ((*cd)->port_subtype == interface_type) - return (*cd); + curcd = *cd; + for (i = 0; curcd[i].hid != NULL; i++) { + if (curcd[i].port_subtype == interface_type) + return (&curcd[i]); + } } SET_FOREACH(cd, uart_acpi_class_set) { - if ((*cd)->port_subtype == interface_type) - return (*cd); + curcd = *cd; + for (i = 0; curcd[i].hid != NULL; i++) { + if (curcd[i].port_subtype == interface_type) + return (&curcd[i]); + } } return (NULL); From owner-svn-src-head@freebsd.org Mon Feb 26 13:12:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D9FFF237A5; Mon, 26 Feb 2018 13:12:52 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFCDC74B51; Mon, 26 Feb 2018 13:12:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E91DF1BDEA; Mon, 26 Feb 2018 13:12:51 +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 w1QDCpIk037779; Mon, 26 Feb 2018 13:12:51 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QDCpvo037778; Mon, 26 Feb 2018 13:12:51 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201802261312.w1QDCpvo037778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 26 Feb 2018 13:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330018 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 13:12:52 -0000 Author: cognet Date: Mon Feb 26 13:12:51 2018 New Revision: 330018 URL: https://svnweb.freebsd.org/changeset/base/330018 Log: In do_ast, make sure the interrupts are enabled before calling ast(). We can reach that point with IRQs disabled, and calling ast() with IRQs  disabled can lead to a deadlock. This should fix the freezes on arm64 under load. Reviewed by: andrew Modified: head/sys/arm64/arm64/exception.S Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Mon Feb 26 12:01:42 2018 (r330017) +++ head/sys/arm64/arm64/exception.S Mon Feb 26 13:12:51 2018 (r330018) @@ -26,6 +26,7 @@ */ #include +#include __FBSDID("$FreeBSD$"); #include "assym.s" @@ -114,9 +115,11 @@ __FBSDID("$FreeBSD$"); .endm .macro do_ast - /* Disable interrupts */ mrs x19, daif + /* Make sure the IRQs are enabled before calling ast() */ + bic x19, x19, #PSR_I 1: + /* Disable interrupts */ msr daifset, #2 /* Read the current thread flags */ From owner-svn-src-head@freebsd.org Mon Feb 26 14:00:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162E6F26C61; Mon, 26 Feb 2018 14:00:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5FA476543; Mon, 26 Feb 2018 14:00:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACDDE1C443; Mon, 26 Feb 2018 14:00:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QE0NR3062681; Mon, 26 Feb 2018 14:00:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QE0N5s062680; Mon, 26 Feb 2018 14:00:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802261400.w1QE0N5s062680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 14:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330019 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 330019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 14:00:24 -0000 Author: kevans Date: Mon Feb 26 14:00:23 2018 New Revision: 330019 URL: https://svnweb.freebsd.org/changeset/base/330019 Log: ofw_fdt: Simplify parts with new libfdt methods libfdt now provides methods to iterate through subnodes and properties in a convenient fashion. Replace our ofw_fdt_{peer,child} searches with calls to their corresponding libfdt methods. Rework ofw_fdt_nextprop to use the fdt_for_each_property_offset macro, making it even more obvious what it's doing. No functional change intended. Reviewed by: nwhitehorn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14225 Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Mon Feb 26 13:12:51 2018 (r330018) +++ head/sys/dev/ofw/ofw_fdt.c Mon Feb 26 14:00:23 2018 (r330019) @@ -174,7 +174,7 @@ fdt_phandle_offset(phandle_t p) static phandle_t ofw_fdt_peer(ofw_t ofw, phandle_t node) { - int depth, offset; + int offset; if (node == 0) { /* Find root node */ @@ -186,39 +186,21 @@ ofw_fdt_peer(ofw_t ofw, phandle_t node) offset = fdt_phandle_offset(node); if (offset < 0) return (0); - - for (depth = 1, offset = fdt_next_node(fdtp, offset, &depth); - offset >= 0; - offset = fdt_next_node(fdtp, offset, &depth)) { - if (depth < 0) - return (0); - if (depth == 1) - return (fdt_offset_phandle(offset)); - } - - return (0); + offset = fdt_next_subnode(fdtp, offset); + return (fdt_offset_phandle(offset)); } /* Return the first child of this node or 0. */ static phandle_t ofw_fdt_child(ofw_t ofw, phandle_t node) { - int depth, offset; + int offset; offset = fdt_phandle_offset(node); if (offset < 0) return (0); - - for (depth = 0, offset = fdt_next_node(fdtp, offset, &depth); - (offset >= 0) && (depth > 0); - offset = fdt_next_node(fdtp, offset, &depth)) { - if (depth < 0) - return (0); - if (depth == 1) - return (fdt_offset_phandle(offset)); - } - - return (0); + offset = fdt_first_subnode(fdtp, offset); + return (fdt_offset_phandle(offset)); } /* Return the parent of this node or 0. */ @@ -341,26 +323,24 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const c if (offset < 0) return (-1); - /* Find the first prop in the node */ - offset = fdt_first_property_offset(fdtp, offset); - if (offset < 0) - return (0); /* No properties */ - - if (previous != NULL) { - while (offset >= 0) { + if (previous == NULL) + /* Find the first prop in the node */ + offset = fdt_first_property_offset(fdtp, offset); + else { + fdt_for_each_property_offset(offset, fdtp, offset) { prop = fdt_getprop_by_offset(fdtp, offset, &name, NULL); if (prop == NULL) return (-1); /* Internal error */ - + /* Skip until we find 'previous', then bail out */ + if (strcmp(name, previous) != 0) + continue; offset = fdt_next_property_offset(fdtp, offset); - if (offset < 0) - return (0); /* No more properties */ - - /* Check if the last one was the one we wanted */ - if (strcmp(name, previous) == 0) - break; + break; } } + + if (offset < 0) + return (0); /* No properties */ prop = fdt_getprop_by_offset(fdtp, offset, &name, &offset); if (prop == NULL) From owner-svn-src-head@freebsd.org Mon Feb 26 15:37:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B919EF2D9EF; Mon, 26 Feb 2018 15:37:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BC417A8EC; Mon, 26 Feb 2018 15:37:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6213B1D4BB; Mon, 26 Feb 2018 15:37:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QFbXL8014010; Mon, 26 Feb 2018 15:37:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QFbWlt014007; Mon, 26 Feb 2018 15:37:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802261537.w1QFbWlt014007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 15:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330020 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 15:37:34 -0000 Author: kevans Date: Mon Feb 26 15:37:32 2018 New Revision: 330020 URL: https://svnweb.freebsd.org/changeset/base/330020 Log: lualoader: Re-work menu skipping bits This is motivated by a want to reduce heap usage if the menu is being skipped. Currently, the menu module must be loaded regardless of whether it's being skipped or not, which adds a cool ~50-100KB worth of memory usage. Move the menu skip logic out to core (and remove a debug print), then check in loader.lua if we should be skipping the menu and avoid loading the menu module entirely if so. This keeps our memory usage below ~115KB for a boot with the menu stripped. Also worth noting: with this change, we no longer explicitly invoke autoboot if we're skipping the menu. Instead, we let the standard loader behavior apply: try to autoboot if we need to, then drop to a loader prompt if not or if the autoboot sequence is interrupted. The only thing we still handle before dropping to the loader autoboot sequence is loadelf(), so that we can still apply any of our kernel loading behavior. Modified: head/stand/lua/core.lua head/stand/lua/loader.lua head/stand/lua/menu.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Mon Feb 26 14:00:23 2018 (r330019) +++ head/stand/lua/core.lua Mon Feb 26 15:37:32 2018 (r330020) @@ -285,6 +285,20 @@ function core.isSystem386() return loader.machine_arch == "i386" end +-- Is the menu skipped in the environment in which we've booted? +function core.isMenuSkipped() + if core.isSerialBoot() then + return true + end + local c = string.lower(loader.getenv("console") or "") + if c:match("^efi[ ;]") ~= nil or c:match("[ ;]efi[ ;]") ~= nil then + return true + end + + c = string.lower(loader.getenv("beastie_disable") or "") + return c == "yes" +end + -- This may be a better candidate for a 'utility' module. function core.deepCopyTable(tbl) local new_tbl = {} Modified: head/stand/lua/loader.lua ============================================================================== --- head/stand/lua/loader.lua Mon Feb 26 14:00:23 2018 (r330019) +++ head/stand/lua/loader.lua Mon Feb 26 15:37:32 2018 (r330020) @@ -30,8 +30,12 @@ -- require("cli") +local core = require("core") local config = require("config") -local menu = require("menu") +local menu +if not core.isMenuSkipped() then + menu = require("menu") +end local password = require("password") local result = lfs.attributes("/boot/lua/local.lua") @@ -42,4 +46,10 @@ end config.load() password.check() -menu.run() +-- menu might be disabled +if menu ~= nil then + menu.run() +else + -- Load kernel/modules before we go + config.loadelf() +end Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Mon Feb 26 14:00:23 2018 (r330019) +++ head/stand/lua/menu.lua Mon Feb 26 15:37:32 2018 (r330020) @@ -405,11 +405,6 @@ function menu.process(menudef, keypress) end function menu.run() - if menu.skip() then - core.autoboot() - return - end - menu.draw(menu.default) local autoboot_key = menu.autoboot() @@ -418,20 +413,6 @@ function menu.run() screen.defcursor() print("Exiting menu!") -end - -function menu.skip() - if core.isSerialBoot() then - return true - end - local c = string.lower(loader.getenv("console") or "") - if c:match("^efi[ ;]") ~= nil or c:match("[ ;]efi[ ;]") ~= nil then - return true - end - - c = string.lower(loader.getenv("beastie_disable") or "") - print("beastie_disable", c) - return c == "yes" end function menu.autoboot() From owner-svn-src-head@freebsd.org Mon Feb 26 15:41:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D87E3F2DD88; Mon, 26 Feb 2018 15:41:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A3387AC9F; Mon, 26 Feb 2018 15:41:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 654241D4FD; Mon, 26 Feb 2018 15:41: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 w1QFfKDq017756; Mon, 26 Feb 2018 15:41:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QFfKVR017754; Mon, 26 Feb 2018 15:41:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802261541.w1QFfKVR017754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 26 Feb 2018 15:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330021 - in head/stand: defaults forth X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: defaults forth X-SVN-Commit-Revision: 330021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 15:41:21 -0000 Author: imp Date: Mon Feb 26 15:41:20 2018 New Revision: 330021 URL: https://svnweb.freebsd.org/changeset/base/330021 Log: These two directories build man pages, so it's incorrect to tag them NO_OBJ. Also, make sure the loader.conf.5 man gets built and installed. Modified: head/stand/defaults/Makefile head/stand/forth/Makefile Modified: head/stand/defaults/Makefile ============================================================================== --- head/stand/defaults/Makefile Mon Feb 26 15:37:32 2018 (r330020) +++ head/stand/defaults/Makefile Mon Feb 26 15:41:20 2018 (r330021) @@ -1,11 +1,9 @@ # $FreeBSD$ -NO_OBJ=t - .include FILES+= loader.conf -FILES+= loader.conf.5 +MAN+= loader.conf.5 FILESDIR_loader.conf= /boot/defaults Modified: head/stand/forth/Makefile ============================================================================== --- head/stand/forth/Makefile Mon Feb 26 15:37:32 2018 (r330020) +++ head/stand/forth/Makefile Mon Feb 26 15:41:20 2018 (r330021) @@ -1,7 +1,5 @@ # $FreeBSD$ -NO_OBJ=t - .include MAN+= beastie.4th.8 \ From owner-svn-src-head@freebsd.org Mon Feb 26 17:51:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75332F36576; Mon, 26 Feb 2018 17:51:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 275F6800C7; Mon, 26 Feb 2018 17:51:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2250D1EA6F; Mon, 26 Feb 2018 17:51:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QHpIx0079302; Mon, 26 Feb 2018 17:51:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QHpI2b079301; Mon, 26 Feb 2018 17:51:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802261751.w1QHpI2b079301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 26 Feb 2018 17:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330022 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 330022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 17:51:19 -0000 Author: trasz Date: Mon Feb 26 17:51:18 2018 New Revision: 330022 URL: https://svnweb.freebsd.org/changeset/base/330022 Log: Fix gettytab(5) to document f0, f1, and f2 as unsupported; they've been gone since r131091. PR: 184691 (partial) Submitted by: naddy@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/gettytab.5 Modified: head/libexec/getty/gettytab.5 ============================================================================== --- head/libexec/getty/gettytab.5 Mon Feb 26 15:41:20 2018 (r330021) +++ head/libexec/getty/gettytab.5 Mon Feb 26 17:51:18 2018 (r330022) @@ -28,7 +28,7 @@ .\" from: @(#)gettytab.5 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" " -.Dd August 23, 2017 +.Dd February 26, 2018 .Dt GETTYTAB 5 .Os .Sh NAME @@ -109,9 +109,6 @@ scripts character .It "ev str" Ta Dv NULL .Ta No "initial environment" -.It "f0 num unused tty mode flags to write messages" -.It "f1 num unused tty mode flags to read login name" -.It "f2 num unused tty mode flags to leave terminal as" .It "fl str" Ta So Li ^O .Sc Ta No "output flush character" .It "hc bool false do" @@ -203,6 +200,9 @@ The following capabilities are no longer supported by .It "bd num 0 backspace delay" .It "cb bool false use crt backspace mode" .It "cd num 0 carriage-return delay" +.It "f0 num unused tty mode flags to write messages" +.It "f1 num unused tty mode flags to read login name" +.It "f2 num unused tty mode flags to leave terminal as" .It "fd num 0 form-feed (vertical motion) delay" .It "lc bool false terminal has lower case" .It "nd num 0 newline (line-feed) delay" @@ -245,17 +245,6 @@ and .Va c_oflag fields, respectively. Each these sets must be completely specified to be effective. -The -.Va \&f0 , -.Va \&f1 , -and -.Va \&f2 -are excepted for backwards compatibility with a previous incarnation of -the TTY sub-system. -In these flags the bottom 16 bits of the (32 bits) -value contain the sgttyb -.Va sg_flags -field, while the top 16 bits represent the local mode word. .Pp Should .Xr getty 8 From owner-svn-src-head@freebsd.org Mon Feb 26 18:01:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91844F37017; Mon, 26 Feb 2018 18:01:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FC3C80808; Mon, 26 Feb 2018 18:01:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 204D71ED2A; Mon, 26 Feb 2018 18:01:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QI1aDr085020; Mon, 26 Feb 2018 18:01:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QI1Z2c085018; Mon, 26 Feb 2018 18:01:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802261801.w1QI1Z2c085018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 18:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330023 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 330023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 18:01:36 -0000 Author: kevans Date: Mon Feb 26 18:01:35 2018 New Revision: 330023 URL: https://svnweb.freebsd.org/changeset/base/330023 Log: libsa: Add MAXWAIT to net for establishing max total timeout Current timeout behavior is to progress in timeout values from MINTMO to MAXTMO in MINTMO steps before finally timing out. This results in a fairly long time before operations finally timeout, which may not be ideal for some use-cases. Add MAXWAIT that may be configured along with MINTMO/MAXTMO. If we attempt to start our send/recv cycle over again but MAXWAIT > 0 and MAXWAIT seconds have already passed, then go ahead and timeout. This is intended for those that just want to say "timeout after 180 seconds" rather than calculate and tweak MINTMO/MAXTMO to get their desired timeout. The default is 0, or "progress from MINTMO to MAXTMO with no exception." This has been modified since review to allow for it to be defined via CFLAGS and doing appropriate error checking. Future work may add some Makefile foo to respect LOADER_NET_MAXWAIT if it's specified in the environment and pass it in as MAXWAIT accordingly. Reviewed by: imp, sbruno, tsoome (all previous version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14389 Modified: head/stand/libsa/net.c head/stand/libsa/net.h Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Mon Feb 26 17:51:18 2018 (r330022) +++ head/stand/libsa/net.c Mon Feb 26 18:01:35 2018 (r330023) @@ -77,6 +77,7 @@ sendrecv(struct iodesc *d, { ssize_t cc; time_t t, tmo, tlast; + time_t tref; long tleft; #ifdef NET_DEBUG @@ -87,13 +88,14 @@ sendrecv(struct iodesc *d, tmo = MINTMO; tlast = 0; tleft = 0; + tref = getsecs(); t = getsecs(); for (;;) { + if (MAXWAIT > 0 && (getsecs() - tref) >= MAXWAIT) { + errno = ETIMEDOUT; + return -1; + } if (tleft <= 0) { - if (tmo >= MAXTMO) { - errno = ETIMEDOUT; - return -1; - } cc = (*sproc)(d, sbuf, ssize); if (cc != -1 && cc < ssize) panic("sendrecv: short write! (%zd < %zd)", Modified: head/stand/libsa/net.h ============================================================================== --- head/stand/libsa/net.h Mon Feb 26 17:51:18 2018 (r330022) +++ head/stand/libsa/net.h Mon Feb 26 18:01:35 2018 (r330023) @@ -61,6 +61,20 @@ enum net_proto { #define MAXTMO 120 /* seconds */ #define MINTMO 2 /* seconds */ +/* + * Maximum wait time for sending and receiving before we give up and timeout. + * If set to 0, operations will eventually timeout completely, but send/recv + * timeouts must progress exponentially from MINTMO to MAXTMO before final + * timeout is hit. + */ +#ifndef MAXWAIT +#define MAXWAIT 0 /* seconds */ +#endif + +#if MAXWAIT < 0 +#error MAXWAIT must not be a negative number +#endif + #define FNAME_SIZE 128 #define IFNAME_SIZE 16 #define RECV_SIZE 1536 /* XXX delete this */ From owner-svn-src-head@freebsd.org Mon Feb 26 18:04:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 065A6F37310; Mon, 26 Feb 2018 18:04:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD18C80B10; Mon, 26 Feb 2018 18:04:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A36081ED7B; Mon, 26 Feb 2018 18:04:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QI4Heb088973; Mon, 26 Feb 2018 18:04:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QI4HsZ088971; Mon, 26 Feb 2018 18:04:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802261804.w1QI4HsZ088971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 26 Feb 2018 18:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330024 - in head/usr.bin: cpuset rctl X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/usr.bin: cpuset rctl X-SVN-Commit-Revision: 330024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 18:04:18 -0000 Author: trasz Date: Mon Feb 26 18:04:17 2018 New Revision: 330024 URL: https://svnweb.freebsd.org/changeset/base/330024 Log: .Xr rctl(8) and cpuset(1). PR: 225935 Submitted by: D. Ebdrup (earlier version) MFC after: 2 weeks Modified: head/usr.bin/cpuset/cpuset.1 head/usr.bin/rctl/rctl.8 Modified: head/usr.bin/cpuset/cpuset.1 ============================================================================== --- head/usr.bin/cpuset/cpuset.1 Mon Feb 26 18:01:35 2018 (r330023) +++ head/usr.bin/cpuset/cpuset.1 Mon Feb 26 18:04:17 2018 (r330024) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2016 +.Dd February 26, 2018 .Dt CPUSET 1 .Os .Sh NAME @@ -187,7 +187,8 @@ Create a new cpuset that is restricted to CPUs 0 and 2 into the new set: .Dl cpuset -C -c -l 0,2 -p .Sh SEE ALSO -.Xr cpuset 2 +.Xr cpuset 2 , +.Xr rctl 8 .Sh HISTORY The .Nm Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Mon Feb 26 18:01:35 2018 (r330023) +++ head/usr.bin/rctl/rctl.8 Mon Feb 26 18:04:17 2018 (r330024) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2017 +.Dd February 26, 2018 .Dt RCTL 8 .Os .Sh NAME @@ -261,6 +261,7 @@ Display all rules matching user "joe": Display all rules matching login classes: .Dl Nm Ar loginclass: .Sh SEE ALSO +.Xr cpuset 1 , .Xr rctl 4 , .Xr rctl.conf 5 .Sh HISTORY From owner-svn-src-head@freebsd.org Mon Feb 26 18:06:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16926F374DF; Mon, 26 Feb 2018 18:06:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABEBB80CE4; Mon, 26 Feb 2018 18:06:15 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BE381ED7D; Mon, 26 Feb 2018 18:06:15 +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 w1QI6Flo089096; Mon, 26 Feb 2018 18:06:15 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QI6F4C089095; Mon, 26 Feb 2018 18:06:15 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201802261806.w1QI6F4C089095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 26 Feb 2018 18:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330025 - head/lib/libcasper/services/cap_grp X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_grp X-SVN-Commit-Revision: 330025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 18:06:16 -0000 Author: oshogbo Date: Mon Feb 26 18:06:15 2018 New Revision: 330025 URL: https://svnweb.freebsd.org/changeset/base/330025 Log: Fix typo. Modified: head/lib/libcasper/services/cap_grp/cap_grp.3 Modified: head/lib/libcasper/services/cap_grp/cap_grp.3 ============================================================================== --- head/lib/libcasper/services/cap_grp/cap_grp.3 Mon Feb 26 18:04:17 2018 (r330024) +++ head/lib/libcasper/services/cap_grp/cap_grp.3 Mon Feb 26 18:06:15 2018 (r330025) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2018 +.Dd February 26, 2018 .Dt CAP_GRP 3 .Os .Sh NAME @@ -103,7 +103,7 @@ The function limits the functions allowed in the service. The .Fa cmds -vriable can be set to +variable can be set to .Dv getgrent , .Dv getgrnam , .Dv getgrgid , From owner-svn-src-head@freebsd.org Mon Feb 26 18:14:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3E6F37D12; Mon, 26 Feb 2018 18:14:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47BD3812BF; Mon, 26 Feb 2018 18:14:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EBA41EF0B; Mon, 26 Feb 2018 18:14:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QIEcdU094110; Mon, 26 Feb 2018 18:14:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QIEcxX094108; Mon, 26 Feb 2018 18:14:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802261814.w1QIEcxX094108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 18:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330026 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 330026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 18:14:38 -0000 Author: kevans Date: Mon Feb 26 18:14:37 2018 New Revision: 330026 URL: https://svnweb.freebsd.org/changeset/base/330026 Log: libsa: Move MAXWAIT from net.h to net.c It's not a setting that has any effect or use outside of the net.c context. Modified: head/stand/libsa/net.c head/stand/libsa/net.h Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Mon Feb 26 18:06:15 2018 (r330025) +++ head/stand/libsa/net.c Mon Feb 26 18:14:37 2018 (r330026) @@ -58,6 +58,20 @@ __FBSDID("$FreeBSD$"); #include "net.h" /* + * Maximum wait time for sending and receiving before we give up and timeout. + * If set to 0, operations will eventually timeout completely, but send/recv + * timeouts must progress exponentially from MINTMO to MAXTMO before final + * timeout is hit. + */ +#ifndef MAXWAIT +#define MAXWAIT 0 /* seconds */ +#endif + +#if MAXWAIT < 0 +#error MAXWAIT must not be a negative number +#endif + +/* * Send a packet and wait for a reply, with exponential backoff. * * The send routine must return the actual number of bytes written, Modified: head/stand/libsa/net.h ============================================================================== --- head/stand/libsa/net.h Mon Feb 26 18:06:15 2018 (r330025) +++ head/stand/libsa/net.h Mon Feb 26 18:14:37 2018 (r330026) @@ -61,20 +61,6 @@ enum net_proto { #define MAXTMO 120 /* seconds */ #define MINTMO 2 /* seconds */ -/* - * Maximum wait time for sending and receiving before we give up and timeout. - * If set to 0, operations will eventually timeout completely, but send/recv - * timeouts must progress exponentially from MINTMO to MAXTMO before final - * timeout is hit. - */ -#ifndef MAXWAIT -#define MAXWAIT 0 /* seconds */ -#endif - -#if MAXWAIT < 0 -#error MAXWAIT must not be a negative number -#endif - #define FNAME_SIZE 128 #define IFNAME_SIZE 16 #define RECV_SIZE 1536 /* XXX delete this */ From owner-svn-src-head@freebsd.org Mon Feb 26 18:23:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9806F387C2; Mon, 26 Feb 2018 18:23:37 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6C381BA0; Mon, 26 Feb 2018 18:23:37 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F8FC1F0A7; Mon, 26 Feb 2018 18:23:37 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QINbd8098822; Mon, 26 Feb 2018 18:23:37 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QINbIY098821; Mon, 26 Feb 2018 18:23:37 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201802261823.w1QINbIY098821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 26 Feb 2018 18:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330027 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 330027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 18:23:38 -0000 Author: dab Date: Mon Feb 26 18:23:36 2018 New Revision: 330027 URL: https://svnweb.freebsd.org/changeset/base/330027 Log: iconv uses strlen directly on user supplied memory `iconv_sysctl_add` from `sys/libkern/iconv.c` incorrectly limits the size of user strings, such that several out of bounds reads could have been possible. static int iconv_sysctl_add(SYSCTL_HANDLER_ARGS) { struct iconv_converter_class *dcp; struct iconv_cspair *csp; struct iconv_add_in din; struct iconv_add_out dout; int error; error = SYSCTL_IN(req, &din, sizeof(din)); if (error) return error; if (din.ia_version != ICONV_ADD_VER) return EINVAL; if (din.ia_datalen > ICONV_CSMAXDATALEN) return EINVAL; if (strlen(din.ia_from) >= ICONV_CSNMAXLEN) return EINVAL; if (strlen(din.ia_to) >= ICONV_CSNMAXLEN) return EINVAL; if (strlen(din.ia_converter) >= ICONV_CNVNMAXLEN) return EINVAL; ... Since the `din` struct is directly copied from userland, there is no guarantee that the strings supplied will be NULL terminated. The `strlen` calls could continue reading past the designated buffer sizes. Declaration of `struct iconv_add_in` is found in `sys/sys/iconv.h`: struct iconv_add_in { int ia_version; char ia_converter[ICONV_CNVNMAXLEN]; char ia_to[ICONV_CSNMAXLEN]; char ia_from[ICONV_CSNMAXLEN]; int ia_datalen; const void *ia_data; }; Our strings are followed by the `ia_datalen` member, which is checked before the `strlen` calls: if (din.ia_datalen > ICONV_CSMAXDATALEN) Since `ICONV_CSMAXDATALEN` has value `0x41000` (and is `unsigned`), this ensures that `din.ia_datalen` contains at least 1 byte of 0, so it is not possible to trigger a read out of bounds of the `struct` however, this code is fragile and could introduce subtle bugs in the future if the `struct` is ever modified. PR: 207302 Submitted by: CTurt Reported by: CTurt Reviewed by: jhb, vangyzen MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14521 Modified: head/sys/libkern/iconv.c Modified: head/sys/libkern/iconv.c ============================================================================== --- head/sys/libkern/iconv.c Mon Feb 26 18:14:37 2018 (r330026) +++ head/sys/libkern/iconv.c Mon Feb 26 18:23:36 2018 (r330027) @@ -413,11 +413,11 @@ iconv_sysctl_add(SYSCTL_HANDLER_ARGS) return EINVAL; if (din.ia_datalen > ICONV_CSMAXDATALEN) return EINVAL; - if (strlen(din.ia_from) >= ICONV_CSNMAXLEN) + if (strnlen(din.ia_from, sizeof(din.ia_from)) >= ICONV_CSNMAXLEN) return EINVAL; - if (strlen(din.ia_to) >= ICONV_CSNMAXLEN) + if (strnlen(din.ia_to, sizeof(din.ia_to)) >= ICONV_CSNMAXLEN) return EINVAL; - if (strlen(din.ia_converter) >= ICONV_CNVNMAXLEN) + if (strnlen(din.ia_converter, sizeof(din.ia_converter)) >= ICONV_CNVNMAXLEN) return EINVAL; if (iconv_lookupconv(din.ia_converter, &dcp) != 0) return EINVAL; From owner-svn-src-head@freebsd.org Mon Feb 26 18:24:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B28E1F3888F; Mon, 26 Feb 2018 18:24:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6190181D16; Mon, 26 Feb 2018 18:24:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C7371F0AE; Mon, 26 Feb 2018 18:24:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QIOOeh098905; Mon, 26 Feb 2018 18:24:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QIOOoR098904; Mon, 26 Feb 2018 18:24:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802261824.w1QIOOoR098904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 18:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330028 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 330028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 18:24:24 -0000 Author: kevans Date: Mon Feb 26 18:24:24 2018 New Revision: 330028 URL: https://svnweb.freebsd.org/changeset/base/330028 Log: libsa: Partially revert r330023 The removal of tmo >= MAXTMO check should not have been done; this is specifically what handles timeout if MAXWAIT == 0. MFC after: 1 week Modified: head/stand/libsa/net.c Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Mon Feb 26 18:23:36 2018 (r330027) +++ head/stand/libsa/net.c Mon Feb 26 18:24:24 2018 (r330028) @@ -110,6 +110,10 @@ sendrecv(struct iodesc *d, return -1; } if (tleft <= 0) { + if (tmo >= MAXTMO) { + errno = ETIMEDOUT; + return -1; + } cc = (*sproc)(d, sbuf, ssize); if (cc != -1 && cc < ssize) panic("sendrecv: short write! (%zd < %zd)", From owner-svn-src-head@freebsd.org Mon Feb 26 18:50:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 127AAF3A521; Mon, 26 Feb 2018 18:50:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8CE582F2E; Mon, 26 Feb 2018 18:50:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3BB51F40C; Mon, 26 Feb 2018 18:50:39 +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 w1QIodM1009875; Mon, 26 Feb 2018 18:50:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QIodSY009874; Mon, 26 Feb 2018 18:50:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802261850.w1QIodSY009874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Feb 2018 18:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330029 - head/stand/defaults X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/stand/defaults X-SVN-Commit-Revision: 330029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 18:50:40 -0000 Author: jhb Date: Mon Feb 26 18:50:39 2018 New Revision: 330029 URL: https://svnweb.freebsd.org/changeset/base/330029 Log: Fix a typo: "now" -> "no". Modified: head/stand/defaults/loader.conf Modified: head/stand/defaults/loader.conf ============================================================================== --- head/stand/defaults/loader.conf Mon Feb 26 18:24:24 2018 (r330028) +++ head/stand/defaults/loader.conf Mon Feb 26 18:50:39 2018 (r330029) @@ -69,7 +69,7 @@ acpi_video_load="NO" # Load the ACPI video extension #loader_delay="3" # Delay in seconds before loading anything. # Default is unset and disabled (no delay). #autoboot_delay="10" # Delay in seconds before autobooting, - # -1 for now user interrupts, NO to disable + # -1 for no user interrupts, NO to disable #password="" # Prevent changes to boot options #bootlock_password="" # Prevent booting (see check-password.4th(8)) #geom_eli_passphrase_prompt="NO" # Prompt for geli(8) passphrase to mount root From owner-svn-src-head@freebsd.org Mon Feb 26 19:02:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F32CF3B11A; Mon, 26 Feb 2018 19:02:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B706C83968; Mon, 26 Feb 2018 19:02:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B213C1F711; Mon, 26 Feb 2018 19:02:11 +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 w1QJ2BQc018874; Mon, 26 Feb 2018 19:02:11 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QJ2BQ9018873; Mon, 26 Feb 2018 19:02:11 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802261902.w1QJ2BQ9018873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 26 Feb 2018 19:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330030 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 330030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 19:02:12 -0000 Author: brooks Date: Mon Feb 26 19:02:11 2018 New Revision: 330030 URL: https://svnweb.freebsd.org/changeset/base/330030 Log: Improve wording of error message when CROSS_TOOLCHAIN is not found. Reported by: emaste, jhb Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Feb 26 18:50:39 2018 (r330029) +++ head/Makefile.inc1 Mon Feb 26 19:02:11 2018 (r330030) @@ -61,7 +61,7 @@ LOCALBASE?= /usr/local .elif exists(${CROSS_TOOLCHAIN}) .include "${CROSS_TOOLCHAIN}" .else -.error CROSS_TOOLCHAIN is '${CROSS_TOOLCHAIN}' which is invalid +.error CROSS_TOOLCHAIN ${CROSS_TOOLCHAIN} not found .endif CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}" .endif From owner-svn-src-head@freebsd.org Mon Feb 26 19:08:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5229F3B7D7; Mon, 26 Feb 2018 19:08:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A59A83DBA; Mon, 26 Feb 2018 19:08:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 756211F735; Mon, 26 Feb 2018 19:08:28 +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 w1QJ8SBt019911; Mon, 26 Feb 2018 19:08:28 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QJ8RSE019905; Mon, 26 Feb 2018 19:08:27 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201802261908.w1QJ8RSE019905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 26 Feb 2018 19:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330031 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_random services/cap_syslog X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_random services/cap_syslog X-SVN-Commit-Revision: 330031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 19:08:29 -0000 Author: oshogbo Date: Mon Feb 26 19:08:27 2018 New Revision: 330031 URL: https://svnweb.freebsd.org/changeset/base/330031 Log: nv was moved to the 9 section. Fix reference to it. Modified: head/lib/libcasper/libcasper/libcasper.3 head/lib/libcasper/services/cap_dns/cap_dns.3 head/lib/libcasper/services/cap_grp/cap_grp.3 head/lib/libcasper/services/cap_random/cap_random.3 head/lib/libcasper/services/cap_syslog/cap_syslog.3 Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Mon Feb 26 19:02:11 2018 (r330030) +++ head/lib/libcasper/libcasper/libcasper.3 Mon Feb 26 19:08:27 2018 (r330031) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2018 +.Dd February 26, 2018 .Dt LIBCASPER 3 .Os .Sh NAME @@ -309,9 +309,9 @@ printf("Name associated with %s is %s.\\n", ipstr, hp- .Xr err 3 , .Xr gethostbyaddr 3 , .Xr inet_aton 3 , -.Xr nv 3 , .Xr capsicum 4 , -.Xr unix 4 +.Xr unix 4 , +.Xr nv 9 .Sh AUTHORS The .Nm libcasper Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.3 Mon Feb 26 19:02:11 2018 (r330030) +++ head/lib/libcasper/services/cap_dns/cap_dns.3 Mon Feb 26 19:08:27 2018 (r330031) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2018 +.Dd February 26, 2018 .Dt CAP_DNS 3 .Os .Sh NAME @@ -194,8 +194,8 @@ printf("Name associated with %s is %s.\\n", ipstr, hp- .Xr gethostbyname 3 , .Xr gethostbyname2 3 , .Xr getnameinfo 3, -.Xr nv 3 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr nv 9 .Sh AUTHORS The .Nm cap_dns Modified: head/lib/libcasper/services/cap_grp/cap_grp.3 ============================================================================== --- head/lib/libcasper/services/cap_grp/cap_grp.3 Mon Feb 26 19:02:11 2018 (r330030) +++ head/lib/libcasper/services/cap_grp/cap_grp.3 Mon Feb 26 19:08:27 2018 (r330031) @@ -213,10 +213,10 @@ cap_close(capgrp); .Xr getgrgid_r 3 , .Xr getgrnam 3 , .Xr getgrnam_r 3 , -.Xr nv 3 , .Xr setgrent 3 , .Xr setgroupent 3 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr nv 9 .Sh AUTHORS The .Nm cap_grp Modified: head/lib/libcasper/services/cap_random/cap_random.3 ============================================================================== --- head/lib/libcasper/services/cap_random/cap_random.3 Mon Feb 26 19:02:11 2018 (r330030) +++ head/lib/libcasper/services/cap_random/cap_random.3 Mon Feb 26 19:08:27 2018 (r330031) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2018 +.Dd February 26, 2018 .Dt CAP_RANDOM 3 .Os .Sh NAME @@ -85,8 +85,8 @@ printf("\\n"); .Xr cap_enter 2 , .Xr arc4random_buf 3 , .Xr err 3 , -.Xr nv 3 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr nv 9 .Sh AUTHORS The .Nm cap_random Modified: head/lib/libcasper/services/cap_syslog/cap_syslog.3 ============================================================================== --- head/lib/libcasper/services/cap_syslog/cap_syslog.3 Mon Feb 26 19:02:11 2018 (r330030) +++ head/lib/libcasper/services/cap_syslog/cap_syslog.3 Mon Feb 26 19:08:27 2018 (r330031) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2018 +.Dd January 27, 2018 .Dt CAP_SYSLOG 3 .Os .Sh NAME @@ -97,11 +97,11 @@ cap_syslog(capsyslog, LOG_NOTICE, "System logs from ca .Xr cap_enter 2 , .Xr closelog 3 , .Xr err 3 , -.Xr nv 3 , .Xr openlog 3 , .Xr setlogmask 3 .Xr syslog 3 , .Xr vsyslog 3 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr nv 9 .Sh AUTHORS .An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org From owner-svn-src-head@freebsd.org Mon Feb 26 19:19:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53874F3C42E; Mon, 26 Feb 2018 19:19:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 076578469C; Mon, 26 Feb 2018 19:19:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 026161F8DF; Mon, 26 Feb 2018 19:19:06 +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 w1QJJ5FD024978; Mon, 26 Feb 2018 19:19:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QJJ5nW024972; Mon, 26 Feb 2018 19:19:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802261919.w1QJJ5nW024972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Feb 2018 19:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330032 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm X-SVN-Commit-Revision: 330032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 19:19:06 -0000 Author: jhb Date: Mon Feb 26 19:19:05 2018 New Revision: 330032 URL: https://svnweb.freebsd.org/changeset/base/330032 Log: Add a new variant of the GLA2GPA ioctl for use by the debug server. Unlike the existing GLA2GPA ioctl, GLA2GPA_NOFAULT does not modify the guest. In particular, it does not inject any faults or modify PTEs in the guest when performing an address space translation. This is used by bhyve's debug server to read and write memory for the remote debugger. Reviewed by: grehan MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D14075 Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon Feb 26 19:08:27 2018 (r330031) +++ head/lib/libvmmapi/vmmapi.c Mon Feb 26 19:19:05 2018 (r330032) @@ -1233,6 +1233,27 @@ vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_gues return (error); } +int +vm_gla2gpa_nofault(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *fault) +{ + struct vm_gla2gpa gg; + int error; + + bzero(&gg, sizeof(struct vm_gla2gpa)); + gg.vcpuid = vcpu; + gg.prot = prot; + gg.gla = gla; + gg.paging = *paging; + + error = ioctl(ctx->fd, VM_GLA2GPA_NOFAULT, &gg); + if (error == 0) { + *fault = gg.fault; + *gpa = gg.gpa; + } + return (error); +} + #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif @@ -1479,6 +1500,7 @@ vm_get_ioctls(size_t *len) VM_PPTDEV_MSIX, VM_INJECT_NMI, VM_STATS, VM_STAT_DESC, VM_SET_X2APIC_STATE, VM_GET_X2APIC_STATE, VM_GET_HPET_CAPABILITIES, VM_GET_GPA_PMAP, VM_GLA2GPA, + VM_GLA2GPA_NOFAULT, VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SET_INTINFO, VM_GET_INTINFO, VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, VM_RESTART_INSTRUCTION }; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon Feb 26 19:08:27 2018 (r330031) +++ head/lib/libvmmapi/vmmapi.h Mon Feb 26 19:19:05 2018 (r330032) @@ -113,6 +113,9 @@ void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, int prot, uint64_t *gpa, int *fault); +int vm_gla2gpa_nofault(struct vmctx *, int vcpuid, + struct vm_guest_paging *paging, uint64_t gla, int prot, + uint64_t *gpa, int *fault); uint32_t vm_get_lowmem_limit(struct vmctx *ctx); void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); void vm_set_memflags(struct vmctx *ctx, int flags); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Mon Feb 26 19:08:27 2018 (r330031) +++ head/sys/amd64/include/vmm_dev.h Mon Feb 26 19:19:05 2018 (r330032) @@ -243,6 +243,7 @@ enum { IOCNUM_GET_MEMSEG = 15, IOCNUM_MMAP_MEMSEG = 16, IOCNUM_MMAP_GETNEXT = 17, + IOCNUM_GLA2GPA_NOFAULT = 18, /* register/state accessors */ IOCNUM_SET_REGISTER = 20, @@ -379,6 +380,8 @@ enum { _IOWR('v', IOCNUM_GET_GPA_PMAP, struct vm_gpa_pte) #define VM_GLA2GPA \ _IOWR('v', IOCNUM_GLA2GPA, struct vm_gla2gpa) +#define VM_GLA2GPA_NOFAULT \ + _IOWR('v', IOCNUM_GLA2GPA_NOFAULT, struct vm_gla2gpa) #define VM_ACTIVATE_CPU \ _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) #define VM_GET_CPUS \ Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Mon Feb 26 19:08:27 2018 (r330031) +++ head/sys/amd64/include/vmm_instruction_emul.h Mon Feb 26 19:19:05 2018 (r330032) @@ -97,6 +97,13 @@ int vmm_fetch_instruction(struct vm *vm, int cpuid, int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, int prot, uint64_t *gpa, int *is_fault); +/* + * Like vm_gla2gpa, but no exceptions are injected into the guest and + * PTEs are not changed. + */ +int vm_gla2gpa_nofault(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *is_fault); + void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); /* Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Mon Feb 26 19:08:27 2018 (r330031) +++ head/sys/amd64/vmm/vmm_dev.c Mon Feb 26 19:19:05 2018 (r330032) @@ -375,6 +375,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da case VM_PPTDEV_MSIX: case VM_SET_X2APIC_STATE: case VM_GLA2GPA: + case VM_GLA2GPA_NOFAULT: case VM_ACTIVATE_CPU: case VM_SET_INTINFO: case VM_GET_INTINFO: @@ -665,6 +666,13 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da ("%s: vm_gla2gpa unknown error %d", __func__, error)); break; } + case VM_GLA2GPA_NOFAULT: + gg = (struct vm_gla2gpa *)data; + error = vm_gla2gpa_nofault(sc->vm, gg->vcpuid, &gg->paging, + gg->gla, gg->prot, &gg->gpa, &gg->fault); + KASSERT(error == 0 || error == EFAULT, + ("%s: vm_gla2gpa unknown error %d", __func__, error)); + break; case VM_ACTIVATE_CPU: vac = (struct vm_activate_cpu *)data; error = vm_activate_cpu(sc->vm, vac->vcpuid); Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Mon Feb 26 19:08:27 2018 (r330031) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Mon Feb 26 19:19:05 2018 (r330032) @@ -1718,9 +1718,9 @@ ptp_hold(struct vm *vm, int vcpu, vm_paddr_t ptpphys, return (ptr); } -int -vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa, int *guest_fault) +static int +_vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *guest_fault, bool check_only) { int nlevels, pfcode, ptpshift, ptpindex, retval, usermode, writable; u_int retries; @@ -1746,7 +1746,8 @@ restart: * XXX assuming a non-stack reference otherwise a stack fault * should be generated. */ - vm_inject_gp(vm, vcpuid); + if (!check_only) + vm_inject_gp(vm, vcpuid); goto fault; } @@ -1776,9 +1777,11 @@ restart: if ((pte32 & PG_V) == 0 || (usermode && (pte32 & PG_U) == 0) || (writable && (pte32 & PG_RW) == 0)) { - pfcode = pf_error_code(usermode, prot, 0, - pte32); - vm_inject_pf(vm, vcpuid, pfcode, gla); + if (!check_only) { + pfcode = pf_error_code(usermode, prot, 0, + pte32); + vm_inject_pf(vm, vcpuid, pfcode, gla); + } goto fault; } @@ -1789,7 +1792,7 @@ restart: * is only set at the last level providing the guest * physical address. */ - if ((pte32 & PG_A) == 0) { + if (!check_only && (pte32 & PG_A) == 0) { if (atomic_cmpset_32(&ptpbase32[ptpindex], pte32, pte32 | PG_A) == 0) { goto restart; @@ -1804,7 +1807,7 @@ restart: } /* Set the dirty bit in the page table entry if necessary */ - if (writable && (pte32 & PG_M) == 0) { + if (!check_only && writable && (pte32 & PG_M) == 0) { if (atomic_cmpset_32(&ptpbase32[ptpindex], pte32, pte32 | PG_M) == 0) { goto restart; @@ -1831,8 +1834,10 @@ restart: pte = ptpbase[ptpindex]; if ((pte & PG_V) == 0) { - pfcode = pf_error_code(usermode, prot, 0, pte); - vm_inject_pf(vm, vcpuid, pfcode, gla); + if (!check_only) { + pfcode = pf_error_code(usermode, prot, 0, pte); + vm_inject_pf(vm, vcpuid, pfcode, gla); + } goto fault; } @@ -1858,13 +1863,15 @@ restart: if ((pte & PG_V) == 0 || (usermode && (pte & PG_U) == 0) || (writable && (pte & PG_RW) == 0)) { - pfcode = pf_error_code(usermode, prot, 0, pte); - vm_inject_pf(vm, vcpuid, pfcode, gla); + if (!check_only) { + pfcode = pf_error_code(usermode, prot, 0, pte); + vm_inject_pf(vm, vcpuid, pfcode, gla); + } goto fault; } /* Set the accessed bit in the page table entry */ - if ((pte & PG_A) == 0) { + if (!check_only && (pte & PG_A) == 0) { if (atomic_cmpset_64(&ptpbase[ptpindex], pte, pte | PG_A) == 0) { goto restart; @@ -1873,8 +1880,11 @@ restart: if (nlevels > 0 && (pte & PG_PS) != 0) { if (pgsize > 1 * GB) { - pfcode = pf_error_code(usermode, prot, 1, pte); - vm_inject_pf(vm, vcpuid, pfcode, gla); + if (!check_only) { + pfcode = pf_error_code(usermode, prot, 1, + pte); + vm_inject_pf(vm, vcpuid, pfcode, gla); + } goto fault; } break; @@ -1884,7 +1894,7 @@ restart: } /* Set the dirty bit in the page table entry if necessary */ - if (writable && (pte & PG_M) == 0) { + if (!check_only && writable && (pte & PG_M) == 0) { if (atomic_cmpset_64(&ptpbase[ptpindex], pte, pte | PG_M) == 0) goto restart; } @@ -1903,6 +1913,24 @@ error: fault: *guest_fault = 1; goto done; +} + +int +vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *guest_fault) +{ + + return (_vm_gla2gpa(vm, vcpuid, paging, gla, prot, gpa, guest_fault, + false)); +} + +int +vm_gla2gpa_nofault(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *guest_fault) +{ + + return (_vm_gla2gpa(vm, vcpuid, paging, gla, prot, gpa, guest_fault, + true)); } int From owner-svn-src-head@freebsd.org Mon Feb 26 19:27:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 591DCF3CD5B; Mon, 26 Feb 2018 19:27:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0DB84F38; Mon, 26 Feb 2018 19:27:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0503D1FA8A; Mon, 26 Feb 2018 19:27:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QJQxl8030415; Mon, 26 Feb 2018 19:26:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QJQxiF030414; Mon, 26 Feb 2018 19:26:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201802261926.w1QJQxiF030414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 26 Feb 2018 19:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330033 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 330033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 19:27:00 -0000 Author: gjb Date: Mon Feb 26 19:26:59 2018 New Revision: 330033 URL: https://svnweb.freebsd.org/changeset/base/330033 Log: Bump the size of virtual machine disk images from 20G to 30G, providing more space for a local buildworld to succeed without attaching separate disks for /usr/src and /usr/obj. Reported by: mckusick MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vm Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Mon Feb 26 19:19:05 2018 (r330032) +++ head/release/Makefile.vm Mon Feb 26 19:26:59 2018 (r330033) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 20G +VMSIZE?= 30G SWAPSIZE?= 1G VMBASE?= vm From owner-svn-src-head@freebsd.org Mon Feb 26 19:28:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C346F3CECD; Mon, 26 Feb 2018 19:28:00 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C41A18511E; Mon, 26 Feb 2018 19:27:59 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEF611FA8B; Mon, 26 Feb 2018 19:27:59 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QJRxsv030489; Mon, 26 Feb 2018 19:27:59 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QJRx94030488; Mon, 26 Feb 2018 19:27:59 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201802261927.w1QJRx94030488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 26 Feb 2018 19:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330034 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 330034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 19:28:00 -0000 Author: dab Date: Mon Feb 26 19:27:59 2018 New Revision: 330034 URL: https://svnweb.freebsd.org/changeset/base/330034 Log: Fix two memory leaks in syslogd A memory leak in syslogd for processing of forward actions was reported. This modification adapts the patch submitted with that bug to fix the leak. While testing the modification, another leak was also found and fixed. PR: 198385 Submitted by: Sreeram Reported by: Sreeram Reviewed by: hrs MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14510 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Mon Feb 26 19:26:59 2018 (r330033) +++ head/usr.sbin/syslogd/syslogd.c Mon Feb 26 19:27:59 2018 (r330034) @@ -180,7 +180,7 @@ static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INI * This structure represents the files that will have log * copies printed. * We require f_file to be valid if f_type is F_FILE, F_CONSOLE, F_TTY - * or if f_type if F_PIPE and f_pid > 0. + * or if f_type is F_PIPE and f_pid > 0. */ struct filed { @@ -382,10 +382,16 @@ close_filed(struct filed *f) return; switch (f->f_type) { - case F_FILE: + case F_FORW: + if (f->f_un.f_forw.f_addr) { + freeaddrinfo(f->f_un.f_forw.f_addr); + f->f_un.f_forw.f_addr = NULL; + } + /*FALLTHROUGH*/ + + case F_FILE: case F_TTY: case F_CONSOLE: - case F_FORW: f->f_type = F_UNUSED; break; case F_PIPE: @@ -1859,6 +1865,7 @@ readconfigfile(FILE *cf, int allow_includes) f = cfline(cline, prog, host); if (f != NULL) addfile(f); + free(f); } } @@ -1956,9 +1963,11 @@ init(int signo) f = cfline("*.ERR\t/dev/console", "*", "*"); if (f != NULL) addfile(f); + free(f); f = cfline("*.PANIC\t*", "*", "*"); if (f != NULL) addfile(f); + free(f); Initialized = 1; return; From owner-svn-src-head@freebsd.org Mon Feb 26 20:31:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115EEF114E8; Mon, 26 Feb 2018 20:31:17 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB57087DED; Mon, 26 Feb 2018 20:31:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B610B20494; Mon, 26 Feb 2018 20:31:16 +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 w1QKVGcZ062586; Mon, 26 Feb 2018 20:31:16 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QKVGrS062585; Mon, 26 Feb 2018 20:31:16 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201802262031.w1QKVGrS062585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Mon, 26 Feb 2018 20:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330035 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 330035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 20:31:17 -0000 Author: pkelsey Date: Mon Feb 26 20:31:16 2018 New Revision: 330035 URL: https://svnweb.freebsd.org/changeset/base/330035 Log: Ensure signed comparison to avoid false trip of assert during VNET teardown. Reported by: lwhsu MFC after: 1 month Modified: head/sys/netinet/tcp_fastopen.c Modified: head/sys/netinet/tcp_fastopen.c ============================================================================== --- head/sys/netinet/tcp_fastopen.c Mon Feb 26 19:27:59 2018 (r330034) +++ head/sys/netinet/tcp_fastopen.c Mon Feb 26 20:31:16 2018 (r330035) @@ -1101,7 +1101,7 @@ tcp_fastopen_ccache_bucket_trim(struct tcp_fastopen_cc if (entries > limit) tcp_fastopen_ccache_entry_drop(cce, ccb); } - KASSERT(ccb->ccb_num_entries <= limit, + KASSERT(ccb->ccb_num_entries <= (int)limit, ("%s: ccb->ccb_num_entries %d exceeds limit %d", __func__, ccb->ccb_num_entries, limit)); if (limit == 0) { From owner-svn-src-head@freebsd.org Mon Feb 26 21:25:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FEFDF23B6A; Mon, 26 Feb 2018 21:25:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFE0A6A3A1; Mon, 26 Feb 2018 21:25:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC87120E3E; Mon, 26 Feb 2018 21:25:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QLPpgQ089824; Mon, 26 Feb 2018 21:25:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QLPpc1089816; Mon, 26 Feb 2018 21:25:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802262125.w1QLPpc1089816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Feb 2018 21:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330036 - in head/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf X-SVN-Commit-Revision: 330036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 21:25:52 -0000 Author: manu Date: Mon Feb 26 21:25:50 2018 New Revision: 330036 URL: https://svnweb.freebsd.org/changeset/base/330036 Log: rk3328: Add support for this SoC * rk_cru is a cru driver that needs to be subclassed by the real CRU driver * rk_clk_pll handle the pll type clock on RockChip SoC, it's only read only for now. * rk_clk_composite handle the different composite clock types (with gate, with mux etc ...) * rk_clk_gate handle the RockChip gates * rk_clk_mux handle the RockChip muxes (unused for now) * Only clocks for supported devices are supported for now, the rest will be added when driver support comes * The assigned-clock* property are not handled for now so we rely a lot on the bootloader to setup some initial values for some clocks. Added: head/sys/arm64/rockchip/ head/sys/arm64/rockchip/clk/ head/sys/arm64/rockchip/clk/rk3328_cru.c (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_composite.c (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_composite.h (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_gate.c (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_gate.h (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_mux.c (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_mux.h (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_pll.c (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_pll.h (contents, props changed) head/sys/arm64/rockchip/clk/rk_cru.c (contents, props changed) head/sys/arm64/rockchip/clk/rk_cru.h (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/conf/options.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Mon Feb 26 20:31:16 2018 (r330035) +++ head/sys/arm64/conf/GENERIC Mon Feb 26 21:25:50 2018 (r330036) @@ -97,6 +97,7 @@ options SOC_ALLWINNER_H5 options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 options SOC_BRCM_BCM2837 +options SOC_ROCKCHIP_RK3328 # Annapurna Alpine drivers device al_ccu # Alpine Cache Coherency Unit Added: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Mon Feb 26 21:25:50 2018 (r330036) @@ -0,0 +1,476 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include + +/* GATES */ + +#define ACLK_PERI 153 +#define HCLK_SDMMC 317 +#define HCLK_SDIO 318 +#define HCLK_EMMC 319 +#define HCLK_SDMMC_EXT 320 + +static struct rk_cru_gate rk3328_gates[] = { + /* CRU_CLKGATE_CON0 */ + CRU_GATE(0, "apll_core", "apll", 0x200, 0) + CRU_GATE(0, "dpll_core", "dpll", 0x200, 1) + CRU_GATE(0, "gpll_core", "gpll", 0x200, 2) + CRU_GATE(0, "npll_core", "npll", 0x200, 12) + + /* CRU_CLKGATE_CON4 */ + CRU_GATE(0, "gpll_peri", "gpll", 0x210, 0) + CRU_GATE(0, "cpll_peri", "cpll", 0x210, 1) + + /* CRU_CLKGATE_CON8 */ + CRU_GATE(0, "pclk_bus", "pclk_bus_pre", 0x220, 3) + CRU_GATE(0, "pclk_phy_pre", "pclk_bus_pre", 0x220, 4) + + /* CRU_CLKGATE_CON10 */ + CRU_GATE(ACLK_PERI, "aclk_peri", "aclk_peri_pre", 0x228, 0) + + /* CRU_CLKGATE_CON19 */ + CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0x24C, 0) + CRU_GATE(HCLK_SDIO, "hclk_sdio", "hclk_peri", 0x24C, 1) + CRU_GATE(HCLK_EMMC, "hclk_emmc", "hclk_peri", 0x24C, 2) + CRU_GATE(HCLK_SDMMC_EXT, "hclk_sdmmc_ext", "hclk_peri", 0x24C, 15) +}; + +/* + * PLLs + */ + +#define PLL_APLL 1 +#define PLL_DPLL 2 +#define PLL_CPLL 3 +#define PLL_GPLL 4 +#define PLL_NPLL 5 + +static const char *pll_parents[] = {"xin24m"}; +static struct rk_clk_pll_def apll = { + .clkdef = { + .id = PLL_APLL, + .name = "apll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x00, + .gate_offset = 0x200, + .gate_shift = 0, + .flags = RK_CLK_PLL_HAVE_GATE, +}; + +static struct rk_clk_pll_def dpll = { + .clkdef = { + .id = PLL_DPLL, + .name = "dpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x20, + .gate_offset = 0x200, + .gate_shift = 1, + .flags = RK_CLK_PLL_HAVE_GATE, +}; + +static struct rk_clk_pll_def cpll = { + .clkdef = { + .id = PLL_CPLL, + .name = "cpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x40, +}; + +static struct rk_clk_pll_def gpll = { + .clkdef = { + .id = PLL_GPLL, + .name = "gpll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x60, + .gate_offset = 0x200, + .gate_shift = 2, + .flags = RK_CLK_PLL_HAVE_GATE, +}; + +static struct rk_clk_pll_def npll = { + .clkdef = { + .id = PLL_NPLL, + .name = "npll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0xa0, + .gate_offset = 0x200, + .gate_shift = 12, + .flags = RK_CLK_PLL_HAVE_GATE, +}; + +/* CRU_CLKSEL_CON0 */ +#define ACLK_BUS_PRE 136 + +/* Needs hdmiphy as parent too*/ +static const char *aclk_bus_pre_parents[] = {"cpll", "gpll"}; +static struct rk_clk_composite_def aclk_bus_pre = { + .clkdef = { + .id = ACLK_BUS_PRE, + .name = "aclk_bus_pre", + .parent_names = aclk_bus_pre_parents, + .parent_cnt = nitems(aclk_bus_pre_parents), + }, + .muxdiv_offset = 0x100, + .mux_shift = 13, + .mux_width = 2, + + .div_shift = 8, + .div_width = 5, + + .gate_offset = 0x232, + .gate_shift = 0, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +/* CRU_CLKSEL_CON1 */ + +#define PCLK_BUS_PRE 216 +#define HCLK_BUS_PRE 328 + +static const char *hclk_bus_pre_parents[] = {"aclk_bus_pre"}; +static struct rk_clk_composite_def hclk_bus_pre = { + .clkdef = { + .id = HCLK_BUS_PRE, + .name = "hclk_bus_pre", + .parent_names = hclk_bus_pre_parents, + .parent_cnt = nitems(hclk_bus_pre_parents), + }, + .muxdiv_offset = 0x104, + + .div_shift = 8, + .div_width = 2, + + .gate_offset = 0x232, + .gate_shift = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static const char *pclk_bus_pre_parents[] = {"aclk_bus_pre"}; +static struct rk_clk_composite_def pclk_bus_pre = { + .clkdef = { + .id = PCLK_BUS_PRE, + .name = "pclk_bus_pre", + .parent_names = pclk_bus_pre_parents, + .parent_cnt = nitems(pclk_bus_pre_parents), + }, + .muxdiv_offset = 0x104, + + .div_shift = 12, + .div_width = 3, + + .gate_offset = 0x232, + .gate_shift = 2, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + +/* CRU_CLKSEL_CON28 */ + +#define ACLK_PERI_PRE 137 + +static const char *aclk_peri_pre_parents[] = {"cpll", "gpll"/* , "hdmiphy" */}; +static struct rk_clk_composite_def aclk_peri_pre = { + .clkdef = { + .id = ACLK_PERI_PRE, + .name = "aclk_peri_pre", + .parent_names = aclk_peri_pre_parents, + .parent_cnt = nitems(aclk_peri_pre_parents), + }, + .muxdiv_offset = 0x170, + + .mux_shift = 6, + .mux_width = 2, + + .div_shift = 0, + .div_width = 5, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX, +}; + +/* CRU_CLKSEL_CON29 */ + +#define PCLK_PERI 230 +#define HCLK_PERI 308 + +static const char *phclk_peri_parents[] = {"aclk_peri_pre"}; +static struct rk_clk_composite_def pclk_peri = { + .clkdef = { + .id = PCLK_PERI, + .name = "pclk_peri", + .parent_names = phclk_peri_parents, + .parent_cnt = nitems(phclk_peri_parents), + }, + + .div_shift = 0, + .div_width = 2, + + /* CRU_CLKGATE_CON10 */ + .gate_offset = 0x228, + .gate_shift = 2, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk_composite_def hclk_peri = { + .clkdef = { + .id = HCLK_PERI, + .name = "hclk_peri", + .parent_names = phclk_peri_parents, + .parent_cnt = nitems(phclk_peri_parents), + }, + + .div_shift = 4, + .div_width = 3, + + /* CRU_CLKGATE_CON10 */ + .gate_offset = 0x228, + .gate_shift = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + +/* CRU_CLKSEL_CON30 */ + +#define SCLK_SDMMC 33 + +static const char *mmc_parents[] = {"cpll", "gpll", "xin24m"/* , "usb480m" */}; +static struct rk_clk_composite_def sdmmc = { + .clkdef = { + .id = SCLK_SDMMC, + .name = "clk_sdmmc", + .parent_names = mmc_parents, + .parent_cnt = nitems(mmc_parents), + }, + .muxdiv_offset = 0x178, + + .mux_shift = 8, + .mux_width = 2, + + .div_shift = 0, + .div_width = 8, + + /* CRU_CLKGATE_CON4 */ + .gate_offset = 0x210, + .gate_shift = 3, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +/* CRU_CLKSEL_CON31 */ +#define SCLK_SDIO 34 + +static struct rk_clk_composite_def sdio = { + .clkdef = { + .id = SCLK_SDIO, + .name = "clk_sdio", + .parent_names = mmc_parents, + .parent_cnt = nitems(mmc_parents), + }, + .muxdiv_offset = 0x17C, + + .mux_shift = 8, + .mux_width = 2, + + .div_shift = 0, + .div_width = 8, + + /* CRU_CLKGATE_CON4 */ + .gate_offset = 0x210, + .gate_shift = 4, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +/* CRU_CLKSEL_CON32 */ +#define SCLK_EMMC 35 + +static struct rk_clk_composite_def emmc = { + .clkdef = { + .id = SCLK_EMMC, + .name = "clk_emmc", + .parent_names = mmc_parents, + .parent_cnt = nitems(mmc_parents), + }, + .muxdiv_offset = 0x180, + + .mux_shift = 8, + .mux_width = 2, + + .div_shift = 0, + .div_width = 8, + + /* CRU_CLKGATE_CON4 */ + .gate_offset = 0x210, + .gate_shift = 5, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk rk3328_clks[] = { + [PLL_APLL] = { + .type = RK_CLK_PLL, + .clk.pll = &apll + }, + [PLL_DPLL] = { + .type = RK_CLK_PLL, + .clk.pll = &dpll + }, + [PLL_CPLL] = { + .type = RK_CLK_PLL, + .clk.pll = &cpll + }, + [PLL_GPLL] = { + .type = RK_CLK_PLL, + .clk.pll = &gpll + }, + [PLL_NPLL] = { + .type = RK_CLK_PLL, + .clk.pll = &npll + }, + + [ACLK_BUS_PRE] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &aclk_bus_pre + }, + [HCLK_BUS_PRE] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &hclk_bus_pre + }, + [PCLK_BUS_PRE] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &pclk_bus_pre + }, + + [ACLK_PERI_PRE] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &aclk_peri_pre, + }, + [PCLK_PERI] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &pclk_peri, + }, + [HCLK_PERI] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &hclk_peri, + }, + [SCLK_SDMMC] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &sdmmc + }, + [SCLK_SDIO] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &sdio + }, + [SCLK_EMMC] = { + .type = RK_CLK_COMPOSITE, + .clk.composite = &emmc + }, +}; + +static int +rk3328_cru_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "rockchip,rk3328-cru")) { + device_set_desc(dev, "Rockchip RK3328 Clock and Reset Unit"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +rk3328_cru_attach(device_t dev) +{ + struct rk_cru_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + + sc->gates = rk3328_gates; + sc->ngates = nitems(rk3328_gates); + + sc->clks = rk3328_clks; + sc->nclks = nitems(rk3328_clks); + + return (rk_cru_attach(dev)); +} + +static device_method_t rk3328_cru_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rk3328_cru_probe), + DEVMETHOD(device_attach, rk3328_cru_attach), + + DEVMETHOD_END +}; + +static devclass_t rk3328_cru_devclass; + +DEFINE_CLASS_1(rk3328_cru, rk3328_cru_driver, rk3328_cru_methods, + sizeof(struct rk_cru_softc), rk_cru_driver); + +EARLY_DRIVER_MODULE(rk3328_cru, simplebus, rk3328_cru_driver, + rk3328_cru_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Added: head/sys/arm64/rockchip/clk/rk_clk_composite.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.c Mon Feb 26 21:25:50 2018 (r330036) @@ -0,0 +1,255 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include + +#include "clkdev_if.h" + +struct rk_clk_composite_sc { + uint32_t muxdiv_offset; + uint32_t mux_shift; + uint32_t mux_width; + uint32_t mux_mask; + + uint32_t div_shift; + uint32_t div_width; + uint32_t div_mask; + + uint32_t gate_offset; + uint32_t gate_shift; + + uint32_t flags; +}; + +#define WRITE4(_clk, off, val) \ + CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) +#define READ4(_clk, off, val) \ + CLKDEV_READ_4(clknode_get_device(_clk), off, val) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) + +#define RK_COMPOSITE_WRITE_MASK 0xFFFF0000 + +static int +rk_clk_composite_init(struct clknode *clk, device_t dev) +{ + struct rk_clk_composite_sc *sc; + uint32_t val, idx; + + sc = clknode_get_softc(clk); + + idx = 0; + if ((sc->flags & RK_CLK_COMPOSITE_HAVE_MUX) != 0) { + DEVICE_LOCK(clk); + READ4(clk, sc->muxdiv_offset, &val); + DEVICE_UNLOCK(clk); + + idx = (val & sc->mux_mask) >> sc->mux_shift; + } + + clknode_init_parent_idx(clk, idx); + + return (0); +} + +static int +rk_clk_composite_set_gate(struct clknode *clk, bool enable) +{ + struct rk_clk_composite_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & RK_CLK_COMPOSITE_HAVE_GATE) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->gate_offset, &val); + if (enable) + val &= ~(1 << sc->gate_shift); + else + val |= 1 << sc->gate_shift; + WRITE4(clk, sc->gate_offset, val | RK_CLK_COMPOSITE_MASK); + DEVICE_UNLOCK(clk); + + return (0); +} + +static int +rk_clk_composite_set_mux(struct clknode *clk, int index) +{ + struct rk_clk_composite_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & RK_CLK_COMPOSITE_HAVE_MUX) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->muxdiv_offset, &val); + val &= ~(sc->mux_mask >> sc->mux_shift); + val |= index << sc->mux_shift; + WRITE4(clk, sc->muxdiv_offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static int +rk_clk_composite_recalc(struct clknode *clk, uint64_t *freq) +{ + struct rk_clk_composite_sc *sc; + uint32_t reg, div; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + + READ4(clk, sc->muxdiv_offset, ®); + + DEVICE_UNLOCK(clk); + + div = ((reg & sc->div_mask) >> sc->div_shift) + 1; + + *freq = *freq / div; + + return (0); +} + +static int +rk_clk_composite_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, + int flags, int *stop) +{ + struct rk_clk_composite_sc *sc; + uint64_t best, cur; + uint32_t div, best_div, val; + + sc = clknode_get_softc(clk); + + for (best = 0, best_div = 0, div = 0; div <= sc->div_mask; div++) { + cur = fparent / div; + if ((*fout - cur) < (*fout - best)) { + best = cur; + best_div = div; + break; + } + } + + if (best_div == 0) + return (0); + + if ((best < *fout) && + ((flags & CLK_SET_ROUND_DOWN) == 0)) { + *stop = 1; + return (ERANGE); + } + if ((best > *fout) && + ((flags & CLK_SET_ROUND_UP) == 0)) { + *stop = 1; + return (ERANGE); + } + + if ((flags & CLK_SET_DRYRUN) != 0) { + *fout = best; + *stop = 1; + return (0); + } + + DEVICE_LOCK(clk); + READ4(clk, sc->muxdiv_offset, &val); + val &= ~sc->div_mask; + val |= (best_div - 1) << sc->div_shift; + WRITE4(clk, sc->muxdiv_offset, val | RK_CLK_COMPOSITE_MASK); + DEVICE_UNLOCK(clk); + + *fout = best; + *stop = 1; + + return (0); +} + +static clknode_method_t rk_clk_composite_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, rk_clk_composite_init), + CLKNODEMETHOD(clknode_set_gate, rk_clk_composite_set_gate), + CLKNODEMETHOD(clknode_set_mux, rk_clk_composite_set_mux), + CLKNODEMETHOD(clknode_recalc_freq, rk_clk_composite_recalc), + CLKNODEMETHOD(clknode_set_freq, rk_clk_composite_set_freq), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(rk_clk_composite_clknode, rk_clk_composite_clknode_class, + rk_clk_composite_clknode_methods, sizeof(struct rk_clk_composite_sc), + clknode_class); + +int +rk_clk_composite_register(struct clkdom *clkdom, struct rk_clk_composite_def *clkdef) +{ + struct clknode *clk; + struct rk_clk_composite_sc *sc; + + clk = clknode_create(clkdom, &rk_clk_composite_clknode_class, + &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + + sc->muxdiv_offset = clkdef->muxdiv_offset; + + sc->mux_shift = clkdef->mux_shift; + sc->mux_width = clkdef->mux_width; + sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; + + sc->div_shift = clkdef->div_shift; + sc->div_width = clkdef->div_width; + sc->div_mask = ((1 << clkdef->div_width) - 1) << sc->div_shift; + + sc->gate_offset = clkdef->gate_offset; + sc->gate_shift = clkdef->gate_shift; + + sc->flags = clkdef->flags; + + clknode_register(clkdom, clk); + + return (0); +} Added: head/sys/arm64/rockchip/clk/rk_clk_composite.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.h Mon Feb 26 21:25:50 2018 (r330036) @@ -0,0 +1,61 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2018 Emmanuel Vadot + * 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$ + */ + +#ifndef _RK_CLK_COMPOSITE_H_ +#define _RK_CLK_COMPOSITE_H_ + +#include + +struct rk_clk_composite_def { + struct clknode_init_def clkdef; + + uint32_t muxdiv_offset; + + uint32_t mux_shift; + uint32_t mux_width; + + uint32_t div_shift; + uint32_t div_width; + + uint32_t gate_offset; + uint32_t gate_shift; + + uint32_t flags; +}; + +#define RK_CLK_COMPOSITE_HAVE_MUX 0x0001 +#define RK_CLK_COMPOSITE_HAVE_GATE 0x0002 + +#define RK_CLK_COMPOSITE_MASK 0xFFFF0000 + +int rk_clk_composite_register(struct clkdom *clkdom, + struct rk_clk_composite_def *clkdef); + +#endif /* _RK_CLK_COMPOSITE_H_ */ Added: head/sys/arm64/rockchip/clk/rk_clk_gate.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/clk/rk_clk_gate.c Mon Feb 26 21:25:50 2018 (r330036) @@ -0,0 +1,135 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include + +#include "clkdev_if.h" + +#define WR4(_clk, off, val) \ + CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) +#define RD4(_clk, off, val) \ + CLKDEV_READ_4(clknode_get_device(_clk), off, val) +#define MD4(_clk, off, clr, set ) \ + CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) + +static int rk_clk_gate_init(struct clknode *clk, device_t dev); +static int rk_clk_gate_set_gate(struct clknode *clk, bool enable); +struct rk_clk_gate_sc { + uint32_t offset; + uint32_t shift; + uint32_t mask; + uint32_t on_value; + uint32_t off_value; + int gate_flags; + bool ungated; +}; + +static clknode_method_t rk_clk_gate_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, rk_clk_gate_init), + CLKNODEMETHOD(clknode_set_gate, rk_clk_gate_set_gate), + CLKNODEMETHOD_END +}; +DEFINE_CLASS_1(rk_clk_gate, rk_clk_gate_class, rk_clk_gate_methods, + sizeof(struct rk_clk_gate_sc), clknode_class); + +static int +rk_clk_gate_init(struct clknode *clk, device_t dev) +{ + uint32_t reg; + struct rk_clk_gate_sc *sc; + int rv; + + sc = clknode_get_softc(clk); + DEVICE_LOCK(clk); + rv = RD4(clk, sc->offset, ®); + DEVICE_UNLOCK(clk); + if (rv != 0) + return (rv); + reg = (reg >> sc->shift) & sc->mask; + sc->ungated = reg == sc->on_value ? 1 : 0; + clknode_init_parent_idx(clk, 0); + return(0); +} + +static int +rk_clk_gate_set_gate(struct clknode *clk, bool enable) +{ + uint32_t reg; + struct rk_clk_gate_sc *sc; + int rv; + + sc = clknode_get_softc(clk); + sc->ungated = enable; + DEVICE_LOCK(clk); + rv = MD4(clk, sc->offset, sc->mask << sc->shift, + ((sc->ungated ? sc->on_value : sc->off_value) << sc->shift) | + RK_CLK_GATE_MASK); + if (rv != 0) { + DEVICE_UNLOCK(clk); + return (rv); + } + RD4(clk, sc->offset, ®); + DEVICE_UNLOCK(clk); + return(0); +} + +int +rk_clk_gate_register(struct clkdom *clkdom, struct rk_clk_gate_def *clkdef) +{ + struct clknode *clk; + struct rk_clk_gate_sc *sc; + + clk = clknode_create(clkdom, &rk_clk_gate_class, &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + sc->offset = clkdef->offset; + sc->shift = clkdef->shift; + sc->mask = clkdef->mask; + sc->on_value = clkdef->on_value; + sc->off_value = clkdef->off_value; + sc->gate_flags = clkdef->gate_flags; + + clknode_register(clkdom, clk); + return (0); +} Added: head/sys/arm64/rockchip/clk/rk_clk_gate.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/clk/rk_clk_gate.h Mon Feb 26 21:25:50 2018 (r330036) @@ -0,0 +1,50 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2018 Emmanuel Vadot + * 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$ + */ + +#ifndef _RK_CLK_GATE_H_ +#define _RK_CLK_GATE_H_ + +#include + +struct rk_clk_gate_def { + struct clknode_init_def clkdef; + uint32_t offset; + uint32_t shift; + uint32_t mask; + uint32_t on_value; + uint32_t off_value; + int gate_flags; +}; + +#define RK_CLK_GATE_MASK 0xFFFF0000 + +int rk_clk_gate_register(struct clkdom *clkdom, struct rk_clk_gate_def *clkdef); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 26 21:27:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 964C2F23E21; Mon, 26 Feb 2018 21:27:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 496FE6A5BD; Mon, 26 Feb 2018 21:27:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F85620E3F; Mon, 26 Feb 2018 21:27:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QLRhYg089938; Mon, 26 Feb 2018 21:27:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QLRg4i089936; Mon, 26 Feb 2018 21:27:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802262127.w1QLRg4i089936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Feb 2018 21:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330037 - head/sys/dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/mmc/host X-SVN-Commit-Revision: 330037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 21:27:43 -0000 Author: manu Date: Mon Feb 26 21:27:42 2018 New Revision: 330037 URL: https://svnweb.freebsd.org/changeset/base/330037 Log: dwmmc: Add clock support and other improvements * If compiled with EXT_RESOURCES look up the "biu" and "ciu" clocks in the DT * Don't use custom property "bus-frequency" but the standard one "clock-frequency" * Use the DT property max-frequency and fall back to 200Mhz if it don't exists * Add more mmc caps suported by the controller * Always ack all interrupts * Subclassed driver can supply an update_ios so they can handle update the clocks accordingly * Take care of the DDR bit in update_ios (no functional change since we do not support voltage change for now) * Make use of the FDT bus-width property Modified: head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/host/dwmmc_var.h Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Mon Feb 26 21:25:50 2018 (r330036) +++ head/sys/dev/mmc/host/dwmmc.c Mon Feb 26 21:27:42 2018 (r330037) @@ -56,6 +56,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EXT_RESOURCES +#include +#endif + #include #include @@ -341,14 +345,12 @@ dwmmc_intr(void *arg) dprintf("%s 0x%08x\n", __func__, reg); if (reg & DWMMC_CMD_ERR_FLAGS) { - WRITE4(sc, SDMMC_RINTSTS, DWMMC_CMD_ERR_FLAGS); dprintf("cmd err 0x%08x cmd 0x%08x\n", reg, cmd->opcode); cmd->error = MMC_ERR_TIMEOUT; } if (reg & DWMMC_DATA_ERR_FLAGS) { - WRITE4(sc, SDMMC_RINTSTS, DWMMC_DATA_ERR_FLAGS); dprintf("data err 0x%08x cmd 0x%08x\n", reg, cmd->opcode); cmd->error = MMC_ERR_FAILED; @@ -361,25 +363,22 @@ dwmmc_intr(void *arg) if (reg & SDMMC_INTMASK_CMD_DONE) { dwmmc_cmd_done(sc); sc->cmd_done = 1; - WRITE4(sc, SDMMC_RINTSTS, SDMMC_INTMASK_CMD_DONE); } - if (reg & SDMMC_INTMASK_ACD) { + if (reg & SDMMC_INTMASK_ACD) sc->acd_rcvd = 1; - WRITE4(sc, SDMMC_RINTSTS, SDMMC_INTMASK_ACD); - } - if (reg & SDMMC_INTMASK_DTO) { + if (reg & SDMMC_INTMASK_DTO) sc->dto_rcvd = 1; - WRITE4(sc, SDMMC_RINTSTS, SDMMC_INTMASK_DTO); - } if (reg & SDMMC_INTMASK_CD) { /* XXX: Handle card detect */ - WRITE4(sc, SDMMC_RINTSTS, SDMMC_INTMASK_CD); } } + /* Ack interrupts */ + WRITE4(sc, SDMMC_RINTSTS, reg); + if (sc->use_pio) { if (reg & (SDMMC_INTMASK_RXDR|SDMMC_INTMASK_DTO)) { pio_read(sc, cmd); @@ -411,37 +410,88 @@ parse_fdt(struct dwmmc_softc *sc) { pcell_t dts_value[3]; phandle_t node; + uint32_t bus_hz = 0, bus_width; int len; +#ifdef EXT_RESOURCES + int error; +#endif if ((node = ofw_bus_get_node(sc->dev)) == -1) return (ENXIO); + /* bus-width */ + if (OF_getencprop(node, "bus-width", &bus_width, sizeof(uint32_t)) <= 0) + bus_width = 4; + if (bus_width >= 4) + sc->host.caps |= MMC_CAP_4_BIT_DATA; + if (bus_width >= 8) + sc->host.caps |= MMC_CAP_8_BIT_DATA; + + /* max-frequency */ + if (OF_getencprop(node, "max-frequency", &sc->max_hz, sizeof(uint32_t)) <= 0) + sc->max_hz = 200000000; + /* fifo-depth */ if ((len = OF_getproplen(node, "fifo-depth")) > 0) { OF_getencprop(node, "fifo-depth", dts_value, len); sc->fifo_depth = dts_value[0]; } - /* num-slots */ + /* num-slots (Deprecated) */ sc->num_slots = 1; if ((len = OF_getproplen(node, "num-slots")) > 0) { + device_printf(sc->dev, "num-slots property is deprecated\n"); OF_getencprop(node, "num-slots", dts_value, len); sc->num_slots = dts_value[0]; } + /* clock-frequency */ + if ((len = OF_getproplen(node, "clock-frequency")) > 0) { + OF_getencprop(node, "clock-frequency", dts_value, len); + bus_hz = dts_value[0]; + } + +#ifdef EXT_RESOURCES + /* BIU (Bus Interface Unit clock) is optional */ + error = clk_get_by_ofw_name(sc->dev, 0, "biu", &sc->biu); + if (sc->biu) { + error = clk_enable(sc->biu); + if (error != 0) { + device_printf(sc->dev, "cannot enable biu clock\n"); + goto fail; + } + } + /* - * We need some platform-specific code to know - * what the clock is supplied for our device. - * For now rely on the value specified in FDT. + * CIU (Controller Interface Unit clock) is mandatory + * if no clock-frequency property is given */ + error = clk_get_by_ofw_name(sc->dev, 0, "ciu", &sc->ciu); + if (sc->ciu) { + error = clk_enable(sc->ciu); + if (error != 0) { + device_printf(sc->dev, "cannot enable ciu clock\n"); + goto fail; + } + if (bus_hz != 0) { + error = clk_set_freq(sc->ciu, bus_hz, 0); + if (error != 0) + device_printf(sc->dev, + "cannot set ciu clock to %u\n", bus_hz); + } + clk_get_freq(sc->ciu, &sc->bus_hz); + } +#endif /* EXT_RESOURCES */ + if (sc->bus_hz == 0) { - if ((len = OF_getproplen(node, "bus-frequency")) <= 0) - return (ENXIO); - OF_getencprop(node, "bus-frequency", dts_value, len); - sc->bus_hz = dts_value[0]; + device_printf(sc->dev, "No bus speed provided\n"); + goto fail; } return (0); + +fail: + return (ENXIO); } int @@ -541,9 +591,10 @@ dwmmc_attach(device_t dev) WRITE4(sc, SDMMC_CTRL, SDMMC_CTRL_INT_ENABLE); sc->host.f_min = 400000; - sc->host.f_max = min(200000000, sc->bus_hz); + sc->host.f_max = sc->max_hz; sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; - sc->host.caps = MMC_CAP_4_BIT_DATA; + sc->host.caps |= MMC_CAP_HSPEED; + sc->host.caps |= MMC_CAP_SIGNALING_330; device_add_child(dev, "mmc", -1); return (bus_generic_attach(dev)); @@ -608,6 +659,8 @@ dwmmc_update_ios(device_t brdev, device_t reqdev) { struct dwmmc_softc *sc; struct mmc_ios *ios; + uint32_t reg; + int ret = 0; sc = device_get_softc(brdev); ios = &sc->host.ios; @@ -615,8 +668,6 @@ dwmmc_update_ios(device_t brdev, device_t reqdev) dprintf("Setting up clk %u bus_width %d\n", ios->clock, ios->bus_width); - dwmmc_setup_bus(sc, ios->clock); - if (ios->bus_width == bus_width_8) WRITE4(sc, SDMMC_CTYPE, SDMMC_CTYPE_8BIT); else if (ios->bus_width == bus_width_4) @@ -629,15 +680,22 @@ dwmmc_update_ios(device_t brdev, device_t reqdev) WRITE4(sc, SDMMC_CLKSEL, sc->sdr_timing); } - /* - * XXX: take care about DDR bit - * - * reg = READ4(sc, SDMMC_UHS_REG); - * reg |= (SDMMC_UHS_REG_DDR); - * WRITE4(sc, SDMMC_UHS_REG, reg); - */ + /* Set DDR mode */ + reg = READ4(sc, SDMMC_UHS_REG); + if (ios->timing == bus_timing_uhs_ddr50 || + ios->timing == bus_timing_mmc_ddr52 || + ios->timing == bus_timing_mmc_hs400) + reg |= (SDMMC_UHS_REG_DDR); + else + reg &= ~(SDMMC_UHS_REG_DDR); + WRITE4(sc, SDMMC_UHS_REG, reg); - return (0); + if (sc->update_ios) + ret = sc->update_ios(sc, ios); + + dwmmc_setup_bus(sc, ios->clock); + + return (ret); } static int @@ -1032,7 +1090,6 @@ dwmmc_read_ivar(device_t bus, device_t child, int whic *(int *)result = sc->host.ios.vdd; break; case MMCBR_IVAR_CAPS: - sc->host.caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: Modified: head/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- head/sys/dev/mmc/host/dwmmc_var.h Mon Feb 26 21:25:50 2018 (r330036) +++ head/sys/dev/mmc/host/dwmmc_var.h Mon Feb 26 21:27:42 2018 (r330037) @@ -33,6 +33,10 @@ #ifndef DEV_MMC_HOST_DWMMC_VAR_H #define DEV_MMC_HOST_DWMMC_VAR_H +#ifdef EXT_RESOURCES +#include +#endif + enum { HWTYPE_NONE, HWTYPE_ALTERA, @@ -56,6 +60,8 @@ struct dwmmc_softc { uint32_t pwren_inverted; u_int desc_count; + int (*update_ios)(struct dwmmc_softc *sc, struct mmc_ios *ios); + bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; struct idmac_desc *desc_ring; @@ -67,11 +73,17 @@ struct dwmmc_softc { uint32_t dto_rcvd; uint32_t acd_rcvd; uint32_t cmd_done; - uint32_t bus_hz; + uint64_t bus_hz; + uint32_t max_hz; uint32_t fifo_depth; uint32_t num_slots; uint32_t sdr_timing; uint32_t ddr_timing; + +#ifdef EXT_RESOURCES + clk_t biu; + clk_t ciu; +#endif }; DECLARE_CLASS(dwmmc_driver); From owner-svn-src-head@freebsd.org Mon Feb 26 21:29:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BBAAF23F81; Mon, 26 Feb 2018 21:29:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E26296A754; Mon, 26 Feb 2018 21:29:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC23120E40; Mon, 26 Feb 2018 21:29:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QLT1J2090037; Mon, 26 Feb 2018 21:29:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QLT1A1090035; Mon, 26 Feb 2018 21:29:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802262129.w1QLT1A1090035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Feb 2018 21:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330038 - in head/sys: conf dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf dev/mmc/host X-SVN-Commit-Revision: 330038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 21:29:02 -0000 Author: manu Date: Mon Feb 26 21:29:01 2018 New Revision: 330038 URL: https://svnweb.freebsd.org/changeset/base/330038 Log: dwmmc_rockchip: Add support for rk3328-dw-mshc * Do not use pio mode like rk2928 * Change clocks frequency in update_ios Tested-On: Pine64 Rock64 (RK3328) Modified: head/sys/conf/files.arm64 head/sys/dev/mmc/host/dwmmc_rockchip.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Feb 26 21:27:42 2018 (r330037) +++ head/sys/conf/files.arm64 Mon Feb 26 21:29:01 2018 (r330038) @@ -185,6 +185,7 @@ dev/hwpmc/hwpmc_arm64_md.c optional hwpmc dev/mbox/mbox_if.m optional soc_brcm_bcm2837 dev/mmc/host/dwmmc.c optional dwmmc fdt dev/mmc/host/dwmmc_hisi.c optional dwmmc fdt soc_hisi_hi6220 +dev/mmc/host/dwmmc_rockchip.c optional dwmmc fdt soc_rockchip_rk3328 dev/neta/if_mvneta_fdt.c optional neta fdt dev/neta/if_mvneta.c optional neta mdio mii dev/ofw/ofw_cpu.c optional fdt Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_rockchip.c Mon Feb 26 21:27:42 2018 (r330037) +++ head/sys/dev/mmc/host/dwmmc_rockchip.c Mon Feb 26 21:29:01 2018 (r330038) @@ -41,11 +41,19 @@ __FBSDID("$FreeBSD$"); #include +enum RKTYPE { + RK2928 = 1, + RK3328, +}; + static struct ofw_compat_data compat_data[] = { - {"rockchip,rk2928-dw-mshc", 1}, + {"rockchip,rk2928-dw-mshc", RK2928}, + {"rockchip,rk3328-dw-mshc", RK3328}, {NULL, 0}, }; +static int dwmmc_rockchip_update_ios(struct dwmmc_softc *sc, struct mmc_ios *ios); + static int rockchip_dwmmc_probe(device_t dev) { @@ -66,14 +74,50 @@ static int rockchip_dwmmc_attach(device_t dev) { struct dwmmc_softc *sc; + int type; sc = device_get_softc(dev); sc->hwtype = HWTYPE_ROCKCHIP; + type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - sc->use_pio = 1; + switch (type) { + case RK2928: + sc->use_pio = 1; + break; + } + sc->pwren_inverted = 1; + sc->update_ios = &dwmmc_rockchip_update_ios; + return (dwmmc_attach(dev)); +} + +static int +dwmmc_rockchip_update_ios(struct dwmmc_softc *sc, struct mmc_ios *ios) +{ + unsigned int clock; + int error; + + if (ios->clock && ios->clock != sc->bus_hz) { + sc->bus_hz = clock = ios->clock; + /* Set the MMC clock. */ + if (sc->ciu) { + /* + * Apparently you need to set the ciu clock to + * the double of bus_hz + */ + error = clk_set_freq(sc->ciu, clock * 2, + CLK_SET_ROUND_DOWN); + if (error != 0) { + device_printf(sc->dev, + "failed to set frequency to %u Hz: %d\n", + clock, error); + return (error); + } + } + } + return (0); } static device_method_t rockchip_dwmmc_methods[] = { From owner-svn-src-head@freebsd.org Mon Feb 26 21:50:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEF6AF25703; Mon, 26 Feb 2018 21:50:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2EC36B43F; Mon, 26 Feb 2018 21:50:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CCE62118D; Mon, 26 Feb 2018 21:50:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QLoDiY000395; Mon, 26 Feb 2018 21:50:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QLoDI9000394; Mon, 26 Feb 2018 21:50:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802262150.w1QLoDI9000394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Feb 2018 21:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330039 - head X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 330039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 21:50:14 -0000 Author: manu Date: Mon Feb 26 21:50:13 2018 New Revision: 330039 URL: https://svnweb.freebsd.org/changeset/base/330039 Log: MAINTAINERS: add myself for Allwinner and 64bits RockChip Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Feb 26 21:29:01 2018 (r330038) +++ head/MAINTAINERS Mon Feb 26 21:50:13 2018 (r330039) @@ -108,3 +108,5 @@ autofs(5) trasz Pre-commit review recommended. iscsi(4) trasz Pre-commit review recommended. rctl(8) trasz Pre-commit review recommended. sys/dev/ofw nwhitehorn Pre-commit review recommended. +sys/arm/allwinner manu Pre-commit review requested +sys/arm64/rockchip manu Pre-commit review requested From owner-svn-src-head@freebsd.org Mon Feb 26 21:56:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 507ADF25DE9; Mon, 26 Feb 2018 21:56:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F20AC6BCF3; Mon, 26 Feb 2018 21:56:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E84D121331; Mon, 26 Feb 2018 21:56:06 +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 w1QLu6PI005124; Mon, 26 Feb 2018 21:56:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QLu6jg005122; Mon, 26 Feb 2018 21:56:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802262156.w1QLu6jg005122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Feb 2018 21:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330040 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 330040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 21:56:07 -0000 Author: jhb Date: Mon Feb 26 21:56:06 2018 New Revision: 330040 URL: https://svnweb.freebsd.org/changeset/base/330040 Log: Fetch TLS key parameters from the firmware. The parameters describe how much of the adapter's memory is reserved for storing TLS keys. The 'meminfo' sysctl now lists this region of adapter memory as 'TLS keys' if present. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Mon Feb 26 21:50:13 2018 (r330039) +++ head/sys/dev/cxgbe/offload.h Mon Feb 26 21:56:06 2018 (r330040) @@ -126,6 +126,7 @@ struct t4_virt_res { /* virtualiz struct t4_range srq; struct t4_range ocq; struct t4_range l2t; + struct t4_range key; }; enum { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Feb 26 21:50:13 2018 (r330039) +++ head/sys/dev/cxgbe/t4_main.c Mon Feb 26 21:56:06 2018 (r330040) @@ -3662,6 +3662,18 @@ get_params__post_init(struct adapter *sc) sc->vres.iscsi.start = val[0]; sc->vres.iscsi.size = val[1] - val[0] + 1; } + if (sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS) { + param[0] = FW_PARAM_PFVF(TLS_START); + param[1] = FW_PARAM_PFVF(TLS_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query TLS parameters: %d.\n", rc); + return (rc); + } + sc->vres.key.start = val[0]; + sc->vres.key.size = val[1] - val[0] + 1; + } t4_init_sge_params(sc); @@ -7006,7 +7018,7 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) "TDDP region:", "TPT region:", "STAG region:", "RQ region:", "RQUDP region:", "PBL region:", "TXPBL region:", "DBVFIFO region:", "ULPRX state:", "ULPTX state:", - "On-chip queues:" + "On-chip queues:", "TLS keys:", }; struct mem_desc avail[4]; struct mem_desc mem[nitems(region) + 3]; /* up to 3 holes */ @@ -7142,6 +7154,13 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) md->base = sc->vres.ocq.start; if (sc->vres.ocq.size) md->limit = md->base + sc->vres.ocq.size - 1; + else + md->idx = nitems(region); /* hide it */ + md++; + + md->base = sc->vres.key.start; + if (sc->vres.key.size) + md->limit = md->base + sc->vres.key.size - 1; else md->idx = nitems(region); /* hide it */ md++; From owner-svn-src-head@freebsd.org Mon Feb 26 22:12:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5775DF27368; Mon, 26 Feb 2018 22:12:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6046CEE7; Mon, 26 Feb 2018 22:12:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 076202164F; Mon, 26 Feb 2018 22:12:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QMCVcP015294; Mon, 26 Feb 2018 22:12:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QMCVUW015291; Mon, 26 Feb 2018 22:12:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802262212.w1QMCVUW015291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Feb 2018 22:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330041 - in head/sys/dev/cxgbe: . crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . crypto X-SVN-Commit-Revision: 330041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 22:12:32 -0000 Author: jhb Date: Mon Feb 26 22:12:31 2018 New Revision: 330041 URL: https://svnweb.freebsd.org/changeset/base/330041 Log: Move ccr_aes_getdeckey() from ccr(4) to the cxgbe(4) driver. This routine will also be used by the TOE module to manage TLS keys. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Feb 26 21:56:06 2018 (r330040) +++ head/sys/dev/cxgbe/adapter.h Mon Feb 26 22:12:31 2018 (r330041) @@ -1138,6 +1138,7 @@ void t4_os_link_changed(struct port_info *); void t4_iterate(void (*)(struct adapter *, void *), void *); void t4_init_devnames(struct adapter *); void t4_add_adapter(struct adapter *); +void t4_aes_getdeckey(void *, const void *, unsigned int); int t4_detach_common(device_t); int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); int t4_map_bars_0_and_4(struct adapter *); Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Mon Feb 26 21:56:06 2018 (r330040) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Mon Feb 26 22:12:31 2018 (r330041) @@ -1821,46 +1821,7 @@ ccr_aes_check_keylen(int alg, int klen) return (0); } -/* - * Borrowed from cesa_prep_aes_key(). We should perhaps have a public - * function to generate this instead. - * - * NB: The crypto engine wants the words in the decryption key in reverse - * order. - */ static void -ccr_aes_getdeckey(void *dec_key, const void *enc_key, unsigned int kbits) -{ - uint32_t ek[4 * (RIJNDAEL_MAXNR + 1)]; - uint32_t *dkey; - int i; - - rijndaelKeySetupEnc(ek, enc_key, kbits); - dkey = dec_key; - dkey += (kbits / 8) / 4; - - switch (kbits) { - case 128: - for (i = 0; i < 4; i++) - *--dkey = htobe32(ek[4 * 10 + i]); - break; - case 192: - for (i = 0; i < 2; i++) - *--dkey = htobe32(ek[4 * 11 + 2 + i]); - for (i = 0; i < 4; i++) - *--dkey = htobe32(ek[4 * 12 + i]); - break; - case 256: - for (i = 0; i < 4; i++) - *--dkey = htobe32(ek[4 * 13 + i]); - for (i = 0; i < 4; i++) - *--dkey = htobe32(ek[4 * 14 + i]); - break; - } - MPASS(dkey == dec_key); -} - -static void ccr_aes_setkey(struct ccr_session *s, int alg, const void *key, int klen) { unsigned int ck_size, iopad_size, kctx_flits, kctx_len, kbits, mk_size; @@ -1889,7 +1850,7 @@ ccr_aes_setkey(struct ccr_session *s, int alg, const v switch (alg) { case CRYPTO_AES_CBC: case CRYPTO_AES_XTS: - ccr_aes_getdeckey(s->blkcipher.deckey, key, kbits); + t4_aes_getdeckey(s->blkcipher.deckey, key, kbits); break; } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Feb 26 21:56:06 2018 (r330040) +++ head/sys/dev/cxgbe/t4_main.c Mon Feb 26 22:12:31 2018 (r330041) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif #ifdef DDB #include @@ -10183,6 +10184,44 @@ DB_FUNC(tcb, db_show_t4tcb, db_t4_table, CS_OWN, NULL) t4_dump_tcb(device_get_softc(dev), tid); } #endif + +/* + * Borrowed from cesa_prep_aes_key(). + * + * NB: The crypto engine wants the words in the decryption key in reverse + * order. + */ +void +t4_aes_getdeckey(void *dec_key, const void *enc_key, unsigned int kbits) +{ + uint32_t ek[4 * (RIJNDAEL_MAXNR + 1)]; + uint32_t *dkey; + int i; + + rijndaelKeySetupEnc(ek, enc_key, kbits); + dkey = dec_key; + dkey += (kbits / 8) / 4; + + switch (kbits) { + case 128: + for (i = 0; i < 4; i++) + *--dkey = htobe32(ek[4 * 10 + i]); + break; + case 192: + for (i = 0; i < 2; i++) + *--dkey = htobe32(ek[4 * 11 + 2 + i]); + for (i = 0; i < 4; i++) + *--dkey = htobe32(ek[4 * 12 + i]); + break; + case 256: + for (i = 0; i < 4; i++) + *--dkey = htobe32(ek[4 * 13 + i]); + for (i = 0; i < 4; i++) + *--dkey = htobe32(ek[4 * 14 + i]); + break; + } + MPASS(dkey == dec_key); +} static struct sx mlu; /* mod load unload */ SX_SYSINIT(cxgbe_mlu, &mlu, "cxgbe mod load/unload"); From owner-svn-src-head@freebsd.org Mon Feb 26 22:17:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A518F277E9; Mon, 26 Feb 2018 22:17:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3776D22B; Mon, 26 Feb 2018 22:17:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A21221655; Mon, 26 Feb 2018 22:17:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QMHSat015599; Mon, 26 Feb 2018 22:17:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QMHSmv015598; Mon, 26 Feb 2018 22:17:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802262217.w1QMHSmv015598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Feb 2018 22:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330042 - head/sys/dev/cxgbe/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 330042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 22:17:28 -0000 Author: jhb Date: Mon Feb 26 22:17:27 2018 New Revision: 330042 URL: https://svnweb.freebsd.org/changeset/base/330042 Log: Don't overflow the ipad[] array when clearing the remainder. After the auth key is copied into the ipad[] array, any remaining bytes are cleared to zero (in case the key is shorter than one block size). The full block size was used as the length of the zero rather than the size of the remaining ipad[]. In practice this overflow was harmless as it could only clear bytes in the following opad[] array which is initialized with a copy of ipad[] in the next statement. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Mon Feb 26 22:12:31 2018 (r330041) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Mon Feb 26 22:17:27 2018 (r330042) @@ -1764,7 +1764,7 @@ ccr_init_hmac_digest(struct ccr_session *s, int cri_al } else memcpy(s->hmac.ipad, key, klen); - memset(s->hmac.ipad + klen, 0, axf->blocksize); + memset(s->hmac.ipad + klen, 0, axf->blocksize - klen); memcpy(s->hmac.opad, s->hmac.ipad, axf->blocksize); for (i = 0; i < axf->blocksize; i++) { From owner-svn-src-head@freebsd.org Mon Feb 26 22:57:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 620ACF2AAB7; Mon, 26 Feb 2018 22:57:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 102BD711FC; Mon, 26 Feb 2018 22:57:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0664721CFA; Mon, 26 Feb 2018 22:57:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QMvqCe040218; Mon, 26 Feb 2018 22:57:52 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QMvqq5040217; Mon, 26 Feb 2018 22:57:52 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802262257.w1QMvqq5040217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Feb 2018 22:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330043 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 330043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 22:57:53 -0000 Author: manu Date: Mon Feb 26 22:57:52 2018 New Revision: 330043 URL: https://svnweb.freebsd.org/changeset/base/330043 Log: rk_cru: Add missing break Modified: head/sys/arm64/rockchip/clk/rk_cru.c Modified: head/sys/arm64/rockchip/clk/rk_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.c Mon Feb 26 22:17:27 2018 (r330042) +++ head/sys/arm64/rockchip/clk/rk_cru.c Mon Feb 26 22:57:52 2018 (r330043) @@ -226,6 +226,7 @@ rk_cru_attach(device_t dev) break; case RK_CLK_MUX: rk_clk_mux_register(sc->clkdom, sc->clks[i].clk.mux); + break; default: device_printf(dev, "Unknown clock type\n"); return (ENXIO); From owner-svn-src-head@freebsd.org Mon Feb 26 23:20:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99D60F2C1FF; Mon, 26 Feb 2018 23:20:38 +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 4410972424; Mon, 26 Feb 2018 23:20:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 93DEF10A8BA; Mon, 26 Feb 2018 18:20:37 -0500 (EST) From: John Baldwin To: Alan Somers Cc: Warner Losh , Steve Wills , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328612 - head/lib/libc/stdlib Date: Mon, 26 Feb 2018 11:03:43 -0800 Message-ID: <1882799.O9cP9dHevK@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201801310305.w0V35EU4090569@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); Mon, 26 Feb 2018 18:20:37 -0500 (EST) 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.25 Precedence: list List-Id: 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, 26 Feb 2018 23:20:38 -0000 On Sunday, February 25, 2018 07:52:49 AM Alan Somers wrote: > I'm seeing the same error during the build of usr.sbin/nologin for > riscv.riscv64sf. Has anybody figured out a solution yet? It's kind of messy. I have a WIP patch series here: https://github.com/freebsd/freebsd/compare/master...bsdjhb:softfloat_symbol_map I'm trying to determine if we should just be ditching more of the soft-float stuff from libc in favor of compiler-rt instead. I think with my current tree I still have a (different) breakage on riscv64sf. > On Thu, Feb 1, 2018 at 9:09 PM, Warner Losh wrote: > > > > > > > On Thu, Feb 1, 2018 at 8:34 PM, Steve Wills wrote: > > > >> This, somehow, seems to have broken the mips64 build: > >> > >> https://ci.freebsd.org/job/FreeBSD-head-mips64-build/216/consoleFull > >> > >> The previous rev works. > >> > > > > This breaks devd, of all things, with > > > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > > function `__gedf2': > > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:96: multiple > > definition of `__gedf2' > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(gedf2.o):/ > > usr/src/lib/libc/softfloat/gedf2.c:18: first defined here > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > > function `__eqdf2': > > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:126: multiple > > definition of `__eqdf2' > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(eqdf2.o):/ > > usr/src/lib/libc/softfloat/eqdf2.c:18: first defined here > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > > function `__ltdf2': > > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:131: multiple > > definition of `__ltdf2' > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(ltdf2.o):/ > > usr/src/lib/libc/softfloat/ltdf2.c:18: first defined here > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > > function `__nedf2': > > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:136: multiple > > definition of `__nedf2' > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(nedf2.o):/ > > usr/src/lib/libc/softfloat/nedf2.c:18: first defined here > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libgcc.a(comparedf2.o): In > > function `__gtdf2': > > /usr/src/contrib/compiler-rt/lib/builtins/comparedf2.c:141: multiple > > definition of `__gtdf2' > > /usr/obj/usr/src/mips.mips64/tmp/usr/lib/libc.a(gtdf2.o):/ > > usr/src/lib/libc/softfloat/gtdf2.c:18: first defined here > > > > undefined.... devd doesn't even use strtodl. > > > > (looks like the code to associate make output with the right commands is > > broken, since I had to dig for it. > > > > Warner > > > > > >> Steve > >> > >> > >> On 01/30/2018 22:05, Warner Losh wrote: > >> > >>> Author: imp > >>> Date: Wed Jan 31 03:05:14 2018 > >>> New Revision: 328612 > >>> URL: https://svnweb.freebsd.org/changeset/base/328612 > >>> > >>> Log: > >>> Move strtold wrapper from strtol.c to its own strtold.c. This code > >>> was written by theraven@ (David Chisnall) entirely, there's no > >>> original Berkeley code left here so just copy his copyright over. > >>> > >>> > > -- John Baldwin From owner-svn-src-head@freebsd.org Mon Feb 26 23:58:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D77BAF2E798; Mon, 26 Feb 2018 23:58:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CD3873A85; Mon, 26 Feb 2018 23:58:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 839C9226C0; Mon, 26 Feb 2018 23:58:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QNwuxU070317; Mon, 26 Feb 2018 23:58:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QNwunm070316; Mon, 26 Feb 2018 23:58:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802262358.w1QNwunm070316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 26 Feb 2018 23:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330044 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 330044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 26 Feb 2018 23:58:57 -0000 Author: ian Date: Mon Feb 26 23:58:56 2018 New Revision: 330044 URL: https://svnweb.freebsd.org/changeset/base/330044 Log: Add a hw.model sysctl oid for armv6/7 which reports the CPU model, similar to what other arches (all except riscv and armv4/5) do. Submitted by: Hyun Hwang Differential Revision: https://reviews.freebsd.org/D14465 Modified: head/sys/arm/arm/identcpu-v6.c Modified: head/sys/arm/arm/identcpu-v6.c ============================================================================== --- head/sys/arm/arm/identcpu-v6.c Mon Feb 26 22:57:52 2018 (r330043) +++ head/sys/arm/arm/identcpu-v6.c Mon Feb 26 23:58:56 2018 (r330044) @@ -56,6 +56,10 @@ char machine[] = "arm"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); +static char cpu_model[64]; +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, + cpu_model, sizeof(cpu_model), "Machine model"); + static char hw_buf[81]; static int hw_buf_idx; static bool hw_buf_newline; @@ -285,11 +289,13 @@ identify_arm_cpu(void) if (cpu_names[i].implementer == cpuinfo.implementer && cpu_names[i].part_number == cpuinfo.part_number) { cpu_class = cpu_names[i].cpu_class; - printf("CPU: %s %s r%dp%d (ECO: 0x%08X)\n", + snprintf(cpu_model, sizeof(cpu_model), + "%s %s r%dp%d (ECO: 0x%08X)", cpu_names[i].impl_name, cpu_names[i].core_name, cpuinfo.revision, cpuinfo.patch, cpuinfo.midr != cpuinfo.revidr ? cpuinfo.revidr : 0); + printf("CPU: %s\n", cpu_model); break; } From owner-svn-src-head@freebsd.org Tue Feb 27 00:30:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55A9CF3059C; Tue, 27 Feb 2018 00:30:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 080F374C04; Tue, 27 Feb 2018 00:30:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2EE022BC1; Tue, 27 Feb 2018 00:30:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1R0UAHU085527; Tue, 27 Feb 2018 00:30:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R0UAXc085525; Tue, 27 Feb 2018 00:30:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802270030.w1R0UAXc085525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 27 Feb 2018 00:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330045 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 330045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 00:30:11 -0000 Author: ian Date: Tue Feb 27 00:30:10 2018 New Revision: 330045 URL: https://svnweb.freebsd.org/changeset/base/330045 Log: Remove obsolete options from these kernel configs. The functionality these enabled is now on by default since r313330. Modified: head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Mon Feb 26 23:58:56 2018 (r330044) +++ head/sys/arm/conf/DOCKSTAR Tue Feb 27 00:30:10 2018 (r330045) @@ -119,7 +119,6 @@ device cryptodev # IPSec device enc options IPSEC -options IPSEC_NAT_T options TCP_SIGNATURE # include support for RFC 2385 # IPFW Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Mon Feb 26 23:58:56 2018 (r330044) +++ head/sys/arm/conf/DREAMPLUG-1001 Tue Feb 27 00:30:10 2018 (r330045) @@ -130,7 +130,6 @@ device cryptodev # IPSec device enc options IPSEC -options IPSEC_NAT_T options TCP_SIGNATURE # include support for RFC 2385 # IPFW From owner-svn-src-head@freebsd.org Tue Feb 27 01:36:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DC5FF35BDF; Tue, 27 Feb 2018 01:36:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E772477EB8; Tue, 27 Feb 2018 01:36:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2822237E3; Tue, 27 Feb 2018 01:36:43 +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 w1R1ahNC020065; Tue, 27 Feb 2018 01:36:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R1ah4l020064; Tue, 27 Feb 2018 01:36:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802270136.w1R1ah4l020064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Feb 2018 01:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330048 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 01:36:44 -0000 Author: mav Date: Tue Feb 27 01:36:43 2018 New Revision: 330048 URL: https://svnweb.freebsd.org/changeset/base/330048 Log: Add sysctls/tunables for dbuf cache size. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Feb 27 01:28:19 2018 (r330047) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Feb 27 01:36:43 2018 (r330048) @@ -134,6 +134,16 @@ int dbuf_cache_max_shift = 5; uint_t dbuf_cache_hiwater_pct = 10; uint_t dbuf_cache_lowater_pct = 10; +SYSCTL_DECL(_vfs_zfs); +SYSCTL_QUAD(_vfs_zfs, OID_AUTO, dbuf_cache_max_bytes, CTLFLAG_RWTUN, + &dbuf_cache_max_bytes, 0, "dbuf cache size in bytes"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, dbuf_cache_max_shift, CTLFLAG_RDTUN, + &dbuf_cache_max_shift, 0, "dbuf size as log2 fraction of ARC"); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, dbuf_cache_hiwater_pct, CTLFLAG_RWTUN, + &dbuf_cache_hiwater_pct, 0, "max percents above the dbuf cache size"); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, dbuf_cache_lowater_pct, CTLFLAG_RWTUN, + &dbuf_cache_lowater_pct, 0, "max percents below the dbuf cache size"); + /* ARGSUSED */ static int dbuf_cons(void *vdb, void *unused, int kmflag) From owner-svn-src-head@freebsd.org Tue Feb 27 01:48:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F13EF37114; Tue, 27 Feb 2018 01:48:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B61F789E1; Tue, 27 Feb 2018 01:48:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 463CA239CE; Tue, 27 Feb 2018 01:48:14 +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 w1R1mE4T025060; Tue, 27 Feb 2018 01:48:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R1mDu3025055; Tue, 27 Feb 2018 01:48:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802270148.w1R1mDu3025055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Feb 2018 01:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330049 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 330049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 01:48:14 -0000 Author: mav Date: Tue Feb 27 01:48:13 2018 New Revision: 330049 URL: https://svnweb.freebsd.org/changeset/base/330049 Log: Allow physically non-contiguous chain frames allocation in mps(4)/mpr(4). Chain frames required to satisfy all 2K of declared I/Os of 128KB each take more then a megabyte of a physical memory, all of which existing code tries allocate as physically contiguous. This patch removes that physical contiguousness requirement, leaving only virtual contiguousness. I was thinking about other ways of allocation, but the less granular allocation becomes, the bigger is the overhead and/or complexity, reaching about 100% overhead if allocate each frame separately. The patch also bumps the chain frames hard limit from 2K to 16K. It is more than enough for the case of default REQ_FRAMES and MAXPHYS (the drivers will allocate less than that automatically), while in case of increased MAXPHYS it will control maximal memory usage. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14420 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 27 01:36:43 2018 (r330048) +++ head/sys/dev/mpr/mpr.c Tue Feb 27 01:48:13 2018 (r330049) @@ -382,7 +382,7 @@ mpr_transition_operational(struct mpr_softc *sc) static void mpr_resize_queues(struct mpr_softc *sc) { - u_int reqcr, prireqcr, maxio, sges_per_frame; + u_int reqcr, prireqcr, maxio, sges_per_frame, chain_seg_size; /* * Size the queues. Since the reply queues always need one free @@ -413,15 +413,11 @@ mpr_resize_queues(struct mpr_softc *sc) * the size of an IEEE Simple SGE. */ if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) { - sc->chain_seg_size = - htole16(sc->facts->IOCMaxChainSegmentSize); - if (sc->chain_seg_size == 0) { - sc->chain_frame_size = MPR_DEFAULT_CHAIN_SEG_SIZE * - MPR_MAX_CHAIN_ELEMENT_SIZE; - } else { - sc->chain_frame_size = sc->chain_seg_size * - MPR_MAX_CHAIN_ELEMENT_SIZE; - } + chain_seg_size = htole16(sc->facts->IOCMaxChainSegmentSize); + if (chain_seg_size == 0) + chain_seg_size = MPR_DEFAULT_CHAIN_SEG_SIZE; + sc->chain_frame_size = chain_seg_size * + MPR_MAX_CHAIN_ELEMENT_SIZE; } else { sc->chain_frame_size = sc->reqframesz; } @@ -766,11 +762,11 @@ mpr_iocfacts_free(struct mpr_softc *sc) if (sc->queues_dmat != NULL) bus_dma_tag_destroy(sc->queues_dmat); - if (sc->chain_busaddr != 0) + if (sc->chain_frames != NULL) { bus_dmamap_unload(sc->chain_dmat, sc->chain_map); - if (sc->chain_frames != NULL) bus_dmamem_free(sc->chain_dmat, sc->chain_frames, sc->chain_map); + } if (sc->chain_dmat != NULL) bus_dma_tag_destroy(sc->chain_dmat); @@ -1411,11 +1407,36 @@ mpr_alloc_replies(struct mpr_softc *sc) return (0); } +static void +mpr_load_chains_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct mpr_softc *sc = arg; + struct mpr_chain *chain; + bus_size_t bo; + int i, o, s; + + if (error != 0) + return; + + for (i = 0, o = 0, s = 0; s < nsegs; s++) { + for (bo = 0; bo + sc->chain_frame_size <= segs[s].ds_len; + bo += sc->chain_frame_size) { + chain = &sc->chains[i++]; + chain->chain =(MPI2_SGE_IO_UNION *)(sc->chain_frames+o); + chain->chain_busaddr = segs[s].ds_addr + bo; + o += sc->chain_frame_size; + mpr_free_chain(sc, chain); + } + if (bo != segs[s].ds_len) + o += segs[s].ds_len - bo; + } + sc->chain_free_lowwater = i; +} + static int mpr_alloc_requests(struct mpr_softc *sc) { struct mpr_command *cm; - struct mpr_chain *chain; int i, rsize, nsegs; rsize = sc->reqframesz * sc->num_reqs; @@ -1444,31 +1465,39 @@ mpr_alloc_requests(struct mpr_softc *sc) mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016jx size= %d\n", (uintmax_t)sc->req_busaddr, rsize); + sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR, + M_NOWAIT | M_ZERO); + if (!sc->chains) { + mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain memory\n"); + return (ENOMEM); + } rsize = sc->chain_frame_size * sc->num_chains; - if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ + if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - rsize, /* maxsize */ - 1, /* nsegments */ - rsize, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->chain_dmat)) { + rsize, /* maxsize */ + howmany(rsize, PAGE_SIZE), /* nsegments */ + rsize, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->chain_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); - } - if (bus_dmamem_alloc(sc->chain_dmat, (void **)&sc->chain_frames, - BUS_DMA_NOWAIT, &sc->chain_map)) { + } + if (bus_dmamem_alloc(sc->chain_dmat, (void **)&sc->chain_frames, + BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->chain_map)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain memory\n"); return (ENOMEM); - } - bzero(sc->chain_frames, rsize); - bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, - mpr_memaddr_cb, &sc->chain_busaddr, 0); - mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016jx size= %d\n", - (uintmax_t)sc->chain_busaddr, rsize); + } + if (bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, + rsize, mpr_load_chains_cb, sc, BUS_DMA_NOWAIT)) { + mpr_dprint(sc, MPR_ERROR, "Cannot load chain memory\n"); + bus_dmamem_free(sc->chain_dmat, sc->chain_frames, + sc->chain_map); + return (ENOMEM); + } rsize = MPR_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1495,22 +1524,6 @@ mpr_alloc_requests(struct mpr_softc *sc) mpr_memaddr_cb, &sc->sense_busaddr, 0); mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016jx size= %d\n", (uintmax_t)sc->sense_busaddr, rsize); - - sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR, - M_WAITOK | M_ZERO); - if (!sc->chains) { - mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain memory\n"); - return (ENOMEM); - } - for (i = 0; i < sc->num_chains; i++) { - chain = &sc->chains[i]; - chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + - i * sc->chain_frame_size); - chain->chain_busaddr = sc->chain_busaddr + - i * sc->chain_frame_size; - mpr_free_chain(sc, chain); - sc->chain_free_lowwater++; - } /* * Allocate NVMe PRP Pages for NVMe SGL support only if the FW supports Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Tue Feb 27 01:36:43 2018 (r330048) +++ head/sys/dev/mpr/mprvar.h Tue Feb 27 01:48:13 2018 (r330049) @@ -41,7 +41,7 @@ #define MPR_PRI_REQ_FRAMES 128 #define MPR_EVT_REPLY_FRAMES 32 #define MPR_REPLY_FRAMES MPR_REQ_FRAMES -#define MPR_CHAIN_FRAMES 2048 +#define MPR_CHAIN_FRAMES 16384 #define MPR_MAXIO_PAGES (-1) #define MPR_SENSE_LEN SSD_FULL_SIZE #define MPR_MSI_MAX 1 @@ -322,7 +322,6 @@ struct mpr_softc { u_int maxio; int chain_free_lowwater; uint32_t chain_frame_size; - uint16_t chain_seg_size; int prp_buffer_size; int prp_pages_free; int prp_pages_free_lowwater; @@ -389,7 +388,6 @@ struct mpr_softc { bus_dmamap_t sense_map; uint8_t *chain_frames; - bus_addr_t chain_busaddr; bus_dma_tag_t chain_dmat; bus_dmamap_t chain_map; Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 27 01:36:43 2018 (r330048) +++ head/sys/dev/mps/mps.c Tue Feb 27 01:48:13 2018 (r330049) @@ -743,11 +743,11 @@ mps_iocfacts_free(struct mps_softc *sc) if (sc->queues_dmat != NULL) bus_dma_tag_destroy(sc->queues_dmat); - if (sc->chain_busaddr != 0) + if (sc->chain_frames != NULL) { bus_dmamap_unload(sc->chain_dmat, sc->chain_map); - if (sc->chain_frames != NULL) bus_dmamem_free(sc->chain_dmat, sc->chain_frames, sc->chain_map); + } if (sc->chain_dmat != NULL) bus_dma_tag_destroy(sc->chain_dmat); @@ -1370,11 +1370,36 @@ mps_alloc_replies(struct mps_softc *sc) return (0); } +static void +mps_load_chains_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct mps_softc *sc = arg; + struct mps_chain *chain; + bus_size_t bo; + int i, o, s; + + if (error != 0) + return; + + for (i = 0, o = 0, s = 0; s < nsegs; s++) { + for (bo = 0; bo + sc->reqframesz <= segs[s].ds_len; + bo += sc->reqframesz) { + chain = &sc->chains[i++]; + chain->chain =(MPI2_SGE_IO_UNION *)(sc->chain_frames+o); + chain->chain_busaddr = segs[s].ds_addr + bo; + o += sc->reqframesz; + mps_free_chain(sc, chain); + } + if (bo != segs[s].ds_len) + o += segs[s].ds_len - bo; + } + sc->chain_free_lowwater = i; +} + static int mps_alloc_requests(struct mps_softc *sc) { struct mps_command *cm; - struct mps_chain *chain; int i, rsize, nsegs; rsize = sc->reqframesz * sc->num_reqs; @@ -1403,31 +1428,39 @@ mps_alloc_requests(struct mps_softc *sc) mps_dprint(sc, MPS_INIT, "request frames busaddr= %#016jx size= %d\n", (uintmax_t)sc->req_busaddr, rsize); + sc->chains = malloc(sizeof(struct mps_chain) * sc->num_chains, M_MPT2, + M_NOWAIT | M_ZERO); + if (!sc->chains) { + mps_dprint(sc, MPS_ERROR, "Cannot allocate chain memory\n"); + return (ENOMEM); + } rsize = sc->reqframesz * sc->num_chains; - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ + if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - rsize, /* maxsize */ - 1, /* nsegments */ - rsize, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->chain_dmat)) { + rsize, /* maxsize */ + howmany(rsize, PAGE_SIZE), /* nsegments */ + rsize, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->chain_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); - } - if (bus_dmamem_alloc(sc->chain_dmat, (void **)&sc->chain_frames, - BUS_DMA_NOWAIT, &sc->chain_map)) { + } + if (bus_dmamem_alloc(sc->chain_dmat, (void **)&sc->chain_frames, + BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->chain_map)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate chain memory\n"); return (ENOMEM); - } - bzero(sc->chain_frames, rsize); - bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize, - mps_memaddr_cb, &sc->chain_busaddr, 0); - mps_dprint(sc, MPS_INIT, "chain frames busaddr= %#016jx size= %d\n", - (uintmax_t)sc->chain_busaddr, rsize); + } + if (bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, + rsize, mps_load_chains_cb, sc, BUS_DMA_NOWAIT)) { + mps_dprint(sc, MPS_ERROR, "Cannot load chain memory\n"); + bus_dmamem_free(sc->chain_dmat, sc->chain_frames, + sc->chain_map); + return (ENOMEM); + } rsize = MPS_SENSE_LEN * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ @@ -1454,22 +1487,6 @@ mps_alloc_requests(struct mps_softc *sc) mps_memaddr_cb, &sc->sense_busaddr, 0); mps_dprint(sc, MPS_INIT, "sense frames busaddr= %#016jx size= %d\n", (uintmax_t)sc->sense_busaddr, rsize); - - sc->chains = malloc(sizeof(struct mps_chain) * sc->num_chains, M_MPT2, - M_WAITOK | M_ZERO); - if(!sc->chains) { - mps_dprint(sc, MPS_ERROR, "Cannot allocate chains memory\n"); - return (ENOMEM); - } - for (i = 0; i < sc->num_chains; i++) { - chain = &sc->chains[i]; - chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + - i * sc->reqframesz); - chain->chain_busaddr = sc->chain_busaddr + - i * sc->reqframesz; - mps_free_chain(sc, chain); - sc->chain_free_lowwater++; - } nsegs = (sc->maxio / PAGE_SIZE) + 1; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Tue Feb 27 01:36:43 2018 (r330048) +++ head/sys/dev/mps/mpsvar.h Tue Feb 27 01:48:13 2018 (r330049) @@ -43,7 +43,7 @@ #define MPS_PRI_REQ_FRAMES 128 #define MPS_EVT_REPLY_FRAMES 32 #define MPS_REPLY_FRAMES MPS_REQ_FRAMES -#define MPS_CHAIN_FRAMES 2048 +#define MPS_CHAIN_FRAMES 16384 #define MPS_MAXIO_PAGES (-1) #define MPS_SENSE_LEN SSD_FULL_SIZE #define MPS_MSI_MAX 1 @@ -378,7 +378,6 @@ struct mps_softc { bus_dmamap_t sense_map; uint8_t *chain_frames; - bus_addr_t chain_busaddr; bus_dma_tag_t chain_dmat; bus_dmamap_t chain_map; From owner-svn-src-head@freebsd.org Tue Feb 27 02:11:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B94FF39F05; Tue, 27 Feb 2018 02:11:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4957A397; Tue, 27 Feb 2018 02:11:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0945623F14; Tue, 27 Feb 2018 02:11:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1R2BNaq036692; Tue, 27 Feb 2018 02:11:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R2BNZR036691; Tue, 27 Feb 2018 02:11:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802270211.w1R2BNZR036691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 27 Feb 2018 02:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330050 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 330050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 02:11:24 -0000 Author: ian Date: Tue Feb 27 02:11:23 2018 New Revision: 330050 URL: https://svnweb.freebsd.org/changeset/base/330050 Log: Initialize all members of vm_page::md_page for armv4/5 systems. This fixes a hang in SI_SUB_KMEM sysinit, and is apparently required after r323290. Inspired by the commit message for r323676. Reported by: andreast@ Modified: head/sys/arm/arm/pmap-v4.c Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Tue Feb 27 01:48:13 2018 (r330049) +++ head/sys/arm/arm/pmap-v4.c Tue Feb 27 02:11:23 2018 (r330050) @@ -1725,6 +1725,8 @@ pmap_page_init(vm_page_t m) TAILQ_INIT(&m->md.pv_list); m->md.pv_memattr = VM_MEMATTR_DEFAULT; + m->md.pvh_attrs = 0; + m->md.pv_kva = 0; } /* From owner-svn-src-head@freebsd.org Tue Feb 27 04:23:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C41BBF1EDDE; Tue, 27 Feb 2018 04:23:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 798C8806C8; Tue, 27 Feb 2018 04:23:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74182256FC; Tue, 27 Feb 2018 04:23:03 +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 w1R4N39u004814; Tue, 27 Feb 2018 04:23:03 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R4N32T004813; Tue, 27 Feb 2018 04:23:03 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802270423.w1R4N32T004813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 27 Feb 2018 04:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330051 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 330051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 04:23:03 -0000 Author: jhibbits Date: Tue Feb 27 04:23:03 2018 New Revision: 330051 URL: https://svnweb.freebsd.org/changeset/base/330051 Log: Fix a minor typo. Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Tue Feb 27 02:11:23 2018 (r330050) +++ head/sys/powerpc/powerpc/cpu.c Tue Feb 27 04:23:03 2018 (r330051) @@ -561,7 +561,7 @@ cpu_booke_setup(int cpuid, uint16_t vers) case FSL_E500v2: /* Only e500v1/v2 support HID0 power management setup. */ - /* Programe power-management mode. */ + /* Program power-management mode. */ hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); hid0 |= HID0_DOZE; From owner-svn-src-head@freebsd.org Tue Feb 27 04:38:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 806A2F223F9; Tue, 27 Feb 2018 04:38:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3377081023; Tue, 27 Feb 2018 04:38: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E69D258AB; Tue, 27 Feb 2018 04:38:28 +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 w1R4cSxk009942; Tue, 27 Feb 2018 04:38:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R4cR9a009940; Tue, 27 Feb 2018 04:38:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802270438.w1R4cR9a009940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 27 Feb 2018 04:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330052 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 330052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 04:38:28 -0000 Author: jhibbits Date: Tue Feb 27 04:38:27 2018 New Revision: 330052 URL: https://svnweb.freebsd.org/changeset/base/330052 Log: Increase the size of a reservation granule for TLB locks A reservation granule on PowerPC is a cache line. On e500mc and derivatives a cacheline size is 64 bytes, not 32. Allocate the maximum size permitted, but only utilize the size that is needed. On e500v1 and e500v2 the reservation granule will still be 32 bytes. Modified: head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Tue Feb 27 04:23:03 2018 (r330051) +++ head/sys/powerpc/booke/booke_machdep.c Tue Feb 27 04:38:27 2018 (r330052) @@ -372,7 +372,7 @@ booke_init(u_long arg1, u_long arg2) return (ret); } -#define RES_GRANULE 32 +#define RES_GRANULE cacheline_size extern uintptr_t tlb0_miss_locks[]; /* Initialise a struct pcpu. */ Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Tue Feb 27 04:23:03 2018 (r330051) +++ head/sys/powerpc/booke/trap_subr.S Tue Feb 27 04:38:27 2018 (r330052) @@ -82,7 +82,7 @@ /* Get the per-CPU data structure */ #define GET_CPUINFO(r) mfsprg0 r -#define RES_GRANULE 32 +#define RES_GRANULE 64 #define RES_LOCK 0 /* offset to the 'lock' word */ #ifdef __powerpc64__ #define RES_RECURSE 8 /* offset to the 'recurse' word */ From owner-svn-src-head@freebsd.org Tue Feb 27 04:41:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47F64F229C0; Tue, 27 Feb 2018 04:41:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F247C813BA; Tue, 27 Feb 2018 04:41:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECECC258E5; Tue, 27 Feb 2018 04:41:14 +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 w1R4fE9n012966; Tue, 27 Feb 2018 04:41:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R4fEDt012965; Tue, 27 Feb 2018 04:41:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201802270441.w1R4fEDt012965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Feb 2018 04:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330053 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 330053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 04:41:15 -0000 Author: bdrewery Date: Tue Feb 27 04:41:14 2018 New Revision: 330053 URL: https://svnweb.freebsd.org/changeset/base/330053 Log: Fix some grammar: "signals <...> are set" Modified: head/lib/libc/gen/posix_spawn.3 Modified: head/lib/libc/gen/posix_spawn.3 ============================================================================== --- head/lib/libc/gen/posix_spawn.3 Tue Feb 27 04:38:27 2018 (r330052) +++ head/lib/libc/gen/posix_spawn.3 Tue Feb 27 04:41:14 2018 (r330053) @@ -269,14 +269,14 @@ If the flag is set in the spawn-flags attribute of the object referenced by .Fa attrp , the signals specified in the spawn-sigdefault attribute of the same -object is set to their default actions in the child process. -Signals set to the default action in the parent process is set to +object are set to their default actions in the child process. +Signals set to the default action in the parent process are set to the default action in the child process. .Pp -Signals set to be caught by the calling process is set to the +Signals set to be caught by the calling process are set to the default action in the child process. .Pp -Signals set to be ignored by the calling process image is set to +Signals set to be ignored by the calling process image are set to be ignored by the child process, unless otherwise specified by the .Dv POSIX_SPAWN_SETSIGDEF flag being set in the spawn-flags attribute of the object referenced by From owner-svn-src-head@freebsd.org Tue Feb 27 09:06:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D1DF32812 for ; Tue, 27 Feb 2018 09:06:48 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x242.google.com (mail-yb0-x242.google.com [IPv6:2607:f8b0:4002:c09::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 1717E6ABAE for ; Tue, 27 Feb 2018 09:06:48 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x242.google.com with SMTP id i13-v6so6288317ybl.9 for ; Tue, 27 Feb 2018 01:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DFbC4bkOOgNkD/0kU5smOt0mwDQZgEbBDluiHDBgrow=; b=cIaah8HccSM2w6DuOXdd8raeXbUXtKd1R74lEECMat4kMxKoa6HymwxXvRw1oieinG mtPAsImOXCdvFQnHFDvTbcv8AD7BtONJoQ/rxfCrXopANgNQhMlRk18rN1lL4k5VaiB7 n0IUiMtqH8CfnIBWyeeTtzGueMP3wJGES3fQI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DFbC4bkOOgNkD/0kU5smOt0mwDQZgEbBDluiHDBgrow=; b=eAus3ar2L+c3ICW970rMpN6husf4g6NSxI9nHdh1H2hXvvKVSKwKu/IbJc2wBpNv79 7S3QZ8/YAlxGXZqWfuRXZw89Yjj9hTfZpQ9g5k2zVN6w0f6DfHoDiKnWwK2WbCScSj3/ 47Fl4rpESlRYwT6YzgP0+kStRP1rH8bb4/YwxbtarFafqvYqCPAI3JTtk+UtxxR66+9o dZxI1CTrqFCUiBYBrovyRwCi8I2j2Cd/4T5zTZFU7FA/RI53ZFQR78decvZ/ws/S3VjQ BAvteEVZ7Bxz5A6iah1b9M+RY5v8VxLLrNb6oAKIv2kt0MjZO8j8m3YXSVmQivMIbn1R U/Eg== X-Gm-Message-State: APf1xPDEL48K4ffItw4QL0UIFuGtI3wCskkkrHfVrEfJMnOpFaJDnc0A yVMrt+BBVOq0njjXS+uVhVa165Sw8cxha4H4y8RJ1g== X-Google-Smtp-Source: AG47ELsCq/T3KiwGTdeMGyN0SSMZpB2eBGv0pEXULEc06XYJZs01Ip0ivgQYrBtGepxaB3nOA2iqCfWF+eQ0IA7mWro= X-Received: by 2002:a25:86c5:: with SMTP id y5-v6mr8928332ybm.194.1519722407100; Tue, 27 Feb 2018 01:06:47 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:dfcb:0:0:0:0:0 with HTTP; Tue, 27 Feb 2018 01:06:16 -0800 (PST) In-Reply-To: <201710091548.v99FmuuT046501@repo.freebsd.org> References: <201710091548.v99FmuuT046501@repo.freebsd.org> From: Eitan Adler Date: Tue, 27 Feb 2018 01:06:16 -0800 Message-ID: Subject: Re: svn commit: r324434 - in head/sys: dev/iwm modules/iwmfw/iwm8265fw To: "George V. Neville-Neil" , Adrian Chadd , Cooper 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.25 Precedence: list List-Id: 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, 27 Feb 2018 09:06:48 -0000 Hi all, I was looking what it would take to MFC this and it seems to be spread across several commits. The following is an incomplete list: - r314073 - r314074 - r314076 - r314082 - r314192 - r321508 - r321509 - r321510 (a) What other commits am I missing? (b) How much of this is actually safe to MFC? Many of the commits are not marked as 'mfc after' and it seems to be undergoing a lot of change. On 9 October 2017 at 08:48, George V. Neville-Neil wrote: > Author: gnn > Date: Mon Oct 9 15:48:56 2017 > New Revision: 324434 > URL: https://svnweb.freebsd.org/changeset/base/324434 > > Log: > Add support for Intel 8265 WiFi > > Obtained from: OpenBSD > MFC after: 1 month > > Added: > head/sys/modules/iwmfw/iwm8265fw/ > head/sys/modules/iwmfw/iwm8265fw/Makefile (contents, props changed) > Modified: > head/sys/dev/iwm/if_iwm.c > head/sys/dev/iwm/if_iwm_8000.c > head/sys/dev/iwm/if_iwm_config.h > > Modified: head/sys/dev/iwm/if_iwm.c > ============================================================================== > --- head/sys/dev/iwm/if_iwm.c Mon Oct 9 15:39:43 2017 (r324433) > +++ head/sys/dev/iwm/if_iwm.c Mon Oct 9 15:48:56 2017 (r324434) > @@ -1,4 +1,4 @@ > -/* $OpenBSD: if_iwm.c,v 1.42 2015/05/30 02:49:23 deraadt Exp $ */ > +/* $OpenBSD: if_iwm.c,v 1.167 2017/04/04 00:40:52 claudio Exp $ */ > > /* > * Copyright (c) 2014 genua mbh > @@ -5690,6 +5690,7 @@ iwm_intr(void *arg) > #define PCI_PRODUCT_INTEL_WL_7265_2 0x095b > #define PCI_PRODUCT_INTEL_WL_8260_1 0x24f3 > #define PCI_PRODUCT_INTEL_WL_8260_2 0x24f4 > +#define PCI_PRODUCT_INTEL_WL_8265_1 0x24fd > > static const struct iwm_devices { > uint16_t device; > @@ -5705,6 +5706,7 @@ static const struct iwm_devices { > { PCI_PRODUCT_INTEL_WL_7265_2, &iwm7265_cfg }, > { PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, > { PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, > + { PCI_PRODUCT_INTEL_WL_8265_1, &iwm8265_cfg }, > }; > > static int > > Modified: head/sys/dev/iwm/if_iwm_8000.c > ============================================================================== > --- head/sys/dev/iwm/if_iwm_8000.c Mon Oct 9 15:39:43 2017 (r324433) > +++ head/sys/dev/iwm/if_iwm_8000.c Mon Oct 9 15:48:56 2017 (r324434) > @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); > #include "if_iwm_config.h" > > #define IWM8000_FW "iwm8000Cfw" > +#define IWM8265_FW "iwm8265fw" > > #define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 > > @@ -90,6 +91,13 @@ __FBSDID("$FreeBSD$"); > const struct iwm_cfg iwm8260_cfg = { > .name = "Intel(R) Dual Band Wireless AC 8260", > .fw_name = IWM8000_FW, > + IWM_DEVICE_8000_COMMON, > + .host_interrupt_operation_mode = 0, > +}; > + > +const struct iwm_cfg iwm8265_cfg = { > + .name = "Intel(R) Dual Band Wireless AC 8265", > + .fw_name = IWM8265_FW, > IWM_DEVICE_8000_COMMON, > .host_interrupt_operation_mode = 0, > }; > > Modified: head/sys/dev/iwm/if_iwm_config.h > ============================================================================== > --- head/sys/dev/iwm/if_iwm_config.h Mon Oct 9 15:39:43 2017 (r324433) > +++ head/sys/dev/iwm/if_iwm_config.h Mon Oct 9 15:48:56 2017 (r324434) > @@ -131,5 +131,6 @@ extern const struct iwm_cfg iwm3165_cfg; > extern const struct iwm_cfg iwm7265_cfg; > extern const struct iwm_cfg iwm7265d_cfg; > extern const struct iwm_cfg iwm8260_cfg; > +extern const struct iwm_cfg iwm8265_cfg; > > #endif /* __IWM_CONFIG_H__ */ > > Added: head/sys/modules/iwmfw/iwm8265fw/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/modules/iwmfw/iwm8265fw/Makefile Mon Oct 9 15:48:56 2017 (r324434) > @@ -0,0 +1,6 @@ > +# $FreeBSD$ > + > +KMOD= iwm8265fw > +IMG= iwm-8265-22 > + > +.include > _______________________________________________ > 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" -- Eitan Adler From owner-svn-src-head@freebsd.org Tue Feb 27 10:54:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8888FF39DC6; Tue, 27 Feb 2018 10:54:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C50F6EE0E; Tue, 27 Feb 2018 10:54:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 362F0164F; Tue, 27 Feb 2018 10:54:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RAsFi1098391; Tue, 27 Feb 2018 10:54:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RAsF0r098387; Tue, 27 Feb 2018 10:54:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802271054.w1RAsF0r098387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 27 Feb 2018 10:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330054 - in head: include lib/libc/gen sbin/init X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: include lib/libc/gen sbin/init X-SVN-Commit-Revision: 330054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 10:54:16 -0000 Author: trasz Date: Tue Feb 27 10:54:15 2018 New Revision: 330054 URL: https://svnweb.freebsd.org/changeset/base/330054 Log: Improve missing tty handling in init(8). This removes a check that did nothing - it was checking for ENXIO, which, with devfs, is no longer returned - and was badly placed anyway, and replaces it with similar one that works, and is done just before starting getty, instead of being done when rereading ttys(5). From the practical point of view, this makes init(8) handle disappearing terminals (eg /dev/ttyU*) gracefully, without unneccessary getty restarts and resulting error messages. Reviewed by: imp@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14307 Modified: head/include/ttyent.h head/lib/libc/gen/getttyent.3 head/lib/libc/gen/getttyent.c head/sbin/init/init.c Modified: head/include/ttyent.h ============================================================================== --- head/include/ttyent.h Tue Feb 27 04:41:14 2018 (r330053) +++ head/include/ttyent.h Tue Feb 27 10:54:15 2018 (r330054) @@ -57,6 +57,8 @@ struct ttyent { #define TTY_SECURE 0x02 /* allow uid of 0 to login */ #define TTY_DIALUP 0x04 /* is a dialup tty */ #define TTY_NETWORK 0x08 /* is a network tty */ +#define TTY_IFEXISTS 0x10 /* configured as "onifexists" */ +#define TTY_IFCONSOLE 0x20 /* configured as "onifconsole" */ int ty_status; /* status flags */ char *ty_window; /* command to start up window manager */ char *ty_comment; /* comment field */ Modified: head/lib/libc/gen/getttyent.3 ============================================================================== --- head/lib/libc/gen/getttyent.3 Tue Feb 27 04:41:14 2018 (r330053) +++ head/lib/libc/gen/getttyent.3 Tue Feb 27 10:54:15 2018 (r330054) @@ -75,6 +75,8 @@ struct ttyent { #define TTY_SECURE 0x02 /* allow uid of 0 to login */ #define TTY_DIALUP 0x04 /* is a dialup tty */ #define TTY_NETWORK 0x08 /* is a network tty */ +#define TTY_IFEXISTS 0x10 /* configured as "onifexists" */ +#define TTY_IFCONSOLE 0x20 /* configured as "onifconsole" */ int ty_status; /* status flags */ char *ty_window; /* command to start up window manager */ char *ty_comment; /* comment field */ @@ -115,6 +117,10 @@ Identifies a tty used for network connections. If this flag is set, then .Fn isnettty will return a non-zero value. +.It Dv TTY_IFEXISTS +Identifies a tty that does not neccessarily exist. +.It Dv TTY_IFCONSOLE +Identifies a tty that might be a system console. .El .It Fa ty_window The command to execute for a window system associated with the line. Modified: head/lib/libc/gen/getttyent.c ============================================================================== --- head/lib/libc/gen/getttyent.c Tue Feb 27 04:41:14 2018 (r330053) +++ head/lib/libc/gen/getttyent.c Tue Feb 27 10:54:15 2018 (r330054) @@ -75,11 +75,14 @@ auto_tty_status(const char *ty_name) { size_t len; char *buf, *cons, *nextcons; + int rv; + rv = TTY_IFCONSOLE; + /* Check if this is an enabled kernel console line */ buf = NULL; if (sysctlbyname("kern.console", NULL, &len, NULL, 0) == -1) - return (0); /* Errors mean don't enable */ + return (rv); /* Errors mean don't enable */ buf = malloc(len); if (sysctlbyname("kern.console", buf, &len, NULL, 0) == -1) goto done; @@ -90,14 +93,14 @@ auto_tty_status(const char *ty_name) nextcons = buf; while ((cons = strsep(&nextcons, ",")) != NULL && strlen(cons) != 0) { if (strcmp(cons, ty_name) == 0) { - free(buf); - return (TTY_ON); + rv |= TTY_ON; + break; } } done: free(buf); - return (0); + return (rv); } static int @@ -107,13 +110,13 @@ auto_exists_status(const char *ty_name) char *dev; int rv; - rv = 0; + rv = TTY_IFEXISTS; if (*ty_name == '/') asprintf(&dev, "%s", ty_name); else asprintf(&dev, "/dev/%s", ty_name); if (dev != NULL && stat(dev, &sb) == 0) - rv = TTY_ON; + rv |= TTY_ON; free(dev); return (rv); } Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Tue Feb 27 04:41:14 2018 (r330053) +++ head/sbin/init/init.c Tue Feb 27 10:54:15 2018 (r330054) @@ -156,6 +156,8 @@ typedef struct init_session { int se_flags; /* status of session */ #define SE_SHUTDOWN 0x1 /* session won't be restarted */ #define SE_PRESENT 0x2 /* session is in /etc/ttys */ +#define SE_IFEXISTS 0x4 /* session defined as "onifexists" */ +#define SE_IFCONSOLE 0x8 /* session defined as "onifconsole" */ int se_nspace; /* spacing count */ char *se_device; /* filename of port */ char *se_getty; /* what to run on that port */ @@ -1262,7 +1264,6 @@ static session_t * new_session(session_t *sprev, struct ttyent *typ) { session_t *sp; - int fd; if ((typ->ty_status & TTY_ON) == 0 || typ->ty_name == 0 || @@ -1273,21 +1274,15 @@ new_session(session_t *sprev, struct ttyent *typ) sp->se_flags |= SE_PRESENT; + if ((typ->ty_status & TTY_IFEXISTS) != 0) + sp->se_flags |= SE_IFEXISTS; + + if ((typ->ty_status & TTY_IFCONSOLE) != 0) + sp->se_flags |= SE_IFCONSOLE; + if (asprintf(&sp->se_device, "%s%s", _PATH_DEV, typ->ty_name) < 0) err(1, "asprintf"); - /* - * Attempt to open the device, if we get "device not configured" - * then don't add the device to the session list. - */ - if ((fd = open(sp->se_device, O_RDONLY | O_NONBLOCK, 0)) < 0) { - if (errno == ENXIO) { - free_session(sp); - return (0); - } - } else - close(fd); - if (setupargv(sp, typ) == 0) { free_session(sp); return (0); @@ -1507,6 +1502,30 @@ start_getty(session_t *sp) } /* + * Return 1 if the session is defined as "onifexists" + * or "onifconsole" and the device node does not exist. + */ +static int +session_has_no_tty(session_t *sp) +{ + int fd; + + if ((sp->se_flags & SE_IFEXISTS) == 0 && + (sp->se_flags & SE_IFCONSOLE) == 0) + return (0); + + fd = open(sp->se_device, O_RDONLY | O_NONBLOCK, 0); + if (fd < 0) { + if (errno == ENOENT) + return (1); + return (0); + } + + close(fd); + return (0); +} + +/* * Collect exit status for a child. * If an exiting login, start a new login running. */ @@ -1524,7 +1543,8 @@ collect_child(pid_t pid) del_session(sp); sp->se_process = 0; - if (sp->se_flags & SE_SHUTDOWN) { + if (sp->se_flags & SE_SHUTDOWN || + session_has_no_tty(sp)) { if ((sprev = sp->se_prev) != NULL) sprev->se_next = sp->se_next; else @@ -1610,6 +1630,8 @@ multi_user(void) for (sp = sessions; sp; sp = sp->se_next) { if (sp->se_process) + continue; + if (session_has_no_tty(sp)) continue; if ((pid = start_getty(sp)) == -1) { /* serious trouble */ From owner-svn-src-head@freebsd.org Tue Feb 27 10:55:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F66F39F50; Tue, 27 Feb 2018 10:55:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307966EFF8; Tue, 27 Feb 2018 10:55:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A76E165F; Tue, 27 Feb 2018 10:55:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RAtXfl098508; Tue, 27 Feb 2018 10:55:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RAtXeW098507; Tue, 27 Feb 2018 10:55:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802271055.w1RAtXeW098507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 27 Feb 2018 10:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330055 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 330055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 10:55:34 -0000 Author: trasz Date: Tue Feb 27 10:55:33 2018 New Revision: 330055 URL: https://svnweb.freebsd.org/changeset/base/330055 Log: Fix typo. Submitted by: jilles@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/gen/getttyent.3 Modified: head/lib/libc/gen/getttyent.3 ============================================================================== --- head/lib/libc/gen/getttyent.3 Tue Feb 27 10:54:15 2018 (r330054) +++ head/lib/libc/gen/getttyent.3 Tue Feb 27 10:55:33 2018 (r330055) @@ -118,7 +118,7 @@ If this flag is set, then .Fn isnettty will return a non-zero value. .It Dv TTY_IFEXISTS -Identifies a tty that does not neccessarily exist. +Identifies a tty that does not necessarily exist. .It Dv TTY_IFCONSOLE Identifies a tty that might be a system console. .El From owner-svn-src-head@freebsd.org Tue Feb 27 12:53:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D873F22CF5; Tue, 27 Feb 2018 12:53:26 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A92474A10; Tue, 27 Feb 2018 12:53:26 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 350042984; Tue, 27 Feb 2018 12:53:26 +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 w1RCrQU0058518; Tue, 27 Feb 2018 12:53:26 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RCrPn7058515; Tue, 27 Feb 2018 12:53:25 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201802271253.w1RCrPn7058515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 27 Feb 2018 12:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330056 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 330056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 12:53:26 -0000 Author: tsoome Date: Tue Feb 27 12:53:25 2018 New Revision: 330056 URL: https://svnweb.freebsd.org/changeset/base/330056 Log: libsa: replace remaining _write callbacks by null_write There are some _write callbacks left only returning EROFS, replace them by null_write. return EROFS from null_write(). Reviewed by: cem, imp, kan Differential Revision: https://reviews.freebsd.org/D14523 Modified: head/stand/libsa/cd9660.c head/stand/libsa/nullfs.c head/stand/libsa/tftp.c Modified: head/stand/libsa/cd9660.c ============================================================================== --- head/stand/libsa/cd9660.c Tue Feb 27 10:55:33 2018 (r330055) +++ head/stand/libsa/cd9660.c Tue Feb 27 12:53:25 2018 (r330056) @@ -66,8 +66,6 @@ static int cd9660_open(const char *path, struct open_f static int cd9660_close(struct open_file *f); static int cd9660_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static int cd9660_write(struct open_file *f, const void *buf, size_t size, - size_t *resid); static off_t cd9660_seek(struct open_file *f, off_t offset, int where); static int cd9660_stat(struct open_file *f, struct stat *sb); static int cd9660_readdir(struct open_file *f, struct dirent *d); @@ -86,7 +84,7 @@ struct fs_ops cd9660_fsops = { cd9660_open, cd9660_close, cd9660_read, - cd9660_write, + null_write, cd9660_seek, cd9660_stat, cd9660_readdir @@ -554,13 +552,6 @@ again: fp->f_off += isonum_711(ep->length); return (0); -} - -static int -cd9660_write(struct open_file *f __unused, const void *buf __unused, - size_t size __unused, size_t *resid __unused) -{ - return EROFS; } static off_t Modified: head/stand/libsa/nullfs.c ============================================================================== --- head/stand/libsa/nullfs.c Tue Feb 27 10:55:33 2018 (r330055) +++ head/stand/libsa/nullfs.c Tue Feb 27 12:53:25 2018 (r330056) @@ -85,7 +85,7 @@ int null_read (struct open_file *f, void *buf, size_t int null_write (struct open_file *f, const void *buf, size_t size, size_t *resid) { - return EIO; + return EROFS; } off_t null_seek (struct open_file *f, off_t offset, int where) Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Tue Feb 27 10:55:33 2018 (r330055) +++ head/stand/libsa/tftp.c Tue Feb 27 12:53:25 2018 (r330056) @@ -69,8 +69,6 @@ static int tftp_open(const char *path, struct open_fil static int tftp_close(struct open_file *f); static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static int tftp_write(struct open_file *f, const void *buf, size_t size, - size_t *resid); static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); @@ -80,7 +78,7 @@ struct fs_ops tftp_fsops = { tftp_open, tftp_close, tftp_read, - tftp_write, + null_write, tftp_seek, tftp_stat, null_readdir @@ -572,13 +570,6 @@ tftp_close(struct open_file *f) } is_open = 0; return (0); -} - -static int -tftp_write(struct open_file *f __unused, const void *start __unused, - size_t size __unused, size_t *resid __unused /* out */) -{ - return (EROFS); } static int From owner-svn-src-head@freebsd.org Tue Feb 27 13:43:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99152F27186; Tue, 27 Feb 2018 13:43:01 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 39E2177D9B; Tue, 27 Feb 2018 13:43:00 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2001:630:212:2a8:3113:b9c5:6591:bff4] (unknown [IPv6:2001:630:212:2a8:3113:b9c5:6591:bff4]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id C81174E63F; Tue, 27 Feb 2018 13:42:21 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r330041 - in head/sys/dev/cxgbe: . crypto From: Andrew Turner In-Reply-To: <201802262212.w1QMCVUW015291@repo.freebsd.org> Date: Tue, 27 Feb 2018 13:42:20 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <892FC376-0B0D-4408-A1B4-0B19C7E25E3E@fubar.geek.nz> References: <201802262212.w1QMCVUW015291@repo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 13:43:01 -0000 > On 26 Feb 2018, at 22:12, John Baldwin wrote: >=20 > Author: jhb > Date: Mon Feb 26 22:12:31 2018 > New Revision: 330041 > URL: https://svnweb.freebsd.org/changeset/base/330041 >=20 > Log: > Move ccr_aes_getdeckey() from ccr(4) to the cxgbe(4) driver. >=20 > This routine will also be used by the TOE module to manage TLS keys. >=20 > Sponsored by: Chelsio Communications I=E2=80=99m getting the following on arm64 after this change: = /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/sys/dev/cxgbe/t4_main.c= :10197:19: error: use of undeclared identifier 'RIJNDAEL_MAXNR' uint32_t ek[4 * (RIJNDAEL_MAXNR + 1)]; ^ = /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/sys/dev/cxgbe/t4_main.c= :10201:2: error: implicit declaration of function 'rijndaelKeySetupEnc' = is invalid in C99 [-Werror,-Wimplicit-function-declaration] rijndaelKeySetupEnc(ek, enc_key, kbits); ^ Andrew From owner-svn-src-head@freebsd.org Tue Feb 27 14:08:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09255F28EB5; Tue, 27 Feb 2018 14:08:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD9B978C73; Tue, 27 Feb 2018 14:08:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A42E834CC; Tue, 27 Feb 2018 14:08:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RE8s7d096572; Tue, 27 Feb 2018 14:08:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RE8sgu096571; Tue, 27 Feb 2018 14:08:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271408.w1RE8sgu096571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330057 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 14:08:55 -0000 Author: avg Date: Tue Feb 27 14:08:54 2018 New Revision: 330057 URL: https://svnweb.freebsd.org/changeset/base/330057 Log: add ZFS_ENTER protection to .zfs/snapshot vnode operations that need it Those operations, zfsctl_snapdir_readdir and zfsctl_snapdir_getattr, access the filesystem's objset and it can be unstable during operations like receive and rollback. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 27 12:53:25 2018 (r330056) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 27 14:08:54 2018 (r330057) @@ -1071,6 +1071,7 @@ zfsctl_snapdir_readdir(ap) return (error); } + ZFS_ENTER(zfsvfs); for (;;) { uint64_t cookie; uint64_t id; @@ -1087,6 +1088,7 @@ zfsctl_snapdir_readdir(ap) *eofp = 1; error = 0; } + ZFS_EXIT(zfsvfs); return (error); } @@ -1099,6 +1101,7 @@ zfsctl_snapdir_readdir(ap) if (error != 0) { if (error == ENAMETOOLONG) error = 0; + ZFS_EXIT(zfsvfs); return (SET_ERROR(error)); } uio->uio_offset = cookie + dots_offset; @@ -1122,6 +1125,7 @@ zfsctl_snapdir_getattr(ap) uint64_t snap_count; int err; + ZFS_ENTER(zfsvfs); zfsctl_common_getattr(vp, vap); vap->va_ctime = dmu_objset_snap_cmtime(zfsvfs->z_os); vap->va_mtime = vap->va_ctime; @@ -1129,12 +1133,15 @@ zfsctl_snapdir_getattr(ap) if (dsl_dataset_phys(ds)->ds_snapnames_zapobj != 0) { err = zap_count(dmu_objset_pool(ds->ds_objset)->dp_meta_objset, dsl_dataset_phys(ds)->ds_snapnames_zapobj, &snap_count); - if (err != 0) + if (err != 0) { + ZFS_EXIT(zfsvfs); return (err); + } vap->va_nlink += snap_count; } vap->va_size = vap->va_nlink; + ZFS_EXIT(zfsvfs); return (0); } From owner-svn-src-head@freebsd.org Tue Feb 27 15:01:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC979F2D0D7; Tue, 27 Feb 2018 15:01:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 822CE7BFAF; Tue, 27 Feb 2018 15:01:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CE5F4199; Tue, 27 Feb 2018 15:01:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RF1IMJ022879; Tue, 27 Feb 2018 15:01:18 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RF1HQC022873; Tue, 27 Feb 2018 15:01:17 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201802271501.w1RF1HQC022873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 27 Feb 2018 15:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330072 - in head/sys: arm/broadcom/bcm2835 dts/arm X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 dts/arm X-SVN-Commit-Revision: 330072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 15:01:19 -0000 Author: mmel Date: Tue Feb 27 15:01:17 2018 New Revision: 330072 URL: https://svnweb.freebsd.org/changeset/base/330072 Log: Switch to mainstream DTS for Raspberry Pi-B and Pi-2. This is first step in attempt to make FreeBSD compatible with all variants of RPi boards. Reviewed by: gonzo MFC after: 3 weeks Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c head/sys/dts/arm/rpi.dts head/sys/dts/arm/rpi2.dts Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue Feb 27 14:51:21 2018 (r330071) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue Feb 27 15:01:17 2018 (r330072) @@ -133,6 +133,13 @@ struct bcm_intc_softc { struct bcm_intc_irqsrc intc_isrcs[BCM_INTC_NIRQS]; }; +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-armctrl-ic", 1}, + {"brcm,bcm2835-armctrl-ic", 1}, + {"brcm,bcm2836-armctrl-ic", 1}, + {NULL, 0} +}; + static struct bcm_intc_softc *bcm_intc_sc = NULL; #define intc_read_4(_sc, reg) \ @@ -366,9 +373,9 @@ bcm_intc_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-armctrl-ic") && - !ofw_bus_is_compatible(dev, "brcm,bcm2836-armctrl-ic")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); + device_set_desc(dev, "BCM2835 Interrupt Controller"); return (BUS_PROBE_DEFAULT); } Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Feb 27 14:51:21 2018 (r330071) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Feb 27 15:01:17 2018 (r330072) @@ -77,6 +77,7 @@ static int bcm2835_sdhci_pio_mode = 0; static struct ofw_compat_data compat_data[] = { {"broadcom,bcm2835-sdhci", 1}, + {"brcm,bcm2835-sdhci", 1}, {"brcm,bcm2835-mmc", 1}, {NULL, 0} }; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Tue Feb 27 14:51:21 2018 (r330071) +++ head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Tue Feb 27 15:01:17 2018 (r330072) @@ -90,6 +90,12 @@ static struct resource_spec bcm_systimer_irq_spec[] = { -1, 0, 0 } }; +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-system-timer", 1}, + {"brcm,bcm2835-system-timer", 1}, + {NULL, 0} +}; + static struct bcm_systimer_softc *bcm_systimer_sc = NULL; /* Read/Write macros for Timer used as timecounter */ @@ -196,12 +202,10 @@ bcm_systimer_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-system-timer")) { - device_set_desc(dev, "BCM2835 System Timer"); - return (BUS_PROBE_DEFAULT); - } + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); - return (ENXIO); + return (BUS_PROBE_DEFAULT); } static int Modified: head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c Tue Feb 27 14:51:21 2018 (r330071) +++ head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c Tue Feb 27 15:01:17 2018 (r330072) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); static struct ofw_compat_data compat_data[] = { {"broadcom,bcm2835-usb", 1}, + {"brcm,bcm2835-usb", 1}, {"brcm,bcm2708-usb", 1}, {NULL, 0} }; Modified: head/sys/dts/arm/rpi.dts ============================================================================== --- head/sys/dts/arm/rpi.dts Tue Feb 27 14:51:21 2018 (r330071) +++ head/sys/dts/arm/rpi.dts Tue Feb 27 15:01:17 2018 (r330072) @@ -24,378 +24,73 @@ * * $FreeBSD$ */ -/dts-v1/; + +#include "bcm2835-rpi-b.dts" -/include/ "bcm2835.dtsi" - / { - model = "Raspberry Pi (BCM2835)"; - compatible = "raspberrypi,model-a", "raspberrypi,model-b", - "broadcom,bcm2835-vc", "broadcom,bcm2708-vc"; - - memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ - - cpus { - #address-cells = <1>; - #size-cells = <0>; - cpu@0 { - compatible = "arm,1176jzf-s"; - device_type = "cpu"; - reg = <0>; /* CPU ID=0 */ - clock-frequency = <700000000>; /* 700MHz */ - }; - }; - + /* This is only necessary for FDT_DTB_STATIC */ memory { device_type = "memory"; reg = <0 0x8000000>; /* 128MB, Set by VideoCore */ }; - system { - revision = <0>; /* Set by VideoCore */ - serial = <0 0>; /* Set by VideoCore */ - }; - - axi { - gpio: gpio { - /* BSC0 */ - pins_bsc0_a: bsc0_a { - broadcom,function = "ALT0"; - }; - - pins_bsc0_b: bsc0_b { - broadcom,function = "ALT0"; - }; - - pins_bsc0_c: bsc0_c { - broadcom,function = "ALT1"; - }; - - /* BSC1 */ - pins_bsc1_a: bsc1_a { - broadcom,function = "ALT0"; - }; - - pins_bsc1_b: bsc1_b { - broadcom,function = "ALT2"; - }; - - /* GPCLK0 */ - pins_gpclk0_a: gpclk0_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk0_b: gpclk0_b { - broadcom,function = "ALT5"; - }; - - pins_gpclk0_c: gpclk0_c { - broadcom,function = "ALT0"; - }; - - pins_gpclk0_d: gpclk0_d { - broadcom,function = "ALT0"; - }; - - /* GPCLK1 */ - pins_gpclk1_a: gpclk1_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk1_b: gpclk1_b { - broadcom,function = "ALT5"; - }; - - pins_gpclk1_c: gpclk1_c { - broadcom,function = "ALT0"; - }; - - pins_gpclk1_d: gpclk1_d { - broadcom,function = "ALT0"; - }; - - /* GPCLK2 */ - pins_gpclk2_a: gpclk2_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk2_b: gpclk2_b { - broadcom,function = "ALT0"; - }; - - /* SPI0 */ - pins_spi0_a: spi0_a { - broadcom,function = "ALT0"; - }; - - pins_spi0_b: spi0_b { - broadcom,function = "ALT0"; - }; - - /* PWM */ - pins_pwm0_a: pwm0_a { - broadcom,function = "ALT0"; - }; - - pins_pwm0_b: pwm0_b { - broadcom,function = "ALT5"; - }; - - pins_pwm0_c: pwm0_c { - broadcom,function = "ALT0"; - }; - - pins_pwm1_a: pwm1_a { - broadcom,function = "ALT0"; - }; - - pins_pwm1_b: pwm1_b { - broadcom,function = "ALT5"; - }; - - pins_pwm1_c: pwm1_c { - broadcom,function = "ALT0"; - }; - - pins_pwm1_d: pwm1_d { - broadcom,function = "ALT0"; - }; - - /* UART0 */ - pins_uart0_a: uart0_a { - broadcom,function = "ALT0"; - }; - - pins_uart0_b: uart0_b { - broadcom,function = "ALT3"; - }; - - pins_uart0_c: uart0_c { - broadcom,function = "ALT2"; - }; - - pins_uart0_fc_a: uart0_fc_a { - broadcom,function = "ALT3"; - }; - - pins_uart0_fc_b: uart0_fc_b { - broadcom,function = "ALT3"; - }; - - pins_uart0_fc_c: uart0_fc_c { - broadcom,function = "ALT2"; - }; - - /* PCM */ - pins_pcm_a: pcm_a { - broadcom,function = "ALT0"; - }; - - pins_pcm_b: pcm_b { - broadcom,function = "ALT2"; - }; - - /* Secondary Address Bus */ - pins_sm_addr_a: sm_addr_a { - broadcom,function = "ALT1"; - }; - - pins_sm_addr_b: sm_addr_b { - broadcom,function = "ALT1"; - }; - - pins_sm_ctl_a: sm_ctl_a { - broadcom,function = "ALT1"; - }; - - pins_sm_ctl_b: sm_ctl_b { - broadcom,function = "ALT1"; - }; - - pins_sm_data_8bit_a: sm_data_8bit_a { - broadcom,function = "ALT1"; - }; - - pins_sm_data_8bit_b: sm_data_8bit_b { - broadcom,function = "ALT1"; - }; - - pins_sm_data_16bit: sm_data_16bit { - broadcom,function = "ALT1"; - }; - - pins_sm_data_18bit: sm_data_18bit { - broadcom,function = "ALT1"; - }; - - /* BSCSL */ - pins_bscsl: bscsl { - broadcom,function = "ALT3"; - }; - - /* SPISL */ - pins_spisl: spisl { - broadcom,function = "ALT3"; - }; - - /* SPI1 */ - pins_spi1: spi1 { - broadcom,function = "ALT4"; - }; - - /* UART1 */ - pins_uart1_a: uart1_a { - broadcom,function = "ALT5"; - }; - - pins_uart1_b: uart1_b { - broadcom,function = "ALT5"; - }; - - pins_uart1_c: uart1_c { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_a: uart1_fc_a { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_b: uart1_fc_b { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_c: uart1_fc_c { - broadcom,function = "ALT5"; - }; - - /* SPI2 */ - pins_spi2: spi2 { - broadcom,function = "ALT4"; - }; - - /* ARM JTAG */ - pins_arm_jtag_trst: arm_jtag_trst { - broadcom,function = "ALT4"; - }; - - pins_arm_jtag_a: arm_jtag_a { - broadcom,function = "ALT5"; - }; - - pins_arm_jtag_b: arm_jtag_b { - broadcom,function = "ALT4"; - }; - - /* Reserved */ - pins_reserved: reserved { - broadcom,function = "ALT3"; - }; - }; - usb { - hub { - compatible = "usb,hub", "usb,device"; - reg = <0x00000001>; - #address-cells = <1>; - #size-cells = <0>; - ethernet: ethernet { - compatible = "net,ethernet", - "usb,device"; - reg = <0x00000001>; - mac-address = [00 00 00 00 00 00]; - }; - }; - - }; - - - }; - - display { - compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; - - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <1>; - - broadcom,width = <0>; /* Set by VideoCore */ - broadcom,height = <0>; /* Set by VideoCore */ - broadcom,depth = <0>; /* Set by VideoCore */ - }; - rpi_ft5406 { compatible = "rpi,rpi-ft5406"; status = "okay"; }; - leds { - compatible = "gpio-leds"; - ok { - label = "ok"; - gpios = <&gpio 16 1>; + /* Temporary patches */ + soc { + sdhost: mmc@7e202000 { + status = "disabled"; + } - /* Don't change this - it configures - * how the led driver determines if - * the led is on or off when it loads. - */ - default-state = "keep"; - - /* This is the real default state. */ - linux,default-trigger = "default-on"; + sdhci@7e300000 { + status = "okay"; }; - }; - power: regulator { - compatible = "broadcom,bcm2835-power-mgr", - "broadcom,bcm2708-power-mgr", - "simple-bus"; - #address-cells = <1>; - #size-cells = <0>; + rng@7e104000 { + interrupts = <2 29>; + } - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <0>; + spi@7e204000 { + status = "okay"; + }; - regulator-name = "VideoCore"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on = <1>; - - sd_card_power: regulator@0 { - compatible = "broadcom,bcm2835-power-dev", - "broadcom,bcm2708-power-dev"; - reg = <0>; - - vin-supply = <&power>; - regulator-name = "SD Card"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; + gpio@7e200000 { + /* Pins that can short 3.3V to GND in output mode: 46-47 + * Pins used by VideoCore: 48-53 + */ + broadcom,read-only = <46>, <47>, <48>, <49>, <50>, + <51>, <52>, <53>; + + /* Reserved */ + pins_reserved: reserved { + broadcom,pins = <48>, <49>, <50>, <51>, <52>, + <53>; + }; + } + + vchiq { + compatible = "brcm,bcm2835-vchiq"; + reg = <0x7e00b840 0xf>; + interrupts = <0 2>; + cache-line-size = <32>; }; - /* This is for the controller itself, not the root port */ - usb_hcd_power: regulator@3 { - compatible = "broadcom,bcm2835-power-dev", - "broadcom,bcm2708-power-dev"; - reg = <3>; + display { + compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; - vin-supply = <&power>; - regulator-name = "USB HCD"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; + broadcom,vc-mailbox = <&mailbox>; + broadcom,vc-channel = <1>; + + broadcom,width = <0>; /* Set by VideoCore */ + broadcom,height = <0>; /* Set by VideoCore */ + broadcom,depth = <0>; /* Set by VideoCore */ }; - }; - aliases { - uart0 = &uart0; - ethernet0 = ðernet; }; - - chosen { - bootargs = ""; /* Set by VideoCore */ - stdin = "uart0"; - stdout = "uart0"; - }; - - __overrides__ { - cache_line_size = <&vchiq>, "cache-line-size:0"; - }; }; + Modified: head/sys/dts/arm/rpi2.dts ============================================================================== --- head/sys/dts/arm/rpi2.dts Tue Feb 27 14:51:21 2018 (r330071) +++ head/sys/dts/arm/rpi2.dts Tue Feb 27 15:01:17 2018 (r330072) @@ -24,389 +24,72 @@ * * $FreeBSD$ */ -/dts-v1/; -/include/ "bcm2836.dtsi" +#include "bcm2836-rpi-2-b.dts" / { - model = "Raspberry Pi 2 Model B"; - compatible = "brcm,bcm2836"; - - memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ - - cpus { - #address-cells = <1>; - #size-cells = <0>; - cpu@0 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0xf00>; /* CPU ID=0xf00 */ - clock-frequency = <800000000>; /* 800MHz */ - }; - cpu@1 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0xf01>; /* CPU ID=0xf01 */ - clock-frequency = <800000000>; /* 800MHz */ - }; - cpu@2 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0xf02>; /* CPU ID=0xf02 */ - clock-frequency = <800000000>; /* 800MHz */ - }; - cpu@3 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0xf03>; /* CPU ID=0xf03 */ - clock-frequency = <800000000>; /* 800MHz */ - }; - }; - + /* This is only necessary for FDT_DTB_STATIC */ memory { device_type = "memory"; reg = <0 0x8000000>; /* 128MB, Set by VideoCore */ }; - system { - revision = <0>; /* Set by VideoCore */ - serial = <0 0>; /* Set by VideoCore */ - }; - - axi { - gpio: gpio { - /* BSC0 */ - pins_bsc0_a: bsc0_a { - broadcom,function = "ALT0"; - }; - - pins_bsc0_b: bsc0_b { - broadcom,function = "ALT0"; - }; - - pins_bsc0_c: bsc0_c { - broadcom,function = "ALT1"; - }; - - /* BSC1 */ - pins_bsc1_a: bsc1_a { - broadcom,function = "ALT0"; - }; - - pins_bsc1_b: bsc1_b { - broadcom,function = "ALT2"; - }; - - /* GPCLK0 */ - pins_gpclk0_a: gpclk0_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk0_b: gpclk0_b { - broadcom,function = "ALT5"; - }; - - pins_gpclk0_c: gpclk0_c { - broadcom,function = "ALT0"; - }; - - pins_gpclk0_d: gpclk0_d { - broadcom,function = "ALT0"; - }; - - /* GPCLK1 */ - pins_gpclk1_a: gpclk1_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk1_b: gpclk1_b { - broadcom,function = "ALT5"; - }; - - pins_gpclk1_c: gpclk1_c { - broadcom,function = "ALT0"; - }; - - pins_gpclk1_d: gpclk1_d { - broadcom,function = "ALT0"; - }; - - /* GPCLK2 */ - pins_gpclk2_a: gpclk2_a { - broadcom,function = "ALT0"; - }; - - pins_gpclk2_b: gpclk2_b { - broadcom,function = "ALT0"; - }; - - /* SPI0 */ - pins_spi0_a: spi0_a { - broadcom,function = "ALT0"; - }; - - pins_spi0_b: spi0_b { - broadcom,function = "ALT0"; - }; - - /* PWM */ - pins_pwm0_a: pwm0_a { - broadcom,function = "ALT0"; - }; - - pins_pwm0_b: pwm0_b { - broadcom,function = "ALT5"; - }; - - pins_pwm0_c: pwm0_c { - broadcom,function = "ALT0"; - }; - - pins_pwm1_a: pwm1_a { - broadcom,function = "ALT0"; - }; - - pins_pwm1_b: pwm1_b { - broadcom,function = "ALT5"; - }; - - pins_pwm1_c: pwm1_c { - broadcom,function = "ALT0"; - }; - - pins_pwm1_d: pwm1_d { - broadcom,function = "ALT0"; - }; - - /* UART0 */ - pins_uart0_a: uart0_a { - broadcom,function = "ALT0"; - }; - - pins_uart0_b: uart0_b { - broadcom,function = "ALT3"; - }; - - pins_uart0_c: uart0_c { - broadcom,function = "ALT2"; - }; - - pins_uart0_fc_a: uart0_fc_a { - broadcom,function = "ALT3"; - }; - - pins_uart0_fc_b: uart0_fc_b { - broadcom,function = "ALT3"; - }; - - pins_uart0_fc_c: uart0_fc_c { - broadcom,function = "ALT2"; - }; - - /* PCM */ - pins_pcm_a: pcm_a { - broadcom,function = "ALT0"; - }; - - pins_pcm_b: pcm_b { - broadcom,function = "ALT2"; - }; - - /* Secondary Address Bus */ - pins_sm_addr_a: sm_addr_a { - broadcom,function = "ALT1"; - }; - - pins_sm_addr_b: sm_addr_b { - broadcom,function = "ALT1"; - }; - - pins_sm_ctl_a: sm_ctl_a { - broadcom,function = "ALT1"; - }; - - pins_sm_ctl_b: sm_ctl_b { - broadcom,function = "ALT1"; - }; - - pins_sm_data_8bit_a: sm_data_8bit_a { - broadcom,function = "ALT1"; - }; - - pins_sm_data_8bit_b: sm_data_8bit_b { - broadcom,function = "ALT1"; - }; - - pins_sm_data_16bit: sm_data_16bit { - broadcom,function = "ALT1"; - }; - - pins_sm_data_18bit: sm_data_18bit { - broadcom,function = "ALT1"; - }; - - /* BSCSL */ - pins_bscsl: bscsl { - broadcom,function = "ALT3"; - }; - - /* SPISL */ - pins_spisl: spisl { - broadcom,function = "ALT3"; - }; - - /* SPI1 */ - pins_spi1: spi1 { - broadcom,function = "ALT4"; - }; - - /* UART1 */ - pins_uart1_a: uart1_a { - broadcom,function = "ALT5"; - }; - - pins_uart1_b: uart1_b { - broadcom,function = "ALT5"; - }; - - pins_uart1_c: uart1_c { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_a: uart1_fc_a { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_b: uart1_fc_b { - broadcom,function = "ALT5"; - }; - - pins_uart1_fc_c: uart1_fc_c { - broadcom,function = "ALT5"; - }; - - /* SPI2 */ - pins_spi2: spi2 { - broadcom,function = "ALT4"; - }; - - /* ARM JTAG */ - pins_arm_jtag_trst: arm_jtag_trst { - broadcom,function = "ALT4"; - }; - - pins_arm_jtag_a: arm_jtag_a { - broadcom,function = "ALT5"; - }; - - pins_arm_jtag_b: arm_jtag_b { - broadcom,function = "ALT4"; - }; - - /* Reserved */ - pins_reserved: reserved { - broadcom,function = "ALT3"; - }; - }; - usb { - hub { - compatible = "usb,hub", "usb,device"; - reg = <0x00000001>; - #address-cells = <1>; - #size-cells = <0>; - ethernet: ethernet { - compatible = "net,ethernet", - "usb,device"; - reg = <0x00000001>; - mac-address = [00 00 00 00 00 00]; - }; - }; - - }; - }; - - display { - compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; - - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <1>; - - broadcom,width = <0>; /* Set by VideoCore */ - broadcom,height = <0>; /* Set by VideoCore */ - broadcom,depth = <0>; /* Set by VideoCore */ - }; - rpi_ft5406 { compatible = "rpi,rpi-ft5406"; status = "okay"; }; - leds { - compatible = "gpio-leds"; - pwr { - label = "pwr"; - gpios = <&gpio 35 0>; - }; + /* Temporary patches */ + soc { + sdhost: mmc@7e202000 { + status = "disabled"; + } - act { - label = "act"; - gpios = <&gpio 47 0>; + sdhci@7e300000 { + status = "okay"; }; - }; - power: regulator { - compatible = "broadcom,bcm2835-power-mgr", - "broadcom,bcm2708-power-mgr", - "simple-bus"; - #address-cells = <1>; - #size-cells = <0>; + rng@7e104000 { + interrupts = <2 29>; + } - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <0>; + spi@7e204000 { + status = "okay"; + }; - regulator-name = "VideoCore"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-always-on = <1>; + gpio@7e200000 { + /* Pins that can short 3.3V to GND in output mode: 46-47 + * Pins used by VideoCore: 48-53 + */ + broadcom,read-only = <46>, <47>, <48>, <49>, <50>, + <51>, <52>, <53>; + + /* Reserved */ + pins_reserved: reserved { + broadcom,pins = <48>, <49>, <50>, <51>, <52>, + <53>; + }; + } - sd_card_power: regulator@0 { - compatible = "broadcom,bcm2835-power-dev", - "broadcom,bcm2708-power-dev"; - reg = <0>; + vchiq { + compatible = "brcm,bcm2835-vchiq"; + reg = <0x7e00b840 0xf>; + interrupts = <0 2>; + cache-line-size = <32>; + }; - vin-supply = <&power>; - regulator-name = "SD Card"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - }; + display { + compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; - /* This is for the controller itself, not the root port */ - usb_hcd_power: regulator@3 { - compatible = "broadcom,bcm2835-power-dev", - "broadcom,bcm2708-power-dev"; - reg = <3>; + broadcom,vc-mailbox = <&mailbox>; + broadcom,vc-channel = <1>; - vin-supply = <&power>; - regulator-name = "USB HCD"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; + broadcom,width = <0>; /* Set by VideoCore */ + broadcom,height = <0>; /* Set by VideoCore */ + broadcom,depth = <0>; /* Set by VideoCore */ }; - }; - aliases { - uart0 = &uart0; - ethernet0 = ðernet; - }; - - chosen { - bootargs = ""; /* Set by VideoCore */ - stdin = "uart0"; - stdout = "uart0"; - }; - - __overrides__ { - cache_line_size = <&vchiq>, "cache-line-size:0"; }; }; From owner-svn-src-head@freebsd.org Tue Feb 27 15:29:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C72DFF2F739; Tue, 27 Feb 2018 15:29:18 +0000 (UTC) (envelope-from byond.lenox@gmail.com) 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 5643D7DAE9; Tue, 27 Feb 2018 15:29:18 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f44.google.com with SMTP id l191so28129707lfe.1; Tue, 27 Feb 2018 07:29:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=H7CdO/cXyRbB/VjRLoaupwArMxYNPaItoc2MpLY4Zmc=; b=Nrok+4B8zcqT+g7ey1yFNpJIdmdEHGBMFRuJcoj2z3LePZbnue0u4+9Q/x7iO61uQv ENplpaRI+VbPMkQny1ZIwVqe0cH2TIrWkkG6fM7RuIBKGrN7KqrggzcxzmrXAqa6FwJ0 ZkijsBMpZcbSVOoPaqROptDXrAzTPw5puQ0q9dRmgooJ1MG5Jmz5cuZJybWTee/2WnCS DaUmyScL/xB8xqMCU6fGLBdAKH0LS+IYutuj22WyELl+sIRNVY0yqGqh3ZOFuh8JbvrX 4ordR2UAzsoyD46ZHCqnCxNSIuuw2HZXYyKA6jQMp8vF1gwCJ6/8Mc4jaN7iIXgCIhx5 PSLQ== X-Gm-Message-State: APf1xPCZXcOZGD65WVBfNSrcA57sV4I+oBBUBqlHbgRv1pbQHZmLs5s+ q/qAUyWOUmLGxB79vveLXTlGahe8 X-Google-Smtp-Source: AG47ELv+u6oaUDCQruvsikqnTGB0t2RKXfKBdzuJ6xzBe93rgcyflftfXVq+yC7D/qus8phs4W0dyA== X-Received: by 10.25.193.23 with SMTP id r23mr9642528lff.45.1519745350799; Tue, 27 Feb 2018 07:29:10 -0800 (PST) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com. [209.85.215.46]) by smtp.gmail.com with ESMTPSA id 65sm2589734lfa.77.2018.02.27.07.29.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 07:29:10 -0800 (PST) Received: by mail-lf0-f46.google.com with SMTP id t204so28119303lff.9; Tue, 27 Feb 2018 07:29:10 -0800 (PST) X-Received: by 10.46.114.26 with SMTP id n26mr11101700ljc.74.1519745350491; Tue, 27 Feb 2018 07:29:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.54.1 with HTTP; Tue, 27 Feb 2018 07:28:49 -0800 (PST) In-Reply-To: <201802260316.w1Q3G4vc022314@repo.freebsd.org> References: <201802260316.w1Q3G4vc022314@repo.freebsd.org> From: Kyle Evans Date: Tue, 27 Feb 2018 09:28:49 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 To: Warner Losh 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.25 Precedence: list List-Id: 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, 27 Feb 2018 15:29:18 -0000 On Sun, Feb 25, 2018 at 9:16 PM, Warner Losh wrote: > Author: imp > Date: Mon Feb 26 03:16:04 2018 > New Revision: 330004 > URL: https://svnweb.freebsd.org/changeset/base/330004 > > Log: > Add NO_OBJ to those directories that don't make anything. > > For directories that don't many anything, add NO_OBJ=t just before we > include bsd.init.mk. This prevents them from creating an OBJ > directory. In addition, prevent defs.mk from creating the machine > related links in these cases. They aren't needed and break, at least > on stable, the read-only src tree build. > Any objection to also removing efi from i386 SUBDIR? It seems silly to be explicitly adding it when we know nothing here is applicable and it's going to take some amount of work to get there. From owner-svn-src-head@freebsd.org Tue Feb 27 15:31:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8CB2F2FA26; Tue, 27 Feb 2018 15:31:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C3DC7DEEA; Tue, 27 Feb 2018 15:31:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1RFVD6d015764; Tue, 27 Feb 2018 07:31:13 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1RFVDck015763; Tue, 27 Feb 2018 07:31:13 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802271531.w1RFVDck015763@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330072 - in head/sys: arm/broadcom/bcm2835 dts/arm In-Reply-To: <201802271501.w1RF1HQC022873@repo.freebsd.org> To: Michal Meloun Date: Tue, 27 Feb 2018 07:31:13 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 15:31:17 -0000 > Author: mmel > Date: Tue Feb 27 15:01:17 2018 > New Revision: 330072 > URL: https://svnweb.freebsd.org/changeset/base/330072 > > Log: > Switch to mainstream DTS for Raspberry Pi-B and Pi-2. > This is first step in attempt to make FreeBSD compatible with all variants of > RPi boards. > > Reviewed by: gonzo > MFC after: 3 weeks > > Modified: > head/sys/arm/broadcom/bcm2835/bcm2835_intr.c > head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c > head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c > head/sys/dts/arm/rpi.dts > head/sys/dts/arm/rpi2.dts YES! What are the chances of also getting arm7 support working for RPi3? Most other people can run a 32bit OS on this board, I do not see why we only support a 64 bit (aarch64) variant. Thanks! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 27 15:34:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E11A5F2FF65; Tue, 27 Feb 2018 15:34:12 +0000 (UTC) (envelope-from byond.lenox@gmail.com) 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 574757E2EF; Tue, 27 Feb 2018 15:34:12 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f44.google.com with SMTP id i80so8824891lfg.5; Tue, 27 Feb 2018 07:34:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pJ//gQHM8aHDQ5zIeoaul3cOuU5dFR80tHM2LtwwqDg=; b=uVzW45MoLeJjfxrTotbaZvKqydMw+mG0r45QdWjDE056qxiNjfITfbVS0KplMqqpoh mE0tf8d6y7EZicwAl/N481k513fKACmZdsQEky7bK1qIgh0KREtv0HZGJKSph0HMm3pd 8chGu1cQx7nQH77+D7G8YBojOXwiyEakgCOmcYRU+QOHR09kYwxBREdQGvbLOlKQGHQG wFgzKRzXvUe+qBrl9szqxTxZO8+A4SQnQ5w2joH1erNlNBabSXtG2DPZUTqbIj/oBhgB oO18cBFRNI2p32CHUGMGzRo/76nSewqNHNYEweqCKuQ7snlSXQLYDim4xL7vCSJWsbg4 6dLg== X-Gm-Message-State: APf1xPBPxyMB3Uzop9gTOmHj5lr7K5UQ/IMjLznpZTSrPho+qxH4q7M1 KCrG7SVLvf6GfREUPIQS8l895eIy X-Google-Smtp-Source: AG47ELvq8Lm7gxFKK5evkQ/Dq2+Lj6jtLviRBzeRkBZxT/KMBHmaJRotv9V/C1H7F79uVpUa/uJC/g== X-Received: by 10.46.104.26 with SMTP id c26mr10072434lja.43.1519745650284; Tue, 27 Feb 2018 07:34:10 -0800 (PST) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com. [209.85.215.52]) by smtp.gmail.com with ESMTPSA id e27sm2598443lfb.20.2018.02.27.07.34.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 07:34:10 -0800 (PST) Received: by mail-lf0-f52.google.com with SMTP id t204so28145036lff.9; Tue, 27 Feb 2018 07:34:10 -0800 (PST) X-Received: by 10.25.181.147 with SMTP id g19mr11364760lfk.47.1519745650028; Tue, 27 Feb 2018 07:34:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.54.1 with HTTP; Tue, 27 Feb 2018 07:33:49 -0800 (PST) In-Reply-To: References: <201802260316.w1Q3G4vc022314@repo.freebsd.org> From: Kyle Evans Date: Tue, 27 Feb 2018 09:33:49 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 To: Warner Losh 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.25 Precedence: list List-Id: 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, 27 Feb 2018 15:34:13 -0000 n Tue, Feb 27, 2018 at 9:28 AM, Kyle Evans wrote: > On Sun, Feb 25, 2018 at 9:16 PM, Warner Losh wrote: >> Author: imp >> Date: Mon Feb 26 03:16:04 2018 >> New Revision: 330004 >> URL: https://svnweb.freebsd.org/changeset/base/330004 >> >> Log: >> Add NO_OBJ to those directories that don't make anything. >> >> For directories that don't many anything, add NO_OBJ=t just before we >> include bsd.init.mk. This prevents them from creating an OBJ >> directory. In addition, prevent defs.mk from creating the machine >> related links in these cases. They aren't needed and break, at least >> on stable, the read-only src tree build. >> > > Any objection to also removing efi from i386 SUBDIR? It seems silly > to be explicitly adding it when we know nothing here is applicable and > it's going to take some amount of work to get there. In fact, this block [1] feels wrong, too... why are we adding efi to SUBDIR for arch's that don't support it? I understand the GCC checks, but libefi, loader, and boot1 are the main bits of efi/, why are these stuck behind MACHINE_CPUARCH checks? [1] https://svnweb.freebsd.org/base/head/stand/efi/Makefile?view=markup#l17 From owner-svn-src-head@freebsd.org Tue Feb 27 15:35:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C975F3014F; Tue, 27 Feb 2018 15:35:12 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D641D7E4D7; Tue, 27 Feb 2018 15:35:11 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D139147E7; Tue, 27 Feb 2018 15:35:11 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RFZBuK042523; Tue, 27 Feb 2018 15:35:11 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RFZBRQ042522; Tue, 27 Feb 2018 15:35:11 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201802271535.w1RFZBRQ042522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 27 Feb 2018 15:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330073 - head/libexec/rtld-elf/aarch64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/libexec/rtld-elf/aarch64 X-SVN-Commit-Revision: 330073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 15:35:12 -0000 Author: mmel Date: Tue Feb 27 15:35:11 2018 New Revision: 330073 URL: https://svnweb.freebsd.org/changeset/base/330073 Log: Make rtld_bind_start() debugger friendly. Save link register and annotate call frame structure so debugger can unwind call frame created by rtld_bind_start(). MFC after: 2 weeks Modified: head/libexec/rtld-elf/aarch64/rtld_start.S Modified: head/libexec/rtld-elf/aarch64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_start.S Tue Feb 27 15:01:17 2018 (r330072) +++ head/libexec/rtld-elf/aarch64/rtld_start.S Tue Feb 27 15:35:11 2018 (r330073) @@ -55,7 +55,15 @@ END(.rtld_start) * x17 = &_rtld_bind_start */ ENTRY(_rtld_bind_start) + .cfi_startproc mov x17, sp + + /* Save frame pointer and SP */ + stp x29, x30, [sp, #-16]! + mov x29, sp + .cfi_def_cfa x29, 16 + .cfi_offset x30, -8 + .cfi_offset x29, -16 /* Save the arguments */ stp x0, x1, [sp, #-16]! @@ -84,9 +92,6 @@ ENTRY(_rtld_bind_start) /* Call into rtld */ bl _rtld_bind - /* Restore the registers saved by the plt code */ - ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)] - /* Backup the address to branch to */ mov x16, x0 @@ -100,11 +105,16 @@ ENTRY(_rtld_bind_start) ldp x4, x5, [sp], #16 ldp x2, x3, [sp], #16 ldp x0, x1, [sp], #16 - /* And the part of the stack the plt entry handled */ - add sp, sp, #16 + /* Restore frame pointer */ + ldp x29, xzr, [sp], #16 + + /* Restore link register saved by the plt code */ + ldp xzr, x30, [sp], #16 + /* Call into the correct function */ br x16 + .cfi_endproc END(_rtld_bind_start) /* From owner-svn-src-head@freebsd.org Tue Feb 27 15:51:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8100BF31A6B; Tue, 27 Feb 2018 15:51:25 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: from mail-wr0-x234.google.com (mail-wr0-x234.google.com [IPv6:2a00:1450:400c:c0c::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 EC50C7F7F2; Tue, 27 Feb 2018 15:51:24 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: by mail-wr0-x234.google.com with SMTP id k9so25387159wre.9; Tue, 27 Feb 2018 07:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wM9/cBlrfEewxQeH0HAVaC7dPG/0L1EZjnyCvpWNmSU=; b=Jqce13uB9RFiTdyxV5LirMucWYnIPqqly9VJHLYYMoccXvyKUTEF7+9JXEwVpWiwB7 WG/dYYhn+vzJF9wViVBwPowsXRKR8pIN7pS/GO2z1f7Aga8u70HOHBDsHyR5b4qYp4Rc Cwwfg9Lb+X9/mhUIqu9yEg6yrKUz5lt1q7YSgVnYdkFFztVsUxB+tDYARrNQbDQJjU2S +Vc4v688BiFw/4FwHlzhmPTrkHq7UDpFyxoUxCB3qv32xZdTZCjg8kxaiwZ8Ana/AUNH PyX1VTDbvNn9YzOxBMkU29GlsYbV4rZi+iOF3awpbU5P61tNp7cNG4GcINKgOpB8QBHO 5btQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wM9/cBlrfEewxQeH0HAVaC7dPG/0L1EZjnyCvpWNmSU=; b=mc45cZ27OZxvuW00J2vlM/Qm6wMS8GK59u1xqPovU4YI0iKNhR65WgTln/4tnUZYRv JsvIjq0t+FKxJfdMKIErUJzsU5vS03aV01gohQHBu6fEFqe0jQSwBGnu7zmNXowE6IPg +kbg02okSzwVmpsT6QVUV+/kw5jYhpH1wZ3Hcf1WDFWYOWcsAw5ajW7WITFiCPU3+JMM 6bhyJW9Dg4iISqB5GbWn9VnEo3xe2evxr9X2316pwTo9OAh0IZuD1sS//gLl8FKc6H0p L+dbnVpzrV6Zm1OKUSefa5nE2nSLxuSjTCKiuPFB05l3sYID4r5FdqI8RjjNRUBZB2yg zVLg== X-Gm-Message-State: APf1xPDtMxTfQziRm0XNDLRN5pfq+P7TLI3pjS9O0cHOtaawL/Y/VDX1 YkEQgUz+Nk/ez6SxlFy5p1M8IeFMlpu0WatS8TcWdg== X-Google-Smtp-Source: AH8x2243IjKvKfy78H1xzgTZY3DFT2/hAaiinK22MLgCdbzLZzL/M8DxoWnU/k5tByUPngVLIVujRWB2RN3ZYe4gGYc= X-Received: by 10.223.179.211 with SMTP id x19mr12873790wrd.175.1519746683140; Tue, 27 Feb 2018 07:51:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.234.131 with HTTP; Tue, 27 Feb 2018 07:51:22 -0800 (PST) In-Reply-To: <1519322697.91697.138.camel@freebsd.org> References: <201802221747.w1MHlGJS032223@repo.freebsd.org> <1519322697.91697.138.camel@freebsd.org> From: Chuck Tuffli Date: Tue, 27 Feb 2018 07:51:22 -0800 Message-ID: Subject: Re: svn commit: r329830 - head/sbin/nvmecontrol To: Ian Lepore Cc: Alan Somers , 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.25 Precedence: list List-Id: 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, 27 Feb 2018 15:51:25 -0000 On Thu, Feb 22, 2018 at 10:04 AM, Ian Lepore wrote: > On Thu, 2018-02-22 at 17:47 +0000, Alan Somers wrote: >> Author: asomers >> Date: Thu Feb 22 17:47:16 2018 >> New Revision: 329830 >> URL: https://svnweb.freebsd.org/changeset/base/329830 >> >> Log: >> nvmecontrol: fix build on amd64/clang >> >> Broken by: 329824 >> Sponsored by: Spectra Logic Corp >> >> Modified: >> head/sbin/nvmecontrol/identify.c >> >> Modified: head/sbin/nvmecontrol/identify.c >> ============================================================================== >> --- head/sbin/nvmecontrol/identify.c Thu Feb 22 17:09:26 2018 (r329829) >> +++ head/sbin/nvmecontrol/identify.c Thu Feb 22 17:47:16 2018 (r329830) >> @@ -112,7 +112,7 @@ print_controller(struct nvme_controller_data *cdata) >> if (cdata->mdts == 0) >> printf("Unlimited\n"); >> else >> - printf("%ld\n", PAGE_SIZE * (1 << cdata->mdts)); >> + printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); >> printf("Controller ID: 0x%02x\n", cdata->ctrlr_id); >> printf("\n"); > > If cdata->mdts > 19 that'll overflow 32 bits. I'm not sure if that can > happen in the real world or not. If so, maybe it'd be better to do > > printf("%ju\n", PAGE_SIZE * ((uintmax_t)1 << cdata->mdts)); > > -- Ian Yes, MDTS is an 8 bit value and thus can overflow in the way you describe, but typically, it is in the range of 5-12. Also note that multiplying by PAGE_SIZE isn't quite correct as MDTS is in units of the NVMe Controller's advertised minimum page size (i.e. CAP.MPSMIN). Most Controllers will default to a value of 4096 for MPSMIN, so practically, this code will usually work. --chuck From owner-svn-src-head@freebsd.org Tue Feb 27 15:51:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 131B3F31AC5; Tue, 27 Feb 2018 15:51:51 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::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 842CC7F983; Tue, 27 Feb 2018 15:51:50 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wr0-x22b.google.com with SMTP id v65so25339289wrc.11; Tue, 27 Feb 2018 07:51:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nSEmCBogelZ2CtHNhuL9F7pAgbW4zagLGrIcgzVYQOg=; b=b4Dxq3GnJpwUpsrdTeknp/yfhijmUsOVSX4i4ICC4M9MQ9w39nZelH0z98dIne0d4y sfSo+8z55B4SH1KJtiY+wQXEstU8K5ve1hEZ1gPbCgiz5DS1LE8Nk9o3v4lCBdmc+QUx V4jz7Z1f1r1i5885QCMg+CcgWy9rIUufTOfmEjlfe+CzhPo5u37olqxzAGEI1Y5bPtli BeSmBn006rwvMrOw+7tJ/xYoPwcs/SEkJ3r1DbgrYFrf1vm/G545osq7DVhEe/gqzI5T ZtgegS35cWc4O+T4gjD1RDb3TN7xSzN1y6qZILBtVEFkoc2/LgmYCtlId3b+6veq3d2g +YSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:to:cc:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=nSEmCBogelZ2CtHNhuL9F7pAgbW4zagLGrIcgzVYQOg=; b=YpD1iz/2cEHH0cgTml+1ciBI6+dwrHBTv5/dtLbgbX9pbjd20y/1NioBO8pIqRpzxB oxmHFON6x9B1yn2SgGw1EVndP0b5RxyOT3toXyJrbQu8xF1uT6srUXPnRftPoIqh7/Ar MpUjR8qNhDPzL0oevGdB940nTLKzX42RHYt3QYILWLlQSgSfpBXxX5xH3Oab/T0zHC0v LYDC95Zon7ZDOEaqIJ7lkyZUyb9NVJ1lImQVCFdYQJZs03FGAYWFzQoGZR1Jy2jQtyNF 06Wg9QCkiO/Ea5p9SQd0Ejepz2Z80QBqPUsK+rRn01/0JtmRgIrRU8rdZC1Fi01EEXyW 7tjA== X-Gm-Message-State: APf1xPA2fszs/looqhE7D2nPPjpmR+/37C+yANn4knLbiIAqqXlskHGY dsK1gxfqy5Zft6C22ZQ1iD3cQBf+ X-Google-Smtp-Source: AG47ELul5c6aFyalnM1+MMXvkUFOprk5jNkPRlK8sEXiFb6gNss9m1KYNuOkFbNdF2MkH+knXU85Xg== X-Received: by 10.223.144.131 with SMTP id i3mr7367916wri.218.1519746709210; Tue, 27 Feb 2018 07:51:49 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id b136sm9629102wme.34.2018.02.27.07.51.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 07:51:48 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r330072 - in head/sys: arm/broadcom/bcm2835 dts/arm To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802271531.w1RFVDck015763@pdx.rh.CN85.dnsmgr.net> Message-ID: Date: Tue, 27 Feb 2018 16:51:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802271531.w1RFVDck015763@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 15:51:51 -0000 On 27.02.2018 16:31, Rodney W. Grimes wrote: >> Author: mmel >> Date: Tue Feb 27 15:01:17 2018 >> New Revision: 330072 >> URL: https://svnweb.freebsd.org/changeset/base/330072 >> >> Log: >> Switch to mainstream DTS for Raspberry Pi-B and Pi-2. >> This is first step in attempt to make FreeBSD compatible with all variants of >> RPi boards. >> >> Reviewed by: gonzo >> MFC after: 3 weeks >> >> Modified: >> head/sys/arm/broadcom/bcm2835/bcm2835_intr.c >> head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c >> head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c >> head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c >> head/sys/dts/arm/rpi.dts >> head/sys/dts/arm/rpi2.dts > > YES! What are the chances of also getting arm7 support working for RPi3? > Most other people can run a 32bit OS on this board, I do not see why we > only support a 64 bit (aarch64) variant. > Yes, I think that we are very close. We still needs FreeBSD specific overlay (head/sys/dts/arm/rpi(2).dts) and something very similar is also necessary for RPi3, but all other bits should be already in tree. (But I cannot test this now, my RPi3 is dead) Michal From owner-svn-src-head@freebsd.org Tue Feb 27 16:06:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E65C8F32FE0; Tue, 27 Feb 2018 16:06:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49E9C8082F; Tue, 27 Feb 2018 16:06:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1RG6jW5015916; Tue, 27 Feb 2018 08:06:45 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1RG6j3n015915; Tue, 27 Feb 2018 08:06:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802271606.w1RG6j3n015915@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330072 - in head/sys: arm/broadcom/bcm2835 dts/arm In-Reply-To: To: mmel@freebsd.org Date: Tue, 27 Feb 2018 08:06:45 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 16:06:48 -0000 > > On 27.02.2018 16:31, Rodney W. Grimes wrote: > >> Author: mmel > >> Date: Tue Feb 27 15:01:17 2018 > >> New Revision: 330072 > >> URL: https://svnweb.freebsd.org/changeset/base/330072 > >> > >> Log: > >> Switch to mainstream DTS for Raspberry Pi-B and Pi-2. > >> This is first step in attempt to make FreeBSD compatible with all variants of > >> RPi boards. > >> > >> Reviewed by: gonzo > >> MFC after: 3 weeks > >> > >> Modified: > >> head/sys/arm/broadcom/bcm2835/bcm2835_intr.c > >> head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > >> head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c > >> head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c > >> head/sys/dts/arm/rpi.dts > >> head/sys/dts/arm/rpi2.dts > > > > YES! What are the chances of also getting arm7 support working for RPi3? > > Most other people can run a 32bit OS on this board, I do not see why we > > only support a 64 bit (aarch64) variant. > > > > Yes, I think that we are very close. We still needs FreeBSD specific > overlay > (head/sys/dts/arm/rpi(2).dts) and something very similar is also necessary > for RPi3, but all other bits should be already in tree. > (But I cannot test this now, my RPi3 is dead) I can test it, have the cross build platform for it already doing builds of lots of arm/mips/i386 stuff, can easily add RPi4/32 to the mix. And I have the hardware to boot it. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 27 16:08:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 035AAF331B2; Tue, 27 Feb 2018 16:08:09 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACD5280A02; Tue, 27 Feb 2018 16:08:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7AE54D1B; Tue, 27 Feb 2018 16:08:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RG88uW057608; Tue, 27 Feb 2018 16:08:08 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RG88ue057607; Tue, 27 Feb 2018 16:08:08 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201802271608.w1RG88ue057607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 27 Feb 2018 16:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330074 - head/sys/dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/extres/clk X-SVN-Commit-Revision: 330074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 16:08:09 -0000 Author: mmel Date: Tue Feb 27 16:08:08 2018 New Revision: 330074 URL: https://svnweb.freebsd.org/changeset/base/330074 Log: Define meaning of remaining clock rounding flags combinations. MFC after: 2 weeks Modified: head/sys/dev/extres/clk/clk.h Modified: head/sys/dev/extres/clk/clk.h ============================================================================== --- head/sys/dev/extres/clk/clk.h Tue Feb 27 15:35:11 2018 (r330073) +++ head/sys/dev/extres/clk/clk.h Tue Feb 27 16:08:08 2018 (r330074) @@ -44,8 +44,12 @@ #define CLK_NODE_CANNOT_STOP 0x00000004 /* Clock cannot be disabled */ /* Flags passed to clk_set_freq() and clknode_set_freq(). */ +#define CLK_SET_ROUND(x) ((x) & (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN)) +#define CLK_SET_ROUND_EXACT 0 #define CLK_SET_ROUND_UP 0x00000001 #define CLK_SET_ROUND_DOWN 0x00000002 +#define CLK_SET_ROUND_ANY (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN) + #define CLK_SET_USER_MASK 0x0000FFFF #define CLK_SET_DRYRUN 0x00010000 From owner-svn-src-head@freebsd.org Tue Feb 27 16:36:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1E3F35436 for ; Tue, 27 Feb 2018 16:36:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::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 6341A81C29 for ; Tue, 27 Feb 2018 16:36:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id a75so15797775itd.0 for ; Tue, 27 Feb 2018 08:36:45 -0800 (PST) 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=EYPnSW+mRXVfOQXM0ZqvQTlA1g/kiYxlsGTG2NSBPJ0=; b=Ouek8fDdZdbKuooM5aeR4cVGvdXerBLpGHRki/HQlPDCFUOhhnm74RbDl1AQ+WVEWH kl4QylhJg2tqb7Qa2rlKM1nzS2Ipc3YHIZeA6IF0FMPFnicpjCiYtCQAU9sFryk3jUBD eRlQkBZ+3wM9JezgN35bO/dnaRxVINAcqFI5BsbwHZnjAoTWzrN2m21dCaQ6TmliNqXZ Gi3zX04svfnAoxvpommhvhlh4i/DD+QKhaRACBD8rZe3IvI+sEcO5oY/L0ZaXwoUFRoo bSY0PAnHFUvr1mkZHy6Czn9NtT1WHLQV9iOgjc/VR9PmMK0N3JVmKOfzfA8lQSkvqqj6 r/tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=EYPnSW+mRXVfOQXM0ZqvQTlA1g/kiYxlsGTG2NSBPJ0=; b=hdm/z9H0ZYGoNnFOfK72vLcF3aRnOqeSyortwfVhFBKVsWFmDFGeoLjoKi/a5ZcgZk qhX7EY0B6Li94SkSBRZnxQvkIm8fqhSquprHTsuUer4ObFiYbeG5fwEGnbMvq5XH06Em nIbKo5oAxE8UzlF0rxboTvoCitO8Sl+eXiyI4H+HxkABznDZ6ubHzIbj65hM2NABfCGV +Bmq9ByjWgik2y2hE6EW7e/d3mNzQPfqy/wpueKrjIi1KwdbzbshRxYmbkX8wvXM23qX qTJByvd9NLv3HeB/5F3R6hcMlHT4QhUgyVFmyPkYvjXjmjEy93Nfif/a7MTPUUy3I0kb eG2Q== X-Gm-Message-State: APf1xPCjoNvN+xLk3bL+Q52JY8a2zPjXxevyxeYRCF90yEHdpvzcKLvx Xw8uyfxW0nDcZwg0C7Ti1r4eMW2L9NsFAnEMCMc88g== X-Google-Smtp-Source: AH8x226y/3PFb3gFQOmDCMBakS3EM4upbvLHUTzIzqsmx+9248rKs6jf91xTr4LKAXQnf9cAxPuh9wsC1XAcuQ5aeGo= X-Received: by 10.36.222.2 with SMTP id d2mr17045043itg.1.1519749404539; Tue, 27 Feb 2018 08:36:44 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Tue, 27 Feb 2018 08:36:43 -0800 (PST) X-Originating-IP: [50.227.106.226] In-Reply-To: References: <201802260316.w1Q3G4vc022314@repo.freebsd.org> From: Warner Losh Date: Tue, 27 Feb 2018 09:36:43 -0700 X-Google-Sender-Auth: oay5d4KViIPRG5P3UvxM5e_e5GM Message-ID: Subject: Re: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 To: Kyle Evans Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 16:36:46 -0000 On Tue, Feb 27, 2018 at 8:33 AM, Kyle Evans wrote: > n Tue, Feb 27, 2018 at 9:28 AM, Kyle Evans wrote: > > On Sun, Feb 25, 2018 at 9:16 PM, Warner Losh wrote: > >> Author: imp > >> Date: Mon Feb 26 03:16:04 2018 > >> New Revision: 330004 > >> URL: https://svnweb.freebsd.org/changeset/base/330004 > >> > >> Log: > >> Add NO_OBJ to those directories that don't make anything. > >> > >> For directories that don't many anything, add NO_OBJ=t just before we > >> include bsd.init.mk. This prevents them from creating an OBJ > >> directory. In addition, prevent defs.mk from creating the machine > >> related links in these cases. They aren't needed and break, at least > >> on stable, the read-only src tree build. > >> > > > > Any objection to also removing efi from i386 SUBDIR? It seems silly > > to be explicitly adding it when we know nothing here is applicable and > > it's going to take some amount of work to get there. > > In fact, this block [1] feels wrong, too... why are we adding efi to > SUBDIR for arch's that don't support it? I understand the GCC checks, > but libefi, loader, and boot1 are the main bits of efi/, why are these > stuck behind MACHINE_CPUARCH checks? > > [1] https://svnweb.freebsd.org/base/head/stand/efi/Makefile? > view=markup#l17 > I think that none of the arch tests in that file are anywhere near legit in that file. More cargo-cult kludgery to eliminate in the build system. I'll take care of that. If i386 builds, we should keep it, otherwise we shouldn't. In fact, we should move all the EFI ifdef junk-o-matic crap from Makefile. at the top level as well. Lemme toss together a patch. Warner From owner-svn-src-head@freebsd.org Tue Feb 27 16:47:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D572EF3636F; Tue, 27 Feb 2018 16:47:39 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51C5182617; Tue, 27 Feb 2018 16:47:39 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f41.google.com with SMTP id g72so9073643lfg.3; Tue, 27 Feb 2018 08:47:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8WstpuPVOeg7L8nSyKA2UgqhdQigpfg5bhuVi2SWy/4=; b=K14RMH4KFexVxpitIBNkka3GBKL0No3PtVVTV73Qz4iVJL9hsiK7J/mQLRr6cKrnKu lVRuM5EE5ONzK9CxiufvjbUAeDuWXNfnqQy62f9VjumNQIOi28Qv3yCMmOTERVQad9Gn anhfTLhV6caYs2Xo2kOXnFTUHpLtIz7ro5XhXvV+mO3ZHZVKlFF/EerraLcUDe3/1e26 wzawnXtx9rhWzRATDmEwHQVtAt8tDR3fnCBjW+MH0N2HDhFsnUX7vAoi1MaTEvDOC7Fg CDU09hsHPGAHlyoujcbQarZxHgPFPvnY1bzygekd4o34SvsEg/F+Ktu7YmrS7S10Lqu0 xyRQ== X-Gm-Message-State: APf1xPBIrqok0nZkrxC9C4iFmNxyedRXe6n/a7riFfgeU/HHpA1Rpvnq ak1nl6w9VMbuutLBU5jIvySdXI09 X-Google-Smtp-Source: AH8x226H9YksOlqSUhfzh3wFWgbS0+pZQskAla0xWr5SyDkXqXdN60AUJAxKekcVLVYQopuzI6KB7Q== X-Received: by 10.46.27.211 with SMTP id c80mr11216605ljf.46.1519750051521; Tue, 27 Feb 2018 08:47:31 -0800 (PST) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com. [209.85.215.46]) by smtp.gmail.com with ESMTPSA id b7sm2641499ljf.18.2018.02.27.08.47.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 08:47:31 -0800 (PST) Received: by mail-lf0-f46.google.com with SMTP id g72so9073576lfg.3; Tue, 27 Feb 2018 08:47:31 -0800 (PST) X-Received: by 10.46.87.72 with SMTP id r8mr11103562ljd.93.1519750051137; Tue, 27 Feb 2018 08:47:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.54.1 with HTTP; Tue, 27 Feb 2018 08:47:10 -0800 (PST) In-Reply-To: References: <201802260316.w1Q3G4vc022314@repo.freebsd.org> From: Kyle Evans Date: Tue, 27 Feb 2018 10:47:10 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 To: Warner Losh Cc: Warner Losh , 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.25 Precedence: list List-Id: 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, 27 Feb 2018 16:47:40 -0000 On Tue, Feb 27, 2018 at 10:36 AM, Warner Losh wrote: > > > On Tue, Feb 27, 2018 at 8:33 AM, Kyle Evans wrote: >> >> n Tue, Feb 27, 2018 at 9:28 AM, Kyle Evans wrote: >> > On Sun, Feb 25, 2018 at 9:16 PM, Warner Losh wrote: >> >> Author: imp >> >> Date: Mon Feb 26 03:16:04 2018 >> >> New Revision: 330004 >> >> URL: https://svnweb.freebsd.org/changeset/base/330004 >> >> >> >> Log: >> >> Add NO_OBJ to those directories that don't make anything. >> >> >> >> For directories that don't many anything, add NO_OBJ=t just before we >> >> include bsd.init.mk. This prevents them from creating an OBJ >> >> directory. In addition, prevent defs.mk from creating the machine >> >> related links in these cases. They aren't needed and break, at least >> >> on stable, the read-only src tree build. >> >> >> > >> > Any objection to also removing efi from i386 SUBDIR? It seems silly >> > to be explicitly adding it when we know nothing here is applicable and >> > it's going to take some amount of work to get there. >> >> In fact, this block [1] feels wrong, too... why are we adding efi to >> SUBDIR for arch's that don't support it? I understand the GCC checks, >> but libefi, loader, and boot1 are the main bits of efi/, why are these >> stuck behind MACHINE_CPUARCH checks? >> >> [1] >> https://svnweb.freebsd.org/base/head/stand/efi/Makefile?view=markup#l17 > > > I think that none of the arch tests in that file are anywhere near legit in > that file. More cargo-cult kludgery to eliminate in the build system. I'll > take care of that. If i386 builds, we should keep it, otherwise we > shouldn't. In fact, we should move all the EFI ifdef junk-o-matic crap from > Makefile. at the top level as well. > Right- the arch tests surrounding the FDT bits are pointless and only really stop us from building something we won't be using (since FDT is default yes regardless of arch, for some reason). It would be nice if we could build efi/fdt based on whether we'll be building an EFI loader w/ HAVE_FDT set rather than these arch tests, but I understand that that's not necessarily straightforward. > Lemme toss together a patch. > Excellent. =) > Warner From owner-svn-src-head@freebsd.org Tue Feb 27 16:51:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DBF1F366E8; Tue, 27 Feb 2018 16:51:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB498828A1; Tue, 27 Feb 2018 16:51:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E61A553D4; Tue, 27 Feb 2018 16:51:09 +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 w1RGp9Hb080364; Tue, 27 Feb 2018 16:51:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RGp96u080363; Tue, 27 Feb 2018 16:51:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802271651.w1RGp96u080363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Feb 2018 16:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330075 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 330075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 16:51:10 -0000 Author: markj Date: Tue Feb 27 16:51:09 2018 New Revision: 330075 URL: https://svnweb.freebsd.org/changeset/base/330075 Log: Give the 0th domain's page daemon thread a consistent name. Page daemon threads for other domains show up in ps(1) output as "pagedaemon/domN", so let that be the case for domain 0 as well. Submitted by: Kevin Bowling MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14518 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Feb 27 16:08:08 2018 (r330074) +++ head/sys/vm/vm_pageout.c Tue Feb 27 16:51:09 2018 (r330075) @@ -1935,6 +1935,7 @@ vm_pageout(void) int i; swap_pager_swap_init(); + snprintf(curthread->td_name, sizeof(curthread->td_name), "dom0"); error = kthread_add(vm_pageout_laundry_worker, NULL, curproc, NULL, 0, 0, "laundry: dom0"); if (error != 0) From owner-svn-src-head@freebsd.org Tue Feb 27 16:51:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF49F3689D for ; Tue, 27 Feb 2018 16:51:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::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 70CC882A50 for ; Tue, 27 Feb 2018 16:51:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id o9so15826332itc.1 for ; Tue, 27 Feb 2018 08:51:52 -0800 (PST) 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=yD3/qv0LiTRJa+uE9CLHfFIXHW33hDBLK6Blhd55Y6o=; b=TvMfsWvqU2TRiGML+QDc4ewUokw7zBdW/UImwApC/QqklBu9rT/0sol+0lZJzktUn0 zU9lCG47hnJ/YHjyv72PCpppRU0efpMX+8I/USm4vbzUGZJhn8li6DHCZhL+I+PgSvo8 Y56fdMBxYDOMsQcxHeQ9LP58/rr7zGAclu4Ij8rpq0uWZXyTido72nLBX51YsJY1R2Zz 0KkiZ63XeqvG86xp/mpA1i+ZNSO4ocPF2MxvDPhDArZWTStf8mXw4LXre1qei4pSfMM6 6ntdrfNNj4UJpS3sauEW4u7TunIjyxt33So31CxQBB3UtBonwSnHJDBCYPyFn2SYdtT5 Dj+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=yD3/qv0LiTRJa+uE9CLHfFIXHW33hDBLK6Blhd55Y6o=; b=djmFY8aVGIkawjdL+uLxQ6cBu7I/f7QMqzaf8g2lXNKRGaIvnXQugWrLaIDwTorZoO lqCQf7b6cIb9iaVLi01DPDqmKMWe82EtI878IcXtuS3LnES5S0rZozgilhHT0AYjxK/A 5hqBKh3nQBo/W26HNLlwZn9dEN6ymhesCS49D2ZGy8tGRcFGLYb1Vt2gWNr1uq34U3cp IWGyMT4x1XE7nuF3qw1okpN9XoUx2WBKR5FiEOELMzb36QYdmL+pMtCUeG7DsKfSOBzU 4brBLCuO1oLsBtQzOMTcO3LJhDGHq4Zz0VIMiG0sLRaCnhl0a5k7jK0hEM9U+nhcTSS/ ApAg== X-Gm-Message-State: APf1xPBpT2XnuDgQtLSe5WvCgmQOj2wtc0t3P0T8YmWpiiz0MzEj54Mn m/fcA8c6Nm9GUFNSlbXg9a8qDkt/4MPyUD11J7uSOw== X-Google-Smtp-Source: AG47ELsiRx8TdCs4zBNFmNiccJTOiKMKllr1p0zLBaKgnbjQDzLvcxP0Jg2qIPXTUpa366TVePn33BcGyNHX9Akvf2Q= X-Received: by 10.36.4.65 with SMTP id 62mr2532932itb.57.1519750311544; Tue, 27 Feb 2018 08:51:51 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Tue, 27 Feb 2018 08:51:50 -0800 (PST) X-Originating-IP: [50.227.106.226] In-Reply-To: References: <201802260316.w1Q3G4vc022314@repo.freebsd.org> From: Warner Losh Date: Tue, 27 Feb 2018 09:51:50 -0700 X-Google-Sender-Auth: kLKvn7dFlDb9Nqsks7vpa-4LvaY Message-ID: Subject: Re: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 To: Kyle Evans Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 16:51:53 -0000 On Tue, Feb 27, 2018 at 9:47 AM, Kyle Evans wrote: > On Tue, Feb 27, 2018 at 10:36 AM, Warner Losh wrote: > > > > > > On Tue, Feb 27, 2018 at 8:33 AM, Kyle Evans wrote: > >> > >> n Tue, Feb 27, 2018 at 9:28 AM, Kyle Evans wrote: > >> > On Sun, Feb 25, 2018 at 9:16 PM, Warner Losh wrote: > >> >> Author: imp > >> >> Date: Mon Feb 26 03:16:04 2018 > >> >> New Revision: 330004 > >> >> URL: https://svnweb.freebsd.org/changeset/base/330004 > >> >> > >> >> Log: > >> >> Add NO_OBJ to those directories that don't make anything. > >> >> > >> >> For directories that don't many anything, add NO_OBJ=t just before > we > >> >> include bsd.init.mk. This prevents them from creating an OBJ > >> >> directory. In addition, prevent defs.mk from creating the machine > >> >> related links in these cases. They aren't needed and break, at > least > >> >> on stable, the read-only src tree build. > >> >> > >> > > >> > Any objection to also removing efi from i386 SUBDIR? It seems silly > >> > to be explicitly adding it when we know nothing here is applicable and > >> > it's going to take some amount of work to get there. > >> > >> In fact, this block [1] feels wrong, too... why are we adding efi to > >> SUBDIR for arch's that don't support it? I understand the GCC checks, > >> but libefi, loader, and boot1 are the main bits of efi/, why are these > >> stuck behind MACHINE_CPUARCH checks? > >> > >> [1] > >> https://svnweb.freebsd.org/base/head/stand/efi/Makefile?view=markup#l17 > > > > > > I think that none of the arch tests in that file are anywhere near legit > in > > that file. More cargo-cult kludgery to eliminate in the build system. > I'll > > take care of that. If i386 builds, we should keep it, otherwise we > > shouldn't. In fact, we should move all the EFI ifdef junk-o-matic crap > from > > Makefile. at the top level as well. > > > > Right- the arch tests surrounding the FDT bits are pointless and only > really stop us from building something we won't be using (since FDT is > default yes regardless of arch, for some reason). > > It would be nice if we could build efi/fdt based on whether we'll be > building an EFI loader w/ HAVE_FDT set rather than these arch tests, > but I understand that that's not necessarily straightforward. It all comes from a fundamental misunderstanding that there's three options for every build option: default yes, default no, and broken.... Warner > Lemme toss together a patch. > > > > Excellent. =) > > > Warner > From owner-svn-src-head@freebsd.org Tue Feb 27 17:12:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8F05F3811C; Tue, 27 Feb 2018 17:12:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A3E083D01; Tue, 27 Feb 2018 17:12:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7555E58BA; Tue, 27 Feb 2018 17:12:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RHCXec092117; Tue, 27 Feb 2018 17:12:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RHCXKt092116; Tue, 27 Feb 2018 17:12:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802271712.w1RHCXKt092116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 27 Feb 2018 17:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330076 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 330076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 17:12:34 -0000 Author: asomers Date: Tue Feb 27 17:12:33 2018 New Revision: 330076 URL: https://svnweb.freebsd.org/changeset/base/330076 Log: fix typo in ipfw(8). No functional change. Submitted by: zxzharmlesszxz Pull Request: https://github.com/freebsd/freebsd/pull/132 Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Tue Feb 27 16:51:09 2018 (r330075) +++ head/sbin/ipfw/tables.c Tue Feb 27 17:12:33 2018 (r330076) @@ -516,7 +516,7 @@ table_modify(ipfw_obj_header *oh, int ac, char *av[]) ac--; av++; break; default: - errx(EX_USAGE, "cmd is not supported for modificatiob"); + errx(EX_USAGE, "cmd is not supported for modification"); } } From owner-svn-src-head@freebsd.org Tue Feb 27 17:35:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EA0FF39B1A; Tue, 27 Feb 2018 17:35:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20AB284DDE; Tue, 27 Feb 2018 17:35:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BA295C43; Tue, 27 Feb 2018 17:35:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RHZTMY002326; Tue, 27 Feb 2018 17:35:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RHZT4q002319; Tue, 27 Feb 2018 17:35:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802271735.w1RHZT4q002319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 27 Feb 2018 17:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330077 - in head: share/mk stand stand/efi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/mk stand stand/efi X-SVN-Commit-Revision: 330077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 17:35:30 -0000 Author: imp Date: Tue Feb 27 17:35:29 2018 New Revision: 330077 URL: https://svnweb.freebsd.org/changeset/base/330077 Log: Move EFI up to common makefile. There's no need for all these .if's based on architecture. Sponsored by: Netflix Modified: head/share/mk/src.opts.mk head/stand/Makefile head/stand/Makefile.amd64 head/stand/Makefile.arm head/stand/Makefile.arm64 head/stand/Makefile.i386 head/stand/efi/Makefile Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Feb 27 17:12:33 2018 (r330076) +++ head/share/mk/src.opts.mk Tue Feb 27 17:35:29 2018 (r330077) @@ -125,6 +125,7 @@ __DEFAULT_YES_OPTIONS = \ LPR \ LS_COLORS \ LZMA_SUPPORT \ + LOADER_EFI \ LOADER_GELI \ MAIL \ MAILWRAPPER \ @@ -285,8 +286,9 @@ BROKEN_OPTIONS+=LIBSOFT .if ${__T:Mmips*} BROKEN_OPTIONS+=SSP .endif +# EFI doesn't exist on mips, powerpc, sparc or riscv. .if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} -BROKEN_OPTIONS+=EFI +BROKEN_OPTIONS+=EFI LOADER_EFI .endif .if ${__T:Mmips64*} # profiling won't work on MIPS64 because there is only assembly for o32 Modified: head/stand/Makefile ============================================================================== --- head/stand/Makefile Tue Feb 27 17:12:33 2018 (r330076) +++ head/stand/Makefile Tue Feb 27 17:35:29 2018 (r330077) @@ -18,6 +18,10 @@ SUBDIR+= man .include +.if ${MK_EFI} != "no" && ${MK_LOADER_EFI} != "no" +SUBDIR+= efi +.endif + .if exists(${.CURDIR}/${MACHINE}/.) SUBDIR+= ${MACHINE} .endif Modified: head/stand/Makefile.amd64 ============================================================================== --- head/stand/Makefile.amd64 Tue Feb 27 17:12:33 2018 (r330076) +++ head/stand/Makefile.amd64 Tue Feb 27 17:35:29 2018 (r330077) @@ -11,7 +11,6 @@ SUBDIR+= ficl32 SUBDIR+= liblua32 .endif -SUBDIR+= efi SUBDIR+= userboot .if ${MK_LOADER_GELI} == "yes" Modified: head/stand/Makefile.arm ============================================================================== --- head/stand/Makefile.arm Tue Feb 27 17:12:33 2018 (r330076) +++ head/stand/Makefile.arm Tue Feb 27 17:35:29 2018 (r330077) @@ -7,4 +7,4 @@ SUBDIR+= fdt SUBDIR+= zfs .endif -SUBDIR+= efi uboot +SUBDIR+= uboot Modified: head/stand/Makefile.arm64 ============================================================================== --- head/stand/Makefile.arm64 Tue Feb 27 17:12:33 2018 (r330076) +++ head/stand/Makefile.arm64 Tue Feb 27 17:35:29 2018 (r330077) @@ -6,5 +6,3 @@ SUBDIR+= fdt .if ${MK_ZFS} != "no" SUBDIR+= zfs .endif - -SUBDIR+= efi Modified: head/stand/Makefile.i386 ============================================================================== --- head/stand/Makefile.i386 Tue Feb 27 17:12:33 2018 (r330076) +++ head/stand/Makefile.i386 Tue Feb 27 17:35:29 2018 (r330077) @@ -6,5 +6,3 @@ SUBDIR+= geli .if ${MK_ZFS} != "no" SUBDIR+= zfs .endif - -SUBDIR+= efi Modified: head/stand/efi/Makefile ============================================================================== --- head/stand/efi/Makefile Tue Feb 27 17:12:33 2018 (r330076) +++ head/stand/efi/Makefile Tue Feb 27 17:35:29 2018 (r330077) @@ -8,17 +8,11 @@ NO_OBJ=t # than 4.5 supports it. .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" .if ${MK_FDT} != "no" SUBDIR+= fdt .endif -.endif -.if ${MACHINE_CPUARCH} == "aarch64" || \ - ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" SUBDIR+= libefi loader boot1 -.endif .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 From owner-svn-src-head@freebsd.org Tue Feb 27 17:36:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80C7FF39BE5; Tue, 27 Feb 2018 17:36:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB8A84F36; Tue, 27 Feb 2018 17:36:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24FEE5C44; Tue, 27 Feb 2018 17:36:02 +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 w1RHa2WF002393; Tue, 27 Feb 2018 17:36:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RHa2bC002392; Tue, 27 Feb 2018 17:36:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802271736.w1RHa2bC002392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 27 Feb 2018 17:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330078 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 330078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 17:36:02 -0000 Author: imp Date: Tue Feb 27 17:36:01 2018 New Revision: 330078 URL: https://svnweb.freebsd.org/changeset/base/330078 Log: Doc __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and BROKEN_OPTIONS in one paragraph to highlight the relationship between them. Suggested by: kevans@ Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Feb 27 17:35:29 2018 (r330077) +++ head/share/mk/src.opts.mk Tue Feb 27 17:36:01 2018 (r330078) @@ -41,7 +41,16 @@ ____: # that haven't been converted over. # -# These options are used by the src builds +# These options are used by the src builds. Those listed in +# __DEFAULT_YES_OPTIONS default to 'yes' and will build unless turned +# off. __DEFAULT_NO_OPTIONS will default to 'no' and won't build +# unless turned on. Any options listed in 'BROKEN_OPTIONS' will be +# hard-wired to 'no'. "Broken" here means not working or +# not-appropriate and/or not supported. It doesn't imply something is +# wrong with the code. There's not a single good word for this, so +# BROKEN was selected as the least imperfect one considered at the +# time. Options are added to BROKEN_OPTIONS list on a per-arch basis. +# At this time, there's no provision for mutually incompatible options. __DEFAULT_YES_OPTIONS = \ ACCT \ From owner-svn-src-head@freebsd.org Tue Feb 27 17:51:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73632F3ADC0; Tue, 27 Feb 2018 17:51:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 212C085A88; Tue, 27 Feb 2018 17:51:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BF565F64; Tue, 27 Feb 2018 17:51:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RHpwTQ010593; Tue, 27 Feb 2018 17:51:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RHpw4X010570; Tue, 27 Feb 2018 17:51:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802271751.w1RHpw4X010570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Feb 2018 17:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330079 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 330079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 17:51:59 -0000 Author: jhb Date: Tue Feb 27 17:51:58 2018 New Revision: 330079 URL: https://svnweb.freebsd.org/changeset/base/330079 Log: Move #include for rijndael.h out of x86-specific region. The #include was added inside of the conditional by accident and the lack of it broke non-x86 builds. Reported by: lwhsu (jenkins), andrew Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 27 17:36:01 2018 (r330078) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 27 17:51:58 2018 (r330079) @@ -67,8 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #endif +#include #ifdef DDB #include #include From owner-svn-src-head@freebsd.org Tue Feb 27 18:52:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDAB8F3F6B2; Tue, 27 Feb 2018 18:52:40 +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 9865168EE7; Tue, 27 Feb 2018 18:52:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8E22410AF2A; Tue, 27 Feb 2018 13:52:39 -0500 (EST) From: John Baldwin To: rgrimes@freebsd.org Cc: Michal Meloun , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330072 - in head/sys: arm/broadcom/bcm2835 dts/arm Date: Tue, 27 Feb 2018 09:47:01 -0800 Message-ID: <8288550.4akxqU8sYM@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802271531.w1RFVDck015763@pdx.rh.CN85.dnsmgr.net> References: <201802271531.w1RFVDck015763@pdx.rh.CN85.dnsmgr.net> 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); Tue, 27 Feb 2018 13:52:39 -0500 (EST) 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.25 Precedence: list List-Id: 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, 27 Feb 2018 18:52:41 -0000 On Tuesday, February 27, 2018 07:31:13 AM Rodney W. Grimes wrote: > > Author: mmel > > Date: Tue Feb 27 15:01:17 2018 > > New Revision: 330072 > > URL: https://svnweb.freebsd.org/changeset/base/330072 > > > > Log: > > Switch to mainstream DTS for Raspberry Pi-B and Pi-2. > > This is first step in attempt to make FreeBSD compatible with all variants of > > RPi boards. > > > > Reviewed by: gonzo > > MFC after: 3 weeks > > > > Modified: > > head/sys/arm/broadcom/bcm2835/bcm2835_intr.c > > head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > > head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c > > head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c > > head/sys/dts/arm/rpi.dts > > head/sys/dts/arm/rpi2.dts > > YES! What are the chances of also getting arm7 support working for RPi3? > Most other people can run a 32bit OS on this board, I do not see why we > only support a 64 bit (aarch64) variant. Hmm, my RPI2 v1.2 (which is an RPI3 without wireless) runs both arm64 and armv7 just fine and has since late summer. (All my testing of armv7 support that was upstreamed into GDB 8.1 was done on that board.) The main changes it needed at the time were some u-boot updates and a commit to properly disable a virtual timer on boot that was causing boot hangs. I think there might have been one other commit to make sdhci deal with the DTS not including a clock frequency or some such as well. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Feb 27 18:52:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E648F3F6DE; Tue, 27 Feb 2018 18:52:47 +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 78EFA68F62; Tue, 27 Feb 2018 18:52:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 48CC410AC13; Tue, 27 Feb 2018 13:52:38 -0500 (EST) From: John Baldwin To: Kyle Evans Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 Date: Tue, 27 Feb 2018 09:50:50 -0800 Message-ID: <1613436.oZ5flIo0b9@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201802260316.w1Q3G4vc022314@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); Tue, 27 Feb 2018 13:52:38 -0500 (EST) 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.25 Precedence: list List-Id: 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, 27 Feb 2018 18:52:47 -0000 On Tuesday, February 27, 2018 09:28:49 AM Kyle Evans wrote: > On Sun, Feb 25, 2018 at 9:16 PM, Warner Losh wrote: > > Author: imp > > Date: Mon Feb 26 03:16:04 2018 > > New Revision: 330004 > > URL: https://svnweb.freebsd.org/changeset/base/330004 > > > > Log: > > Add NO_OBJ to those directories that don't make anything. > > > > For directories that don't many anything, add NO_OBJ=t just before we > > include bsd.init.mk. This prevents them from creating an OBJ > > directory. In addition, prevent defs.mk from creating the machine > > related links in these cases. They aren't needed and break, at least > > on stable, the read-only src tree build. > > > > Any objection to also removing efi from i386 SUBDIR? It seems silly > to be explicitly adding it when we know nothing here is applicable and > it's going to take some amount of work to get there. Actually, I believe the only thing it needs is for the i386 kernel to understand the EFI memory map. If you made the i386 EFI loader fake up the SMAP metadata from the EFI memory map you could probably boot an unmodified i386 kernel. (It would be better to teach the i386 kernel to handle the EFI memory map though.) It's more a matter of does someone care enough to actually get a test environment going to test it. One would also eventually want to teach the i386 kernel about efifb as well as EFI runtime services, but that shouldn't be strictly required for booting an i386 kernel via EFI. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Feb 27 19:38:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD65AF2144C; Tue, 27 Feb 2018 19:38:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 312116B988; Tue, 27 Feb 2018 19:38:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1RJceRb016761; Tue, 27 Feb 2018 11:38:40 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1RJcebu016760; Tue, 27 Feb 2018 11:38:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802271938.w1RJcebu016760@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 In-Reply-To: <1613436.oZ5flIo0b9@ralph.baldwin.cx> To: John Baldwin Date: Tue, 27 Feb 2018 11:38:40 -0800 (PST) CC: Kyle Evans , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 19:38:50 -0000 > On Tuesday, February 27, 2018 09:28:49 AM Kyle Evans wrote: > > On Sun, Feb 25, 2018 at 9:16 PM, Warner Losh wrote: > > > Author: imp > > > Date: Mon Feb 26 03:16:04 2018 > > > New Revision: 330004 > > > URL: https://svnweb.freebsd.org/changeset/base/330004 > > > > > > Log: > > > Add NO_OBJ to those directories that don't make anything. > > > > > > For directories that don't many anything, add NO_OBJ=t just before we > > > include bsd.init.mk. This prevents them from creating an OBJ > > > directory. In addition, prevent defs.mk from creating the machine > > > related links in these cases. They aren't needed and break, at least > > > on stable, the read-only src tree build. > > > > > > > Any objection to also removing efi from i386 SUBDIR? It seems silly > > to be explicitly adding it when we know nothing here is applicable and > > it's going to take some amount of work to get there. > > Actually, I believe the only thing it needs is for the i386 kernel to > understand the EFI memory map. If you made the i386 EFI loader fake up the > SMAP metadata from the EFI memory map you could probably boot an unmodified > i386 kernel. (It would be better to teach the i386 kernel to handle the EFI > memory map though.) It's more a matter of does someone care enough to > actually get a test environment going to test it. I may have some of the test pieces in place in the form of ipxe32.efi and network booting. I just cant rember which piece of hardware triggered that path in my configuration, I had to force it to legacy bios mode to get it working. > One would also eventually want to teach the i386 kernel about efifb as well > as EFI runtime services, but that shouldn't be strictly required for booting > an i386 kernel via EFI. How much of that could be done in bhyve with a different compile of edk2? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 27 19:49:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71A07F22410; Tue, 27 Feb 2018 19:49:29 +0000 (UTC) (envelope-from gonzo@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 0C5EA6C265; Tue, 27 Feb 2018 19:49:28 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1 (FreeBSD)) (envelope-from ) id 1eqlFY-000EVd-ER; Tue, 27 Feb 2018 11:49:20 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id w1RJnJgC055776; Tue, 27 Feb 2018 11:49:19 -0800 (PST) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Tue, 27 Feb 2018 11:49:19 -0800 From: Oleksandr Tymoshenko To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330072 - in head/sys: arm/broadcom/bcm2835 dts/arm Message-ID: <20180227194919.GA55766@bluezbox.com> References: <201802271501.w1RF1HQC022873@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802271501.w1RF1HQC022873@repo.freebsd.org> X-Operating-System: FreeBSD/11.1-RELEASE-p4 (amd64) User-Agent: Mutt/1.9.1 (2017-09-22) 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: Michal Meloun (mmel@FreeBSD.org) wrote: > Author: mmel > Date: Tue Feb 27 15:01:17 2018 > New Revision: 330072 > URL: https://svnweb.freebsd.org/changeset/base/330072 > > Log: > Switch to mainstream D [...] 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.25 Precedence: list List-Id: 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, 27 Feb 2018 19:49:29 -0000 Michal Meloun (mmel@FreeBSD.org) wrote: > Author: mmel > Date: Tue Feb 27 15:01:17 2018 > New Revision: 330072 > URL: https://svnweb.freebsd.org/changeset/base/330072 > > Log: > Switch to mainstream DTS for Raspberry Pi-B and Pi-2. > This is first step in attempt to make FreeBSD compatible with all variants of > RPi boards. > > Reviewed by: gonzo > MFC after: 3 weeks > > Modified: > head/sys/arm/broadcom/bcm2835/bcm2835_intr.c > head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c > head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c > head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c > head/sys/dts/arm/rpi.dts > head/sys/dts/arm/rpi2.dts Thanks for working on this -- gonzo From owner-svn-src-head@freebsd.org Tue Feb 27 21:06:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10102F28ED1; Tue, 27 Feb 2018 21:06:03 +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 714B86FE65; Tue, 27 Feb 2018 21:06:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id E79CE10A8C2; Tue, 27 Feb 2018 16:06:00 -0500 (EST) From: John Baldwin To: rgrimes@freebsd.org Cc: Kyle Evans , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330004 - in head/stand: . arm efi forth i386 mips powerpc sparc64 Date: Tue, 27 Feb 2018 12:12:55 -0800 Message-ID: <1693065.RfaVEKElXH@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802271938.w1RJcebu016760@pdx.rh.CN85.dnsmgr.net> References: <201802271938.w1RJcebu016760@pdx.rh.CN85.dnsmgr.net> 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); Tue, 27 Feb 2018 16:06:01 -0500 (EST) 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.25 Precedence: list List-Id: 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, 27 Feb 2018 21:06:03 -0000 On Tuesday, February 27, 2018 11:38:40 AM Rodney W. Grimes wrote: > > On Tuesday, February 27, 2018 09:28:49 AM Kyle Evans wrote: > > > On Sun, Feb 25, 2018 at 9:16 PM, Warner Losh wrote: > > > > Author: imp > > > > Date: Mon Feb 26 03:16:04 2018 > > > > New Revision: 330004 > > > > URL: https://svnweb.freebsd.org/changeset/base/330004 > > > > > > > > Log: > > > > Add NO_OBJ to those directories that don't make anything. > > > > > > > > For directories that don't many anything, add NO_OBJ=t just before we > > > > include bsd.init.mk. This prevents them from creating an OBJ > > > > directory. In addition, prevent defs.mk from creating the machine > > > > related links in these cases. They aren't needed and break, at least > > > > on stable, the read-only src tree build. > > > > > > > > > > Any objection to also removing efi from i386 SUBDIR? It seems silly > > > to be explicitly adding it when we know nothing here is applicable and > > > it's going to take some amount of work to get there. > > > > Actually, I believe the only thing it needs is for the i386 kernel to > > understand the EFI memory map. If you made the i386 EFI loader fake up the > > SMAP metadata from the EFI memory map you could probably boot an unmodified > > i386 kernel. (It would be better to teach the i386 kernel to handle the EFI > > memory map though.) It's more a matter of does someone care enough to > > actually get a test environment going to test it. > > I may have some of the test pieces in place in the form of ipxe32.efi > and network booting. I just cant rember which piece of hardware > triggered that path in my configuration, I had to force it to legacy > bios mode to get it working. > > > One would also eventually want to teach the i386 kernel about efifb as well > > as EFI runtime services, but that shouldn't be strictly required for booting > > an i386 kernel via EFI. > > How much of that could be done in bhyve with a different compile of edk2? It could be done, but I've never built edk2 for bhyve. I believe there are existing EFI32 blobs for qemu though and that is probably a quicker route to getting this working (it is what I would do if I worked on it). -- John Baldwin From owner-svn-src-head@freebsd.org Tue Feb 27 21:22:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C7CBF2A51D; Tue, 27 Feb 2018 21:22:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 227EC70EEC; Tue, 27 Feb 2018 21:22:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C1B510354; Tue, 27 Feb 2018 21:22:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RLMvOM018414; Tue, 27 Feb 2018 21:22:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RLMvpV018412; Tue, 27 Feb 2018 21:22:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802272122.w1RLMvpV018412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 27 Feb 2018 21:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330082 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 21:22:58 -0000 Author: kevans Date: Tue Feb 27 21:22:57 2018 New Revision: 330082 URL: https://svnweb.freebsd.org/changeset/base/330082 Log: lualoader: Add a twiddle at password prompt This gives some form of feedback while typing, and matches-(ish*) Forth behavior. The cursor generally rests two column after the password prompt, then the twiddle is drawn three columns later and the cursor reset to resting position after being drawn. I've removed the note about re-evaluating it for security considerations and instead set it up as a module-local variable that we can set later depending on environment or something. It's set to false with no chance of changing at the moment. *As close as I can tell from reading check-password.4th, because I don't have an easy test (or deployed) setup for forth loader to check how close it is. Please do mention if it's not close enough. Modified: head/stand/lua/password.lua head/stand/lua/screen.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Tue Feb 27 19:24:06 2018 (r330081) +++ head/stand/lua/password.lua Tue Feb 27 21:22:57 2018 (r330082) @@ -33,27 +33,46 @@ local core = require("core") local screen = require("screen") local password = {} +-- Asterisks as a password mask +local show_password_mask = false +local twiddle_chars = {"/", "-", "\\", "|"} +local twiddle_pos = 1 -- Module exports function password.read() local str = "" local n = 0 + twiddle_pos = 1 + local function draw_twiddle() + loader.printc(" " .. twiddle_chars[twiddle_pos]) + screen.movecursor(-3, -1) + twiddle_pos = (twiddle_pos % #twiddle_chars) + 1 + end + + -- Space between the prompt and any on-screen feedback + loader.printc(" ") while true do local ch = io.getchar() if ch == core.KEY_ENTER then break end - -- XXX TODO: Evaluate if we really want this or not, as a - -- security consideration of sorts if ch == core.KEY_BACKSPACE or ch == core.KEY_DELETE then if n > 0 then n = n - 1 - -- loader.printc("\008 \008") + if show_password_mask then + loader.printc("\008 \008") + else + draw_twiddle() + end str = str:sub(1, n) end else - -- loader.printc("*") + if show_password_mask then + loader.printc("*") + else + draw_twiddle() + end str = str .. string.char(ch) n = n + 1 end Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Tue Feb 27 19:24:06 2018 (r330081) +++ head/stand/lua/screen.lua Tue Feb 27 21:22:57 2018 (r330082) @@ -49,6 +49,24 @@ function screen.setcursor(x, y) loader.printc("\027[" .. y .. ";" .. x .. "H") end +function screen.movecursor(dx, dy) + if core.isSerialBoot() then + return + end + + if dx < 0 then + loader.printc("\027[" .. -dx .. "D") + elseif dx > 0 then + loader.printc("\027[" .. dx .. "C") + end + + if dy < 0 then + loader.printc("\027[" .. -dy .. "A") + elseif dy > 0 then + loader.printc("\027[" .. dy .. "B") + end +end + function screen.setforeground(color_value) if color.disabled then return color_value From owner-svn-src-head@freebsd.org Tue Feb 27 21:30:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B561F2AE24; Tue, 27 Feb 2018 21:30:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E024971483; Tue, 27 Feb 2018 21:30:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB14C10366; Tue, 27 Feb 2018 21:30:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RLUOrm019760; Tue, 27 Feb 2018 21:30:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RLUOZ0019758; Tue, 27 Feb 2018 21:30:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802272130.w1RLUOZ0019758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 27 Feb 2018 21:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330083 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 21:30:25 -0000 Author: kevans Date: Tue Feb 27 21:30:24 2018 New Revision: 330083 URL: https://svnweb.freebsd.org/changeset/base/330083 Log: lualoader: Remove remnants of testing... twiddle_pos didn't need to be a module-scope local, since it's going to get reset with every read anyways- it was left-over from other things. screen.movecursor with a y=-1 setting was from a test of movecursor, resulting in the twiddle characters being drawn going up the console and looking quite funky. Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Tue Feb 27 21:22:57 2018 (r330082) +++ head/stand/lua/password.lua Tue Feb 27 21:30:24 2018 (r330083) @@ -36,17 +36,16 @@ local password = {} -- Asterisks as a password mask local show_password_mask = false local twiddle_chars = {"/", "-", "\\", "|"} -local twiddle_pos = 1 -- Module exports function password.read() local str = "" local n = 0 + local twiddle_pos = 1 - twiddle_pos = 1 local function draw_twiddle() loader.printc(" " .. twiddle_chars[twiddle_pos]) - screen.movecursor(-3, -1) + screen.movecursor(-3, 0) twiddle_pos = (twiddle_pos % #twiddle_chars) + 1 end From owner-svn-src-head@freebsd.org Tue Feb 27 21:52:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82B68F2CA18; Tue, 27 Feb 2018 21:52:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E614724FA; Tue, 27 Feb 2018 21:52:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2967010865; Tue, 27 Feb 2018 21:52:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RLqNdj037182; Tue, 27 Feb 2018 21:52:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RLqMmW037179; Tue, 27 Feb 2018 21:52:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802272152.w1RLqMmW037179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 27 Feb 2018 21:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330084 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 21:52:23 -0000 Author: kevans Date: Tue Feb 27 21:52:22 2018 New Revision: 330084 URL: https://svnweb.freebsd.org/changeset/base/330084 Log: lualoader: Replace instances of \027 with KEYSTR_ESCAPE With exception to drawing bits, which should probably be kept as-is to not make a mess out of things. Reported by: rpokala (a while ago) Modified: head/stand/lua/color.lua head/stand/lua/screen.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Tue Feb 27 21:30:24 2018 (r330083) +++ head/stand/lua/color.lua Tue Feb 27 21:52:22 2018 (r330084) @@ -62,14 +62,14 @@ function color.escapef(color_value) if color.disabled then return color_value end - return "\027[3" .. color_value .. "m" + return core.KEYSTR_ESCAPE .. "[3" .. color_value .. "m" end function color.escapeb(color_value) if color.disabled then return color_value end - return "\027[4" .. color_value .. "m" + return core.KEYSTR_ESCAPE .. "[4" .. color_value .. "m" end function color.escape(fg_color, bg_color, attribute) @@ -81,7 +81,7 @@ function color.escape(fg_color, bg_color, attribute) else attribute = attribute .. ";" end - return "\027[" .. attribute .. + return core.KEYSTR_ESCAPE .. "[" .. attribute .. "3" .. fg_color .. ";4" .. bg_color .. "m" end @@ -89,14 +89,14 @@ function color.default() if color.disabled then return "" end - return "\027[0;37;40m" + return core.KEYSTR_ESCAPE .. "[0;37;40m" end function color.highlight(str) if color.disabled then return str end - return "\027[1m" .. str .. "\027[0m" + return core.KEYSTR_ESCAPE .. "[1m" .. str .. core.KEYSTR_ESCAPE .. "[0m" end return color Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Tue Feb 27 21:30:24 2018 (r330083) +++ head/stand/lua/screen.lua Tue Feb 27 21:52:22 2018 (r330084) @@ -38,7 +38,7 @@ function screen.clear() if core.isSerialBoot() then return end - loader.printc("\027[H\027[J") + loader.printc(core.KEYSTR_ESCAPE .. "[H" .. core.KEYSTR_ESCAPE .. "[J") end function screen.setcursor(x, y) @@ -46,7 +46,7 @@ function screen.setcursor(x, y) return end - loader.printc("\027[" .. y .. ";" .. x .. "H") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. y .. ";" .. x .. "H") end function screen.movecursor(dx, dy) @@ -55,15 +55,15 @@ function screen.movecursor(dx, dy) end if dx < 0 then - loader.printc("\027[" .. -dx .. "D") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. -dx .. "D") elseif dx > 0 then - loader.printc("\027[" .. dx .. "C") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. dx .. "C") end if dy < 0 then - loader.printc("\027[" .. -dy .. "A") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. -dy .. "A") elseif dy > 0 then - loader.printc("\027[" .. dy .. "B") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. dy .. "B") end end @@ -89,7 +89,7 @@ function screen.defcursor() if core.isSerialBoot() then return end - loader.printc("\027[25;0H") + loader.printc(core.KEYSTR_ESCAPE .. "[25;0H") end return screen From owner-svn-src-head@freebsd.org Tue Feb 27 21:59:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31D72F2D250; Tue, 27 Feb 2018 21:59:24 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8FCE72911; Tue, 27 Feb 2018 21:59:23 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3FA61087E; Tue, 27 Feb 2018 21:59:23 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RLxNAi038349; Tue, 27 Feb 2018 21:59:23 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RLxNj8038348; Tue, 27 Feb 2018 21:59:23 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201802272159.w1RLxNj8038348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 27 Feb 2018 21:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330085 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 330085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 21:59:24 -0000 Author: dab Date: Tue Feb 27 21:59:23 2018 New Revision: 330085 URL: https://svnweb.freebsd.org/changeset/base/330085 Log: dhclient violates RFC2131 when sending early DHCPREQUEST message to re-obtain old IP When dhclient first starts, if an old IP address exists in the dhclient.leases file, dhclient(8) sends early DHCPREQUEST message(s) in an attempt to re-obtain the old IP address again. These messages contain the old IP as a requested-IP-address option in the message body (correct) but also use the old IP address as the packet's source IP (incorrect). RFC2131 sec 4.1 states: DHCP messages broadcast by a client prior to that client obtaining its IP address must have the source address field in the IP header set to 0. The use of the old IP as the packet's source address is incorrect if (a) the computer is now on a different network or (b) it is on the same network, but the old IP has been reallocated to another host. Fix dhclient to use 0.0.0.0 as the source IP in this circumstance without removing any existing functionality. Any previously-used old IP is still requested in the body of an early DHCPREQUEST message. PR: 199378 Submitted by: J.R. Oldroyd Reported by: J.R. Oldroyd Reviewed by: cem, asomers, vangyzen MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14527 Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Tue Feb 27 21:52:22 2018 (r330084) +++ head/sbin/dhclient/dhclient.c Tue Feb 27 21:59:23 2018 (r330085) @@ -1513,7 +1513,8 @@ cancel: memcpy(&to.s_addr, ip->client->destination.iabuf, sizeof(to.s_addr)); - if (ip->client->state != S_REQUESTING) + if (ip->client->state != S_REQUESTING && + ip->client->state != S_REBOOTING) memcpy(&from, ip->client->active->address.iabuf, sizeof(from)); else From owner-svn-src-head@freebsd.org Tue Feb 27 22:01:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 283C9F2D4DF; Tue, 27 Feb 2018 22:01:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D149D72C3F; Tue, 27 Feb 2018 22:01:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3047109E0; Tue, 27 Feb 2018 22:01:40 +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 w1RM1edJ042454; Tue, 27 Feb 2018 22:01:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RM1ej4042450; Tue, 27 Feb 2018 22:01:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802272201.w1RM1ej4042450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 27 Feb 2018 22:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330086 - in head/usr.bin/seq: . tests X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/usr.bin/seq: . tests X-SVN-Commit-Revision: 330086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 22:01:41 -0000 Author: cem Date: Tue Feb 27 22:01:40 2018 New Revision: 330086 URL: https://svnweb.freebsd.org/changeset/base/330086 Log: seq(1): Consistently include 'last' for non-integers The source of error is a rounded increment being too large and thus the loop steps slightly past 'last'. Perform a final comparison using the formatted string values (truncated precision) to determine if we still need to print the 'last' value. PR: 217149 Submitted by: Fernando Apesteguía , Yuri Pankov (earlier version) Reported by: Martijn Dekker Sponsored by: Dell EMC Isilon Added: head/usr.bin/seq/tests/ head/usr.bin/seq/tests/Makefile (contents, props changed) head/usr.bin/seq/tests/seq_test.sh (contents, props changed) Modified: head/usr.bin/seq/Makefile head/usr.bin/seq/seq.c Modified: head/usr.bin/seq/Makefile ============================================================================== --- head/usr.bin/seq/Makefile Tue Feb 27 21:59:23 2018 (r330085) +++ head/usr.bin/seq/Makefile Tue Feb 27 22:01:40 2018 (r330086) @@ -1,8 +1,13 @@ # $NetBSD: Makefile,v 1.3 2009/04/14 22:15:26 lukem Exp $ # $FreeBSD$ +.include + PROG= seq LIBADD= m + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/seq/seq.c ============================================================================== --- head/usr.bin/seq/seq.c Tue Feb 27 21:59:23 2018 (r330085) +++ head/usr.bin/seq/seq.c Tue Feb 27 22:01:40 2018 (r330086) @@ -76,17 +76,20 @@ static char *unescape(char *); int main(int argc, char *argv[]) { - int c = 0, errflg = 0; - int equalize = 0; - double first = 1.0; - double last = 0.0; - double incr = 0.0; + const char *sep, *term; struct lconv *locale; - char *fmt = NULL; - const char *sep = "\n"; - const char *term = NULL; - char pad = ZERO; + char pad, *fmt, *cur_print, *last_print; + double first, last, incr, last_shown_value, cur, step; + int c, errflg, equalize; + pad = ZERO; + fmt = NULL; + first = 1.0; + last = incr = last_shown_value = 0.0; + c = errflg = equalize = 0; + sep = "\n"; + term = NULL; + /* Determine the locale's decimal point. */ locale = localeconv(); if (locale && locale->decimal_point && locale->decimal_point[0] != '\0') @@ -169,17 +172,32 @@ main(int argc, char *argv[]) } else fmt = generate_format(first, incr, last, equalize, pad); - if (incr > 0) { - for (; first <= last; first += incr) { - printf(fmt, first); - fputs(sep, stdout); - } - } else { - for (; first >= last; first += incr) { - printf(fmt, first); - fputs(sep, stdout); - } + for (step = 1, cur = first; incr > 0 ? cur <= last : cur >= last; + cur = first + incr * step++) { + printf(fmt, cur); + fputs(sep, stdout); + last_shown_value = cur; } + + /* + * Did we miss the last value of the range in the loop above? + * + * We might have, so check if the printable version of the last + * computed value ('cur') and desired 'last' value are equal. If they + * are equal after formatting truncation, but 'cur' and + * 'last_shown_value' are not equal, it means the exit condition of the + * loop held true due to a rounding error and we still need to print + * 'last'. + */ + asprintf(&cur_print, fmt, cur); + asprintf(&last_print, fmt, last); + if (strcmp(cur_print, last_print) == 0 && cur != last_shown_value) { + fputs(last_print, stdout); + fputs(sep, stdout); + } + free(cur_print); + free(last_print); + if (term != NULL) fputs(term, stdout); Added: head/usr.bin/seq/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/seq/tests/Makefile Tue Feb 27 22:01:40 2018 (r330086) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH= seq_test + +.include Added: head/usr.bin/seq/tests/seq_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/seq/tests/seq_test.sh Tue Feb 27 22:01:40 2018 (r330086) @@ -0,0 +1,40 @@ +# Copyright (c) 2018 Conrad Meyer +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +atf_test_case float_rounding +float_rounding_head() +{ + atf_set "descr" "Check for correct termination in the face of floating point rounding" +} +float_rounding_body() +{ + atf_check -o inline:'1\n1.1\n1.2\n' seq 1 0.1 1.2 +} + +atf_init_test_cases() +{ + atf_add_test_case float_rounding +} From owner-svn-src-head@freebsd.org Tue Feb 27 22:02:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD388F2D7AE; Tue, 27 Feb 2018 22:02:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7016E72FEA; Tue, 27 Feb 2018 22:02:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B03010A1F; Tue, 27 Feb 2018 22:02:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RM2ewf043366; Tue, 27 Feb 2018 22:02:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RM2ekm043363; Tue, 27 Feb 2018 22:02:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802272202.w1RM2ekm043363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 27 Feb 2018 22:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330087 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 22:02:41 -0000 Author: kevans Date: Tue Feb 27 22:02:39 2018 New Revision: 330087 URL: https://svnweb.freebsd.org/changeset/base/330087 Log: lualoader: Convert instances of KEYSTR_ESCAPE .. "[" -> KEYSTR_CSI Modified: head/stand/lua/color.lua head/stand/lua/core.lua head/stand/lua/screen.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Tue Feb 27 22:01:40 2018 (r330086) +++ head/stand/lua/color.lua Tue Feb 27 22:02:39 2018 (r330087) @@ -62,14 +62,14 @@ function color.escapef(color_value) if color.disabled then return color_value end - return core.KEYSTR_ESCAPE .. "[3" .. color_value .. "m" + return core.KEYSTR_CSI .. "3" .. color_value .. "m" end function color.escapeb(color_value) if color.disabled then return color_value end - return core.KEYSTR_ESCAPE .. "[4" .. color_value .. "m" + return core.KEYSTR_CSI .. "4" .. color_value .. "m" end function color.escape(fg_color, bg_color, attribute) @@ -81,7 +81,7 @@ function color.escape(fg_color, bg_color, attribute) else attribute = attribute .. ";" end - return core.KEYSTR_ESCAPE .. "[" .. attribute .. + return core.KEYSTR_CSI .. attribute .. "3" .. fg_color .. ";4" .. bg_color .. "m" end @@ -89,14 +89,14 @@ function color.default() if color.disabled then return "" end - return core.KEYSTR_ESCAPE .. "[0;37;40m" + return core.KEYSTR_CSI .. "0;37;40m" end function color.highlight(str) if color.disabled then return str end - return core.KEYSTR_ESCAPE .. "[1m" .. str .. core.KEYSTR_ESCAPE .. "[0m" + return core.KEYSTR_CSI .. "1m" .. str .. core.KEYSTR_CSI .. "0m" end return color Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Tue Feb 27 22:01:40 2018 (r330086) +++ head/stand/lua/core.lua Tue Feb 27 22:02:39 2018 (r330087) @@ -47,6 +47,7 @@ core.KEY_ENTER = 13 core.KEY_DELETE = 127 core.KEYSTR_ESCAPE = "\027" +core.KEYSTR_CSI = core.KEYSTR_ESCAPE .. "[" core.MENU_RETURN = "return" core.MENU_ENTRY = "entry" Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Tue Feb 27 22:01:40 2018 (r330086) +++ head/stand/lua/screen.lua Tue Feb 27 22:02:39 2018 (r330087) @@ -38,7 +38,7 @@ function screen.clear() if core.isSerialBoot() then return end - loader.printc(core.KEYSTR_ESCAPE .. "[H" .. core.KEYSTR_ESCAPE .. "[J") + loader.printc(core.KEYSTR_CSI .. "H" .. core.KEYSTR_CSI .. "J") end function screen.setcursor(x, y) @@ -46,7 +46,7 @@ function screen.setcursor(x, y) return end - loader.printc(core.KEYSTR_ESCAPE .. "[" .. y .. ";" .. x .. "H") + loader.printc(core.KEYSTR_CSI .. y .. ";" .. x .. "H") end function screen.movecursor(dx, dy) @@ -55,15 +55,15 @@ function screen.movecursor(dx, dy) end if dx < 0 then - loader.printc(core.KEYSTR_ESCAPE .. "[" .. -dx .. "D") + loader.printc(core.KEYSTR_CSI .. -dx .. "D") elseif dx > 0 then - loader.printc(core.KEYSTR_ESCAPE .. "[" .. dx .. "C") + loader.printc(core.KEYSTR_CSI .. dx .. "C") end if dy < 0 then - loader.printc(core.KEYSTR_ESCAPE .. "[" .. -dy .. "A") + loader.printc(core.KEYSTR_CSI .. -dy .. "A") elseif dy > 0 then - loader.printc(core.KEYSTR_ESCAPE .. "[" .. dy .. "B") + loader.printc(core.KEYSTR_CSI .. dy .. "B") end end @@ -89,7 +89,7 @@ function screen.defcursor() if core.isSerialBoot() then return end - loader.printc(core.KEYSTR_ESCAPE .. "[25;0H") + loader.printc(core.KEYSTR_CSI .. "25;0H") end return screen From owner-svn-src-head@freebsd.org Tue Feb 27 22:07:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20222F2DD8B; Tue, 27 Feb 2018 22:07:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8E4173458; Tue, 27 Feb 2018 22:07:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3BD710A26; Tue, 27 Feb 2018 22:07:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RM7fsG044356; Tue, 27 Feb 2018 22:07:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RM7f2P044355; Tue, 27 Feb 2018 22:07:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802272207.w1RM7f2P044355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 27 Feb 2018 22:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330088 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 22:07:42 -0000 Author: kevans Date: Tue Feb 27 22:07:41 2018 New Revision: 330088 URL: https://svnweb.freebsd.org/changeset/base/330088 Log: lualoader: Correct test sense, comments, and add some more comments Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Tue Feb 27 22:02:39 2018 (r330087) +++ head/stand/lua/config.lua Tue Feb 27 22:07:41 2018 (r330088) @@ -333,6 +333,9 @@ function config.loadmod(mod, silent) return status end +-- Returns true if we processed the file successfully, false if we did not. +-- If 'silent' is true, being unable to read the file is not considered a +-- failure. function config.processFile(name, silent) if silent == nil then silent = false @@ -340,15 +343,13 @@ function config.processFile(name, silent) local text = readFile(name, silent) if text == nil then - return not silent + return silent end return config.parse(text) end -- silent runs will not return false if we fail to open the file --- check_and_halt, if it's set, will be executed on the full text of the config --- file. If it returns false, we are to halt immediately. function config.parse(text) local n = 1 local status = true From owner-svn-src-head@freebsd.org Tue Feb 27 22:12:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34BF9F2E59D; Tue, 27 Feb 2018 22:12:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC04673A36; Tue, 27 Feb 2018 22:12:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6C1710BC0; Tue, 27 Feb 2018 22:12:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RMCcnx049873; Tue, 27 Feb 2018 22:12:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RMCcfV049872; Tue, 27 Feb 2018 22:12:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201802272212.w1RMCcfV049872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 27 Feb 2018 22:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330089 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 330089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 22:12:39 -0000 Author: tuexen Date: Tue Feb 27 22:12:38 2018 New Revision: 330089 URL: https://svnweb.freebsd.org/changeset/base/330089 Log: When checking the TCP fast cookie length, conststently also check for the minimum length. This fixes a bug where cookies of length 2 bytes (which is smaller than the minimum length of 4) is provided by the server. Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_fastopen.c Modified: head/sys/netinet/tcp_fastopen.c ============================================================================== --- head/sys/netinet/tcp_fastopen.c Tue Feb 27 22:07:41 2018 (r330088) +++ head/sys/netinet/tcp_fastopen.c Tue Feb 27 22:12:38 2018 (r330089) @@ -1071,7 +1071,8 @@ tcp_fastopen_ccache_create(struct tcp_fastopen_ccache_ cce->cce_server_ip.v6 = inc->inc6_faddr; } cce->server_port = inc->inc_fport; - if ((cookie_len <= TCP_FASTOPEN_MAX_COOKIE_LEN) && + if ((cookie_len >= TCP_FASTOPEN_MIN_COOKIE_LEN) && + (cookie_len <= TCP_FASTOPEN_MAX_COOKIE_LEN) && ((cookie_len & 0x1) == 0)) { cce->server_mss = mss; cce->cookie_len = cookie_len; From owner-svn-src-head@freebsd.org Tue Feb 27 22:22:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36DA4F2F0E2; Tue, 27 Feb 2018 22:22:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04ED674122; Tue, 27 Feb 2018 22:22:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1E9610D68; Tue, 27 Feb 2018 22:22:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RMMNxC056270; Tue, 27 Feb 2018 22:22:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RMMNil056269; Tue, 27 Feb 2018 22:22:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802272222.w1RMMNil056269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 27 Feb 2018 22:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330090 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 330090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 27 Feb 2018 22:22:24 -0000 Author: kevans Date: Tue Feb 27 22:22:23 2018 New Revision: 330090 URL: https://svnweb.freebsd.org/changeset/base/330090 Log: Add 'usr.bin/seq' to tests mtree after r330086 Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Feb 27 22:12:38 2018 (r330089) +++ head/etc/mtree/BSD.tests.dist Tue Feb 27 22:22:23 2018 (r330090) @@ -968,6 +968,8 @@ regress.multitest.out .. .. + seq + .. soelim .. stat From owner-svn-src-head@freebsd.org Wed Feb 28 00:17:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE37AF3796D; Wed, 28 Feb 2018 00:17:09 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9AC478CC4; Wed, 28 Feb 2018 00:17:08 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4B4011FCE; Wed, 28 Feb 2018 00:17:08 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S0H8Ho017157; Wed, 28 Feb 2018 00:17:08 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S0H8Qx017156; Wed, 28 Feb 2018 00:17:08 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201802280017.w1S0H8Qx017156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Wed, 28 Feb 2018 00:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330091 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 330091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 00:17:09 -0000 Author: karels Date: Wed Feb 28 00:17:08 2018 New Revision: 330091 URL: https://svnweb.freebsd.org/changeset/base/330091 Log: Revert r314685 in ps Revert r314685, and add a comment describing the original behavior and the intent. Reviewed by: dab@ vangyzen@ jhb@ Differential Revision: https://reviews.freebsd.org/D14530 Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Tue Feb 27 22:22:23 2018 (r330090) +++ head/bin/ps/ps.c Wed Feb 28 00:17:08 2018 (r330091) @@ -194,10 +194,17 @@ main(int argc, char *argv[]) (void) setlocale(LC_ALL, ""); time(&now); /* Used by routines in print.c. */ + /* + * Compute default output line length before processing options. + * If COLUMNS is set, use it. Otherwise, if this is part of an + * interactive job (i.e. one associated with a terminal), use + * the terminal width. "Interactive" is determined by whether + * any of stdout, stderr, or stdin is a terminal. The intent + * is that "ps", "ps | more", and "ps | grep" all use the same + * default line length unless -w is specified. + */ if ((cols = getenv("COLUMNS")) != NULL && *cols != '\0') termwidth = atoi(cols); - else if (!isatty(STDOUT_FILENO)) - termwidth = UNLIMITED; else if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&ws) == -1) || From owner-svn-src-head@freebsd.org Wed Feb 28 00:32:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED670F38E63; Wed, 28 Feb 2018 00:32:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B71679D00; Wed, 28 Feb 2018 00:32:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f169.google.com with SMTP id e7so1311958ioj.1; Tue, 27 Feb 2018 16:32:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=iWn3NJ02lS5krRkAbxEGn1QpzdKXe2PIcAXiiVH8AgY=; b=JwQQtPiMs47Xcm/lu5iK/GpWBC3LKFS/ozPlOruCaYo8aF6X8qPMqf5yvup6HiiOIO Oyx6BSQO2HtwTfgaGhi82InAGbIk7tVhLCTgHQqd8vAKZnnQwQFlaR4obrR2SfwGsh/1 8Ab+BN37Lvf8VeUvDtOAeG8lZrsd2ttcdFbD7hvNxlx+AAdjJAMK1SRLfuotQNLri7qS DO0ofhF/1KhOVAHsRyknCJ9Pn41HiviMPsjGAYZk1q+JNxhbkYz2xVlZr7arQ8TJr3z6 uKOB+BbJtrl3up/bTnn9vreRICfedh1JV0l8jQGpqVZCpsOWEN1JcCiSsI+Z3vk/6WLe 48Ig== X-Gm-Message-State: APf1xPAo97cU89uUxTWHaCybOwO4VlrQaWJkTd2RkBZsggx8IBSEit5I 7GYsuJ261A4ZGS8nawQfA6qhkOHm X-Google-Smtp-Source: AG47ELsIvq3x9aZwMM6OgG8YZ85kNQiwgTcT63CpwYcPCBcp10jQQ7FnEw1NSYapNtwc9JR3VzHaNg== X-Received: by 10.107.180.196 with SMTP id d187mr18449891iof.187.1519777968764; Tue, 27 Feb 2018 16:32:48 -0800 (PST) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com. [209.85.214.54]) by smtp.gmail.com with ESMTPSA id c74sm280842ioe.10.2018.02.27.16.32.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 16:32:48 -0800 (PST) Received: by mail-it0-f54.google.com with SMTP id u5so1424262itc.1; Tue, 27 Feb 2018 16:32:48 -0800 (PST) X-Received: by 10.36.3.67 with SMTP id e64mr19279760ite.46.1519777968297; Tue, 27 Feb 2018 16:32:48 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Tue, 27 Feb 2018 16:32:47 -0800 (PST) In-Reply-To: <201802280017.w1S0H8Qx017156@repo.freebsd.org> References: <201802280017.w1S0H8Qx017156@repo.freebsd.org> From: Conrad Meyer Date: Tue, 27 Feb 2018 16:32:47 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330091 - head/bin/ps To: Mike Karels 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.25 Precedence: list List-Id: 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, 28 Feb 2018 00:32:56 -0000 This is probably the wrong change to make. It makes us incompatible with Linux and Mac OS. Anyway, I'll reopen the associated PR and you can handle it how you like. Conrad On Tue, Feb 27, 2018 at 4:17 PM, Mike Karels wrote: > Author: karels > Date: Wed Feb 28 00:17:08 2018 > New Revision: 330091 > URL: https://svnweb.freebsd.org/changeset/base/330091 > > Log: > Revert r314685 in ps > > Revert r314685, and add a comment describing the original > behavior and the intent. > > Reviewed by: dab@ vangyzen@ jhb@ > Differential Revision: https://reviews.freebsd.org/D14530 > > Modified: > head/bin/ps/ps.c > > Modified: head/bin/ps/ps.c > ============================================================================== > --- head/bin/ps/ps.c Tue Feb 27 22:22:23 2018 (r330090) > +++ head/bin/ps/ps.c Wed Feb 28 00:17:08 2018 (r330091) > @@ -194,10 +194,17 @@ main(int argc, char *argv[]) > (void) setlocale(LC_ALL, ""); > time(&now); /* Used by routines in print.c. */ > > + /* > + * Compute default output line length before processing options. > + * If COLUMNS is set, use it. Otherwise, if this is part of an > + * interactive job (i.e. one associated with a terminal), use > + * the terminal width. "Interactive" is determined by whether > + * any of stdout, stderr, or stdin is a terminal. The intent > + * is that "ps", "ps | more", and "ps | grep" all use the same > + * default line length unless -w is specified. > + */ > if ((cols = getenv("COLUMNS")) != NULL && *cols != '\0') > termwidth = atoi(cols); > - else if (!isatty(STDOUT_FILENO)) > - termwidth = UNLIMITED; > else if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && > ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && > ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&ws) == -1) || > From owner-svn-src-head@freebsd.org Wed Feb 28 04:23:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C3DBF26477; Wed, 28 Feb 2018 04:23:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B29EB82D98; Wed, 28 Feb 2018 04:23:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 937D51497E; Wed, 28 Feb 2018 04:23:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S4NSGv042634; Wed, 28 Feb 2018 04:23:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S4NSME042632; Wed, 28 Feb 2018 04:23:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802280423.w1S4NSME042632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 04:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330098 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 04:23:29 -0000 Author: kevans Date: Wed Feb 28 04:23:28 2018 New Revision: 330098 URL: https://svnweb.freebsd.org/changeset/base/330098 Log: lualoader: Re-do twiddle It worked on my test setup, but is clearly non-functional on others. Further examination of check-password.4th showed that it actually reset the cursor to 0,25 every time and overwrote the previous password prompt. Do that, and also clear the "Incorrect Password" text if the correct password gets entered. Modified: head/stand/lua/password.lua head/stand/lua/screen.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Wed Feb 28 02:49:48 2018 (r330097) +++ head/stand/lua/password.lua Wed Feb 28 04:23:28 2018 (r330098) @@ -33,19 +33,21 @@ local core = require("core") local screen = require("screen") local password = {} + +local INCORRECT_PASSWORD = "loader: incorrect password!" -- Asterisks as a password mask local show_password_mask = false local twiddle_chars = {"/", "-", "\\", "|"} -- Module exports -function password.read() +function password.read(prompt_length) local str = "" local n = 0 local twiddle_pos = 1 local function draw_twiddle() loader.printc(" " .. twiddle_chars[twiddle_pos]) - screen.movecursor(-3, 0) + screen.setcursor(prompt_length + 2, 25) twiddle_pos = (twiddle_pos % #twiddle_chars) + 1 end @@ -84,15 +86,27 @@ function password.check() screen.defcursor() -- pwd is optionally supplied if we want to check it local function doPrompt(prompt, pwd) + local attempts = 1 + + local function clear_incorrect_text_prompt() + loader.printc("\n") + loader.printc(string.rep(" ", #INCORRECT_PASSWORD)) + end + while true do + screen.defcursor() loader.printc(prompt) - local read_pwd = password.read() + local read_pwd = password.read(#prompt) if pwd == nil or pwd == read_pwd then - -- Throw an extra newline after password prompt - print("") + -- Clear the prompt + twiddle + loader.printc(string.rep(" ", #prompt + 5)) + if attempts > 1 then + clear_incorrect_text_prompt() + end return read_pwd end - print("\n\nloader: incorrect password!\n") + loader.printc("\n" .. INCORRECT_PASSWORD) + attempts = attempts + 1 loader.delay(3*1000*1000) end end Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Wed Feb 28 02:49:48 2018 (r330097) +++ head/stand/lua/screen.lua Wed Feb 28 04:23:28 2018 (r330098) @@ -49,24 +49,6 @@ function screen.setcursor(x, y) loader.printc(core.KEYSTR_CSI .. y .. ";" .. x .. "H") end -function screen.movecursor(dx, dy) - if core.isSerialBoot() then - return - end - - if dx < 0 then - loader.printc(core.KEYSTR_CSI .. -dx .. "D") - elseif dx > 0 then - loader.printc(core.KEYSTR_CSI .. dx .. "C") - end - - if dy < 0 then - loader.printc(core.KEYSTR_CSI .. -dy .. "A") - elseif dy > 0 then - loader.printc(core.KEYSTR_CSI .. dy .. "B") - end -end - function screen.setforeground(color_value) if color.disabled then return color_value From owner-svn-src-head@freebsd.org Wed Feb 28 04:31:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCFDF26C2C; Wed, 28 Feb 2018 04:31:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40BA08347C; Wed, 28 Feb 2018 04:31:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B8C714AD5; Wed, 28 Feb 2018 04:31:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S4VKIn044982; Wed, 28 Feb 2018 04:31:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S4VKTu044980; Wed, 28 Feb 2018 04:31:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802280431.w1S4VKTu044980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 04:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330099 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 04:31:20 -0000 Author: kevans Date: Wed Feb 28 04:31:19 2018 New Revision: 330099 URL: https://svnweb.freebsd.org/changeset/base/330099 Log: lualoader: Further screen cleanup - Add screen.default_x and screen.default_y to determine where screen.defcursor resets the cursor to. - Use screen.setcursor in screen.defcursor instead of rewriting the escape sequence. - Use screen.default_y when resetting the cursor after writing the new twiddle character, add a comment verbally describing the position just in case. Modified: head/stand/lua/password.lua head/stand/lua/screen.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Wed Feb 28 04:23:28 2018 (r330098) +++ head/stand/lua/password.lua Wed Feb 28 04:31:19 2018 (r330099) @@ -47,7 +47,8 @@ function password.read(prompt_length) local function draw_twiddle() loader.printc(" " .. twiddle_chars[twiddle_pos]) - screen.setcursor(prompt_length + 2, 25) + -- Reset cursor to just after the password prompt + screen.setcursor(prompt_length + 2, screen.default_y) twiddle_pos = (twiddle_pos % #twiddle_chars) + 1 end Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Wed Feb 28 04:23:28 2018 (r330098) +++ head/stand/lua/screen.lua Wed Feb 28 04:31:19 2018 (r330099) @@ -34,6 +34,9 @@ local core = require("core") local screen = {} -- Module exports +screen.default_x = 0 +screen.default_y = 25 + function screen.clear() if core.isSerialBoot() then return @@ -71,7 +74,7 @@ function screen.defcursor() if core.isSerialBoot() then return end - loader.printc(core.KEYSTR_CSI .. "25;0H") + screen.setcursor(screen.default_x, screen.default_y) end return screen From owner-svn-src-head@freebsd.org Wed Feb 28 05:02:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11BB7F28FE5; Wed, 28 Feb 2018 05:02:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6EFD846E7; Wed, 28 Feb 2018 05:02:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1FBE15011; Wed, 28 Feb 2018 05:02:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S525Nv063037; Wed, 28 Feb 2018 05:02:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S525tl063036; Wed, 28 Feb 2018 05:02:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802280502.w1S525tl063036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 05:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330100 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 05:02:06 -0000 Author: kevans Date: Wed Feb 28 05:02:05 2018 New Revision: 330100 URL: https://svnweb.freebsd.org/changeset/base/330100 Log: lualoader: Remove debug function Our module bits ended up more stable than I anticipated, so this turns out to be no longer useful. If things like this need to come back, we should do it in a separate 'debug' module to serve as a collection of debugging aides. As a rule, this 'debug' module would *not* be allowed as a requirement of any other modules in-tree. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Wed Feb 28 04:31:19 2018 (r330099) +++ head/stand/lua/config.lua Wed Feb 28 05:02:05 2018 (r330100) @@ -249,15 +249,6 @@ function config.setKey(key, name, value) modules[key][name] = value end -function config.lsModules() - print("== Listing modules") - for k, v in pairs(modules) do - print(k, v.load) - end - print("== List of modules ended") -end - - function config.isValidComment(line) if line ~= nil then local s = line:match("^%s*#.*") From owner-svn-src-head@freebsd.org Wed Feb 28 05:11:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB60DF29762; Wed, 28 Feb 2018 05:11:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81BC284BE1; Wed, 28 Feb 2018 05:11:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CC2F15061; Wed, 28 Feb 2018 05:11:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S5BA0Q066294; Wed, 28 Feb 2018 05:11:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S5BAZE066293; Wed, 28 Feb 2018 05:11:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802280511.w1S5BAZE066293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 05:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330101 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 05:11:11 -0000 Author: kevans Date: Wed Feb 28 05:11:10 2018 New Revision: 330101 URL: https://svnweb.freebsd.org/changeset/base/330101 Log: lualoader: Add note that \027 is a decimal representation We've included an extra '0' in there (which might get removed later, but it's maintained for the moment for legacy purposes) which oftentimes indicate that the following number should be treated as octal. This is not the case, so note that to prevent future confusion (of myself and others). Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Wed Feb 28 05:02:05 2018 (r330100) +++ head/stand/lua/core.lua Wed Feb 28 05:11:10 2018 (r330101) @@ -46,6 +46,8 @@ core.KEY_BACKSPACE = 8 core.KEY_ENTER = 13 core.KEY_DELETE = 127 +-- Note that this is a decimal representation, despite the leading 0 that in +-- other contexts (outside of Lua) may mean 'octal' core.KEYSTR_ESCAPE = "\027" core.KEYSTR_CSI = core.KEYSTR_ESCAPE .. "[" From owner-svn-src-head@freebsd.org Wed Feb 28 07:59:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1218F31A05; Wed, 28 Feb 2018 07:59:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A76D6A584; Wed, 28 Feb 2018 07:59:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60AE516BAC; Wed, 28 Feb 2018 07:59:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S7xwTb048147; Wed, 28 Feb 2018 07:59:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S7xuiR048135; Wed, 28 Feb 2018 07:59:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201802280759.w1S7xuiR048135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 28 Feb 2018 07:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330104 - in head: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/html/drivers contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contr... X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/html/drivers contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys contrib... X-SVN-Commit-Revision: 330104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 07:59:59 -0000 Author: delphij Date: Wed Feb 28 07:59:55 2018 New Revision: 330104 URL: https://svnweb.freebsd.org/changeset/base/330104 Log: MFV r330102: ntp 4.2.8p11 Added: head/contrib/ntp/sntp/m4/ntp_af_unspec.m4 - copied unchanged from r330102, vendor/ntp/dist/sntp/m4/ntp_af_unspec.m4 head/contrib/ntp/sntp/tests/testconf.yml - copied unchanged from r330102, vendor/ntp/dist/sntp/tests/testconf.yml Modified: head/contrib/ntp/ChangeLog head/contrib/ntp/Makefile.am head/contrib/ntp/Makefile.in head/contrib/ntp/NEWS head/contrib/ntp/aclocal.m4 head/contrib/ntp/adjtimed/Makefile.in head/contrib/ntp/clockstuff/Makefile.in head/contrib/ntp/configure head/contrib/ntp/configure.ac head/contrib/ntp/html/access.html head/contrib/ntp/html/accopt.html head/contrib/ntp/html/authentic.html head/contrib/ntp/html/drivers/driver18.html head/contrib/ntp/html/drivers/driver40-ja.html head/contrib/ntp/html/drivers/driver40.html head/contrib/ntp/html/keygen.html head/contrib/ntp/html/miscopt.html head/contrib/ntp/html/monopt.html head/contrib/ntp/html/ntpq.html head/contrib/ntp/include/Makefile.in head/contrib/ntp/include/isc/Makefile.in head/contrib/ntp/include/ntp.h head/contrib/ntp/include/ntp_calendar.h head/contrib/ntp/include/ntp_config.h head/contrib/ntp/include/ntp_fp.h head/contrib/ntp/include/ntp_keyacc.h head/contrib/ntp/include/ntp_request.h head/contrib/ntp/include/ntp_stdlib.h head/contrib/ntp/include/ntpd.h head/contrib/ntp/include/recvbuff.h head/contrib/ntp/include/ssl_applink.c head/contrib/ntp/kernel/Makefile.in head/contrib/ntp/kernel/sys/Makefile.in head/contrib/ntp/libntp/Makefile.in head/contrib/ntp/libntp/a_md5encrypt.c head/contrib/ntp/libntp/adjtime.c head/contrib/ntp/libntp/authkeys.c head/contrib/ntp/libntp/authreadkeys.c head/contrib/ntp/libntp/libssl_compat.c head/contrib/ntp/libntp/ntp_calendar.c head/contrib/ntp/libntp/ssl_init.c head/contrib/ntp/libntp/statestr.c head/contrib/ntp/libntp/systime.c head/contrib/ntp/libntp/work_thread.c head/contrib/ntp/libparse/Makefile.in head/contrib/ntp/ntpd/Makefile.in head/contrib/ntp/ntpd/complete.conf.in head/contrib/ntp/ntpd/invoke-ntp.conf.texi head/contrib/ntp/ntpd/invoke-ntp.keys.texi head/contrib/ntp/ntpd/invoke-ntpd.texi head/contrib/ntp/ntpd/keyword-gen-utd head/contrib/ntp/ntpd/keyword-gen.c head/contrib/ntp/ntpd/ntp.conf.5man head/contrib/ntp/ntpd/ntp.conf.5mdoc head/contrib/ntp/ntpd/ntp.conf.def head/contrib/ntp/ntpd/ntp.conf.html head/contrib/ntp/ntpd/ntp.conf.man.in head/contrib/ntp/ntpd/ntp.conf.mdoc.in head/contrib/ntp/ntpd/ntp.keys.5man head/contrib/ntp/ntpd/ntp.keys.5mdoc head/contrib/ntp/ntpd/ntp.keys.def head/contrib/ntp/ntpd/ntp.keys.html head/contrib/ntp/ntpd/ntp.keys.man.in head/contrib/ntp/ntpd/ntp.keys.mdoc.in head/contrib/ntp/ntpd/ntp_config.c head/contrib/ntp/ntpd/ntp_control.c head/contrib/ntp/ntpd/ntp_crypto.c head/contrib/ntp/ntpd/ntp_io.c head/contrib/ntp/ntpd/ntp_keyword.h head/contrib/ntp/ntpd/ntp_leapsec.c head/contrib/ntp/ntpd/ntp_parser.c head/contrib/ntp/ntpd/ntp_parser.h head/contrib/ntp/ntpd/ntp_peer.c head/contrib/ntp/ntpd/ntp_proto.c head/contrib/ntp/ntpd/ntp_refclock.c head/contrib/ntp/ntpd/ntp_request.c head/contrib/ntp/ntpd/ntp_restrict.c head/contrib/ntp/ntpd/ntp_scanner.c head/contrib/ntp/ntpd/ntp_util.c head/contrib/ntp/ntpd/ntpd-opts.c head/contrib/ntp/ntpd/ntpd-opts.h head/contrib/ntp/ntpd/ntpd.1ntpdman head/contrib/ntp/ntpd/ntpd.1ntpdmdoc head/contrib/ntp/ntpd/ntpd.c head/contrib/ntp/ntpd/ntpd.html head/contrib/ntp/ntpd/ntpd.man.in head/contrib/ntp/ntpd/ntpd.mdoc.in head/contrib/ntp/ntpd/ntpsim.c head/contrib/ntp/ntpd/refclock_gpsdjson.c head/contrib/ntp/ntpd/refclock_jjy.c head/contrib/ntp/ntpd/refclock_palisade.c head/contrib/ntp/ntpd/refclock_parse.c head/contrib/ntp/ntpdate/Makefile.in head/contrib/ntp/ntpdc/Makefile.in head/contrib/ntp/ntpdc/invoke-ntpdc.texi head/contrib/ntp/ntpdc/layout.std head/contrib/ntp/ntpdc/ntpdc-opts.c head/contrib/ntp/ntpdc/ntpdc-opts.h head/contrib/ntp/ntpdc/ntpdc.1ntpdcman head/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc head/contrib/ntp/ntpdc/ntpdc.c head/contrib/ntp/ntpdc/ntpdc.html head/contrib/ntp/ntpdc/ntpdc.man.in head/contrib/ntp/ntpdc/ntpdc.mdoc.in head/contrib/ntp/ntpdc/ntpdc_ops.c head/contrib/ntp/ntpq/Makefile.am head/contrib/ntp/ntpq/Makefile.in head/contrib/ntp/ntpq/invoke-ntpq.texi head/contrib/ntp/ntpq/ntpq-opts.c head/contrib/ntp/ntpq/ntpq-opts.def head/contrib/ntp/ntpq/ntpq-opts.h head/contrib/ntp/ntpq/ntpq-subs.c head/contrib/ntp/ntpq/ntpq.1ntpqman head/contrib/ntp/ntpq/ntpq.1ntpqmdoc head/contrib/ntp/ntpq/ntpq.c head/contrib/ntp/ntpq/ntpq.html head/contrib/ntp/ntpq/ntpq.man.in head/contrib/ntp/ntpq/ntpq.mdoc.in head/contrib/ntp/ntpq/ntpq.texi head/contrib/ntp/ntpsnmpd/Makefile.in head/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi head/contrib/ntp/ntpsnmpd/netsnmp_daemonize.c head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc head/contrib/ntp/ntpsnmpd/ntpsnmpd.html head/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in head/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in head/contrib/ntp/packageinfo.sh head/contrib/ntp/parseutil/Makefile.in head/contrib/ntp/scripts/Makefile.in head/contrib/ntp/scripts/build/Makefile.in head/contrib/ntp/scripts/build/UpdatePoint head/contrib/ntp/scripts/calc_tickadj/Makefile.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in head/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi head/contrib/ntp/scripts/invoke-plot_summary.texi head/contrib/ntp/scripts/invoke-summary.texi head/contrib/ntp/scripts/lib/Makefile.in head/contrib/ntp/scripts/ntp-wait/Makefile.in head/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi head/contrib/ntp/scripts/ntp-wait/ntp-wait-opts head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc head/contrib/ntp/scripts/ntp-wait/ntp-wait.html head/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in head/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in head/contrib/ntp/scripts/ntpsweep/Makefile.in head/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi head/contrib/ntp/scripts/ntpsweep/ntpsweep-opts head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc head/contrib/ntp/scripts/ntpsweep/ntpsweep.html head/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in head/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in head/contrib/ntp/scripts/ntptrace/Makefile.in head/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi head/contrib/ntp/scripts/ntptrace/ntptrace-opts head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc head/contrib/ntp/scripts/ntptrace/ntptrace.html head/contrib/ntp/scripts/ntptrace/ntptrace.man.in head/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in head/contrib/ntp/scripts/plot_summary-opts head/contrib/ntp/scripts/plot_summary.1plot_summaryman head/contrib/ntp/scripts/plot_summary.1plot_summarymdoc head/contrib/ntp/scripts/plot_summary.html head/contrib/ntp/scripts/plot_summary.man.in head/contrib/ntp/scripts/plot_summary.mdoc.in head/contrib/ntp/scripts/summary-opts head/contrib/ntp/scripts/summary.1summaryman head/contrib/ntp/scripts/summary.1summarymdoc head/contrib/ntp/scripts/summary.html head/contrib/ntp/scripts/summary.man.in head/contrib/ntp/scripts/summary.mdoc.in head/contrib/ntp/scripts/update-leap/Makefile.in head/contrib/ntp/scripts/update-leap/invoke-update-leap.texi head/contrib/ntp/scripts/update-leap/update-leap-opts head/contrib/ntp/scripts/update-leap/update-leap.1update-leapman head/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc head/contrib/ntp/scripts/update-leap/update-leap.html head/contrib/ntp/scripts/update-leap/update-leap.in head/contrib/ntp/scripts/update-leap/update-leap.man.in head/contrib/ntp/scripts/update-leap/update-leap.mdoc.in head/contrib/ntp/sntp/Makefile.in head/contrib/ntp/sntp/check-libntp.mf head/contrib/ntp/sntp/configure head/contrib/ntp/sntp/crypto.c head/contrib/ntp/sntp/crypto.h head/contrib/ntp/sntp/harden/linux head/contrib/ntp/sntp/include/version.def head/contrib/ntp/sntp/include/version.texi head/contrib/ntp/sntp/invoke-sntp.texi head/contrib/ntp/sntp/m4/ntp_harden.m4 head/contrib/ntp/sntp/m4/ntp_libevent.m4 head/contrib/ntp/sntp/m4/ntp_openssl.m4 head/contrib/ntp/sntp/m4/version.m4 head/contrib/ntp/sntp/main.c head/contrib/ntp/sntp/networking.c head/contrib/ntp/sntp/sntp-opts.c head/contrib/ntp/sntp/sntp-opts.def head/contrib/ntp/sntp/sntp-opts.h head/contrib/ntp/sntp/sntp.1sntpman head/contrib/ntp/sntp/sntp.1sntpmdoc head/contrib/ntp/sntp/sntp.html head/contrib/ntp/sntp/sntp.man.in head/contrib/ntp/sntp/sntp.mdoc.in head/contrib/ntp/sntp/tests/Makefile.am head/contrib/ntp/sntp/tests/Makefile.in head/contrib/ntp/sntp/tests/crypto.c head/contrib/ntp/sntp/tests/keyFile.c head/contrib/ntp/sntp/tests/packetHandling.c head/contrib/ntp/sntp/tests/packetProcessing.c head/contrib/ntp/sntp/tests/run-crypto.c head/contrib/ntp/sntp/tests/run-keyFile.c head/contrib/ntp/sntp/tests/run-kodDatabase.c head/contrib/ntp/sntp/tests/run-kodFile.c head/contrib/ntp/sntp/tests/run-networking.c head/contrib/ntp/sntp/tests/run-packetHandling.c head/contrib/ntp/sntp/tests/run-packetProcessing.c head/contrib/ntp/sntp/tests/run-t-log.c head/contrib/ntp/sntp/tests/run-utilities.c head/contrib/ntp/sntp/unity/auto/generate_test_runner.rb head/contrib/ntp/sntp/utilities.c head/contrib/ntp/sntp/version.c head/contrib/ntp/util/Makefile.in head/contrib/ntp/util/invoke-ntp-keygen.texi head/contrib/ntp/util/ntp-keygen-opts.c head/contrib/ntp/util/ntp-keygen-opts.def head/contrib/ntp/util/ntp-keygen-opts.h head/contrib/ntp/util/ntp-keygen.1ntp-keygenman head/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc head/contrib/ntp/util/ntp-keygen.html head/contrib/ntp/util/ntp-keygen.man.in head/contrib/ntp/util/ntp-keygen.mdoc.in head/usr.sbin/ntp/config.h head/usr.sbin/ntp/doc/ntp-keygen.8 head/usr.sbin/ntp/doc/ntp.conf.5 head/usr.sbin/ntp/doc/ntp.keys.5 head/usr.sbin/ntp/doc/ntpd.8 head/usr.sbin/ntp/doc/ntpdc.8 head/usr.sbin/ntp/doc/ntpq.8 head/usr.sbin/ntp/doc/sntp.8 head/usr.sbin/ntp/ntp-keygen/Makefile head/usr.sbin/ntp/ntptime/Makefile head/usr.sbin/ntp/scripts/mkver Directory Properties: head/contrib/ntp/ (props changed) Modified: head/contrib/ntp/ChangeLog ============================================================================== --- head/contrib/ntp/ChangeLog Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/ChangeLog Wed Feb 28 07:59:55 2018 (r330104) @@ -1,6 +1,107 @@ --- -(4.2.8p10-win-beta1) 2017/03/21 Released by Harlan Stenn -(4.2.8p10) + +* [Sec 3454] Unauthenticated packet can reset authenticated interleave + associations. HStenn. +* [Sec 3453] Interleaved symmetric mode cannot recover from bad state. HStenn. +* [Sec 3415] Permit blocking authenticated symmetric/passive associations. + Implement ippeerlimit. HStenn, JPerlinger. +* [Sec 3414] ntpq: decodearr() can write beyond its 'buf' limits + - initial patch by , extended by +* [Sec 3412] ctl_getitem(): Don't compare names past NUL. +* [Sec 3012] Sybil vulnerability: noepeer support. HStenn, JPerlinger. +* [Bug 3457] OpenSSL FIPS mode regression +* [Bug 3455] ntpd doesn't use scope id when binding multicast + - applied patch by Sean Haugh +* [Bug 3452] PARSE driver prints uninitialized memory. +* [Bug 3450] Dubious error messages from plausibility checks in get_systime() + - removed error log caused by rounding/slew, ensured postcondition +* [Bug 3447] AES-128-CMAC (fixes) + - refactoring the MAC code, too +* [Bug 3441] Validate the assumption that AF_UNSPEC is 0. stenn@ntp.org +* [Bug 3439] When running multiple commands / hosts in ntpq... + - applied patch by ggarvey +* [Bug 3438] Negative values and values > 999 days in... + - applied patch by ggarvey (with minor mods) +* [Bug 3437] ntpd tries to open socket with AF_UNSPEC domain + - applied patch (with mods) by Miroslav Lichvar +* [Bug 3435] anchor NTP era alignment +* [Bug 3433] sntp crashes when run with -a. +* [Bug 3430] ntpq dumps core (SIGSEGV) for "keytype md2" + - fixed several issues with hash algos in ntpd, sntp, ntpq, + ntpdc and the test suites +* [Bug 3424] Trimble Thunderbolt 1024 week millenium bug + - initial patch by Daniel Pouzzner +* [Bug 3423] QNX adjtime() implementation error checking is + wrong +* [Bug 3417] ntpq ifstats packet counters can be negative + made IFSTATS counter quantities unsigned +* [Bug 3411] problem about SIGN(6) packet handling for ntp-4.2.8p10 + - raised receive buffer size to 1200 +* [Bug 3408] refclock_jjy.c: Avoid a wrong report of the coverity static + analysis tool. +* [Bug 3405] update-leap.in: general cleanup, HTTPS support. Paul McMath. +* [Bug 3404] Fix openSSL DLL usage under Windows + - fix/drop assumptions on OpenSSL libs directory layout +* [Bug 3399] NTP: linker error in 4.2.8p10 during Linux cross-compilation + - initial patch by timeflies@mail2tor.com +* [Bug 3398] tests fail with core dump + - patch contributed by Alexander Bluhm +* [Bug 3397] ctl_putstr() asserts that data fits in its buffer + rework of formatting & data transfer stuff in 'ntp_control.c' + avoids unecessary buffers and size limitations. +* [Bug 3394] Leap second deletion does not work on ntpd clients + - fixed handling of dynamic deletion w/o leap file +* [Bug 3391] ntpd segfaults on startup due to small warmup thread stack size + - increased mimimum stack size to 32kB +* [Bug 3367] Faulty LinuxPPS NMEA clock support in 4.2.8 + - reverted handling of PPS kernel consumer to 4.2.6 behavior +* [Bug 3365] Updates driver40(-ja).html and miscopt.html +* [Bug 3358] Spurious KoD log messages in .INIT. phase. HStenn. +* [Bug 3016] wrong error position reported for bad ":config pool" + - fixed location counter & ntpq output +* [Bug 2900] libntp build order problem. HStenn. +* [Bug 2878] Tests are cluttering up syslog +* [Bug 2737] Wrong phone number listed for USNO. ntp-bugs@bodosom.net, + perlinger@ntp.org +* [Bug 2557] Fix Thunderbolt init. ntp-bugs@bodosom.net, perlinger@ntp. +* [Bug 948] Trustedkey config directive leaks memory. +* Use strlcpy() to copy strings, not memcpy(). HStenn. +* Typos. HStenn. +* test_ntp_scanner_LDADD needs ntpd/ntp_io.o. HStenn. +* refclock_jjy.c: Add missing "%s" to an msyslog() call. HStenn. +* Build ntpq and libntpq.a with NTP_HARD_*FLAGS. perlinger@ntp.org +* Fix trivial warnings from 'make check'. perlinger@ntp.org +* Fix bug in the override portion of the compiler hardening macro. HStenn. +* record_raw_stats(): Log entire packet. Log writes. HStenn. +* AES-128-CMAC support. BInglis, HStenn, JPerlinger. +* sntp: tweak key file logging. HStenn. +* sntp: pkt_output(): Improve debug output. HStenn. +* update-leap: updates from Paul McMath. +* When using pkg-config, report --modversion. HStenn. +* Clean up libevent configure checks. HStenn. +* sntp: show the IP of who sent us a crypto-NAK. HStenn. +* Allow .../N to specify subnet bits for IPs in ntp.keys. HStenn, JPerlinger. +* authistrustedip() - use it in more places. HStenn, JPerlinger. +* New sysstats: sys_lamport, sys_tsrounding. HStenn. +* Update ntp.keys .../N documentation. HStenn. +* Distribute testconf.yml. HStenn. +* Add DPRINTF(2,...) lines to receive() for packet drops. HStenn. +* Rename the configuration flag fifo variables. HStenn. +* Improve saveconfig output. HStenn. +* Decode restrict flags on receive() debug output. HStenn. +* Decode interface flags on receive() debug output. HStenn. +* Warn the user if deprecated "driftfile name WanderThreshold" is used. HStenn. +* Update the documentation in ntp.conf.def . HStenn. +* restrictions() must return restrict flags and ippeerlimit. HStenn. +* Update ntpq peer documentation to describe the 'p' type. HStenn. +* Rename restrict 'flags' to 'rflags. Use an enum for the values. HStenn. +* Provide dump_restricts() for debugging. HStenn. +* Use consistent 4th arg type for [gs]etsockopt. JPerlinger. +* Some tests might need LIBM. HStenn. +* update-leap: Allow -h/--help early. HStenn. + +--- +(4.2.8p10) 2017/03/21 Released by Harlan Stenn * [Sec 3389] NTP-01-016: Denial of Service via Malformed Config (Pentest report 01.2017) Modified: head/contrib/ntp/Makefile.am ============================================================================== --- head/contrib/ntp/Makefile.am Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/Makefile.am Wed Feb 28 07:59:55 2018 (r330104) @@ -5,10 +5,10 @@ NULL = # moved sntp first to get libtool and libevent built. SUBDIRS = \ - sntp \ scripts \ include \ libntp \ + sntp \ libparse \ ntpd \ ntpdate \ Modified: head/contrib/ntp/Makefile.in ============================================================================== --- head/contrib/ntp/Makefile.in Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/Makefile.in Wed Feb 28 07:59:55 2018 (r330104) @@ -99,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/li $(top_srcdir)/sntp/m4/ltsugar.m4 \ $(top_srcdir)/sntp/m4/ltversion.m4 \ $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_af_unspec.m4 \ $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ @@ -523,10 +524,10 @@ NULL = # moved sntp first to get libtool and libevent built. SUBDIRS = \ - sntp \ scripts \ include \ libntp \ + sntp \ libparse \ ntpd \ ntpdate \ Modified: head/contrib/ntp/NEWS ============================================================================== --- head/contrib/ntp/NEWS Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/NEWS Wed Feb 28 07:59:55 2018 (r330104) @@ -1,4 +1,331 @@ -- +NTP 4.2.8p11 (Harlan Stenn , 2018/02/27) + +NOTE: this NEWS file will be undergoing more revisions. + +Focus: Security, Bug fixes, enhancements. + +Severity: MEDIUM + +This release fixes 2 low-/medium-, 1 informational/medum-, and 2 low-severity +vulnerabilities in ntpd, one medium-severity vulernability in ntpq, and +provides 65 other non-security fixes and improvements: + +* NTP Bug 3454: Unauthenticated packet can reset authenticated interleaved + association (LOW/MED) + Date Resolved: Stable (4.2.8p11) 27 Feb 2018 + References: Sec 3454 / CVE-2018-7185 / VU#961909 + Affects: ntp-4.2.6, up to but not including ntp-4.2.8p11. + CVSS2: MED 4.3 (AV:N/AC:M/Au:N/C:N/I:N/A:P) This could score between + 2.9 and 6.8. + CVSS3: LOW 3.1 CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L This could + score between 2.6 and 3.1 + Summary: + The NTP Protocol allows for both non-authenticated and + authenticated associations, in client/server, symmetric (peer), + and several broadcast modes. In addition to the basic NTP + operational modes, symmetric mode and broadcast servers can + support an interleaved mode of operation. In ntp-4.2.8p4 a bug + was inadvertently introduced into the protocol engine that + allows a non-authenticated zero-origin (reset) packet to reset + an authenticated interleaved peer association. If an attacker + can send a packet with a zero-origin timestamp and the source + IP address of the "other side" of an interleaved association, + the 'victim' ntpd will reset its association. The attacker must + continue sending these packets in order to maintain the + disruption of the association. In ntp-4.0.0 thru ntp-4.2.8p6, + interleave mode could be entered dynamically. As of ntp-4.2.8p7, + interleaved mode must be explicitly configured/enabled. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p11, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page. + If you are unable to upgrade to 4.2.8p11 or later and have + 'peer HOST xleave' lines in your ntp.conf file, remove the + 'xleave' option. + Have enough sources of time. + Properly monitor your ntpd instances. + If ntpd stops running, auto-restart it without -g . + Credit: + This weakness was discovered by Miroslav Lichvar of Red Hat. + +* NTP Bug 3453: Interleaved symmetric mode cannot recover from bad + state (LOW/MED) + Date Resolved: Stable (4.2.8p11) 27 Feb 2018 + References: Sec 3453 / CVE-2018-7184 / VU#961909 + Affects: ntpd in ntp-4.2.8p4, up to but not including ntp-4.2.8p11. + CVSS2: MED 4.3 (AV:N/AC:M/Au:N/C:P/I:N/A:N) + Could score between 2.9 and 6.8. + CVSS3: LOW 3.1 - CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L + Could score between 2.6 and 6.0. + Summary: + The fix for NtpBug2952 was incomplete, and while it fixed one + problem it created another. Specifically, it drops bad packets + before updating the "received" timestamp. This means a + third-party can inject a packet with a zero-origin timestamp, + meaning the sender wants to reset the association, and the + transmit timestamp in this bogus packet will be saved as the + most recent "received" timestamp. The real remote peer does + not know this value and this will disrupt the association until + the association resets. + Mitigation: + Implement BCP-38. + Upgrade to ntp-4.2.8p11 or later from the NTP Project Download Page + or the NTP Public Services Project Download Page. + Use authentication with 'peer' mode. + Have enough sources of time. + Properly monitor your ntpd instances. + If ntpd stops running, auto-restart it without -g . + Credit: + This weakness was discovered by Miroslav Lichvar of Red Hat. + +* NTP Bug 3415: Provide a way to prevent authenticated symmetric passive + peering (LOW) + Date Resolved: Stable (4.2.8p11) 27 Feb 2018 + References: Sec 3415 / CVE-2018-7170 / VU#961909 + Sec 3012 / CVE-2016-1549 / VU#718152 + Affects: All ntp-4 releases up to, but not including 4.2.8p7, and + 4.3.0 up to, but not including 4.3.92. Resolved in 4.2.8p11. + CVSS2: LOW 3.5 - (AV:N/AC:M/Au:S/C:N/I:P/A:N) + CVSS3: LOW 3.1 - CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N + Summary: + ntpd can be vulnerable to Sybil attacks. If a system is set up to + use a trustedkey and if one is not using the feature introduced in + ntp-4.2.8p6 allowing an optional 4th field in the ntp.keys file to + specify which IPs can serve time, a malicious authenticated peer + -- i.e. one where the attacker knows the private symmetric key -- + can create arbitrarily-many ephemeral associations in order to win + the clock selection of ntpd and modify a victim's clock. Three + additional protections are offered in ntp-4.2.8p11. One is the + new 'noepeer' directive, which disables symmetric passive + ephemeral peering. Another is the new 'ippeerlimit' directive, + which limits the number of peers that can be created from an IP. + The third extends the functionality of the 4th field in the + ntp.keys file to include specifying a subnet range. + Mitigation: + Implement BCP-38. + Upgrade to ntp-4.2.8p11 or later from the NTP Project Download Page + or the NTP Public Services Project Download Page. + Use the 'noepeer' directive to prohibit symmetric passive + ephemeral associations. + Use the 'ippeerlimit' directive to limit the number of peers + that can be created from an IP. + Use the 4th argument in the ntp.keys file to limit the IPs and + subnets that can be time servers. + Have enough sources of time. + Properly monitor your ntpd instances. + If ntpd stops running, auto-restart it without -g . + Credit: + This weakness was reported as Bug 3012 by Matthew Van Gundy of + Cisco ASIG, and separately by Stefan Moser as Bug 3415. + +* ntpq Bug 3414: decodearr() can write beyond its 'buf' limits (Medium) + Date Resolved: 27 Feb 2018 + References: Sec 3414 / CVE-2018-7183 / VU#961909 + Affects: ntpq in ntp-4.2.8p6, up to but not including ntp-4.2.8p11. + CVSS2: MED 6.8 (AV:N/AC:M/Au:N/C:P/I:P/A:P) + CVSS3: MED 5.0 CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L + Summary: + ntpq is a monitoring and control program for ntpd. decodearr() + is an internal function of ntpq that is used to -- wait for it -- + decode an array in a response string when formatted data is being + displayed. This is a problem in affected versions of ntpq if a + maliciously-altered ntpd returns an array result that will trip this + bug, or if a bad actor is able to read an ntpq request on its way to + a remote ntpd server and forge and send a response before the remote + ntpd sends its response. It's potentially possible that the + malicious data could become injectable/executable code. + Mitigation: + Implement BCP-38. + Upgrade to ntp-4.2.8p11 or later from the NTP Project Download Page + or the NTP Public Services Project Download Page. + Credit: + This weakness was discovered by Michael Macnair of Thales e-Security. + +* NTP Bug 3412: ctl_getitem(): buffer read overrun leads to undefined + behavior and information leak (Info/Medium) + Date Resolved: 27 Feb 2018 + References: Sec 3412 / CVE-2018-7182 / VU#961909 + Affects: ntp-4.2.8p6, up to but not including ntp-4.2.8p11. + CVSS2: INFO 0.0 - MED 5.0 (AV:N/AC:L/Au:N/C:P/I:N/A:N) 0.0 if C:N + CVSS3: NONE 0.0 - MED 5.3 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N + 0.0 if C:N + Summary: + ctl_getitem() is used by ntpd to process incoming mode 6 packets. + A malicious mode 6 packet can be sent to an ntpd instance, and + if the ntpd instance is from 4.2.8p6 thru 4.2.8p10, that will + cause ctl_getitem() to read past the end of its buffer. + Mitigation: + Implement BCP-38. + Upgrade to ntp-4.2.8p11 or later from the NTP Project Download Page + or the NTP Public Services Project Download Page. + Have enough sources of time. + Properly monitor your ntpd instances. + If ntpd stops running, auto-restart it without -g . + Credit: + This weakness was discovered by Yihan Lian of Qihoo 360. + +* NTP Bug 3012: Sybil vulnerability: ephemeral association attack + Also see Bug 3415, above. + Date Mitigated: Stable (4.2.8p7) 26 Apr 2016; Dev (4.3.92) 26 Apr 2016 + Date Resolved: Stable (4.2.8p11) 27 Feb 2018 + References: Sec 3012 / CVE-2016-1549 / VU#718152 + Affects: All ntp-4 releases up to, but not including 4.2.8p7, and + 4.3.0 up to, but not including 4.3.92. Resolved in 4.2.8p11. + CVSS2: LOW 3.5 - (AV:N/AC:M/Au:S/C:N/I:P/A:N) + CVSS3: MED 5.3 - CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N + Summary: + ntpd can be vulnerable to Sybil attacks. If a system is set up + to use a trustedkey and if one is not using the feature + introduced in ntp-4.2.8p6 allowing an optional 4th field in the + ntp.keys file to specify which IPs can serve time, a malicious + authenticated peer -- i.e. one where the attacker knows the + private symmetric key -- can create arbitrarily-many ephemeral + associations in order to win the clock selection of ntpd and + modify a victim's clock. Two additional protections are + offered in ntp-4.2.8p11. One is the 'noepeer' directive, which + disables symmetric passive ephemeral peering. The other extends + the functionality of the 4th field in the ntp.keys file to + include specifying a subnet range. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p11, or later, from the NTP Project Download Page or + the NTP Public Services Project Download Page. + Use the 'noepeer' directive to prohibit symmetric passive + ephemeral associations. + Use the 'ippeerlimit' directive to limit the number of peer + associations from an IP. + Use the 4th argument in the ntp.keys file to limit the IPs + and subnets that can be time servers. + Properly monitor your ntpd instances. + Credit: + This weakness was discovered by Matthew Van Gundy of Cisco ASIG. + +* Bug fixes: + [Bug 3457] OpenSSL FIPS mode regression + [Bug 3455] ntpd doesn't use scope id when binding multicast + - applied patch by Sean Haugh + [Bug 3452] PARSE driver prints uninitialized memory. + [Bug 3450] Dubious error messages from plausibility checks in get_systime() + - removed error log caused by rounding/slew, ensured postcondition + [Bug 3447] AES-128-CMAC (fixes) + - refactoring the MAC code, too + [Bug 3441] Validate the assumption that AF_UNSPEC is 0. stenn@ntp.org + [Bug 3439] When running multiple commands / hosts in ntpq... + - applied patch by ggarvey + [Bug 3438] Negative values and values > 999 days in... + - applied patch by ggarvey (with minor mods) + [Bug 3437] ntpd tries to open socket with AF_UNSPEC domain + - applied patch (with mods) by Miroslav Lichvar + [Bug 3435] anchor NTP era alignment + [Bug 3433] sntp crashes when run with -a. + [Bug 3430] ntpq dumps core (SIGSEGV) for "keytype md2" + - fixed several issues with hash algos in ntpd, sntp, ntpq, + ntpdc and the test suites + [Bug 3424] Trimble Thunderbolt 1024 week millenium bug + - initial patch by Daniel Pouzzner + [Bug 3423] QNX adjtime() implementation error checking is + wrong + [Bug 3417] ntpq ifstats packet counters can be negative + made IFSTATS counter quantities unsigned + [Bug 3411] problem about SIGN(6) packet handling for ntp-4.2.8p10 + - raised receive buffer size to 1200 + [Bug 3408] refclock_jjy.c: Avoid a wrong report of the coverity static + analysis tool. + [Bug 3405] update-leap.in: general cleanup, HTTPS support. Paul McMath. + [Bug 3404] Fix openSSL DLL usage under Windows + - fix/drop assumptions on OpenSSL libs directory layout + [Bug 3399] NTP: linker error in 4.2.8p10 during Linux cross-compilation + - initial patch by timeflies@mail2tor.com + [Bug 3398] tests fail with core dump + - patch contributed by Alexander Bluhm + [Bug 3397] ctl_putstr() asserts that data fits in its buffer + rework of formatting & data transfer stuff in 'ntp_control.c' + avoids unecessary buffers and size limitations. + [Bug 3394] Leap second deletion does not work on ntpd clients + - fixed handling of dynamic deletion w/o leap file + [Bug 3391] ntpd segfaults on startup due to small warmup thread stack size + - increased mimimum stack size to 32kB + [Bug 3367] Faulty LinuxPPS NMEA clock support in 4.2.8 + - reverted handling of PPS kernel consumer to 4.2.6 behavior + [Bug 3365] Updates driver40(-ja).html and miscopt.html + [Bug 3358] Spurious KoD log messages in .INIT. phase. HStenn. + [Bug 3016] wrong error position reported for bad ":config pool" + - fixed location counter & ntpq output + [Bug 2900] libntp build order problem. HStenn. + [Bug 2878] Tests are cluttering up syslog + [Bug 2737] Wrong phone number listed for USNO. ntp-bugs@bodosom.net, + perlinger@ntp.org + [Bug 2557] Fix Thunderbolt init. ntp-bugs@bodosom.net, perlinger@ntp. + [Bug 948] Trustedkey config directive leaks memory. + Use strlcpy() to copy strings, not memcpy(). HStenn. + Typos. HStenn. + test_ntp_scanner_LDADD needs ntpd/ntp_io.o. HStenn. + refclock_jjy.c: Add missing "%s" to an msyslog() call. HStenn. + Build ntpq and libntpq.a with NTP_HARD_*FLAGS. perlinger@ntp.org + Fix trivial warnings from 'make check'. perlinger@ntp.org + Fix bug in the override portion of the compiler hardening macro. HStenn. + record_raw_stats(): Log entire packet. Log writes. HStenn. + AES-128-CMAC support. BInglis, HStenn, JPerlinger. + sntp: tweak key file logging. HStenn. + sntp: pkt_output(): Improve debug output. HStenn. + update-leap: updates from Paul McMath. + When using pkg-config, report --modversion. HStenn. + Clean up libevent configure checks. HStenn. + sntp: show the IP of who sent us a crypto-NAK. HStenn. + Allow .../N to specify subnet bits for IPs in ntp.keys. HStenn, JPerlinger. + authistrustedip() - use it in more places. HStenn, JPerlinger. + New sysstats: sys_lamport, sys_tsrounding. HStenn. + Update ntp.keys .../N documentation. HStenn. + Distribute testconf.yml. HStenn. + Add DPRINTF(2,...) lines to receive() for packet drops. HStenn. + Rename the configuration flag fifo variables. HStenn. + Improve saveconfig output. HStenn. + Decode restrict flags on receive() debug output. HStenn. + Decode interface flags on receive() debug output. HStenn. + Warn the user if deprecated "driftfile name WanderThreshold" is used. HStenn. + Update the documentation in ntp.conf.def . HStenn. + restrictions() must return restrict flags and ippeerlimit. HStenn. + Update ntpq peer documentation to describe the 'p' type. HStenn. + Rename restrict 'flags' to 'rflags. Use an enum for the values. HStenn. + Provide dump_restricts() for debugging. HStenn. + Use consistent 4th arg type for [gs]etsockopt. JPerlinger. + +* Other items: + +* update-leap needs the following perl modules: + Net::SSLeay + IO::Socket::SSL + +* New sysstats variables: sys_lamport, sys_tsrounding +See them with: ntpq -c "rv 0 ss_lamport,ss_tsrounding" +sys_lamport counts the number of observed Lamport violations, while +sys_tsrounding counts observed timestamp rounding events. + +* New ntp.conf items: + +- restrict ... noepeer +- restrict ... ippeerlimit N + +The 'noepeer' directive will disallow all ephemeral/passive peer +requests. + +The 'ippeerlimit' directive limits the number of time associations +for each IP in the designated set of addresses. This limit does not +apply to explicitly-configured associations. A value of -1, the current +default, means an unlimited number of associations may connect from a +single IP. 0 means "none", etc. Ordinarily the only way multiple +associations would come from the same IP would be if the remote side +was using a proxy. But a trusted machine might become compromised, +in which case an attacker might spin up multiple authenticated sessions +from different ports. This directive should be helpful in this case. + +* New ntp.keys feature: Each IP in the optional list of IPs in the 4th +field may contain a /subnetbits specification, which identifies the +scope of IPs that may use this key. This IP/subnet restriction can be +used to limit the IPs that may use the key in most all situations where +a key is used. +-- NTP 4.2.8p10 (Harlan Stenn , 2017/03/21) Focus: Security, Bug fixes, enhancements. @@ -960,7 +1287,7 @@ following 9 low- and medium-severity vulnerabilities: Implement BCP-38. Upgrade to 4.2.8p7, or later, from the NTP Project Download Page or the NTP Public Services Project Download Page - Properly monitor your =ntpd= instances + Properly monitor your ntpd instances Credit: This weakness was discovered by Stephen Gray and Matthew Van Gundy of Cisco ASIG. @@ -1029,7 +1356,7 @@ following 9 low- and medium-severity vulnerabilities: Implement BCP-38. Upgrade to 4.2.8p7, or later, from the NTP Project Download Page or the NTP Public Services Project Download Page - Properly monitor your =ntpd= instances + Properly monitor your ntpd instances Credit: This weakness was discovered by Yihan Lian of the Cloud Security Team, Qihoo 360. @@ -1266,7 +1593,7 @@ following 1 low- and 8 medium-severity vulnerabilities Configure 'ntpd' to get time from multiple sources. Upgrade to 4.2.8p6, or later, from the NTP Project Download Page or the NTP Public Services Project Download Page. - Monitor your 'ntpd= instances. + Monitor your 'ntpd' instances. Credit: This weakness was discovered by Matthey Van Gundy and Jonathan Gardner of Cisco ASIG. Modified: head/contrib/ntp/aclocal.m4 ============================================================================== --- head/contrib/ntp/aclocal.m4 Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/aclocal.m4 Wed Feb 28 07:59:55 2018 (r330104) @@ -1339,6 +1339,7 @@ m4_include([sntp/m4/ltoptions.m4]) m4_include([sntp/m4/ltsugar.m4]) m4_include([sntp/m4/ltversion.m4]) m4_include([sntp/m4/lt~obsolete.m4]) +m4_include([sntp/m4/ntp_af_unspec.m4]) m4_include([sntp/m4/ntp_cacheversion.m4]) m4_include([sntp/m4/ntp_compiler.m4]) m4_include([sntp/m4/ntp_crosscompile.m4]) Modified: head/contrib/ntp/adjtimed/Makefile.in ============================================================================== --- head/contrib/ntp/adjtimed/Makefile.in Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/adjtimed/Makefile.in Wed Feb 28 07:59:55 2018 (r330104) @@ -108,6 +108,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/li $(top_srcdir)/sntp/m4/ltsugar.m4 \ $(top_srcdir)/sntp/m4/ltversion.m4 \ $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_af_unspec.m4 \ $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ @@ -952,7 +953,6 @@ install-exec-hook: # check-libntp: ../libntp/libntp.a - @echo stamp > $@ ../libntp/libntp.a: cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a Modified: head/contrib/ntp/clockstuff/Makefile.in ============================================================================== --- head/contrib/ntp/clockstuff/Makefile.in Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/clockstuff/Makefile.in Wed Feb 28 07:59:55 2018 (r330104) @@ -101,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/li $(top_srcdir)/sntp/m4/ltsugar.m4 \ $(top_srcdir)/sntp/m4/ltversion.m4 \ $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_af_unspec.m4 \ $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ @@ -793,7 +794,6 @@ uninstall-am: check-libntp: ../libntp/libntp.a - @echo stamp > $@ ../libntp/libntp.a: cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a Modified: head/contrib/ntp/configure ============================================================================== --- head/contrib/ntp/configure Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/configure Wed Feb 28 07:59:55 2018 (r330104) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ntp 4.2.8p10. +# Generated by GNU Autoconf 2.69 for ntp 4.2.8p11. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ntp' PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.8p10' -PACKAGE_STRING='ntp 4.2.8p10' +PACKAGE_VERSION='4.2.8p11' +PACKAGE_STRING='ntp 4.2.8p11' PACKAGE_BUGREPORT='http://bugs.ntp.org./' PACKAGE_URL='http://www.ntp.org./' @@ -944,6 +944,7 @@ ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking +with_hardenfile with_locfile enable_shared enable_static @@ -1613,7 +1614,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.8p10 to adapt to many kinds of systems. +\`configure' configures ntp 4.2.8p11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1683,7 +1684,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.8p10:";; + short | recursive ) echo "Configuration of ntp 4.2.8p11:";; esac cat <<\_ACEOF @@ -1699,6 +1700,7 @@ Optional Features and Packages: do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build + --with-hardenfile=XXX os-specific or "/dev/null" --with-locfile=XXX os-specific or "legacy" --enable-shared[=PKGS] build shared libraries [default=no] --enable-static[=PKGS] build static libraries [default=yes] @@ -1921,7 +1923,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.8p10 +ntp configure 4.2.8p11 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2630,7 +2632,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.8p10, which was +It was created by ntp $as_me 4.2.8p11, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3631,7 +3633,7 @@ fi # Define the identity of the package. PACKAGE='ntp' - VERSION='4.2.8p10' + VERSION='4.2.8p11' cat >>confdefs.h <<_ACEOF @@ -6581,11 +6583,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu $as_echo_n "checking for compile/link hardening flags... " >&6; } -# Check whether --with-locfile was given. -if test "${with_locfile+set}" = set; then : - withval=$with_locfile; +# Check whether --with-hardenfile was given. +if test "${with_hardenfile+set}" = set; then : + withval=$with_hardenfile; else - with_locfile=no + with_hardenfile=no fi @@ -6593,12 +6595,12 @@ fi ( \ SENTINEL_DIR="$PWD" && \ cd $srcdir/sntp && \ - case "$with_locfile" in \ + case "$with_hardenfile" in \ yes|no|'') \ scripts/genHardFlags -d "$SENTINEL_DIR" \ ;; \ *) \ - scripts/genHardFlags -d "$SENTINEL_DIR" -f "$with_locfile" \ + scripts/genHardFlags -d "$SENTINEL_DIR" -f "$with_hardenfile" \ ;; \ esac \ ) > genHardFlags.i 2> genHardFlags.err @@ -15937,8 +15939,13 @@ $as_echo_n "checking if libevent $ntp_libevent_min_ver if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent then ntp_use_local_libevent=no - { $as_echo "$as_me:${as_lineno-$LINENO}: Using the installed libevent" >&5 -$as_echo "$as_me: Using the installed libevent" >&6;} + ntp_libevent_version="`$PKG_CONFIG --modversion libevent`" + case "$ntp_libevent_version" in + *.*) ;; + *) ntp_libevent_version='(unknown)' ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, version $ntp_libevent_version" >&5 +$as_echo "yes, version $ntp_libevent_version" >&6; } CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads` CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent` # HMS: I hope the following is accurate. @@ -15966,8 +15973,6 @@ $as_echo "$as_me: Using the installed libevent" >&6;} LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads" esac LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_core" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } else ntp_use_local_libevent=yes # HMS: do we only need to do this if LIBISC_PTHREADS_NOTHREADS @@ -26468,6 +26473,36 @@ fi done + + +# We could do a cv check here, but is it worth it? + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef AF_UNSPEC + #include "Bletch: AF_UNSPEC is undefined!" + #endif + #if AF_UNSPEC != 0 + #include "Bletch: AF_UNSPEC != 0" + #endif + +int +main () +{ +{ $as_echo "$as_me:${as_lineno-$LINENO}: AF_UNSPEC is zero, as expected." >&5 +$as_echo "$as_me: AF_UNSPEC is zero, as expected." >&6;} + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : @@ -30114,8 +30149,13 @@ $as_echo_n "checking pkg-config for $pkg... " >&6; } VER_SUFFIX=o ntp_openssl=yes ntp_openssl_from_pkg_config=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ntp_openssl_version="`$PKG_CONFIG --modversion $pkg`" + case "$ntp_openssl_version" in + *.*) ;; + *) ntp_openssl_version='(unknown)' ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, version $ntp_openssl_version" >&5 +$as_echo "yes, version $ntp_openssl_version" >&6; } break fi @@ -33924,7 +33964,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntp $as_me 4.2.8p10, which was +This file was extended by ntp $as_me 4.2.8p11, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33991,7 +34031,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ntp config.status 4.2.8p10 +ntp config.status 4.2.8p11 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/ntp/configure.ac ============================================================================== --- head/contrib/ntp/configure.ac Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/configure.ac Wed Feb 28 07:59:55 2018 (r330104) @@ -528,6 +528,8 @@ AC_CHECK_HEADERS([sys/timex.h], [], [], [ #endif ]) +NTP_AF_UNSPEC + AC_TYPE_SIGNAL AC_TYPE_OFF_T AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c Modified: head/contrib/ntp/html/access.html ============================================================================== --- head/contrib/ntp/html/access.html Wed Feb 28 06:23:57 2018 (r330103) +++ head/contrib/ntp/html/access.html Wed Feb 28 07:59:55 2018 (r330104) @@ -19,7 +19,7 @@ color: #FF0000;

giffrom Pogo, Walt Kelly

The skunk watches for intruders and sprays.

Last update: - 11-Sep-2010 05:53 + 26-Jul-2017 20:10 UTC


Related Links

@@ -32,7 +32,7 @@ color: #FF0000;

The ACL is specified as a list of restrict commands in the following format:

restrict address [mask mask] [flag][...]

The address argument expressed in dotted-quad form is the address of a host or network. Alternatively, the address argument can be a valid host DNS name. The mask argument expressed in IPv4 or IPv6 numeric address form defaults to all mask bits on, meaning that the address is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0 for IPv4 and address :: mask :: for IPv6) is always the first entry in the list. restrict default, with no mask option, modifies both IPv4 and IPv6 default entries. restrict source configures a template restriction automatically added at runtime for each association, whether configured, ephemeral, or preemptable, and removed when the association is demobilized.

-

Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags. are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server.

+

Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server.

An example may clarify how it works. Our campus has two class-B networks, 128.4 for the ECE and CIS departments and 128.175 for the rest of campus. Let's assume (not true!) that subnet 128.4.1 homes critical services like class rosters and spread sheets. A suitable ACL might look like this:

 restrict default nopeer					# deny new associations

Modified: head/contrib/ntp/html/accopt.html
==============================================================================
--- head/contrib/ntp/html/accopt.html	Wed Feb 28 06:23:57 2018	(r330103)
+++ head/contrib/ntp/html/accopt.html	Wed Feb 28 07:59:55 2018	(r330104)
@@ -3,89 +3,185 @@
 
 
 
-Access Control Commands and Options
-
+Access Control Commands and Options 
 
 
 
 
 

Access Control Commands and Options

-giffrom Pogo, Walt Kelly +giffrom Pogo, +Walt Kelly

The skunk watches for intruders and sprays.

-

Last update: - 13-Nov-2014 03:00 - UTC

+

Last update: 7-Jan-2018 23:56 UTC


Related Links

- - + +

Commands and Options

-

Unless noted otherwise, further information about these ccommands is on the Access Control Support page.

+

Unless noted otherwise, further information about these ccommands is on +the Access Control Support page.

-
discard [ average avg ][ minimum min ] [ monitor prob ]
-
Set the parameters of the rate control facility which protects the server from client abuse. If the limited flag is present in the ACL, packets that violate these limits are discarded. If, in addition, the kod flag is present, a kiss-o'-death packet is returned. See the Rate Management page for further information. The options are: +
discard [ average avg ][ minimum min ] + [ monitor prob ]
+
Set the parameters of the rate control facility which protects the + server from client abuse. If the limited flag is present in the + ACL, packets that violate these limits are discarded. If, in addition, + the kod flag is present, a kiss-o'-death packet is + returned. See the Rate Management page for + further information. The options are:
average avg
-
Specify the minimum average interpacket spacing (minimum average headway - time) in log2 s with default 3.
+
Specify the minimum average interpacket spacing (minimum average + headway time) in log2 s with default 3.
minimum min
-
Specify the minimum interpacket spacing (guard time) in seconds with default 2.
+
Specify the minimum interpacket spacing (guard time) in seconds + with default 2.
monitor
-
Specify the probability of being recorded for packets that overflow the MRU list size limit set by mru maxmem or mru maxdepth. This is a performance optimization for servers with aggregate arrivals of 1000 packets per second or more.
+
Specify the probability of being recorded for packets that + overflow the MRU list size limit set by mru maxmem + or mru maxdepth. This is a performance optimization for + servers with aggregate arrivals of 1000 packets per second or + more.
-
restrict default [flag][...]
- restrict source [flag][...]
- restrict address [mask mask] [flag][...]
-
The address argument expressed in dotted-quad form is the address of a host or network. Alternatively, the address argument can be a valid host DNS name. The mask argument expressed in IPv4 or IPv6 numeric address form defaults to all mask bits on, meaning that the address is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0 for IPv4 and address :: mask :: for IPv6) is always the first entry in the list. restrict default, with no mask option, modifies both IPv4 and IPv6 default entries. restrict source configures a template restriction automatically added at runtime for each association, whether configured, ephemeral, or preemptible, and removed when the association is demobilized.
-
Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags. are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server. One or more of the following flags may be specified:
+
restrict [-4 | -6] default [ippeerlimit num] + [flag][...]
restrict source [ippeerlimit num] + [flag][...]
restrict address [mask mask] + [ippeerlimit num] [flag][...]
+
The address argument expressed in IPv4 or IPv6 numeric + address form is the address of a host or network. Alternatively, + the address argument can be a valid host DNS + name. The mask argument expressed in IPv4 or IPv6 + numeric address form defaults to all mask bits on, meaning that + the address is treated as the address of an individual + host. A default entry (address 0.0.0.0, mask 0.0.0.0 for IPv4 and + address :: mask :: for IPv6) is always the first entry in the + list. restrict default, with no mask option, modifies both IPv4 + and IPv6 default entries. restrict source configures a template + restriction automatically added at runtime for each association, whether + configured, ephemeral, or preemptible, and removed when the association + is demobilized.
+
The optional ippeerlimit takes a numeric argument that + indicates how many incoming (at present) peer requests will be permitted + for each IP, regardless of whether or not the request comes from an + authenticated source. A value of -1 means "unlimited", which is the + current default. A value of 0 means "none". Ordinarily one would + expect at most 1 of these sessions to exist per IP, however if the + remote side is operating thru a proxy there would be one association for + each remote peer at that IP.
+
Some flags have the effect to deny service, some have the effect to + enable service and some are conditioned by other flags. The flags are + not orthogonal, in that more restrictive flags will often make less + restrictive ones redundant. The flags that deny service are classed in + two categories, those that restrict time service and those that restrict + informational queries and attempts to do run-time reconfiguration of the + server. One or more of the following flags may be specified:
flake
-
Discard received NTP packets with probability 0.1; that is, on average drop one packet in ten. This is for testing and amusement. The name comes from Bob Braden's flakeway, which once did a similar thing for early Internet testing.
+
Discard received NTP packets with probability 0.1; that is, on + average drop one packet in ten. This is for testing and + amusement. The name comes from Bob Braden's flakeway, which + once did a similar thing for early Internet testing.
ignore
-
Deny packets of all kinds, including ntpq and ntpdc queries.
+
Deny packets of all kinds, including ntpq + and ntpdc queries.
kod
-
Send a kiss-o'-death (KoD) packet if the limited flag is present and a packet violates the rate limits established by the discard command. KoD packets are themselves rate limited for each source address separately. If the kod flag is used in a restriction which does not have the limited flag, no KoD responses will result.
+
Send a kiss-o'-death (KoD) packet if the limited flag is + present and a packet violates the rate limits established by + the discard command. KoD packets are themselves rate + limited for each source address separately. If the kod flag + is used in a restriction which does not have the limited + flag, no KoD responses will result.
limited
-
Deny time service if the packet violates the rate limits established by the discard command. This does not apply to ntpq and ntpdc queries.
+
Deny time service if the packet violates the rate limits + established by the discard command. This does not apply + to ntpq and ntpdc queries.
lowpriotrap
-
Declare traps set by matching hosts to be low priority. The number of traps a server can maintain is limited (the current limit is 3). Traps are usually assigned on a first come, first served basis, with later trap requestors being denied service. This flag modifies the assignment algorithm by allowing low priority traps to be overridden by later requests for normal priority traps.
+
Declare traps set by matching hosts to be low priority. The number + of traps a server can maintain is limited (the current limit is + 3). Traps are usually assigned on a first come, first served basis, + with later trap requestors being denied service. This flag modifies + the assignment algorithm by allowing low priority traps to be + overridden by later requests for normal priority traps.
mssntp
-
Enable Microsoft Windows MS-SNTP authentication using Active Directory services. Note: Potential users should be aware that these services involve a TCP connection to another process that could potentially block, denying services to other users. Therefore, this flag should be used only for a dedicated server with no clients other than MS-SNTP.
+
Enable Microsoft Windows MS-SNTP authentication using Active + Directory services. Note: Potential users + should be aware that these services involve a TCP connection to + another process that could potentially block, denying services to + other users. Therefore, this flag should be used only for a + dedicated server with no clients other than MS-SNTP.
+
noepeer
+
Deny packets that would mobilize an ephemeral peering association, + even if authenticated.
nomodify
-
Deny ntpq and ntpdc queries which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted.
+
Deny ntpq and ntpdc queries which attempt to + modify the state of the server (i.e., run time + reconfiguration). Queries which return information are + permitted.
noquery
-
Deny ntpq and ntpdc queries. Time service is not affected.
+
Deny ntpq and ntpdc queries. Time service is not + affected.
nopeer
-
Deny packets that might mobilize an association unless authenticated. This includes broadcast, symmetric-active and manycast server packets when a configured association does not exist. It also includes pool associations, so if you want to use servers from a pool directive and also want to use nopeer by default, you'll want a "restrict source ..." line as well that does not include the nopeer directive. Note that this flag does not apply to packets that do not attempt to mobilize an association.
+
Deny packets that might mobilize an association unless + authenticated. This includes broadcast, symmetric-active and + manycast server packets when a configured association does not + exist. It also includes pool associations, so if you want + to use servers from a pool directive and also want to + use nopeer by default, you'll want a "restrict source + ..." line as well that does not include + the nopeer directive. Note that this flag does not apply + to packets that do not attempt to mobilize an association.
noserve
-
Deny all packets except ntpq and ntpdc queries.
+
Deny all packets except ntpq and ntpdc + queries.
notrap
-
Decline to provide mode 6 control message trap service to matching hosts. The trap service is a subsystem of the ntpdc control message protocol which is intended for use by remote event logging programs.
+
Decline to provide mode 6 control message trap service to matching + hosts. The trap service is a subsystem of the ntpdc control + message protocol which is intended for use by remote event logging + programs.
notrust
-
Deny packets that are not cryptographically authenticated. Note carefully how this flag interacts with the auth option of the enable and disable commands. If auth is enabled, which is the default, authentication is required for all packets that might mobilize an association. If auth is disabled, but the notrust flag is not present, an association can be mobilized whether or not authenticated. If auth is disabled, but the notrust flag is present, authentication is required only for the specified address/mask range.
+
Deny packets that are not cryptographically authenticated. Note + carefully how this flag interacts with the auth option of + the enable and disable commands. If auth + is enabled, which is the default, authentication is required for all + packets that might mobilize an association. If auth is + disabled, but the notrust flag is not present, an + association can be mobilized whether or not + authenticated. If auth is disabled, but + the notrust flag is present, authentication is required + only for the specified address/mask range.
ntpport
-
This is actually a match algorithm modifier, rather than a restriction - flag. Its presence causes the restriction entry to be matched only if the - source port in the packet is the standard NTP UDP port (123). A restrict line - containing ntpport is considered more specific than one with the *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 28 08:53:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BC36F350B3; Wed, 28 Feb 2018 08:53:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DFA76C80B; Wed, 28 Feb 2018 08:53:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0861917551; Wed, 28 Feb 2018 08:53:08 +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 w1S8r7ba079420; Wed, 28 Feb 2018 08:53:07 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S8r72H079419; Wed, 28 Feb 2018 08:53:07 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201802280853.w1S8r72H079419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 28 Feb 2018 08:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330105 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 330105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 08:53:08 -0000 Author: kp Date: Wed Feb 28 08:53:07 2018 New Revision: 330105 URL: https://svnweb.freebsd.org/changeset/base/330105 Log: pf: Do not flush on reload pfctl only takes the last '-F' argument into account, so this never did what was intended. Moreover, there is no reason to flush rules before reloading, because pf keeps track of the rule which created a given state. That means that existing connections will keep being processed according to the rule which originally created them. Simply reloading the (new) rules suffices. The new rules will apply to new connections. PR: 127814 Submitted by: Andreas Longwitz MFC after: 3 weeks Modified: head/etc/rc.d/pf Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Wed Feb 28 07:59:55 2018 (r330104) +++ head/etc/rc.d/pf Wed Feb 28 08:53:07 2018 (r330105) @@ -54,9 +54,6 @@ pf_reload() { echo "Reloading pf rules." $pf_program -n -f "$pf_rules" || return 1 - # Flush everything but existing state entries that way when - # rules are read in, it doesn't break established connections. - $pf_program -Fnat -Fqueue -Frules -FSources -Finfo -FTables -Fosfp > /dev/null 2>&1 $pf_program -f "$pf_rules" $pf_flags } From owner-svn-src-head@freebsd.org Wed Feb 28 09:59:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D131FF39A63; Wed, 28 Feb 2018 09:59:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 876476EF5C; Wed, 28 Feb 2018 09:59:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8263B17F2E; Wed, 28 Feb 2018 09:59:58 +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 w1S9xw7a009587; Wed, 28 Feb 2018 09:59:58 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S9xwv4009586; Wed, 28 Feb 2018 09:59:58 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201802280959.w1S9xwv4009586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 28 Feb 2018 09:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330108 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 330108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 09:59:59 -0000 Author: kp Date: Wed Feb 28 09:59:58 2018 New Revision: 330108 URL: https://svnweb.freebsd.org/changeset/base/330108 Log: pf: Apply $pf_flags when verifying the pf.conf file When checking the validity of the pf.conf file also include the user supplied pf_flags. These flags might overrule macros or specify anchors, which we will apply when actually applying the pf.conf file, so we must also take them into account when verifying the validity. Submitted by: Andreas Longwitz MFC after: 3 weeks Modified: head/etc/rc.d/pf Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Wed Feb 28 09:59:44 2018 (r330107) +++ head/etc/rc.d/pf Wed Feb 28 09:59:58 2018 (r330108) @@ -47,13 +47,13 @@ pf_stop() pf_check() { echo "Checking pf rules." - $pf_program -n -f "$pf_rules" + $pf_program -n -f "$pf_rules" $pf_flags } pf_reload() { echo "Reloading pf rules." - $pf_program -n -f "$pf_rules" || return 1 + $pf_program -n -f "$pf_rules" $pf_flags || return 1 $pf_program -f "$pf_rules" $pf_flags } From owner-svn-src-head@freebsd.org Wed Feb 28 14:57:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61911F2C286; Wed, 28 Feb 2018 14:57:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14BF07AA3D; Wed, 28 Feb 2018 14:57:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09C201AF48; Wed, 28 Feb 2018 14:57:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SEvjW5059856; Wed, 28 Feb 2018 14:57:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SEvjNN059852; Wed, 28 Feb 2018 14:57:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802281457.w1SEvjNN059852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Feb 2018 14:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330110 - in head: sys/conf tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: sys/conf tools/build/options X-SVN-Commit-Revision: 330110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 14:57:46 -0000 Author: emaste Date: Wed Feb 28 14:57:45 2018 New Revision: 330110 URL: https://svnweb.freebsd.org/changeset/base/330110 Log: Add kernel retpoline option for amd64 Retpoline is a compiler-based mitigation for CVE-2017-5715, also known as Spectre V2, that protects against speculative execution branch target injection attacks. In this commit it is disabled by default, but will be changed in a followup commit. Reviewed by: bdrewery (previous version) MFC after: 3 days Security: CVE-2017-5715 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14242 Added: head/tools/build/options/WITHOUT_KERNEL_RETPOLINE (contents, props changed) head/tools/build/options/WITH_KERNEL_RETPOLINE (contents, props changed) Modified: head/sys/conf/kern.mk head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Wed Feb 28 10:00:02 2018 (r330109) +++ head/sys/conf/kern.mk Wed Feb 28 14:57:45 2018 (r330110) @@ -203,7 +203,7 @@ CFLAGS+= -ffreestanding # gcc and clang opimizers take advantage of this. The kernel makes # use of signed integer wraparound mechanics so we need the compiler # to treat it as a wraparound and not take shortcuts. -# +# CFLAGS+= -fwrapv # @@ -212,6 +212,14 @@ CFLAGS+= -fwrapv .if ${MK_SSP} != "no" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector +.endif + +# +# Retpoline speculative execution vulnerability mitigation (CVE-2017-5715) +# +.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Mretpoline} != "" && \ + ${MK_KERNEL_RETPOLINE} != "no" +CFLAGS+= -mretpoline .endif # Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Wed Feb 28 10:00:02 2018 (r330109) +++ head/sys/conf/kern.opts.mk Wed Feb 28 14:57:45 2018 (r330110) @@ -47,6 +47,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ + KERNEL_RETPOLINE \ NAND \ OFED \ RATELIMIT \ @@ -83,6 +84,11 @@ BROKEN_OPTIONS+= FORMAT_EXTENSIONS # for them. .if ${MACHINE} != "i386" && ${MACHINE} != "amd64" BROKEN_OPTIONS+= OFED +.endif + +# Things that don't work based on toolchain support. +.if ${MACHINE} != "amd64" +BROKEN_OPTIONS+= KERNEL_RETPOLINE .endif # expanded inline from bsd.mkopt.mk to avoid share/mk dependency Added: head/tools/build/options/WITHOUT_KERNEL_RETPOLINE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_KERNEL_RETPOLINE Wed Feb 28 14:57:45 2018 (r330110) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to disable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. Added: head/tools/build/options/WITH_KERNEL_RETPOLINE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_KERNEL_RETPOLINE Wed Feb 28 14:57:45 2018 (r330110) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to enable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. From owner-svn-src-head@freebsd.org Wed Feb 28 15:02:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C000F2C779; Wed, 28 Feb 2018 15:02:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::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 991DE7AE56; Wed, 28 Feb 2018 15:02:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x231.google.com with SMTP id c11so3785849ith.4; Wed, 28 Feb 2018 07:02:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lyB7+Bgm/isElox7fEkD2qiS5miqbay8tGQwQrcgU2U=; b=Z0vNNuqGB8/PxwPB8o6swGMETAXHodzzGG6ixVzK5Mvv1Ot/anjjGHc7iMyHjOhATE jOPw1QB1TYeKCRc+sRQNP77eNtc48Kl/C08cVNwuv/LRH/0HXkSCBWJ0Ea5wgjSBft38 ygemTw9y3dnfwzrpXQcx9+C/AnpTkKODfDC/J2P3F6qQfmXtvikV6d8D3SS3qcAO/8Nu XlGcIcki1++Xp8rWWXZooDrMVCCIbUd2nDclYcFqK5h1O/SB7c/RT/ka3p170Xo5gaBE aqyPpHURPZrmPGqp17ORhPmFV4ZvlLXw01HkvQ1X/fg7bWaA7jDpiQ21sM7m2jIS+0de 3Pcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=lyB7+Bgm/isElox7fEkD2qiS5miqbay8tGQwQrcgU2U=; b=BSiSeEDnVPXz6zbiiUlE0teHYyytlkg7fKSMnwfzk4r00hPLuXwDIf0+W4VGJJEOMK ig540CAF+6lpLx/MfQW+abZ8OD9ycmMA3jR5eFW8splOkKMrYweePcc4ren9J79hTbTX y8y+O8eI+rUnT2LWbYIMGzDDMfZlv6F2Zjy8n54Z9iqnQcUh+PBOuD9Pds88hPAUOS6R FK2jP9YmnwhSxAqwsKq5zJf7HY7IuvQzKltAWH3XqxACNLjzR+16Uwgs0io17+QBNe0/ 8Ja/b4fiAOj/Y/9WFIFhkvWWWWdemgBA1/pxllXG+UdAWTLLTMM6XbXNEw611bodZyHy zcjw== X-Gm-Message-State: APf1xPCStN3YPT4yqxWjArSxEqgTUnWZkzvb6qJVIvyzNahMpgQBFJ1B hlz7Y6kPSsvtv/ZuBn6SlfKRivGRHyBZoaPEqTiP+w== X-Google-Smtp-Source: AG47ELuUlE9EDU4FTpMugRaCRKzBPtctr1OX0izHgWn51PwiOjul9Ezb6Z9pVoLIuFwDCGkx5BXyJXXuWP1WiRGnWG0= X-Received: by 10.36.210.65 with SMTP id z62mr20994113itf.49.1519830123726; Wed, 28 Feb 2018 07:02:03 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.13 with HTTP; Wed, 28 Feb 2018 07:01:43 -0800 (PST) In-Reply-To: <201709290636.v8T6aJDG089556@repo.freebsd.org> References: <201709290636.v8T6aJDG089556@repo.freebsd.org> From: Ed Maste Date: Wed, 28 Feb 2018 10:01:43 -0500 X-Google-Sender-Auth: 9bSgTsktvRry_GjeBppttmGT4rw Message-ID: Subject: Re: svn commit: r324099 - in head: share/mk sys/boot To: Wojciech Macek 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.25 Precedence: list List-Id: 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, 28 Feb 2018 15:02:05 -0000 On 29 September 2017 at 02:36, Wojciech Macek wrote: > Author: wma > Date: Fri Sep 29 06:36:19 2017 > New Revision: 324099 > URL: https://svnweb.freebsd.org/changeset/base/324099 > > Log: > Compile loader as Little-Endian on PPC64/POWER8 This is missing a description file in tools/build/options; generating src.conf.5 reports "no description found for WITH_LOADER_FORCE_LE" (as well as 5 other missing descriptions and a number of duplicate options in mips and riscv). From owner-svn-src-head@freebsd.org Wed Feb 28 15:02:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88D20F2C812; Wed, 28 Feb 2018 15:02:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2997AFD0; Wed, 28 Feb 2018 15:02:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E72D1B0D6; Wed, 28 Feb 2018 15:02:28 +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 w1SF2Sp0063680; Wed, 28 Feb 2018 15:02:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SF2R0X063679; Wed, 28 Feb 2018 15:02:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802281502.w1SF2R0X063679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 28 Feb 2018 15:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330111 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 330111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:02:28 -0000 Author: andrew Date: Wed Feb 28 15:02:27 2018 New Revision: 330111 URL: https://svnweb.freebsd.org/changeset/base/330111 Log: The Arm pl011 driver assumes it's running a devicetree based system. It calls OF_* functions to check if it needs to implement workarounds. This may not be the case on arm64 where we support both FDT and ACPI. Fix this by checking if we are booting on FDT before calling these checks. Reviewed by: ian Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Differential Revision: https://reviews.freebsd.org/D14515 Modified: head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Wed Feb 28 14:57:45 2018 (r330110) +++ head/sys/dev/uart/uart_dev_pl011.c Wed Feb 28 15:02:27 2018 (r330111) @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include +#include #include #include @@ -56,6 +58,14 @@ __FBSDID("$FreeBSD$"); #include +#ifdef __aarch64__ +#define IS_FDT (arm64_bus_method == ARM64_BUS_FDT) +#elif defined(FDT) +#define IS_FDT 1 +#else +#error Unsupported configuration +#endif + /* PL011 UART registers and masks*/ #define UART_DR 0x00 /* Data register */ #define DR_FE (1 << 8) /* Framing error */ @@ -447,11 +457,10 @@ uart_pl011_bus_param(struct uart_softc *sc, int baudra return (0); } +#ifdef FDT static int -uart_pl011_bus_probe(struct uart_softc *sc) +uart_pl011_bus_hwrev_fdt(struct uart_softc *sc) { - uint8_t hwrev; -#ifdef FDT pcell_t node; uint32_t periphid; @@ -467,19 +476,32 @@ uart_pl011_bus_probe(struct uart_softc *sc) */ if (ofw_bus_is_compatible(sc->sc_dev, "brcm,bcm2835-pl011") || ofw_bus_is_compatible(sc->sc_dev, "broadcom,bcm2835-uart")) { - hwrev = 2; + return (2); } else { node = ofw_bus_get_node(sc->sc_dev); if (OF_getencprop(node, "arm,primecell-periphid", &periphid, sizeof(periphid)) > 0) { - hwrev = (periphid >> 20) & 0x0f; - } else { - hwrev = __uart_getreg(&sc->sc_bas, UART_PIDREG_2) >> 4; + return ((periphid >> 20) & 0x0f); } } -#else - hwrev = __uart_getreg(&sc->sc_bas, UART_PIDREG_2) >> 4; + + return (-1); +} #endif + +static int +uart_pl011_bus_probe(struct uart_softc *sc) +{ + int hwrev; + + hwrev = -1; +#ifdef FDT + if (IS_FDT) + hwrev = uart_pl011_bus_hwrev_fdt(sc); +#endif + if (hwrev < 0) + hwrev = __uart_getreg(&sc->sc_bas, UART_PIDREG_2) >> 4; + if (hwrev <= 2) { sc->sc_rxfifosz = FIFO_RX_SIZE_R2; sc->sc_txfifosz = FIFO_TX_SIZE_R2; From owner-svn-src-head@freebsd.org Wed Feb 28 15:03:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95F5CF2C9FF; Wed, 28 Feb 2018 15:03:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A6747B1B9; Wed, 28 Feb 2018 15:03:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 051D41B0F2; Wed, 28 Feb 2018 15:03:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SF3ri2064671; Wed, 28 Feb 2018 15:03:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SF3r5U064670; Wed, 28 Feb 2018 15:03:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802281503.w1SF3r5U064670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Feb 2018 15:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330112 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 330112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:03:54 -0000 Author: emaste Date: Wed Feb 28 15:03:53 2018 New Revision: 330112 URL: https://svnweb.freebsd.org/changeset/base/330112 Log: Regen src.conf.5 after r330110 (WITH_KERNEL_RETPOLINE) As a bonus also includes the LUA loader description. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Feb 28 15:02:27 2018 (r330111) +++ head/share/man/man5/src.conf.5 Wed Feb 28 15:03:53 2018 (r330112) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 9, 2018 +.Dd February 28, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -880,6 +880,9 @@ Set to build some programs without Kerberos support, l .Xr sshd 8 , and .Xr telnetd 8 . +.It Va WITH_KERNEL_RETPOLINE +Set to enable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. .It Va WITHOUT_KERNEL_SYMBOLS Set to not install kernel symbol files. .Bf -symbolic @@ -1019,6 +1022,8 @@ Enable firewire support in /boot/loader and /boot/zfsl This option is a nop on all other platforms. .It Va WITHOUT_LOADER_GELI Disable inclusion of GELI crypto support in the boot chain binaries. +.It Va WITH_LOADER_LUA +Set to build LUA bindings for the boot loader. .It Va WITHOUT_LOCALES Set to not build localization files; see .Xr locale 1 . From owner-svn-src-head@freebsd.org Wed Feb 28 15:17:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C50A2F2D970; Wed, 28 Feb 2018 15:17:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 421F87CA7B; Wed, 28 Feb 2018 15:17:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1SFH7Ox020665; Wed, 28 Feb 2018 07:17:07 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1SFH7oA020664; Wed, 28 Feb 2018 07:17:07 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802281517.w1SFH7oA020664@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330105 - head/etc/rc.d In-Reply-To: <201802280853.w1S8r72H079419@repo.freebsd.org> To: Kristof Provost Date: Wed, 28 Feb 2018 07:17:07 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:17:12 -0000 > Author: kp > Date: Wed Feb 28 08:53:07 2018 > New Revision: 330105 > URL: https://svnweb.freebsd.org/changeset/base/330105 > > Log: > pf: Do not flush on reload > > pfctl only takes the last '-F' argument into account, so this never did what > was intended. > > Moreover, there is no reason to flush rules before reloading, because pf keeps > track of the rule which created a given state. That means that existing > connections will keep being processed according to the rule which originally > created them. Simply reloading the (new) rules suffices. The new rules will > apply to new connections. Would it be possible to wrap this in a conditional? (pf_keepexisting?) Your changing existing, and possibly expected, behavior. I say expected because I may not want those existing connections to exist any longer as I had made a mistake in my pf configuration that allowed connections I do not desire. Also RELNOTES: y as this changes security behavior. Thanks, > PR: 127814 > Submitted by: Andreas Longwitz > MFC after: 3 weeks > > Modified: > head/etc/rc.d/pf > > Modified: head/etc/rc.d/pf > ============================================================================== > --- head/etc/rc.d/pf Wed Feb 28 07:59:55 2018 (r330104) > +++ head/etc/rc.d/pf Wed Feb 28 08:53:07 2018 (r330105) > @@ -54,9 +54,6 @@ pf_reload() > { > echo "Reloading pf rules." > $pf_program -n -f "$pf_rules" || return 1 > - # Flush everything but existing state entries that way when > - # rules are read in, it doesn't break established connections. > - $pf_program -Fnat -Fqueue -Frules -FSources -Finfo -FTables -Fosfp > /dev/null 2>&1 > $pf_program -f "$pf_rules" $pf_flags > } > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Feb 28 15:18:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4A11F2DB54; Wed, 28 Feb 2018 15:18:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 798377CC2D; Wed, 28 Feb 2018 15:18:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FDF01B29B; Wed, 28 Feb 2018 15:18:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SFIVxH072326; Wed, 28 Feb 2018 15:18:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SFIVkA072325; Wed, 28 Feb 2018 15:18:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802281518.w1SFIVkA072325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 28 Feb 2018 15:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330113 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 330113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:18:31 -0000 Author: andrew Date: Wed Feb 28 15:18:31 2018 New Revision: 330113 URL: https://svnweb.freebsd.org/changeset/base/330113 Log: Only check the ProducerConsumer flag on extended memory. As per the ACPI 6.0 spec 6.4.3.5 bit 0 is ignored on QWord, DWord, and Word Address Space Descriptors, but not Extended Address Space Descriptors. Reviewed by: jhb Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Differential Revision: https://reviews.freebsd.org/D14516 Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Wed Feb 28 15:03:53 2018 (r330112) +++ head/sys/dev/acpica/acpi_resource.c Wed Feb 28 15:18:31 2018 (r330113) @@ -342,7 +342,8 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context) } if (length <= 0) break; - if (res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { + if (res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 && + res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored %s %s producer\n", name, acpi_address_range_name(res->Data.Address.ResourceType))); From owner-svn-src-head@freebsd.org Wed Feb 28 15:25:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDA64F2E366; Wed, 28 Feb 2018 15:25:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89AA57D251; Wed, 28 Feb 2018 15:25:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DA681B42F; Wed, 28 Feb 2018 15:25:47 +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 w1SFPlwl077138; Wed, 28 Feb 2018 15:25:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SFPloF077137; Wed, 28 Feb 2018 15:25:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802281525.w1SFPloF077137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 28 Feb 2018 15:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330114 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:25:48 -0000 Author: andrew Date: Wed Feb 28 15:25:47 2018 New Revision: 330114 URL: https://svnweb.freebsd.org/changeset/base/330114 Log: Count the number of GIC redistributors in the ACPI tables. The GICv3 driver needs this to allocate memory, and connect the CPUs to the interrupt controller. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gic_v3_acpi.c Modified: head/sys/arm64/arm64/gic_v3_acpi.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_acpi.c Wed Feb 28 15:18:31 2018 (r330113) +++ head/sys/arm64/arm64/gic_v3_acpi.c Wed Feb 28 15:25:47 2018 (r330114) @@ -206,7 +206,42 @@ gic_v3_acpi_probe(device_t dev) return (BUS_PROBE_NOWILDCARD); } +static void +madt_count_redistrib(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + struct gic_v3_softc *sc = arg; + + if (entry->Type == ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR) + sc->gic_redists.nregions++; +} + static int +gic_v3_acpi_count_regions(device_t dev) +{ + struct gic_v3_softc *sc; + ACPI_TABLE_MADT *madt; + vm_paddr_t physaddr; + + sc = device_get_softc(dev); + + physaddr = acpi_find_table(ACPI_SIG_MADT); + if (physaddr == 0) + return (ENXIO); + + madt = acpi_map_table(physaddr, ACPI_SIG_MADT); + if (madt == NULL) { + device_printf(dev, "Unable to map the MADT\n"); + return (ENXIO); + } + + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + madt_count_redistrib, sc); + acpi_unmap_table(madt); + + return (sc->gic_redists.nregions > 0 ? 0 : ENXIO); +} + +static int gic_v3_acpi_attach(device_t dev) { struct gic_v3_softc *sc; @@ -216,8 +251,9 @@ gic_v3_acpi_attach(device_t dev) sc->dev = dev; sc->gic_bus = GIC_BUS_ACPI; - /* TODO: Count these correctly */ - sc->gic_redists.nregions = 1; + err = gic_v3_acpi_count_regions(dev); + if (err != 0) + goto error; err = gic_v3_attach(dev); if (err != 0) From owner-svn-src-head@freebsd.org Wed Feb 28 15:27:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E917F2E679; Wed, 28 Feb 2018 15:27:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6C137D41D; Wed, 28 Feb 2018 15:27:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD7E41B430; Wed, 28 Feb 2018 15:27:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SFRaxL077246; Wed, 28 Feb 2018 15:27:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SFRats077245; Wed, 28 Feb 2018 15:27:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281527.w1SFRats077245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 15:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330115 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 330115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:27:37 -0000 Author: kevans Date: Wed Feb 28 15:27:36 2018 New Revision: 330115 URL: https://svnweb.freebsd.org/changeset/base/330115 Log: Add missing WITH_BSD_GREP_FASTMATCH description MFC after: 3 days Added: head/tools/build/options/WITH_BSD_GREP_FASTMATCH (contents, props changed) Added: head/tools/build/options/WITH_BSD_GREP_FASTMATCH ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BSD_GREP_FASTMATCH Wed Feb 28 15:27:36 2018 (r330115) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set this option to use the fastmatch implementation in +.Xr bsdgrep 1 . From owner-svn-src-head@freebsd.org Wed Feb 28 15:28:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A674FF2E706; Wed, 28 Feb 2018 15:28:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20B8A7D554; Wed, 28 Feb 2018 15:28:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BBA11B431; Wed, 28 Feb 2018 15:28:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SFS4X3077311; Wed, 28 Feb 2018 15:28:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SFS4gx077308; Wed, 28 Feb 2018 15:28:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281528.w1SFS4gx077308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 15:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330116 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 330116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:28:05 -0000 Author: kevans Date: Wed Feb 28 15:28:04 2018 New Revision: 330116 URL: https://svnweb.freebsd.org/changeset/base/330116 Log: Some missing LOADER_EFI build option descriptions Added: head/tools/build/options/WITHOUT_LOADER_EFI (contents, props changed) head/tools/build/options/WITH_LOADER_EFI (contents, props changed) Added: head/tools/build/options/WITHOUT_LOADER_EFI ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_EFI Wed Feb 28 15:28:04 2018 (r330116) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to disable building of EFI bootloader components Added: head/tools/build/options/WITH_LOADER_EFI ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_EFI Wed Feb 28 15:28:04 2018 (r330116) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build EFI bootloader components From owner-svn-src-head@freebsd.org Wed Feb 28 15:45:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34131F2FA44; Wed, 28 Feb 2018 15:45:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6EBC7E5C0; Wed, 28 Feb 2018 15:45:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD53C1B775; Wed, 28 Feb 2018 15:45:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SFjE0a087587; Wed, 28 Feb 2018 15:45:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SFjExR087586; Wed, 28 Feb 2018 15:45:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281545.w1SFjExR087586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 15:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330117 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 330117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:45:15 -0000 Author: kevans Date: Wed Feb 28 15:45:14 2018 New Revision: 330117 URL: https://svnweb.freebsd.org/changeset/base/330117 Log: Regenerate src.conf(5) after r330115 and r330116 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Feb 28 15:28:04 2018 (r330116) +++ head/share/man/man5/src.conf.5 Wed Feb 28 15:45:14 2018 (r330117) @@ -219,6 +219,9 @@ Set to not build the BSD licensed version of cpio base .Xr libarchive 3 . .It Va WITH_BSD_GREP Install BSD-licensed grep as '[ef]grep' instead of GNU grep. +.It Va WITH_BSD_GREP_FASTMATCH +Set this option to use the fastmatch implementation in +.Xr bsdgrep 1 . .It Va WITHOUT_BSNMP Set to not build or install .Xr bsnmpd 1 @@ -1017,6 +1020,16 @@ Set to use LLVM's libunwind stack unwinder (instead of .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +.It Va WITHOUT_LOADER_EFI +Set to disable building of EFI bootloader components +.Pp +This is a default setting on +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LOADER_EFI +Set to build EFI bootloader components +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader and /boot/zfsloader on x86. This option is a nop on all other platforms. From owner-svn-src-head@freebsd.org Wed Feb 28 15:47:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9957BF2FC70; Wed, 28 Feb 2018 15:47:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484F17E7A7; Wed, 28 Feb 2018 15:47:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EBB71B776; Wed, 28 Feb 2018 15:47:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SFlO6l087708; Wed, 28 Feb 2018 15:47:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SFlOJn087706; Wed, 28 Feb 2018 15:47:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281547.w1SFlOJn087706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 15:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330118 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 330118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:47:25 -0000 Author: kevans Date: Wed Feb 28 15:47:24 2018 New Revision: 330118 URL: https://svnweb.freebsd.org/changeset/base/330118 Log: Add missing punctuation to *_LOADER_EFI descriptions... Modified: head/tools/build/options/WITHOUT_LOADER_EFI head/tools/build/options/WITH_LOADER_EFI Modified: head/tools/build/options/WITHOUT_LOADER_EFI ============================================================================== --- head/tools/build/options/WITHOUT_LOADER_EFI Wed Feb 28 15:45:14 2018 (r330117) +++ head/tools/build/options/WITHOUT_LOADER_EFI Wed Feb 28 15:47:24 2018 (r330118) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to disable building of EFI bootloader components +Set to disable building of EFI bootloader components. Modified: head/tools/build/options/WITH_LOADER_EFI ============================================================================== --- head/tools/build/options/WITH_LOADER_EFI Wed Feb 28 15:45:14 2018 (r330117) +++ head/tools/build/options/WITH_LOADER_EFI Wed Feb 28 15:47:24 2018 (r330118) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to build EFI bootloader components +Set to build EFI bootloader components. From owner-svn-src-head@freebsd.org Wed Feb 28 15:48:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86884F2FD1F; Wed, 28 Feb 2018 15:48:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34F9C7E926; Wed, 28 Feb 2018 15:48:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F6DC1B784; Wed, 28 Feb 2018 15:48:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SFm9TZ087781; Wed, 28 Feb 2018 15:48:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SFm9VR087780; Wed, 28 Feb 2018 15:48:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281548.w1SFm9VR087780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 15:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330119 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 330119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 15:48:09 -0000 Author: kevans Date: Wed Feb 28 15:48:08 2018 New Revision: 330119 URL: https://svnweb.freebsd.org/changeset/base/330119 Log: Regenerate src.conf(5) after r330118 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Feb 28 15:47:24 2018 (r330118) +++ head/share/man/man5/src.conf.5 Wed Feb 28 15:48:08 2018 (r330119) @@ -1021,12 +1021,12 @@ Set to use LLVM's libunwind stack unwinder (instead of This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_EFI -Set to disable building of EFI bootloader components +Set to disable building of EFI bootloader components. .Pp This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LOADER_EFI -Set to build EFI bootloader components +Set to build EFI bootloader components. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. From owner-svn-src-head@freebsd.org Wed Feb 28 16:03:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36461F313CC; Wed, 28 Feb 2018 16:03:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCDB08039B; Wed, 28 Feb 2018 16:03:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7D211BACE; Wed, 28 Feb 2018 16:03:40 +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 w1SG3e5P099775; Wed, 28 Feb 2018 16:03:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SG3elu099774; Wed, 28 Feb 2018 16:03:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201802281603.w1SG3elu099774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 28 Feb 2018 16:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330120 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 16:03:41 -0000 Author: andrew Date: Wed Feb 28 16:03:40 2018 New Revision: 330120 URL: https://svnweb.freebsd.org/changeset/base/330120 Log: Allow releasing APs to take more time, as long as we are making progress. On large core count machines this can be slow while all the CPUs update the online counter. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Wed Feb 28 15:48:08 2018 (r330119) +++ head/sys/arm64/arm64/mp_machdep.c Wed Feb 28 16:03:40 2018 (r330120) @@ -221,7 +221,7 @@ arm64_cpu_attach(device_t dev) static void release_aps(void *dummy __unused) { - int i; + int i, started; /* Only release CPUs if they exist */ if (mp_ncpus == 1) @@ -241,11 +241,22 @@ release_aps(void *dummy __unused) "sev \n" ::: "memory"); - printf("Release APs\n"); + printf("Release APs..."); + started = 0; for (i = 0; i < 2000; i++) { - if (smp_started) + if (smp_started) { + printf("done\n"); return; + } + /* + * Don't time out while we are making progress. Some large + * systems can take a while to start all CPUs. + */ + if (smp_cpus > started) { + i = 0; + started = smp_cpus; + } DELAY(1000); } From owner-svn-src-head@freebsd.org Wed Feb 28 16:08:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ED39F3188B; Wed, 28 Feb 2018 16:08:43 +0000 (UTC) (envelope-from srs0=awtu=fw=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EA708080D; Wed, 28 Feb 2018 16:08:43 +0000 (UTC) (envelope-from srs0=awtu=fw=freebsd.org=kp@codepro.be) Received: from [192.168.26.135] (254.158.dhcp.conference.apricot.net [220.247.158.254]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 70D0E2CAB1; Wed, 28 Feb 2018 17:08:40 +0100 (CET) From: "Kristof Provost" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330105 - head/etc/rc.d Date: Wed, 28 Feb 2018 21:53:36 +0545 X-Mailer: MailMate (2.0BETAr6104) Message-ID: <8D4597D0-8B68-42FA-85FB-907655DA19E7@FreeBSD.org> In-Reply-To: <201802281517.w1SFH7oA020664@pdx.rh.CN85.dnsmgr.net> References: <201802281517.w1SFH7oA020664@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 16:08:43 -0000 On 28 Feb 2018, at 21:02, Rodney W. Grimes wrote: >> Author: kp >> Date: Wed Feb 28 08:53:07 2018 >> New Revision: 330105 >> URL: https://svnweb.freebsd.org/changeset/base/330105 >> >> Log: >> pf: Do not flush on reload >> >> pfctl only takes the last '-F' argument into account, so this never >> did what >> was intended. >> >> Moreover, there is no reason to flush rules before reloading, >> because pf keeps >> track of the rule which created a given state. That means that >> existing >> connections will keep being processed according to the rule which >> originally >> created them. Simply reloading the (new) rules suffices. The new >> rules will >> apply to new connections. > > Would it be possible to wrap this in a conditional? (pf_keepexisting?) > Your changing existing, and possibly expected, behavior. > I say expected because I may not want those existing connections to > exist any longer as I had made a mistake in my pf configuration that > allowed connections I do not desire. > Keeping connections on reload (note, reload != restart) is not new behaviour. This has not changed. The deleted line attempted to flush nat, queue, rules, Sources, info, Tables and osfp. It only ever flushed osfp because pfctl only took the last -F into account. Regards, Kristof From owner-svn-src-head@freebsd.org Wed Feb 28 16:19:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B97BAF3230D; Wed, 28 Feb 2018 16:19:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4E6C80EA5; Wed, 28 Feb 2018 16:19:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1SGJGAl020977; Wed, 28 Feb 2018 08:19:16 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1SGJGPD020976; Wed, 28 Feb 2018 08:19:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802281619.w1SGJGPD020976@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330105 - head/etc/rc.d In-Reply-To: <8D4597D0-8B68-42FA-85FB-907655DA19E7@FreeBSD.org> To: Kristof Provost Date: Wed, 28 Feb 2018 08:19:16 -0800 (PST) CC: rgrimes@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 16:19:27 -0000 > On 28 Feb 2018, at 21:02, Rodney W. Grimes wrote: > >> Author: kp > >> Date: Wed Feb 28 08:53:07 2018 > >> New Revision: 330105 > >> URL: https://svnweb.freebsd.org/changeset/base/330105 > >> > >> Log: > >> pf: Do not flush on reload > >> > >> pfctl only takes the last '-F' argument into account, so this never > >> did what > >> was intended. > >> > >> Moreover, there is no reason to flush rules before reloading, > >> because pf keeps > >> track of the rule which created a given state. That means that > >> existing > >> connections will keep being processed according to the rule which > >> originally > >> created them. Simply reloading the (new) rules suffices. The new > >> rules will > >> apply to new connections. > > > > Would it be possible to wrap this in a conditional? (pf_keepexisting?) > > Your changing existing, and possibly expected, behavior. > > I say expected because I may not want those existing connections to > > exist any longer as I had made a mistake in my pf configuration that > > allowed connections I do not desire. > > > Keeping connections on reload (note, reload != restart) is not new > behaviour. > This has not changed. It has, minorly, in that OSPF connections are not dropped now, but if thats the only change I'll live with the change. > The deleted line attempted to flush nat, queue, rules, Sources, info, > Tables and osfp. It only ever flushed osfp because pfctl only took the > last -F into account. So might it be better to correct what it was attempting to do, and wrap that in a conditional? I may or may not want this to exist after a reload, and that should be my option, alternative is for me to either edit this file, or write my own. Or having to execute a bunch of -F commands by hand. It was clearly the intent of the original author to have these flushed, fixing the mistake by removing the flushes is one way to fix it. I am asking for consideration on that there is another desired solution, and that both can exist with a simple knob. > Regards, > Kristof -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Feb 28 16:24:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 102AAF32A83; Wed, 28 Feb 2018 16:24:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6EBF81564; Wed, 28 Feb 2018 16:24: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 978771BE0D; Wed, 28 Feb 2018 16:24:33 +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 w1SGOXtk009932; Wed, 28 Feb 2018 16:24:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SGOXJX009927; Wed, 28 Feb 2018 16:24:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802281624.w1SGOXJX009927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 28 Feb 2018 16:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330121 - in head: share/man/man4 sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/isp X-SVN-Commit-Revision: 330121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 16:24:34 -0000 Author: mav Date: Wed Feb 28 16:24:32 2018 New Revision: 330121 URL: https://svnweb.freebsd.org/changeset/base/330121 Log: Add support for Enhanced Gen 5 (16Gb) and Gen 6 (32Gb) QLogic FC HBAs. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/share/man/man4/isp.4 head/sys/dev/isp/isp.c head/sys/dev/isp/isp_pci.c head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispvar.h Modified: head/share/man/man4/isp.4 ============================================================================== --- head/share/man/man4/isp.4 Wed Feb 28 16:03:40 2018 (r330120) +++ head/share/man/man4/isp.4 Wed Feb 28 16:24:32 2018 (r330121) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009-2017 Alexander Motin +.\" Copyright (c) 2009-2018 Alexander Motin .\" Copyright (c) 2006 Marcus Alves Grando .\" Copyright (c) 1998-2001 Matthew Jacob, for NASA/Ames Research Center .\" @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2017 +.Dd February 27, 2018 .Dt ISP 4 .Os .Sh NAME @@ -139,6 +139,10 @@ Optical 4Gb Fibre Channel PCIe cards. Optical 8Gb Fibre Channel PCIe cards. .It Qlogic 267x/836x (aka 2031/8031) Optical 16Gb FC/FCoE PCIe cards. +.It Qlogic 2690/2692/2694 (aka 2684/2692) +Optical 16Gb Fibre Channel PCIe cards. +.It Qlogic 2740/2742/2764 (aka 2722/2714) +Optical 32Gb Fibre Channel PCIe cards. .El .Sh CONFIGURATION OPTIONS Target mode support for Fibre Channel adapters may be enabled with the Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Wed Feb 28 16:03:40 2018 (r330120) +++ head/sys/dev/isp/isp.c Wed Feb 28 16:24:32 2018 (r330121) @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2009-2017 Alexander Motin + * Copyright (c) 2009-2018 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -226,8 +226,11 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) btype = "2532"; break; case ISP_HA_FC_2600: - btype = "2031"; + btype = "2600"; break; + case ISP_HA_FC_2700: + btype = "2700"; + break; default: break; } @@ -2020,7 +2023,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) } icbp->icb_execthrottle = DEFAULT_EXEC_THROTTLE(isp); - if (icbp->icb_execthrottle < 1) { + if (icbp->icb_execthrottle < 1 && !IS_26XX(isp)) { isp_prt(isp, ISP_LOGERR, "bad execution throttle of %d- using %d", DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); icbp->icb_execthrottle = ICB_DFLT_THROTTLE; } @@ -2125,11 +2128,15 @@ isp_fibre_init_2400(ispsoftc_t *isp) } else if (isp->isp_confopts & ISP_CFG_16GB) { icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK; icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_16GB; + } else if (isp->isp_confopts & ISP_CFG_32GB) { + icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK; + icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_32GB; } else { switch (icbp->icb_fwoptions3 & ICB2400_OPT3_RATE_MASK) { case ICB2400_OPT3_RATE_4GB: case ICB2400_OPT3_RATE_8GB: case ICB2400_OPT3_RATE_16GB: + case ICB2400_OPT3_RATE_32GB: case ICB2400_OPT3_RATE_AUTO: break; case ICB2400_OPT3_RATE_2GB: @@ -3094,6 +3101,8 @@ not_on_fabric: if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { if (mbs.param[1] == MBGSD_10GB) fcp->isp_gbspeed = 10; + else if (mbs.param[1] == MBGSD_32GB) + fcp->isp_gbspeed = 32; else if (mbs.param[1] == MBGSD_16GB) fcp->isp_gbspeed = 16; else if (mbs.param[1] == MBGSD_8GB) @@ -5902,6 +5911,13 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox) isp_prt(isp, ISP_LOGERR, "Temperature alert (subcode 0x%x)", ISP_READ(isp, OUTMAILBOX1)); break; + case ASYNC_TRANSCEIVER_INSERTION: + isp_prt(isp, ISP_LOGDEBUG0, "Transceiver insertion (0x%x)", + ISP_READ(isp, OUTMAILBOX1)); + break; + case ASYNC_TRANSCEIVER_REMOVAL: + isp_prt(isp, ISP_LOGDEBUG0, "Transceiver removal"); + break; case ASYNC_AUTOLOAD_FW_COMPLETE: isp_prt(isp, ISP_LOGDEBUG0, "Autoload FW init complete"); break; @@ -6826,7 +6842,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x07, 0x01), /* 0x66: MBOX_TARGET_RESET */ ISP_FC_OPMAP(0x07, 0x01), /* 0x67: MBOX_CLEAR_TASK_SET */ ISP_FC_OPMAP(0x07, 0x01), /* 0x68: MBOX_ABORT_TASK_SET */ - ISP_FC_OPMAP(0x01, 0x07), /* 0x69: MBOX_GET_FW_STATE */ + ISP_FC_OPMAP_HALF(0x00, 0x01, 0x0f, 0x1f), /* 0x69: MBOX_GET_FW_STATE */ ISP_FC_OPMAP_HALF(0x6, 0x03, 0x0, 0xcf), /* 0x6a: MBOX_GET_PORT_NAME */ ISP_FC_OPMAP(0xcf, 0x01), /* 0x6b: MBOX_GET_LINK_STATUS */ ISP_FC_OPMAP(0x0f, 0x01), /* 0x6c: MBOX_INIT_LIP_RESET */ Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Wed Feb 28 16:03:40 2018 (r330120) +++ head/sys/dev/isp/isp_pci.c Wed Feb 28 16:24:32 2018 (r330121) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2009-2018 Alexander Motin * Copyright (c) 1997-2008 by Matthew Jacob * All rights reserved. * @@ -177,6 +178,17 @@ static struct ispmdvec mdvec_2600 = { NULL }; +static struct ispmdvec mdvec_2700 = { + isp_pci_run_isr_2400, + isp_pci_rd_reg_2600, + isp_pci_wr_reg_2600, + isp_pci_mbxdma, + isp_pci_dmasetup, + isp_common_dmateardown, + isp_pci_irqsetup, + NULL +}; + #ifndef PCIM_CMD_INVEN #define PCIM_CMD_INVEN 0x10 #endif @@ -209,142 +221,80 @@ static struct ispmdvec mdvec_2600 = { #define PCIR_ROMADDR 0x30 #endif -#ifndef PCI_VENDOR_QLOGIC #define PCI_VENDOR_QLOGIC 0x1077 -#endif -#ifndef PCI_PRODUCT_QLOGIC_ISP1020 #define PCI_PRODUCT_QLOGIC_ISP1020 0x1020 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP1080 #define PCI_PRODUCT_QLOGIC_ISP1080 0x1080 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP10160 #define PCI_PRODUCT_QLOGIC_ISP10160 0x1016 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP12160 #define PCI_PRODUCT_QLOGIC_ISP12160 0x1216 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP1240 #define PCI_PRODUCT_QLOGIC_ISP1240 0x1240 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP1280 #define PCI_PRODUCT_QLOGIC_ISP1280 0x1280 -#endif -#ifndef PCI_PRODUCT_QLOGIC_ISP2100 #define PCI_PRODUCT_QLOGIC_ISP2100 0x2100 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP2200 #define PCI_PRODUCT_QLOGIC_ISP2200 0x2200 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP2300 #define PCI_PRODUCT_QLOGIC_ISP2300 0x2300 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP2312 #define PCI_PRODUCT_QLOGIC_ISP2312 0x2312 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP2322 #define PCI_PRODUCT_QLOGIC_ISP2322 0x2322 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP2422 #define PCI_PRODUCT_QLOGIC_ISP2422 0x2422 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP2432 #define PCI_PRODUCT_QLOGIC_ISP2432 0x2432 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP2532 #define PCI_PRODUCT_QLOGIC_ISP2532 0x2532 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP6312 +#define PCI_PRODUCT_QLOGIC_ISP5432 0x5432 #define PCI_PRODUCT_QLOGIC_ISP6312 0x6312 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP6322 #define PCI_PRODUCT_QLOGIC_ISP6322 0x6322 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP5432 -#define PCI_PRODUCT_QLOGIC_ISP5432 0x5432 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP2031 #define PCI_PRODUCT_QLOGIC_ISP2031 0x2031 -#endif - -#ifndef PCI_PRODUCT_QLOGIC_ISP8031 #define PCI_PRODUCT_QLOGIC_ISP8031 0x8031 -#endif +#define PCI_PRODUCT_QLOGIC_ISP2684 0x2171 +#define PCI_PRODUCT_QLOGIC_ISP2692 0x2b61 +#define PCI_PRODUCT_QLOGIC_ISP2714 0x2071 +#define PCI_PRODUCT_QLOGIC_ISP2722 0x2261 -#define PCI_QLOGIC_ISP5432 \ - ((PCI_PRODUCT_QLOGIC_ISP5432 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP1020 \ ((PCI_PRODUCT_QLOGIC_ISP1020 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP1080 \ ((PCI_PRODUCT_QLOGIC_ISP1080 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP10160 \ ((PCI_PRODUCT_QLOGIC_ISP10160 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP12160 \ ((PCI_PRODUCT_QLOGIC_ISP12160 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP1240 \ ((PCI_PRODUCT_QLOGIC_ISP1240 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP1280 \ ((PCI_PRODUCT_QLOGIC_ISP1280 << 16) | PCI_VENDOR_QLOGIC) #define PCI_QLOGIC_ISP2100 \ ((PCI_PRODUCT_QLOGIC_ISP2100 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP2200 \ ((PCI_PRODUCT_QLOGIC_ISP2200 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP2300 \ ((PCI_PRODUCT_QLOGIC_ISP2300 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP2312 \ ((PCI_PRODUCT_QLOGIC_ISP2312 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP2322 \ ((PCI_PRODUCT_QLOGIC_ISP2322 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP2422 \ ((PCI_PRODUCT_QLOGIC_ISP2422 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP2432 \ ((PCI_PRODUCT_QLOGIC_ISP2432 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP2532 \ ((PCI_PRODUCT_QLOGIC_ISP2532 << 16) | PCI_VENDOR_QLOGIC) - +#define PCI_QLOGIC_ISP5432 \ + ((PCI_PRODUCT_QLOGIC_ISP5432 << 16) | PCI_VENDOR_QLOGIC) #define PCI_QLOGIC_ISP6312 \ ((PCI_PRODUCT_QLOGIC_ISP6312 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP6322 \ ((PCI_PRODUCT_QLOGIC_ISP6322 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP2031 \ ((PCI_PRODUCT_QLOGIC_ISP2031 << 16) | PCI_VENDOR_QLOGIC) - #define PCI_QLOGIC_ISP8031 \ ((PCI_PRODUCT_QLOGIC_ISP8031 << 16) | PCI_VENDOR_QLOGIC) +#define PCI_QLOGIC_ISP2684 \ + ((PCI_PRODUCT_QLOGIC_ISP2684 << 16) | PCI_VENDOR_QLOGIC) +#define PCI_QLOGIC_ISP2692 \ + ((PCI_PRODUCT_QLOGIC_ISP2692 << 16) | PCI_VENDOR_QLOGIC) +#define PCI_QLOGIC_ISP2714 \ + ((PCI_PRODUCT_QLOGIC_ISP2714 << 16) | PCI_VENDOR_QLOGIC) +#define PCI_QLOGIC_ISP2722 \ + ((PCI_PRODUCT_QLOGIC_ISP2722 << 16) | PCI_VENDOR_QLOGIC) /* * Odd case for some AMI raid cards... We need to *not* attach to this. @@ -464,6 +414,18 @@ isp_pci_probe(device_t dev) case PCI_QLOGIC_ISP8031: device_set_desc(dev, "Qlogic ISP 8031 PCI FCoE Adapter"); break; + case PCI_QLOGIC_ISP2684: + device_set_desc(dev, "Qlogic ISP 2684 PCI FC Adapter"); + break; + case PCI_QLOGIC_ISP2692: + device_set_desc(dev, "Qlogic ISP 2692 PCI FC Adapter"); + break; + case PCI_QLOGIC_ISP2714: + device_set_desc(dev, "Qlogic ISP 2714 PCI FC Adapter"); + break; + case PCI_QLOGIC_ISP2722: + device_set_desc(dev, "Qlogic ISP 2722 PCI FC Adapter"); + break; default: return (ENXIO); } @@ -809,6 +771,16 @@ isp_pci_attach(device_t dev) isp->isp_nchan += isp_nvports; isp->isp_mdvec = &mdvec_2600; isp->isp_type = ISP_HA_FC_2600; + pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF; + break; + case PCI_QLOGIC_ISP2684: + case PCI_QLOGIC_ISP2692: + case PCI_QLOGIC_ISP2714: + case PCI_QLOGIC_ISP2722: + did = 0x2700; + isp->isp_nchan += isp_nvports; + isp->isp_mdvec = &mdvec_2700; + isp->isp_type = ISP_HA_FC_2700; pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF; break; default: Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Wed Feb 28 16:03:40 2018 (r330120) +++ head/sys/dev/isp/ispmbox.h Wed Feb 28 16:24:32 2018 (r330121) @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2009-2017 Alexander Motin + * Copyright (c) 2009-2018 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -178,6 +178,7 @@ #define MBGSD_4GB 0x03 /* 24XX only */ #define MBGSD_8GB 0x04 /* 25XX only */ #define MBGSD_16GB 0x05 /* 26XX only */ +#define MBGSD_32GB 0x06 /* 27XX only */ #define MBGSD_10GB 0x13 /* 26XX only */ #define MBOX_SEND_RNFT 0x005e #define MBOX_INIT_FIRMWARE 0x0060 @@ -299,6 +300,8 @@ #define ASYNC_INTER_DRIVER_COMP 0x8100 /* FCoE only */ #define ASYNC_INTER_DRIVER_NOTIFY 0x8101 /* FCoE only */ #define ASYNC_INTER_DRIVER_TIME_EXT 0x8102 /* FCoE only */ +#define ASYNC_TRANSCEIVER_INSERTION 0x8130 +#define ASYNC_TRANSCEIVER_REMOVAL 0x8131 #define ASYNC_NIC_FW_STATE_CHANGE 0x8200 /* FCoE only */ #define ASYNC_AUTOLOAD_FW_COMPLETE 0x8400 #define ASYNC_AUTOLOAD_FW_FAILURE 0x8401 @@ -1072,6 +1075,7 @@ typedef struct { #define ICB2400_OPT3_RATE_4GB 0x00006000 #define ICB2400_OPT3_RATE_8GB 0x00008000 #define ICB2400_OPT3_RATE_16GB 0x0000A000 +#define ICB2400_OPT3_RATE_32GB 0x0000C000 #define ICB2400_OPT3_ENA_OOF_XFRDY 0x00000200 #define ICB2400_OPT3_NO_N2N_LOGI 0x00000100 #define ICB2400_OPT3_NO_LOCAL_PLOGI 0x00000080 Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Wed Feb 28 16:03:40 2018 (r330120) +++ head/sys/dev/isp/ispvar.h Wed Feb 28 16:24:32 2018 (r330121) @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2009-2017 Alexander Motin + * Copyright (c) 2009-2018 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -633,8 +633,8 @@ struct ispsoftc { #define ISP_CFG_NPORT_ONLY 0x04 /* insist on {N/F}-Port connection */ #define ISP_CFG_LPORT 0x06 /* prefer {N/F}L-Port connection */ #define ISP_CFG_NPORT 0x08 /* prefer {N/F}-Port connection */ -#define ISP_CFG_1GB 0x10 /* force 1GB connection (23XX only) */ -#define ISP_CFG_2GB 0x20 /* force 2GB connection (23XX only) */ +#define ISP_CFG_1GB 0x10 /* force 1Gb connection (23XX only) */ +#define ISP_CFG_2GB 0x20 /* force 2Gb connection (23XX only) */ #define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ #define ISP_CFG_NONVRAM 0x40 /* ignore NVRAM */ #define ISP_CFG_NOFCTAPE 0x100 /* disable FC-Tape */ @@ -642,9 +642,10 @@ struct ispsoftc { #define ISP_CFG_OWNFSZ 0x400 /* override NVRAM frame size */ #define ISP_CFG_OWNLOOPID 0x800 /* override NVRAM loopid */ #define ISP_CFG_OWNEXCTHROTTLE 0x1000 /* override NVRAM execution throttle */ -#define ISP_CFG_4GB 0x2000 /* force 4GB connection (24XX only) */ -#define ISP_CFG_8GB 0x4000 /* force 8GB connection (25XX only) */ -#define ISP_CFG_16GB 0x8000 /* force 16GB connection (82XX only) */ +#define ISP_CFG_4GB 0x2000 /* force 4Gb connection (24XX only) */ +#define ISP_CFG_8GB 0x4000 /* force 8Gb connection (25XX only) */ +#define ISP_CFG_16GB 0x8000 /* force 16Gb connection (26XX only) */ +#define ISP_CFG_32GB 0x10000 /* force 32Gb connection (27XX only) */ /* * For each channel, the outer layers should know what role that channel @@ -745,6 +746,7 @@ struct ispsoftc { #define ISP_HA_FC_2400 0x60 #define ISP_HA_FC_2500 0x70 #define ISP_HA_FC_2600 0x80 +#define ISP_HA_FC_2700 0x90 #define IS_SCSI(isp) (isp->isp_type & ISP_HA_SCSI) #define IS_1020(isp) (isp->isp_type < ISP_HA_SCSI_1240) @@ -771,6 +773,7 @@ struct ispsoftc { #define IS_24XX(isp) ((isp)->isp_type >= ISP_HA_FC_2400) #define IS_25XX(isp) ((isp)->isp_type >= ISP_HA_FC_2500) #define IS_26XX(isp) ((isp)->isp_type >= ISP_HA_FC_2600) +#define IS_27XX(isp) ((isp)->isp_type >= ISP_HA_FC_2700) /* * DMA related macros From owner-svn-src-head@freebsd.org Wed Feb 28 16:24:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923CBF32AB0; Wed, 28 Feb 2018 16:24:39 +0000 (UTC) (envelope-from srs0=awtu=fw=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93852815AD; Wed, 28 Feb 2018 16:24:37 +0000 (UTC) (envelope-from srs0=awtu=fw=freebsd.org=kp@codepro.be) Received: from [192.168.26.135] (254.158.dhcp.conference.apricot.net [220.247.158.254]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 7359E2CB6B; Wed, 28 Feb 2018 17:24:35 +0100 (CET) From: "Kristof Provost" To: rgrimes@FreeBSD.org Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r330105 - head/etc/rc.d Date: Wed, 28 Feb 2018 22:09:31 +0545 X-Mailer: MailMate (2.0BETAr6104) Message-ID: <4EC3BE57-F14C-4CBD-ADC1-10293B96142C@FreeBSD.org> In-Reply-To: <201802281619.w1SGJGPD020976@pdx.rh.CN85.dnsmgr.net> References: <201802281619.w1SGJGPD020976@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 16:24:39 -0000 On 28 Feb 2018, at 22:04, Rodney W. Grimes wrote: > So might it be better to correct what it was attempting to do, > and wrap that in a conditional? I may or may not want this > to exist after a reload, and that should be my option, alternative > is for me to either edit this file, or write my own. Or having > to execute a bunch of -F commands by hand. > > It was clearly the intent of the original author to have these > flushed, fixing the mistake by removing the flushes is one way > to fix it. I am asking for consideration on that there is another > desired solution, and that both can exist with a simple knob. > Yes, but what was originally attempted was to keep the existing connections. This is currently the case. There’s no point to flushing anything before loading the new rules. If you want to be able to choose wether or not to keep the existing connections we could add a conditional `pfctl -F states`, but you can already accomplish this by calling `/etc/rc.d/pf restart` rather than `/etc/rc.d/pf reload`. I'm not sure it's worth adding a new knob. Regards, Kristof From owner-svn-src-head@freebsd.org Wed Feb 28 17:20:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8991F368EC; Wed, 28 Feb 2018 17:20:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78AC3839BB; Wed, 28 Feb 2018 17:20:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7289F1C609; Wed, 28 Feb 2018 17:20:10 +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 w1SHKAfQ035078; Wed, 28 Feb 2018 17:20:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SHKAH3035077; Wed, 28 Feb 2018 17:20:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802281720.w1SHKAH3035077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Feb 2018 17:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330122 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 330122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 17:20:11 -0000 Author: emaste Date: Wed Feb 28 17:20:10 2018 New Revision: 330122 URL: https://svnweb.freebsd.org/changeset/base/330122 Log: rc.d/jail: avoid misinterpreting expr arguments (Due to some misconfiguration) I ended up with _mask set to "-v", and /etc/rc.d/jail then failed with "expr: illegal option -- v". Use "expr --" so that variable content is never interpreted as an option. Reviewed by: jamie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14535 Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Wed Feb 28 16:24:32 2018 (r330121) +++ head/etc/rc.d/jail Wed Feb 28 17:20:10 2018 (r330122) @@ -316,7 +316,7 @@ jail_extract_address() # Extract the prefix/netmask/prefixlen part by cutting off the address. _mask=${_r} - _mask=`expr "${_mask}" : "${_addr}\(.*\)"` + _mask=`expr -- "${_mask}" : "${_addr}\(.*\)"` # Identify type {inet,inet6}. case "${_addr}" in @@ -366,8 +366,8 @@ jail_handle_ips_option() while [ ${#_x} -gt 0 ]; do case "${_x}" in *,*) # Extract the first argument and strip it off the list. - _i=`expr "${_x}" : '^\([^,]*\)'` - _x=`expr "${_x}" : "^[^,]*,\(.*\)"` + _i=`expr -- "${_x}" : '^\([^,]*\)'` + _x=`expr -- "${_x}" : "^[^,]*,\(.*\)"` ;; *) _i=${_x} _x="" From owner-svn-src-head@freebsd.org Wed Feb 28 19:05:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AEFEF3D9E2; Wed, 28 Feb 2018 19:05:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1014B8823D; Wed, 28 Feb 2018 19:05:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0605D1D825; Wed, 28 Feb 2018 19:05:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SJ5PmI089494; Wed, 28 Feb 2018 19:05:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SJ5PTY089493; Wed, 28 Feb 2018 19:05:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802281905.w1SJ5PTY089493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 28 Feb 2018 19:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330125 - head/sys/dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/mmc/host X-SVN-Commit-Revision: 330125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 19:05:26 -0000 Author: manu Date: Wed Feb 28 19:05:25 2018 New Revision: 330125 URL: https://svnweb.freebsd.org/changeset/base/330125 Log: dwmmc_rockchip: Add ifdefs on EXT_RESOURCES The old RK3188 kernel config uses dwmmc but isn't compiled with EXT_RESOURCES. Add ifdefs around code using EXT_RESOURCES code. Reported by: rpokala Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_rockchip.c Wed Feb 28 18:34:22 2018 (r330124) +++ head/sys/dev/mmc/host/dwmmc_rockchip.c Wed Feb 28 19:05:25 2018 (r330125) @@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef EXT_RESOURCES +#include +#endif + #include enum RKTYPE { @@ -88,11 +92,14 @@ rockchip_dwmmc_attach(device_t dev) sc->pwren_inverted = 1; +#ifdef EXT_RESOURCES sc->update_ios = &dwmmc_rockchip_update_ios; +#endif return (dwmmc_attach(dev)); } +#ifdef EXT_RESOURCES static int dwmmc_rockchip_update_ios(struct dwmmc_softc *sc, struct mmc_ios *ios) { @@ -119,6 +126,7 @@ dwmmc_rockchip_update_ios(struct dwmmc_softc *sc, stru } return (0); } +#endif static device_method_t rockchip_dwmmc_methods[] = { /* bus interface */ From owner-svn-src-head@freebsd.org Wed Feb 28 19:08:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D58EAF3DDD2; Wed, 28 Feb 2018 19:08:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8558B88575; Wed, 28 Feb 2018 19:08:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8057B1D827; Wed, 28 Feb 2018 19:08:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SJ8qf1089656; Wed, 28 Feb 2018 19:08:52 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SJ8qVC089655; Wed, 28 Feb 2018 19:08:52 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802281908.w1SJ8qVC089655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 28 Feb 2018 19:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330126 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 330126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 19:08:53 -0000 Author: manu Date: Wed Feb 28 19:08:52 2018 New Revision: 330126 URL: https://svnweb.freebsd.org/changeset/base/330126 Log: RK3188: Mark it NO_UNIVERSE This is an old kernel so mark it as NO_UNIVERSE so it's not built by the universe rule or tinderbox. Modified: head/sys/arm/conf/RK3188 Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Wed Feb 28 19:05:25 2018 (r330125) +++ head/sys/arm/conf/RK3188 Wed Feb 28 19:08:52 2018 (r330126) @@ -18,6 +18,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident RK3188 include "std.armv7" From owner-svn-src-head@freebsd.org Wed Feb 28 20:06:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13A62F41B8E; Wed, 28 Feb 2018 20:06:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9AB28AEBA; Wed, 28 Feb 2018 20:06:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B49661E228; Wed, 28 Feb 2018 20:06:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SK63jh019724; Wed, 28 Feb 2018 20:06:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SK63hY019723; Wed, 28 Feb 2018 20:06:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201802282006.w1SK63hY019723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 28 Feb 2018 20:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330127 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 330127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 20:06:04 -0000 Author: bdrewery Date: Wed Feb 28 20:06:03 2018 New Revision: 330127 URL: https://svnweb.freebsd.org/changeset/base/330127 Log: Allow overriding .MAKE.MAKEFILE_PREFERENCE. This will be utilized by Ports tools to avoid some extra stat(2) calls. MFC after: 3 days Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Wed Feb 28 19:08:52 2018 (r330126) +++ head/share/mk/sys.mk Wed Feb 28 20:06:03 2018 (r330127) @@ -314,7 +314,8 @@ SHELL= ${__MAKE_SHELL} .MAKE.EXPAND_VARIABLES= yes # Tell bmake the makefile preference -.MAKE.MAKEFILE_PREFERENCE= BSDmakefile makefile Makefile +MAKEFILE_PREFERENCE?= BSDmakefile makefile Makefile +.MAKE.MAKEFILE_PREFERENCE= ${MAKEFILE_PREFERENCE} # Tell bmake to always pass job tokens, regardless of target depending on # .MAKE or looking like ${MAKE}/${.MAKE}/$(MAKE)/$(.MAKE)/make. From owner-svn-src-head@freebsd.org Wed Feb 28 20:51:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C01CEF44B08; Wed, 28 Feb 2018 20:51:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 736758CD7D; Wed, 28 Feb 2018 20:51:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D69E1EA61; Wed, 28 Feb 2018 20:51:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SKpLc9045558; Wed, 28 Feb 2018 20:51:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SKpL01045557; Wed, 28 Feb 2018 20:51:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802282051.w1SKpL01045557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 20:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330128 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 330128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 20:51:21 -0000 Author: kevans Date: Wed Feb 28 20:51:21 2018 New Revision: 330128 URL: https://svnweb.freebsd.org/changeset/base/330128 Log: Revert r328964: if_awg: Skip emac reset if configured for internal PHY This broke EFI boots consistently, and emac reset is sometimes needed if things get into a bad state -- this won't be done without a full powercycle. Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Wed Feb 28 20:06:03 2018 (r330127) +++ head/sys/arm/allwinner/if_awg.c Wed Feb 28 20:51:21 2018 (r330128) @@ -1834,11 +1834,9 @@ awg_attach(device_t dev) awg_get_eaddr(dev, eaddr); /* Soft reset EMAC core */ - if (!awg_has_internal_phy(dev)) { - error = awg_reset(dev); - if (error != 0) - return (error); - } + error = awg_reset(dev); + if (error != 0) + return (error); /* Setup DMA descriptors */ error = awg_setup_dma(dev); From owner-svn-src-head@freebsd.org Wed Feb 28 21:51:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40B8AF264D4; Wed, 28 Feb 2018 21:51:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8D878F8DF; Wed, 28 Feb 2018 21:51:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3E6D1F321; Wed, 28 Feb 2018 21:51:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SLppm7083860; Wed, 28 Feb 2018 21:51:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SLppQv083859; Wed, 28 Feb 2018 21:51:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802282151.w1SLppQv083859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 28 Feb 2018 21:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330131 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 330131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 28 Feb 2018 21:51:52 -0000 Author: ian Date: Wed Feb 28 21:51:51 2018 New Revision: 330131 URL: https://svnweb.freebsd.org/changeset/base/330131 Log: Fix module loading on arm after the metadata.c unification in r329190. Arm modules need an additional address fixup not needed by other platforms. Modified: head/stand/common/metadata.c Modified: head/stand/common/metadata.c ============================================================================== --- head/stand/common/metadata.c Wed Feb 28 21:49:44 2018 (r330130) +++ head/stand/common/metadata.c Wed Feb 28 21:51:51 2018 (r330131) @@ -265,6 +265,7 @@ md_copymodules(vm_offset_t addr, int kern64) struct preloaded_file *fp; struct file_metadata *md; uint64_t scratch64; + uint32_t scratch32; int c; c = addr != 0; @@ -281,7 +282,11 @@ md_copymodules(vm_offset_t addr, int kern64) scratch64 = fp->f_size; MOD_SIZE(addr, scratch64, c); } else { - MOD_ADDR(addr, fp->f_addr, c); + scratch32 = fp->f_addr; +#ifdef __arm__ + scratch32 -= __elfN(relocation_offset); +#endif + MOD_ADDR(addr, scratch32, c); MOD_SIZE(addr, fp->f_size, c); } for (md = fp->f_metadata; md != NULL; md = md->md_next) { From owner-svn-src-head@freebsd.org Thu Mar 1 00:29:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E27AF30D41; Thu, 1 Mar 2018 00:29:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E55116DB0B; Thu, 1 Mar 2018 00:29:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB73C20C89; Thu, 1 Mar 2018 00:29:52 +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 w210TqZi069964; Thu, 1 Mar 2018 00:29:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w210TqF5069963; Thu, 1 Mar 2018 00:29:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803010029.w210TqF5069963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 1 Mar 2018 00:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330135 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 330135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 00:29:53 -0000 Author: cem Date: Thu Mar 1 00:29:52 2018 New Revision: 330135 URL: https://svnweb.freebsd.org/changeset/base/330135 Log: ffs: softdep_disk_write_complete: Quiesce spurious Coverity warning Coverity cannot determine that handle_written_indirdep() does not access uninitialized 'sbp' when flags argument is zero. So, simply move the initialization slightly sooner to silence the warning. No functional change. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Mar 1 00:05:14 2018 (r330134) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Mar 1 00:29:52 2018 (r330135) @@ -10984,6 +10984,8 @@ softdep_disk_write_complete(bp) if (ump == NULL) return; + sbp = NULL; + /* * If an error occurred while doing the write, then the data * has not hit the disk and the dependencies cannot be processed. @@ -11026,7 +11028,6 @@ softdep_disk_write_complete(bp) /* * Ump SU lock must not be released anywhere in this code segment. */ - sbp = NULL; owk = NULL; while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { WORKLIST_REMOVE(wk); From owner-svn-src-head@freebsd.org Thu Mar 1 00:59:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4173F32731; Thu, 1 Mar 2018 00:58:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1A76E998; Thu, 1 Mar 2018 00:58:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B97021162; Thu, 1 Mar 2018 00:58:59 +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 w210wx03084822; Thu, 1 Mar 2018 00:58:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w210wxaO084821; Thu, 1 Mar 2018 00:58:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803010058.w210wxaO084821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 1 Mar 2018 00:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330136 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 330136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 00:59:00 -0000 Author: cem Date: Thu Mar 1 00:58:59 2018 New Revision: 330136 URL: https://svnweb.freebsd.org/changeset/base/330136 Log: psm(4): Always initialize used values in debug print 'status' array passed to get_mouse_status() is usually uninitialized by callers. Fully populating it with values in get_mouse_status() can fail due to read_aux_data(). Additionally, nothing in API constrains 'len' to be >= 3. In practice, every caller passes three, so perhaps that argument should just be removed. Refactoring is a larger change, though. Remove use of potentially uninitialized values by: 1. Only printing 3 debug statuses if the passed array was at least 'len' >= 3; 2. Populating 'status' array up to first three elements, if read_aux_data() failed. No functional change intended. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu Mar 1 00:29:52 2018 (r330135) +++ head/sys/dev/atkbdc/psm.c Thu Mar 1 00:58:59 2018 (r330136) @@ -785,9 +785,12 @@ get_mouse_status(KBDC kbdc, int *status, int flag, int if (status[i] < 0) break; } - - VLOG(1, (LOG_DEBUG, "psm: %s %02x %02x %02x\n", - (flag == 1) ? "data" : "status", status[0], status[1], status[2])); + if (len >= 3) { + for (; i < 3; ++i) + status[i] = 0; + VLOG(1, (LOG_DEBUG, "psm: %s %02x %02x %02x\n", + (flag == 1) ? "data" : "status", status[0], status[1], status[2])); + } return (i); } From owner-svn-src-head@freebsd.org Thu Mar 1 00:59:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 342ADF327FA; Thu, 1 Mar 2018 00:59:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 990CA6EB20; Thu, 1 Mar 2018 00:59:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w210xoIl022626; Wed, 28 Feb 2018 16:59:50 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w210xoZ3022625; Wed, 28 Feb 2018 16:59:50 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803010059.w210xoZ3022625@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330135 - head/sys/ufs/ffs In-Reply-To: <201803010029.w210TqF5069963@repo.freebsd.org> To: Conrad Meyer Date: Wed, 28 Feb 2018 16:59:50 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 00:59:54 -0000 > Author: cem > Date: Thu Mar 1 00:29:52 2018 > New Revision: 330135 > URL: https://svnweb.freebsd.org/changeset/base/330135 > > Log: > ffs: softdep_disk_write_complete: Quiesce spurious Coverity warning > > Coverity cannot determine that handle_written_indirdep() does not access > uninitialized 'sbp' when flags argument is zero. > > So, simply move the initialization slightly sooner to silence the warning. > > No functional change. I am always concerned when we modify code just to silence a warning from a static analysis tool. There use to be a pretty hard and fast rule about this: Dont do it, at most document that the tool is lacking and giving false positives. It double raises an eye brow when the change is made to silence the tool and "no function change" should be occuring. > Reported by: Coverity > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/ufs/ffs/ffs_softdep.c > > Modified: head/sys/ufs/ffs/ffs_softdep.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_softdep.c Thu Mar 1 00:05:14 2018 (r330134) > +++ head/sys/ufs/ffs/ffs_softdep.c Thu Mar 1 00:29:52 2018 (r330135) > @@ -10984,6 +10984,8 @@ softdep_disk_write_complete(bp) > if (ump == NULL) > return; > > + sbp = NULL; > + > /* > * If an error occurred while doing the write, then the data > * has not hit the disk and the dependencies cannot be processed. > @@ -11026,7 +11028,6 @@ softdep_disk_write_complete(bp) > /* > * Ump SU lock must not be released anywhere in this code segment. > */ > - sbp = NULL; > owk = NULL; > while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { > WORKLIST_REMOVE(wk); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Mar 1 01:21:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0A7AF34766 for ; Thu, 1 Mar 2018 01:21:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::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 5461D6FDBD for ; Thu, 1 Mar 2018 01:21:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id p78so5342244iod.13 for ; Wed, 28 Feb 2018 17:21:43 -0800 (PST) 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=L+6CGghJ2TOYFVE74zOn5odNQKJ58gAIZwdIDYXziRo=; b=f/TMD/lgjtu81SZdzsKH/alDLJREFvkPNMfCjGB72M/jg+y2d1bDermC6Q1F22aqMH bltNQzDdrRR+rv4Eb1lC/GvAevr5Zoy8glPxjDfpdhXg7ob4yKJ43itC0pvJQcTsXMN4 3k8anaBtFyHrwsES9FfBIRzY9SUC6SsJyK10DUsAZeCVwH1rjNwNDVOfjiEFuPAkA6qR 8X6IRXkS7+okxafI/sRovkoD/ctQCPYQVVlyrNCx+V1p5sfQT4/6MXyIJlktBraYwxN6 ZfE4nIX+J7aaM801hAHH2k/FjB2wECstEFAufds50jW7KQY3RUKxl3/Pme/NnxqV/N8y u13Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=L+6CGghJ2TOYFVE74zOn5odNQKJ58gAIZwdIDYXziRo=; b=So2UM04Qhrz1xvOWrhGEPf5Vs8fWVnro/u1P+8jCiO0uJfPVIwG3VKjmgL+CwLDQwX e8/r8L/qDZifjKfS6ZTUj7ExVHDHkTF5NuNvDnVUCA+qIMSsvurcUEVEABbsfrQH2QlJ WhOozeFUEvprJ7Zvs9i7GQtEb1C3KY14eiQin5XFZYw1feoy+jfhBWHPX3ntCw67VFyO gw1MyNesENiw8+FPrWw9P23fO3+bM5bLwy085hF86XwTApgKe4gjWU7q7MJZGlk8ESht icVXxGOAhxVNOdp43kvxcj8HQgY6iBNfTrkUftsOrOhO7eZj/hOKWu1l4BQHuMmZS8eH Ha6g== X-Gm-Message-State: APf1xPDoBvZW20FdkHR7/N7JQZ4WTTDJ+gH65TZpECJtEj0E1KKguCXA 0uJuG3V0nuj/HWDFqiK1IFkNaShRhLhTeCycPeWswQ== X-Google-Smtp-Source: AG47ELtJNaJcaBUeg2m2cVZsTxzKYWBiGaO3y5sMLke/ufTtsIVmGtxV7EboHMa7aw53+Co6AnmdOrsjiNrVs6IkKnE= X-Received: by 10.107.187.129 with SMTP id l123mr93013iof.39.1519867302536; Wed, 28 Feb 2018 17:21:42 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.150.220 with HTTP; Wed, 28 Feb 2018 17:21:41 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201803010059.w210xoZ3022625@pdx.rh.CN85.dnsmgr.net> References: <201803010029.w210TqF5069963@repo.freebsd.org> <201803010059.w210xoZ3022625@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 28 Feb 2018 18:21:41 -0700 X-Google-Sender-Auth: kUrySqGGD6_NqT65H4RsBz0jNNQ Message-ID: Subject: Re: svn commit: r330135 - head/sys/ufs/ffs To: "Rodney W. Grimes" Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 01:21:44 -0000 On Wed, Feb 28, 2018 at 5:59 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: cem > > Date: Thu Mar 1 00:29:52 2018 > > New Revision: 330135 > > URL: https://svnweb.freebsd.org/changeset/base/330135 > > > > Log: > > ffs: softdep_disk_write_complete: Quiesce spurious Coverity warning > > > > Coverity cannot determine that handle_written_indirdep() does not > access > > uninitialized 'sbp' when flags argument is zero. > > > > So, simply move the initialization slightly sooner to silence the > warning. > > > > No functional change. > > I am always concerned when we modify code just to silence a > warning from a static analysis tool. There use to be a pretty > hard and fast rule about this: Dont do it, at most document > that the tool is lacking and giving false positives. > > It double raises an eye brow when the change is made to > silence the tool and "no function change" should be occuring. In this case, there's no harm, and I think it makes the code a little easier to understand... Warner > > Reported by: Coverity > > Sponsored by: Dell EMC Isilon > > > > Modified: > > head/sys/ufs/ffs/ffs_softdep.c > > > > Modified: head/sys/ufs/ffs/ffs_softdep.c > > ============================================================ > ================== > > --- head/sys/ufs/ffs/ffs_softdep.c Thu Mar 1 00:05:14 2018 > (r330134) > > +++ head/sys/ufs/ffs/ffs_softdep.c Thu Mar 1 00:29:52 2018 > (r330135) > > @@ -10984,6 +10984,8 @@ softdep_disk_write_complete(bp) > > if (ump == NULL) > > return; > > > > + sbp = NULL; > > + > > /* > > * If an error occurred while doing the write, then the data > > * has not hit the disk and the dependencies cannot be processed. > > @@ -11026,7 +11028,6 @@ softdep_disk_write_complete(bp) > > /* > > * Ump SU lock must not be released anywhere in this code segment. > > */ > > - sbp = NULL; > > owk = NULL; > > while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { > > WORKLIST_REMOVE(wk); > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Thu Mar 1 01:49:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 190F5F365BD; Thu, 1 Mar 2018 01:49:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB1AA71257; Thu, 1 Mar 2018 01:49: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5FAC21ADE; Thu, 1 Mar 2018 01:49:36 +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 w211naFm009929; Thu, 1 Mar 2018 01:49:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w211naXG009928; Thu, 1 Mar 2018 01:49:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803010149.w211naXG009928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 1 Mar 2018 01:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330137 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 330137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 01:49:37 -0000 Author: cem Date: Thu Mar 1 01:49:36 2018 New Revision: 330137 URL: https://svnweb.freebsd.org/changeset/base/330137 Log: pci_ioctl: Avoid returning uninitialized error value if user provided empty buffer In the weird case where the user-provided buffer was zero bytes, we could break out of PCIOCGETCONF and return without initializing error. In this case, initialize error to zero -- we successfully did nothing, as requested. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Thu Mar 1 00:58:59 2018 (r330136) +++ head/sys/dev/pci/pci_user.c Thu Mar 1 01:49:36 2018 (r330137) @@ -762,8 +762,10 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, * tell the user that there are more matches * left. */ - if (cio->num_matches >= ionum) + if (cio->num_matches >= ionum) { + error = 0; break; + } #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 From owner-svn-src-head@freebsd.org Thu Mar 1 02:05:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6568F37D60; Thu, 1 Mar 2018 02:05:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35327721F7; Thu, 1 Mar 2018 02:05:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2125f9K022878; Wed, 28 Feb 2018 18:05:41 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2125fqx022877; Wed, 28 Feb 2018 18:05:41 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803010205.w2125fqx022877@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330135 - head/sys/ufs/ffs In-Reply-To: To: Warner Losh Date: Wed, 28 Feb 2018 18:05:41 -0800 (PST) CC: "Rodney W. Grimes" , Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:05:49 -0000 > On Wed, Feb 28, 2018 at 5:59 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: cem > > > Date: Thu Mar 1 00:29:52 2018 > > > New Revision: 330135 > > > URL: https://svnweb.freebsd.org/changeset/base/330135 > > > > > > Log: > > > ffs: softdep_disk_write_complete: Quiesce spurious Coverity warning > > > > > > Coverity cannot determine that handle_written_indirdep() does not > > access > > > uninitialized 'sbp' when flags argument is zero. > > > > > > So, simply move the initialization slightly sooner to silence the > > warning. > > > > > > No functional change. > > > > I am always concerned when we modify code just to silence a > > warning from a static analysis tool. There use to be a pretty > > hard and fast rule about this: Dont do it, at most document > > that the tool is lacking and giving false positives. > > > > It double raises an eye brow when the change is made to > > silence the tool and "no function change" should be occuring. > > > In this case, there's no harm, and I think it makes the code a little > easier to understand... If infact handle_written_indirdep() should not access sbp then it would be safe to pass it a void * and let the code blow up if it should derefernce it. Thus simply changing the call that was causing the problem and not moving any lines of code. > Warner > > > > > Reported by: Coverity > > > Sponsored by: Dell EMC Isilon > > > > > > Modified: > > > head/sys/ufs/ffs/ffs_softdep.c > > > > > > Modified: head/sys/ufs/ffs/ffs_softdep.c > > > ============================================================ > > ================== > > > --- head/sys/ufs/ffs/ffs_softdep.c Thu Mar 1 00:05:14 2018 > > (r330134) > > > +++ head/sys/ufs/ffs/ffs_softdep.c Thu Mar 1 00:29:52 2018 > > (r330135) > > > @@ -10984,6 +10984,8 @@ softdep_disk_write_complete(bp) > > > if (ump == NULL) > > > return; > > > > > > + sbp = NULL; > > > + > > > /* > > > * If an error occurred while doing the write, then the data > > > * has not hit the disk and the dependencies cannot be processed. > > > @@ -11026,7 +11028,6 @@ softdep_disk_write_complete(bp) > > > /* > > > * Ump SU lock must not be released anywhere in this code segment. > > > */ > > > - sbp = NULL; > > > owk = NULL; > > > while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { > > > WORKLIST_REMOVE(wk); > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Mar 1 02:04:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F701F37BF3; Thu, 1 Mar 2018 02:04:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8B36720C8; Thu, 1 Mar 2018 02:04:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E399B21E80; Thu, 1 Mar 2018 02:04:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2124Qow019691; Thu, 1 Mar 2018 02:04:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2124QkO019689; Thu, 1 Mar 2018 02:04:26 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803010204.w2124QkO019689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 02:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330138 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:04:27 -0000 Author: kevans Date: Thu Mar 1 02:04:26 2018 New Revision: 330138 URL: https://svnweb.freebsd.org/changeset/base/330138 Log: lualoader: Dedup these "Return to main menu" entries Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Thu Mar 1 01:49:36 2018 (r330137) +++ head/stand/lua/menu.lua Thu Mar 1 02:04:26 2018 (r330138) @@ -39,6 +39,10 @@ local drawer = require("drawer") local menu = {} local drawn_menu +local return_menu_entry = { + entry_type = core.MENU_RETURN, + name = "Back to main menu" .. color.highlight(" [Backspace]"), +} local function OnOff(str, value) if value then @@ -97,12 +101,8 @@ menu.handlers = { menu.boot_environments = { entries = { -- return to welcome menu + return_menu_entry, { - entry_type = core.MENU_RETURN, - name = "Back to main menu" .. - color.highlight(" [Backspace]"), - }, - { entry_type = core.MENU_CAROUSEL_ENTRY, carousel_id = "be_active", items = core.bootenvList, @@ -149,11 +149,7 @@ menu.boot_environments = { menu.boot_options = { entries = { -- return to welcome menu - { - entry_type = core.MENU_RETURN, - name = "Back to main menu" .. - color.highlight(" [Backspace]"), - }, + return_menu_entry, -- load defaults { entry_type = core.MENU_ENTRY, From owner-svn-src-head@freebsd.org Thu Mar 1 02:31:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85F09F39C42; Thu, 1 Mar 2018 02:31:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 384E3735F4; Thu, 1 Mar 2018 02:31:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 331EE222BB; Thu, 1 Mar 2018 02:31:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w212VSb0030647; Thu, 1 Mar 2018 02:31:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w212VS7S030646; Thu, 1 Mar 2018 02:31:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803010231.w212VS7S030646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 02:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330139 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:31:29 -0000 Author: kevans Date: Thu Mar 1 02:31:28 2018 New Revision: 330139 URL: https://svnweb.freebsd.org/changeset/base/330139 Log: lualoader: config: Pull some messages out into constants Rather than hardcoding these things. This could lead to some form of loader localization later, but the main goal at the moment is to get a clear view of the strings we're outputting and strive to use more string.format() and less wild concatenation all over the place. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Thu Mar 1 02:04:26 2018 (r330138) +++ head/stand/lua/config.lua Thu Mar 1 02:31:28 2018 (r330139) @@ -30,11 +30,24 @@ -- local config = {} - local modules = {} - local carousel_choices = {} +local MSG_FAILEXEC = "Failed to exec '%s'" +local MSG_FAILSETENV = "Failed to '%s' with value: %s" +local MSG_FAILOPENCFG = "Failed to open config: '%s'" +local MSG_FAILREADCFG = "Failed to read config: '%s'" +local MSG_FAILPARSECFG = "Failed to parse config: '%s'" +local MSG_FAILEXBEF = "Failed to execute '%s' before loading '%s'" +local MSG_FAILEXMOD = "Failed to execute '%s'" +local MSG_FAILEXAF = "Failed to execute '%s' after loading '%s'" +local MSG_MALFORMED = "Malformed line (%d):\n\t'%s'" +local MSG_DEFAULTKERNFAIL = "No kernel set, failed to load from module_path" +local MSG_KERNFAIL = "Failed to load kernel '%s'" +local MSG_KERNLOADING = "Loading kernel..." +local MSG_MODLOADING = "Loading configured modules..." +local MSG_MODLOADFAIL = "Could not load one or more modules!" + local pattern_table = { { str = "^%s*(#.*)", @@ -97,7 +110,7 @@ local pattern_table = { str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, _) if loader.perform(k) ~= 0 then - print("Failed to exec '" .. k .. "'") + print(MSG_FAILEXEC:format(k)) end end, }, @@ -106,8 +119,7 @@ local pattern_table = { str = "^%s*([%w%p]+)%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, v) if config.setenv(k, v) ~= 0 then - print("Failed to set '" .. k .. - "' with value: " .. v .. "") + print(MSG_FAILSETENV:format(k, v)) end end, }, @@ -116,8 +128,7 @@ local pattern_table = { str = "^%s*([%w%p]+)%s*=%s*(%d+)%s*(.*)", process = function(k, v) if config.setenv(k, v) ~= 0 then - print("Failed to set '" .. k .. - "' with value: " .. v .. "") + print(MSG_FAILSETENV:format(k, tostring(v))) end end, }, @@ -127,7 +138,7 @@ local function readFile(name, silent) local f = io.open(name) if f == nil then if not silent then - print("Failed to open config: '" .. name .. "'") + print(MSG_FAILOPENCFG:format(name)) end return nil end @@ -138,7 +149,7 @@ local function readFile(name, silent) if text == nil then if not silent then - print("Failed to read config: '" .. name .. "'") + print(MSG_FAILREADCFG:format(name)) end return nil end @@ -162,8 +173,7 @@ local function checkNextboot() end if not config.parse(text) then - print("Failed to parse nextboot configuration: '" .. - nextboot_file .. "'") + print(MSG_FAILPARSECFG:format(nextbootfile)) end -- Attempt to rewrite the first line and only the first line of the @@ -264,6 +274,7 @@ end function config.loadmod(mod, silent) local status = true + local pstatus = true for k, v in pairs(mod) do if v.load == "YES" then local str = "load " @@ -278,23 +289,17 @@ function config.loadmod(mod, silent) else str = str .. k end - if v.before ~= nil then - if loader.perform(v.before) ~= 0 then - if not silent then - print("Failed to execute '" .. - v.before .. - "' before loading '" .. k .. - "'") - end - status = false + pstatus = loader.perform(v.before) == 0 + if not pstatus and not silent then + print(MSG_FAILEXBEF:format(v.before, k)) end + status = status and pstatus end if loader.perform(str) ~= 0 then if not silent then - print("Failed to execute '" .. str .. - "'") + print(MSG_FAILEXMOD:format(str)) end if v.error ~= nil then loader.perform(v.error) @@ -303,15 +308,11 @@ function config.loadmod(mod, silent) end if v.after ~= nil then - if loader.perform(v.after) ~= 0 then - if not silent then - print("Failed to execute '" .. - v.after .. - "' after loading '" .. k .. - "'") - end - status = false + pstatus = loader.perform(v.after) == 0 + if not pstatus and not silent then + print(MSG_FAILEXAF:format(v.after, k)) end + status = status and pstatus end -- else @@ -357,8 +358,8 @@ function config.parse(text) if config.isValidComment(c) then val.process(k, v) else - print("Malformed line (" .. n .. - "):\n\t'" .. line .. "'") + print(MSG_MALFORMED:format(n, + line)) status = false end @@ -367,8 +368,7 @@ function config.parse(text) end if not found then - print("Malformed line (" .. n .. "):\n\t'" .. - line .. "'") + print(MSG_MALFORMED:format(n, line)) status = false end end @@ -417,7 +417,7 @@ function config.loadKernel(other_kernel) config.kernel_loaded = nil return true else - print("No kernel set, failed to load from module_path") + print(MSG_DEFAULTKERNFAIL) return false end else @@ -455,7 +455,7 @@ function config.loadKernel(other_kernel) config.kernel_loaded = kernel return true else - print("Failed to load kernel '" .. kernel .. "'") + print(MSG_KERNFAIL:format(kernel)) return false end end @@ -471,7 +471,7 @@ function config.load(file) end if not config.processFile(file) then - print("Failed to parse configuration: '" .. file .. "'") + print(MSG_FAILPARSECFG:format(file)) end local f = loader.getenv("loader_conf_files") @@ -481,8 +481,7 @@ function config.load(file) -- silent parse so that we complain on parse errors but -- not for them simply not existing. if not config.processFile(name, true) then - print("Failed to parse configuration: '" .. - name .. "'") + print(MSG_FAILPARSECFG:format(name)) end end end @@ -504,17 +503,16 @@ function config.loadelf() local kernel = config.kernel_selected or config.kernel_loaded local loaded - print("Loading kernel...") + print(MSG_KERNLOADING) loaded = config.loadKernel(kernel) if not loaded then - print("Failed to load any kernel") return end - print("Loading configured modules...") + print(MSG_MODLOADING) if not config.loadmod(modules) then - print("Could not load one or more modules!") + print(MSG_MODLOADFAIL) end end From owner-svn-src-head@freebsd.org Thu Mar 1 04:44:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22ACAF4417D; Thu, 1 Mar 2018 04:44:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C178479B68; Thu, 1 Mar 2018 04:44:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC4E623A7C; Thu, 1 Mar 2018 04:44:17 +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 w214iHQ7000497; Thu, 1 Mar 2018 04:44:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214iHmG000496; Thu, 1 Mar 2018 04:44:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201803010444.w214iHmG000496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 1 Mar 2018 04:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330147 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 330147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 04:44:18 -0000 Author: jhibbits Date: Thu Mar 1 04:44:17 2018 New Revision: 330147 URL: https://svnweb.freebsd.org/changeset/base/330147 Log: Fix the psl_userset32 definition. It should be based on psl_userset, not psl_kernset. As kernset, it would inherit kernel config, including privilege level. Modified: head/sys/powerpc/booke/booke_machdep.c Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Thu Mar 1 04:43:52 2018 (r330146) +++ head/sys/powerpc/booke/booke_machdep.c Thu Mar 1 04:44:17 2018 (r330147) @@ -216,7 +216,7 @@ booke_cpu_init(void) #endif psl_userset = psl_kernset | PSL_PR; #ifdef __powerpc64__ - psl_userset32 = psl_kernset & ~PSL_CM; + psl_userset32 = psl_userset & ~PSL_CM; #endif psl_userstatic = ~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1); From owner-svn-src-head@freebsd.org Thu Mar 1 10:31:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43DEF34513; Thu, 1 Mar 2018 10:31:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB087AACC; Thu, 1 Mar 2018 10:31:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 759972760F; Thu, 1 Mar 2018 10:31:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21AVp5Q076476; Thu, 1 Mar 2018 10:31:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21AVpNU076475; Thu, 1 Mar 2018 10:31:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803011031.w21AVpNU076475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Mar 2018 10:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330236 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 330236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 10:31:52 -0000 Author: hselasky Date: Thu Mar 1 10:31:51 2018 New Revision: 330236 URL: https://svnweb.freebsd.org/changeset/base/330236 Log: Correct the return value from flush_work() and flush_delayed_work() in the LinuxKPI to comply more with Linux. This fixes an issue when these functions are used in waiting loops. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Thu Mar 1 08:33:20 2018 (r330235) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Thu Mar 1 10:31:51 2018 (r330236) @@ -454,6 +454,7 @@ bool linux_flush_work(struct work_struct *work) { struct taskqueue *tq; + int retval; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_flush_work() might sleep"); @@ -463,8 +464,9 @@ linux_flush_work(struct work_struct *work) return (0); default: tq = work->work_queue->taskqueue; + retval = taskqueue_poll_is_busy(tq, &work->work_task); taskqueue_drain(tq, &work->work_task); - return (1); + return (retval); } } @@ -477,6 +479,7 @@ bool linux_flush_delayed_work(struct delayed_work *dwork) { struct taskqueue *tq; + int retval; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_flush_delayed_work() might sleep"); @@ -490,8 +493,9 @@ linux_flush_delayed_work(struct delayed_work *dwork) /* FALLTHROUGH */ default: tq = dwork->work.work_queue->taskqueue; + retval = taskqueue_poll_is_busy(tq, &dwork->work.work_task); taskqueue_drain(tq, &dwork->work.work_task); - return (1); + return (retval); } } From owner-svn-src-head@freebsd.org Thu Mar 1 13:52:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9782F2C31D; Thu, 1 Mar 2018 13:52:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84B2D86B57; Thu, 1 Mar 2018 13:52:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F8D2180F; Thu, 1 Mar 2018 13:52:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21DqJNe081633; Thu, 1 Mar 2018 13:52:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21DqJQM081628; Thu, 1 Mar 2018 13:52:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803011352.w21DqJQM081628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 1 Mar 2018 13:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330239 - in head/sys: amd64/linux compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux compat/linux X-SVN-Commit-Revision: 330239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 13:52:20 -0000 Author: emaste Date: Thu Mar 1 13:52:18 2018 New Revision: 330239 URL: https://svnweb.freebsd.org/changeset/base/330239 Log: Rationalize license text on Linuxolator files Many licenses on Linuxolator files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the standard 2-clause FreeBSD license for those files where I have permission from each of the listed copyright holders. Additional files still waiting on permission from others are listed in review D14210. Approved by: dchagin, rdivacky, sos MFC after: 1 week MFC with: r329370 Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux/linux_dummy.c head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_emul.h Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Thu Mar 1 10:57:50 2018 (r330238) +++ head/sys/amd64/linux/linux.h Thu Mar 1 13:52:18 2018 (r330239) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Dmitry Chagin * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. @@ -7,24 +9,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Thu Mar 1 10:57:50 2018 (r330238) +++ head/sys/amd64/linux/linux_dummy.c Thu Mar 1 13:52:18 2018 (r330239) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Dmitry Chagin * All rights reserved. * @@ -6,22 +8,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Thu Mar 1 10:57:50 2018 (r330238) +++ head/sys/compat/linux/linux_emul.c Thu Mar 1 13:52:18 2018 (r330239) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2006 Roman Divacky * Copyright (c) 2013 Dmitry Chagin @@ -9,24 +9,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Thu Mar 1 10:57:50 2018 (r330238) +++ head/sys/compat/linux/linux_emul.h Thu Mar 1 13:52:18 2018 (r330239) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2006 Roman Divacky * Copyright (c) 2013 Dmitry Chagin @@ -9,24 +9,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * 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$ */ From owner-svn-src-head@freebsd.org Thu Mar 1 14:11:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 285B6F2DDB4; Thu, 1 Mar 2018 14:11:09 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C806687971; Thu, 1 Mar 2018 14:11:08 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2CEC1B0B; Thu, 1 Mar 2018 14:11:08 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21EB8U9088002; Thu, 1 Mar 2018 14:11:08 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21EB87c087995; Thu, 1 Mar 2018 14:11:08 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201803011411.w21EB87c087995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 1 Mar 2018 14:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330240 - in head/sys: conf powerpc/conf powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: in head/sys: conf powerpc/conf powerpc/powernv X-SVN-Commit-Revision: 330240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 14:11:09 -0000 Author: wma Date: Thu Mar 1 14:11:07 2018 New Revision: 330240 URL: https://svnweb.freebsd.org/changeset/base/330240 Log: PowerNV: Initial support for OPAL I2C transfers Add I2C OPAL driver and a set of dummy-ones to allow all I2C things on Power8 to attach. TODO: better async token management Submitted by: Wojciech Macek Obtained from: Semihalf Sponsored by: IBM, QCM Technologies Added: head/sys/powerpc/powernv/opal_i2c.c (contents, props changed) head/sys/powerpc/powernv/opal_i2cm.c (contents, props changed) head/sys/powerpc/powernv/powernv_centaur.c (contents, props changed) head/sys/powerpc/powernv/powernv_xscom.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/powernv/opal.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Mar 1 13:52:18 2018 (r330239) +++ head/sys/conf/files.powerpc Thu Mar 1 14:11:07 2018 (r330240) @@ -186,9 +186,13 @@ powerpc/powermac/vcoregpio.c optional powermac powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_console.c optional powernv powerpc/powernv/opal_dev.c optional powernv +powerpc/powernv/opal_i2c.c optional iicbus fdt powernv +powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv powerpc/powernv/opal_pci.c optional powernv pci powerpc/powernv/opalcall.S optional powernv powerpc/powernv/platform_powernv.c optional powernv +powerpc/powernv/powernv_centaur.c optional powernv +powerpc/powernv/powernv_xscom.c optional powernv powerpc/powerpc/altivec.c optional powerpc | powerpc64 powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.c standard Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu Mar 1 13:52:18 2018 (r330239) +++ head/sys/powerpc/conf/GENERIC64 Thu Mar 1 14:11:07 2018 (r330240) @@ -206,6 +206,7 @@ device fwe # Ethernet over FireWire (non-standard!) # Misc device iicbus # I2C bus code +device iic device kiic # Keywest I2C device ad7417 # PowerMac7,2 temperature sensor device ds1631 # PowerMac11,2 temperature sensor Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Thu Mar 1 13:52:18 2018 (r330239) +++ head/sys/powerpc/powernv/opal.h Thu Mar 1 14:11:07 2018 (r330240) @@ -71,15 +71,37 @@ int opal_call(uint64_t token, ...); #define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45 #define OPAL_RETURN_CPU 69 #define OPAL_REINIT_CPUS 70 +#define OPAL_CHECK_ASYNC_COMPLETION 86 +#define OPAL_I2C_REQUEST 109 #define OPAL_PCI_TCE_KILL 126 /* For OPAL_PCI_SET_PE */ #define OPAL_UNMAP_PE 0 #define OPAL_MAP_PE 1 -#define OPAL_SUCCESS 0 -#define OPAL_PARAMETER -1 -#define OPAL_CLOSED -5 +#define OPAL_SUCCESS 0 +#define OPAL_PARAMETER -1 +#define OPAL_BUSY -2 +#define OPAL_CLOSED -5 #define OPAL_BUSY_EVENT -12 +#define OPAL_ASYNC_COMPLETION -15 + +struct opal_msg { + uint32_t msg_type; + uint32_t reserved; + uint64_t params[8]; +}; + +enum opal_msg_type { + OPAL_MSG_ASYNC_COMP = 0, + OPAL_MSG_MEM_ERR = 1, + OPAL_MSG_EPOW = 2, + OPAL_MSG_SHUTDOWN = 3, + OPAL_MSG_HMI_EVT = 4, + OPAL_MSG_DPO = 5, + OPAL_MSG_PRD = 6, + OPAL_MSG_OCC = 7, + OPAL_MSG_TYPE_MAX, +}; #endif Added: head/sys/powerpc/powernv/opal_i2c.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_i2c.c Thu Mar 1 14:11:07 2018 (r330240) @@ -0,0 +1,252 @@ +/*- + * Copyright (c) 2017-2018 QCM Technologies. + * Copyright (c) 2017-2018 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include "iicbus_if.h" + +#include "opal.h" + +#ifdef FDT +#include +#include +#endif + +struct opal_i2c_softc +{ + device_t dev; + device_t iicbus; + uint32_t opal_id; + struct mtx sc_mtx; +}; + +/* OPAL I2C request */ +struct opal_i2c_request { + uint8_t type; +#define OPAL_I2C_RAW_READ 0 +#define OPAL_I2C_RAW_WRITE 1 +#define OPAL_I2C_SM_READ 2 +#define OPAL_I2C_SM_WRITE 3 + uint8_t flags; + uint8_t subaddr_sz; /* Max 4 */ + uint8_t reserved; + uint16_t addr; /* 7 or 10 bit address */ + uint16_t reserved2; + uint32_t subaddr; /* Sub-address if any */ + uint32_t size; /* Data size */ + uint64_t buffer_pa; /* Buffer real address */ +}; + +static int opal_i2c_attach(device_t); +static int opal_i2c_callback(device_t, int, caddr_t); +static int opal_i2c_probe(device_t); +static int opal_i2c_transfer(device_t, struct iic_msg *, uint32_t); +static int i2c_opal_send_request(uint32_t, struct opal_i2c_request *); + +static device_method_t opal_i2c_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, opal_i2c_probe), + DEVMETHOD(device_attach, opal_i2c_attach), + + /* iicbus interface */ + DEVMETHOD(iicbus_callback, opal_i2c_callback), + DEVMETHOD(iicbus_transfer, opal_i2c_transfer), + DEVMETHOD_END +}; + +#define I2C_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define I2C_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define I2C_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ + "i2c", MTX_DEF) + +static devclass_t opal_i2c_devclass; + +static driver_t opal_i2c_driver = { + "i2c", + opal_i2c_methods, + sizeof(struct opal_i2c_softc), +}; + +static int +opal_i2c_probe(device_t dev) +{ + + if (!(ofw_bus_is_compatible(dev, "ibm,opal-i2c"))) + return (ENXIO); + + device_set_desc(dev, "opal-i2c"); + + return (0); +} + +static int +opal_i2c_attach(device_t dev) +{ + struct opal_i2c_softc *sc; + int len; + + sc = device_get_softc(dev); + sc->dev = dev; + + len = OF_getproplen(ofw_bus_get_node(dev), "ibm,opal-id"); + if (len <= 0) + return (EINVAL); + OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-id", &sc->opal_id, len); + + if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) { + device_printf(dev, "could not allocate iicbus instance\n"); + return (EINVAL); + } + + I2C_LOCK_INIT(sc); + + return (bus_generic_attach(dev)); +} + +static int +opal_get_async_rc(struct opal_msg msg) +{ + if (msg.msg_type != OPAL_MSG_ASYNC_COMP) + return OPAL_PARAMETER; + else + return htobe64(msg.params[1]); +} + +static int +i2c_opal_send_request(uint32_t bus_id, struct opal_i2c_request *req) +{ + struct opal_msg msg; + int token, rc; + + /* + * XXX: + * Async tokens should be managed globally. Since there is + * only one place now, use hardcoded value. + */ + token = 0x112233; + + memset(&msg, 0, sizeof(msg)); + + rc = opal_call(OPAL_I2C_REQUEST, token, bus_id, + pmap_kextract((uint64_t)req)); + if (rc != OPAL_ASYNC_COMPLETION) + return (rc); + + do { + rc = opal_call(OPAL_CHECK_ASYNC_COMPLETION, + pmap_kextract((uint64_t)&msg), sizeof(msg), token); + } while (rc == OPAL_BUSY); + + if (rc != OPAL_SUCCESS) + return (rc); + + rc = opal_get_async_rc(msg); + + return rc; +} + +static int +opal_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + struct opal_i2c_softc *sc; + int i, err = 0; + struct opal_i2c_request req; + + sc = device_get_softc(dev); + + memset(&req, 0, sizeof(req)); + + /* XXX: Currently OPAL can parse only 1 message */ + if (nmsgs > 1) { + device_printf(dev, + "trying to parse %d messages, while only 1 is supported\n", nmsgs); + return (ENOMEM); + } + + I2C_LOCK(sc); + for (i = 0; i < nmsgs; i++) { + req.type = (msgs[i].flags & IIC_M_RD) ? + OPAL_I2C_RAW_READ : OPAL_I2C_RAW_WRITE; + req.addr = htobe16(msgs[0].slave); + req.size = htobe32(msgs[0].len); + req.buffer_pa = htobe64(pmap_kextract((uint64_t)msgs[0].buf)); + + err = i2c_opal_send_request(sc->opal_id, &req); + } + I2C_UNLOCK(sc); + + return (err); +} + +static int +opal_i2c_callback(device_t dev, int index, caddr_t data) +{ + int error = 0; + + switch (index) { + case IIC_REQUEST_BUS: + break; + + case IIC_RELEASE_BUS: + break; + + default: + error = EINVAL; + } + + return (error); +} + +DRIVER_MODULE(opal_i2c, opal_i2cm, opal_i2c_driver, opal_i2c_devclass, NULL, + NULL); +DRIVER_MODULE(iicbus, opal_i2c, iicbus_driver, iicbus_devclass, NULL, NULL); +MODULE_DEPEND(opal_i2c, iicbus, 1, 1, 1); Added: head/sys/powerpc/powernv/opal_i2cm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_i2cm.c Thu Mar 1 14:11:07 2018 (r330240) @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 2017-2018 QCM Technologies. + * Copyright (c) 2017-2018 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#endif + +struct opal_i2cm_softc +{ + +}; + +static int opal_i2cm_attach(device_t); +static int opal_i2cm_probe(device_t); +static const struct ofw_bus_devinfo * + opal_i2cm_get_devinfo(device_t, device_t); + +static device_method_t opal_i2cm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, opal_i2cm_probe), + DEVMETHOD(device_attach, opal_i2cm_attach), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, opal_i2cm_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static devclass_t opal_i2cm_devclass; + +static int +opal_i2cm_probe(device_t dev) +{ + + if (!(ofw_bus_is_compatible(dev, "ibm,centaur-i2cm") || + ofw_bus_is_compatible(dev, "ibm,power8-i2cm"))) + return (ENXIO); + + device_set_desc(dev, "centaur-i2cm"); + return (0); +} + +static int +opal_i2cm_attach(device_t dev) +{ + phandle_t child; + device_t cdev; + struct ofw_bus_devinfo *dinfo; + + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_DEVBUF); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_DEVBUF); + continue; + } + device_set_ivars(cdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static const struct ofw_bus_devinfo * +opal_i2cm_get_devinfo(device_t dev, device_t child) +{ + return (device_get_ivars(child)); +} + +DEFINE_CLASS_0(opal_i2cm, opal_i2cm_driver, opal_i2cm_methods, + sizeof(struct opal_i2cm_softc)); +DRIVER_MODULE(opal_i2cm, powernv_xscom, opal_i2cm_driver, opal_i2cm_devclass, NULL, + NULL); +DRIVER_MODULE(opal_i2cm, powernv_centaur, opal_i2cm_driver, opal_i2cm_devclass, NULL, + NULL); + Added: head/sys/powerpc/powernv/powernv_centaur.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/powernv_centaur.c Thu Mar 1 14:11:07 2018 (r330240) @@ -0,0 +1,130 @@ +/*- + * Copyright (c) 2017-2018 QCM Technologies. + * Copyright (c) 2017-2018 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#endif + +struct powernv_centaur_softc +{ + +}; + +static int powernv_centaur_attach(device_t); +static int powernv_centaur_probe(device_t); +static const struct ofw_bus_devinfo * + powernv_centaur_get_devinfo(device_t, device_t); + +static device_method_t powernv_centaur_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, powernv_centaur_probe), + DEVMETHOD(device_attach, powernv_centaur_attach), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, powernv_centaur_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static devclass_t powernv_centaur_devclass; + +static int +powernv_centaur_probe(device_t dev) +{ + + if (!(ofw_bus_is_compatible(dev, "ibm,centaur"))) + return (ENXIO); + + device_set_desc(dev, "centaur"); + return (0); +} + +static int +powernv_centaur_attach(device_t dev) +{ + phandle_t child; + device_t cdev; + struct ofw_bus_devinfo *dinfo; + + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_DEVBUF); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_DEVBUF); + continue; + } + device_set_ivars(cdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static const struct ofw_bus_devinfo * +powernv_centaur_get_devinfo(device_t dev, device_t child) +{ + return (device_get_ivars(child)); +} + +DEFINE_CLASS_0(powernv_centaur, powernv_centaur_driver, powernv_centaur_methods, + sizeof(struct powernv_centaur_softc)); +DRIVER_MODULE(powernv_centaur, ofwbus, powernv_centaur_driver, powernv_centaur_devclass, NULL, + NULL); + Added: head/sys/powerpc/powernv/powernv_xscom.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/powernv_xscom.c Thu Mar 1 14:11:07 2018 (r330240) @@ -0,0 +1,130 @@ +/*- + * Copyright (c) 2017-2018 QCM Technologies. + * Copyright (c) 2017-2018 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#endif + +struct powernv_xscom_softc +{ + +}; + +static int powernv_xscom_attach(device_t); +static int powernv_xscom_probe(device_t); +static const struct ofw_bus_devinfo * + powernv_xscom_get_devinfo(device_t, device_t); + +static device_method_t powernv_xscom_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, powernv_xscom_probe), + DEVMETHOD(device_attach, powernv_xscom_attach), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, powernv_xscom_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static devclass_t powernv_xscom_devclass; + +static int +powernv_xscom_probe(device_t dev) +{ + + if (!(ofw_bus_is_compatible(dev, "ibm,xscom"))) + return (ENXIO); + + device_set_desc(dev, "xscom"); + return (0); +} + +static int +powernv_xscom_attach(device_t dev) +{ + phandle_t child; + device_t cdev; + struct ofw_bus_devinfo *dinfo; + + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_DEVBUF); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_DEVBUF); + continue; + } + device_set_ivars(cdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static const struct ofw_bus_devinfo * +powernv_xscom_get_devinfo(device_t dev, device_t child) +{ + return (device_get_ivars(child)); +} + +DEFINE_CLASS_0(powernv_xscom, powernv_xscom_driver, powernv_xscom_methods, + sizeof(struct powernv_xscom_softc)); +DRIVER_MODULE(powernv_xscom, ofwbus, powernv_xscom_driver, powernv_xscom_devclass, NULL, + NULL); + From owner-svn-src-head@freebsd.org Thu Mar 1 14:14:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BC2CF2E36F for ; Thu, 1 Mar 2018 14:14:09 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-qt0-x22b.google.com (mail-qt0-x22b.google.com [IPv6:2607:f8b0:400d:c0d::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 9727287DDB for ; Thu, 1 Mar 2018 14:14:08 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-qt0-x22b.google.com with SMTP id v90so7620988qte.12 for ; Thu, 01 Mar 2018 06:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=of2qSXodY6sIM2ltc/jkesoYD00+hzZWYkQrpWBvh0k=; b=jPASPltl3V2d9Pfhf3a4RyU8tIJtefvtOkSOAM6n9gZvy/6a72sVkoceJ4QS6bR2D0 HK7GJiB6RAU+Z7rvlFFc0mLbvf0RQ5qzTdgQnJTAtZBkAKuRWaw3gGMILIgDm8J2vcSr FbcFSVG0Q07Z57WNC+zuOPOVljpUQb9IHiROHq5jdfZu72SLWX+V4wUBZlE4v1IEBJ1q ncv1ihN2gpPPr7RM/Zc79vpVEX3oIgsjKxUzeaCWTQ5OHat4SkszLCKkXhZQR3g9A5Z1 /hcsogUbpTjSweZCb0ulO4MebVPsQ60AFaFdAJn+RtbSXuc08Rk4Rjatto9f4vCIEuVV dH1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=of2qSXodY6sIM2ltc/jkesoYD00+hzZWYkQrpWBvh0k=; b=XENrT5w1q02oYsl0QN5yLcfmc09IOXcwnbkccC7eMY0hjHLWPnBmQe+fa7/LIvCnq2 yB4D91vcNXMG6aI/Na5rg56d/CZsRRnCsxNW/qktc7Kwjy0f6YTHsBmYLvJI2XkVIOZR zA3/GAogxQZvNz8Y5KsGYY81W8vKxzvDqb1fn+tWV4MTfbzrASgJRZVaFZZb6amloXxg qO8D4wp8JU64jx9ZFRYdPwnweDQAGKUf7I3N+Jr97VTwuiTcOwgQNHqn0v0OjVi7Rkr8 6clLKuYeG+No1CG1xeK8uQhTUuGuA15GW3mK07diDRqaY4GGebuC+OSX9pUOaTqb8FWf GBMQ== X-Gm-Message-State: AElRT7FNbVLS/bY0ltDrtkltnIeX+Xmq5MUAOQdbSWttwqDxdQ445Spz zwr0hq5bS/5USCQXuFTPmEay77olAnZ9GZEDDsALRw== X-Google-Smtp-Source: AG47ELuc4Jat+BGv3Ms4ze4KthR4+63eXchkbGnKuP16RdA8T9yBW8WL8djVO6NDTIHC7pa0U0l7bhzfcq79rtlPwrk= X-Received: by 10.237.42.198 with SMTP id t64mr3123247qtd.274.1519913648010; Thu, 01 Mar 2018 06:14:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.39.140 with HTTP; Thu, 1 Mar 2018 06:13:47 -0800 (PST) In-Reply-To: References: <201709290636.v8T6aJDG089556@repo.freebsd.org> From: Wojciech Macek Date: Thu, 1 Mar 2018 15:13:47 +0100 Message-ID: Subject: Re: svn commit: r324099 - in head: share/mk sys/boot To: Ed Maste Cc: Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 14:14:09 -0000 Thanks, I'll handle this. Regards, Wojtek 2018-02-28 16:01 GMT+01:00 Ed Maste : > On 29 September 2017 at 02:36, Wojciech Macek wrote: > > Author: wma > > Date: Fri Sep 29 06:36:19 2017 > > New Revision: 324099 > > URL: https://svnweb.freebsd.org/changeset/base/324099 > > > > Log: > > Compile loader as Little-Endian on PPC64/POWER8 > > This is missing a description file in tools/build/options; generating > src.conf.5 reports "no description found for WITH_LOADER_FORCE_LE" (as > well as 5 other missing descriptions and a number of duplicate options > in mips and riscv). > From owner-svn-src-head@freebsd.org Thu Mar 1 15:43:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B8B8F364B7; Thu, 1 Mar 2018 15:43:52 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1256CFE1; Thu, 1 Mar 2018 15:43:51 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w21Fhgcd001246 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 1 Mar 2018 07:43:43 -0800 Subject: Re: svn commit: r330240 - in head/sys: conf powerpc/conf powerpc/powernv To: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803011411.w21EB87c087995@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Thu, 1 Mar 2018 07:43:42 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803011411.w21EB87c087995@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbZ4Txg5GwOtr6b7Lj+LQD99kbPJj3kUc5xXb01/jv0sXOARsrZXrSEfyS69OMbGwzUpAklZ+ffzFMJMzDdhGGi+fqPhO+9nyE= X-Sonic-ID: C;QJLqUWcd6BG58SAFsE207w== M;dnthUmcd6BG58SAFsE207w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 15:43:52 -0000 On 03/01/18 06:11, Wojciech Macek wrote: > Author: wma > Date: Thu Mar 1 14:11:07 2018 > New Revision: 330240 > URL: https://svnweb.freebsd.org/changeset/base/330240 > > Log: > PowerNV: Initial support for OPAL I2C transfers > > Add I2C OPAL driver and a set of dummy-ones to allow > all I2C things on Power8 to attach. > > TODO: better async token management > > Submitted by: Wojciech Macek > Obtained from: Semihalf > Sponsored by: IBM, QCM Technologies > > Added: > head/sys/powerpc/powernv/opal_i2c.c (contents, props changed) > head/sys/powerpc/powernv/opal_i2cm.c (contents, props changed) > head/sys/powerpc/powernv/powernv_centaur.c (contents, props changed) > head/sys/powerpc/powernv/powernv_xscom.c (contents, props changed) > Modified: > head/sys/conf/files.powerpc > head/sys/powerpc/conf/GENERIC64 > head/sys/powerpc/powernv/opal.h > > Modified: head/sys/conf/files.powerpc > ============================================================================== > --- head/sys/conf/files.powerpc Thu Mar 1 13:52:18 2018 (r330239) > +++ head/sys/conf/files.powerpc Thu Mar 1 14:11:07 2018 (r330240) > @@ -186,9 +186,13 @@ powerpc/powermac/vcoregpio.c optional powermac > powerpc/powernv/opal.c optional powernv > powerpc/powernv/opal_console.c optional powernv > powerpc/powernv/opal_dev.c optional powernv > +powerpc/powernv/opal_i2c.c optional iicbus fdt powernv > +powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv These don't use FDT functions directly (and shouldn't), so you should remove the fdt part on the right. We only gate on 'options FDT' for things that are really FDT- (as opposed to OF-) specific. > powerpc/powernv/opal_pci.c optional powernv pci > powerpc/powernv/opalcall.S optional powernv > powerpc/powernv/platform_powernv.c optional powernv > +powerpc/powernv/powernv_centaur.c optional powernv > +powerpc/powernv/powernv_xscom.c optional powernv > powerpc/powerpc/altivec.c optional powerpc | powerpc64 > powerpc/powerpc/autoconf.c standard > powerpc/powerpc/bcopy.c standard > > Modified: head/sys/powerpc/conf/GENERIC64 > ============================================================================== > --- head/sys/powerpc/conf/GENERIC64 Thu Mar 1 13:52:18 2018 (r330239) > +++ head/sys/powerpc/conf/GENERIC64 Thu Mar 1 14:11:07 2018 (r330240) > @@ -206,6 +206,7 @@ device fwe # Ethernet over FireWire (non-standard!) > > # Misc > device iicbus # I2C bus code > +device iic Please add a comment here. -Nathan From owner-svn-src-head@freebsd.org Thu Mar 1 17:47:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B786F3F194; Thu, 1 Mar 2018 17:47:29 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE0472189; Thu, 1 Mar 2018 17:47:29 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45ADA427C; Thu, 1 Mar 2018 17:47:29 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21HlTJH099004; Thu, 1 Mar 2018 17:47:29 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21HlSmM099002; Thu, 1 Mar 2018 17:47:28 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201803011747.w21HlSmM099002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 1 Mar 2018 17:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330245 - in head/usr.sbin/pw: . tests X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: in head/usr.sbin/pw: . tests X-SVN-Commit-Revision: 330245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 17:47:29 -0000 Author: dab Date: Thu Mar 1 17:47:28 2018 New Revision: 330245 URL: https://svnweb.freebsd.org/changeset/base/330245 Log: Allow the "@" and "!" characters in passwd file GECOS fields. Two PRs (152084 & 210187) request allowing the "@" and/or "!" characters in the passwd file GECOS field. The man page for pw does not mention that those characters are disallowed, Linux supports those characters in this field, and the "@" character in particular would be useful for storing email addresses in that field. PR: 152084, 210187 Submitted by: jschauma@netmeister.org, Dave Cottlehuber Reported by: jschauma@netmeister.org, Dave Cottlehuber Reviewed by: delphij (secteam), vangyzen MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14519 Modified: head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/tests/pw_useradd_test.sh Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Thu Mar 1 17:31:36 2018 (r330244) +++ head/usr.sbin/pw/pw_user.c Thu Mar 1 17:47:28 2018 (r330245) @@ -632,7 +632,7 @@ pw_checkname(char *name, int gecos) reject = 0; if (gecos) { /* See if the name is valid as a gecos (comment) field. */ - badchars = ":!@"; + badchars = ":"; showtype = "gecos field"; } else { /* See if the name is valid as a userid or group. */ Modified: head/usr.sbin/pw/tests/pw_useradd_test.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd_test.sh Thu Mar 1 17:31:36 2018 (r330244) +++ head/usr.sbin/pw/tests/pw_useradd_test.sh Thu Mar 1 17:47:28 2018 (r330245) @@ -27,9 +27,9 @@ atf_test_case user_add_comments user_add_comments_body() { populate_etc_skel - atf_check -s exit:0 ${PW} useradd test -c "Test User,work,123,456" - atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ - grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd + atf_check -s exit:0 ${PW} useradd test -c 'Test User,work!,123,user@example.com' + atf_check -s exit:0 -o match:'^test:.*:Test User,work!,123,user@example.com:' \ + grep '^test:.*:Test User,work!,123,user@example.com:' $HOME/master.passwd } # Test add user with comments and option -N From owner-svn-src-head@freebsd.org Thu Mar 1 19:50:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D600F23C1E; Thu, 1 Mar 2018 19:50:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B6A576E5B; Thu, 1 Mar 2018 19:50:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4644F56F6; Thu, 1 Mar 2018 19:50:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21JouXa059450; Thu, 1 Mar 2018 19:50:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21JotuM059447; Thu, 1 Mar 2018 19:50:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803011950.w21JotuM059447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Mar 2018 19:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330248 - in head: share/mk stand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/mk stand X-SVN-Commit-Revision: 330248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 19:50:56 -0000 Author: imp Date: Thu Mar 1 19:50:55 2018 New Revision: 330248 URL: https://svnweb.freebsd.org/changeset/base/330248 Log: Create LOADER_UBOOT, and LOADER_OFW. Move these options out of Makefile.${MACHINE_ARCH} and remove the now-empty files. Generate the *32 directories on the necessary architectures (well, currently only amd64) on the fly. Remove LOADER_EFI variable and co-locate it with EFI. Differential Review: https://reviews.freebsd.org/D14546 Deleted: head/stand/Makefile.arm head/stand/Makefile.arm64 head/stand/Makefile.i386 head/stand/Makefile.mips head/stand/Makefile.powerpc head/stand/Makefile.sparc64 Modified: head/share/mk/src.opts.mk head/stand/Makefile head/stand/Makefile.amd64 Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Mar 1 18:19:14 2018 (r330247) +++ head/share/mk/src.opts.mk Thu Mar 1 19:50:55 2018 (r330248) @@ -134,8 +134,9 @@ __DEFAULT_YES_OPTIONS = \ LPR \ LS_COLORS \ LZMA_SUPPORT \ - LOADER_EFI \ LOADER_GELI \ + LOADER_OFW \ + LOADER_UBOOT \ MAIL \ MAILWRAPPER \ MAKE \ @@ -297,8 +298,21 @@ BROKEN_OPTIONS+=SSP .endif # EFI doesn't exist on mips, powerpc, sparc or riscv. .if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} -BROKEN_OPTIONS+=EFI LOADER_EFI +BROKEN_OPTIONS+=EFI .endif +# GELI isn't supported on !x86 +.if ${__T} != "i386" && ${__T} != "amd64" +BROKEN_OPTIONS+=LOADER_GELI +.endif +# OFW is only for powerpc and sparc64, exclude others +.if ${__T:Mpowerpc*} == "" && ${__T:Msparc64} == "" +BROKEN_OPTIONS+=LOADER_OFW +.endif +# UBOOT is only for arm, mips and powerpc, exclude others +.if ${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == "" +BROKEN_OPTIONS+=LOADER_UBOOT +.endif + .if ${__T:Mmips64*} # profiling won't work on MIPS64 because there is only assembly for o32 BROKEN_OPTIONS+=PROFILE Modified: head/stand/Makefile ============================================================================== --- head/stand/Makefile Thu Mar 1 18:19:14 2018 (r330247) +++ head/stand/Makefile Thu Mar 1 19:50:55 2018 (r330248) @@ -2,28 +2,43 @@ .include -SUBDIR+= libsa -.if ${MK_FORTH} != "no" -# Build the add-in FORTH interpreter. -SUBDIR+= ficl -SUBDIR+= forth +# For amd64 we have to build 32 and 64 bit versions of things. For +# others we don't. LIB32LIST is a list of libraries, which if +# included, need to be built 32-bit as well. +.if ${MACHINE_ARCH} == "amd64" +LIB32LIST=libsa ficl liblua zfs .endif -.if ${MK_LOADER_LUA} != "no" -SUBDIR+= liblua -SUBDIR+= lua -.endif -SUBDIR+= defaults -SUBDIR+= man +S.yes+= libsa +S.${MK_FORTH}+= ficl +S.${MK_FORTH}+= forth +S.${MK_LOADER_LUA}+= liblua +S.${MK_LOADER_LUA}+= lua +S.${MK_FDT}+= fdt +S.${MK_LOADER_OFW}+= ofw +S.${MK_ZFS}+= zfs +S.yes+= defaults +S.yes+= man + +S.${MK_LOADER_GELI}+= geli + .include -.if ${MK_EFI} != "no" && ${MK_LOADER_EFI} != "no" -SUBDIR+= efi -.endif +S.${MK_EFI}+= efi +S.${MK_LOADER_UBOOT}+= uboot .if exists(${.CURDIR}/${MACHINE}/.) -SUBDIR+= ${MACHINE} +S.yes+= ${MACHINE} .endif + +# Build the actual subdir list from S.yes, adding in the 32-bit +# variant if necessary. +.for _x in ${S.yes} +SUBDIR+=${_x} +.if defined(LIB32LIST) && ${LIB32LIST:M${_x}} +SUBDIR+=${_x}32 +.endif +.endfor .include Modified: head/stand/Makefile.amd64 ============================================================================== --- head/stand/Makefile.amd64 Thu Mar 1 18:19:14 2018 (r330247) +++ head/stand/Makefile.amd64 Thu Mar 1 19:50:55 2018 (r330248) @@ -1,20 +1,4 @@ # $FreeBSD$ -SUBDIR+= libsa32 -.if ${MK_ZFS} != "no" -SUBDIR+= zfs zfs32 -.endif -.if ${MK_FORTH} != "no" -SUBDIR+= ficl32 -.endif -.if ${MK_LOADER_LUA} != "no" -SUBDIR+= liblua32 -.endif - -SUBDIR+= userboot - -.if ${MK_LOADER_GELI} == "yes" -SUBDIR+= geli -.endif - -SUBDIR+= i386 +S.yes+= userboot +S.yes+= i386 From owner-svn-src-head@freebsd.org Thu Mar 1 19:59:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA63F24944; Thu, 1 Mar 2018 19:59:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B92D77525; Thu, 1 Mar 2018 19:59:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 414A25861; Thu, 1 Mar 2018 19:59:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21Jxnx9063459; Thu, 1 Mar 2018 19:59:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21JxnVq063455; Thu, 1 Mar 2018 19:59:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803011959.w21JxnVq063455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 19:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330249 - in head/stand: efi i386 powerpc sparc64 uboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: efi i386 powerpc sparc64 uboot X-SVN-Commit-Revision: 330249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 19:59:50 -0000 Author: kevans Date: Thu Mar 1 19:59:49 2018 New Revision: 330249 URL: https://svnweb.freebsd.org/changeset/base/330249 Log: stand: Makefile SUBDIR cleanup Use SUBDIR.${MK_*} where appropriate. r330248 eliminated most of the offenders, sweep the rest under the rug. Differential Revision: https://reviews.freebsd.org/D14545 Modified: head/stand/efi/Makefile head/stand/i386/Makefile head/stand/powerpc/Makefile head/stand/sparc64/Makefile head/stand/uboot/Makefile Modified: head/stand/efi/Makefile ============================================================================== --- head/stand/efi/Makefile Thu Mar 1 19:50:55 2018 (r330248) +++ head/stand/efi/Makefile Thu Mar 1 19:59:49 2018 (r330249) @@ -8,10 +8,7 @@ NO_OBJ=t # than 4.5 supports it. .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 -.if ${MK_FDT} != "no" -SUBDIR+= fdt -.endif - +SUBDIR.${MK_FDT}+= fdt SUBDIR+= libefi loader boot1 .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Thu Mar 1 19:50:55 2018 (r330248) +++ head/stand/i386/Makefile Thu Mar 1 19:59:49 2018 (r330249) @@ -7,9 +7,7 @@ NO_OBJ=t SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ libi386 -.if ${MK_LOADER_FIREWIRE} == "yes" -SUBDIR+= libfirewire -.endif +SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire SUBDIR+= loader @@ -20,8 +18,6 @@ SUBDIR+= pxeldr SUBDIR+= kgzldr .endif -.if ${MK_ZFS} != "no" -SUBDIR+= zfsboot gptzfsboot zfsloader -.endif +SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot zfsloader .include Modified: head/stand/powerpc/Makefile ============================================================================== --- head/stand/powerpc/Makefile Thu Mar 1 19:50:55 2018 (r330248) +++ head/stand/powerpc/Makefile Thu Mar 1 19:59:49 2018 (r330249) @@ -5,8 +5,6 @@ NO_OBJ=t .include SUBDIR= boot1.chrp ofw uboot -.if ${MK_FDT} == "yes" -SUBDIR+= kboot -.endif +SUBDIR.${MK_FDT}+= kboot .include Modified: head/stand/sparc64/Makefile ============================================================================== --- head/stand/sparc64/Makefile Thu Mar 1 19:50:55 2018 (r330248) +++ head/stand/sparc64/Makefile Thu Mar 1 19:59:49 2018 (r330249) @@ -5,8 +5,6 @@ NO_OBJ=t .include SUBDIR= boot1 loader -.if ${MK_ZFS} != "no" -SUBDIR+=zfsboot zfsloader -.endif +SUBDIR.${MK_ZFS}+=zfsboot zfsloader .include Modified: head/stand/uboot/Makefile ============================================================================== --- head/stand/uboot/Makefile Thu Mar 1 19:50:55 2018 (r330248) +++ head/stand/uboot/Makefile Thu Mar 1 19:59:49 2018 (r330249) @@ -4,8 +4,6 @@ SUBDIR= lib -.if ${MK_FDT} != "no" -SUBDIR+=fdt -.endif +SUBDIR.${MK_FDT}+=fdt .include From owner-svn-src-head@freebsd.org Thu Mar 1 21:46:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46949F2CD99; Thu, 1 Mar 2018 21:46:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8C377BB7C; Thu, 1 Mar 2018 21:46:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3EA96A72; Thu, 1 Mar 2018 21:46:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21Lk1DI018406; Thu, 1 Mar 2018 21:46:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21Lk1ZE018401; Thu, 1 Mar 2018 21:46:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803012146.w21Lk1ZE018401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 21:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330250 - in head/stand: efi i386 powerpc sparc64 uboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: efi i386 powerpc sparc64 uboot X-SVN-Commit-Revision: 330250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:46:02 -0000 Author: kevans Date: Thu Mar 1 21:46:01 2018 New Revision: 330250 URL: https://svnweb.freebsd.org/changeset/base/330250 Log: stand: Fix build after r330249 One does not simply convert to SUBDIR.yes in stand without making everything else in the affected files SUBDIR.yes -- there are better ways to do this. Modified: head/stand/efi/Makefile head/stand/i386/Makefile head/stand/powerpc/Makefile head/stand/sparc64/Makefile head/stand/uboot/Makefile Modified: head/stand/efi/Makefile ============================================================================== --- head/stand/efi/Makefile Thu Mar 1 19:59:49 2018 (r330249) +++ head/stand/efi/Makefile Thu Mar 1 21:46:01 2018 (r330250) @@ -9,7 +9,7 @@ NO_OBJ=t .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 SUBDIR.${MK_FDT}+= fdt -SUBDIR+= libefi loader boot1 +SUBDIR.yes+= libefi loader boot1 .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Thu Mar 1 19:59:49 2018 (r330249) +++ head/stand/i386/Makefile Thu Mar 1 21:46:01 2018 (r330250) @@ -4,18 +4,18 @@ NO_OBJ=t .include -SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ +SUBDIR.yes= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ libi386 SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire -SUBDIR+= loader +SUBDIR.yes+= loader # special boot programs, 'self-extracting boot2+loader' -SUBDIR+= pxeldr +SUBDIR.yes+= pxeldr .if ${MACHINE_CPUARCH} == "i386" -SUBDIR+= kgzldr +SUBDIR.yes+= kgzldr .endif SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot zfsloader Modified: head/stand/powerpc/Makefile ============================================================================== --- head/stand/powerpc/Makefile Thu Mar 1 19:59:49 2018 (r330249) +++ head/stand/powerpc/Makefile Thu Mar 1 21:46:01 2018 (r330250) @@ -4,7 +4,7 @@ NO_OBJ=t .include -SUBDIR= boot1.chrp ofw uboot +SUBDIR.yes= boot1.chrp ofw uboot SUBDIR.${MK_FDT}+= kboot .include Modified: head/stand/sparc64/Makefile ============================================================================== --- head/stand/sparc64/Makefile Thu Mar 1 19:59:49 2018 (r330249) +++ head/stand/sparc64/Makefile Thu Mar 1 21:46:01 2018 (r330250) @@ -4,7 +4,7 @@ NO_OBJ=t .include -SUBDIR= boot1 loader +SUBDIR.yes= boot1 loader SUBDIR.${MK_ZFS}+=zfsboot zfsloader .include Modified: head/stand/uboot/Makefile ============================================================================== --- head/stand/uboot/Makefile Thu Mar 1 19:59:49 2018 (r330249) +++ head/stand/uboot/Makefile Thu Mar 1 21:46:01 2018 (r330250) @@ -2,7 +2,7 @@ .include -SUBDIR= lib +SUBDIR.yes= lib SUBDIR.${MK_FDT}+=fdt From owner-svn-src-head@freebsd.org Thu Mar 1 21:51:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7249CF2D25B; Thu, 1 Mar 2018 21:51:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24B4A7BEDB; Thu, 1 Mar 2018 21:51:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 053436BAD; Thu, 1 Mar 2018 21:51:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21LpKAE020210; Thu, 1 Mar 2018 21:51:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21LpKZU020209; Thu, 1 Mar 2018 21:51:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803012151.w21LpKZU020209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 21:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330251 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 330251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:51:21 -0000 Author: kevans Date: Thu Mar 1 21:51:20 2018 New Revision: 330251 URL: https://svnweb.freebsd.org/changeset/base/330251 Log: Remove LOADER_EFI description files LOADER_EFI functionality got folded into EFI as of r330248. Deleted: head/tools/build/options/WITHOUT_LOADER_EFI head/tools/build/options/WITH_LOADER_EFI From owner-svn-src-head@freebsd.org Thu Mar 1 21:57:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E316AF2D9B3; Thu, 1 Mar 2018 21:57:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 970D47C3E2; Thu, 1 Mar 2018 21:57:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C7776C00; Thu, 1 Mar 2018 21:57:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21Lv9Da023549; Thu, 1 Mar 2018 21:57:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21Lv9jm023545; Thu, 1 Mar 2018 21:57:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803012157.w21Lv9jm023545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 21:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330252 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 330252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:57:10 -0000 Author: kevans Date: Thu Mar 1 21:57:08 2018 New Revision: 330252 URL: https://svnweb.freebsd.org/changeset/base/330252 Log: MFC after: 1 week Added: head/tools/build/options/WITHOUT_LOADER_OFW (contents, props changed) head/tools/build/options/WITHOUT_LOADER_UBOOT (contents, props changed) head/tools/build/options/WITH_LOADER_OFW (contents, props changed) head/tools/build/options/WITH_LOADER_UBOOT (contents, props changed) Added: head/tools/build/options/WITHOUT_LOADER_OFW ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_OFW Thu Mar 1 21:57:08 2018 (r330252) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable building of openfirmware bootloader components. Added: head/tools/build/options/WITHOUT_LOADER_UBOOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_UBOOT Thu Mar 1 21:57:08 2018 (r330252) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable building of ubldr. Added: head/tools/build/options/WITH_LOADER_OFW ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_OFW Thu Mar 1 21:57:08 2018 (r330252) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build openfirmware bootloader components. Added: head/tools/build/options/WITH_LOADER_UBOOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_UBOOT Thu Mar 1 21:57:08 2018 (r330252) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build ubldr. From owner-svn-src-head@freebsd.org Thu Mar 1 21:59:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40EB5F2DC50; Thu, 1 Mar 2018 21:59:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB5007C5D6; Thu, 1 Mar 2018 21:59:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7EF76C01; Thu, 1 Mar 2018 21:59:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21LxUXA023681; Thu, 1 Mar 2018 21:59:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21LxUQY023680; Thu, 1 Mar 2018 21:59:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803012159.w21LxUQY023680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 21:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330253 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 330253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:59:31 -0000 Author: kevans Date: Thu Mar 1 21:59:30 2018 New Revision: 330253 URL: https://svnweb.freebsd.org/changeset/base/330253 Log: Back out r330252; will reapply with an actual commit message Deleted: head/tools/build/options/WITHOUT_LOADER_OFW head/tools/build/options/WITHOUT_LOADER_UBOOT head/tools/build/options/WITH_LOADER_OFW head/tools/build/options/WITH_LOADER_UBOOT From owner-svn-src-head@freebsd.org Thu Mar 1 22:00:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 745E2F2DD71; Thu, 1 Mar 2018 22:00:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 271557C75E; Thu, 1 Mar 2018 22:00:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 222D76C0B; Thu, 1 Mar 2018 22:00:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21M0dJ1023841; Thu, 1 Mar 2018 22:00:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21M0cEY023837; Thu, 1 Mar 2018 22:00:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803012200.w21M0cEY023837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 22:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330254 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 330254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:00:39 -0000 Author: kevans Date: Thu Mar 1 22:00:38 2018 New Revision: 330254 URL: https://svnweb.freebsd.org/changeset/base/330254 Log: Add descriptions for recently added loader options Added: head/tools/build/options/WITHOUT_LOADER_OFW - copied unchanged from r330252, head/tools/build/options/WITHOUT_LOADER_OFW head/tools/build/options/WITHOUT_LOADER_UBOOT - copied unchanged from r330252, head/tools/build/options/WITHOUT_LOADER_UBOOT head/tools/build/options/WITH_LOADER_OFW - copied unchanged from r330252, head/tools/build/options/WITH_LOADER_OFW head/tools/build/options/WITH_LOADER_UBOOT - copied unchanged from r330252, head/tools/build/options/WITH_LOADER_UBOOT Copied: head/tools/build/options/WITHOUT_LOADER_OFW (from r330252, head/tools/build/options/WITHOUT_LOADER_OFW) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_OFW Thu Mar 1 22:00:38 2018 (r330254, copy of r330252, head/tools/build/options/WITHOUT_LOADER_OFW) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable building of openfirmware bootloader components. Copied: head/tools/build/options/WITHOUT_LOADER_UBOOT (from r330252, head/tools/build/options/WITHOUT_LOADER_UBOOT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_UBOOT Thu Mar 1 22:00:38 2018 (r330254, copy of r330252, head/tools/build/options/WITHOUT_LOADER_UBOOT) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable building of ubldr. Copied: head/tools/build/options/WITH_LOADER_OFW (from r330252, head/tools/build/options/WITH_LOADER_OFW) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_OFW Thu Mar 1 22:00:38 2018 (r330254, copy of r330252, head/tools/build/options/WITH_LOADER_OFW) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build openfirmware bootloader components. Copied: head/tools/build/options/WITH_LOADER_UBOOT (from r330252, head/tools/build/options/WITH_LOADER_UBOOT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_UBOOT Thu Mar 1 22:00:38 2018 (r330254, copy of r330252, head/tools/build/options/WITH_LOADER_UBOOT) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build ubldr. From owner-svn-src-head@freebsd.org Thu Mar 1 22:04:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8FF5F2E241; Thu, 1 Mar 2018 22:04:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 596DA7CBD1; Thu, 1 Mar 2018 22:04:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 504F56DA8; Thu, 1 Mar 2018 22:04:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21M4q4l028339; Thu, 1 Mar 2018 22:04:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21M4qXm028338; Thu, 1 Mar 2018 22:04:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803012204.w21M4qXm028338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Mar 2018 22:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330255 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 330255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:04:52 -0000 Author: kevans Date: Thu Mar 1 22:04:51 2018 New Revision: 330255 URL: https://svnweb.freebsd.org/changeset/base/330255 Log: Regenerate src.conf(5) after r330254 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Mar 1 22:00:38 2018 (r330254) +++ head/share/man/man5/src.conf.5 Thu Mar 1 22:04:51 2018 (r330255) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 28, 2018 +.Dd March 1, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1020,23 +1020,36 @@ Set to use LLVM's libunwind stack unwinder (instead of .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. -.It Va WITHOUT_LOADER_EFI -Set to disable building of EFI bootloader components. -.Pp -This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. -.It Va WITH_LOADER_EFI -Set to build EFI bootloader components. -.Pp -This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader and /boot/zfsloader on x86. This option is a nop on all other platforms. .It Va WITHOUT_LOADER_GELI Disable inclusion of GELI crypto support in the boot chain binaries. +.Pp +This is a default setting on +arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LOADER_LUA Set to build LUA bindings for the boot loader. +.It Va WITHOUT_LOADER_OFW +Disable building of openfirmware bootloader components. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. +.It Va WITH_LOADER_OFW +Set to build openfirmware bootloader components. +.Pp +This is a default setting on +powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +.It Va WITHOUT_LOADER_UBOOT +Disable building of ubldr. +.Pp +This is a default setting on +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LOADER_UBOOT +Set to build ubldr. +.Pp +This is a default setting on +arm/arm, arm/armeb, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LOCALES Set to not build localization files; see .Xr locale 1 . From owner-svn-src-head@freebsd.org Thu Mar 1 22:38:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67FE4F30800; Thu, 1 Mar 2018 22:38:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 198BA7DFB8; Thu, 1 Mar 2018 22:38:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 130DD727D; Thu, 1 Mar 2018 22:38:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21McLuY043346; Thu, 1 Mar 2018 22:38:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21McL5j043345; Thu, 1 Mar 2018 22:38:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803012238.w21McL5j043345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 22:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330256 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 330256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:38:22 -0000 Author: eadler Date: Thu Mar 1 22:38:21 2018 New Revision: 330256 URL: https://svnweb.freebsd.org/changeset/base/330256 Log: sys/sys: Use a more common spelling of 'dirent' Submitted by: Domagoj Stolfa MFC After: 3 days Modified: head/sys/sys/dirent.h Modified: head/sys/sys/dirent.h ============================================================================== --- head/sys/sys/dirent.h Thu Mar 1 22:04:51 2018 (r330255) +++ head/sys/sys/dirent.h Thu Mar 1 22:38:21 2018 (r330256) @@ -112,7 +112,7 @@ struct freebsd11_dirent { /* * The _GENERIC_DIRSIZ macro gives the minimum record length which will hold - * the directory entry. This returns the amount of space in struct direct + * the directory entry. This returns the amount of space in struct dirent * without the d_name field, plus enough space for the name with a terminating * null byte (dp->d_namlen+1), rounded up to a 8 byte boundary. * From owner-svn-src-head@freebsd.org Thu Mar 1 22:57:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D87D0F31C82; Thu, 1 Mar 2018 22:57:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 848C07ED0B; Thu, 1 Mar 2018 22:57:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ABD175AD; Thu, 1 Mar 2018 22:57:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21MvE6h053315; Thu, 1 Mar 2018 22:57:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21MvElX053313; Thu, 1 Mar 2018 22:57:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803012257.w21MvElX053313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 1 Mar 2018 22:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330257 - in head/sys: dev/efidev sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: dev/efidev sys X-SVN-Commit-Revision: 330257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:57:15 -0000 Author: ian Date: Thu Mar 1 22:57:14 2018 New Revision: 330257 URL: https://svnweb.freebsd.org/changeset/base/330257 Log: Add a function to retrieve the EFI realtime clock capabilities. Modified: head/sys/dev/efidev/efirt.c head/sys/sys/efi.h Modified: head/sys/dev/efidev/efirt.c ============================================================================== --- head/sys/dev/efidev/efirt.c Thu Mar 1 22:38:21 2018 (r330256) +++ head/sys/dev/efidev/efirt.c Thu Mar 1 22:57:14 2018 (r330257) @@ -241,7 +241,7 @@ efi_get_table(struct uuid *uuid, void **ptr) } static int -efi_get_time_locked(struct efi_tm *tm) +efi_get_time_locked(struct efi_tm *tm, struct efi_tmcap *tmcap) { efi_status status; int error; @@ -250,7 +250,7 @@ efi_get_time_locked(struct efi_tm *tm) error = efi_enter(); if (error != 0) return (error); - status = efi_runtime->rt_gettime(tm, NULL); + status = efi_runtime->rt_gettime(tm, tmcap); efi_leave(); error = efi_status_to_errno(status); return (error); @@ -264,7 +264,21 @@ efi_get_time(struct efi_tm *tm) if (efi_runtime == NULL) return (ENXIO); EFI_TIME_LOCK() - error = efi_get_time_locked(tm); + error = efi_get_time_locked(tm, NULL); + EFI_TIME_UNLOCK() + return (error); +} + +int +efi_get_time_capabilities(struct efi_tmcap *tmcap) +{ + struct efi_tm dummy; + int error; + + if (efi_runtime == NULL) + return (ENXIO); + EFI_TIME_LOCK() + error = efi_get_time_locked(&dummy, tmcap); EFI_TIME_UNLOCK() return (error); } Modified: head/sys/sys/efi.h ============================================================================== --- head/sys/sys/efi.h Thu Mar 1 22:38:21 2018 (r330256) +++ head/sys/sys/efi.h Thu Mar 1 22:57:14 2018 (r330257) @@ -179,6 +179,7 @@ void efi_destroy_1t1_map(void); int efi_rt_ok(void); int efi_get_table(struct uuid *uuid, void **ptr); int efi_get_time(struct efi_tm *tm); +int efi_get_time_capabilities(struct efi_tmcap *tmcap); int efi_reset_system(void); int efi_set_time(struct efi_tm *tm); int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib, From owner-svn-src-head@freebsd.org Fri Mar 2 00:56:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8809AF3986F; Fri, 2 Mar 2018 00:56:52 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7C0E83110; Fri, 2 Mar 2018 00:56:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w220ugM9027821; Thu, 1 Mar 2018 16:56:42 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w220ugMV027820; Thu, 1 Mar 2018 16:56:42 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803020056.w220ugMV027820@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330256 - head/sys/sys In-Reply-To: <201803012238.w21McL5j043345@repo.freebsd.org> To: Eitan Adler Date: Thu, 1 Mar 2018 16:56:42 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 00:56:52 -0000 > Author: eadler > Date: Thu Mar 1 22:38:21 2018 > New Revision: 330256 > URL: https://svnweb.freebsd.org/changeset/base/330256 > > Log: > sys/sys: Use a more common spelling of 'dirent' Actually, correct missed rename of direct to dirent, the name of this structure in 4.2/4.3 was direct, posix renamed it to dirent. The comment probably got missed when the rest of the file was changed. > Submitted by: Domagoj Stolfa > MFC After: 3 days > > Modified: > head/sys/sys/dirent.h > > Modified: head/sys/sys/dirent.h > ============================================================================== > --- head/sys/sys/dirent.h Thu Mar 1 22:04:51 2018 (r330255) > +++ head/sys/sys/dirent.h Thu Mar 1 22:38:21 2018 (r330256) > @@ -112,7 +112,7 @@ struct freebsd11_dirent { > > /* > * The _GENERIC_DIRSIZ macro gives the minimum record length which will hold > - * the directory entry. This returns the amount of space in struct direct > + * the directory entry. This returns the amount of space in struct dirent > * without the d_name field, plus enough space for the name with a terminating > * null byte (dp->d_namlen+1), rounded up to a 8 byte boundary. > * > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Mar 2 01:53:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DDAEF3D03A; Fri, 2 Mar 2018 01:53:52 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6BC984DEC; Fri, 2 Mar 2018 01:53:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B18C71126F; Fri, 2 Mar 2018 01:53:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w221rpaO043148; Fri, 2 Mar 2018 01:53:51 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w221rpD1043143; Fri, 2 Mar 2018 01:53:51 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201803020153.w221rpD1043143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 2 Mar 2018 01:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330260 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake X-SVN-Commit-Revision: 330260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 01:53:52 -0000 Author: sjg Date: Fri Mar 2 01:53:50 2018 New Revision: 330260 URL: https://svnweb.freebsd.org/changeset/base/330260 Log: Update to bmake-201802222 Fixes segfault in Var_Set if val is NULL Don't treat .info as warning with -W Added: head/contrib/bmake/mk/ldorder.mk - copied unchanged from r330259, vendor/NetBSD/bmake/dist/mk/ldorder.mk Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile.config.in head/contrib/bmake/VERSION head/contrib/bmake/aclocal.m4 head/contrib/bmake/bmake.cat1 head/contrib/bmake/configure head/contrib/bmake/configure.in head/contrib/bmake/job.c head/contrib/bmake/make.h head/contrib/bmake/meta.c head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/FILES head/contrib/bmake/mk/auto.obj.mk head/contrib/bmake/mk/dpadd.mk head/contrib/bmake/mk/final.mk head/contrib/bmake/mk/gendirdeps.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/lib.mk head/contrib/bmake/mk/own.mk head/contrib/bmake/mk/prog.mk head/contrib/bmake/mk/sys.mk head/contrib/bmake/mk/sys.vars.mk head/contrib/bmake/os.sh head/contrib/bmake/parse.c head/contrib/bmake/stresep.c head/contrib/bmake/unit-tests/varcmd.exp head/contrib/bmake/unit-tests/varcmd.mk head/contrib/bmake/var.c head/usr.bin/bmake/Makefile.config head/usr.bin/bmake/Makefile.inc head/usr.bin/bmake/config.h Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Thu Mar 1 23:46:02 2018 (r330259) +++ head/contrib/bmake/ChangeLog Fri Mar 2 01:53:50 2018 (r330260) @@ -1,3 +1,44 @@ +2018-02-22 Simon J. Gerraty + + * VERSION: 20180222 + Merge with NetBSD make, pick up + o parse.c: avoid calling sysconf for every call to loadfile + +2018-02-18 Simon J. Gerraty + + * VERSION: 20180218 + Merge with NetBSD make, pick up + o var.c: Var_Set handle NULL value anytime. + +2018-02-12 Simon J. Gerraty + + * VERSION: 20180212 + Merge with NetBSD make, pick up + o parse.c: do not treat .info as warning with -W + +2017-12-07 Simon J. Gerraty + + * VERSION: 20171207 + Merge with NetBSD make, pick up + o var.c: Var_Append use Var_Set if var not previously set + so that VAR_CMD is handled correctly. + Add a suitable unit-test. + +2017-11-26 Simon J. Gerraty + + * VERSION (_MAKE_VERSION): 20171126 + + * aclocal.m4: use AC_LINK_IFELSE for AC_C___ATTRIBUTE__ + since AC_TRY_COMPILE puts input inside main() + which upsets modern compilers. + +2017-11-18 Simon J. Gerraty + + * VERSION: 20171118 + Merge with NetBSD make, pick up + o var.c: do not append to variable set on command line + add unit-test to catch this. + 2017-10-28 Simon J. Gerraty * VERSION: 20171028 Modified: head/contrib/bmake/Makefile.config.in ============================================================================== --- head/contrib/bmake/Makefile.config.in Thu Mar 1 23:46:02 2018 (r330259) +++ head/contrib/bmake/Makefile.config.in Fri Mar 2 01:53:50 2018 (r330260) @@ -15,7 +15,7 @@ LDFLAGS= @LDFLAGS@ LIBOBJS= @LIBOBJS@ LDADD= @LIBS@ USE_META= @use_meta@ -FILEMON_H= @filemon_h@ +FILEMON_H?= @filemon_h@ BMAKE_PATH_MAX?= @bmake_path_max@ # used if MAXPATHLEN not defined CPPFLAGS+= -DBMAKE_PATH_MAX=${BMAKE_PATH_MAX} Modified: head/contrib/bmake/VERSION ============================================================================== --- head/contrib/bmake/VERSION Thu Mar 1 23:46:02 2018 (r330259) +++ head/contrib/bmake/VERSION Fri Mar 2 01:53:50 2018 (r330260) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20171028 +_MAKE_VERSION=20180222 Modified: head/contrib/bmake/aclocal.m4 ============================================================================== --- head/contrib/bmake/aclocal.m4 Thu Mar 1 23:46:02 2018 (r330259) +++ head/contrib/bmake/aclocal.m4 Fri Mar 2 01:53:50 2018 (r330260) @@ -1,5 +1,5 @@ dnl RCSid: -dnl $Id: aclocal.m4,v 1.5 2003/03/06 21:21:30 sjg Exp $ +dnl $Id: aclocal.m4,v 1.6 2017/11/26 22:39:20 sjg Exp $ dnl dnl @@ -55,16 +55,21 @@ dnl AC_DEFUN(AC_C___ATTRIBUTE__, [ AC_MSG_CHECKING(for __attribute__) AC_CACHE_VAL(ac_cv___attribute__, [ -AC_TRY_COMPILE([ +AC_LINK_IFELSE([ #include -], -[ + static void foo(void) __attribute__ ((noreturn)); static void foo(void) { exit(1); +} + +int +main(int argc, char **argv) +{ + foo(); } ], ac_cv___attribute__=yes, Modified: head/contrib/bmake/bmake.cat1 ============================================================================== --- head/contrib/bmake/bmake.cat1 Thu Mar 1 23:46:02 2018 (r330259) +++ head/contrib/bmake/bmake.cat1 Fri Mar 2 01:53:50 2018 (r330260) @@ -1,73 +1,73 @@ -BMAKE(1) NetBSD General Commands Manual BMAKE(1) +BMAKE(1) FreeBSD General Commands Manual BMAKE(1) -NNAAMMEE - bbmmaakkee -- maintain program dependencies +NAME + bmake -- maintain program dependencies -SSYYNNOOPPSSIISS - bbmmaakkee [--BBeeiikkNNnnqqrrssttWWwwXX] [--CC _d_i_r_e_c_t_o_r_y] [--DD _v_a_r_i_a_b_l_e] [--dd _f_l_a_g_s] - [--ff _m_a_k_e_f_i_l_e] [--II _d_i_r_e_c_t_o_r_y] [--JJ _p_r_i_v_a_t_e] [--jj _m_a_x___j_o_b_s] - [--mm _d_i_r_e_c_t_o_r_y] [--TT _f_i_l_e] [--VV _v_a_r_i_a_b_l_e] [--vv _v_a_r_i_a_b_l_e] - [_v_a_r_i_a_b_l_e_=_v_a_l_u_e] [_t_a_r_g_e_t _._._.] +SYNOPSIS + bmake [-BeikNnqrstWwX] [-C directory] [-D variable] [-d flags] + [-f makefile] [-I directory] [-J private] [-j max_jobs] + [-m directory] [-T file] [-V variable] [-v variable] + [variable=value] [target ...] -DDEESSCCRRIIPPTTIIOONN - bbmmaakkee is a program designed to simplify the maintenance of other pro- +DESCRIPTION + bmake is a program designed to simplify the maintenance of other pro- grams. Its input is a list of specifications as to the files upon which - programs and other files depend. If no --ff _m_a_k_e_f_i_l_e makefile option is - given, bbmmaakkee will try to open `_m_a_k_e_f_i_l_e' then `_M_a_k_e_f_i_l_e' in order to find - the specifications. If the file `_._d_e_p_e_n_d' exists, it is read (see + programs and other files depend. If no -f makefile makefile option is + given, bmake will try to open `makefile' then `Makefile' in order to find + the specifications. If the file `.depend' exists, it is read (see mkdep(1)). This manual page is intended as a reference document only. For a more - thorough description of bbmmaakkee and makefiles, please refer to _P_M_a_k_e _- _A - _T_u_t_o_r_i_a_l. + thorough description of bmake and makefiles, please refer to PMake - A + Tutorial. - bbmmaakkee will prepend the contents of the _M_A_K_E_F_L_A_G_S environment variable to + bmake will prepend the contents of the MAKEFLAGS environment variable to the command line arguments before parsing them. The options are as follows: - --BB Try to be backwards compatible by executing a single shell per + -B Try to be backwards compatible by executing a single shell per command and by executing the commands to make the sources of a dependency line in sequence. - --CC _d_i_r_e_c_t_o_r_y - Change to _d_i_r_e_c_t_o_r_y before reading the makefiles or doing any- - thing else. If multiple --CC options are specified, each is inter- - preted relative to the previous one: --CC _/ --CC _e_t_c is equivalent to - --CC _/_e_t_c. + -C directory + Change to directory before reading the makefiles or doing any- + thing else. If multiple -C options are specified, each is inter- + preted relative to the previous one: -C / -C etc is equivalent to + -C /etc. - --DD _v_a_r_i_a_b_l_e - Define _v_a_r_i_a_b_l_e to be 1, in the global context. + -D variable + Define variable to be 1, in the global context. - --dd _[_-_]_f_l_a_g_s - Turn on debugging, and specify which portions of bbmmaakkee are to + -d [-]flags + Turn on debugging, and specify which portions of bmake are to print debugging information. Unless the flags are preceded by - `-' they are added to the _M_A_K_E_F_L_A_G_S environment variable and will + `-' they are added to the MAKEFLAGS environment variable and will be processed by any child make processes. By default, debugging information is printed to standard error, but this can be changed - using the _F debugging flag. The debugging output is always + using the F debugging flag. The debugging output is always unbuffered; in addition, if debugging is enabled but debugging output is not directed to standard output, then the standard out- - put is line buffered. _F_l_a_g_s is one or more of the following: + put is line buffered. Flags is one or more of the following: - _A Print all possible debugging information; equivalent to + A Print all possible debugging information; equivalent to specifying all of the debugging flags. - _a Print debugging information about archive searching and + a Print debugging information about archive searching and caching. - _C Print debugging information about current working direc- + C Print debugging information about current working direc- tory. - _c Print debugging information about conditional evaluation. + c Print debugging information about conditional evaluation. - _d Print debugging information about directory searching and + d Print debugging information about directory searching and caching. - _e Print debugging information about failed commands and + e Print debugging information about failed commands and targets. - _F[++]_f_i_l_e_n_a_m_e + F[+]filename Specify where debugging output is written. This must be the last flag, because it consumes the remainder of the argument. If the character immediately after the `F' @@ -80,80 +80,80 @@ DDEESSCCRRIIPPTTIIOONN named file. If the file name ends `.%d' then the `%d' is replaced by the pid. - _f Print debugging information about loop evaluation. + f Print debugging information about loop evaluation. - _g_1 Print the input graph before making anything. + g1 Print the input graph before making anything. - _g_2 Print the input graph after making everything, or before + g2 Print the input graph after making everything, or before exiting on error. - _g_3 Print the input graph before exiting on error. + g3 Print the input graph before exiting on error. - _j Print debugging information about running multiple + j Print debugging information about running multiple shells. - _l Print commands in Makefiles regardless of whether or not + l Print commands in Makefiles regardless of whether or not they are prefixed by `@' or other "quiet" flags. Also known as "loud" behavior. - _M Print debugging information about "meta" mode decisions + M Print debugging information about "meta" mode decisions about targets. - _m Print debugging information about making targets, includ- + m Print debugging information about making targets, includ- ing modification dates. - _n Don't delete the temporary command scripts created when + n Don't delete the temporary command scripts created when running commands. These temporary scripts are created in the directory referred to by the TMPDIR environment vari- - able, or in _/_t_m_p if TMPDIR is unset or set to the empty + able, or in /tmp if TMPDIR is unset or set to the empty string. The temporary scripts are created by mkstemp(3), - and have names of the form _m_a_k_e_X_X_X_X_X_X. _N_O_T_E: This can - create many files in TMPDIR or _/_t_m_p, so use with care. + and have names of the form makeXXXXXX. NOTE: This can + create many files in TMPDIR or /tmp, so use with care. - _p Print debugging information about makefile parsing. + p Print debugging information about makefile parsing. - _s Print debugging information about suffix-transformation + s Print debugging information about suffix-transformation rules. - _t Print debugging information about target list mainte- + t Print debugging information about target list mainte- nance. - _V Force the --VV option to print raw values of variables, + V Force the -V option to print raw values of variables, overriding the default behavior set via - _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S. + .MAKE.EXPAND_VARIABLES. - _v Print debugging information about variable assignment. + v Print debugging information about variable assignment. - _x Run shell commands with --xx so the actual commands are + x Run shell commands with -x so the actual commands are printed as they are executed. - --ee Specify that environment variables override macro assignments + -e Specify that environment variables override macro assignments within makefiles. - --ff _m_a_k_e_f_i_l_e - Specify a makefile to read instead of the default `_m_a_k_e_f_i_l_e'. If - _m_a_k_e_f_i_l_e is `--', standard input is read. Multiple makefiles may + -f makefile + Specify a makefile to read instead of the default `makefile'. If + makefile is `-', standard input is read. Multiple makefiles may be specified, and are read in the order specified. - --II _d_i_r_e_c_t_o_r_y + -I directory Specify a directory in which to search for makefiles and included makefiles. The system makefile directory (or directories, see - the --mm option) is automatically included as part of this list. + the -m option) is automatically included as part of this list. - --ii Ignore non-zero exit of shell commands in the makefile. Equiva- - lent to specifying `--' before each command line in the makefile. + -i Ignore non-zero exit of shell commands in the makefile. Equiva- + lent to specifying `-' before each command line in the makefile. - --JJ _p_r_i_v_a_t_e - This option should _n_o_t be specified by the user. + -J private + This option should not be specified by the user. - When the _j option is in use in a recursive build, this option is + When the j option is in use in a recursive build, this option is passed by a make to child makes to allow all the make processes in the build to cooperate to avoid overloading the system. - --jj _m_a_x___j_o_b_s - Specify the maximum number of jobs that bbmmaakkee may have running at - any one time. The value is saved in _._M_A_K_E_._J_O_B_S. Turns compati- - bility mode off, unless the _B flag is also specified. When com- + -j max_jobs + Specify the maximum number of jobs that bmake may have running at + any one time. The value is saved in .MAKE.JOBS. Turns compati- + bility mode off, unless the B flag is also specified. When com- patibility mode is off, all commands associated with a target are executed in a single shell invocation as opposed to the tradi- tional one shell invocation per line. This can break traditional @@ -162,90 +162,90 @@ DDEESSCCRRIIPPTTIIOONN It is more efficient to correct the scripts rather than turn backwards compatibility on. - --kk Continue processing after errors are encountered, but only on + -k Continue processing after errors are encountered, but only on those targets that do not depend on the target whose creation caused the error. - --mm _d_i_r_e_c_t_o_r_y + -m directory Specify a directory in which to search for sys.mk and makefiles - included via the <_f_i_l_e>-style include statement. The --mm option + included via the <file>-style include statement. The -m option can be used multiple times to form a search path. This path will override the default system include path: /usr/share/mk. Fur- thermore the system include path will be appended to the search - path used for "_f_i_l_e"-style include statements (see the --II + path used for "file"-style include statements (see the -I option). - If a file or directory name in the --mm argument (or the + If a file or directory name in the -m argument (or the MAKESYSPATH environment variable) starts with the string ".../" - then bbmmaakkee will search for the specified file or directory named + then bmake will search for the specified file or directory named in the remaining part of the argument string. The search starts with the current directory of the Makefile and then works upward towards the root of the file system. If the search is success- ful, then the resulting directory replaces the ".../" specifica- - tion in the --mm argument. If used, this feature allows bbmmaakkee to + tion in the -m argument. If used, this feature allows bmake to easily search in the current source tree for customized sys.mk files (e.g., by using ".../mk/sys.mk" as an argument). - --nn Display the commands that would have been executed, but do not + -n Display the commands that would have been executed, but do not actually execute them unless the target depends on the .MAKE spe- cial source (see below). - --NN Display the commands which would have been executed, but do not + -N Display the commands which would have been executed, but do not actually execute any of them; useful for debugging top-level makefiles without descending into subdirectories. - --qq Do not execute any commands, but exit 0 if the specified targets + -q Do not execute any commands, but exit 0 if the specified targets are up-to-date and 1, otherwise. - --rr Do not use the built-in rules specified in the system makefile. + -r Do not use the built-in rules specified in the system makefile. - --ss Do not echo any commands as they are executed. Equivalent to - specifying `@@' before each command line in the makefile. + -s Do not echo any commands as they are executed. Equivalent to + specifying `@' before each command line in the makefile. - --TT _t_r_a_c_e_f_i_l_e - When used with the --jj flag, append a trace record to _t_r_a_c_e_f_i_l_e + -T tracefile + When used with the -j flag, append a trace record to tracefile for each job started and completed. - --tt Rather than re-building a target as specified in the makefile, + -t Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up- to-date. - --VV _v_a_r_i_a_b_l_e - Print the value of _v_a_r_i_a_b_l_e. Do not build any targets. Multiple + -V variable + Print the value of variable. Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or unde- fined variable. The value printed is extracted from the global context after all makefiles have been read. By default, the raw variable contents (which may include additional unexpanded vari- - able references) are shown. If _v_a_r_i_a_b_l_e contains a `$' then the + able references) are shown. If variable contains a `$' then the value will be recursively expanded to its complete resultant text before printing. The expanded value will also be printed if - _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S is set to true and the --ddVV option has not + .MAKE.EXPAND_VARIABLES is set to true and the -dV option has not been used to override it. Note that loop-local and target-local variables, as well as values taken temporarily by global vari- ables during makefile processing, are not accessible via this - option. The --ddvv debug mode can be used to see these at the cost + option. The -dv debug mode can be used to see these at the cost of generating substantial extraneous output. - --vv _v_a_r_i_a_b_l_e - Like --VV but the variable is always expanded to its complete + -v variable + Like -V but the variable is always expanded to its complete value. - --WW Treat any warnings during makefile parsing as errors. + -W Treat any warnings during makefile parsing as errors. - --ww Print entering and leaving directory messages, pre and post pro- + -w Print entering and leaving directory messages, pre and post pro- cessing. - --XX Don't export variables passed on the command line to the environ- + -X Don't export variables passed on the command line to the environ- ment individually. Variables passed on the command line are - still exported via the _M_A_K_E_F_L_A_G_S environment variable. This + still exported via the MAKEFLAGS environment variable. This option may be useful on systems which have a small limit on the size of command arguments. - _v_a_r_i_a_b_l_e_=_v_a_l_u_e - Set the value of the variable _v_a_r_i_a_b_l_e to _v_a_l_u_e. Normally, all + variable=value + Set the value of the variable variable to value. Normally, all values passed on the command line are also exported to sub-makes - in the environment. The --XX flag disables this behavior. Vari- + in the environment. The -X flag disables this behavior. Vari- able assignments should follow options for POSIX compatibility but no ordering is enforced. @@ -257,28 +257,28 @@ DDEESSCCRRIIPPTTIIOONN them with a backslash (`\'). The trailing newline character and initial whitespace on the following line are compressed into a single space. -FFIILLEE DDEEPPEENNDDEENNCCYY SSPPEECCIIFFIICCAATTIIOONNSS +FILE DEPENDENCY SPECIFICATIONS Dependency lines consist of one or more targets, an operator, and zero or more sources. This creates a relationship where the targets ``depend'' on the sources and are usually created from them. The exact relationship between the target and the source is determined by the operator that sep- arates them. The three operators are as follows: - :: A target is considered out-of-date if its modification time is less + : A target is considered out-of-date if its modification time is less than those of any of its sources. Sources for a target accumulate over dependency lines when this operator is used. The target is - removed if bbmmaakkee is interrupted. + removed if bmake is interrupted. - !! Targets are always re-created, but not until all sources have been + ! Targets are always re-created, but not until all sources have been examined and re-created as necessary. Sources for a target accumu- late over dependency lines when this operator is used. The target - is removed if bbmmaakkee is interrupted. + is removed if bmake is interrupted. - :::: If no sources are specified, the target is always re-created. Oth- + :: If no sources are specified, the target is always re-created. Oth- erwise, a target is considered out-of-date if any of its sources has been modified more recently than the target. Sources for a target do not accumulate over dependency lines when this operator - is used. The target will not be removed if bbmmaakkee is interrupted. + is used. The target will not be removed if bmake is interrupted. Targets and sources may contain the shell wildcard values `?', `*', `[]', and `{}'. The values `?', `*', and `[]' may only be used as part of the @@ -287,37 +287,37 @@ FFIILLEE DDEEPPEENNDDEENNCCYY SSPPEEC existing files. Expansion is in directory order, not alphabetically as done in the shell. -SSHHEELLLL CCOOMMMMAANNDDSS +SHELL COMMANDS Each target may have associated with it one or more lines of shell com- mands, normally used to create the target. Each of the lines in this - script _m_u_s_t be preceded by a tab. (For historical reasons, spaces are + script must be preceded by a tab. (For historical reasons, spaces are not accepted.) While targets can appear in many dependency lines if desired, by default only one of these rules may be followed by a creation - script. If the `::::' operator is used, however, all rules may include + script. If the `::' operator is used, however, all rules may include scripts and the scripts are executed in the order found. Each line is treated as a separate shell command, unless the end of line is escaped with a backslash (`\') in which case that line and the next are combined. If the first characters of the command are any combination - of `@@', `++', or `--', the command is treated specially. A `@@' causes the - command not to be echoed before it is executed. A `++' causes the command - to be executed even when --nn is given. This is similar to the effect of + of `@', `+', or `-', the command is treated specially. A `@' causes the + command not to be echoed before it is executed. A `+' causes the command + to be executed even when -n is given. This is similar to the effect of the .MAKE special source, except that the effect can be limited to a sin- - gle line of a script. A `--' in compatibility mode causes any non-zero + gle line of a script. A `-' in compatibility mode causes any non-zero exit status of the command line to be ignored. - When bbmmaakkee is run in jobs mode with --jj _m_a_x___j_o_b_s, the entire script for + When bmake is run in jobs mode with -j max_jobs, the entire script for the target is fed to a single instance of the shell. In compatibility (non-jobs) mode, each command is run in a separate process. If the com- mand contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n') it - will be passed to the shell; otherwise bbmmaakkee will attempt direct execu- - tion. If a line starts with `--' and the shell has ErrCtl enabled then + will be passed to the shell; otherwise bmake will attempt direct execu- + tion. If a line starts with `-' and the shell has ErrCtl enabled then failure of the command line will be ignored as in compatibility mode. - Otherwise `--' affects the entire job; the script will stop at the first + Otherwise `-' affects the entire job; the script will stop at the first command line that fails, but the target will not be deemed to have failed. - Makefiles should be written so that the mode of bbmmaakkee operation does not + Makefiles should be written so that the mode of bmake operation does not change their behavior. For example, any command which needs to use ``cd'' or ``chdir'' without potentially changing the directory for subse- quent commands should be put in parentheses so it executes in a subshell. @@ -334,35 +334,35 @@ SSHHEELLLL CCOOMMMMAANNDDSS (cd ${.CURDIR} && ${MAKE} $@); \ echo Back in `pwd` - Since bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' before executing any targets, each + Since bmake will chdir(2) to `.OBJDIR' before executing any targets, each child process starts with that as its current working directory. -VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS +VARIABLE ASSIGNMENTS Variables in make are much like variables in the shell, and, by tradi- tion, consist of all upper-case letters. - VVaarriiaabbllee aassssiiggnnmmeenntt mmooddiiffiieerrss + Variable assignment modifiers The five operators that can be used to assign values to variables are as follows: - == Assign the value to the variable. Any previous value is overrid- + = Assign the value to the variable. Any previous value is overrid- den. - ++== Append the value to the current value of the variable. + += Append the value to the current value of the variable. - ??== Assign the value to the variable if it is not already defined. + ?= Assign the value to the variable if it is not already defined. - ::== Assign with expansion, i.e. expand the value before assigning it + := Assign with expansion, i.e. expand the value before assigning it to the variable. Normally, expansion is not done until the vari- - able is referenced. _N_O_T_E: References to undefined variables are - _n_o_t expanded. This can cause problems when variable modifiers + able is referenced. NOTE: References to undefined variables are + not expanded. This can cause problems when variable modifiers are used. - !!== Expand the value and pass it to the shell for execution and + != Expand the value and pass it to the shell for execution and assign the result to the variable. Any newlines in the result are replaced with spaces. - Any white-space before the assigned _v_a_l_u_e is removed; if the value is + Any white-space before the assigned value is removed; if the value is being appended, a single space is inserted between the previous contents of the variable and the appended value. @@ -412,12 +412,12 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT ${b} contains ``${j} ${j} ${j}'' which expands to ``3 3 3'' since after the loop completes ${j} contains ``3''. - VVaarriiaabbllee ccllaasssseess + Variable classes The four different classes of variables (in order of increasing prece- dence) are: Environment variables - Variables defined as part of bbmmaakkee's environment. + Variables defined as part of bmake's environment. Global variables Variables defined in the makefile or in included makefiles. @@ -432,91 +432,91 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT target to target. It is not currently possible to define new local vari- ables. The seven local variables are as follows: - _._A_L_L_S_R_C The list of all sources for this target; also known as - `_>'. + .ALLSRC The list of all sources for this target; also known as + `>'. - _._A_R_C_H_I_V_E The name of the archive file; also known as `_!'. + .ARCHIVE The name of the archive file; also known as `!'. - _._I_M_P_S_R_C In suffix-transformation rules, the name/path of the + .IMPSRC In suffix-transformation rules, the name/path of the source from which the target is to be transformed (the - ``implied'' source); also known as `_<'. It is not + ``implied'' source); also known as `<'. It is not defined in explicit rules. - _._M_E_M_B_E_R The name of the archive member; also known as `_%'. + .MEMBER The name of the archive member; also known as `%'. - _._O_O_D_A_T_E The list of sources for this target that were deemed out- - of-date; also known as `_?'. + .OODATE The list of sources for this target that were deemed out- + of-date; also known as `?'. - _._P_R_E_F_I_X The file prefix of the target, containing only the file + .PREFIX The file prefix of the target, containing only the file portion, no suffix or preceding directory components; - also known as `_*'. The suffix must be one of the known - suffixes declared with ..SSUUFFFFIIXXEESS or it will not be recog- + also known as `*'. The suffix must be one of the known + suffixes declared with .SUFFIXES or it will not be recog- nized. - _._T_A_R_G_E_T The name of the target; also known as `_@'. For compati- - bility with other makes this is an alias for ..AARRCCHHIIVVEE in + .TARGET The name of the target; also known as `@'. For compati- + bility with other makes this is an alias for .ARCHIVE in archive member rules. - The shorter forms (`_>', `_!', `_<', `_%', `_?', `_*', and `_@') are permitted + The shorter forms (`>', `!', `<', `%', `?', `*', and `@') are permitted for backward compatibility with historical makefiles and legacy POSIX make and are not recommended. Variants of these variables with the punctuation followed immediately by - `D' or `F', e.g. `_$_(_@_D_)', are legacy forms equivalent to using the `:H' + `D' or `F', e.g. `$(@D)', are legacy forms equivalent to using the `:H' and `:T' modifiers. These forms are accepted for compatibility with AT&T System V UNIX makefiles and POSIX but are not recommended. Four of the local variables may be used in sources on dependency lines because they expand to the proper value for each target on the line. - These variables are `_._T_A_R_G_E_T', `_._P_R_E_F_I_X', `_._A_R_C_H_I_V_E', and `_._M_E_M_B_E_R'. + These variables are `.TARGET', `.PREFIX', `.ARCHIVE', and `.MEMBER'. - AAddddiittiioonnaall bbuuiilltt--iinn vvaarriiaabblleess - In addition, bbmmaakkee sets or knows about the following variables: + Additional built-in variables + In addition, bmake sets or knows about the following variables: - _$ A single dollar sign `$', i.e. `$$' expands to a single + $ A single dollar sign `$', i.e. `$$' expands to a single dollar sign. - _._A_L_L_T_A_R_G_E_T_S The list of all targets encountered in the Makefile. If + .ALLTARGETS The list of all targets encountered in the Makefile. If evaluated during Makefile parsing, lists only those tar- gets encountered thus far. - _._C_U_R_D_I_R A path to the directory where bbmmaakkee was executed. Refer + .CURDIR A path to the directory where bmake was executed. Refer to the description of `PWD' for more details. - _._I_N_C_L_U_D_E_D_F_R_O_M_D_I_R + .INCLUDEDFROMDIR The directory of the file this Makefile was included from. - _._I_N_C_L_U_D_E_D_F_R_O_M_F_I_L_E + .INCLUDEDFROMFILE The filename of the file this Makefile was included from. - MAKE The name that bbmmaakkee was executed with (_a_r_g_v_[_0_]). For - compatibility bbmmaakkee also sets _._M_A_K_E with the same value. + MAKE The name that bmake was executed with (argv[0]). For + compatibility bmake also sets .MAKE with the same value. The preferred variable to use is the environment variable MAKE because it is more compatible with other versions of - bbmmaakkee and cannot be confused with the special target with + bmake and cannot be confused with the special target with the same name. - _._M_A_K_E_._D_E_P_E_N_D_F_I_L_E - Names the makefile (default `_._d_e_p_e_n_d') from which gener- + .MAKE.DEPENDFILE + Names the makefile (default `.depend') from which gener- ated dependencies are read. - _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S - A boolean that controls the default behavior of the --VV - option. If true, variable values printed with --VV are + .MAKE.EXPAND_VARIABLES + A boolean that controls the default behavior of the -V + option. If true, variable values printed with -V are fully expanded; if false, the raw variable contents (which may include additional unexpanded variable refer- ences) are shown. - _._M_A_K_E_._E_X_P_O_R_T_E_D The list of variables exported by bbmmaakkee. + .MAKE.EXPORTED The list of variables exported by bmake. - _._M_A_K_E_._J_O_B_S The argument to the --jj option. + .MAKE.JOBS The argument to the -j option. - _._M_A_K_E_._J_O_B_._P_R_E_F_I_X - If bbmmaakkee is run with _j then output for each target is + .MAKE.JOB.PREFIX + If bmake is run with j then output for each target is prefixed with a token `--- target ---' the first part of - which can be controlled via _._M_A_K_E_._J_O_B_._P_R_E_F_I_X. If - _._M_A_K_E_._J_O_B_._P_R_E_F_I_X is empty, no token is printed. + which can be controlled via .MAKE.JOB.PREFIX. If + .MAKE.JOB.PREFIX is empty, no token is printed. For example: .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}] would produce tokens like `---make[1234] target ---' mak- @@ -524,156 +524,156 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT achieved. MAKEFLAGS The environment variable `MAKEFLAGS' may contain anything - that may be specified on bbmmaakkee's command line. Anything - specified on bbmmaakkee's command line is appended to the + that may be specified on bmake's command line. Anything + specified on bmake's command line is appended to the `MAKEFLAGS' variable which is then entered into the envi- - ronment for all programs which bbmmaakkee executes. + ronment for all programs which bmake executes. - _._M_A_K_E_._L_E_V_E_L The recursion depth of bbmmaakkee. The initial instance of - bbmmaakkee will be 0, and an incremented value is put into the + .MAKE.LEVEL The recursion depth of bmake. The initial instance of + bmake will be 0, and an incremented value is put into the environment to be seen by the next generation. This allows tests like: .if ${.MAKE.LEVEL} == 0 to protect things which should only be evaluated in the initial - instance of bbmmaakkee. + instance of bmake. - _._M_A_K_E_._M_A_K_E_F_I_L_E___P_R_E_F_E_R_E_N_C_E - The ordered list of makefile names (default `_m_a_k_e_f_i_l_e', - `_M_a_k_e_f_i_l_e') that bbmmaakkee will look for. + .MAKE.MAKEFILE_PREFERENCE + The ordered list of makefile names (default `makefile', + `Makefile') that bmake will look for. - _._M_A_K_E_._M_A_K_E_F_I_L_E_S - The list of makefiles read by bbmmaakkee, which is useful for + .MAKE.MAKEFILES + The list of makefiles read by bmake, which is useful for tracking dependencies. Each makefile is recorded only once, regardless of the number of times read. - _._M_A_K_E_._M_O_D_E Processed after reading all makefiles. Can affect the - mode that bbmmaakkee runs in. It can contain a number of key- + .MAKE.MODE Processed after reading all makefiles. Can affect the + mode that bmake runs in. It can contain a number of key- words: - _c_o_m_p_a_t Like --BB, puts bbmmaakkee into "compat" + compat Like -B, puts bmake into "compat" mode. - _m_e_t_a Puts bbmmaakkee into "meta" mode, where + meta Puts bmake into "meta" mode, where meta files are created for each tar- get to capture the command run, the output generated and if filemon(4) is available, the system calls which - are of interest to bbmmaakkee. The cap- + are of interest to bmake. The cap- tured output can be very useful when diagnosing errors. - _c_u_r_d_i_r_O_k_= _b_f Normally bbmmaakkee will not create .meta - files in `_._C_U_R_D_I_R'. This can be - overridden by setting _b_f to a value + curdirOk= bf Normally bmake will not create .meta + files in `.CURDIR'. This can be + overridden by setting bf to a value which represents True. - _m_i_s_s_i_n_g_-_m_e_t_a_= _b_f If _b_f is True, then a missing .meta + missing-meta= bf If bf is True, then a missing .meta file makes the target out-of-date. - _m_i_s_s_i_n_g_-_f_i_l_e_m_o_n_= _b_f If _b_f is True, then missing filemon + missing-filemon= bf If bf is True, then missing filemon data makes the target out-of-date. - _n_o_f_i_l_e_m_o_n Do not use filemon(4). + nofilemon Do not use filemon(4). - _e_n_v For debugging, it can be useful to + env For debugging, it can be useful to include the environment in the .meta file. - _v_e_r_b_o_s_e If in "meta" mode, print a clue + verbose If in "meta" mode, print a clue about the target being built. This is useful if the build is otherwise running silently. The message printed the value of: - _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X. + .MAKE.META.PREFIX. - _i_g_n_o_r_e_-_c_m_d Some makefiles have commands which + ignore-cmd Some makefiles have commands which are simply not stable. This keyword causes them to be ignored for deter- mining whether a target is out of date in "meta" mode. See also - ..NNOOMMEETTAA__CCMMPP. + .NOMETA_CMP. - _s_i_l_e_n_t_= _b_f If _b_f is True, when a .meta file is - created, mark the target ..SSIILLEENNTT. + silent= bf If bf is True, when a .meta file is + created, mark the target .SILENT. - _._M_A_K_E_._M_E_T_A_._B_A_I_L_I_W_I_C_K + .MAKE.META.BAILIWICK In "meta" mode, provides a list of prefixes which match - the directories controlled by bbmmaakkee. If a file that was - generated outside of _._O_B_J_D_I_R but within said bailiwick is + the directories controlled by bmake. If a file that was + generated outside of .OBJDIR but within said bailiwick is missing, the current target is considered out-of-date. - _._M_A_K_E_._M_E_T_A_._C_R_E_A_T_E_D + .MAKE.META.CREATED In "meta" mode, this variable contains a list of all the meta files updated. If not empty, it can be used to - trigger processing of _._M_A_K_E_._M_E_T_A_._F_I_L_E_S. + trigger processing of .MAKE.META.FILES. - _._M_A_K_E_._M_E_T_A_._F_I_L_E_S + .MAKE.META.FILES In "meta" mode, this variable contains a list of all the meta files used (updated or not). This list can be used to process the meta files to extract dependency informa- tion. - _._M_A_K_E_._M_E_T_A_._I_G_N_O_R_E___P_A_T_H_S + .MAKE.META.IGNORE_PATHS Provides a list of path prefixes that should be ignored; because the contents are expected to change over time. - The default list includes: `_/_d_e_v _/_e_t_c _/_p_r_o_c _/_t_m_p _/_v_a_r_/_r_u_n - _/_v_a_r_/_t_m_p' + The default list includes: `/dev /etc /proc /tmp /var/run + /var/tmp' - _._M_A_K_E_._M_E_T_A_._I_G_N_O_R_E___P_A_T_T_E_R_N_S + .MAKE.META.IGNORE_PATTERNS Provides a list of patterns to match against pathnames. Ignore any that match. - _._M_A_K_E_._M_E_T_A_._I_G_N_O_R_E___F_I_L_T_E_R + .MAKE.META.IGNORE_FILTER Provides a list of variable modifiers to apply to each pathname. Ignore if the expansion is an empty string. - _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X + .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: Building ${.TARGET:H:tA}/${.TARGET:T} - _._M_A_K_E_O_V_E_R_R_I_D_E_S This variable is used to record the names of variables + .MAKEOVERRIDES This variable is used to record the names of variables assigned to on the command line, so that they may be exported as part of `MAKEFLAGS'. This behavior can be - disabled by assigning an empty value to `_._M_A_K_E_O_V_E_R_R_I_D_E_S' + disabled by assigning an empty value to `.MAKEOVERRIDES' within a makefile. Extra variables can be exported from - a makefile by appending their names to `_._M_A_K_E_O_V_E_R_R_I_D_E_S'. - `MAKEFLAGS' is re-exported whenever `_._M_A_K_E_O_V_E_R_R_I_D_E_S' is + a makefile by appending their names to `.MAKEOVERRIDES'. + `MAKEFLAGS' is re-exported whenever `.MAKEOVERRIDES' is modified. - _._M_A_K_E_._P_A_T_H___F_I_L_E_M_O_N - If bbmmaakkee was built with filemon(4) support, this is set + .MAKE.PATH_FILEMON + If bmake was built with filemon(4) support, this is set to the path of the device node. This allows makefiles to test for this support. - _._M_A_K_E_._P_I_D The process-id of bbmmaakkee. + .MAKE.PID The process-id of bmake. - _._M_A_K_E_._P_P_I_D The parent process-id of bbmmaakkee. + .MAKE.PPID The parent process-id of bmake. - _._M_A_K_E_._S_A_V_E___D_O_L_L_A_R_S + .MAKE.SAVE_DOLLARS value should be a boolean that controls whether `$$' are preserved when doing `:=' assignments. The default is false, for backwards compatibility. Set to true for com- patability with other makes. If set to false, `$$' becomes `$' per normal evaluation rules. - _M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R - When bbmmaakkee stops due to an error, it sets `_._E_R_R_O_R___T_A_R_G_E_T' - to the name of the target that failed, `_._E_R_R_O_R___C_M_D' to + MAKE_PRINT_VAR_ON_ERROR + When bmake stops due to an error, it sets `.ERROR_TARGET' + to the name of the target that failed, `.ERROR_CMD' to the commands of the failed target, and in "meta" mode, it - also sets `_._E_R_R_O_R___C_W_D' to the getcwd(3), and - `_._E_R_R_O_R___M_E_T_A___F_I_L_E' to the path of the meta file (if any) + also sets `.ERROR_CWD' to the getcwd(3), and + `.ERROR_META_FILE' to the path of the meta file (if any) describing the failed target. It then prints its name - and the value of `_._C_U_R_D_I_R' as well as the value of any - variables named in `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R'. + and the value of `.CURDIR' as well as the value of any + variables named in `MAKE_PRINT_VAR_ON_ERROR'. - _._n_e_w_l_i_n_e This variable is simply assigned a newline character as - its value. This allows expansions using the ::@@ modifier + .newline This variable is simply assigned a newline character as + its value. This allows expansions using the :@ modifier to put a newline between iterations of the loop rather than a space. For example, the printing of - `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R' could be done as + `MAKE_PRINT_VAR_ON_ERROR' could be done as ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}. - _._O_B_J_D_I_R A path to the directory where the targets are built. Its + .OBJDIR A path to the directory where the targets are built. Its value is determined by trying to chdir(2) to the follow- ing directories in order and using the first match: @@ -687,11 +687,11 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT (Only if `MAKEOBJDIR' is set in the environment or on the command line.) - 3. ${.CURDIR}_/_o_b_j_.${MACHINE} + 3. ${.CURDIR}/obj.${MACHINE} - 4. ${.CURDIR}_/_o_b_j + 4. ${.CURDIR}/obj - 5. _/_u_s_r_/_o_b_j_/${.CURDIR} + 5. /usr/obj/${.CURDIR} 6. ${.CURDIR} @@ -701,43 +701,43 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNT may be used. This is especially useful with `MAKEOBJDIR'. - `_._O_B_J_D_I_R' may be modified in the makefile via the special - target `..OOBBJJDDIIRR'. In all cases, bbmmaakkee will chdir(2) to - the specified directory if it exists, and set `_._O_B_J_D_I_R' + `.OBJDIR' may be modified in the makefile via the special + target `.OBJDIR'. In all cases, bmake will chdir(2) to + the specified directory if it exists, and set `.OBJDIR' and `PWD' to that directory before executing any targets. - _._P_A_R_S_E_D_I_R A path to the directory of the current `_M_a_k_e_f_i_l_e' being + .PARSEDIR A path to the directory of the current `Makefile' being parsed. - _._P_A_R_S_E_F_I_L_E The basename of the current `_M_a_k_e_f_i_l_e' being parsed. - This variable and `_._P_A_R_S_E_D_I_R' are both set only while the - `_M_a_k_e_f_i_l_e_s' are being parsed. If you want to retain + .PARSEFILE The basename of the current `Makefile' being parsed. + This variable and `.PARSEDIR' are both set only while the + `Makefiles' are being parsed. If you want to retain their current values, assign them to a variable using - assignment with expansion: (`::=='). + assignment with expansion: (`:='). - _._P_A_T_H A variable that represents the list of directories that - bbmmaakkee will search for files. The search list should be - updated using the target `_._P_A_T_H' rather than the vari- + .PATH A variable that represents the list of directories that + bmake will search for files. The search list should be + updated using the target `.PATH' rather than the vari- able. - PWD Alternate path to the current directory. bbmmaakkee normally - sets `_._C_U_R_D_I_R' to the canonical path given by getcwd(3). + PWD Alternate path to the current directory. bmake normally + sets `.CURDIR' to the canonical path given by getcwd(3). However, if the environment variable `PWD' is set and - gives a path to the current directory, then bbmmaakkee sets - `_._C_U_R_D_I_R' to the value of `PWD' instead. This behavior + gives a path to the current directory, then bmake sets + `.CURDIR' to the value of `PWD' instead. This behavior is disabled if `MAKEOBJDIRPREFIX' is set or `MAKEOBJDIR' *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Mar 2 02:39:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EBB6F3FEC6; Fri, 2 Mar 2018 02:39:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01506865D3; Fri, 2 Mar 2018 02:39:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC430118BC; Fri, 2 Mar 2018 02:39:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w222dGn1062871; Fri, 2 Mar 2018 02:39:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w222dGwx062870; Fri, 2 Mar 2018 02:39:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803020239.w222dGwx062870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 02:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330261 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:39:17 -0000 Author: kevans Date: Fri Mar 2 02:39:16 2018 New Revision: 330261 URL: https://svnweb.freebsd.org/changeset/base/330261 Log: lualoader: Fix some lint-mentioned errors - nextbootfile is not a variable, but nextboot_file is - pstatus was explicitly initialized but later clobbered, so don't initialize it. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Fri Mar 2 01:53:50 2018 (r330260) +++ head/stand/lua/config.lua Fri Mar 2 02:39:16 2018 (r330261) @@ -173,7 +173,7 @@ local function checkNextboot() end if not config.parse(text) then - print(MSG_FAILPARSECFG:format(nextbootfile)) + print(MSG_FAILPARSECFG:format(nextboot_file)) end -- Attempt to rewrite the first line and only the first line of the @@ -274,7 +274,7 @@ end function config.loadmod(mod, silent) local status = true - local pstatus = true + local pstatus for k, v in pairs(mod) do if v.load == "YES" then local str = "load " From owner-svn-src-head@freebsd.org Fri Mar 2 02:39:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A544DF3FF5F; Fri, 2 Mar 2018 02:39:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFA786710; Fri, 2 Mar 2018 02:39:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55DAF118BD; Fri, 2 Mar 2018 02:39:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w222dfrq062932; Fri, 2 Mar 2018 02:39:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w222dfHK062931; Fri, 2 Mar 2018 02:39:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803020239.w222dfHK062931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 02:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330262 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:39:41 -0000 Author: kevans Date: Fri Mar 2 02:39:41 2018 New Revision: 330262 URL: https://svnweb.freebsd.org/changeset/base/330262 Log: lualoader: Use #str instead of tracking length with 'n' We really gain almost nothing by tracking length separately, especially when it's as easy as "#str", so reduce complexity. Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Fri Mar 2 02:39:16 2018 (r330261) +++ head/stand/lua/password.lua Fri Mar 2 02:39:41 2018 (r330262) @@ -42,7 +42,6 @@ local twiddle_chars = {"/", "-", "\\", "|"} -- Module exports function password.read(prompt_length) local str = "" - local n = 0 local twiddle_pos = 1 local function draw_twiddle() @@ -60,14 +59,13 @@ function password.read(prompt_length) break end if ch == core.KEY_BACKSPACE or ch == core.KEY_DELETE then - if n > 0 then - n = n - 1 + if #str > 0 then if show_password_mask then loader.printc("\008 \008") else draw_twiddle() end - str = str:sub(1, n) + str = str:sub(1, #str - 1) end else if show_password_mask then @@ -76,7 +74,6 @@ function password.read(prompt_length) draw_twiddle() end str = str .. string.char(ch) - n = n + 1 end end return str From owner-svn-src-head@freebsd.org Fri Mar 2 03:05:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF9D2F41FC7; Fri, 2 Mar 2018 03:05:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD8987D2D; Fri, 2 Mar 2018 03:05:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66C7411DF7; Fri, 2 Mar 2018 03:05:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2235avk079023; Fri, 2 Mar 2018 03:05:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2235a9s079022; Fri, 2 Mar 2018 03:05:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803020305.w2235a9s079022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 03:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330263 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 03:05:37 -0000 Author: kevans Date: Fri Mar 2 03:05:36 2018 New Revision: 330263 URL: https://svnweb.freebsd.org/changeset/base/330263 Log: lualoader: Use string literal \xNN instead of string.char() Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Mar 2 02:39:41 2018 (r330262) +++ head/stand/lua/drawer.lua Fri Mar 2 03:05:36 2018 (r330263) @@ -313,13 +313,13 @@ function drawer.drawbox() local w = drawer.box_pos_dim.w local h = drawer.box_pos_dim.h - local hl = string.char(0xCD) - local vl = string.char(0xBA) + local hl = "\xCD" + local vl = "\xBA" - local tl = string.char(0xC9) - local bl = string.char(0xC8) - local tr = string.char(0xBB) - local br = string.char(0xBC) + local tl = "\xC9" + local bl = "\xC8" + local tr = "\xBB" + local br = "\xBC" screen.setcursor(x, y); print(tl) screen.setcursor(x, y+h); print(bl) From owner-svn-src-head@freebsd.org Fri Mar 2 03:26:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 397A7F4344F; Fri, 2 Mar 2018 03:26:57 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::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 BD23A68942; Fri, 2 Mar 2018 03:26:56 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x243.google.com with SMTP id j7so517683ita.3; Thu, 01 Mar 2018 19:26:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=t1x9HcMIHMBFIFvEmnqfIn5w8PiQI+CbN4/7MwTnfqo=; b=rb6acYTU4RW9CI4Pm997kqrlFI+Y7JPpNnXqm7kSZZs2akSZ8Kn0X3JZeYmSjZ87GW 9p42s7q4LeI4LRyAuvnl93CRkhMWa/2CCp7YI5v6lI5qv9M4vpe9ffBhLzCOSY6EVTY1 hpLEa8yWOtx5Luv8s80w+YXHGIGIB7e6TdPR11Pqy0cFtRiIE3oyjM9RSduvkU8Q6Tg6 vpFTLn18NdJ/y7vcIH65NuKwyjOlJZwltBdV0h0cxV7m/6k7S0Qq/xfxNC6xF/99W9BB jWOpXr/chdnDXPWqVzkXN92tgsr6umDST9eKhMxDkFHY28yWhqLcvCYIULNYs742wWEE gUGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=t1x9HcMIHMBFIFvEmnqfIn5w8PiQI+CbN4/7MwTnfqo=; b=t26m566LRlxlEj52o7byBOSCI1i7g967blVlnS3WB9C2/we+tGCTY6ezgci6R+M9Vv wb+TZliPUGZeotUvEz6puEaky30g0/DtTuHK5dA8FghGToNGy+HhDdv+UDCGPx5LANr9 f4ZrtMTqut4QzlqSa3/hnHHAIQz0QBjla/Dq/b0VHgjYNut8iRlyNTSMvPnE15FXkbSR LdoIDAIQpyw9LPn4HQT61nqkJUSp70HdKLCMzpZ2+H90HfhYPWt5Fw05vdQkB+W3aaXe zcGETjLvLha2OsOC6r5htdAOqN80FpLvWdrX5nZMcsusXJZxfWwK919IBxMZ0jkbx763 4ykg== X-Gm-Message-State: AElRT7FvS7oDm4vWcPzESH9C9j29LGiOweUr4soLCPlHmpSYFEXhM/rJ aqZV4DkqI4dP4h75ylMBOqS9uJME8kYfxq4L6nbJ7zO1 X-Google-Smtp-Source: AG47ELtWx0+xJEVqIH+7WOfci09pwqYxhWTB2bkY0I5GTcd1XYYEae8ELkhLgGGIfu0vbS2IbQP2mbe4B9XG1IeHwN8= X-Received: by 10.36.47.135 with SMTP id j129mr682851itj.78.1519961215978; Thu, 01 Mar 2018 19:26:55 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.13 with HTTP; Thu, 1 Mar 2018 19:26:35 -0800 (PST) In-Reply-To: <201711271503.vARF38FE095978@repo.freebsd.org> References: <201711271503.vARF38FE095978@repo.freebsd.org> From: Ed Maste Date: Thu, 1 Mar 2018 22:26:35 -0500 X-Google-Sender-Auth: mygImM1Bf6i-g2-6g3Tm3VGIyis Message-ID: Subject: Re: svn commit: r326257 - in head/sys/amd64: acpica amd64 ia32 include include/pc linux32 pci vmm vmm/amd vmm/intel vmm/io To: "Pedro F. Giffuni" 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.25 Precedence: list List-Id: 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 Mar 2018 03:26:57 -0000 On 27 November 2017 at 10:03, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Nov 27 15:03:07 2017 > New Revision: 326257 > URL: https://svnweb.freebsd.org/changeset/base/326257 > > Log: > sys/amd64: further adoption of SPDX licensing ID tags. ... > Modified: head/sys/amd64/linux32/linux32_machdep.c > ============================================================================== > --- head/sys/amd64/linux32/linux32_machdep.c Mon Nov 27 15:01:59 2017 (r326256) > +++ head/sys/amd64/linux32/linux32_machdep.c Mon Nov 27 15:03:07 2017 (r326257) > @@ -1,4 +1,6 @@ > /*- > + * SPDX-License-Identifier: BSD-3-Clause > + * A few Linuxulator files gained a BSD-3-Clause tag, but they're not actually 3-Clause BSD; they have a small addition to the first clause, which ends with "in this position and unchanged." I've been going through the Linuxulator source files to rationalize the license text (see review D14210) but am waiting on confirmation from a few copyright holders before all files can be cleaned up. Until that happens I think we should just remove the SPDX tags from these files. From owner-svn-src-head@freebsd.org Fri Mar 2 04:15:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A431AF46424 for ; Fri, 2 Mar 2018 04:15:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic306-18.consmr.mail.bf2.yahoo.com (sonic306-18.consmr.mail.bf2.yahoo.com [74.6.132.57]) (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 350C46A579 for ; Fri, 2 Mar 2018 04:15:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1519964143; bh=BY5MJPJZq2YfeLDQARiYx+d/MBE4i52CWjWPdKUj0L0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=q5Zd78FMlHMaQeSclTHSo2V3lKhWGRD61LXQDkPFUmoHW1YAy6W5X4T4O7ACM/NhepIdDUFeH1jZPGsx0rsJYDKi5bL0X8cfqQwgeSFHpfc3A3VwkbDmROg17G+Im4r8W/gvH6BXERFeLGsJrCieP4sWGpBVrqO1VJsw9GcZka80QB3F8TM72YYy+0LDTlUHpfskgdhRM1kmRn4bXAldV1aIS71RHdRr4+HOHr8Ux5ku4JiTwSYS3JrvF9Pbhyc6D1DxLsocYlYEglQN/HyF8vn7UVHbGS9Gdor9PxRdmyX7wQLex5PQJvuHStmwYBcOg2GPXxaZ+vuSZHDZ4/gkPQ== X-YMail-OSG: D9hZv0cVM1kri5rDEdWR1ni0RZWn_it2_bFGsZzqETkCarvK..LSIZe4OFq265G 3lJboVMvbDObdFCA0hpNLKoIjxMtW7XNj7xN3xB97RHdV73d_HPALaVe9k.s9xcEZZZvn9Xy.2oC DldVnzA6R3e7jZldZS5gE682n44FHAdz1sSYZDFiyk0QmQTkzJ2QrM9x6rShfYXb21Evrqgy8QsI aLmj_JYUQCaybs_yb7fsw3NwRfZGRqDxvESeYLBNVP30xW_0hesFjTqZJ0CU9.oQr_xtPdNTZEoV pM2BoGyA46eWNI_UGCv8NSDaevI7PVwoiYsCQYoWeP6vABk_Et6rq21mt9ptcUNb159CMdy8Vwha JIwpUoDtvhUeZOUpPbX6p.c6DVqc1j.MgRquLcJAGRNzs9dnbAUxSfpCButEl_3VqBpvGVNgB6zJ dWRbX_WJ0ue9HoEhncrKMLQQV.1IoUDCXBA49YCVWkzJRvyoHTh4xDxvl2C7qKwEwOVQwLO5gili rSennWtRu7Ds- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Fri, 2 Mar 2018 04:15:43 +0000 Received: from smtp105.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.5]) ([98.139.231.38]) by smtp411.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 61c2bda04029b562ca076180ae59e6d3; Fri, 02 Mar 2018 04:05:32 +0000 (UTC) Subject: Re: svn commit: r326257 - in head/sys/amd64: acpica amd64 ia32 include include/pc linux32 pci vmm vmm/amd vmm/intel vmm/io To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711271503.vARF38FE095978@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <0d7f85b3-30e8-9fad-a4db-ecdfaaa98c2d@FreeBSD.org> Date: Thu, 1 Mar 2018 23:05:31 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 04:15:45 -0000 On 01/03/2018 22:26, Ed Maste wrote: > On 27 November 2017 at 10:03, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Mon Nov 27 15:03:07 2017 >> New Revision: 326257 >> URL: https://svnweb.freebsd.org/changeset/base/326257 >> >> Log: >> sys/amd64: further adoption of SPDX licensing ID tags. > ... >> Modified: head/sys/amd64/linux32/linux32_machdep.c >> ============================================================================== >> --- head/sys/amd64/linux32/linux32_machdep.c Mon Nov 27 15:01:59 2017 (r326256) >> +++ head/sys/amd64/linux32/linux32_machdep.c Mon Nov 27 15:03:07 2017 (r326257) >> @@ -1,4 +1,6 @@ >> /*- >> + * SPDX-License-Identifier: BSD-3-Clause >> + * > A few Linuxulator files gained a BSD-3-Clause tag, but they're not > actually 3-Clause BSD; they have a small addition to the first clause, > which ends with "in this position and unchanged." I've been going > through the Linuxulator source files to rationalize the license text > (see review D14210) but am waiting on confirmation from a few > copyright holders before all files can be cleaned up. > > Until that happens I think we should just remove the SPDX tags from these files. Yes, that sounds right. Feel free to drop the SPDX tags from anything that looks suspicious. Pedro. From owner-svn-src-head@freebsd.org Fri Mar 2 04:34:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E59F47873; Fri, 2 Mar 2018 04:34:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C8C86B276; Fri, 2 Mar 2018 04:34:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5782112C3B; Fri, 2 Mar 2018 04:34:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w224YspG023445; Fri, 2 Mar 2018 04:34:54 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w224Yr9J023438; Fri, 2 Mar 2018 04:34:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201803020434.w224Yr9J023438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 2 Mar 2018 04:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330264 - in head: lib/libufs stand/libsa sys/geom sys/geom/journal sys/geom/label sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: lib/libufs stand/libsa sys/geom sys/geom/journal sys/geom/label sys/ufs/ffs X-SVN-Commit-Revision: 330264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 04:34:55 -0000 Author: mckusick Date: Fri Mar 2 04:34:53 2018 New Revision: 330264 URL: https://svnweb.freebsd.org/changeset/base/330264 Log: This change is some refactoring of Mark Johnston's changes in r329375 to fix the memory leak that I introduced in r328426. Instead of trying to clear up the possible memory leak in all the clients, I ensure that it gets cleaned up in the source (e.g., ffs_sbget ensures that memory is always freed if it returns an error). The original change in r328426 was a bit sparse in its description. So I am expanding on its description here (thanks cem@ and rgrimes@ for your encouragement for my longer commit messages). In preparation for adding check hashing to superblocks, r328426 is a refactoring of the code to get the reading/writing of the superblock into one place. Unlike the cylinder group reading/writing which ends up in two places (ffs_getcg/ffs_geom_strategy in the kernel and cgget/cgput in libufs), I have the core superblock functions just in the kernel (ffs_sbfetch/ffs_sbput in ffs_subr.c which is already imported into utilities like fsck_ffs as well as libufs to implement sbget/sbput). The ffs_sbfetch and ffs_sbput functions take a function pointer to do the actual I/O for which there are four variants: ffs_use_bread / ffs_use_bwrite for the in-kernel filesystem g_use_g_read_data / g_use_g_write_data for kernel geom clients ufs_use_sa_read for the standalone code (stand/libsa/ufs.c but not stand/libsa/ufsread.c which is size constrained) use_pread / use_pwrite for libufs Uses of these interfaces are in the UFS filesystem, geoms journal & label, libsa changes, and libufs. They also permeate out into the filesystem utilities fsck_ffs, newfs, growfs, clri, dump, quotacheck, fsirand, fstyp, and quot. Some of these utilities should probably be converted to directly use libufs (like dumpfs was for example), but there does not seem to be much win in doing so. Tested by: Peter Holm (pho@) Modified: head/lib/libufs/sblock.c head/stand/libsa/ufs.c head/sys/geom/geom_io.c head/sys/geom/journal/g_journal_ufs.c head/sys/geom/label/g_label_ufs.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/lib/libufs/sblock.c ============================================================================== --- head/lib/libufs/sblock.c Fri Mar 2 03:05:36 2018 (r330263) +++ head/lib/libufs/sblock.c Fri Mar 2 04:34:53 2018 (r330264) @@ -150,7 +150,6 @@ use_pread(void *devfd, off_t loc, void **bufp, int siz int fd; fd = *(int *)devfd; - free(*bufp); if ((*bufp = malloc(size)) == NULL) return (ENOSPC); if (pread(fd, *bufp, size, loc) != size) Modified: head/stand/libsa/ufs.c ============================================================================== --- head/stand/libsa/ufs.c Fri Mar 2 03:05:36 2018 (r330263) +++ head/stand/libsa/ufs.c Fri Mar 2 04:34:53 2018 (r330264) @@ -518,7 +518,7 @@ ufs_open(upath, f) /* read super block */ twiddle(1); - if ((rc = ffs_sbget(f, &fs, -1, 0, ufs_use_sa_read)) != 0) + if ((rc = ffs_sbget(f, &fs, -1, "stand", ufs_use_sa_read)) != 0) goto out; fp->f_fs = fs; /* @@ -688,7 +688,6 @@ ufs_use_sa_read(void *devfd, off_t loc, void **bufp, i int error; f = (struct open_file *)devfd; - free(*bufp); if ((*bufp = malloc(size)) == NULL) return (ENOSPC); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, loc / DEV_BSIZE, Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Fri Mar 2 03:05:36 2018 (r330263) +++ head/sys/geom/geom_io.c Fri Mar 2 04:34:53 2018 (r330264) @@ -957,6 +957,9 @@ g_use_g_read_data(void *devfd, off_t loc, void **bufp, { struct g_consumer *cp; + KASSERT(*bufp == NULL, + ("g_use_g_read_data: non-NULL *bufp %p\n", *bufp)); + cp = (struct g_consumer *)devfd; /* * Take care not to issue an invalid I/O request. The offset of @@ -966,8 +969,6 @@ g_use_g_read_data(void *devfd, off_t loc, void **bufp, */ if (loc % cp->provider->sectorsize != 0) return (ENOENT); - if (*bufp != NULL) - g_free(*bufp); *bufp = g_read_data(cp, loc, size, NULL); if (*bufp == NULL) return (ENOENT); Modified: head/sys/geom/journal/g_journal_ufs.c ============================================================================== --- head/sys/geom/journal/g_journal_ufs.c Fri Mar 2 03:05:36 2018 (r330263) +++ head/sys/geom/journal/g_journal_ufs.c Fri Mar 2 04:34:53 2018 (r330264) @@ -72,11 +72,11 @@ g_journal_ufs_dirty(struct g_consumer *cp) fs = NULL; if (SBLOCKSIZE % cp->provider->sectorsize != 0 || - ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) { + ffs_sbget(cp, &fs, -1, M_GEOM, g_use_g_read_data) != 0) { GJ_DEBUG(0, "Cannot find superblock to mark file system %s " "as dirty.", cp->provider->name); - if (fs != NULL) - g_free(fs); + KASSERT(fs == NULL, + ("g_journal_ufs_dirty: non-NULL fs %p\n", fs)); return; } GJ_DEBUG(0, "clean=%d flags=0x%x", fs->fs_clean, fs->fs_flags); Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Fri Mar 2 03:05:36 2018 (r330263) +++ head/sys/geom/label/g_label_ufs.c Fri Mar 2 04:34:53 2018 (r330264) @@ -77,9 +77,9 @@ g_label_ufs_taste_common(struct g_consumer *cp, char * fs = NULL; if (SBLOCKSIZE % pp->sectorsize != 0 || - ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) { - if (fs != NULL) - g_free(fs); + ffs_sbget(cp, &fs, -1, M_GEOM, g_use_g_read_data) != 0) { + KASSERT(fs == NULL, + ("g_label_ufs_taste_common: non-NULL fs %p\n",fs); return; } Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Fri Mar 2 03:05:36 2018 (r330263) +++ head/sys/ufs/ffs/ffs_subr.c Fri Mar 2 04:34:53 2018 (r330264) @@ -151,6 +151,7 @@ static int readsuper(void *, struct fs **, off_t, int, * superblock. Memory is allocated for the superblock by the readfunc and * is returned. If filltype is non-NULL, additional memory is allocated * of type filltype and filled in with the superblock summary information. + * All memory is freed when any error is returned. * * If a superblock is found, zero is returned. Otherwise one of the * following error values is returned: @@ -172,16 +173,24 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc int32_t *lp; char *buf; + fs = NULL; *fsp = NULL; if (altsblock != -1) { - if ((error = readsuper(devfd, fsp, altsblock, 1, - readfunc)) != 0) + if ((error = readsuper(devfd, &fs, altsblock, 1, + readfunc)) != 0) { + if (fs != NULL) + UFS_FREE(fs, filltype); return (error); + } } else { for (i = 0; sblock_try[i] != -1; i++) { - if ((error = readsuper(devfd, fsp, sblock_try[i], 0, + if ((error = readsuper(devfd, &fs, sblock_try[i], 0, readfunc)) == 0) break; + if (fs != NULL) { + UFS_FREE(fs, filltype); + fs = NULL; + } if (error == ENOENT) continue; return (error); @@ -190,20 +199,18 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc return (ENOENT); } /* - * If not filling in summary information, return. - */ - if (filltype == NULL) - return (0); - /* * Read in the superblock summary information. */ - fs = *fsp; size = fs->fs_cssize; blks = howmany(size, fs->fs_fsize); if (fs->fs_contigsumsize > 0) size += fs->fs_ncg * sizeof(int32_t); size += fs->fs_ncg * sizeof(u_int8_t); - space = UFS_MALLOC(size, filltype, M_WAITOK); + /* When running in libufs or libsa, UFS_MALLOC may fail */ + if ((space = UFS_MALLOC(size, filltype, M_WAITOK)) == NULL) { + UFS_FREE(fs, filltype); + return (ENOSPC); + } fs->fs_csp = (struct csum *)space; for (i = 0; i < blks; i += fs->fs_frag) { size = fs->fs_bsize; @@ -213,9 +220,10 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc error = (*readfunc)(devfd, dbtob(fsbtodb(fs, fs->fs_csaddr + i)), (void **)&buf, size); if (error) { - UFS_FREE(buf, filltype); + if (buf != NULL) + UFS_FREE(buf, filltype); UFS_FREE(fs->fs_csp, filltype); - fs->fs_csp = NULL; + UFS_FREE(fs, filltype); return (error); } memcpy(space, buf, size); @@ -231,6 +239,7 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc size = fs->fs_ncg * sizeof(u_int8_t); fs->fs_contigdirs = (u_int8_t *)space; bzero(fs->fs_contigdirs, size); + *fsp = fs; return (0); } @@ -246,8 +255,6 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo int error; error = (*readfunc)(devfd, sblockloc, (void **)fsp, SBLOCKSIZE); - if (*fsp != NULL) - (*fsp)->fs_csp = NULL; /* Not yet any summary information */ if (error != 0) return (error); fs = *fsp; @@ -263,6 +270,8 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo fs->fs_bsize >= roundup(sizeof(struct fs), DEV_BSIZE)) { /* Have to set for old filesystems that predate this field */ fs->fs_sblockactualloc = sblockloc; + /* Not yet any summary information */ + fs->fs_csp = NULL; return (0); } return (ENOENT); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Mar 2 03:05:36 2018 (r330263) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Mar 2 04:34:53 2018 (r330264) @@ -1075,14 +1075,11 @@ ffs_use_bread(void *devfd, off_t loc, void **bufp, int struct buf *bp; int error; - free(*bufp, M_UFSMNT); + KASSERT(*bufp == NULL, ("ffs_use_bread: non-NULL *bufp %p\n", *bufp)); *bufp = malloc(size, M_UFSMNT, M_WAITOK); if ((error = bread((struct vnode *)devfd, btodb(loc), size, NOCRED, - &bp)) != 0) { - free(*bufp, M_UFSMNT); - *bufp = NULL; + &bp)) != 0) return (error); - } bcopy(bp->b_data, *bufp, size); bp->b_flags |= B_INVAL | B_NOCACHE; brelse(bp); From owner-svn-src-head@freebsd.org Fri Mar 2 05:35:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C134F25EA9; Fri, 2 Mar 2018 05:35:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8FDD6D78C; Fri, 2 Mar 2018 05:35:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E8F3135F7; Fri, 2 Mar 2018 05:35:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w225ZEn1054021; Fri, 2 Mar 2018 05:35:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w225ZEs6054020; Fri, 2 Mar 2018 05:35:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803020535.w225ZEs6054020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 05:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330267 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 05:35:15 -0000 Author: kevans Date: Fri Mar 2 05:35:14 2018 New Revision: 330267 URL: https://svnweb.freebsd.org/changeset/base/330267 Log: Add core.lua(8), but do not add to distribution Distribution will be done after all of the lualoader manpages are created. Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D14479 Added: head/stand/lua/core.lua.8 (contents, props changed) Added: head/stand/lua/core.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/core.lua.8 Fri Mar 2 05:35:14 2018 (r330267) @@ -0,0 +1,222 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 2, 2018 +.Dt CORE.LUA 8 +.Os +.Sh NAME +.Nm core.lua +.Nd FreeBSD core module +.Sh DESCRIPTION +.Nm +contains core functionality that does not have a more fitting module. +.Pp +Before hooking into or using the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local core = require("core") +.Ss CONSTANTS +The following raw key code constants are defined in +.Nm : +.Bl -tag -width KEY_BACKSPACE -compact -offset indent +.It Ic KEY_BACKSPACE +The backspace code. +Should generally be checked along with +.Ic KEY_DELETE +for backspace functionality. +.It Ic KEY_ENTER +The enter key, or hard return. +.It Ic KEY_DELETE +The delete code. +Should generally be checked along with +.Ic KEY_BACKSPACE +for backspace functionality. +.El +.Pp +The following key-string constants are defined in +.Nm : +.Bl -tag -width KEYSTR_ESCAPE -compact -offset indent +.It Ic KEYSTR_ESCAPE +The escape key. +.El +.Pp +The following menu entry type constants are defined in +.Nm : +.Bl -tag -width MENU_CAROUSEL_ENTRY -compact -offset indent +.It Ic MENU_RETURN +Return to the parent menu. +.It Ic MENU_ENTRY +A normal menu entry. +.It Ic MENU_SEPARATOR +A menu entry that serves as a separator. +.It Ic MENU_SUBMENU +A menu entry that opens a submenu when selected. +.It Ic MENU_CAROUSEL_ENTRY +A menu entry that rotates through items like a carousel upon selection of the +menu entry. +.El +.Pp +Please see +.Xr menu.lua 8 +for extended descriptions and usage of the +.Ic MENU_* +constants. +.Ss Exported functions +The following functions are exported from +.Nm : +.Bl -tag -width core.getACPIPresent -offset indent +.It Fn core.setVerbose verbose +Sets or unsets +.Ev boot_verbose . +If +.Fa verbose +is omitted, toggle the current verbose setting. +.It Fn core.setSingleUser singleUser +Sets or unsets +.Ev boot_single . +If +.Fa singleUser +is omitted, toggle the current single user setting. +.It Fn core.getACPIPresent checkingSystemDefaults +Check whether ACPI is present. +This will only be accurate for i386-compatible loaders, including non-UEFI +loaders on amd64 systems. +If +.Fa checkingSystemDefaults +is true, ignore the current value of +.Ev hint.acpi.0.disabled . +Otherwise, return true only if ACPI is both present and not disabled. +.It Fn core.setACPI acpi +Sets or unsets +.Ev acpi_load , +.Ev hint.acpi.0.disabled , +and +.Ev loader.acpi_disabled_by_user . +If +.Fa acpi +is omitted, toggle the current ACPI setting. +.It Fn core.setSafeMode safeMode +Set the safe mode setting. +Sets or unsets +.Ev kern.smp.disabled , +.Ev hw.ata.ata_dma , +.Ev hw.ata.atapi_dma , +.Ev hw.ata.wc , +.Ev hw.eisa_slots , +.Ev kern.eventtimer.periodic , +and +.Ev kern.geom.part.check_integrity . +If +.Fa safeMode +is omitted, toggle the current safe mode setting. +.It Fn core.kernelList +Returns a table of kernels to display on the boot menu. +This will combine +.Ic kernel +and +.Ic kernels +from +.Xr loader.conf 5 . +If +.Ic kernels_autodetect +is set in +.Xr loader.conf 5 , +kernels will be autodetected from the current system. +.It Fn core.bootenvDefault +Returns the default boot environment, nil if unset. +.It Fn core.bootenvList +Returns a table of boot environments, or an empty table. +These will be picked up using the +.Ev bootenvs +and +.Ev bootenvs_count +variables set by +.Xr zfsloader 8 . +.It Fn core.setDefaults +Resets ACPI, safe mode, single user, and verbose settings to their system +defauilts. +.It Fn core.autoboot argstr +Loads the kernel and specified modules, then invokes the +.Ic autoboot +.Xr loader 8 +command with +.Fa argstr +as-is. +.It Fn core.boot argstr +Loads the kernel and specified modules, then invokes the +.Ic boot +.Xr loader 8 +command with +.Fa argstr +as-is. +.It Fn core.isSingleUserBoot +Returns true if +.Ev boot_single +is set to yes. +.It Fn core.isZFSBoot +Returns true if +.Ev currdev +is set to a +.Xr zfs 8 +dataset. +.It Fn core.isSerialBoot +Returns true if we are booting over serial. +This checks +.Ev console , +.Ev boot_serial , +and +.Ev boot_multicons . +.It Fn core.isSystem386 +Returns true if this bootloader was compiled as an i386 binary. +This generally applies to i386 loaders as well as non-UEFI loaders on amd64. +.It Fn core.deepCopyTable tbl +Recursively deep copies +.Fa tbl +and returns the result. +.It Fn core.popFrontTable tbl +Pops the front element off of +.Fa tbl , +and returns two return values: the front element, and the rest of the table. +If there are no elements, this returns nil and nil. +If there is one element, this returns the front element and an empty table. +This will not operate on truly associative tables; numeric indices are +required. +.El +.Sh SEE ALSO +.Xr loader.conf 5 , +.Xr loader 8 , +.Xr menu.lua 8 +.Sh AUTHORS +The +.Nm +file was originally written by +.An Pedro Souza Aq Mt pedrosouza@FreeBSD.org . +Later work and this manual page was done by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-svn-src-head@freebsd.org Fri Mar 2 05:36:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0028BF25FE5; Fri, 2 Mar 2018 05:36:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B276D915; Fri, 2 Mar 2018 05:36:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A08A513607; Fri, 2 Mar 2018 05:36:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w225a4Tx054091; Fri, 2 Mar 2018 05:36:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w225a4UV054090; Fri, 2 Mar 2018 05:36:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803020536.w225a4UV054090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 05:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330268 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 05:36:05 -0000 Author: kevans Date: Fri Mar 2 05:36:04 2018 New Revision: 330268 URL: https://svnweb.freebsd.org/changeset/base/330268 Log: Add menu.lua(8), but do not add to distribution Distribution will be done after all of the lualoader manpages are created. Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D14480 Added: head/stand/lua/menu.lua.8 (contents, props changed) Added: head/stand/lua/menu.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/menu.lua.8 Fri Mar 2 05:36:04 2018 (r330268) @@ -0,0 +1,236 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 23, 2018 +.Dt MENU.LUA 8 +.Os +.Sh NAME +.Nm menu.lua +.Nd FreeBSD dynamic menu boot module +.Sh DESCRIPTION +.Nm +contains the main functionality required to build a dynamic menu system. +It also contains definitions for the built-in menus, some of which are +influenced by +.Xr loader 8 +environment variables. +.Pp +Before hooking into the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local menu = require("menu") +.Ss MENU DEFINITIONS +Menus are represented in +.Nm +as a table. +That table +.Sy must +contain an +.Va entries +key. +.Pp +If the value of the +.Va entries +key is itself a table, then each value in this table defines a single entry in +this menu. +See +.Sx MENU ITEM DEFINITIONS +for the structure of each entry. +.Pp +.Va entries +may also be a function. +This function must return a table, each value of which defines a single entry +in this menu. +See +.Sx MENU ITEM DEFINITIONS . +.Ss MENU ITEM DEFINITIONS +The following keys may be defined for a menu item: +.Bl -tag -width disable-module_module -offset indent +.It Ic entry_type +The type of this menu entry. +See +.Sx MENU ITEM TYPES . +.It Ic carousel_id +A unique string id for this carousel. +A carousel is a menu entry that rotates through a selection of items. +Used for storage of the carousel's current setting. +.It Ic visible +A lambda that returns +.Dv true +if this menu item should be visible and +.Dv false +if it should not be visible. +.It Ic items +A table (or a lambda that returns a table) of the possible choices for this +carousel. +.It Ic name +A string (or a lambda that returns a string) containing the current name of this +item. +.It Ic func +The function executed when this entry is selected. +Every type except for +.Ic core.MENU_SEPARATOR +may have a +.Ic func . +.It Ic submenu +The submenu menu definition to draw when this entry is selected. +.It Ic alias +A table of case-sensitive aliases for this menu entry. +All menu entries that can be selected may have any number of +.Ic alias +entries. +.El +.Pp +.Ic entry_type +is the only required key for every entry type. +.Ic name +is required for all entry types except for +.Ic core.MENU_SEPARATOR . +.Ss MENU ITEM TYPES +The menu item type constants are defined in +.Xr core.lua 8 . +The following types are available: +.Bl -tag -width core.MENU_CAROUSEL_ENTRY -offset indent +.It Ic core.MENU_RETURN +Return to the parent menu. +If the current menu is the default menu, +.Nm +will exit the menu and begin the autoboot sequence (if applicable). +This type of menu entry may execute +.Ic func , +when selected, and has a +.Ic name . +.It Ic core.MENU_ENTRY +A normal menu entry that executes +.Ic func +when selected, and has a +.Ic name . +.It Ic core.MENU_SEPARATOR +A menu entry that serves as a separator. +It may have a +.Ic name . +.It Ic core.MENU_SUBMENU +A menu entry that opens +.Ic submenu +when selected. +It may have a +.Ic name . +.It Ic core.MENU_CAROUSEL_ENTRY +A menu entry that rotates through +.Ic items +like a carousel. +.Ic func +is executed when selected, and the callback is passed the choice index, name of +the current choice, and the table of choices. +.El +.Ss EXPORTED MENUS +The following menus are exported by +.Nm : +.Bl -tag -width menu.boot_environments -offset indent +.It Ic menu.default +The default menu to draw. +Set to +.Ic menu.welcome +by default. +.It Ic menu.welcome +The welcome menu. +Contains single and multi user boot options, as well as entries to access other +menus. +.It Ic menu.boot_options +The "Boot Options" menu. +.It Ic menu.boot_environments +The "Boot Environments" menu. +This menu is only visible if the system is booted on a ZFS partition and more +than one boot environment was detected at boot. +.El +.Sh EXAMPLES +To replace the default boot menu with a simple boot menu: +.Pp +.Bd -literal -offset indent -compact +local core = require("core") +local menu = require("menu") + +menu.default = { + entries = { + { + entry_type = core.MENU_ENTRY, + name = "Boot", + func = core.boot, + }, + { + entry_type = core.MENU_CAROUSEL_ENTRY, + carousel_id = "unique_boot_entry_name", + items = {"NO", "YES"}, + name = function(_, choice, _) + return "Option: " .. choice + end, + func = function(_, _, _) + loader.setenv("some_envvar", "some_value") + end, + }, + }, +} +.Ed +.Pp +To add another option to the welcome menu: +.Pp +.Bd -literal -offset indent -compact +local core = require("core") +local menu = require("menu") + +local welcome_entries = menu.welcome.all_entries +welcome_entries[#welcome_entries + 1] = { + entry_type = core.MENU_CAROUSEL_ENTRY, + carousel_id = "unique_boot_entry_name", + items = {"NO", "YES"}, + name = function(_, choice, _) + return "Option: " .. choice + end, + func = function(_, _, _) + loader.setenv("some_envvar", "some_value") + end, +} +.Ed +.Sh SEE ALSO +.Xr loader.conf 5 , +.Xr core.lua 8 , +.Xr loader 8 +.Sh HISTORY +The +.Nm +file first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +file was originally written by +.An Pedro Souza Aq Mt pedrosouza@FreeBSD.org . +Later work and this manual page was done by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-svn-src-head@freebsd.org Fri Mar 2 05:38:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6364F26266; Fri, 2 Mar 2018 05:38:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 849CB6DB0B; Fri, 2 Mar 2018 05:38:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AEB713617; Fri, 2 Mar 2018 05:38:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w225c8R8054199; Fri, 2 Mar 2018 05:38:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w225c8F2054198; Fri, 2 Mar 2018 05:38:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803020538.w225c8F2054198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 05:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330269 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 05:38:09 -0000 Author: kevans Date: Fri Mar 2 05:38:08 2018 New Revision: 330269 URL: https://svnweb.freebsd.org/changeset/base/330269 Log: core.lua(8): Add missing note about core.KEYSTR_CSI Modified: head/stand/lua/core.lua.8 Modified: head/stand/lua/core.lua.8 ============================================================================== --- head/stand/lua/core.lua.8 Fri Mar 2 05:36:04 2018 (r330268) +++ head/stand/lua/core.lua.8 Fri Mar 2 05:38:08 2018 (r330269) @@ -65,6 +65,8 @@ The following key-string constants are defined in .Bl -tag -width KEYSTR_ESCAPE -compact -offset indent .It Ic KEYSTR_ESCAPE The escape key. +.It Ic KEYSTR_CSI +The ANSI CSI sequence. .El .Pp The following menu entry type constants are defined in From owner-svn-src-head@freebsd.org Fri Mar 2 05:46:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 764B2F26AD4; Fri, 2 Mar 2018 05:46:06 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA8146E0C0; Fri, 2 Mar 2018 05:46:05 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MQiVh-1fH7JL47h7-00U1os; Fri, 02 Mar 2018 06:40:47 +0100 Date: Fri, 2 Mar 2018 06:40:40 +0100 From: "O. Hartmann" To: Kirk McKusick Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330264 - in head: lib/libufs stand/libsa sys/geom sys/geom/journal sys/geom/label sys/ufs/ffs Message-ID: <20180302064040.05b7b46a@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <201803020434.w224Yr9J023438@repo.freebsd.org> References: <201803020434.w224Yr9J023438@repo.freebsd.org> Organization: Walstatt MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Uj7Q3UcH7/adSqYyDQRnpyEwFi48c5rQXwrWA3/Ix2Gs5scOsDV A5IUgYiVizM1oPaOAKLJHLwLBAIHXNNEtNhBpyBYbcCiYwbt7r2Wrp5AOP2sXuDeXAmtpbC EO3L8nlSgDMd6IPwSJ/9zwxa4KGtTUA6VbXVArbOdSQhgnY6+r6OKNHolkV6VlVKD5HrLux SBrf9H+cUn6qXHt3B7eNw== X-UI-Out-Filterresults: notjunk:1;V01:K0:bRGvkkq3DWE=:wztjwl7BcJI1cuABskcLe/ ddH3DF1qMqHYEX5UNq4E9PQFk2BKljX9dfzmuDGdhTuu1B8U3d4zB0beF21qdI3acorJ0y3eC +QoKUudoN+DOfyGyr/9LJ/t7S91jd7M4YSLR2j/Bc0fjROVTIIkXq9PgceVyORCVy8kangDZ1 GLVQuz/sJesZIPMJ2Cyw5skYynPXtL+1EQuovISnPKX427RKuoevSzA3QJX18AHM5ERCqvq6D 0U8T/GpmyIagO7OVb8K9d1iTa3hH4XveuQCvdewF+X6pP8hGCSUIncul2D3EFn0AppJLAghRH 4GQWfbs2/kqGkUqUKdJmskyn2d9B4bYkWHw4nPEqiBgeO+iR5iSMdvS7PU61VvMDMNc0sTMYK +vwymcmjO1dUS9Vtv9G17erZPunYzOroc58XyCLTtmDtDNc8g6P9U99PMIHo6Q+3s3/JJwstO Gs06i8bj0DwMafhNI6EAdb+f37imcKP4kajiO8ozi0rj0Yma2zMUpTC5zB2OF70pw6WFda8Ub 4wO4y6babsgrr+kvKWHwQQYIjSRiYg4BXsxuBJDGKsCMVWlfLN+C6YUauO850tj+ZCo04vrNU ya/2g4uwLuz/J219bqNjdSsy1hnxxZOYZ42FUEhM8ONsGscKLgSV+ilYpUdooZl1tJoC/rTEo IxVaItoZx6WLPSp5niNFuHZ45O/kdH7Q7z1qO3hkhL03IwWfnIcuzqBwIuXsB0WC7v7ApB3Ec WVDpNBsifarA9rTiw9aBXcIdjvyYQNzzf/XxwGhLQ9D2arAG4t31VswgQ0QuiL7g07NoLRPm7 WkEI8/Ed1nzJSUASi4OwFD1F91j5p/ecXnM/JFGV7ft69nYILA= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 05:46:06 -0000 On Fri, 2 Mar 2018 04:34:53 +0000 (UTC) Kirk McKusick wrote: > Author: mckusick > Date: Fri Mar 2 04:34:53 2018 > New Revision: 330264 > URL: https://svnweb.freebsd.org/changeset/base/330264 > > Log: > This change is some refactoring of Mark Johnston's changes in r329375 > to fix the memory leak that I introduced in r328426. Instead of > trying to clear up the possible memory leak in all the clients, I > ensure that it gets cleaned up in the source (e.g., ffs_sbget ensures > that memory is always freed if it returns an error). > > The original change in r328426 was a bit sparse in its description. > So I am expanding on its description here (thanks cem@ and rgrimes@ > for your encouragement for my longer commit messages). > > In preparation for adding check hashing to superblocks, r328426 is > a refactoring of the code to get the reading/writing of the superblock > into one place. Unlike the cylinder group reading/writing which > ends up in two places (ffs_getcg/ffs_geom_strategy in the kernel > and cgget/cgput in libufs), I have the core superblock functions > just in the kernel (ffs_sbfetch/ffs_sbput in ffs_subr.c which is > already imported into utilities like fsck_ffs as well as libufs to > implement sbget/sbput). The ffs_sbfetch and ffs_sbput functions > take a function pointer to do the actual I/O for which there are > four variants: > > ffs_use_bread / ffs_use_bwrite for the in-kernel filesystem > > g_use_g_read_data / g_use_g_write_data for kernel geom clients > > ufs_use_sa_read for the standalone code (stand/libsa/ufs.c > but not stand/libsa/ufsread.c which is size constrained) > > use_pread / use_pwrite for libufs > > Uses of these interfaces are in the UFS filesystem, geoms journal & > label, libsa changes, and libufs. They also permeate out into the > filesystem utilities fsck_ffs, newfs, growfs, clri, dump, quotacheck, > fsirand, fstyp, and quot. Some of these utilities should probably be > converted to directly use libufs (like dumpfs was for example), but > there does not seem to be much win in doing so. > > Tested by: Peter Holm (pho@) > > Modified: > head/lib/libufs/sblock.c > head/stand/libsa/ufs.c > head/sys/geom/geom_io.c > head/sys/geom/journal/g_journal_ufs.c > head/sys/geom/label/g_label_ufs.c > head/sys/ufs/ffs/ffs_subr.c > head/sys/ufs/ffs/ffs_vfsops.c > > Modified: head/lib/libufs/sblock.c > ============================================================================== > --- head/lib/libufs/sblock.c Fri Mar 2 03:05:36 2018 (r330263) > +++ head/lib/libufs/sblock.c Fri Mar 2 04:34:53 2018 (r330264) > @@ -150,7 +150,6 @@ use_pread(void *devfd, off_t loc, void **bufp, int siz > int fd; > > fd = *(int *)devfd; > - free(*bufp); > if ((*bufp = malloc(size)) == NULL) > return (ENOSPC); > if (pread(fd, *bufp, size, loc) != size) > > Modified: head/stand/libsa/ufs.c > ============================================================================== > --- head/stand/libsa/ufs.c Fri Mar 2 03:05:36 2018 (r330263) > +++ head/stand/libsa/ufs.c Fri Mar 2 04:34:53 2018 (r330264) > @@ -518,7 +518,7 @@ ufs_open(upath, f) > > /* read super block */ > twiddle(1); > - if ((rc = ffs_sbget(f, &fs, -1, 0, ufs_use_sa_read)) != 0) > + if ((rc = ffs_sbget(f, &fs, -1, "stand", ufs_use_sa_read)) != 0) > goto out; > fp->f_fs = fs; > /* > @@ -688,7 +688,6 @@ ufs_use_sa_read(void *devfd, off_t loc, void **bufp, i > int error; > > f = (struct open_file *)devfd; > - free(*bufp); > if ((*bufp = malloc(size)) == NULL) > return (ENOSPC); > error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, loc / > DEV_BSIZE, > > Modified: head/sys/geom/geom_io.c > ============================================================================== > --- head/sys/geom/geom_io.c Fri Mar 2 03:05:36 2018 (r330263) > +++ head/sys/geom/geom_io.c Fri Mar 2 04:34:53 2018 (r330264) > @@ -957,6 +957,9 @@ g_use_g_read_data(void *devfd, off_t loc, void **bufp, > { > struct g_consumer *cp; > > + KASSERT(*bufp == NULL, > + ("g_use_g_read_data: non-NULL *bufp %p\n", *bufp)); > + > cp = (struct g_consumer *)devfd; > /* > * Take care not to issue an invalid I/O request. The offset of > @@ -966,8 +969,6 @@ g_use_g_read_data(void *devfd, off_t loc, void **bufp, > */ > if (loc % cp->provider->sectorsize != 0) > return (ENOENT); > - if (*bufp != NULL) > - g_free(*bufp); > *bufp = g_read_data(cp, loc, size, NULL); > if (*bufp == NULL) > return (ENOENT); > > Modified: head/sys/geom/journal/g_journal_ufs.c > ============================================================================== > --- head/sys/geom/journal/g_journal_ufs.c Fri Mar 2 03:05:36 > 2018 (r330263) +++ head/sys/geom/journal/g_journal_ufs.c Fri > Mar 2 04:34:53 2018 (r330264) @@ -72,11 +72,11 @@ > g_journal_ufs_dirty(struct g_consumer *cp) > fs = NULL; > if (SBLOCKSIZE % cp->provider->sectorsize != 0 || > - ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) { > + ffs_sbget(cp, &fs, -1, M_GEOM, g_use_g_read_data) != 0) { > GJ_DEBUG(0, "Cannot find superblock to mark file system %s " > "as dirty.", cp->provider->name); > - if (fs != NULL) > - g_free(fs); > + KASSERT(fs == NULL, > + ("g_journal_ufs_dirty: non-NULL fs %p\n", fs)); > return; > } > GJ_DEBUG(0, "clean=%d flags=0x%x", fs->fs_clean, fs->fs_flags); > > Modified: head/sys/geom/label/g_label_ufs.c > ============================================================================== > --- head/sys/geom/label/g_label_ufs.c Fri Mar 2 03:05:36 2018 > (r330263) +++ head/sys/geom/label/g_label_ufs.c Fri Mar 2 04:34:53 > 2018 (r330264) @@ -77,9 +77,9 @@ g_label_ufs_taste_common(struct > g_consumer *cp, char * > fs = NULL; > if (SBLOCKSIZE % pp->sectorsize != 0 || > - ffs_sbget(cp, &fs, -1, NULL, g_use_g_read_data) != 0) { > - if (fs != NULL) > - g_free(fs); > + ffs_sbget(cp, &fs, -1, M_GEOM, g_use_g_read_data) != 0) { > + KASSERT(fs == NULL, > + ("g_label_ufs_taste_common: non-NULL fs %p\n",fs); > return; > } > > > Modified: head/sys/ufs/ffs/ffs_subr.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_subr.c Fri Mar 2 03:05:36 2018 > (r330263) +++ head/sys/ufs/ffs/ffs_subr.c Fri Mar 2 04:34:53 > 2018 (r330264) @@ -151,6 +151,7 @@ static int readsuper(void *, struct > fs **, off_t, int, > * superblock. Memory is allocated for the superblock by the readfunc and > * is returned. If filltype is non-NULL, additional memory is allocated > * of type filltype and filled in with the superblock summary information. > + * All memory is freed when any error is returned. > * > * If a superblock is found, zero is returned. Otherwise one of the > * following error values is returned: > @@ -172,16 +173,24 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc > int32_t *lp; > char *buf; > > + fs = NULL; > *fsp = NULL; > if (altsblock != -1) { > - if ((error = readsuper(devfd, fsp, altsblock, 1, > - readfunc)) != 0) > + if ((error = readsuper(devfd, &fs, altsblock, 1, > + readfunc)) != 0) { > + if (fs != NULL) > + UFS_FREE(fs, filltype); > return (error); > + } > } else { > for (i = 0; sblock_try[i] != -1; i++) { > - if ((error = readsuper(devfd, fsp, sblock_try[i], 0, > + if ((error = readsuper(devfd, &fs, sblock_try[i], 0, > readfunc)) == 0) > break; > + if (fs != NULL) { > + UFS_FREE(fs, filltype); > + fs = NULL; > + } > if (error == ENOENT) > continue; > return (error); > @@ -190,20 +199,18 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc > return (ENOENT); > } > /* > - * If not filling in summary information, return. > - */ > - if (filltype == NULL) > - return (0); > - /* > * Read in the superblock summary information. > */ > - fs = *fsp; > size = fs->fs_cssize; > blks = howmany(size, fs->fs_fsize); > if (fs->fs_contigsumsize > 0) > size += fs->fs_ncg * sizeof(int32_t); > size += fs->fs_ncg * sizeof(u_int8_t); > - space = UFS_MALLOC(size, filltype, M_WAITOK); > + /* When running in libufs or libsa, UFS_MALLOC may fail */ > + if ((space = UFS_MALLOC(size, filltype, M_WAITOK)) == NULL) { > + UFS_FREE(fs, filltype); > + return (ENOSPC); > + } > fs->fs_csp = (struct csum *)space; > for (i = 0; i < blks; i += fs->fs_frag) { > size = fs->fs_bsize; > @@ -213,9 +220,10 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc > error = (*readfunc)(devfd, > dbtob(fsbtodb(fs, fs->fs_csaddr + i)), (void **)&buf, > size); if (error) { > - UFS_FREE(buf, filltype); > + if (buf != NULL) > + UFS_FREE(buf, filltype); > UFS_FREE(fs->fs_csp, filltype); > - fs->fs_csp = NULL; > + UFS_FREE(fs, filltype); > return (error); > } > memcpy(space, buf, size); > @@ -231,6 +239,7 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc > size = fs->fs_ncg * sizeof(u_int8_t); > fs->fs_contigdirs = (u_int8_t *)space; > bzero(fs->fs_contigdirs, size); > + *fsp = fs; > return (0); > } > > @@ -246,8 +255,6 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo > int error; > > error = (*readfunc)(devfd, sblockloc, (void **)fsp, SBLOCKSIZE); > - if (*fsp != NULL) > - (*fsp)->fs_csp = NULL; /* Not yet any summary > information */ if (error != 0) > return (error); > fs = *fsp; > @@ -263,6 +270,8 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo > fs->fs_bsize >= roundup(sizeof(struct fs), DEV_BSIZE)) { > /* Have to set for old filesystems that predate this field */ > fs->fs_sblockactualloc = sblockloc; > + /* Not yet any summary information */ > + fs->fs_csp = NULL; > return (0); > } > return (ENOENT); > > Modified: head/sys/ufs/ffs/ffs_vfsops.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_vfsops.c Fri Mar 2 03:05:36 2018 > (r330263) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Mar 2 04:34:53 > 2018 (r330264) @@ -1075,14 +1075,11 @@ ffs_use_bread(void *devfd, > off_t loc, void **bufp, int struct buf *bp; > int error; > > - free(*bufp, M_UFSMNT); > + KASSERT(*bufp == NULL, ("ffs_use_bread: non-NULL *bufp %p\n", > *bufp)); *bufp = malloc(size, M_UFSMNT, M_WAITOK); > if ((error = bread((struct vnode *)devfd, btodb(loc), size, NOCRED, > - &bp)) != 0) { > - free(*bufp, M_UFSMNT); > - *bufp = NULL; > + &bp)) != 0) > return (error); > - } > bcopy(bp->b_data, *bufp, size); > bp->b_flags |= B_INVAL | B_NOCACHE; > brelse(bp); > _______________________________________________ > 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" Recent build of a kernel on CURRENT fails for me due to: [...] --- g_label_ufs.o --- /pool/sources/CURRENT/src/sys/geom/label/g_label_ufs.c:81:3: error: unterminated function-like macro invocation KASSERT(fs == NULL, ^ /pool/sources/CURRENT/src/sys/sys/systm.h:99:9: note: macro 'KASSERT' defined here #define KASSERT(exp,msg) do { \ ^ /pool/sources/CURRENT/src/sys/geom/label/g_label_ufs.c:155:38: error: expected '}' MODULE_DEPEND(g_label, ufs, 1, 1, 1); ^ /pool/sources/CURRENT/src/sys/geom/label/g_label_ufs.c:80:62: note: to match this '{' ffs_sbget(cp, &fs, -1, M_GEOM, g_use_g_read_data) != 0) { ^ /pool/sources/CURRENT/src/sys/geom/label/g_label_ufs.c:155:38: error: expected '}' MODULE_DEPEND(g_label, ufs, 1, 1, 1); ^ /pool/sources/CURRENT/src/sys/geom/label/g_label_ufs.c:70:1: note: to match this '{' { ^ 3 errors generated. *** [g_label_ufs.o] Error code 1 From owner-svn-src-head@freebsd.org Fri Mar 2 06:02:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4366DF275BE; Fri, 2 Mar 2018 06:02:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9B7F6E9C3; Fri, 2 Mar 2018 06:02:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4A5D13AD6; Fri, 2 Mar 2018 06:02:54 +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 w2262sxk068979; Fri, 2 Mar 2018 06:02:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2262scg068978; Fri, 2 Mar 2018 06:02:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803020602.w2262scg068978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 2 Mar 2018 06:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330270 - head/sys/geom/label X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/geom/label X-SVN-Commit-Revision: 330270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 06:02:55 -0000 Author: cem Date: Fri Mar 2 06:02:54 2018 New Revision: 330270 URL: https://svnweb.freebsd.org/changeset/base/330270 Log: g_label_ufs: Fix typo from r330264 Reported by: O. Hartmann Sponsored by: Dell EMC Isilon Modified: head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Fri Mar 2 05:38:08 2018 (r330269) +++ head/sys/geom/label/g_label_ufs.c Fri Mar 2 06:02:54 2018 (r330270) @@ -79,7 +79,7 @@ g_label_ufs_taste_common(struct g_consumer *cp, char * if (SBLOCKSIZE % pp->sectorsize != 0 || ffs_sbget(cp, &fs, -1, M_GEOM, g_use_g_read_data) != 0) { KASSERT(fs == NULL, - ("g_label_ufs_taste_common: non-NULL fs %p\n",fs); + ("g_label_ufs_taste_common: non-NULL fs %p\n", fs)); return; } From owner-svn-src-head@freebsd.org Fri Mar 2 07:01:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E14F29970; Fri, 2 Mar 2018 07:01:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (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 E89BB70BA3; Fri, 2 Mar 2018 07:01:54 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f180.google.com with SMTP id v6so9778031iog.7; Thu, 01 Mar 2018 23:01:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=rhQJ2YGU7YKAkBA6/0uepABpCxHnbFBpRshiKA1yNYY=; b=mx3G0SnjPE41ejlrkqB5k9qRNDSVn1G3/CUmZiAdXJp8PfuOP2CjAjQ2bCPByiQ8uI 7QOe4gNJgLHL6ivsT6Qc++rog39rRVfszO0Q7Rb6nMV09TyTYblzvf2VlVmYxuO5FYzR at2FEna+aNDWzBY+d5S/H50Wrv1IGnF3VpHlvJlbWWF+5c9tXUg8ep7ZVhEkkyL0YfJo MKNsE3uj/RSyHcitGCPR7DVSxwKLWv1JFEaxO1rgLne/T2X3VHg9pdVDmemW84p0Uegs oNJIC9hq3vBfN2JkbB7T6jzw+YBF8rDjRhAGcYuUs7Xn7Bm59s2HCY7lDY7meKaUoD0l ITew== X-Gm-Message-State: APf1xPDCUkU1r33cM/RfH49LPtRD8PoPOGlwZjH2f6HXyKnArYHdzqmT B96YrB1GmzErUFOW0/41cJeqjRFz X-Google-Smtp-Source: AG47ELtT59rYryqmDkIJg1qFONbW0D5/3yB3U5t52ksJ4s1Y8uvIr1LAcnbVtnwWmzit5XmFov40aw== X-Received: by 10.107.112.7 with SMTP id l7mr4924740ioc.228.1519970651533; Thu, 01 Mar 2018 22:04:11 -0800 (PST) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com. [209.85.223.180]) by smtp.gmail.com with ESMTPSA id l42sm4169824ioi.53.2018.03.01.22.04.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 22:04:11 -0800 (PST) Received: by mail-io0-f180.google.com with SMTP id u84so9679753iod.9; Thu, 01 Mar 2018 22:04:11 -0800 (PST) X-Received: by 10.107.34.80 with SMTP id i77mr5043954ioi.220.1519970651175; Thu, 01 Mar 2018 22:04:11 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Thu, 1 Mar 2018 22:04:10 -0800 (PST) In-Reply-To: <20180302064040.05b7b46a@freyja.zeit4.iv.bundesimmobilien.de> References: <201803020434.w224Yr9J023438@repo.freebsd.org> <20180302064040.05b7b46a@freyja.zeit4.iv.bundesimmobilien.de> From: Conrad Meyer Date: Thu, 1 Mar 2018 22:04:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330264 - in head: lib/libufs stand/libsa sys/geom sys/geom/journal sys/geom/label sys/ufs/ffs To: "O. Hartmann" Cc: Kirk McKusick , 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.25 Precedence: list List-Id: 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 Mar 2018 07:01:55 -0000 On Thu, Mar 1, 2018 at 9:40 PM, O. Hartmann wrote: > On Fri, 2 Mar 2018 04:34:53 +0000 (UTC) > Kirk McKusick wrote: > >> Author: mckusick >> Date: Fri Mar 2 04:34:53 2018 >> New Revision: 330264 >> URL: https://svnweb.freebsd.org/changeset/base/330264 >> ... > > Recent build of a kernel on CURRENT fails for me due to: > > [...] > --- g_label_ufs.o --- > /pool/sources/CURRENT/src/sys/geom/label/g_label_ufs.c:81:3: error: > unterminated function-like macro invocation KASSERT(fs == NULL, > ^ Should be fixed in r330270. Thanks, Conrad From owner-svn-src-head@freebsd.org Fri Mar 2 08:52:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7CABF30F67; Fri, 2 Mar 2018 08:52:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE1875480; Fri, 2 Mar 2018 08:52:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 728B9155CF; Fri, 2 Mar 2018 08:52:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w228qR17053695; Fri, 2 Mar 2018 08:52:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w228qRUZ053693; Fri, 2 Mar 2018 08:52:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803020852.w228qRUZ053693@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 Mar 2018 08:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330271 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 330271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 08:52:28 -0000 Author: hselasky Date: Fri Mar 2 08:52:27 2018 New Revision: 330271 URL: https://svnweb.freebsd.org/changeset/base/330271 Log: Rename callout member in struct timer_list to match the one in struct delayed_work in the LinuxKPI. This allows the timer_pending() function macro to be used with delayed work structures. No functional nor structural change. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/timer.h Fri Mar 2 06:02:54 2018 (r330270) +++ head/sys/compat/linuxkpi/common/include/linux/timer.h Fri Mar 2 08:52:27 2018 (r330271) @@ -38,7 +38,7 @@ #include struct timer_list { - struct callout timer_callout; + struct callout callout; void (*function) (unsigned long); unsigned long data; int expires; @@ -51,7 +51,7 @@ extern unsigned long linux_timer_hz_mask; #define setup_timer(timer, func, dat) do { \ (timer)->function = (func); \ (timer)->data = (dat); \ - callout_init(&(timer)->timer_callout, 1); \ + callout_init(&(timer)->callout, 1); \ } while (0) #define __setup_timer(timer, func, dat, flags) do { \ @@ -62,16 +62,16 @@ extern unsigned long linux_timer_hz_mask; #define init_timer(timer) do { \ (timer)->function = NULL; \ (timer)->data = 0; \ - callout_init(&(timer)->timer_callout, 1); \ + callout_init(&(timer)->callout, 1); \ } while (0) extern void mod_timer(struct timer_list *, int); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); -#define del_timer(timer) (void)callout_stop(&(timer)->timer_callout) -#define del_timer_sync(timer) (void)callout_drain(&(timer)->timer_callout) -#define timer_pending(timer) callout_pending(&(timer)->timer_callout) +#define del_timer(timer) (void)callout_stop(&(timer)->callout) +#define del_timer_sync(timer) (void)callout_drain(&(timer)->callout) +#define timer_pending(timer) callout_pending(&(timer)->callout) #define round_jiffies(j) \ ((int)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) #define round_jiffies_relative(j) round_jiffies(j) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Mar 2 06:02:54 2018 (r330270) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Mar 2 08:52:27 2018 (r330271) @@ -1734,7 +1734,7 @@ mod_timer(struct timer_list *timer, int expires) { timer->expires = expires; - callout_reset(&timer->timer_callout, + callout_reset(&timer->callout, linux_timer_jiffies_until(expires), &linux_timer_callback_wrapper, timer); } @@ -1743,7 +1743,7 @@ void add_timer(struct timer_list *timer) { - callout_reset(&timer->timer_callout, + callout_reset(&timer->callout, linux_timer_jiffies_until(timer->expires), &linux_timer_callback_wrapper, timer); } @@ -1752,7 +1752,7 @@ void add_timer_on(struct timer_list *timer, int cpu) { - callout_reset_on(&timer->timer_callout, + callout_reset_on(&timer->callout, linux_timer_jiffies_until(timer->expires), &linux_timer_callback_wrapper, timer, cpu); } From owner-svn-src-head@freebsd.org Fri Mar 2 08:56:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EABA7F31351; Fri, 2 Mar 2018 08:56:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C31B756E7; Fri, 2 Mar 2018 08:56:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92159155D6; Fri, 2 Mar 2018 08:56: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 w228uFxL053884; Fri, 2 Mar 2018 08:56:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w228uFPo053883; Fri, 2 Mar 2018 08:56:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803020856.w228uFPo053883@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 Mar 2018 08:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330272 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 330272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 08:56:16 -0000 Author: hselasky Date: Fri Mar 2 08:56:15 2018 New Revision: 330272 URL: https://svnweb.freebsd.org/changeset/base/330272 Log: Implement wait_on_bit() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Fri Mar 2 08:52:27 2018 (r330271) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Fri Mar 2 08:56:15 2018 (r330272) @@ -249,6 +249,8 @@ void linux_wake_up_atomic_t(atomic_t *); int linux_wait_on_atomic_t(atomic_t *, unsigned int); #define wake_up_bit(word, bit) linux_wake_up_bit(word, bit) +#define wait_on_bit(word, bit, state) \ + linux_wait_on_bit_timeout(word, bit, state, MAX_SCHEDULE_TIMEOUT) #define wait_on_bit_timeout(word, bit, state, timeout) \ linux_wait_on_bit_timeout(word, bit, state, timeout) #define wake_up_atomic_t(a) linux_wake_up_atomic_t(a) From owner-svn-src-head@freebsd.org Fri Mar 2 08:58:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98045F31597; Fri, 2 Mar 2018 08:58:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B4397592A; Fri, 2 Mar 2018 08:58:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42066155D7; Fri, 2 Mar 2018 08:58:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w228wXP0053996; Fri, 2 Mar 2018 08:58:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w228wX1G053995; Fri, 2 Mar 2018 08:58:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803020858.w228wX1G053995@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 Mar 2018 08:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330273 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 330273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 08:58:33 -0000 Author: hselasky Date: Fri Mar 2 08:58:32 2018 New Revision: 330273 URL: https://svnweb.freebsd.org/changeset/base/330273 Log: Implement ktime_get_raw() function in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Fri Mar 2 08:56:15 2018 (r330272) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Fri Mar 2 08:58:32 2018 (r330273) @@ -189,6 +189,15 @@ ktime_get_real_seconds(void) return (ts.tv_sec); } +static inline ktime_t +ktime_get_raw(void) +{ + struct timespec ts; + + nanotime(&ts); + return (timespec_to_ktime(ts)); +} + static inline u64 ktime_get_raw_ns(void) { From owner-svn-src-head@freebsd.org Fri Mar 2 08:59:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89FE7F3174D; Fri, 2 Mar 2018 08:59:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA6F75B22; Fri, 2 Mar 2018 08:59:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36C8C155D8; Fri, 2 Mar 2018 08:59:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w228xsFr054081; Fri, 2 Mar 2018 08:59:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w228xsGF054080; Fri, 2 Mar 2018 08:59:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803020859.w228xsGF054080@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 Mar 2018 08:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330274 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 330274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 08:59:54 -0000 Author: hselasky Date: Fri Mar 2 08:59:53 2018 New Revision: 330274 URL: https://svnweb.freebsd.org/changeset/base/330274 Log: Implement more lockdep stubs in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/lockdep.h Fri Mar 2 08:58:32 2018 (r330273) +++ head/sys/compat/linuxkpi/common/include/linux/lockdep.h Fri Mar 2 08:59:53 2018 (r330274) @@ -36,8 +36,9 @@ struct lock_class_key { }; #define lockdep_set_class(lock, key) - #define lockdep_set_class_and_name(lock, key, name) +#define lockdep_set_current_reclaim_state(g) do { } while (0) +#define lockdep_clear_current_reclaim_state() do { } while (0) #define lockdep_assert_held(m) \ sx_assert(&(m)->sx, SA_XLOCKED) From owner-svn-src-head@freebsd.org Fri Mar 2 13:04:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 670E9F43B52; Fri, 2 Mar 2018 13:04:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE927F8D2; Fri, 2 Mar 2018 13:04:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1497D17D74; Fri, 2 Mar 2018 13:04:22 +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 w22D4LdE078859; Fri, 2 Mar 2018 13:04:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22D4LhO078858; Fri, 2 Mar 2018 13:04:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803021304.w22D4LhO078858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 2 Mar 2018 13:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330276 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 13:04:22 -0000 Author: andrew Date: Fri Mar 2 13:04:21 2018 New Revision: 330276 URL: https://svnweb.freebsd.org/changeset/base/330276 Log: Count the number of children in the GICv3 ACPI attachment. This is needed later for assigning IRQ vector space. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gic_v3_acpi.c Modified: head/sys/arm64/arm64/gic_v3_acpi.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_acpi.c Fri Mar 2 10:57:46 2018 (r330275) +++ head/sys/arm64/arm64/gic_v3_acpi.c Fri Mar 2 13:04:21 2018 (r330276) @@ -297,12 +297,14 @@ gic_v3_add_children(ACPI_SUBTABLE_HEADER *entry, void { ACPI_MADT_GENERIC_TRANSLATOR *gict; struct gic_v3_acpi_devinfo *di; + struct gic_v3_softc *sc; device_t child, dev; if (entry->Type == ACPI_MADT_TYPE_GENERIC_TRANSLATOR) { /* We have an ITS, add it as a child */ gict = (ACPI_MADT_GENERIC_TRANSLATOR *)entry; dev = arg; + sc = device_get_softc(dev); child = device_add_child(dev, "its", -1); if (child == NULL) @@ -313,6 +315,7 @@ gic_v3_add_children(ACPI_SUBTABLE_HEADER *entry, void resource_list_add(&di->di_rl, SYS_RES_MEMORY, 0, gict->BaseAddress, gict->BaseAddress + 128 * 1024 - 1, 128 * 1024); + sc->gic_nchildren++; device_set_ivars(child, di); } } From owner-svn-src-head@freebsd.org Fri Mar 2 14:14:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D45B9F26FD9; Fri, 2 Mar 2018 14:14:13 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from mo6-p00-ob.smtp.rzone.de (mo6-p00-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5300::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25ABE82CD1; Fri, 2 Mar 2018 14:14:13 +0000 (UTC) (envelope-from pieter@degoeje.nl) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1520000052; s=strato-dkim-0002; d=degoeje.nl; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Date:Message-ID: From:References:To:Subject:X-RZG-CLASS-ID:X-RZG-AUTH; bh=EC4U1TGW7mQdV/MlNVmdh0fqqPUN33TCc3JmWi2MtKs=; b=PwvVS2ZIWLyHGw6tCzc8eE+0cbSnt3rxZiwwwsy1AcnJrYK19j5lpKjupTBfht8zS9 mTZGKj/y9XN6VCjECgqxQPkv3mkssGCi17U6VE2DPnjJ6jAkumuxffw22jYkhcP570tu Ol4C296ZDfM+oZzGgMQe0msKdHoWH0OFQZ5+nFhDgzMOetUK8hxGQ4sS3OPAKeoN7dl6 Ys0AFFyCKVlO1H6JO/YiW6wRP/vuSWwzNJvBXEz3FLEMKinN279fUiaiURpLqoC/gxxR XyC6YI+a/uL8aD4OYYFOeiMd11rpGib4nBudqkXRu4oP5Z1NNmA/MZpzNn7DNxPFSPsv I9UA== X-RZG-AUTH: :PGUBYUW6W/vjKUwSpXdHbXp/KlnzhfjpGaq9ccFSB01ZbYSz0XXyHEnBMb8k5m4K X-RZG-CLASS-ID: mo00 Received: from [192.168.1.81] ([31.200.213.82]) by smtp.strato.com (RZmta 42.18 AUTH) with ESMTPSA id N065ceu22EE8Yoj (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 2 Mar 2018 15:14:08 +0100 (CET) Subject: Re: svn commit: r329882 - in head/sys: conf kern sys vm To: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802232251.w1NMpqn4025101@repo.freebsd.org> From: Pieter de Goeje Message-ID: <1782e475-06d8-c806-0d0c-ae5a5893baf5@degoeje.nl> Date: Fri, 2 Mar 2018 15:14:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802232251.w1NMpqn4025101@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 14:14:14 -0000 Hi, I'm curious, it looks like Kd is quite significant by default, I assume to limit the slew rate of the output. Given that the error is an integer, and pidctrl_daemon() is called at irregular intervals, it seems to me that the derivative will be very noisy. In my experience with PID controllers controlling physical processes, one would need some kind of filtering on the input to make Kd useful, otherwise it would just contribute more instability to the system. In practice even a simple exponential (single pole) filter can help a lot at the cost of increased response time. Is this something that was considered? - Pieter de Goeje From owner-svn-src-head@freebsd.org Fri Mar 2 14:16:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93FE9F272A1; Fri, 2 Mar 2018 14:16:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 426E882EC5; Fri, 2 Mar 2018 14:16:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D49118898; Fri, 2 Mar 2018 14:16:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22EGKSu015208; Fri, 2 Mar 2018 14:16:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22EGJHm015205; Fri, 2 Mar 2018 14:16:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803021416.w22EGJHm015205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 2 Mar 2018 14:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330277 - in head: bin/stty libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: bin/stty libexec/getty X-SVN-Commit-Revision: 330277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 14:16:20 -0000 Author: trasz Date: Fri Mar 2 14:16:19 2018 New Revision: 330277 URL: https://svnweb.freebsd.org/changeset/base/330277 Log: .Xr pstat(8), so that people have a chance to learn how to get a list of terminal devices using "pstat -t". MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/bin/stty/stty.1 head/libexec/getty/getty.8 head/libexec/getty/ttys.5 Modified: head/bin/stty/stty.1 ============================================================================== --- head/bin/stty/stty.1 Fri Mar 2 13:04:21 2018 (r330276) +++ head/bin/stty/stty.1 Fri Mar 2 14:16:19 2018 (r330277) @@ -32,7 +32,7 @@ .\" @(#)stty.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd March 2, 2018 .Dt STTY 1 .Os .Sh NAME @@ -589,7 +589,8 @@ Same as the control character .Ex -std .Sh SEE ALSO .Xr resizewin 1 , -.Xr termios 4 +.Xr termios 4 , +.Xr pstat 8 .Sh STANDARDS The .Nm Modified: head/libexec/getty/getty.8 ============================================================================== --- head/libexec/getty/getty.8 Fri Mar 2 13:04:21 2018 (r330276) +++ head/libexec/getty/getty.8 Fri Mar 2 14:16:19 2018 (r330277) @@ -28,7 +28,7 @@ .\" from: @(#)getty.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd June 4, 1993 +.Dd March 2, 2018 .Dt GETTY 8 .Os .Sh NAME @@ -116,7 +116,8 @@ does not exist. .Xr tty 4 , .Xr gettytab 5 , .Xr ttys 5 , -.Xr init 8 +.Xr init 8 , +.Xr pstat 8 .Sh HISTORY A .Nm Modified: head/libexec/getty/ttys.5 ============================================================================== --- head/libexec/getty/ttys.5 Fri Mar 2 13:04:21 2018 (r330276) +++ head/libexec/getty/ttys.5 Fri Mar 2 14:16:19 2018 (r330277) @@ -28,7 +28,7 @@ .\" from: @(#)ttys.5 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd March 16, 2017 +.Dd March 2, 2018 .Dt TTYS 5 .Os .Sh NAME @@ -166,7 +166,8 @@ ttyv0 "/usr/local/bin/xterm -display :0" xterm on wind .Xr login.conf 5 , .Xr termcap 5 , .Xr getty 8 , -.Xr init 8 +.Xr init 8 , +.Xr pstat 8 .\".Xr init 8 , .\".Xr ttyflags 8 .Sh HISTORY From owner-svn-src-head@freebsd.org Fri Mar 2 14:40:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EBFCF290B6 for ; Fri, 2 Mar 2018 14:40:20 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C60D83F6D for ; Fri, 2 Mar 2018 14:40:18 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-lf0-x22c.google.com with SMTP id v9so13572891lfa.11 for ; Fri, 02 Mar 2018 06:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MDXwQE4Kaj0pGVIoymzDI9EpLNmbjuQzI8QncPo8IhU=; b=jXhDPm54kaBEv1vDeysApZdtqM0Q+C4UiPF6jZVOGX+QJtCMYejiOfL7KmC/15sdB1 za1cKth8xwC9OmulTZdkLZwYu0RNhfStJ7ZJgDjykvuIJmCf4Pu1qw0GdxGnoVg0knnL xt+IhxjtR/ueTeCMLmLOGonrLmjl9/R4+6rCKS2qPX9EZmJl11eUVRSqarnODgrQrZPn Y3tUk0SDgioaIBh+vLVKftIjQdvswF5byvo4cZZeO9/OMiihdPu+xpxVs0IHac9vvmvH 0ZRRL8GsTC150wO5ta25jNeJbv8NTNvfmlmdVYqIyc0XSko/AN4m35bzUw2eaACtfusd 9l8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MDXwQE4Kaj0pGVIoymzDI9EpLNmbjuQzI8QncPo8IhU=; b=cEiJuWwTiNWhdm3fbSMSeSkxOkPZyGaH2wPjjE5WBwBHI4AeCxeXBdao3+RwM+b8dc iBWzu8r3bEpO+fnStGSBX/QU+Sj4c7L3ypf9JI+xjk0FdS+xww0IoM3Aq5X1OtKWpnoT gYoL8o3g2XQnhaZyCUnOQMgLa0z1P2sCeyTy1WVanZ3TbC8upCV2s+vY6yDGzZesFRHS FzTojGDAExA8slAGBYV9cua80XxB4fGiS4rlAWAspYJ69qurhQEB75j6fBtHYTs4KIE8 0o5QZIvWFo7fH8j12VJIb5A83/fbOxYkLI/hdyxJxCIPoeMy+1YliBGYaSB9yiOqxulO Tbsg== X-Gm-Message-State: AElRT7HzWe3jz9MGjSiGq9IEyyLHFGyAqZGr/RpJZCHsrMkp5wP2YT6M xQPC5nO9ub14I0ZSfxOXaL8jj2aq2qqiwDYyyqh3Zg== X-Google-Smtp-Source: AG47ELuMLIxIN7gWl+JW/+LvCSrTr/ejweA2ny3/VVcQ7smr5eRwi1mSCLQpd1QcLa9hVvpNVGnq0aofw2Kx8FI9pbo= X-Received: by 10.25.158.149 with SMTP id h143mr4419233lfe.129.1520001617340; Fri, 02 Mar 2018 06:40:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.201.5 with HTTP; Fri, 2 Mar 2018 06:39:46 -0800 (PST) In-Reply-To: <201802232251.w1NMpqn4025101@repo.freebsd.org> References: <201802232251.w1NMpqn4025101@repo.freebsd.org> From: Ed Schouten Date: Fri, 2 Mar 2018 15:39:46 +0100 Message-ID: Subject: Re: svn commit: r329882 - in head/sys: conf kern sys vm To: Jeff Roberson 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.25 Precedence: list List-Id: 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 Mar 2018 14:40:20 -0000 Hi Jeff, 2018-02-23 23:51 GMT+01:00 Jeff Roberson : > Add a generic Proportional Integral Derivative (PID) controller algorithm and > use it to regulate page daemon output. That looks pretty nifty. Looking at the code, it exposes metrics through sysctl. Be sure to give prometheus_sysctl_exporter(8) a try if you ever want to graph the characteristics of the controller! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands From owner-svn-src-head@freebsd.org Fri Mar 2 14:42:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3A9BF2944D; Fri, 2 Mar 2018 14:42:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5FA684321; Fri, 2 Mar 2018 14:42:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8759018D66; Fri, 2 Mar 2018 14:42:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22Eg8wm028600; Fri, 2 Mar 2018 14:42:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22Eg8uK028599; Fri, 2 Mar 2018 14:42:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803021442.w22Eg8uK028599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 2 Mar 2018 14:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330278 - head X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 330278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 14:42:09 -0000 Author: trasz Date: Fri Mar 2 14:42:08 2018 New Revision: 330278 URL: https://svnweb.freebsd.org/changeset/base/330278 Log: Fix README.md formatting. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/README.md Modified: head/README.md ============================================================================== --- head/README.md Fri Mar 2 14:16:19 2018 (r330277) +++ head/README.md Fri Mar 2 14:42:08 2018 (r330278) @@ -36,53 +36,53 @@ devices, not just those commonly used. Source Roadmap: --------------- ``` -bin System/user commands. +bin System/user commands. -cddl Various commands and libraries under the Common Development - and Distribution License. +cddl Various commands and libraries under the Common Development + and Distribution License. -contrib Packages contributed by 3rd parties. +contrib Packages contributed by 3rd parties. -crypto Cryptography stuff (see crypto/README). +crypto Cryptography stuff (see crypto/README). -etc Template files for /etc. +etc Template files for /etc. -gnu Various commands and libraries under the GNU Public License. - Please see gnu/COPYING* for more information. +gnu Various commands and libraries under the GNU Public License. + Please see gnu/COPYING* for more information. -include System include files. +include System include files. -kerberos5 Kerberos5 (Heimdal) package. +kerberos5 Kerberos5 (Heimdal) package. -lib System libraries. +lib System libraries. -libexec System daemons. +libexec System daemons. -release Release building Makefile & associated tools. +release Release building Makefile & associated tools. -rescue Build system for statically linked /rescue utilities. +rescue Build system for statically linked /rescue utilities. -sbin System commands. +sbin System commands. -secure Cryptographic libraries and commands. +secure Cryptographic libraries and commands. -share Shared resources. +share Shared resources. -stand Boot loader sources. +stand Boot loader sources. -sys Kernel sources. +sys Kernel sources. -tests Regression tests which can be run by Kyua. See tests/README - for additional information. +tests Regression tests which can be run by Kyua. See tests/README + for additional information. -tools Utilities for regression testing and miscellaneous tasks. +tools Utilities for regression testing and miscellaneous tasks. -usr.bin User commands. +usr.bin User commands. -usr.sbin System administration commands. +usr.sbin System administration commands. ``` For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see: - https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html + https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html From owner-svn-src-head@freebsd.org Fri Mar 2 15:12:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C415DF2B8CC; Fri, 2 Mar 2018 15:12:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6553A858B6; Fri, 2 Mar 2018 15:12:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4780D19239; Fri, 2 Mar 2018 15:12:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22FCJIM046167; Fri, 2 Mar 2018 15:12:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22FCINn046157; Fri, 2 Mar 2018 15:12:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803021512.w22FCINn046157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Mar 2018 15:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330279 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 330279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 15:12:20 -0000 Author: emaste Date: Fri Mar 2 15:12:18 2018 New Revision: 330279 URL: https://svnweb.freebsd.org/changeset/base/330279 Log: libefivar: use standard 2-Clause FreeBSD license Approved by: imp Sponsored by: The FreeBSD Foundation Modified: head/lib/libefivar/efi-osdep.h head/lib/libefivar/efivar-dp-format.c head/lib/libefivar/efivar-dp-parse.c head/lib/libefivar/efivar-dp-xlate.c head/lib/libefivar/efivar-dp.h head/lib/libefivar/efivar.c head/lib/libefivar/efivar.h head/lib/libefivar/uefi-dplib.h head/lib/libefivar/uefi-dputil.c Modified: head/lib/libefivar/efi-osdep.h ============================================================================== --- head/lib/libefivar/efi-osdep.h Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efi-osdep.h Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: head/lib/libefivar/efivar-dp-format.c ============================================================================== --- head/lib/libefivar/efivar-dp-format.c Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efivar-dp-format.c Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ /* Modified: head/lib/libefivar/efivar-dp-parse.c ============================================================================== --- head/lib/libefivar/efivar-dp-parse.c Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efivar-dp-parse.c Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ /* Modified: head/lib/libefivar/efivar-dp-xlate.c ============================================================================== --- head/lib/libefivar/efivar-dp-xlate.c Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efivar-dp-xlate.c Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include Modified: head/lib/libefivar/efivar-dp.h ============================================================================== --- head/lib/libefivar/efivar-dp.h Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efivar-dp.h Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: head/lib/libefivar/efivar.c ============================================================================== --- head/lib/libefivar/efivar.c Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efivar.c Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include Modified: head/lib/libefivar/efivar.h ============================================================================== --- head/lib/libefivar/efivar.h Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efivar.h Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: head/lib/libefivar/uefi-dplib.h ============================================================================== --- head/lib/libefivar/uefi-dplib.h Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/uefi-dplib.h Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: head/lib/libefivar/uefi-dputil.c ============================================================================== --- head/lib/libefivar/uefi-dputil.c Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/uefi-dputil.c Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * 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. */ /* From owner-svn-src-head@freebsd.org Fri Mar 2 15:28:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75DCEF2CB53; Fri, 2 Mar 2018 15:28:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2476086560; Fri, 2 Mar 2018 15:28:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F4C9193EC; Fri, 2 Mar 2018 15:28:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22FS9WB051458; Fri, 2 Mar 2018 15:28:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22FS8CT051457; Fri, 2 Mar 2018 15:28:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803021528.w22FS8CT051457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 15:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330281 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 15:28:09 -0000 Author: kevans Date: Fri Mar 2 15:28:08 2018 New Revision: 330281 URL: https://svnweb.freebsd.org/changeset/base/330281 Log: lualoader: Steamroll the box-drawing - Add drawer.frame_styles to map out the kinds of characters we need for the different loader_menu_frame values - Respect loader_menu_frame, default to double[*] - (imp) Use loader.printc instead of print- print adds a newline to the output, which is not the right thing we want to be doing. - (imp) Draw horizontal frames a little more efficiently- setting the cursor after every line segment is horribly inefficient, especially on serial consoles. Halve the number of characters written at the expense of an additional loop to draw the bottom frame, which is likely more efficient in the long run for some of less ideal scenarios. [*] menu.4th(8) claims that the default here was single, but unset loader_menu_frame yielded double and we didn't have any overrides in the default loader.conf(5), so double it is. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Mar 2 15:17:42 2018 (r330280) +++ head/stand/lua/drawer.lua Fri Mar 2 15:28:08 2018 (r330281) @@ -256,6 +256,36 @@ drawer.logodefs = { }, } +drawer.frame_styles = { + -- Indexed by valid values for loader_menu_frame in loader.conf(5). + -- All of the keys appearing below must be set for any menu frame style + -- added to drawer.frame_styles. + ["ascii"] = { + horizontal = "-", + vertical = "|", + top_left = "+", + bottom_left = "+", + top_right = "+", + bottom_right = "+", + }, + ["single"] = { + horizontal = "\xC4", + vertical = "\xB3", + top_left = "\xDA", + bottom_left = "\xC0", + top_right = "\xBF", + bottom_right = "\xD9", + }, + ["double"] = { + horizontal = "\xCD", + vertical = "\xBA", + top_left = "\xC9", + bottom_left = "\xC8", + top_right = "\xBB", + bottom_right = "\xBC", + }, +} + function drawer.drawscreen(menu_opts) -- drawlogo() must go first. -- it determines the positions of other elements @@ -306,42 +336,52 @@ function drawer.drawmenu(menudef) return alias_table end - function drawer.drawbox() local x = drawer.box_pos_dim.x local y = drawer.box_pos_dim.y local w = drawer.box_pos_dim.w local h = drawer.box_pos_dim.h - local hl = "\xCD" - local vl = "\xBA" + local framestyle = loader.getenv("loader_menu_frame") or "double" + local framespec = drawer.frame_styles[framestyle] + -- If we don't have a framespec for the current frame style, just don't + -- draw a box. + if framespec == nil then + return + end - local tl = "\xC9" - local bl = "\xC8" - local tr = "\xBB" - local br = "\xBC" + local hl = framespec.horizontal + local vl = framespec.vertical - screen.setcursor(x, y); print(tl) - screen.setcursor(x, y+h); print(bl) - screen.setcursor(x+w, y); print(tr) - screen.setcursor(x+w, y+h); print(br) + local tl = framespec.top_left + local bl = framespec.bottom_left + local tr = framespec.top_right + local br = framespec.bottom_right - for i = 1, w-1 do - screen.setcursor(x+i, y) - print(hl) - screen.setcursor(x+i, y+h) - print(hl) + screen.setcursor(x, y); loader.printc(tl) + screen.setcursor(x, y + h); loader.printc(bl) + screen.setcursor(x + w, y); loader.printc(tr) + screen.setcursor(x + w, y + h); loader.printc(br) + + screen.setcursor(x + 1, y) + for _ = 1, w - 1 do + loader.printc(hl) end - for i = 1, h-1 do - screen.setcursor(x, y+i) - print(vl) - screen.setcursor(x+w, y+i) - print(vl) + screen.setcursor(x + 1, y + h) + for _ = 1, w - 1 do + loader.printc(hl) end - screen.setcursor(x+(w/2)-9, y) - print("Welcome to FreeBSD") + for i = 1, h - 1 do + screen.setcursor(x, y + i) + loader.printc(vl) + screen.setcursor(x + w, y + i) + loader.printc(vl) + end + + screen.setcursor(x + (w / 2) - 9, y) + loader.printc("Welcome to FreeBSD") end function drawer.draw(x, y, logo) From owner-svn-src-head@freebsd.org Fri Mar 2 15:46:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC3A1F2E418; Fri, 2 Mar 2018 15:46:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A93F8775C; Fri, 2 Mar 2018 15:46:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8597A19706; Fri, 2 Mar 2018 15:46:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22FkMbI061570; Fri, 2 Mar 2018 15:46:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22FkMbY061569; Fri, 2 Mar 2018 15:46:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803021546.w22FkMbY061569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 15:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330282 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 330282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 15:46:23 -0000 Author: kevans Date: Fri Mar 2 15:46:22 2018 New Revision: 330282 URL: https://svnweb.freebsd.org/changeset/base/330282 Log: lualoader: Register loader.printc as global printc Modified: head/stand/liblua/lutils.c Modified: head/stand/liblua/lutils.c ============================================================================== --- head/stand/liblua/lutils.c Fri Mar 2 15:28:08 2018 (r330281) +++ head/stand/liblua/lutils.c Fri Mar 2 15:46:22 2018 (r330282) @@ -307,6 +307,7 @@ static const struct luaL_Reg loaderlib[] = { REG_SIMPLE(command), REG_SIMPLE(getenv), REG_SIMPLE(perform), + /* Also registered as the global 'printc' */ REG_SIMPLE(printc), REG_SIMPLE(setenv), REG_SIMPLE(time), @@ -335,6 +336,8 @@ luaopen_loader(lua_State *L) lua_setfield(L, -2, "machine"); lua_pushstring(L, MACHINE_ARCH); lua_setfield(L, -2, "machine_arch"); + /* Set global printc to loader.printc */ + lua_register(L, "printc", lua_printc); return 1; } From owner-svn-src-head@freebsd.org Fri Mar 2 16:06:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2EDEF303AC; Fri, 2 Mar 2018 16:06:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 512A768A1E; Fri, 2 Mar 2018 16:06:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EE0719A38; Fri, 2 Mar 2018 16:06:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22G6KMs071838; Fri, 2 Mar 2018 16:06:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22G6Kji071836; Fri, 2 Mar 2018 16:06:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803021606.w22G6Kji071836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 16:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330283 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 16:06:21 -0000 Author: kevans Date: Fri Mar 2 16:06:20 2018 New Revision: 330283 URL: https://svnweb.freebsd.org/changeset/base/330283 Log: lualoader: Use global printc instead of loader.printc r330282 registered loader.printc as printc, so use it instead. This makes sense for a couple reasons, the major point being that it reads a little bit easier and pairs nicely with the global 'print'. Similar cases can not really be made for other loader.* functions as most of them are either highly specific to our use-case or usually available in other modules, such as `os`. printc does not have a standard implementation in the Lua world(*), so we have a little more leeway with it, and it's kind of a special case of the globally available 'print'. (*) I've been in the Lua world for all of two weeks, so this could be wrong. Modified: head/stand/lua/drawer.lua head/stand/lua/password.lua head/stand/lua/screen.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Fri Mar 2 15:46:22 2018 (r330282) +++ head/stand/lua/drawer.lua Fri Mar 2 16:06:20 2018 (r330283) @@ -358,30 +358,30 @@ function drawer.drawbox() local tr = framespec.top_right local br = framespec.bottom_right - screen.setcursor(x, y); loader.printc(tl) - screen.setcursor(x, y + h); loader.printc(bl) - screen.setcursor(x + w, y); loader.printc(tr) - screen.setcursor(x + w, y + h); loader.printc(br) + screen.setcursor(x, y); printc(tl) + screen.setcursor(x, y + h); printc(bl) + screen.setcursor(x + w, y); printc(tr) + screen.setcursor(x + w, y + h); printc(br) screen.setcursor(x + 1, y) for _ = 1, w - 1 do - loader.printc(hl) + printc(hl) end screen.setcursor(x + 1, y + h) for _ = 1, w - 1 do - loader.printc(hl) + printc(hl) end for i = 1, h - 1 do screen.setcursor(x, y + i) - loader.printc(vl) + printc(vl) screen.setcursor(x + w, y + i) - loader.printc(vl) + printc(vl) end screen.setcursor(x + (w / 2) - 9, y) - loader.printc("Welcome to FreeBSD") + printc("Welcome to FreeBSD") end function drawer.draw(x, y, logo) Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Fri Mar 2 15:46:22 2018 (r330282) +++ head/stand/lua/password.lua Fri Mar 2 16:06:20 2018 (r330283) @@ -45,14 +45,14 @@ function password.read(prompt_length) local twiddle_pos = 1 local function draw_twiddle() - loader.printc(" " .. twiddle_chars[twiddle_pos]) + printc(" " .. twiddle_chars[twiddle_pos]) -- Reset cursor to just after the password prompt screen.setcursor(prompt_length + 2, screen.default_y) twiddle_pos = (twiddle_pos % #twiddle_chars) + 1 end -- Space between the prompt and any on-screen feedback - loader.printc(" ") + printc(" ") while true do local ch = io.getchar() if ch == core.KEY_ENTER then @@ -61,7 +61,7 @@ function password.read(prompt_length) if ch == core.KEY_BACKSPACE or ch == core.KEY_DELETE then if #str > 0 then if show_password_mask then - loader.printc("\008 \008") + printc("\008 \008") else draw_twiddle() end @@ -69,7 +69,7 @@ function password.read(prompt_length) end else if show_password_mask then - loader.printc("*") + printc("*") else draw_twiddle() end @@ -87,23 +87,23 @@ function password.check() local attempts = 1 local function clear_incorrect_text_prompt() - loader.printc("\n") - loader.printc(string.rep(" ", #INCORRECT_PASSWORD)) + printc("\n") + printc(string.rep(" ", #INCORRECT_PASSWORD)) end while true do screen.defcursor() - loader.printc(prompt) + printc(prompt) local read_pwd = password.read(#prompt) if pwd == nil or pwd == read_pwd then -- Clear the prompt + twiddle - loader.printc(string.rep(" ", #prompt + 5)) + printc(string.rep(" ", #prompt + 5)) if attempts > 1 then clear_incorrect_text_prompt() end return read_pwd end - loader.printc("\n" .. INCORRECT_PASSWORD) + printc("\n" .. INCORRECT_PASSWORD) attempts = attempts + 1 loader.delay(3*1000*1000) end Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Fri Mar 2 15:46:22 2018 (r330282) +++ head/stand/lua/screen.lua Fri Mar 2 16:06:20 2018 (r330283) @@ -41,7 +41,7 @@ function screen.clear() if core.isSerialBoot() then return end - loader.printc(core.KEYSTR_CSI .. "H" .. core.KEYSTR_CSI .. "J") + printc(core.KEYSTR_CSI .. "H" .. core.KEYSTR_CSI .. "J") end function screen.setcursor(x, y) @@ -49,25 +49,25 @@ function screen.setcursor(x, y) return end - loader.printc(core.KEYSTR_CSI .. y .. ";" .. x .. "H") + printc(core.KEYSTR_CSI .. y .. ";" .. x .. "H") end function screen.setforeground(color_value) if color.disabled then return color_value end - loader.printc(color.escapef(color_value)) + printc(color.escapef(color_value)) end function screen.setbackground(color_value) if color.disabled then return color_value end - loader.printc(color.escapeb(color_value)) + printc(color.escapeb(color_value)) end function screen.defcolor() - loader.printc(color.default()) + printc(color.default()) end function screen.defcursor() From owner-svn-src-head@freebsd.org Fri Mar 2 16:31:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B111F321FC; Fri, 2 Mar 2018 16:31:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF3EF6A0CF; Fri, 2 Mar 2018 16:31:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA1F619E9E; Fri, 2 Mar 2018 16:31:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22GVNc4083118; Fri, 2 Mar 2018 16:31:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22GVN0x083117; Fri, 2 Mar 2018 16:31:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803021631.w22GVN0x083117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 16:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330284 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 330284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 16:31:24 -0000 Author: kevans Date: Fri Mar 2 16:31:23 2018 New Revision: 330284 URL: https://svnweb.freebsd.org/changeset/base/330284 Log: liblua: Use putc instead of printf for printc printc does not need the features or the overhead of printf. It does not take formatting strings, and it pipes the single string argument through an "%s" format. Instead, use putc directly. This pipes the string through in its entirety as a series of 'unsigned char's, generally straight to the console emulator. Discussed with: tsoome Modified: head/stand/liblua/lutils.c Modified: head/stand/liblua/lutils.c ============================================================================== --- head/stand/liblua/lutils.c Fri Mar 2 16:06:20 2018 (r330283) +++ head/stand/liblua/lutils.c Fri Mar 2 16:31:23 2018 (r330284) @@ -153,13 +153,13 @@ lua_unsetenv(lua_State *L) static int lua_printc(lua_State *L) { - int status; - ssize_t l; + ssize_t cur, l; const char *s = luaL_checklstring(L, 1, &l); - status = (printf("%s", s) == l); + for (cur = 0; cur < l; ++cur) + putchar((unsigned char)*(s++)); - return status; + return 1; } static int From owner-svn-src-head@freebsd.org Fri Mar 2 16:47:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2662F33390; Fri, 2 Mar 2018 16:47:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 818AE6AF4B; Fri, 2 Mar 2018 16:47:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77D391A090; Fri, 2 Mar 2018 16:47:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22Gl2Mx092317; Fri, 2 Mar 2018 16:47:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22Gl2t7092316; Fri, 2 Mar 2018 16:47:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803021647.w22Gl2t7092316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 2 Mar 2018 16:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330285 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 330285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 16:47:03 -0000 Author: kib Date: Fri Mar 2 16:47:02 2018 New Revision: 330285 URL: https://svnweb.freebsd.org/changeset/base/330285 Log: Remove _Nonnull attributes from user addresses arguments for copyout(9) family. The addresses are user-controllable, and if the process ABI allows mapping at zero, then the zero address is meaningful, contradicting the definition of _Nonnull. In any case, it does not require any special code to handle NULL udaddr. It is not clear if __restrict makes sense as well, since kaddr and udaddr point to different address spaces, so equal numeric values of the pointers do not imply aliasing and a legitimate. But leave it for later. copyinstr(9) does not have its user address argument annotated. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Mar 2 16:31:23 2018 (r330284) +++ head/sys/sys/systm.h Fri Mar 2 16:47:02 2018 (r330285) @@ -277,14 +277,14 @@ int copystr(const void * _Nonnull __restrict kfaddr, int copyinstr(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len, size_t * __restrict lencopied); -int copyin(const void * _Nonnull __restrict udaddr, +int copyin(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len); -int copyin_nofault(const void * _Nonnull __restrict udaddr, +int copyin_nofault(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len); int copyout(const void * _Nonnull __restrict kaddr, - void * _Nonnull __restrict udaddr, size_t len); + void * __restrict udaddr, size_t len); int copyout_nofault(const void * _Nonnull __restrict kaddr, - void * _Nonnull __restrict udaddr, size_t len); + void * __restrict udaddr, size_t len); int fubyte(volatile const void *base); long fuword(volatile const void *base); From owner-svn-src-head@freebsd.org Fri Mar 2 16:47:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACEC4F333DB for ; Fri, 2 Mar 2018 16:47:14 +0000 (UTC) (envelope-from byond.lenox@gmail.com) 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 092B06B040 for ; Fri, 2 Mar 2018 16:47:14 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f54.google.com with SMTP id m69so14219282lfe.8 for ; Fri, 02 Mar 2018 08:47:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=tE5BMzzolCPFWRDUxQIjhGytjdkyXnt4sMGkhe39KbQ=; b=ZV35Uas35s7uyYZac9P6sxTZF4WPeJOuQH+tc/f8Of/HF/fjaZhTM287NCBZR+SNE1 Dx1oSzXYAxJc3MqRXo8soQQd0/XWFNUQxSWSd0whYTpNiRvC0ic/oPwtZGaClFwHKdRK Iisg28jnymcq5iLTansMHh38naLieIL8XT/ZmWkprAUSaelerVtaOl9st9yr0I7bS6YQ kDTbF/dlH3OPSN2VM+ssOGczHN6pkBKRnPRbwQUjQZ5TicuGKuXTsumIkphoofmbOIz+ Vg4o9DGQmQ/tvm8S32r/FraPjGSYjJ3azLAKKrf3GTTyuHEMxiyawfHTZIt8wC4b0IGW mCzw== X-Gm-Message-State: AElRT7EPKiR2JJ22HYX0Sm7dXzveBddzSryv166OWGlSpoT4jXxX88ly jWwRPVF+ZjnWhfLtkKZRAL9FkPXo X-Google-Smtp-Source: AG47ELtlOZu5X3ezyO2E8p4nfXn5gtxxc33vbDE1G/L243FhCsAYCSJtkWozf018D8PWgOyhflPmsw== X-Received: by 10.46.93.148 with SMTP id v20mr4204639lje.34.1520009231362; Fri, 02 Mar 2018 08:47:11 -0800 (PST) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com. [209.85.215.53]) by smtp.gmail.com with ESMTPSA id 77sm1384784ljz.67.2018.03.02.08.47.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Mar 2018 08:47:11 -0800 (PST) Received: by mail-lf0-f53.google.com with SMTP id v9so14142230lfa.11 for ; Fri, 02 Mar 2018 08:47:11 -0800 (PST) X-Received: by 10.46.114.26 with SMTP id n26mt5151018ljc.74.1520009231020; Fri, 02 Mar 2018 08:47:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.54.1 with HTTP; Fri, 2 Mar 2018 08:46:50 -0800 (PST) In-Reply-To: <201803021631.w22GVN0x083117@repo.freebsd.org> References: <201803021631.w22GVN0x083117@repo.freebsd.org> From: Kyle Evans Date: Fri, 2 Mar 2018 10:46:50 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330284 - head/stand/liblua 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.25 Precedence: list List-Id: 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 Mar 2018 16:47:14 -0000 On Fri, Mar 2, 2018 at 10:31 AM, Kyle Evans wrote: > Author: kevans > Date: Fri Mar 2 16:31:23 2018 > New Revision: 330284 > URL: https://svnweb.freebsd.org/changeset/base/330284 > > Log: > liblua: Use putc instead of printf for printc > > printc does not need the features or the overhead of printf. It does not > take formatting strings, and it pipes the single string argument through an > "%s" format. > > Instead, use putc directly. This pipes the string through in its entirety as > a series of 'unsigned char's, generally straight to the console emulator. > > Discussed with: tsoome > FYI- This has been confirmed to fix a problem recently reported to -current by garga@ where the frames around the menu wouldn't draw properly on an EFI boot. From owner-svn-src-head@freebsd.org Fri Mar 2 16:51:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 095AFF33900; Fri, 2 Mar 2018 16:51:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0BA66B42B; Fri, 2 Mar 2018 16:51:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB8821A0FF; Fri, 2 Mar 2018 16:51:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22GphSn094259; Fri, 2 Mar 2018 16:51:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22Gph3f094258; Fri, 2 Mar 2018 16:51:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803021651.w22Gph3f094258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 16:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330286 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 330286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 16:51:44 -0000 Author: kevans Date: Fri Mar 2 16:51:43 2018 New Revision: 330286 URL: https://svnweb.freebsd.org/changeset/base/330286 Log: Add --globals printc to lua-lint We provide a global 'printc' as of r330282; make luacheck aware of this fact so that we can use it without complaints. Modified: head/tools/boot/lua-lint.sh Modified: head/tools/boot/lua-lint.sh ============================================================================== --- head/tools/boot/lua-lint.sh Fri Mar 2 16:47:02 2018 (r330285) +++ head/tools/boot/lua-lint.sh Fri Mar 2 16:51:43 2018 (r330286) @@ -16,4 +16,4 @@ LUACHECK=$(which luacheck) cd $(make -V SRCTOP)/stand ${LUACHECK} . --globals loader --globals lfs --globals io.getchar \ - --globals io.ischar --globals cli_execute --std lua53 + --globals io.ischar --globals printc --globals cli_execute --std lua53 From owner-svn-src-head@freebsd.org Fri Mar 2 17:07:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02BE2F350B9; Fri, 2 Mar 2018 17:07:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAE226C2AD; Fri, 2 Mar 2018 17:07:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5E451A3D7; Fri, 2 Mar 2018 17:07:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22H78Zl002542; Fri, 2 Mar 2018 17:07:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22H78eA002541; Fri, 2 Mar 2018 17:07:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803021707.w22H78eA002541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Mar 2018 17:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330287 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 17:07:09 -0000 Author: kevans Date: Fri Mar 2 17:07:08 2018 New Revision: 330287 URL: https://svnweb.freebsd.org/changeset/base/330287 Log: lualoader: Reset the cursor position after the menu is drawn Rather than before the menu is drawn. The drawer is going to reset the crusor position as soon as it draws anything anyways, so doing it before serves no purpose. Setting it after is needed so we don't clobber the menu when we start booting. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Mar 2 16:51:43 2018 (r330286) +++ head/stand/lua/menu.lua Fri Mar 2 17:07:08 2018 (r330287) @@ -346,9 +346,9 @@ menu.current_alias_table = {} function menu.draw(menudef) -- Clear the screen, reset the cursor, then draw screen.clear() - screen.defcursor() menu.current_alias_table = drawer.drawscreen(menudef) drawn_menu = menudef + screen.defcursor() end -- 'keypress' allows the caller to indicate that a key has been pressed that we From owner-svn-src-head@freebsd.org Fri Mar 2 17:53:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B2F4F38858 for ; Fri, 2 Mar 2018 17:53:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic311-36.consmr.mail.gq1.yahoo.com (sonic311-36.consmr.mail.gq1.yahoo.com [98.137.65.217]) (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 11FD96E7EF for ; Fri, 2 Mar 2018 17:53:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1520013233; bh=nJhAFKbKO43Se73CDWzYG+bhYfEAfRgZZhUqQj747eg=; h=Subject:To:References:From:Cc:Date:In-Reply-To:From:Subject; b=SxGfQ5LewGs2AmIG7OH5zKVAV1DM3HI4pzYoCAtAWJAVcZtm1Q4feteNlahmKN5786x0n3YlnvP+0ew8I0YQVtRlxpSse7jJloUk6yUoW+GtVdAb0C87qLVXy9jTo/p2ZPhflYb+iXxYppgV64Q1NB30VTJquwcYi1fPz7F3zFs78BxLpQdFS4cVMauoZtNdTU7is3BiofldIJsuxuQiEbxW+8RpYoVjbVeJbaPYZUSLqSXfjrNiTZHj4v3fYNDttFkcvI6iSpnJPpc80cnY+omWo/ThtDC+E8NRtApjktY3jMiMdyq/p9EUPYZVZXsY3mKNN4vNteeunCqGjvtS+Q== X-YMail-OSG: ZbVgzWwVM1lrzfcoQh9uN3_D8pwzcisEmyhd.pJfUjo1OAbPXGlUEs3gTkcFnMz b9.NhZU8wBzXcrgOGxMkxPdnKG_kPCk7SNtcda2BXBcI6yG5EbfaEWQqn8_JIMlZp__Pc1SqRJCS fbrX_Q7e56y.TFA6YfPVDGU99vZ5L2Vjl2NsLvuutAufur_awlAIS4optFgdFOV.VEyVMSYtzOC4 xS65MxKmZVb_IVzhtn.9.F6Cxf0Ip1pCdhp3fFuXUnC90CHhbejllDOzVqC7Rv1Pfq38vylGvNFr CEOHOTk1MjQZvMlZ8p8tfqoQlLHu3BM7RNi6L0v4QM8mbbbohorCWaXzYO7koWo0DRnUP7g7ZqH9 tr9t_biwbXsBoeS4bG_fEUP5tlFei3Wcwairiwd.ilrRXDxM39IElRmqld0CVLGcTS8cB9rG4ZEs 7EwetwJRSw9N3.PEtAxDzRxGrgzC2FA3zBAbPQZp8O_GK_aklU_S6JgWseSWyzuBME_6N59rw6Ot Fx2bnSa3cP8Y- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.gq1.yahoo.com with HTTP; Fri, 2 Mar 2018 17:53:53 +0000 Received: from smtp109.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.5]) ([10.211.35.160]) by smtp407.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 4fcceec02d620a9008a8fe216a3ce7c5; Fri, 02 Mar 2018 17:43:42 +0000 (UTC) Subject: Re: svn commit: r330285 - head/sys/sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803021647.w22Gl2t7092316@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Cc: Eitan Adler Message-ID: Date: Fri, 2 Mar 2018 12:43:34 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803021647.w22Gl2t7092316@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 17:53:56 -0000 (cc in Eitan as he may be interested in the extra restrict cases) On 02/03/2018 11:47, Konstantin Belousov wrote: > Author: kib > Date: Fri Mar 2 16:47:02 2018 > New Revision: 330285 > URL: https://svnweb.freebsd.org/changeset/base/330285 > > Log: > Remove _Nonnull attributes from user addresses arguments for > copyout(9) family. > > The addresses are user-controllable, and if the process ABI allows > mapping at zero, then the zero address is meaningful, contradicting > the definition of _Nonnull. In any case, it does not require any > special code to handle NULL udaddr. > FWIW, the _Nonnull attributes didn't do much at all beyond producing a warning. They replaced the GNU __nonnull() attributes which were much more dangerous. I am OK with seeing both gone here though. > It is not clear if __restrict makes sense as well, since kaddr and > udaddr point to different address spaces, so equal numeric values of > the pointers do not imply aliasing and a legitimate. But leave it for > later. > > copyinstr(9) does not have its user address argument annotated. I think use of _Nonnull attributes in the threading functions may also be a waste (I introduced them mostly to be compatible with Android). FWIW, Dragonfly sprinkled some restrict there recently: http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 Just in case someone is considering more cleanups. Cheers, Pedro. > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/sys/sys/systm.h > > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Fri Mar 2 16:31:23 2018 (r330284) > +++ head/sys/sys/systm.h Fri Mar 2 16:47:02 2018 (r330285) > @@ -277,14 +277,14 @@ int copystr(const void * _Nonnull __restrict kfaddr, > int copyinstr(const void * __restrict udaddr, > void * _Nonnull __restrict kaddr, size_t len, > size_t * __restrict lencopied); > -int copyin(const void * _Nonnull __restrict udaddr, > +int copyin(const void * __restrict udaddr, > void * _Nonnull __restrict kaddr, size_t len); > -int copyin_nofault(const void * _Nonnull __restrict udaddr, > +int copyin_nofault(const void * __restrict udaddr, > void * _Nonnull __restrict kaddr, size_t len); > int copyout(const void * _Nonnull __restrict kaddr, > - void * _Nonnull __restrict udaddr, size_t len); > + void * __restrict udaddr, size_t len); > int copyout_nofault(const void * _Nonnull __restrict kaddr, > - void * _Nonnull __restrict udaddr, size_t len); > + void * __restrict udaddr, size_t len); > > int fubyte(volatile const void *base); > long fuword(volatile const void *base); > From owner-svn-src-head@freebsd.org Fri Mar 2 17:59:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 309EAF38E0A; Fri, 2 Mar 2018 17:59:21 +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 C59A96EAE6; Fri, 2 Mar 2018 17:59:20 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id C206F5A9F12; Fri, 2 Mar 2018 17:59:13 +0000 (UTC) Date: Fri, 2 Mar 2018 17:59:13 +0000 From: Brooks Davis To: Pedro Giffuni Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Eitan Adler Subject: Re: svn commit: r330285 - head/sys/sys Message-ID: <20180302175913.GA68675@spindle.one-eyed-alien.net> References: <201803021647.w22Gl2t7092316@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 17:59:21 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: > (cc in Eitan as he may be interested in the extra restrict cases) >=20 >=20 > On 02/03/2018 11:47, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Mar 2 16:47:02 2018 > > New Revision: 330285 > > URL: https://svnweb.freebsd.org/changeset/base/330285 > > > > Log: > > Remove _Nonnull attributes from user addresses arguments for > > copyout(9) family. > > =20 > > The addresses are user-controllable, and if the process ABI allows > > mapping at zero, then the zero address is meaningful, contradicting > > the definition of _Nonnull. In any case, it does not require any > > special code to handle NULL udaddr. > > =20 >=20 > FWIW, the _Nonnull attributes didn't do much at all beyond producing a=20 > warning. > They replaced the GNU __nonnull() attributes which were much more dangero= us. > I am OK with seeing both gone here though. Even if the process ABI doesn't allow mapping at NULL, we have code that depends on copyout(NULL, foo, 0) being a nop. -- Brooks --GvXjxJ+pjyke8COw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJamZDvAAoJEKzQXbSebgfAz5kH/i1J5S2FD3/bEfJT3xi0U/Bj gPhljBfLEXVK6ktlzX2p1aHZMYgStoygfbCkwpRIAnkNg+/kJH3DgdvyWy7qCgul kgeC62p63PXIps6OdLdQymu5RyYzLSPLQumPcyKD5RmjJAO7Np23IG7i3Cczvwi+ t/V/r4bHluy+e2HhyWQqSqTTFY1DQqpj4rY5KvTFmaGQl6M2kv/ZpslQ1C4U4Irc 9L/+PsiANl63iqFUQu7iEmV9C7SphGv0M08Os5wDm21SGqecIRTJLqsZOKGuPoDb BOFw5uJW1tV3BZ8LPbCS7nO3hvD8xdI8y+xaMrZA0puwRb2LnyVPS++vGBpSogU= =0QFb -----END PGP SIGNATURE----- --GvXjxJ+pjyke8COw-- From owner-svn-src-head@freebsd.org Fri Mar 2 18:19:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E31ACF3A706; Fri, 2 Mar 2018 18:19:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6223E6FCBE; Fri, 2 Mar 2018 18:19:47 +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 w22IJYCt036866 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 2 Mar 2018 20:19:37 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w22IJYCt036866 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w22IJYnX036865; Fri, 2 Mar 2018 20:19:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Mar 2018 20:19:34 +0200 From: Konstantin Belousov To: Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Eitan Adler Subject: Re: svn commit: r330285 - head/sys/sys Message-ID: <20180302181934.GF3194@kib.kiev.ua> References: <201803021647.w22Gl2t7092316@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: 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 Mar 2018 18:19:48 -0000 On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: > (cc in Eitan as he may be interested in the extra restrict cases) > > > On 02/03/2018 11:47, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Mar 2 16:47:02 2018 > > New Revision: 330285 > > URL: https://svnweb.freebsd.org/changeset/base/330285 > > > > Log: > > Remove _Nonnull attributes from user addresses arguments for > > copyout(9) family. > > > > The addresses are user-controllable, and if the process ABI allows > > mapping at zero, then the zero address is meaningful, contradicting > > the definition of _Nonnull. In any case, it does not require any > > special code to handle NULL udaddr. > > > > FWIW, the _Nonnull attributes didn't do much at all beyond producing a > warning. > They replaced the GNU __nonnull() attributes which were much more dangerous. > I am OK with seeing both gone here though. > > > It is not clear if __restrict makes sense as well, since kaddr and > > udaddr point to different address spaces, so equal numeric values of > > the pointers do not imply aliasing and a legitimate. But leave it for > > later. > > > > copyinstr(9) does not have its user address argument annotated. > > I think use of _Nonnull attributes in the threading functions may also > be a waste (I introduced them mostly to be compatible with Android). > FWIW, Dragonfly sprinkled some restrict there recently: > > http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 > > Just in case someone is considering more cleanups. This is not a cleanup for me, but a needed change. Right now x86 copyouts are implemented in asm, so whatever damage is done to the prototypes, only effect is at the caller side. In my work, i386 copyouts are done in C, so it starts matter. Also I looked at the dragonfly commit because I become curious what do you mean by threading functions. The first example was int pthread_attr_getguardsize(const pthread_attr_t * __restrict, - size_t *); + size_t * __restrict); POSIX agrees with the dragonfly change, but I do not understand it. Aliasing rules already disallow the first and second arguments to point to the same memory, because they have different types. From owner-svn-src-head@freebsd.org Fri Mar 2 18:48:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C62DEF3C9F1; Fri, 2 Mar 2018 18:48:07 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BEDA7149D; Fri, 2 Mar 2018 18:48:07 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 769BC1B42A; Fri, 2 Mar 2018 18:48:07 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22Im7KV052827; Fri, 2 Mar 2018 18:48:07 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22Im7Fl052826; Fri, 2 Mar 2018 18:48:07 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201803021848.w22Im7Fl052826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 2 Mar 2018 18:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330289 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 330289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:48:07 -0000 Author: shurd Date: Fri Mar 2 18:48:07 2018 New Revision: 330289 URL: https://svnweb.freebsd.org/changeset/base/330289 Log: iflib: stop timer callout when stopping iflib_timer has been seen running after the interface had been removed. This change prevents that. Submitted by: matt.macy@joyent.com Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri Mar 2 18:12:25 2018 (r330288) +++ head/sys/net/iflib.c Fri Mar 2 18:48:07 2018 (r330289) @@ -2267,6 +2267,10 @@ iflib_stop(if_ctx_t ctx) for (i = 0; i < scctx->isc_ntxqsets; i++, txq++) { /* make sure all transmitters have completed before proceeding XXX */ + CALLOUT_LOCK(txq); + callout_stop(&txq->ift_timer); + CALLOUT_UNLOCK(txq); + /* clean any enqueued buffers */ iflib_ifmp_purge(txq); /* Free any existing tx buffers. */ From owner-svn-src-head@freebsd.org Fri Mar 2 18:57:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5401BF3D6E2; Fri, 2 Mar 2018 18:57:01 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA2E872ACC; Fri, 2 Mar 2018 18:57:00 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA94B1B5CF; Fri, 2 Mar 2018 18:57:00 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22Iv0ta059640; Fri, 2 Mar 2018 18:57:00 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22Iv0Kf059639; Fri, 2 Mar 2018 18:57:00 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201803021857.w22Iv0Kf059639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 2 Mar 2018 18:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330290 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: wblock X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 330290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:57:01 -0000 Author: wblock (doc committer) Date: Fri Mar 2 18:57:00 2018 New Revision: 330290 URL: https://svnweb.freebsd.org/changeset/base/330290 Log: Clarity and style fixes. Sponsored by: iXsystems Modified: head/share/man/man4/dtrace_lockstat.4 Modified: head/share/man/man4/dtrace_lockstat.4 ============================================================================== --- head/share/man/man4/dtrace_lockstat.4 Fri Mar 2 18:48:07 2018 (r330289) +++ head/share/man/man4/dtrace_lockstat.4 Fri Mar 2 18:57:00 2018 (r330290) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2017 +.Dd March 2, 2018 .Dt DTRACE_LOCKSTAT 4 .Os .Sh NAME @@ -58,19 +58,19 @@ provider allows the tracing of events related to locki .Fx . .Pp The -.Nm lockstat -provider contains DTrace probes for inspecting the kernel's lock +.Nm +provider contains DTrace probes for inspecting kernel lock state transitions. Probes exist for the .Xr mutex 9 , -.Xr rwlock 9 +.Xr rwlock 9 , and .Xr sx 9 lock types. The .Xr lockstat 1 utility can be used to collect and display data collected from the -.Nm lockstat +.Nm provider. Each type of lock has .Fn acquire @@ -125,7 +125,7 @@ and probes fire when a .Dv MTX_SPIN .Xr mutex 9 -is acquired and released, respectively. +is acquired or released, respectively. The only argument is a pointer to the lock structure which describes the lock being acquired or released. .Pp @@ -151,7 +151,7 @@ and .Fn lockstat:::rw-release probes fire when a .Xr rwlock 9 -is acquired and released, respectively. +is acquired or released, respectively. The first argument is a pointer to the structure which describes the lock being acquired. The second argument is @@ -210,7 +210,7 @@ and .Fn lockstat:::sx-release probes fire when a .Xr sx 9 -is acquired and released, respectively. +is acquired or released, respectively. The first argument is a pointer to the structure which describes the lock being acquired. The second argument is @@ -281,14 +281,14 @@ in nanoseconds, that the thread was spinning. .Xr sx 9 .Sh HISTORY The -.Nm lockstat +.Nm provider first appeared in Solaris. The .Fx implementation of the -.Nm lockstat +.Nm provider first appeared in -.Fx 9. +.Fx 9 . .Sh AUTHORS This manual page was written by .An George V. Neville-Neil Aq Mt gnn@FreeBSD.org . From owner-svn-src-head@freebsd.org Fri Mar 2 19:07:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55DA9F3E3BC; Fri, 2 Mar 2018 19:07:33 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1E7733AA; Fri, 2 Mar 2018 19:07:33 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 056791B774; Fri, 2 Mar 2018 19:07:33 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22J7Wjf064832; Fri, 2 Mar 2018 19:07:32 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22J7WgH064831; Fri, 2 Mar 2018 19:07:32 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201803021907.w22J7WgH064831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 2 Mar 2018 19:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330291 - head/sbin/geom/class/part X-SVN-Group: head X-SVN-Commit-Author: wblock X-SVN-Commit-Paths: head/sbin/geom/class/part X-SVN-Commit-Revision: 330291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 19:07:33 -0000 Author: wblock (doc committer) Date: Fri Mar 2 19:07:32 2018 New Revision: 330291 URL: https://svnweb.freebsd.org/changeset/base/330291 Log: Clarify and clean up some language, and add an explicit example. Sponsored by: iXsystems Differential Revision: https://reviews.freebsd.org/D12336 Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Fri Mar 2 18:57:00 2018 (r330290) +++ head/sbin/geom/class/part/gpart.8 Fri Mar 2 19:07:32 2018 (r330291) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 10, 2018 +.Dd March 2, 2018 .Dt GPART 8 .Os .Sh NAME @@ -1327,16 +1327,16 @@ After creating all required partitions, embed bootstra .Bd -literal -offset indent /sbin/gpart bootcode -p /boot/boot1 da0 .Ed -.Ss Deleting partitions and partitioning scheme -If you get a +.Ss Deleting Partitions and Destroying the Partitioning Scheme +If a .Em "Device busy" -error when trying to destroy a partition table, remember that you must -delete all its partitions first with the +error is shown when trying to destroy a partition table, remember that +all of the partitions must be deleted first with the .Cm delete action. -In this example, assume we have +In this example, .Pa da0 -with three partitions: +has three partitions: .Bd -literal -offset indent /sbin/gpart delete -i 3 da0 /sbin/gpart delete -i 2 da0 @@ -1344,11 +1344,15 @@ with three partitions: /sbin/gpart destroy da0 .Ed .Pp -Alternatively, you can invoke the -.Cm destroy -action with the +Rather than deleting each partition and then destroying the partitioning +scheme, the .Fl F -flag. +option can be given with +.Cm destroy +to delete all of the partitions before destroying the partitioning scheme. +This is equivalent to the previous example: +.Bd -literal -offset indent +/sbin/gpart destroy -F da0 .Ed .Ss Backup and Restore .Pp From owner-svn-src-head@freebsd.org Fri Mar 2 19:50:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7A75F40DC0; Fri, 2 Mar 2018 19:50:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6740274D72; Fri, 2 Mar 2018 19:50:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61FAA1BDE0; Fri, 2 Mar 2018 19:50:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22Jog2i086163; Fri, 2 Mar 2018 19:50:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22JogH7086161; Fri, 2 Mar 2018 19:50:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201803021950.w22JogH7086161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 2 Mar 2018 19:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330292 - head/sys/dev/ispfw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ispfw X-SVN-Commit-Revision: 330292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 19:50:43 -0000 Author: mav Date: Fri Mar 2 19:50:41 2018 New Revision: 330292 URL: https://svnweb.freebsd.org/changeset/base/330292 Log: Update QLogic ISP 24xx/25xx chips firmware to 8.07.00. MFC after: 1 month Modified: head/sys/dev/ispfw/asm_2400.h head/sys/dev/ispfw/asm_2500.h Modified: head/sys/dev/ispfw/asm_2400.h ============================================================================== --- head/sys/dev/ispfw/asm_2400.h Fri Mar 2 19:07:32 2018 (r330291) +++ head/sys/dev/ispfw/asm_2400.h Fri Mar 2 19:50:41 2018 (r330292) @@ -27,23 +27,23 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * Firmware Version 7.03.00 (Apr 14, 2014) + * Firmware Version 8.07.00 (2017) */ #ifdef ISP_2400 static const uint32_t isp_2400_risc_code[] = { - 0x0401f195, 0x00112000, 0x00100000, 0x0000c798, - 0x00000007, 0x00000003, 0x00000000, 0x00009496, + 0x0401f1be, 0x00112000, 0x00100000, 0x0000c79b, + 0x00000008, 0x00000007, 0x00000000, 0x00009496, 0x00000003, 0x00000000, 0x20434f50, 0x59524947, - 0x48542032, 0x30303720, 0x514c4f47, 0x49432043, + 0x48542032, 0x30313720, 0x514c4f47, 0x49432043, 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, 0x32347878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x2020372e, 0x30332e30, + 0x56657273, 0x696f6e20, 0x2020382e, 0x30372e30, 0x30202024, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x42001800, 0x0010014c, 0x42002000, 0x0010e36f, + 0x42001800, 0x0010014c, 0x42002000, 0x0010e377, 0x500c0800, 0x800c1800, 0x500c1000, 0x800c1800, 0x54042000, 0x80102000, 0x80040800, 0x80081040, 0x040207fc, 0x500c0800, 0x800409c0, 0x040207f6, @@ -126,759 +126,771 @@ static const uint32_t isp_2400_risc_code[] = { 0x00006150, 0x00000010, 0x00006170, 0x00000010, 0x00006190, 0x00000010, 0x000061b0, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00100000, 0x00100000, 0x0000c798, - 0xffffffff, 0x00112004, 0x00020000, 0x00000c50, - 0xffffffff, 0x00112c54, 0x0010fd00, 0x00001b58, - 0xffffffff, 0x001147ac, 0x0000c000, 0x000008b1, - 0x00ffffff, 0x0011505d, 0x00008000, 0x00000696, + 0x00000000, 0x00100000, 0x00100000, 0x0000c79b, + 0xffffffff, 0x00112004, 0x00020000, 0x00001083, + 0xffffffff, 0x00113087, 0x0010fd00, 0x00001b72, + 0xffffffff, 0x00114bf9, 0x0000c000, 0x000008e2, + 0x00ffffff, 0x001154db, 0x00008000, 0x0000069e, 0x00ffffff, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x4203f000, 0x00021fff, 0x40000000, - 0x4203e000, 0x90000100, 0x40000000, 0x42000800, - 0x00020c51, 0x4202f000, 0x00000000, 0x42000000, - 0x00007023, 0x50000000, 0x8c000500, 0x04020003, - 0x42000800, 0x00020000, 0x45780800, 0x80040800, - 0x82040580, 0x00022000, 0x040207fc, 0x4178a000, - 0x4200a800, 0x0010c798, 0x42000800, 0x0010fd00, - 0x40540000, 0x8004b480, 0x0201f800, 0x0010c5e6, - 0x0401fade, 0x0401fa0a, 0x4803c856, 0x42000000, - 0x00001000, 0x50000000, 0x82000480, 0x24320002, - 0x0402000d, 0x0201f800, 0x0010c62d, 0x04000008, - 0x42000800, 0x00007a17, 0x50040000, 0x8c00050e, - 0x04020003, 0x8400054e, 0x44000800, 0x4a030000, - 0x00000000, 0x4a03c020, 0x00000004, 0x4203e000, - 0x6000000f, 0x4a0370e8, 0x00000003, 0x4a0378e8, - 0x00000003, 0x59e00023, 0x8c000500, 0x04020027, - 0x42002800, 0x0010017d, 0x58140800, 0x4817c857, - 0x4807c857, 0x800409c0, 0x0400000b, 0x58142002, - 0x4813c857, 0x58141003, 0x4c140000, 0x0401faaa, - 0x5c002800, 0x0402002a, 0x82142c00, 0x00000004, - 0x0401f7f2, 0x42002800, 0x0010017d, 0x5814a000, - 0x4817c857, 0x4853c857, 0x8050a1c0, 0x0400000f, - 0x4c140000, 0x5814a801, 0x4857c857, 0x40500000, - 0x80540480, 0x04000005, 0x5814b002, 0x485bc857, - 0x0201f800, 0x0010c5dd, 0x5c002800, 0x82142c00, - 0x00000004, 0x0401f7ee, 0x42002800, 0x0010017d, - 0x58140801, 0x4817c857, 0x4807c857, 0x800409c0, - 0x04000018, 0x58142002, 0x4813c857, 0x58141003, - 0x4c140000, 0x0401fa84, 0x04020005, 0x5c002800, - 0x82142c00, 0x00000004, 0x0401f7f2, 0x4803c856, - 0x4a03c020, 0x00004010, 0x4a03c011, 0x40100011, - 0x04006000, 0x4203e000, 0x40000000, 0x4a03c017, - 0x00000000, 0x4203e000, 0x30000001, 0x0401f000, - 0x4803c856, 0x0201f800, 0x0010fd04, 0x0401fb0b, - 0x4a03c014, 0x001c001c, 0x42002000, 0x00111858, - 0x0201f800, 0x0010c5ee, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24220001, 0x04000908, + 0x00000000, 0x00000006, 0x00000009, 0x0000000c, + 0x0000000f, 0x00000012, 0x00000000, 0x00000000, + 0x0000000c, 0x00000000, 0x00000000, 0x00000000, + 0x00100199, 0x00100198, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00100199, 0x00100198, + 0x00100195, 0x00100199, 0x00100198, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00100199, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00100199, 0x00100199, + 0x00100199, 0x00000000, 0x00100199, 0x00000000, + 0x00000000, 0x00000000, 0x4203f000, 0x00021fff, + 0x40000000, 0x4203e000, 0x90000100, 0x40000000, + 0x42000800, 0x00021084, 0x4202f000, 0x00000000, + 0x42000000, 0x00007023, 0x50000000, 0x8c000500, + 0x04020003, 0x42000800, 0x00020000, 0x45780800, + 0x80040800, 0x82040580, 0x00022000, 0x040207fc, + 0x4178a000, 0x4200a800, 0x0010c79b, 0x42000800, + 0x0010fd00, 0x40540000, 0x8004b480, 0x0201f800, + 0x0010c5e7, 0x0401fadb, 0x0401fa14, 0x4803c856, 0x42000000, 0x00001000, 0x50000000, 0x82000480, - 0x24320001, 0x04000902, 0x59c40000, 0x82000500, - 0xffff0000, 0x80000120, 0x82000580, 0x00002422, - 0x04020005, 0x59a8007e, 0x84000540, 0x4803507e, - 0x0401f00a, 0x59e00003, 0x82000500, 0x00030000, - 0x82000580, 0x00010000, 0x04020004, 0x59a8007e, - 0x84000542, 0x4803507e, 0x4c140000, 0x0201f800, - 0x0010bd98, 0x5c002800, 0x42000800, 0x00001100, - 0x42001800, 0x00000100, 0x82141480, 0x0017ffff, - 0x0402100d, 0x42000800, 0x00000900, 0x82141480, - 0x0013ffff, 0x04021008, 0x42000800, 0x00000240, - 0x42001800, 0x00000040, 0x82141480, 0x0011ffff, - 0x040018d7, 0x48075013, 0x480f5257, 0x42001000, - 0x0000002c, 0x0201f800, 0x00106fe1, 0x82040c00, - 0x00111d44, 0x4807500b, 0x4a03c810, 0x00100000, - 0x4a03c811, 0x0010c798, 0x4a03c812, 0x0010fd00, - 0x4a03c813, 0x00111857, 0x4a03c829, 0x00000004, - 0x59e40001, 0x82000540, 0x0003403f, 0x4803c801, - 0x42001000, 0x0000001c, 0x0401f9fa, 0x4202c000, - 0x00111d44, 0x59aab00b, 0x59aaa00b, 0x59aaa80b, - 0x59aac813, 0x49675056, 0x59a8000b, 0x4803500c, - 0x0401fadd, 0x0201f800, 0x00108242, 0x0401faed, - 0x0401fb3d, 0x0201f800, 0x00101ab2, 0x0201f800, - 0x0010133c, 0x0201f800, 0x00100691, 0x0201f800, - 0x00100d6b, 0x0201f800, 0x00107023, 0x0401f85c, - 0x0201f800, 0x001022a6, 0x0201f800, 0x0010576d, - 0x0201f800, 0x00104f33, 0x0201f800, 0x00106abc, - 0x0201f800, 0x001067bd, 0x0201f800, 0x001013e1, - 0x0201f800, 0x00101243, 0x4203e000, 0xf0000001, - 0x0201f800, 0x0010c72c, 0x4a03c018, 0x00000000, - 0x4203e000, 0x20000511, 0x4203e000, 0x50010000, - 0x4a03c020, 0x00000000, 0x04027010, 0x59e00020, - 0x82000580, 0x00000002, 0x0402000c, 0x4a03c020, - 0x00004000, 0x4a03c011, 0x40000010, 0x04006000, - 0x4203e000, 0x40000000, 0x4a03c017, 0x00000000, - 0x4203e000, 0x30000001, 0x4202d800, 0x00000000, - 0x4203e000, 0xb0600000, 0x59a80082, 0x4003f800, - 0x0201f000, 0x00020004, 0x4df00000, 0x4203e000, - 0x50000000, 0x416c0000, 0x82000c80, 0x00000008, - 0x0402186b, 0x0c01f804, 0x5c03e000, 0x0201f000, - 0x00020008, 0x001002d2, 0x00111729, 0x001114e2, - 0x001002d1, 0x001114ae, 0x001002d1, 0x001002d1, - 0x001002e4, 0x0401f85e, 0x42000800, 0x0010d115, - 0x5804001e, 0x8c000500, 0x0400000d, 0x84000500, - 0x4800081e, 0x4202d800, 0x00000004, 0x0401f983, - 0x49f3c857, 0x5c000800, 0x5c000000, 0x82000540, - 0x00003e00, 0x4c000000, 0x4c040000, 0x1c01f000, - 0x4a038805, 0x000000f0, 0x1c01f000, 0x4a03504e, - 0x00000007, 0x4a03504f, 0x00000003, 0x4a035050, - 0x00000000, 0x4a035051, 0x00009496, 0x0201f800, - 0x00105706, 0x4a035421, 0x0000ffff, 0x4a035015, - 0x00ffffff, 0x0201f800, 0x00109f94, 0x4a035025, - 0x20200000, 0x4a035026, 0x88000200, 0x4a035027, - 0x00ff001f, 0x4a035028, 0x000007d0, 0x4a035029, - 0x80000000, 0x4a03502a, 0x00000200, 0x4a03502b, - 0x00ff0000, 0x4a03502c, 0x00010000, 0x4a035033, - 0x514c4f47, 0x4a035034, 0x49432020, 0x1c01f000, - 0x4d440000, 0x417a8800, 0x4c5c0000, 0x4178b800, - 0x0201f800, 0x00020353, 0x04020005, 0x0201f800, - 0x00104b75, 0x04020002, 0x805cb800, 0x81468800, - 0x83440580, 0x000007f0, 0x040207f6, 0x405c0800, - 0x5c00b800, 0x5c028800, 0x1c01f000, 0x4803c857, + 0x24320002, 0x0402000d, 0x0201f800, 0x0010c62e, + 0x04000008, 0x42000800, 0x00007a17, 0x50040000, + 0x8c00050e, 0x04020003, 0x8400054e, 0x44000800, + 0x4a030000, 0x00000000, 0x4a03c020, 0x00000004, + 0x4203e000, 0x6000000f, 0x4a0370e8, 0x00000003, + 0x4a0378e8, 0x00000003, 0x59e00023, 0x8c000500, + 0x04020027, 0x42002800, 0x0010017d, 0x58140800, + 0x4817c857, 0x4807c857, 0x800409c0, 0x0400000b, + 0x58142002, 0x4813c857, 0x58141003, 0x4c140000, + 0x0401faa7, 0x5c002800, 0x0402002a, 0x82142c00, + 0x00000004, 0x0401f7f2, 0x42002800, 0x0010017d, + 0x5814a000, 0x4817c857, 0x4853c857, 0x8050a1c0, + 0x0400000f, 0x4c140000, 0x5814a801, 0x4857c857, + 0x40500000, 0x80540480, 0x04000005, 0x5814b002, + 0x485bc857, 0x0201f800, 0x0010c5de, 0x5c002800, + 0x82142c00, 0x00000004, 0x0401f7ee, 0x42002800, + 0x0010017d, 0x58140801, 0x4817c857, 0x4807c857, + 0x800409c0, 0x04000018, 0x58142002, 0x4813c857, + 0x58141003, 0x4c140000, 0x0401fa81, 0x04020005, + 0x5c002800, 0x82142c00, 0x00000004, 0x0401f7f2, + 0x4803c856, 0x4a03c020, 0x00004010, 0x4a03c011, + 0x40100011, 0x04006000, 0x4203e000, 0x40000000, + 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, + 0x0401f000, 0x4803c856, 0x0201f800, 0x0010fd04, + 0x0401fb08, 0x4a03c014, 0x001c001c, 0x42002000, + 0x00111872, 0x0201f800, 0x0010c5ef, 0x42000000, + 0x00001000, 0x50000000, 0x82000480, 0x24220001, + 0x0400090b, 0x42000000, 0x00001000, 0x50000000, + 0x82000480, 0x24320001, 0x04000905, 0x59c40000, + 0x82000500, 0xffff0000, 0x80000120, 0x82000580, + 0x00002422, 0x04020005, 0x59a8007f, 0x84000540, + 0x4803507f, 0x0401f00a, 0x59e00003, 0x82000500, + 0x00030000, 0x82000580, 0x00010000, 0x04020004, + 0x59a8007f, 0x84000542, 0x4803507f, 0x4c140000, + 0x0201f800, 0x0010bd94, 0x5c002800, 0x42000800, + 0x00001100, 0x42001800, 0x00000100, 0x82141480, + 0x0017ffff, 0x0402100d, 0x42000800, 0x00000900, + 0x82141480, 0x0013ffff, 0x04021008, 0x42000800, + 0x00000240, 0x42001800, 0x00000040, 0x82141480, + 0x0011ffff, 0x040018da, 0x48075013, 0x480f5257, + 0x42001000, 0x0000002c, 0x0201f800, 0x00107213, + 0x82040c00, 0x00111d64, 0x4807500b, 0x4a03c810, + 0x00100000, 0x4a03c811, 0x0010c79b, 0x4a03c812, + 0x0010fd00, 0x4a03c813, 0x00111871, 0x4a03c829, + 0x00000004, 0x59e40001, 0x82000540, 0x0003403f, + 0x4803c801, 0x42001000, 0x0000001c, 0x0401f9f7, + 0x4202c000, 0x00111d64, 0x59aab00b, 0x59aaa00b, + 0x59aaa80b, 0x59aac813, 0x49675056, 0x59a8000b, + 0x4803500c, 0x0401fada, 0x0201f800, 0x00108133, + 0x0401faea, 0x0401fb3a, 0x0201f800, 0x00101ad5, + 0x0201f800, 0x0010134e, 0x0201f800, 0x001006b3, + 0x0201f800, 0x00100d9b, 0x0201f800, 0x00107255, + 0x0401f85d, 0x0201f800, 0x001022f2, 0x0201f800, + 0x001058cc, 0x0201f800, 0x00105081, 0x0201f800, + 0x00106ce1, 0x0201f800, 0x001069d7, 0x0201f800, + 0x001013f3, 0x0201f800, 0x00101255, 0x4203e000, + 0xf0000001, 0x0201f800, 0x0010c72f, 0x4a03c018, + 0x00000000, 0x4203e000, 0x20000511, 0x4203e000, + 0x50010000, 0x04006000, 0x4a03c020, 0x00000000, + 0x04027010, 0x59e00020, 0x82000580, 0x00000002, + 0x0402000c, 0x4a03c020, 0x00004000, 0x4a03c011, + 0x40000010, 0x04006000, 0x4203e000, 0x40000000, + 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, + 0x4202d800, 0x00000000, 0x4203e000, 0xb0600000, + 0x59a80083, 0x4003f800, 0x0201f000, 0x00020004, + 0x4df00000, 0x4203e000, 0x50000000, 0x416c0000, + 0x82000c80, 0x00000008, 0x0402186d, 0x0c01f804, + 0x5c03e000, 0x0201f000, 0x00020008, 0x001002fc, + 0x00111743, 0x001114fc, 0x001002fb, 0x001114c8, + 0x001002fb, 0x001002fb, 0x0010030e, 0x0401f860, + 0x42000800, 0x0010d117, 0x5804001e, 0x8c000500, + 0x0400000d, 0x84000500, 0x4800081e, 0x4202d800, + 0x00000004, 0x0401f97f, 0x49f3c857, 0x5c000800, + 0x5c000000, 0x82000540, 0x00003e00, 0x4c000000, + 0x4c040000, 0x1c01f000, 0x4a038805, 0x000000f0, + 0x1c01f000, 0x4a03504e, 0x00000008, 0x4a03504f, + 0x00000007, 0x4a035050, 0x00000000, 0x4a035051, + 0x00009496, 0x0201f800, 0x00105866, 0x4a035421, + 0x0000ffff, 0x4a035015, 0x00ffffff, 0x0201f800, + 0x00109eef, 0x4a035025, 0x20200000, 0x4a035026, + 0x88000200, 0x4a035027, 0x00ff001f, 0x4a035028, + 0x000007d0, 0x4a035029, 0x80000000, 0x4a03502a, + 0x00000200, 0x4a03502b, 0x00ff0000, 0x4a03502c, + 0x00010000, 0x4a035033, 0x514c4f47, 0x4a035034, + 0x49432020, 0x1c01f000, 0x4d340000, 0x4d440000, + 0x417a8800, 0x4c5c0000, 0x4178b800, 0x0201f800, + 0x00020356, 0x04020005, 0x0201f800, 0x00104cb5, + 0x04020002, 0x805cb800, 0x81468800, 0x83440580, + 0x000007f0, 0x040207f6, 0x405c0800, 0x5c00b800, + 0x5c028800, 0x5c026800, 0x1c01f000, 0x4803c857, 0x5c000000, 0x4c000000, 0x4803c857, 0x0401f80c, 0x485fc857, 0x4203e000, 0x50000000, 0x5c000000, - 0x4d780000, 0x4200b800, 0x00008002, 0x0401f009, + 0x4d780000, 0x4200b800, 0x00008002, 0x0401f00a, 0x486bc857, 0x486fc857, 0x4873c857, 0x485fc857, - 0x4203e000, 0x50000000, 0x4200b800, 0x00008002, - 0x04006000, 0x4c000000, 0x4c040000, 0x59bc00ea, - 0x4803c857, 0x82000500, 0x00000007, 0x82000580, - 0x00000001, 0x04020005, 0x42000800, 0x00000000, - 0x0201f800, 0x001071c9, 0x59b800ea, 0x4803c857, - 0x4a0370e8, 0x00000004, 0x5c000800, 0x4807c025, - 0x80040920, 0x4807c026, 0x5c000000, 0x4803c023, - 0x80000120, 0x4803c024, 0x5c000000, 0x4803c857, - 0x4803c021, 0x80000120, 0x4803c022, 0x41f80000, - 0x4803c029, 0x80000120, 0x4803c02a, 0x41780800, - 0x59a80006, 0x8c000504, 0x04000004, 0x8d0e1d2e, - 0x04000002, 0x84040d48, 0x4807c027, 0x42000000, - 0x00001000, 0x50000000, 0x82000480, 0x24320001, - 0x4803c857, 0x0400104b, 0x0201f800, 0x0010c62d, - 0x04000046, 0x42000800, 0x0010ebce, 0x46000800, - 0xfaceface, 0x80040800, 0x4c080000, 0x4c0c0000, - 0x42001000, 0x00007a00, 0x58080013, 0x44000800, - 0x80040800, 0x58080019, 0x44000800, 0x80040800, - 0x5808001a, 0x44000800, 0x80040800, 0x5808001b, - 0x44000800, 0x80040800, 0x5808001c, 0x44000800, - 0x80040800, 0x5808001f, 0x44000800, 0x80040800, - 0x42001000, 0x00007a40, 0x42001800, 0x0000000b, - 0x50080000, 0x44000800, 0x80081000, 0x80040800, - 0x800c1840, 0x040207fb, 0x42001800, 0x00000003, - 0x42001000, 0x00007b00, 0x480c1003, 0x58080005, - 0x44000800, 0x80040800, 0x800c1840, 0x040217fb, - 0x42001000, 0x00007c00, 0x58080002, 0x44000800, - 0x80040800, 0x58080003, 0x44000800, 0x80040800, - 0x58080020, 0x44000800, 0x80040800, 0x58080021, - 0x44000800, 0x80040800, 0x58080022, 0x44000800, - 0x80040800, 0x58080023, 0x44000800, 0x80040800, - 0x5c001800, 0x5c001000, 0x4a030000, 0x00000000, - 0x485fc020, 0x905cb9c0, 0x825cbd40, 0x00000012, - 0x485fc011, 0x4203e000, 0x40000000, 0x4202d800, - 0x00000005, 0x4a03c017, 0x00000000, 0x4203e000, - 0x30000001, 0x0401f847, 0x0401f7ff, 0x42000000, - 0x00000004, 0x0401f80c, 0x4a03c855, 0x0001eb5a, - 0x59e40001, 0x82000540, 0x00000700, 0x4803c801, - 0x42000000, 0x0010d5d7, 0x49780003, 0x49780004, - 0x1c01f000, 0x42000800, 0x0010d5d9, 0x44000800, - 0x59e40801, 0x82041500, 0xfff3c0ff, 0x480bc801, - 0x8c040d24, 0x0400000c, 0x4c000000, 0x59e41052, - 0x59e40054, 0x800000d4, 0x82000400, 0x0010ebea, - 0x80081480, 0x480bc853, 0x4a03c800, 0x00000040, - 0x5c000000, 0x4a03c850, 0x0010ebea, 0x800000d4, - 0x82002400, 0x0010ebe9, 0x4813c851, 0x4a03c853, - 0x00000400, 0x42000000, 0x0010ebea, 0x82001400, - 0x00001000, 0x45780000, 0x80000000, 0x80081d80, - 0x040207fd, 0x4807c801, 0x1c01f000, 0x42002000, - 0x0010d5d7, 0x59e41801, 0x58100c01, 0x82040500, - 0x00003800, 0x820c1d00, 0xffffc7ff, 0x800c1d40, - 0x480fc801, 0x1c01f000, 0x5c036000, 0x4db00000, - 0x49b3c857, 0x4803c857, 0x1c01f000, 0x1c01f000, - 0x59a80067, 0x8c000530, 0x040207fe, 0x4c080000, - 0x42001000, 0x00000004, 0x0401f862, 0x5c001000, - 0x4201d000, 0x00028b0a, 0x0201f800, 0x001069c8, - 0x4c080000, 0x42001000, 0x00000008, 0x0401f859, - 0x5c001000, 0x4201d000, 0x00028b0a, 0x0201f800, - 0x001069c8, 0x4c080000, 0x42001000, 0x00000010, - 0x0401f850, 0x5c001000, 0x4201d000, 0x00028b0a, - 0x0201f800, 0x001069c8, 0x0401f7e2, 0x8c00050c, - 0x59a80867, 0x04020003, 0x84040d30, 0x0401f006, - 0x84040d70, 0x48075067, 0x42001000, 0x00000000, - 0x0401f040, 0x48075067, 0x836c0500, 0x00000007, - 0x0c01f001, 0x0010046b, 0x00100451, 0x00100451, - 0x00100439, 0x0010045e, 0x00100451, 0x00100451, - 0x0010045e, 0x59a8007e, 0x8c000502, 0x04020013, - 0x59c40801, 0x82040d00, 0x00018000, 0x82040580, - 0x00010000, 0x0400000a, 0x82040580, 0x00008000, - 0x04000004, 0x42001000, 0x42004000, 0x0401f006, - 0x42001000, 0x22002000, 0x0401f003, 0x42001000, - 0x12001000, 0x0401f025, 0x42001000, 0x00001004, - 0x0401f022, 0x59a8007e, 0x8c000502, 0x04020008, - 0x59a80067, 0x8c000534, 0x04020004, 0x42001000, - 0x74057005, 0x0401f819, 0x1c01f000, 0x42001000, - 0x00002008, 0x0401f7fc, 0x59a80067, 0x8c000534, - 0x0402000a, 0x59a8007e, 0x8c000502, 0x04000004, - 0x42001000, 0x24052005, 0x0401f00c, 0x42001000, - 0x74057005, 0x0401f009, 0x1c01f000, 0x1c01f000, - 0x82081500, 0x0000001c, 0x82081540, 0x001c0000, - 0x480bc013, 0x1c01f000, 0x59a80067, 0x8c000530, - 0x04000002, 0x84081570, 0x480b5067, 0x8c000530, - 0x04020005, 0x82081500, 0x00007000, 0x80081114, - 0x0401fff0, 0x1c01f000, 0x40001800, 0x800c18c2, - 0x800c0400, 0x800c18c6, 0x800c0400, 0x800c18c2, - 0x800c0400, 0x800c190e, 0x800c0400, 0x80000112, - 0x1c01f000, 0x41780000, 0x50041800, 0x800c0400, - 0x80040800, 0x80102040, 0x040207fc, 0x80080500, - 0x80000540, 0x1c01f000, 0x4202f000, 0x00000000, - 0x41780000, 0x41780800, 0x41781000, 0x41781800, - 0x41782000, 0x41782800, 0x41783000, 0x41783800, - 0x41784000, 0x41784800, 0x41785000, 0x41785800, - 0x41786000, 0x41786800, 0x41787000, 0x41787800, - 0x41788000, 0x41788800, 0x41789000, 0x41789800, - 0x4178a000, 0x4178a800, 0x4178b000, 0x4178b800, - 0x4178c000, 0x4178c800, 0x4178d000, 0x4178d800, - 0x4178e000, 0x4178e800, 0x4178f000, 0x4178f800, - 0x41790000, 0x41790800, 0x41791000, 0x41791800, - 0x41792000, 0x41792800, 0x41793000, 0x41793800, - 0x41794000, 0x41794800, 0x41795000, 0x41795800, - 0x41796000, 0x41796800, 0x41797000, 0x41797800, - 0x41798000, 0x41798800, 0x42019000, 0x0010d1a5, - 0x42019800, 0x0010d17b, 0x4179a000, 0x4179a800, - 0x4179b000, 0x4179b800, 0x4179c800, 0x4179c000, - 0x4179d000, 0x4179d800, 0x4179e000, 0x4179e800, - 0x4179f000, 0x4179f800, 0x417a0000, 0x417a0800, - 0x417a1000, 0x417a1800, 0x417a2000, 0x42022800, - 0x00006100, 0x417a3000, 0x417a3800, 0x417a4000, - 0x417a4800, 0x417a5000, 0x417a5800, 0x417a6000, - 0x417a6800, 0x417a7000, 0x417a7800, 0x417a8000, - 0x417a8800, 0x417a9000, 0x417a9800, 0x417ae800, - 0x417af800, 0x42030000, 0x00007c00, 0x42031000, - 0x0010d476, 0x42031800, 0x0000bf1d, 0x42032000, - 0x0000bf32, 0x42032800, 0x0010d43e, 0x42033000, - 0x00020c5a, 0x42034000, 0x0010d115, 0x42033800, - 0x0010d134, 0x42034800, 0x0010d1b4, 0x42035000, - 0x0010d080, 0x42035800, 0x0010c880, 0x42030800, - 0x0010d176, 0x417b6000, 0x42036800, 0x00006f00, - 0x4203c800, 0x00003000, 0x42037000, 0x0000ff00, - 0x42037800, 0x0000bf00, 0x42038000, 0x00007700, - 0x42038800, 0x00004000, 0x42039000, 0x00006000, - 0x42039800, 0x0010e906, 0x4203a000, 0x00007600, - 0x4203a800, 0x00007400, 0x4203b000, 0x00007200, - 0x4203b800, 0x00007100, 0x4203c000, 0x00007000, - 0x4203d000, 0x00000000, 0x4203e800, 0x000201ba, - 0x417bd800, 0x1c01f000, 0x42000800, 0x00100000, - 0x50040000, 0x4c000000, 0x42000000, 0x0000aaaa, - 0x44000800, 0x42001800, 0x00005555, 0x42002000, - 0x00010000, 0x82102400, 0x00010000, 0x40100000, - 0x80042c00, 0x440c2800, 0x42003000, 0x0000000a, - 0x80183040, 0x040207ff, 0x50140000, 0x800c0580, - 0x04020004, 0x50040000, 0x800c0580, 0x040207f2, - 0x5c000000, 0x44000800, 0x80142840, 0x4817c861, - 0x4817500a, 0x1c01f000, 0x40681800, 0x59a8081f, - 0x800409c0, 0x04020008, 0x49781c0c, 0x4a001a0c, - 0x00000002, 0x4a001804, 0x00000007, 0x59a80015, - 0x48001805, 0x4c0c0000, 0x0401fdba, 0x5c001800, - 0x800409c0, 0x04020002, 0x80040800, 0x48041806, - 0x1c01f000, 0x4200b000, 0x00000080, 0x59a80086, - 0x8c00053e, 0x04000003, 0x4200b000, 0x00000040, - 0x42024800, 0x0010d5ef, 0x42000000, 0x0010db6f, - 0x48024809, 0x82000400, 0x00000010, 0x83264c00, - 0x0000000b, 0x8058b040, 0x040207fa, 0x1c01f000, - 0x59a8080c, 0x4006d000, 0x4202b800, 0x00000001, - 0x59a8180a, 0x480fc857, 0x82041400, 0x00000015, - 0x82082400, 0x00000015, 0x40100000, 0x800c0480, - 0x04001006, 0x44080800, 0x40080800, 0x40101000, - 0x815eb800, 0x0401f7f7, 0x45780800, 0x495f5020, - 0x1c01f000, 0x0401f803, 0x412d8800, 0x1c01f000, - 0x835c0480, 0x00000104, 0x0400100a, 0x496bc857, - 0x815eb840, 0x416a5800, 0x592ed000, 0x497a5800, - 0x497a5801, 0x497a5805, 0x812e59c0, 0x1c01f000, - 0x42000000, 0x0010d52b, 0x0201f800, 0x0010c50a, - 0x417a5800, 0x0401f7f9, 0x0401f803, 0x412d8800, - 0x1c01f000, 0x815eb840, 0x04001009, 0x416a5800, - 0x492fc857, 0x592ed000, 0x497a5800, 0x497a5801, - 0x497a5805, 0x812e59c0, 0x1c01f000, 0x42000000, - 0x0010d52b, 0x0201f800, 0x0010c50a, 0x417ab800, - 0x417a5800, 0x0401f7f8, 0x492fc857, 0x496a5800, - 0x412ed000, 0x815eb800, 0x59c80000, 0x82000540, - 0x00001200, 0x48039000, 0x1c01f000, 0x492fc857, - 0x812e59c0, 0x04000007, 0x592c0001, 0x497a5801, - 0x4c000000, 0x0401fff1, 0x5c025800, 0x0401f7f9, - 0x1c01f000, 0x4807c856, 0x42007000, 0x00020c51, - 0x4a007000, 0x00000000, 0x59e00003, 0x82000540, - 0x00008080, 0x4803c003, 0x4a03b805, 0x90000001, - 0x59dc0006, 0x4a03b805, 0x70000000, 0x59dc0006, + 0x496fc857, 0x4203e000, 0x50000000, 0x4200b800, + 0x00008002, 0x4c000000, 0x04006000, 0x4c040000, + 0x59bc00ea, 0x4803c857, 0x82000500, 0x00000007, + 0x82000580, 0x00000001, 0x04020005, 0x42000800, + 0x00000000, 0x0201f800, 0x00020c3d, 0x59b800ea, + 0x4803c857, 0x4a0370e8, 0x00000004, 0x5c000800, + 0x4807c025, 0x80040920, 0x4807c026, 0x5c000000, + 0x4803c023, 0x80000120, 0x4803c024, 0x5c000000, + 0x4803c857, 0x4803c021, 0x80000120, 0x4803c022, + 0x41f80000, 0x4803c029, 0x80000120, 0x4803c02a, + 0x41780800, 0x59a80006, 0x8c000504, 0x04000004, + 0x8d0e1d2e, 0x04000002, 0x84040d48, 0x4807c027, + 0x59a80062, 0x8c00050a, 0x04000004, 0x84040d4a, + 0x4807c857, 0x4807c027, 0x42000000, 0x00001000, + 0x50000000, 0x82000480, 0x24320001, 0x4803c857, + 0x0400104b, 0x0201f800, 0x0010c62e, 0x04000046, + 0x42000800, 0x0010ebd6, 0x46000800, 0xfaceface, + 0x80040800, 0x4c080000, 0x4c0c0000, 0x42001000, + 0x00007a00, 0x58080013, 0x44000800, 0x80040800, + 0x58080019, 0x44000800, 0x80040800, 0x5808001a, + 0x44000800, 0x80040800, 0x5808001b, 0x44000800, + 0x80040800, 0x5808001c, 0x44000800, 0x80040800, + 0x5808001f, 0x44000800, 0x80040800, 0x42001000, + 0x00007a40, 0x42001800, 0x0000000b, 0x50080000, + 0x44000800, 0x80081000, 0x80040800, 0x800c1840, + 0x040207fb, 0x42001800, 0x00000003, 0x42001000, + 0x00007b00, 0x480c1003, 0x58080005, 0x44000800, + 0x80040800, 0x800c1840, 0x040217fb, 0x42001000, + 0x00007c00, 0x58080002, 0x44000800, 0x80040800, + 0x58080003, 0x44000800, 0x80040800, 0x58080020, + 0x44000800, 0x80040800, 0x58080021, 0x44000800, + 0x80040800, 0x58080022, 0x44000800, 0x80040800, + 0x58080023, 0x44000800, 0x80040800, 0x5c001800, + 0x5c001000, 0x4a030000, 0x00000000, 0x485fc020, + 0x905cb9c0, 0x825cbd40, 0x00000012, 0x485fc011, + 0x4203e000, 0x40000000, 0x4202d800, 0x00000005, + 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, + 0x0401f83a, 0x0401f7ff, 0x42000000, 0x00000004, + 0x0401f80c, 0x4a03c855, 0x0001eb5a, 0x59e40001, + 0x82000540, 0x00000700, 0x4803c801, 0x42000000, + 0x0010d5df, 0x49780003, 0x49780004, 0x1c01f000, + 0x42000800, 0x0010d5e1, 0x44000800, 0x59e40801, + 0x82041500, 0xfff3c0ff, 0x480bc801, 0x4a03c850, + 0x0010ebf2, 0x800000d4, 0x82002400, 0x0010ebf1, + 0x4813c851, 0x4a03c853, 0x00000400, 0x42000000, + 0x0010ebf2, 0x82001400, 0x00001000, 0x45780000, + 0x80000000, 0x80081d80, 0x040207fd, 0x4807c801, + 0x1c01f000, 0x42002000, 0x0010d5df, 0x59e41801, + 0x58100c01, 0x82040500, 0x00003800, 0x820c1d00, + 0xffffc7ff, 0x800c1d40, 0x480fc801, 0x1c01f000, + 0x5c036000, 0x4db00000, 0x49b3c857, 0x4803c857, + 0x1c01f000, 0x1c01f000, 0x59a80068, 0x8c000530, + 0x040207fe, 0x4c080000, 0x42001000, 0x00000004, + 0x0401f862, 0x5c001000, 0x4201d000, 0x00028b0a, + 0x0201f800, 0x00106bed, 0x4c080000, 0x42001000, + 0x00000008, 0x0401f859, 0x5c001000, 0x4201d000, + 0x00028b0a, 0x0201f800, 0x00106bed, 0x4c080000, + 0x42001000, 0x00000010, 0x0401f850, 0x5c001000, + 0x4201d000, 0x00028b0a, 0x0201f800, 0x00106bed, + 0x0401f7e2, 0x8c00050c, 0x59a80868, 0x04020003, + 0x84040d30, 0x0401f006, 0x84040d70, 0x48075068, + 0x42001000, 0x00000000, 0x0401f040, 0x48075068, + 0x836c0500, 0x00000007, 0x0c01f001, 0x00100491, + 0x00100477, 0x00100477, 0x0010045f, 0x00100484, + 0x00100477, 0x00100477, 0x00100484, 0x59a8007f, + 0x8c000502, 0x04020013, 0x59c40801, 0x82040d00, + 0x00018000, 0x82040580, 0x00010000, 0x0400000a, + 0x82040580, 0x00008000, 0x04000004, 0x42001000, + 0x42004000, 0x0401f006, 0x42001000, 0x22002000, + 0x0401f003, 0x42001000, 0x12001000, 0x0401f025, + 0x42001000, 0x00001004, 0x0401f022, 0x59a8007f, + 0x8c000502, 0x04020008, 0x59a80068, 0x8c000534, + 0x04020004, 0x42001000, 0x74057005, 0x0401f819, + 0x1c01f000, 0x42001000, 0x00002008, 0x0401f7fc, + 0x59a80068, 0x8c000534, 0x0402000a, 0x59a8007f, + 0x8c000502, 0x04000004, 0x42001000, 0x24052005, + 0x0401f00c, 0x42001000, 0x74057005, 0x0401f009, + 0x1c01f000, 0x1c01f000, 0x82081500, 0x0000001c, + 0x82081540, 0x001c0000, 0x480bc013, 0x1c01f000, + 0x59a80068, 0x8c000530, 0x04000002, 0x84081570, + 0x480b5068, 0x8c000530, 0x04020005, 0x82081500, + 0x00007000, 0x80081114, 0x0401fff0, 0x1c01f000, + 0x40001800, 0x800c18c2, 0x800c0400, 0x800c18c6, + 0x800c0400, 0x800c18c2, 0x800c0400, 0x800c190e, + 0x800c0400, 0x80000112, 0x1c01f000, 0x41780000, + 0x50041800, 0x800c0400, 0x80040800, 0x80102040, + 0x040207fc, 0x80080500, 0x80000540, 0x1c01f000, + 0x4202f000, 0x00000000, 0x41780000, 0x41780800, + 0x41781000, 0x41781800, 0x41782000, 0x41782800, + 0x41783000, 0x41783800, 0x41784000, 0x41784800, + 0x41785000, 0x41785800, 0x41786000, 0x41786800, + 0x41787000, 0x41787800, 0x41788000, 0x41788800, + 0x41789000, 0x41789800, 0x4178a000, 0x4178a800, + 0x4178b000, 0x4178b800, 0x4178c000, 0x4178c800, + 0x4178d000, 0x4178d800, 0x4178e000, 0x4178e800, + 0x4178f000, 0x4178f800, 0x41790000, 0x41790800, + 0x41791000, 0x41791800, 0x41792000, 0x41792800, + 0x41793000, 0x41793800, 0x41794000, 0x41794800, + 0x41795000, 0x41795800, 0x41796000, 0x41796800, + 0x41797000, 0x41797800, 0x41798000, 0x41798800, + 0x42019000, 0x0010d1a7, 0x42019800, 0x0010d17d, + 0x4179a000, 0x4179a800, 0x4179b000, 0x4179b800, + 0x4179c800, 0x4179c000, 0x4179d000, 0x4179d800, + 0x4179e000, 0x4179e800, 0x4179f000, 0x4179f800, + 0x417a0000, 0x417a0800, 0x417a1000, 0x417a1800, + 0x417a2000, 0x42022800, 0x00006100, 0x417a3000, + 0x417a3800, 0x417a4000, 0x417a4800, 0x417a5000, + 0x417a5800, 0x417a6000, 0x417a6800, 0x417a7000, + 0x417a7800, 0x417a8000, 0x417a8800, 0x417a9000, + 0x417a9800, 0x417ae800, 0x417af800, 0x42030000, + 0x00007c00, 0x42031000, 0x0010d47b, 0x42031800, + 0x0000bf1d, 0x42032000, 0x0000bf32, 0x42032800, + 0x0010d440, 0x42033000, 0x0002108d, 0x42034000, + 0x0010d117, 0x42033800, 0x0010d136, 0x42034800, + 0x0010d1b6, 0x42035000, 0x0010d080, 0x42035800, + 0x0010c880, 0x42030800, 0x0010d178, 0x417b6000, + 0x42036800, 0x00006f00, 0x4203c800, 0x00003000, + 0x42037000, 0x0000ff00, 0x42037800, 0x0000bf00, + 0x42038000, 0x00007700, 0x42038800, 0x00004000, + 0x42039000, 0x00006000, 0x42039800, 0x0010e90e, + 0x4203a000, 0x00007600, 0x4203a800, 0x00007400, + 0x4203b000, 0x00007200, 0x4203b800, 0x00007100, + 0x4203c000, 0x00007000, 0x4203d000, 0x00000000, + 0x4203e800, 0x000201bd, 0x417bd800, 0x1c01f000, + 0x42000800, 0x00100000, 0x50040000, 0x4c000000, + 0x42000000, 0x0000aaaa, 0x44000800, 0x42001800, + 0x00005555, 0x42002000, 0x00010000, 0x82102400, + 0x00010000, 0x40100000, 0x80042c00, 0x440c2800, + 0x42003000, 0x0000000a, 0x80183040, 0x040207ff, + 0x50140000, 0x800c0580, 0x04020004, 0x50040000, + 0x800c0580, 0x040207f2, 0x5c000000, 0x44000800, + 0x80142840, 0x4817c861, 0x4817500a, 0x1c01f000, + 0x40681800, 0x59a8081f, 0x800409c0, 0x04020008, + 0x49781c0c, 0x4a001a0c, 0x00000002, 0x4a001804, + 0x00000007, 0x59a80015, 0x48001805, 0x4c0c0000, + 0x0401fdbe, 0x5c001800, 0x800409c0, 0x04020002, + 0x80040800, 0x48041806, 0x1c01f000, 0x4200b000, + 0x00000080, 0x59a80087, 0x8c00053e, 0x04000003, + 0x4200b000, 0x00000040, 0x42024800, 0x0010d5f7, + 0x42000000, 0x0010db77, 0x48024809, 0x82000400, + 0x00000010, 0x83264c00, 0x0000000b, 0x8058b040, + 0x040207fa, 0x1c01f000, 0x59a8080c, 0x4006d000, + 0x4202b800, 0x00000001, 0x59a8180a, 0x480fc857, + 0x82041400, 0x00000015, 0x82082400, 0x00000015, + 0x40100000, 0x800c0480, 0x04001006, 0x44080800, + 0x40080800, 0x40101000, 0x815eb800, 0x0401f7f7, + 0x45780800, 0x495f5020, 0x1c01f000, 0x0401f803, + 0x412d8800, 0x1c01f000, 0x835c0480, 0x00000104, + 0x0400100a, 0x496bc857, 0x815eb840, 0x416a5800, + 0x592ed000, 0x497a5800, 0x497a5801, 0x497a5805, + 0x812e59c0, 0x1c01f000, 0x42000000, 0x0010d52f, + 0x0201f800, 0x0010c50c, 0x417a5800, 0x0401f7f9, + 0x0401f803, 0x412d8800, 0x1c01f000, 0x815eb840, + 0x04001009, 0x416a5800, 0x492fc857, 0x592ed000, + 0x497a5800, 0x497a5801, 0x497a5805, 0x812e59c0, + 0x1c01f000, 0x42000000, 0x0010d52f, 0x0201f800, + 0x0010c50c, 0x417ab800, 0x417a5800, 0x0401f7f8, + 0x492fc857, 0x496a5800, 0x412ed000, 0x815eb800, + 0x59c80000, 0x82000540, 0x00001200, 0x48039000, + 0x1c01f000, 0x492fc857, 0x812e59c0, 0x04000007, + 0x592c0001, 0x497a5801, 0x4c000000, 0x0401fff1, + 0x5c025800, 0x0401f7f9, 0x1c01f000, 0x4807c856, + 0x42007000, 0x00021084, 0x4a007000, 0x00000000, + 0x59e00003, 0x82000540, 0x00008080, 0x4803c003, + 0x4a03b805, 0x90000001, 0x59dc0006, 0x4a03b805, + 0x70000000, 0x59dc0006, 0x4a03b805, 0x30000000, + 0x59dc0006, 0x4a03b805, 0x80000000, 0x4200b000, + 0x00000020, 0x497bb807, 0x8058b040, 0x040207fe, 0x4a03b805, 0x30000000, 0x59dc0006, 0x4a03b805, - 0x80000000, 0x4200b000, 0x00000020, 0x497bb807, - 0x8058b040, 0x040207fe, 0x4a03b805, 0x30000000, - 0x59dc0006, 0x4a03b805, 0x60000001, 0x59dc0006, - 0x4a03b805, 0x70000001, 0x59dc0006, 0x4a03b805, - 0x30000002, 0x4200b000, 0x00000020, 0x497bb807, - 0x8058b040, 0x040207fe, 0x4a03b805, 0x30000000, - 0x59dc0006, 0x4a03b805, 0x60000001, 0x4803c856, - 0x0401ffad, 0x04000d42, 0x42001000, 0x0010d471, - 0x452c1000, 0x4a025801, 0x00000001, 0x4a025802, - 0x00000100, 0x4a025808, 0x001078f8, 0x497a5809, - 0x497a580a, 0x497a580b, 0x0401ff9f, 0x04000d34, - 0x42001000, 0x0010d472, 0x452c1000, 0x4a025801, - 0x00000000, 0x4a025802, 0x00000100, 0x4a025808, - 0x0010105c, 0x497a5803, 0x497a5806, 0x497a5807, - 0x497a5809, 0x59a8007e, 0x8c000500, 0x04000006, - 0x4a03b805, 0xe0000001, 0x59dc0006, 0x8c000522, - 0x040007fc, 0x1c01f000, 0x40681000, 0x0201f800, - 0x00020017, 0x1c01f000, 0x42001000, 0x00020027, - 0x0201f800, 0x0010687a, 0x0201f800, 0x0010a07e, - 0x58380807, 0x42002000, 0x00000001, 0x58040801, - 0x800409c0, 0x04000003, 0x80102000, 0x0401f7fc, - 0x0201f800, 0x0010b9e9, 0x04020011, 0x42000000, - 0x0010d493, 0x0201f800, 0x0010c50a, 0x0201f800, - 0x0010a096, 0x42000800, 0x00000001, 0x42001000, - 0x00020027, 0x0201f800, 0x00106844, 0x42007000, - 0x00020c51, 0x0201f000, 0x00020031, 0x4a03b805, - 0x30000002, 0x59dc0006, 0x4807b800, 0x480bb801, - 0x42007000, 0x00020c51, 0x4a007002, 0x00000040, - 0x480c7008, 0x58380007, 0x82000400, 0x00000005, - 0x48007003, 0x4a007000, 0x00000003, 0x4803b803, - 0x0201f000, 0x00020051, 0x58380802, 0x42001000, - 0x0000ff00, 0x82040480, 0x0000ff00, 0x04021003, - 0x40041000, 0x80000580, 0x48007002, 0x480bb802, - 0x59dc0006, 0x4a03b805, 0x10000000, 0x1c01f000, - 0x4a03b805, 0x30000001, 0x58386001, 0x58301008, - 0x4807c857, 0x4803c857, 0x4833c857, 0x4a006002, - 0x00000200, 0x4a007000, 0x00000000, 0x800811c0, - 0x02000000, 0x0002002d, 0x0201f000, 0x00020093, - 0x59dc0006, 0x8c000520, 0x0400000a, 0x02004800, - 0x000209db, 0x59dc0006, 0x82000500, 0x00006000, - 0x04000004, 0x82000580, 0x00006000, 0x040207f8, - 0x1c01f000, 0x41781800, 0x58382005, 0x40300000, - 0x80100580, 0x04000007, 0x40101800, 0x58102000, - 0x801021c0, 0x040207fa, 0x4803c856, 0x0401f011, - 0x4833c857, 0x58302000, 0x49786000, 0x800c19c0, - 0x04020008, 0x801021c0, 0x04000003, 0x48107005, - 0x0401f008, 0x49787005, 0x49787004, 0x0401f005, - 0x48101800, 0x801021c0, 0x04020002, 0x480c7004, - 0x1c01f000, 0x4803c856, 0x4dc00000, 0x42007000, - 0x0010d474, 0x4a007400, 0x00000000, 0x49787001, - 0x42038000, 0x00007720, 0x4a038006, 0x60000001, - 0x4a038009, 0xf4f60000, 0x42038000, 0x00007700, + 0x60000001, 0x59dc0006, 0x4a03b805, 0x70000001, + 0x59dc0006, 0x4a03b805, 0x30000002, 0x4200b000, + 0x00000020, 0x497bb807, 0x8058b040, 0x040207fe, + 0x4a03b805, 0x30000000, 0x59dc0006, 0x4a03b805, + 0x60000001, 0x4803c856, 0x0401ffad, 0x04000d48, + 0x42001000, 0x0010d476, 0x452c1000, 0x4a025801, + 0x00000001, 0x4a025802, 0x00000100, 0x4a025808, + 0x00107839, 0x497a5809, 0x497a580a, 0x497a580b, + 0x0401ff9f, 0x04000d3a, 0x42001000, 0x0010d477, + 0x452c1000, 0x4a025801, 0x00000000, 0x4a025802, + 0x00000100, 0x4a025808, 0x00101064, 0x497a5803, + 0x497a5806, 0x497a5807, 0x497a5809, 0x59a8007f, + 0x8c000500, 0x04000006, 0x4a03b805, 0xe0000001, + 0x59dc0006, 0x8c000522, 0x040007fc, 0x1c01f000, + 0x40681000, 0x0201f800, 0x00020020, 0x1c01f000, + 0x42001000, 0x00020030, 0x0201f800, 0x00106a97, + 0x0201f800, 0x00109fd9, 0x58380807, 0x42002000, + 0x00000001, 0x58040801, 0x800409c0, 0x04000003, + 0x80102000, 0x0401f7fc, 0x0201f800, 0x0010b9d3, + 0x0402000d, 0x0201f800, 0x00109ff1, 0x42000800, + 0x00000001, 0x42001000, 0x00020030, 0x0201f800, + 0x00106a61, 0x42007000, 0x00021084, 0x0201f000, + 0x0002003a, 0x4a03b805, 0x30000002, 0x59dc0006, + 0x4807b800, 0x480bb801, 0x42007000, 0x00021084, + 0x4a007002, 0x00000040, 0x480c7008, 0x58380007, + 0x82000400, 0x00000005, 0x48007003, 0x4a007000, + 0x00000003, 0x4803b803, 0x0201f000, 0x0002005a, + 0x58380802, 0x42001000, 0x0000ff00, 0x82040480, + 0x0000ff00, 0x04021003, 0x40041000, 0x80000580, + 0x48007002, 0x480bb802, 0x59dc0006, 0x4a03b805, + 0x10000000, 0x1c01f000, 0x4a03b805, 0x30000001, + 0x58386001, 0x58301008, 0x4807c857, 0x4803c857, + 0x4833c857, 0x4a006002, 0x00000200, 0x4a007000, + 0x00000000, 0x800811c0, 0x02000000, 0x00020036, + 0x0201f000, 0x0002009c, 0x59dc0006, 0x8c000520, + 0x0400000a, 0x02004800, 0x00020a23, 0x59dc0006, + 0x82000500, 0x00006000, 0x04000004, 0x82000580, + 0x00006000, 0x040207f8, 0x1c01f000, 0x41781800, + 0x58382005, 0x40300000, 0x80100580, 0x04000007, + 0x40101800, 0x58102000, 0x801021c0, 0x040207fa, + 0x4803c856, 0x0401f011, 0x4833c857, 0x58302000, + 0x49786000, 0x800c19c0, 0x04020008, 0x801021c0, + 0x04000003, 0x48107005, 0x0401f008, 0x49787005, + 0x49787004, 0x0401f005, 0x48101800, 0x801021c0, + 0x04020002, 0x480c7004, 0x1c01f000, 0x4803c856, + 0x4dc00000, 0x42007000, 0x0010d479, 0x4a007400, + 0x00000000, 0x49787001, 0x42038000, 0x00007720, 0x4a038006, 0x60000001, 0x4a038009, 0xf4f60000, - 0x4a03c822, 0x00000010, 0x4a0370e8, 0x00000000, - 0x0401f809, 0x4a0370e9, 0x00003a0f, 0x4a0370e8, - 0x00000000, 0x4a0370e8, 0x00000001, 0x5c038000, - 0x1c01f000, 0x4c5c0000, 0x4178b800, 0x0401f80a, - 0x5c00b800, 0x1c01f000, 0x4803c856, 0x4c5c0000, - 0x825cbd40, 0x00000001, 0x0401f803, 0x5c00b800, - 0x1c01f000, 0x4803c856, 0x4dc00000, 0x4c500000, - 0x4c580000, 0x4c540000, 0x4a0370e8, 0x00000000, - 0x805cb9c0, 0x0400000b, 0x4a038807, 0x00000004, - 0x4a0370e5, 0x00080000, 0x59b800ea, 0x8c000510, - 0x04000004, 0x59b800e0, 0x0401f87d, 0x0401f7fb, - 0x42038000, 0x00007720, 0x0201f800, 0x00100ccd, - 0x59c00007, 0x4a038006, 0x20000000, 0x59c00007, - 0x4a038006, 0x8000000a, 0x59c00007, 0x4a038006, - 0x8000000b, 0x59c00007, 0x4a038006, 0x40000001, + 0x42038000, 0x00007700, 0x4a038006, 0x60000001, + 0x4a038009, 0xf4f60000, 0x4a03c822, 0x00000010, + 0x4a0370e8, 0x00000000, 0x0401f809, 0x4a0370e9, + 0x00003a0f, 0x4a0370e8, 0x00000000, 0x4a0370e8, + 0x00000001, 0x5c038000, 0x1c01f000, 0x4c5c0000, + 0x4178b800, 0x0401f80a, 0x5c00b800, 0x1c01f000, + 0x4803c856, 0x4c5c0000, 0x825cbd40, 0x00000001, + 0x0401f803, 0x5c00b800, 0x1c01f000, 0x4803c856, + 0x4dc00000, 0x4c500000, 0x4c580000, 0x4c540000, + 0x4a0370e8, 0x00000000, 0x805cb9c0, 0x0400000b, + 0x4a038807, 0x00000004, 0x4a0370e5, 0x00080000, + 0x59b800ea, 0x8c000510, 0x04000004, 0x59b800e0, + 0x0401f87d, 0x0401f7fb, 0x42038000, 0x00007720, + 0x0201f800, 0x00100cf9, 0x59c00007, 0x4a038006, + 0x20000000, 0x59c00007, 0x4a038006, 0x8000000a, + 0x59c00007, 0x4a038006, 0x8000000b, 0x59c00007, + 0x4a038006, 0x40000001, 0x83c00580, 0x00007700, + 0x04000004, 0x42038000, 0x00007700, 0x0401f7ed, + 0x42038000, 0x00007720, 0x42000800, 0x00000800, + 0x59c00007, 0x8c00051e, 0x04000006, 0x4a038006, + 0x90000001, 0x80040840, 0x040207fa, 0x0401fc48, 0x83c00580, 0x00007700, 0x04000004, 0x42038000, - 0x00007700, 0x0401f7ed, 0x42038000, 0x00007720, - 0x42000800, 0x00000800, 0x59c00007, 0x8c00051e, - 0x04000006, 0x4a038006, 0x90000001, 0x80040840, - 0x040207fa, 0x0401fc3e, 0x83c00580, 0x00007700, - 0x04000004, 0x42038000, 0x00007700, 0x0401f7f1, - 0x4178a000, 0x805cb9c0, 0x0402001d, 0x4200b000, - 0x00000020, 0x83b8ac00, 0x00000020, 0x0201f800, - 0x0010c5e6, 0x4a0370fb, 0x00000001, 0x4a037020, - 0x00100f3c, 0x59a80032, 0x82000500, 0x0000ffff, - 0x48037021, 0x4a037035, 0x0010e84c, 0x4a037030, - 0x0010d095, 0x4a037031, 0x0010c880, 0x4a037032, - 0x0010d186, 0x4a037036, 0x0010d191, 0x59840002, - 0x48037034, 0x4a037038, 0x00100f33, 0x4a0370fb, - 0x00000001, 0x4200b000, 0x00000020, 0x83b8ac00, - 0x00000000, 0x0201f800, 0x0010c5e6, 0x4200b000, - 0x00000040, 0x83b8ac00, 0x00000040, 0x0201f800, - 0x0010c5e6, 0x805cb9c0, 0x04020006, 0x4a0370e4, - 0xaaaaaaaa, 0x4a0370e5, 0xaaaaaaaa, 0x0401f005, - 0x4a0370e4, 0xa2aa2a82, 0x4a0370e5, 0xaaaaa2aa, - 0x4a0370e6, 0xaaaaaaaa, 0x4a0370fb, 0x00000000, - 0x4a0370e6, 0xaaaaaaaa, 0x42038000, 0x00007720, - 0x4a038006, 0x90000000, 0x59c00007, 0x8c00051e, - 0x02020800, 0x0010032f, 0x42038000, 0x00007700, - 0x4a038006, 0x90000000, 0x59c00007, 0x8c00051e, - 0x02020800, 0x0010032f, 0x5c00a800, 0x5c00b000, - 0x5c00a000, 0x5c038000, 0x1c01f000, 0x4d300000, - 0x4d380000, 0x40026000, 0x82000500, 0x7f000000, - 0x82000580, 0x60000000, 0x04020012, 0x83326500, - 0x00ffffff, 0x0201f800, 0x0010a6dc, 0x0402000d, - 0x59300203, 0x82000580, 0x00000004, 0x04020009, - 0x59300c07, 0x82040580, 0x00000009, 0x04020005, - 0x42027000, 0x00000047, 0x0201f800, 0x00020b22, - 0x5c027000, 0x5c026000, 0x1c01f000, 0x4d300000, - 0x4d2c0000, 0x4d340000, 0x4d400000, 0x4cfc0000, - 0x4d380000, 0x4d3c0000, 0x4d440000, 0x4d4c0000, - 0x4d480000, 0x4c5c0000, 0x4c600000, 0x4c640000, - 0x4d040000, 0x4cc80000, 0x4ccc0000, 0x4cf40000, - 0x4cf80000, 0x0201f800, 0x00020096, 0x5c01f000, - 0x5c01e800, 0x5c019800, 0x5c019000, 0x5c020800, - 0x5c00c800, 0x5c00c000, 0x5c00b800, 0x5c029000, - 0x5c029800, 0x5c028800, 0x5c027800, 0x5c027000, - 0x5c01f800, 0x5c028000, 0x5c026800, 0x5c025800, - 0x5c026000, 0x1c01f000, 0x493bc857, 0x0201f000, - 0x000200c3, 0x83300500, 0x000000ff, 0x82000c80, - 0x00000007, 0x02021800, 0x0010032f, 0x0c01f025, - 0x1c01f000, 0x82000d00, 0xc0000038, 0x02020800, - 0x00100324, 0x0201f800, 0x0010032f, 0x00000000, - 0x00000048, 0x00000054, 0x00000053, 0x001007ba, - 0x001007df, 0x001007da, 0x001007fe, 0x001007c6, - 0x001007d2, 0x001007ba, 0x001007f9, 0x0010085d, - 0x001007ba, 0x00100860, 0x001007ba, 0x001007ba, - 0x00100864, 0x0010086a, 0x00100888, 0x0010089d, - 0x001007ff, 0x001008a6, 0x001008b2, 0x001007ba, - 0x001007ba, 0x001007ba, 0x0201f800, 0x0010032f, - 0x001007c4, 0x00100949, 0x00100823, 0x0010084c, - 0x001007c4, 0x001007c4, 0x001007c4, 0x001007c4, - 0x0201f800, 0x0010032f, 0x4803c856, 0x59300004, - 0x8c00053e, 0x04020005, 0x42027000, 0x00000055, - 0x0201f000, 0x00020b22, 0x0201f800, 0x00107595, - 0x040007fa, 0x1c01f000, 0x4803c856, 0x0401f8e1, - 0x40002800, 0x41782000, 0x42027000, 0x00000056, - 0x0201f000, 0x00020b22, 0x4803c856, 0x42027000, - 0x00000057, 0x0201f000, 0x00020b22, 0x4803c856, - 0x59325809, 0x812e59c0, 0x04000016, 0x59300008, - 0x8c00051a, 0x0402000d, 0x592c0409, 0x8c00051c, - 0x04020003, 0x4a026012, 0xffffffff, 0x59300004, - 0x8c00053e, 0x04020008, 0x42027000, 0x00000048, - 0x0201f000, 0x00020b22, 0x4a025a07, 0x00000007, - 0x0401f7f5, 0x0201f800, 0x00107595, 0x040007f7, - 0x1c01f000, 0x4803c856, 0x83300500, 0x00ffffff, - 0x0201f000, 0x00106e06, 0x1c01f000, 0x4803c856, - 0x813261c0, 0x02000800, 0x0010032f, 0x0201f800, - 0x00109c4d, 0x0400000d, 0x59325809, 0x592c0209, - 0x84000552, 0x48025a09, 0x0201f800, 0x001010f7, - 0x59300004, 0x8c00053e, 0x04020005, 0x417a7800, - 0x0201f800, 0x001097a0, 0x1c01f000, 0x0201f800, - 0x00107595, 0x040007fa, 0x1c01f000, 0x4c040000, - 0x59b808ea, 0x82040d00, 0x00000007, 0x82040580, - 0x00000003, 0x04000004, 0x42000000, 0x60000000, - 0x0401f8c8, 0x5c000800, 0x1c01f000, 0x0401f916, - 0x0400001b, 0x59325809, 0x812e59c0, 0x04000018, - 0x592c0205, 0x82000500, 0x000000ff, 0x82000d80, - 0x00000029, 0x04020012, 0x59300203, 0x82000580, - 0x00000003, 0x0400000b, 0x59300808, 0x84040d26, - 0x48066008, 0x0201f800, 0x0002011f, 0x4a03900d, - 0x00000040, 0x4a0370e5, 0x00000008, 0x1c01f000, - 0x0201f800, 0x00107595, 0x040007f4, 0x42000000, - 0x0010d536, 0x0201f800, 0x0010c50a, 0x59880151, - 0x80000000, 0x48031151, 0x4a03900d, 0x00000040, - 0x42000000, 0xc0000000, 0x0201f000, 0x00020113, - 0x4c5c0000, 0x4c600000, 0x4c640000, 0x4200c800, - 0x0010e853, 0x4200b800, 0x00003000, 0x4200c000, - 0x00000105, 0x0201f800, 0x001065fd, 0x4a0370e4, - 0x02000000, 0x5c00c800, 0x5c00c000, 0x5c00b800, - 0x1c01f000, 0x4933c857, 0x0201f000, 0x00020afe, - 0x4933c857, 0x0201f800, 0x00100cd5, 0x1c01f000, - 0x41300800, 0x800409c0, 0x02020800, 0x0010032f, - 0x0201f800, 0x00100324, 0x42000000, 0x0010d536, - 0x0201f800, 0x0010c50a, 0x4933c857, 0x813261c0, - 0x02000800, 0x0010032f, 0x0401f842, 0x40002800, - 0x0201f800, 0x0010c473, 0x4c140000, 0x59a8007b, - 0x80000540, 0x04000005, 0x8c142d2a, 0x04000003, - 0x0201f800, 0x00100cd5, 0x5c002800, 0x0401f8ae, - 0x04000007, 0x5932680a, 0x59340200, 0x8c00050e, - 0x59300415, 0x02020800, 0x00109f4a, 0x1c01f000, - 0x42000000, 0x0010d536, 0x0201f800, 0x0010c50a, - 0x4933c857, 0x813261c0, 0x02000800, 0x0010032f, - 0x0401f89d, 0x0400000b, 0x0201f800, 0x00109c4d, - 0x04000008, 0x59325809, 0x592c0209, 0x8400054e, - 0x48025a09, 0x417a7800, 0x0201f800, 0x001097a0, - 0x1c01f000, 0x485fc857, 0x5c000000, 0x4d780000, - 0x4203e000, 0x50000000, 0x4200b800, 0x00008005, - 0x0201f000, 0x00100334, 0x4933c857, 0x83300480, - 0x00000020, 0x02021800, 0x0010032f, 0x83300c00, - 0x0010d5ab, 0x50040000, 0x80000000, 0x04001002, - 0x44000800, 0x1c01f000, 0x4933c857, 0x0401f7f4, - 0x4807c856, 0x59b800ea, 0x8c000510, 0x040007fd, - 0x59b800e0, 0x4803c857, 0x1c01f000, 0x4803c856, - 0x42000000, 0x10000000, 0x41300800, 0x0401f029, - 0x8c000510, 0x02000000, 0x00020119, 0x4c040000, - 0x0401f80b, 0x5c000800, 0x82100480, 0x00000008, - 0x02001000, 0x00020119, 0x4c040000, 0x0401fe9c, - 0x5c000800, 0x0201f000, 0x00020119, 0x59b800e2, - 0x59b820e2, 0x80100580, 0x040207fd, 0x80102114, - 0x0401f001, 0x40101800, 0x800c190a, 0x82100500, - 0x0000001f, 0x820c1d00, 0x0000001f, 0x800c2480, - 0x82102500, 0x0000001f, 0x1c01f000, 0x40680000, - 0x406c0800, 0x0401f807, 0x42018800, 0x00000001, - 0x04020003, 0x42018800, 0x00000000, 0x1c01f000, - 0x82000500, 0xf0000000, 0x82040d00, 0x0fffffff, - 0x80040d40, 0x4807c857, 0x42001000, 0x0010d475, - 0x50080000, 0x80000540, 0x04020005, 0x4a0370e5, - 0x00000003, 0x4a0370e4, 0x00000300, 0x80000000, - 0x44001000, 0x42001000, 0x00000400, 0x59b800ea, - 0x8c000510, 0x0400000c, 0x0401ffd1, 0x82100480, - 0x00000008, 0x04001007, 0x4c040000, 0x4c080000, - 0x0401fe63, 0x5c001000, 0x5c000800, 0x0401f020, - 0x59b800ea, 0x8c000516, 0x0402001d, 0x4a0370e4, - 0x00300000, 0x480770e1, 0x42001000, 0x0000ff00, - 0x80081040, 0x04000012, 0x59b808e4, 0x8c040d28, - 0x040207fc, 0x42001000, 0x0010d475, 0x50080000, - 0x80000040, 0x04020005, 0x4a0370e5, 0x00000002, - 0x4a0370e4, 0x00000200, 0x02001800, 0x0010032f, - 0x44001000, 0x8c040d2c, 0x1c01f000, 0x41f80000, - 0x50000000, 0x0201f800, 0x0010032f, 0x80081040, - 0x040207d3, 0x41f80000, 0x50000000, 0x0201f800, - 0x0010032f, 0x4d380000, 0x59300c07, 0x82040580, - 0x00000009, 0x04020006, 0x42027000, 0x00000047, - 0x0201f800, 0x00020b22, 0x80000580, 0x5c027000, - 0x1c01f000, 0x4c500000, 0x4a03900d, 0x00000001, - 0x59c8a020, 0x4a03900d, 0x00000002, 0x59c80820, - 0x8c50a52e, 0x04000002, 0x900409c0, 0x82040d00, - 0x0000ffff, 0x0201f800, 0x001065bc, 0x5c00a000, - 0x1c01f000, 0x42000000, 0x0010d528, 0x0201f800, - 0x0010c50a, 0x0401ffec, 0x0400005b, 0x4933c857, - 0x59300407, 0x82000580, 0x00000000, 0x04000056, - 0x59c82021, 0x4a03900d, 0x00000001, 0x59c82821, - 0x82142d00, 0x0000ffff, 0x59325809, 0x812e59c0, - 0x0400004d, 0x5932680a, 0x0201f800, 0x00104a92, - 0x02020800, 0x00109f32, 0x599c0019, 0x8c00050c, - 0x04020022, 0x0201f800, 0x00104a92, 0x0402001f, - 0x59300812, 0x4807c857, 0x592c0409, 0x8c00051c, - 0x04020018, 0x8400055c, 0x48025c09, 0x42000000, - 0x0010d4a4, 0x0201f800, 0x0010c50a, 0x592c0a05, - 0x82040d00, 0x000000ff, 0x82040580, 0x00000048, - 0x04000007, 0x82040580, 0x00000018, 0x04000004, - 0x82040580, 0x00000068, 0x04020006, 0x59300012, - 0x0201f800, 0x0010a6e6, 0x80000d40, 0x48065803, - 0x4a026012, 0x7fffffff, 0x59300008, 0x8c000516, - 0x04020021, 0x48166014, 0x0201f800, 0x00104a92, - 0x04000004, 0x59300415, 0x8c00051c, 0x04000004, - 0x599c0019, 0x8c00050c, 0x04000017, 0x0201f800, - 0x00100f5c, 0x04020014, 0x0401fa8f, 0x40280000, - 0x4802600e, 0x04000005, 0x4832600c, 0x50200000, - 0x4802600b, 0x4822600d, 0x59300415, 0x8c00051c, - 0x04020004, 0x599c0019, 0x8c00050c, 0x04020885, - 0x4a03900d, 0x00000040, 0x4a0370e5, 0x00000008, - 0x1c01f000, 0x42000000, 0x0010d536, 0x0201f800, - 0x0010c50a, 0x59880153, 0x80000000, 0x48031153, - 0x4a03900d, 0x00000040, 0x42000000, 0xc0000000, - 0x0201f000, 0x00020113, 0x4cf80000, 0x58f40000, - 0x8001f540, 0x0401f820, 0x41781800, 0x0401f935, - 0x04020014, 0x44140800, 0x0401f82a, 0x04000011, - 0x40043800, 0x42001800, 0x00000001, 0x40142000, - 0x0401f92c, 0x0402000b, 0x801c3800, 0x501c0000, - 0x44000800, 0x0401f810, 0x801c0580, 0x04000004, - 0x44103800, 0x801c3840, 0x44143800, 0x0401f819, - 0x5c01f000, 0x1c01f000, 0x80f9f1c0, 0x04020003, - 0x58f41202, 0x0401f003, 0x42001000, 0x00000007, - 0x1c01f000, 0x80f9f1c0, 0x04020006, 0x58f40401, - 0x82000480, 0x00000002, 0x80f40400, 0x0401f005, - 0x58f80401, 0x82000480, 0x00000002, 0x80f80400, - 0x50002800, 0x80000000, 0x50002000, 0x1c01f000, - 0x80f9f1c0, 0x04020008, 0x58f40401, 0x82000480, - 0x00000002, 0x02001800, 0x0010032f, 0x4801ec01, - 0x0401f00b, 0x58f80401, 0x82000480, 0x00000002, - 0x02001800, 0x0010032f, 0x4801f401, 0x82000580, - 0x00000002, 0x04020002, 0x0401f81b, 0x58f40202, - 0x80000040, 0x4801ea02, 0x02000800, 0x0010032f, - 0x82000580, 0x00000001, 0x1c01f000, 0x82f40580, - 0xffffffff, 0x0400000f, 0x58f40201, 0x82000580, - 0x0000dcb3, 0x02020800, 0x0010032f, 0x58f40000, - 0x8001f540, 0x04000006, 0x58f80201, 0x82000580, - 0x0000ddb9, 0x02020800, 0x0010032f, 0x0401f80a, - 0x1c01f000, 0x4d2c0000, 0x40fa5800, 0x0201f800, - 0x001005aa, 0x4979e800, 0x4179f000, 0x5c025800, - 0x1c01f000, 0x80f5e9c0, 0x04000009, 0x80f9f1c0, - 0x04020ff5, 0x4d2c0000, 0x40f65800, 0x0201f800, - 0x001005aa, 0x4179e800, 0x5c025800, 0x1c01f000, - 0x4cf40000, 0x0201f800, 0x00104a92, 0x04020036, - 0x59300808, 0x82040500, 0x00013100, 0x04020032, - 0x8c040d22, 0x04000032, 0x59300028, 0x8001ed40, - 0x02000800, 0x0010032f, 0x82000580, 0xffffffff, - 0x04000029, 0x58f40201, 0x82000580, 0x0000dcb3, - 0x02020800, 0x0010032f, 0x58f40a02, 0x82040500, - 0x0000fffe, 0x04000003, 0x0401ff74, 0x58f40a02, - 0x82040480, 0x0000000f, 0x04021095, 0x80040800, - 0x4805ea02, 0x82040580, 0x00000008, 0x04000099, - 0x82040480, 0x00000008, 0x0400100a, 0x58f40000, - 0x8001ed40, 0x02000800, 0x0010032f, 0x58f40201, - 0x82000580, 0x0000ddb9, 0x02020800, 0x0010032f, - 0x58f40401, 0x82000c00, 0x00000002, 0x4805ec01, - 0x80f40400, 0x59300813, 0x44040000, 0x80000000, - 0x45780000, 0x5c01e800, 0x1c01f000, 0x42001000, - 0x00000400, 0x59b800e4, 0x8c000524, 0x0402005f, - 0x4a0370e4, 0x00030000, 0x40000000, 0x59b800e4, - 0x8c000524, 0x04020057, 0x59300808, 0x84040d62, - 0x48066008, 0x4a0370e4, 0x00020000, 0x4d2c0000, - 0x0201f800, 0x00100584, 0x04000061, 0x492e6028, - 0x4a025a01, 0x0000dcb3, 0x59300009, 0x80001d40, - 0x02000800, 0x0010032f, 0x580c0810, 0x48065803, - 0x580c0205, 0x82000500, 0x000000ff, 0x82000580, - 0x00000068, 0x04020037, 0x580c1801, 0x800c19c0, - 0x02000800, 0x0010032f, 0x580c0c06, 0x82040d00, - 0x00000003, 0x82040580, 0x00000002, 0x04020003, - 0x592c0803, 0x0401f02b, 0x580c2a07, 0x580c0008, - 0x59301812, 0x800c0580, 0x0400002a, 0x82040580, - 0x00000000, 0x04000012, 0x40140000, 0x4c080000, - 0x400c1000, 0x41780800, 0x0201f800, 0x00107000, - 0x800409c0, 0x02020800, 0x0010032f, 0x82140c00, - 0x00000008, 0x0201f800, 0x00106fe1, 0x5c001000, - 0x40041800, 0x592c0803, 0x0401f022, 0x82140400, - 0x00000008, 0x4c080000, 0x400c1000, 0x41780800, - 0x0201f800, 0x00107000, 0x800409c0, 0x02020800, - 0x0010032f, 0x40140800, 0x0201f800, 0x00106fe1, - 0x5c001000, 0x40041800, 0x592c0803, 0x0401f011, - 0x59301812, 0x40040000, 0x800c0580, 0x0402000d, - 0x497a5a02, 0x4a025c01, 0x00000004, 0x0401f011, - 0x4a0370e4, 0x00020000, 0x40000000, 0x40000000, - 0x80081040, 0x02000800, 0x0010032f, 0x0401f79a, - 0x4a025a02, 0x00000001, 0x4a025c01, 0x00000006, - 0x497a5804, 0x400c0000, 0x80040480, 0x48025805, - 0x412de800, 0x5c025800, 0x0401f76d, 0x5c025800, - 0x4a026028, 0xffffffff, 0x0401f787, 0x4d2c0000, - 0x58f65800, 0x0201f800, 0x001005aa, 0x40f65800, - 0x0201f800, 0x001005aa, 0x5c025800, 0x0401f7f5, - 0x4d2c0000, 0x0201f800, 0x00100584, 0x040007f8, - 0x4a025a01, 0x0000ddb9, 0x4a025c01, 0x00000002, - 0x492de800, 0x412de800, 0x5c025800, 0x0401f769, - 0x0401fee2, 0x82f40400, 0x00000004, 0x800c0400, - 0x40000800, 0x50040000, 0x80100580, 0x04000016, - 0x82040c00, 0x00000002, 0x80081040, 0x040207fa, - 0x80f9f1c0, 0x04000011, 0x58f41202, 0x82081480, - 0x00000007, 0x82f80400, 0x00000002, 0x800c0400, - 0x40000800, 0x50040000, 0x80100580, 0x04000006, - 0x82040c00, 0x00000002, 0x80081040, 0x040207fa, - 0x0401f002, 0x1c01f000, 0x82000540, 0x00000001, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Mar 2 20:59:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10820F45873; Fri, 2 Mar 2018 20:59:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8F64781E3; Fri, 2 Mar 2018 20:59:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF9621C909; Fri, 2 Mar 2018 20:59:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22KxaEC020222; Fri, 2 Mar 2018 20:59:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22KxaCZ020221; Fri, 2 Mar 2018 20:59:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803022059.w22KxaCZ020221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Mar 2018 20:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330293 - head/sys/modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 330293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 20:59:37 -0000 Author: manu Date: Fri Mar 2 20:59:36 2018 New Revision: 330293 URL: https://svnweb.freebsd.org/changeset/base/330293 Log: dtb/allwinner: Build sun8i-h3-nanopi-m1-plus.dts We have a u-boot port for this board so add the dtb to the build. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Fri Mar 2 19:50:41 2018 (r330292) +++ head/sys/modules/dtb/allwinner/Makefile Fri Mar 2 20:59:36 2018 (r330293) @@ -14,6 +14,7 @@ DTS= \ sun8i-a83t-bananapi-m3.dts \ sun8i-h2-plus-orangepi-zero.dts \ sun8i-h3-nanopi-m1.dts \ + sun8i-h3-nanopi-m1-plus.dts \ sun8i-h3-nanopi-neo.dts \ sun8i-h3-orangepi-one.dts \ sun8i-h3-orangepi-plus2e.dts From owner-svn-src-head@freebsd.org Fri Mar 2 21:26:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1F37F4708A; Fri, 2 Mar 2018 21:26:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8126E79634; Fri, 2 Mar 2018 21:26:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBF091CE04; Fri, 2 Mar 2018 21:26:27 +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 w22LQRSG034840; Fri, 2 Mar 2018 21:26:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22LQRKH034839; Fri, 2 Mar 2018 21:26:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201803022126.w22LQRKH034839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 2 Mar 2018 21:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330294 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:26:32 -0000 Author: mjg Date: Fri Mar 2 21:26:27 2018 New Revision: 330294 URL: https://svnweb.freebsd.org/changeset/base/330294 Log: sx: fix adaptive spinning broken in r327397 The condition was flipped. In particular heavy multithreaded kernel builds on zfs started suffering due to nested sx locks. For instance make -s -j 128 buildkernel: before: 3326.67s user 1269.62s system 6981% cpu 1:05.84 total after: 3365.55s user 911.27s system 6871% cpu 1:02.24 total ps. .-'---`-. .-'---`-. ,' `. ,' `. | \ | \ | \ | \ \ _ \ \ _ \ ,\ _ ,'-,/-)\ ,\ _ ,'-,/-)\ ( * \ \,' ,' ,'-) ( * \ \,' ,' ,'-) `._,) -',-') `._,) -',-') \/ ''/ \/ ''/ ) / / ) / / / ,'-' / ,'-' Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Fri Mar 2 20:59:36 2018 (r330293) +++ head/sys/kern/kern_sx.c Fri Mar 2 21:26:27 2018 (r330294) @@ -584,7 +584,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO sx->lock_object.lo_name, (void *)sx->sx_lock, file, line); #ifdef ADAPTIVE_SX - adaptive = ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0); + adaptive = ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0); #endif #ifdef HWPMC_HOOKS @@ -937,7 +937,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO #endif #ifdef ADAPTIVE_SX - adaptive = ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0); + adaptive = ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0); #endif #ifdef HWPMC_HOOKS From owner-svn-src-head@freebsd.org Fri Mar 2 21:26:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CB3DF470E6; Fri, 2 Mar 2018 21:26:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA2C797E1; Fri, 2 Mar 2018 21:26:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 259181CE05; Fri, 2 Mar 2018 21:26:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22LQmU9034896; Fri, 2 Mar 2018 21:26:48 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22LQmt0034895; Fri, 2 Mar 2018 21:26:48 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803022126.w22LQmt0034895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 2 Mar 2018 21:26:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330295 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 330295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:26:49 -0000 Author: asomers Date: Fri Mar 2 21:26:48 2018 New Revision: 330295 URL: https://svnweb.freebsd.org/changeset/base/330295 Log: ZFS: fix adding vdevs to very large pools r323791 changed the return value of zpool_read_label. Error paths that previously returned 0 began to return -1 instead. However, not all error paths initialized errno. When adding vdevs to a very large pool, errno could be prepopulated with ENOMEM, causing the operation to fail. Fix the bug by setting errno=ENOENT in the case that no ZFS label is found. PR: 226096 Submitted by: Nikita Kozlov Reviewed by: avg MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13088 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Mar 2 21:26:27 2018 (r330294) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Mar 2 21:26:48 2018 (r330295) @@ -923,6 +923,7 @@ zpool_read_label(int fd, nvlist_t **config) free(label); *config = NULL; + errno = ENOENT; return (-1); } From owner-svn-src-head@freebsd.org Fri Mar 2 21:49:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC70CF24CF1; Fri, 2 Mar 2018 21:49:07 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::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 77DD27ABBC; Fri, 2 Mar 2018 21:49:07 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id t6so13703702qtn.9; Fri, 02 Mar 2018 13:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gGHgcTUlV93Q8V0/C7BefpOHMXLk/3d1Sr7J9b/NyQc=; b=EZ1aWcW4qmT5gdbixv/RypWucnT7Gb3C4qogYbGd9xxi/iVl1H0ZclLA82ZWXhyZwE ZbsIxZL43Poa7AQepWw3gc6pFi34OTiuI2nxd4446gmwjKgw92nq375BegYObusyd/dP +yZdFsoOe31TsdTaz2VXpo4z9uInrHCzyCGpKVzqIaKHNrbyA6oHCSZG0x18oFOpM5g0 YaTPj0FaMV6+m3/X/5mEpZNaVIJ3IcTh00bBcruv9vYfn6+t8z9NeykN1s7qT69fh+xP YwfhlcsSnAGXOHSj9aZuiHW/LUN+7P0xU/Wl5tFQ4LLOXSwKC2vkzlRl+tEw4OOIl+Xo Lf0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gGHgcTUlV93Q8V0/C7BefpOHMXLk/3d1Sr7J9b/NyQc=; b=J/yyTwMuMoawjFy5lrOGnT3w/HasGYu/3WqFPFy1gshe7GnPOAsyvz3B1kJackcCYG vTY7Vxn/zZijYKJoLrivmZ74EdOC5/Qqtzx3FSR1L3FUxIrdP8FMtEKpQBRUEqtCHAdQ WkYTdirNE0bViaTIhcX9/spaPJv+ZHvHkm+YuPMm0MtYnorY8feAitPhVKqdhENNzQ6M NASRd7131PkyQI97q5TjKrY80zLp/0nVGmsKJac84hpekm41AhtoIWSs0qrfnM4qDTvm auN+T/mmDeWt3duwFY+5bEFZ9SiKoPd0pMpUL/TY0xuCRh0J7s1txkzunuMqW7g69eWU w6Nw== X-Gm-Message-State: AElRT7FXviwvO0FsFQ5itftvx44NpZf5p3Ze0dg/0wM2D9gz7rQ6Mp3Q 8CWGoJlvoC4WSWH8D3SvXXIvs+2ExcCkuMvk4tRK9w== X-Google-Smtp-Source: AG47ELvG6U8J2YtxhjQbFffHKIfv6YKsaWCIgXWqMX1YmPqbgNmb8gAawzc1NmIjFAX6tFew0vNWYZUCyuqo22M1g0s= X-Received: by 10.200.27.2 with SMTP id y2mr11006834qtj.161.1520027346963; Fri, 02 Mar 2018 13:49:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.35.42 with HTTP; Fri, 2 Mar 2018 13:49:06 -0800 (PST) In-Reply-To: <201803022126.w22LQRKH034839@repo.freebsd.org> References: <201803022126.w22LQRKH034839@repo.freebsd.org> From: Mateusz Guzik Date: Fri, 2 Mar 2018 22:49:06 +0100 Message-ID: Subject: Re: svn commit: r330294 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:49:08 -0000 On Fri, Mar 2, 2018 at 10:26 PM, Mateusz Guzik wrote: > Author: mjg > Date: Fri Mar 2 21:26:27 2018 > New Revision: 330294 > URL: https://svnweb.freebsd.org/changeset/base/330294 > > Log: > sx: fix adaptive spinning broken in r327397 > > The condition was flipped. > > In particular heavy multithreaded kernel builds on zfs started suffering > due to nested sx locks. > > For instance make -s -j 128 buildkernel: > > before: 3326.67s user 1269.62s system 6981% cpu 1:05.84 total > after: 3365.55s user 911.27s system 6871% cpu 1:02.24 total > > ps. > .-'---`-. .-'---`-. > ,' `. ,' `. > | \ | \ > | \ | \ > \ _ \ \ _ \ > ,\ _ ,'-,/-)\ ,\ _ ,'-,/-)\ > ( * \ \,' ,' ,'-) ( * \ \,' ,' ,'-) > `._,) -',-') `._,) -',-') > \/ ''/ \/ ''/ > ) / / ) / / > / ,'-' / ,'-' > For some reason some people have non-fixed size fonts and keep asking what this is. It's not a squirrel, Admiral Ackbar nor a failed attempt at ascii art. The svnweb version provides a nice view: https://svnweb.freebsd.org/base?view=revision&revision=330294 Courtesy of http://www.asciifacepalm.com/ -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Mar 2 22:10:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30A51F26B21; Fri, 2 Mar 2018 22:10:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1A567BD62; Fri, 2 Mar 2018 22:10:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC7A01D4E4; Fri, 2 Mar 2018 22:10:49 +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 w22MAnCc055148; Fri, 2 Mar 2018 22:10:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22MAnob055140; Fri, 2 Mar 2018 22:10:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803022210.w22MAnob055140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Mar 2018 22:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys X-SVN-Commit-Revision: 330297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:10:50 -0000 Author: brooks Date: Fri Mar 2 22:10:48 2018 New Revision: 330297 URL: https://svnweb.freebsd.org/changeset/base/330297 Log: Rename kernel-only members of semid_ds and msgid_ds. This deliberately breaks the API in preperation for future syscall revisions which will remove these nonstandard members. In an exp-run a single port (devel/qemu-user-static) was found to use them which it did becuase it emulates system calls. This has been fixed in the ports tree. PR: 224443 (exp-run) Reviewed by: kib, jhb (previous version) Exp-run by: antoine Sponsored by: DARPA, AFRP Differential Revision: https://reviews.freebsd.org/D14490 Modified: head/lib/libc/sys/msgctl.2 head/lib/libc/sys/semctl.2 head/sys/compat/freebsd32/freebsd32_ipc.h head/sys/i386/ibcs2/ibcs2_ipc.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/sys/msg.h head/sys/sys/sem.h Modified: head/lib/libc/sys/msgctl.2 ============================================================================== --- head/lib/libc/sys/msgctl.2 Fri Mar 2 21:50:02 2018 (r330296) +++ head/lib/libc/sys/msgctl.2 Fri Mar 2 22:10:48 2018 (r330297) @@ -63,8 +63,8 @@ and contains (amongst others) the following members: .Bd -literal struct msqid_ds { struct ipc_perm msg_perm; /* msg queue permission bits */ - struct msg *msg_first; /* first message in the queue */ - struct msg *msg_last; /* last message in the queue */ + struct msg *__msg_first; /* kernel data, don't use */ + struct msg *__msg_last; /* kernel data, don't use */ msglen_t msg_cbytes; /* number of bytes in use on the queue */ msgqnum_t msg_qnum; /* number of msgs in the queue */ msglen_t msg_qbytes; /* max # of bytes on the queue */ Modified: head/lib/libc/sys/semctl.2 ============================================================================== --- head/lib/libc/sys/semctl.2 Fri Mar 2 21:50:02 2018 (r330296) +++ head/lib/libc/sys/semctl.2 Fri Mar 2 22:10:48 2018 (r330297) @@ -145,7 +145,7 @@ is defined as follows: .Bd -literal struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ - struct sem *sem_base; /* pointer to first semaphore in set */ + struct sem *__sem_base; /* kernel data, don't use */ u_short sem_nsems; /* number of sems in set */ time_t sem_otime; /* last operation time */ time_t sem_ctime; /* last change time */ Modified: head/sys/compat/freebsd32/freebsd32_ipc.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ipc.h Fri Mar 2 21:50:02 2018 (r330296) +++ head/sys/compat/freebsd32/freebsd32_ipc.h Fri Mar 2 22:10:48 2018 (r330297) @@ -43,7 +43,7 @@ struct ipc_perm32 { struct semid_ds32 { struct ipc_perm32 sem_perm; - uint32_t sem_base; + uint32_t __sem_base; unsigned short sem_nsems; int32_t sem_otime; int32_t sem_ctime; @@ -69,8 +69,8 @@ union semun32 { struct msqid_ds32 { struct ipc_perm32 msg_perm; - uint32_t msg_first; - uint32_t msg_last; + uint32_t __msg_first; + uint32_t __msg_last; uint32_t msg_cbytes; uint32_t msg_qnum; uint32_t msg_qbytes; @@ -143,7 +143,7 @@ struct ipc_perm32_old { struct semid_ds32_old { struct ipc_perm32_old sem_perm; - uint32_t sem_base; + uint32_t __sem_base; unsigned short sem_nsems; int32_t sem_otime; int32_t sem_pad1; @@ -154,8 +154,8 @@ struct semid_ds32_old { struct msqid_ds32_old { struct ipc_perm32_old msg_perm; - uint32_t msg_first; - uint32_t msg_last; + uint32_t __msg_first; + uint32_t __msg_last; uint32_t msg_cbytes; uint32_t msg_qnum; uint32_t msg_qbytes; Modified: head/sys/i386/ibcs2/ibcs2_ipc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_ipc.c Fri Mar 2 21:50:02 2018 (r330296) +++ head/sys/i386/ibcs2/ibcs2_ipc.c Fri Mar 2 22:10:48 2018 (r330297) @@ -73,9 +73,8 @@ cvt_msqid2imsqid(bp, ibp) struct msqid_ds *bp; struct ibcs2_msqid_ds *ibp; { + memset(ibp, 0, sizeof(*ibp)); cvt_perm2iperm(&bp->msg_perm, &ibp->msg_perm); - ibp->msg_first = bp->msg_first; - ibp->msg_last = bp->msg_last; ibp->msg_cbytes = (u_short)bp->msg_cbytes; ibp->msg_qnum = (u_short)bp->msg_qnum; ibp->msg_qbytes = (u_short)bp->msg_qbytes; @@ -93,8 +92,6 @@ struct ibcs2_msqid_ds *ibp; struct msqid_ds *bp; { cvt_iperm2perm(&ibp->msg_perm, &bp->msg_perm); - bp->msg_first = ibp->msg_first; - bp->msg_last = ibp->msg_last; bp->msg_cbytes = ibp->msg_cbytes; bp->msg_qnum = ibp->msg_qnum; bp->msg_qbytes = ibp->msg_qbytes; @@ -283,8 +280,8 @@ cvt_semid2isemid(bp, ibp) struct semid_ds *bp; struct ibcs2_semid_ds *ibp; { + memset(ibp, 0, sizeof(*ibp); cvt_perm2iperm(&bp->sem_perm, &ibp->sem_perm); - ibp->sem_base = (struct ibcs2_sem *)bp->sem_base; ibp->sem_nsems = bp->sem_nsems; ibp->sem_otime = bp->sem_otime; ibp->sem_ctime = bp->sem_ctime; @@ -297,7 +294,6 @@ struct ibcs2_semid_ds *ibp; struct semid_ds *bp; { cvt_iperm2perm(&ibp->sem_perm, &bp->sem_perm); - bp->sem_base = (struct sem *)ibp->sem_base; bp->sem_nsems = ibp->sem_nsems; bp->sem_otime = ibp->sem_otime; bp->sem_ctime = ibp->sem_ctime; Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Fri Mar 2 21:50:02 2018 (r330296) +++ head/sys/kern/sysv_msg.c Fri Mar 2 22:10:48 2018 (r330297) @@ -425,7 +425,7 @@ msq_remove(struct msqid_kernel *msqkptr) msqkptr->cred = NULL; /* Free the message headers */ - msghdr = msqkptr->u.msg_first; + msghdr = msqkptr->u.__msg_first; while (msghdr != NULL) { struct msg *msghdr_tmp; @@ -573,7 +573,7 @@ kern_msgctl(td, msqid, cmd, msqbuf) * thread cannot free a certain msghdr. The msq will get * into an inconsistent state. */ - for (msghdr = msqkptr->u.msg_first; msghdr != NULL; + for (msghdr = msqkptr->u.__msg_first; msghdr != NULL; msghdr = msghdr->msg_next) { error = mac_sysvmsq_check_msgrmid(td->td_ucred, msghdr); if (error != 0) @@ -731,8 +731,8 @@ sys_msgget(struct thread *td, struct msgget_args *uap) msqkptr->cred = crhold(cred); /* Make sure that the returned msqid is unique */ msqkptr->u.msg_perm.seq = (msqkptr->u.msg_perm.seq + 1) & 0x7fff; - msqkptr->u.msg_first = NULL; - msqkptr->u.msg_last = NULL; + msqkptr->u.__msg_first = NULL; + msqkptr->u.__msg_last = NULL; msqkptr->u.msg_cbytes = 0; msqkptr->u.msg_qnum = 0; msqkptr->u.msg_qbytes = msginfo.msgmnb; @@ -1079,14 +1079,14 @@ kern_msgsnd(struct thread *td, int msqid, const void * /* * Put the message into the queue */ - if (msqkptr->u.msg_first == NULL) { - msqkptr->u.msg_first = msghdr; - msqkptr->u.msg_last = msghdr; + if (msqkptr->u.__msg_first == NULL) { + msqkptr->u.__msg_first = msghdr; + msqkptr->u.__msg_last = msghdr; } else { - msqkptr->u.msg_last->msg_next = msghdr; - msqkptr->u.msg_last = msghdr; + msqkptr->u.__msg_last->msg_next = msghdr; + msqkptr->u.__msg_last = msghdr; } - msqkptr->u.msg_last->msg_next = NULL; + msqkptr->u.__msg_last->msg_next = NULL; msqkptr->u.msg_cbytes += msghdr->msg_ts; msqkptr->u.msg_qnum++; @@ -1194,7 +1194,7 @@ kern_msgrcv(struct thread *td, int msqid, void *msgp, msghdr = NULL; while (msghdr == NULL) { if (msgtyp == 0) { - msghdr = msqkptr->u.msg_first; + msghdr = msqkptr->u.__msg_first; if (msghdr != NULL) { if (msgsz < msghdr->msg_ts && (msgflg & MSG_NOERROR) == 0) { @@ -1210,12 +1210,13 @@ kern_msgrcv(struct thread *td, int msqid, void *msgp, if (error != 0) goto done2; #endif - if (msqkptr->u.msg_first == msqkptr->u.msg_last) { - msqkptr->u.msg_first = NULL; - msqkptr->u.msg_last = NULL; + if (msqkptr->u.__msg_first == + msqkptr->u.__msg_last) { + msqkptr->u.__msg_first = NULL; + msqkptr->u.__msg_last = NULL; } else { - msqkptr->u.msg_first = msghdr->msg_next; - if (msqkptr->u.msg_first == NULL) + msqkptr->u.__msg_first = msghdr->msg_next; + if (msqkptr->u.__msg_first == NULL) panic("msg_first/last screwed up #1"); } } @@ -1224,7 +1225,7 @@ kern_msgrcv(struct thread *td, int msqid, void *msgp, struct msg **prev; previous = NULL; - prev = &(msqkptr->u.msg_first); + prev = &(msqkptr->u.__msg_first); while ((msghdr = *prev) != NULL) { /* * Is this message's type an exact match or is @@ -1256,20 +1257,20 @@ kern_msgrcv(struct thread *td, int msqid, void *msgp, goto done2; #endif *prev = msghdr->msg_next; - if (msghdr == msqkptr->u.msg_last) { + if (msghdr == msqkptr->u.__msg_last) { if (previous == NULL) { if (prev != - &msqkptr->u.msg_first) - panic("msg_first/last screwed up #2"); - msqkptr->u.msg_first = + &msqkptr->u.__msg_first) + panic("__msg_first/last screwed up #2"); + msqkptr->u.__msg_first = NULL; - msqkptr->u.msg_last = + msqkptr->u.__msg_last = NULL; } else { if (prev == - &msqkptr->u.msg_first) - panic("msg_first/last screwed up #3"); - msqkptr->u.msg_last = + &msqkptr->u.__msg_first) + panic("__msg_first/last screwed up #3"); + msqkptr->u.__msg_last = previous; } } @@ -1461,8 +1462,8 @@ sysctl_msqids(SYSCTL_HANDLER_ARGS) #endif { /* Don't leak kernel pointers */ - tmsqk.u.msg_first = NULL; - tmsqk.u.msg_last = NULL; + tmsqk.u.__msg_first = NULL; + tmsqk.u.__msg_last = NULL; tmsqk.label = NULL; tmsqk.cred = NULL; /* @@ -1713,8 +1714,8 @@ freebsd7_freebsd32_msgctl(struct thread *td, if (error) return (error); freebsd32_ipcperm_old_in(&msqbuf32.msg_perm, &msqbuf.msg_perm); - PTRIN_CP(msqbuf32, msqbuf, msg_first); - PTRIN_CP(msqbuf32, msqbuf, msg_last); + PTRIN_CP(msqbuf32, msqbuf, __msg_first); + PTRIN_CP(msqbuf32, msqbuf, __msg_last); CP(msqbuf32, msqbuf, msg_cbytes); CP(msqbuf32, msqbuf, msg_qnum); CP(msqbuf32, msqbuf, msg_qbytes); @@ -1730,8 +1731,8 @@ freebsd7_freebsd32_msgctl(struct thread *td, if (uap->cmd == IPC_STAT) { bzero(&msqbuf32, sizeof(msqbuf32)); freebsd32_ipcperm_old_out(&msqbuf.msg_perm, &msqbuf32.msg_perm); - PTROUT_CP(msqbuf, msqbuf32, msg_first); - PTROUT_CP(msqbuf, msqbuf32, msg_last); + PTROUT_CP(msqbuf, msqbuf32, __msg_first); + PTROUT_CP(msqbuf, msqbuf32, __msg_last); CP(msqbuf, msqbuf32, msg_cbytes); CP(msqbuf, msqbuf32, msg_qnum); CP(msqbuf, msqbuf32, msg_qbytes); @@ -1758,8 +1759,8 @@ freebsd32_msgctl(struct thread *td, struct freebsd32_m if (error) return (error); freebsd32_ipcperm_in(&msqbuf32.msg_perm, &msqbuf.msg_perm); - PTRIN_CP(msqbuf32, msqbuf, msg_first); - PTRIN_CP(msqbuf32, msqbuf, msg_last); + PTRIN_CP(msqbuf32, msqbuf, __msg_first); + PTRIN_CP(msqbuf32, msqbuf, __msg_last); CP(msqbuf32, msqbuf, msg_cbytes); CP(msqbuf32, msqbuf, msg_qnum); CP(msqbuf32, msqbuf, msg_qbytes); @@ -1774,8 +1775,8 @@ freebsd32_msgctl(struct thread *td, struct freebsd32_m return (error); if (uap->cmd == IPC_STAT) { freebsd32_ipcperm_out(&msqbuf.msg_perm, &msqbuf32.msg_perm); - PTROUT_CP(msqbuf, msqbuf32, msg_first); - PTROUT_CP(msqbuf, msqbuf32, msg_last); + PTROUT_CP(msqbuf, msqbuf32, __msg_first); + PTROUT_CP(msqbuf, msqbuf32, __msg_last); CP(msqbuf, msqbuf32, msg_cbytes); CP(msqbuf, msqbuf32, msg_qnum); CP(msqbuf, msqbuf32, msg_qbytes); @@ -1883,8 +1884,8 @@ freebsd7_msgctl(struct thread *td, struct freebsd7_msg if (error) return (error); ipcperm_old2new(&msqold.msg_perm, &msqbuf.msg_perm); - CP(msqold, msqbuf, msg_first); - CP(msqold, msqbuf, msg_last); + CP(msqold, msqbuf, __msg_first); + CP(msqold, msqbuf, __msg_last); CP(msqold, msqbuf, msg_cbytes); CP(msqold, msqbuf, msg_qnum); CP(msqold, msqbuf, msg_qbytes); @@ -1900,8 +1901,8 @@ freebsd7_msgctl(struct thread *td, struct freebsd7_msg if (uap->cmd == IPC_STAT) { bzero(&msqold, sizeof(msqold)); ipcperm_new2old(&msqbuf.msg_perm, &msqold.msg_perm); - CP(msqbuf, msqold, msg_first); - CP(msqbuf, msqold, msg_last); + CP(msqbuf, msqold, __msg_first); + CP(msqbuf, msqold, __msg_last); CP(msqbuf, msqold, msg_cbytes); CP(msqbuf, msqold, msg_qnum); CP(msqbuf, msqold, msg_qbytes); Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Fri Mar 2 21:50:02 2018 (r330296) +++ head/sys/kern/sysv_sem.c Fri Mar 2 22:10:48 2018 (r330297) @@ -287,7 +287,7 @@ seminit(void) semu = malloc(seminfo.semmnu * seminfo.semusz, M_SEM, M_WAITOK); for (i = 0; i < seminfo.semmni; i++) { - sema[i].u.sem_base = 0; + sema[i].u.__sem_base = 0; sema[i].u.sem_perm.mode = 0; sema[i].u.sem_perm.seq = 0; #ifdef MAC @@ -576,15 +576,15 @@ sem_remove(int semidx, struct ucred *cred) wakeup(semakptr); for (i = 0; i < seminfo.semmni; i++) { if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && - sema[i].u.sem_base > semakptr->u.sem_base) + sema[i].u.__sem_base > semakptr->u.__sem_base) mtx_lock_flags(&sema_mtx[i], LOP_DUPOK); } - for (i = semakptr->u.sem_base - sem; i < semtot; i++) + for (i = semakptr->u.__sem_base - sem; i < semtot; i++) sem[i] = sem[i + semakptr->u.sem_nsems]; for (i = 0; i < seminfo.semmni; i++) { if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && - sema[i].u.sem_base > semakptr->u.sem_base) { - sema[i].u.sem_base -= semakptr->u.sem_nsems; + sema[i].u.__sem_base > semakptr->u.__sem_base) { + sema[i].u.__sem_base -= semakptr->u.sem_nsems; mtx_unlock(&sema_mtx[i]); } } @@ -802,7 +802,7 @@ kern_semctl(struct thread *td, int semid, int semnum, error = EINVAL; goto done2; } - *rval = semakptr->u.sem_base[semnum].semncnt; + *rval = semakptr->u.__sem_base[semnum].semncnt; break; case GETPID: @@ -814,7 +814,7 @@ kern_semctl(struct thread *td, int semid, int semnum, error = EINVAL; goto done2; } - *rval = semakptr->u.sem_base[semnum].sempid; + *rval = semakptr->u.__sem_base[semnum].sempid; break; case GETVAL: @@ -826,7 +826,7 @@ kern_semctl(struct thread *td, int semid, int semnum, error = EINVAL; goto done2; } - *rval = semakptr->u.sem_base[semnum].semval; + *rval = semakptr->u.__sem_base[semnum].semval; break; case GETALL: @@ -860,7 +860,7 @@ kern_semctl(struct thread *td, int semid, int semnum, if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) goto done2; for (i = 0; i < semakptr->u.sem_nsems; i++) - array[i] = semakptr->u.sem_base[i].semval; + array[i] = semakptr->u.__sem_base[i].semval; mtx_unlock(sema_mtxp); error = copyout(array, arg->array, count * sizeof(*array)); mtx_lock(sema_mtxp); @@ -875,7 +875,7 @@ kern_semctl(struct thread *td, int semid, int semnum, error = EINVAL; goto done2; } - *rval = semakptr->u.sem_base[semnum].semzcnt; + *rval = semakptr->u.__sem_base[semnum].semzcnt; break; case SETVAL: @@ -891,7 +891,7 @@ kern_semctl(struct thread *td, int semid, int semnum, error = ERANGE; goto done2; } - semakptr->u.sem_base[semnum].semval = arg->val; + semakptr->u.__sem_base[semnum].semval = arg->val; SEMUNDO_LOCK(); semundo_clear(semidx, semnum); SEMUNDO_UNLOCK(); @@ -921,7 +921,7 @@ kern_semctl(struct thread *td, int semid, int semnum, error = ERANGE; break; } - semakptr->u.sem_base[i].semval = usval; + semakptr->u.__sem_base[i].semval = usval; } SEMUNDO_LOCK(); semundo_clear(semidx, -1); @@ -1052,16 +1052,16 @@ sys_semget(struct thread *td, struct semget_args *uap) sema[semid].u.sem_nsems = nsems; sema[semid].u.sem_otime = 0; sema[semid].u.sem_ctime = time_second; - sema[semid].u.sem_base = &sem[semtot]; + sema[semid].u.__sem_base = &sem[semtot]; semtot += nsems; - bzero(sema[semid].u.sem_base, - sizeof(sema[semid].u.sem_base[0])*nsems); + bzero(sema[semid].u.__sem_base, + sizeof(sema[semid].u.__sem_base[0])*nsems); #ifdef MAC mac_sysvsem_create(cred, &sema[semid]); #endif mtx_unlock(&sema_mtx[semid]); DPRINTF(("sembase = %p, next = %p\n", - sema[semid].u.sem_base, &sem[semtot])); + sema[semid].u.__sem_base, &sem[semtot])); } else { DPRINTF(("didn't find it and wasn't asked to create it\n")); error = ENOENT; @@ -1204,12 +1204,12 @@ sys_semop(struct thread *td, struct semop_args *uap) for (i = 0; i < nsops; i++) { sopptr = &sops[i]; - semptr = &semakptr->u.sem_base[sopptr->sem_num]; + semptr = &semakptr->u.__sem_base[sopptr->sem_num]; DPRINTF(( - "semop: semakptr=%p, sem_base=%p, " + "semop: semakptr=%p, __sem_base=%p, " "semptr=%p, sem[%d]=%d : op=%d, flag=%s\n", - semakptr, semakptr->u.sem_base, semptr, + semakptr, semakptr->u.__sem_base, semptr, sopptr->sem_num, semptr->semval, sopptr->sem_op, (sopptr->sem_flg & IPC_NOWAIT) ? "nowait" : "wait")); @@ -1251,7 +1251,7 @@ sys_semop(struct thread *td, struct semop_args *uap) */ DPRINTF(("semop: rollback 0 through %d\n", i-1)); for (j = 0; j < i; j++) - semakptr->u.sem_base[sops[j].sem_num].semval -= + semakptr->u.__sem_base[sops[j].sem_num].semval -= sops[j].sem_op; /* If we detected an error, return it */ @@ -1290,10 +1290,10 @@ sys_semop(struct thread *td, struct semop_args *uap) /* * Renew the semaphore's pointer after wakeup since - * during msleep sem_base may have been modified and semptr + * during msleep __sem_base may have been modified and semptr * is not valid any more */ - semptr = &semakptr->u.sem_base[sopptr->sem_num]; + semptr = &semakptr->u.__sem_base[sopptr->sem_num]; /* * The semaphore is still alive. Readjust the count of @@ -1362,7 +1362,7 @@ done: } for (j = 0; j < nsops; j++) - semakptr->u.sem_base[sops[j].sem_num].semval -= + semakptr->u.__sem_base[sops[j].sem_num].semval -= sops[j].sem_op; DPRINTF(("error = %d from semundo_adjust\n", error)); @@ -1375,7 +1375,7 @@ done: /* We're definitely done - set the sempid's and time */ for (i = 0; i < nsops; i++) { sopptr = &sops[i]; - semptr = &semakptr->u.sem_base[sopptr->sem_num]; + semptr = &semakptr->u.__sem_base[sopptr->sem_num]; semptr->sempid = td->td_proc->p_pid; } semakptr->u.sem_otime = time_second; @@ -1458,13 +1458,13 @@ semexit_myhook(void *arg, struct proc *p) suptr->un_proc, suptr->un_ent[ix].un_id, suptr->un_ent[ix].un_num, suptr->un_ent[ix].un_adjval, - semakptr->u.sem_base[semnum].semval)); + semakptr->u.__sem_base[semnum].semval)); - if (adjval < 0 && semakptr->u.sem_base[semnum].semval < + if (adjval < 0 && semakptr->u.__sem_base[semnum].semval < -adjval) - semakptr->u.sem_base[semnum].semval = 0; + semakptr->u.__sem_base[semnum].semval = 0; else - semakptr->u.sem_base[semnum].semval += adjval; + semakptr->u.__sem_base[semnum].semval += adjval; wakeup(semakptr); DPRINTF(("semexit: back from wakeup\n")); @@ -1514,7 +1514,7 @@ sysctl_sema(SYSCTL_HANDLER_ARGS) bzero(&tsemak32, sizeof(tsemak32)); freebsd32_ipcperm_out(&tsemak.u.sem_perm, &tsemak32.u.sem_perm); - /* Don't copy u.sem_base */ + /* Don't copy u.__sem_base */ CP(tsemak, tsemak32, u.sem_nsems); CP(tsemak, tsemak32, u.sem_otime); CP(tsemak, tsemak32, u.sem_ctime); @@ -1524,7 +1524,7 @@ sysctl_sema(SYSCTL_HANDLER_ARGS) } else #endif { - tsemak.u.sem_base = NULL; + tsemak.u.__sem_base = NULL; tsemak.label = NULL; tsemak.cred = NULL; outaddr = &tsemak; @@ -1791,7 +1791,7 @@ freebsd7___semctl(struct thread *td, struct freebsd7__ if (error) return (error); ipcperm_old2new(&dsold.sem_perm, &dsbuf.sem_perm); - CP(dsold, dsbuf, sem_base); + CP(dsold, dsbuf, __sem_base); CP(dsold, dsbuf, sem_nsems); CP(dsold, dsbuf, sem_otime); CP(dsold, dsbuf, sem_ctime); @@ -1816,7 +1816,7 @@ freebsd7___semctl(struct thread *td, struct freebsd7__ case IPC_STAT: bzero(&dsold, sizeof(dsold)); ipcperm_new2old(&dsbuf.sem_perm, &dsold.sem_perm); - CP(dsbuf, dsold, sem_base); + CP(dsbuf, dsold, __sem_base); CP(dsbuf, dsold, sem_nsems); CP(dsbuf, dsold, sem_otime); CP(dsbuf, dsold, sem_ctime); @@ -1888,7 +1888,7 @@ freebsd7_freebsd32_semctl(struct thread *td, if (error) return (error); freebsd32_ipcperm_old_in(&dsbuf32.sem_perm, &dsbuf.sem_perm); - PTRIN_CP(dsbuf32, dsbuf, sem_base); + PTRIN_CP(dsbuf32, dsbuf, __sem_base); CP(dsbuf32, dsbuf, sem_nsems); CP(dsbuf32, dsbuf, sem_otime); CP(dsbuf32, dsbuf, sem_ctime); @@ -1913,7 +1913,7 @@ freebsd7_freebsd32_semctl(struct thread *td, case IPC_STAT: bzero(&dsbuf32, sizeof(dsbuf32)); freebsd32_ipcperm_old_out(&dsbuf.sem_perm, &dsbuf32.sem_perm); - PTROUT_CP(dsbuf, dsbuf32, sem_base); + PTROUT_CP(dsbuf, dsbuf32, __sem_base); CP(dsbuf, dsbuf32, sem_nsems); CP(dsbuf, dsbuf32, sem_otime); CP(dsbuf, dsbuf32, sem_ctime); @@ -1960,7 +1960,7 @@ freebsd32_semctl(struct thread *td, struct freebsd32_s if (error) return (error); freebsd32_ipcperm_in(&dsbuf32.sem_perm, &dsbuf.sem_perm); - PTRIN_CP(dsbuf32, dsbuf, sem_base); + PTRIN_CP(dsbuf32, dsbuf, __sem_base); CP(dsbuf32, dsbuf, sem_nsems); CP(dsbuf32, dsbuf, sem_otime); CP(dsbuf32, dsbuf, sem_ctime); @@ -1985,7 +1985,7 @@ freebsd32_semctl(struct thread *td, struct freebsd32_s case IPC_STAT: bzero(&dsbuf32, sizeof(dsbuf32)); freebsd32_ipcperm_out(&dsbuf.sem_perm, &dsbuf32.sem_perm); - PTROUT_CP(dsbuf, dsbuf32, sem_base); + PTROUT_CP(dsbuf, dsbuf32, __sem_base); CP(dsbuf, dsbuf32, sem_nsems); CP(dsbuf, dsbuf32, sem_otime); CP(dsbuf, dsbuf32, sem_ctime); Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Fri Mar 2 21:50:02 2018 (r330296) +++ head/sys/sys/msg.h Fri Mar 2 22:10:48 2018 (r330297) @@ -64,8 +64,8 @@ typedef __time_t time_t; defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) struct msqid_ds_old { struct ipc_perm_old msg_perm; /* msg queue permission bits */ - struct msg *msg_first; /* first message in the queue */ - struct msg *msg_last; /* last message in the queue */ + struct msg *__msg_first; /* first message in the queue */ + struct msg *__msg_last; /* last message in the queue */ msglen_t msg_cbytes; /* number of bytes in use on the queue */ msgqnum_t msg_qnum; /* number of msgs in the queue */ msglen_t msg_qbytes; /* max # of bytes on the queue */ @@ -89,8 +89,8 @@ struct msqid_ds_old { struct msqid_ds { struct ipc_perm msg_perm; /* msg queue permission bits */ - struct msg *msg_first; /* first message in the queue */ - struct msg *msg_last; /* last message in the queue */ + struct msg *__msg_first; /* first message in the queue */ + struct msg *__msg_last; /* last message in the queue */ msglen_t msg_cbytes; /* number of bytes in use on the queue */ msgqnum_t msg_qnum; /* number of msgs in the queue */ msglen_t msg_qbytes; /* max # of bytes on the queue */ Modified: head/sys/sys/sem.h ============================================================================== --- head/sys/sys/sem.h Fri Mar 2 21:50:02 2018 (r330296) +++ head/sys/sys/sem.h Fri Mar 2 22:10:48 2018 (r330297) @@ -34,7 +34,7 @@ typedef __time_t time_t; defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) struct semid_ds_old { struct ipc_perm_old sem_perm; /* operation permission struct */ - struct sem *sem_base; /* pointer to first semaphore in set */ + struct sem *__sem_base; /* pointer to first semaphore in set */ unsigned short sem_nsems; /* number of sems in set */ time_t sem_otime; /* last operation time */ long sem_pad1; /* SVABI/386 says I need this here */ @@ -48,7 +48,7 @@ struct semid_ds_old { struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ - struct sem *sem_base; /* pointer to first semaphore in set */ + struct sem *__sem_base; /* pointer to first semaphore in set */ unsigned short sem_nsems; /* number of sems in set */ time_t sem_otime; /* last operation time */ time_t sem_ctime; /* last change time */ From owner-svn-src-head@freebsd.org Fri Mar 2 22:13:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99BF9F26FD0; Fri, 2 Mar 2018 22:13:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46C1E7C1D4; Fri, 2 Mar 2018 22:13:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4123B1D66A; Fri, 2 Mar 2018 22:13:30 +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 w22MDU5q059651; Fri, 2 Mar 2018 22:13:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22MDUmY059650; Fri, 2 Mar 2018 22:13:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803022213.w22MDUmY059650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Mar 2018 22:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330298 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 330298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:13:30 -0000 Author: brooks Date: Fri Mar 2 22:13:29 2018 New Revision: 330298 URL: https://svnweb.freebsd.org/changeset/base/330298 Log: Don't define struct mymsg. PR: 224299, 224443 (exp-run) Reviewed by: kib, jhb Exp-run by: antoine Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14491 Modified: head/sys/sys/msg.h Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Fri Mar 2 22:10:48 2018 (r330297) +++ head/sys/sys/msg.h Fri Mar 2 22:13:29 2018 (r330298) @@ -101,23 +101,6 @@ struct msqid_ds { time_t msg_ctime; /* time of last msgctl() */ }; -#if __BSD_VISIBLE -/* - * Structure describing a message. The SVID doesn't suggest any - * particular name for this structure. There is a reference in the - * msgop man page that reads "The structure mymsg is an example of what - * this user defined buffer might look like, and includes the following - * members:". This sentence is followed by two lines equivalent - * to the mtype and mtext field declarations below. It isn't clear - * if "mymsg" refers to the name of the structure type or the name of an - * instance of the structure... - */ -struct mymsg { - long mtype; /* message type (+ve integer) */ - char mtext[1]; /* message body */ -}; -#endif - #ifdef _KERNEL struct msg { struct msg *msg_next; /* next msg in the chain */ From owner-svn-src-head@freebsd.org Fri Mar 2 22:31:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D83CF280F1; Fri, 2 Mar 2018 22:31:40 +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 2DBEA7CB65; Fri, 2 Mar 2018 22:31:39 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9FB105A9F12; Fri, 2 Mar 2018 22:31:38 +0000 (UTC) Date: Fri, 2 Mar 2018 22:31:38 +0000 From: Brooks Davis To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys Message-ID: <20180302223138.GA83679@spindle.one-eyed-alien.net> References: <201803022210.w22MAnob055140@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline In-Reply-To: <201803022210.w22MAnob055140@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:31:40 -0000 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 02, 2018 at 10:10:49PM +0000, Brooks Davis wrote: > Author: brooks > Date: Fri Mar 2 22:10:48 2018 > New Revision: 330297 > URL: https://svnweb.freebsd.org/changeset/base/330297 >=20 > Log: > Rename kernel-only members of semid_ds and msgid_ds. > =20 > This deliberately breaks the API in preperation for future syscall > revisions which will remove these nonstandard members. > =20 > In an exp-run a single port (devel/qemu-user-static) was found to > use them which it did becuase it emulates system calls. This has > been fixed in the ports tree. > =20 > PR: 224443 (exp-run) > Reviewed by: kib, jhb (previous version) > Exp-run by: antoine > Sponsored by: DARPA, AFRP > Differential Revision: https://reviews.freebsd.org/D14490 FYI, a __FreeBSD_version bump is coming along with a third commit. -- Brooks --yrj/dFKFPuw6o+aM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJamdDJAAoJEKzQXbSebgfADCoH/AjKqrdFvggyHrQjK9Py7UwS zeKppyk/fNFXdp8yPsqMbAsNLnLp35Yy1CeSoYrxA9aPgwP0/14xG5xmo7wvSddx Fy43vX3/M8m9M/9hL6R8YhYVSRMSoQtYEFi+NKAGcmwWGSq0M1j+aTfQG9BSYPan lBnwj4OH/bHg6lbeK9j6e4RJsdWwXux0vhC3eNu+keMA4RZqf1RgPxInkTiwlBmH MktJZL28RMbyZnoXBAmjLoqpywMD9nb7F81jtaRcwNHWmQLv6Jn7AirO30GF6T5/ 0mktixXLqGBVbk+8Rgn5x288fy9vTSsamOFYraxRkBYoJ3x/WYhXUtOffc/MoWM= =bHx0 -----END PGP SIGNATURE----- --yrj/dFKFPuw6o+aM-- From owner-svn-src-head@freebsd.org Fri Mar 2 22:32:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97ABDF28409; Fri, 2 Mar 2018 22:32:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5887CF3B; Fri, 2 Mar 2018 22:32:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4547F1D9AC; Fri, 2 Mar 2018 22:32:54 +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 w22MWsZg069749; Fri, 2 Mar 2018 22:32:54 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22MWriF069743; Fri, 2 Mar 2018 22:32:53 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803022232.w22MWriF069743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Mar 2018 22:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330299 - in head: contrib/sendmail/include/sm/os lib/libc/gen lib/libc/sys sys/sys usr.bin/svn/lib/libapr X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: contrib/sendmail/include/sm/os lib/libc/gen lib/libc/sys sys/sys usr.bin/svn/lib/libapr X-SVN-Commit-Revision: 330299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:32:54 -0000 Author: brooks Date: Fri Mar 2 22:32:53 2018 New Revision: 330299 URL: https://svnweb.freebsd.org/changeset/base/330299 Log: Don't declare union semun in userspace unless _WANT_SEMUN is defined. POSIX explicitly states that the application must declare union semun. This makes no sense, but it is what it is. This brings us into line with Linux, MacOS/Darwin, and NetBSD. In a ports exp-run a moderate number of ports fail due to a lack of approprate autotools-like discovery mechanisms or local patches. A commit to address them will follow shortly. PR: 224300, 224443 (exp-run) Reviewed by: emaste, jhb, kib Exp-run by: antoine Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14492 Modified: head/contrib/sendmail/include/sm/os/sm_os_freebsd.h head/lib/libc/gen/semctl.c head/lib/libc/sys/semctl.2 head/sys/sys/param.h head/sys/sys/sem.h head/usr.bin/svn/lib/libapr/apr.h Modified: head/contrib/sendmail/include/sm/os/sm_os_freebsd.h ============================================================================== --- head/contrib/sendmail/include/sm/os/sm_os_freebsd.h Fri Mar 2 22:13:29 2018 (r330298) +++ head/contrib/sendmail/include/sm/os/sm_os_freebsd.h Fri Mar 2 22:32:53 2018 (r330299) @@ -34,7 +34,7 @@ # define SM_CONF_SHM 1 #endif /* SM_CONF_SHM */ #ifndef SM_CONF_SEM -# define SM_CONF_SEM 1 +# define SM_CONF_SEM 2 #endif /* SM_CONF_SEM */ #ifndef SM_CONF_MSG # define SM_CONF_MSG 1 Modified: head/lib/libc/gen/semctl.c ============================================================================== --- head/lib/libc/gen/semctl.c Fri Mar 2 22:13:29 2018 (r330298) +++ head/lib/libc/gen/semctl.c Fri Mar 2 22:32:53 2018 (r330299) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #ifndef NO_COMPAT7 #define _WANT_SEMUN_OLD #endif +#define _WANT_SEMUN #include #include Modified: head/lib/libc/sys/semctl.2 ============================================================================== --- head/lib/libc/sys/semctl.2 Fri Mar 2 22:13:29 2018 (r330298) +++ head/lib/libc/sys/semctl.2 Fri Mar 2 22:32:53 2018 (r330299) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 1995 +.Dd February 23, 2018 .Dt SEMCTL 2 .Os .Sh NAME @@ -55,10 +55,7 @@ For the commands that use the .Fa arg argument, .Fa "union semun" -is defined as follows: -.\" -.\" From : -.\" +must be defined as follows: .Bd -literal union semun { int val; /* value for SETVAL */ @@ -66,6 +63,12 @@ union semun { u_short *array; /* array for GETALL & SETALL */ }; .Ed +Non-portable software may define +.Dv _WANT_SEMUN +before including +.Pa sys/sem.h +to use the system definition of +.Fa "union semun" . .Pp Commands are performed as follows: .\" Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Mar 2 22:13:29 2018 (r330298) +++ head/sys/sys/param.h Fri Mar 2 22:32:53 2018 (r330299) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200058 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200059 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/sem.h ============================================================================== --- head/sys/sys/sem.h Fri Mar 2 22:13:29 2018 (r330298) +++ head/sys/sys/sem.h Fri Mar 2 22:32:53 2018 (r330299) @@ -76,6 +76,7 @@ union semun_old { }; #endif +#if defined(_KERNEL) || defined(_WANT_SEMUN) /* * semctl's arg parameter structure */ @@ -84,6 +85,7 @@ union semun { struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ unsigned short *array; /* array for GETALL & SETALL */ }; +#endif /* * commands for semctl Modified: head/usr.bin/svn/lib/libapr/apr.h ============================================================================== --- head/usr.bin/svn/lib/libapr/apr.h Fri Mar 2 22:13:29 2018 (r330298) +++ head/usr.bin/svn/lib/libapr/apr.h Fri Mar 2 22:32:53 2018 (r330299) @@ -261,7 +261,7 @@ extern "C" { #define APR_HAVE_STRSTR 1 #define APR_HAVE_MEMCHR 1 #define APR_HAVE_STRUCT_RLIMIT 1 -#define APR_HAVE_UNION_SEMUN 1 +#define APR_HAVE_UNION_SEMUN 0 #define APR_HAVE_SCTP 1 #define APR_HAVE_IOVEC 1 From owner-svn-src-head@freebsd.org Fri Mar 2 23:25:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94B4DF2C0A1; Fri, 2 Mar 2018 23:25:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EE5AE7EEEF; Fri, 2 Mar 2018 23:25:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id ru3VeizugYxCTru3We2d7b; Fri, 02 Mar 2018 16:25:39 -0700 X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=v2DPQv5-lfwA:10 a=y3olD_i8AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=Oau6QQ8of-43uJIf8QYA:9 a=CjuIK1q_8ugA:10 a=2GdgqtpztZvaxdPX1XqS:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id EB19B199; Fri, 2 Mar 2018 15:25:35 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w22NPYLw050494; Fri, 2 Mar 2018 15:25:35 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w22NPYiW050422; Fri, 2 Mar 2018 15:25:34 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201803022325.w22NPYiW050422@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Brooks Davis cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys In-Reply-To: Message from Brooks Davis of "Fri, 02 Mar 2018 22:31:38 +0000." <20180302223138.GA83679@spindle.one-eyed-alien.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 02 Mar 2018 15:25:33 -0800 X-CMAE-Envelope: MS4wfLR9PPXxvK/z97AjnwiPSjYQtSbeiKUsBDpDw2Vsn5EEWGq2cZaiTGBKbOIf8FB6FCVeoaw2AbDypUS4LL1fA1/Gf1S3T3hT+aLsuH5PX2Gw0GcQG1vE FkbR3FR07+XkPXKCKgx0lOCAgzReuRlywFPxosr54vKniXqYql+nSBpFvbM/NOVeQcKFbHrQOvQTkuwEhskUSEjnd2YSmhxXuLwg7ULN6W5pwuxL7CQv6qkV 4r6FdDQ9B2O2twdbk+dDiwSen2Wg/jNgeptL/Zh0Rsat6jv4qHL9yBMl5/7WqR2L X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:25:47 -0000 In message <20180302223138.GA83679@spindle.one-eyed-alien.net>, Brooks Davis wr ites: > > --yrj/dFKFPuw6o+aM > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Fri, Mar 02, 2018 at 10:10:49PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Fri Mar 2 22:10:48 2018 > > New Revision: 330297 > > URL: https://svnweb.freebsd.org/changeset/base/330297 > >=20 > > Log: > > Rename kernel-only members of semid_ds and msgid_ds. > > =20 > > This deliberately breaks the API in preperation for future syscall > > revisions which will remove these nonstandard members. > > =20 > > In an exp-run a single port (devel/qemu-user-static) was found to > > use them which it did becuase it emulates system calls. This has > > been fixed in the ports tree. > > =20 > > PR: 224443 (exp-run) > > Reviewed by: kib, jhb (previous version) > > Exp-run by: antoine > > Sponsored by: DARPA, AFRP > > Differential Revision: https://reviews.freebsd.org/D14490 > > FYI, a __FreeBSD_version bump is coming along with a third commit. Hi Brooks, This causes ipcrm build to fail: /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:14: error: variable has incomplete type 'union semun' union semun arg; ^ /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:8: note: forward declaration of 'union semun' union semun arg; ^ Index: usr.bin/ipcrm/ipcrm.c =================================================================== --- usr.bin/ipcrm/ipcrm.c (revision 330299) +++ usr.bin/ipcrm/ipcrm.c (working copy) @@ -39,6 +39,7 @@ #define _WANT_SYSVMSG_INTERNALS #include #define _WANT_SYSVSEM_INTERNALS +#define _WANT_SEMUN #include #define _WANT_SYSVSHM_INTERNALS #include And: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:14: error: variable has incomplete type 'union semun' union semun sun; ^ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:8: note: forward declaration of 'union semun' union semun sun; ^ Index: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c =================================================================== --- /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (revision 330299) +++ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (working copy) @@ -49,6 +49,7 @@ #include #include #include +#define _WANT_SEMUN #include #include #include I'm not sure if there are more. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Mar 2 23:31:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6D1F2C638; Fri, 2 Mar 2018 23:31:42 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 454637F348; Fri, 2 Mar 2018 23:31:42 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id ru9Lej1u2YxCTru9Me2eUR; Fri, 02 Mar 2018 16:31:40 -0700 X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=v2DPQv5-lfwA:10 a=VxmjJ2MpAAAA:8 a=y3olD_i8AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=GsJFgSFYXISw1m55AkIA:9 a=CjuIK1q_8ugA:10 a=TYcZS3IPWXAA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=2GdgqtpztZvaxdPX1XqS:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A80161AC; Fri, 2 Mar 2018 15:31:37 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w22NVaV6063593; Fri, 2 Mar 2018 15:31:36 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w22NVa4r063569; Fri, 2 Mar 2018 15:31:36 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201803022331.w22NVa4r063569@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys In-Reply-To: Message from Cy Schubert of "Fri, 02 Mar 2018 15:25:33 -0800." <201803022325.w22NPYiW050422@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 02 Mar 2018 15:31:36 -0800 X-CMAE-Envelope: MS4wfEqO6EL1UHYjLYtZHmOjjYQoD+t2nCeAKichsq4bJqC9OlpKYE519uhc2OuAMEb3IThuhje4RLrC2FkkKZrCs0MNEMx8016lgMmzZg93KZzZGYPVPKIJ oyWPbedHrJuCuGhG1dJkE92uyGFZxQs5G/pMBOvbLHEoukU+yIzLBBjcEy5l7SDewDY/Dn1hXooMUVxdIMQ6nJ5HJmMNuzT0tvsXSlFleS4uxben9V2lBMFF P+95pSwGi0HsEAZ5grVYMTlGlLV4dFhteIbonOwkam2cu7CoVNVZQFcarlOJCPYS X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:31:43 -0000 In message <201803022325.w22NPYiW050422@slippy.cwsent.com>, Cy Schubert writes: > In message <20180302223138.GA83679@spindle.one-eyed-alien.net>, Brooks > Davis wr > ites: > > > > --yrj/dFKFPuw6o+aM > > Content-Type: text/plain; charset=us-ascii > > Content-Disposition: inline > > Content-Transfer-Encoding: quoted-printable > > > > On Fri, Mar 02, 2018 at 10:10:49PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Fri Mar 2 22:10:48 2018 > > > New Revision: 330297 > > > URL: https://svnweb.freebsd.org/changeset/base/330297 > > >=20 > > > Log: > > > Rename kernel-only members of semid_ds and msgid_ds. > > > =20 > > > This deliberately breaks the API in preperation for future syscall > > > revisions which will remove these nonstandard members. > > > =20 > > > In an exp-run a single port (devel/qemu-user-static) was found to > > > use them which it did becuase it emulates system calls. This has > > > been fixed in the ports tree. > > > =20 > > > PR: 224443 (exp-run) > > > Reviewed by: kib, jhb (previous version) > > > Exp-run by: antoine > > > Sponsored by: DARPA, AFRP > > > Differential Revision: https://reviews.freebsd.org/D14490 > > > > FYI, a __FreeBSD_version bump is coming along with a third commit. > > Hi Brooks, > > This causes ipcrm build to fail: > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:14: error: variable has > incomplete type 'union semun' > union semun arg; > ^ > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:8: note: forward > declaration of 'union semun' > union semun arg; > ^ > > > Index: usr.bin/ipcrm/ipcrm.c > =================================================================== > --- usr.bin/ipcrm/ipcrm.c (revision 330299) > +++ usr.bin/ipcrm/ipcrm.c (working copy) > @@ -39,6 +39,7 @@ > #define _WANT_SYSVMSG_INTERNALS > #include > #define _WANT_SYSVSEM_INTERNALS > +#define _WANT_SEMUN > #include > #define _WANT_SYSVSHM_INTERNALS > #include > > And: > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:14: > error: variable has incomplete type 'union semun' > union semun sun; > ^ > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:8: note: > forward declaration of 'union semun' > union semun sun; > ^ > > Index: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c > =================================================================== > --- /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (revision > 330299) > +++ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (working > copy) > @@ -49,6 +49,7 @@ > #include > #include > #include > +#define _WANT_SEMUN > #include > #include > #include > > > I'm not sure if there are more. Sorry, this should be reported against r330299. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Mar 2 23:32:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E323F2C79D; Fri, 2 Mar 2018 23:32:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 275817F5D0; Fri, 2 Mar 2018 23:31:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 422751E325; Fri, 2 Mar 2018 23:31:56 +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 w22NVu0l097012; Fri, 2 Mar 2018 23:31:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22NVteJ097010; Fri, 2 Mar 2018 23:31:55 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803022331.w22NVteJ097010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Mar 2018 23:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330300 - in head: contrib/netbsd-tests/kernel usr.bin/ipcrm X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: contrib/netbsd-tests/kernel usr.bin/ipcrm X-SVN-Commit-Revision: 330300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:32:00 -0000 Author: brooks Date: Fri Mar 2 23:31:55 2018 New Revision: 330300 URL: https://svnweb.freebsd.org/changeset/base/330300 Log: Fix build post r330299 Modified: head/contrib/netbsd-tests/kernel/t_sysv.c head/usr.bin/ipcrm/ipcrm.c Modified: head/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- head/contrib/netbsd-tests/kernel/t_sysv.c Fri Mar 2 22:32:53 2018 (r330299) +++ head/contrib/netbsd-tests/kernel/t_sysv.c Fri Mar 2 23:31:55 2018 (r330300) @@ -94,13 +94,11 @@ key_t msgkey, semkey, shmkey; int maxloop = 1; -#ifndef __FreeBSD__ union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_{STAT,SET} */ u_short *array; /* array for GETALL & SETALL */ }; -#endif /* Writes an integer to a file. To be used from the body of the test Modified: head/usr.bin/ipcrm/ipcrm.c ============================================================================== --- head/usr.bin/ipcrm/ipcrm.c Fri Mar 2 22:32:53 2018 (r330299) +++ head/usr.bin/ipcrm/ipcrm.c Fri Mar 2 23:31:55 2018 (r330300) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #define _WANT_SYSVMSG_INTERNALS #include #define _WANT_SYSVSEM_INTERNALS +#define _WANT_SEMUN #include #define _WANT_SYSVSHM_INTERNALS #include From owner-svn-src-head@freebsd.org Fri Mar 2 23:33:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA391F2CA54; Fri, 2 Mar 2018 23:33:44 +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 6A52F7F924; Fri, 2 Mar 2018 23:33:44 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 6EF085A9F12; Fri, 2 Mar 2018 23:33:43 +0000 (UTC) Date: Fri, 2 Mar 2018 23:33:43 +0000 From: Brooks Davis To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys Message-ID: <20180302233343.GC83679@spindle.one-eyed-alien.net> References: <201803022325.w22NPYiW050422@slippy.cwsent.com> <201803022331.w22NVa4r063569@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ALfTUftag+2gvp1h" Content-Disposition: inline In-Reply-To: <201803022331.w22NVa4r063569@slippy.cwsent.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:33:45 -0000 --ALfTUftag+2gvp1h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 02, 2018 at 03:31:36PM -0800, Cy Schubert wrote: > In message <201803022325.w22NPYiW050422@slippy.cwsent.com>, Cy Schubert= =20 > writes: > > In message <20180302223138.GA83679@spindle.one-eyed-alien.net>, Brooks= =20 > > Davis wr > > ites: > > >=20 > > > --yrj/dFKFPuw6o+aM > > > Content-Type: text/plain; charset=3Dus-ascii > > > Content-Disposition: inline > > > Content-Transfer-Encoding: quoted-printable > > > > > > On Fri, Mar 02, 2018 at 10:10:49PM +0000, Brooks Davis wrote: > > > > Author: brooks > > > > Date: Fri Mar 2 22:10:48 2018 > > > > New Revision: 330297 > > > > URL: https://svnweb.freebsd.org/changeset/base/330297 > > > >=3D20 > > > > Log: > > > > Rename kernel-only members of semid_ds and msgid_ds. > > > > =3D20 > > > > This deliberately breaks the API in preperation for future syscall > > > > revisions which will remove these nonstandard members. > > > > =3D20 > > > > In an exp-run a single port (devel/qemu-user-static) was found to > > > > use them which it did becuase it emulates system calls. This has > > > > been fixed in the ports tree. > > > > =3D20 > > > > PR: 224443 (exp-run) > > > > Reviewed by: kib, jhb (previous version) > > > > Exp-run by: antoine > > > > Sponsored by: DARPA, AFRP > > > > Differential Revision: https://reviews.freebsd.org/D14490 > > > > > > FYI, a __FreeBSD_version bump is coming along with a third commit. > > > > Hi Brooks, > > > > This causes ipcrm build to fail: > > > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:14: error: variable has= =20 > > incomplete type 'union semun' > > union semun arg; > > ^ > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:8: note: forward=20 > > declaration of 'union semun' > > union semun arg; > > ^ > > > > > > Index: usr.bin/ipcrm/ipcrm.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 > > --- usr.bin/ipcrm/ipcrm.c (revision 330299) > > +++ usr.bin/ipcrm/ipcrm.c (working copy) > > @@ -39,6 +39,7 @@ > > #define _WANT_SYSVMSG_INTERNALS > > #include > > #define _WANT_SYSVSEM_INTERNALS > > +#define _WANT_SEMUN > > #include > > #define _WANT_SYSVSHM_INTERNALS > > #include > > > > And: > > > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:14:=20 > > error: variable has incomplete type 'union semun' > > union semun sun; > > ^ > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:8: note:= =20 > > forward declaration of 'union semun' > > union semun sun; > > ^ > > > > Index: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.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 > > --- /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (revision= =20 > > 330299) > > +++ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (working= =20 > > copy) > > @@ -49,6 +49,7 @@ > > #include > > #include > > #include > > +#define _WANT_SEMUN > > #include > > #include > > #include > > > > > > I'm not sure if there are more. >=20 > Sorry, this should be reported against r330299. Thanks for the reports. Sorry about that. Doing another buildworld to check for more. -- Brooks --ALfTUftag+2gvp1h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJamd9WAAoJEKzQXbSebgfA8lcH/3Pei+RMDJFP1OGYGKom4z7j 8/HMNYcq98rEjfMgyHuCpDPABLlHhMENYiF2qWeqTHkQ+x3RNpOZ+m0Ueg2P7kUw xEIxvlZoM5YIphqHqx3/HmoHlLUdDY6JSwjVw65/CzZh83q7kKq0a2xZQ44tcJc1 cWEuvKBnVfodGyFQ9tIPFnNxDEMAspod3xUAQ5orrL5/AX57ZaLaRWmkT+OntJDz kImC3SC0js8dLCJxNZ2ZkY/q5r71fAAuJ/JaAsY6JMRCJeNWtwzfT1Bw2RFf4DxT acvf8TaZHc5V4q0Ev7g6TXp6IGW3zImkKT/sMCCIV0Sofb7XVjUImzyx32y4TcE= =P9Nu -----END PGP SIGNATURE----- --ALfTUftag+2gvp1h-- From owner-svn-src-head@freebsd.org Fri Mar 2 23:35:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF16FF2CBFC; Fri, 2 Mar 2018 23:35:08 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 24CFF7FAE8; Fri, 2 Mar 2018 23:35:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id ruCfej35RYxCTruCge2fIx; Fri, 02 Mar 2018 16:35:06 -0700 X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=v2DPQv5-lfwA:10 a=y3olD_i8AAAA:8 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=_bR8DJifUNjSDPGD_U0A:9 a=CjuIK1q_8ugA:10 a=TYcZS3IPWXAA:10 a=2GdgqtpztZvaxdPX1XqS:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id D8F801E4; Fri, 2 Mar 2018 15:35:04 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w22NZ4W6079548; Fri, 2 Mar 2018 15:35:04 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w22NZ449079543; Fri, 2 Mar 2018 15:35:04 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201803022335.w22NZ449079543@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Brooks Davis cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys In-Reply-To: Message from Brooks Davis of "Fri, 02 Mar 2018 23:33:43 +0000." <20180302233343.GC83679@spindle.one-eyed-alien.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 02 Mar 2018 15:35:04 -0800 X-CMAE-Envelope: MS4wfJSWsMoYC32yQqIEAdr1EWkpsrhHu357qh0S4vRIpcypRFva3aM01aCTWCp4gJ9gd2mCzjXnzOM1I6eeXyVuc/vO5nsFkxKBzgd9vX/purUb/xYZP52H Du/ompfdm+kmGxjG091qkzqYt7ENbcmuz96Lhw7vtpOQQxYLh0fG8cZOJ20SKLKcJ3bx7lrV75GkeRG0J/r7I4Dc6Ghnjw6VwKt3z2pSHTBaEl9nQ1OPhMuD mLV9tKiPacED2PV/IBvcYdm6GcgKd57dMJFujASawzFiVjABAkx19i5WSUvuBy/Q X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:35:09 -0000 In message <20180302233343.GC83679@spindle.one-eyed-alien.net>, Brooks Davis wr ites: > > > --ALfTUftag+2gvp1h > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Fri, Mar 02, 2018 at 03:31:36PM -0800, Cy Schubert wrote: > > In message <201803022325.w22NPYiW050422@slippy.cwsent.com>, Cy Schubert= > =20 > > writes: > > > In message <20180302223138.GA83679@spindle.one-eyed-alien.net>, Brooks= > =20 > > > Davis wr > > > ites: > > > >=20 > > > > --yrj/dFKFPuw6o+aM > > > > Content-Type: text/plain; charset=3Dus-ascii > > > > Content-Disposition: inline > > > > Content-Transfer-Encoding: quoted-printable > > > > > > > > On Fri, Mar 02, 2018 at 10:10:49PM +0000, Brooks Davis wrote: > > > > > Author: brooks > > > > > Date: Fri Mar 2 22:10:48 2018 > > > > > New Revision: 330297 > > > > > URL: https://svnweb.freebsd.org/changeset/base/330297 > > > > >=3D20 > > > > > Log: > > > > > Rename kernel-only members of semid_ds and msgid_ds. > > > > > =3D20 > > > > > This deliberately breaks the API in preperation for future syscall > > > > > revisions which will remove these nonstandard members. > > > > > =3D20 > > > > > In an exp-run a single port (devel/qemu-user-static) was found to > > > > > use them which it did becuase it emulates system calls. This has > > > > > been fixed in the ports tree. > > > > > =3D20 > > > > > PR: 224443 (exp-run) > > > > > Reviewed by: kib, jhb (previous version) > > > > > Exp-run by: antoine > > > > > Sponsored by: DARPA, AFRP > > > > > Differential Revision: https://reviews.freebsd.org/D14490 > > > > > > > > FYI, a __FreeBSD_version bump is coming along with a third commit. > > > > > > Hi Brooks, > > > > > > This causes ipcrm build to fail: > > > > > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:14: error: variable has= > =20 > > > incomplete type 'union semun' > > > union semun arg; > > > ^ > > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:8: note: forward=20 > > > declaration of 'union semun' > > > union semun arg; > > > ^ > > > > > > > > > Index: usr.bin/ipcrm/ipcrm.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 > > > --- usr.bin/ipcrm/ipcrm.c (revision 330299) > > > +++ usr.bin/ipcrm/ipcrm.c (working copy) > > > @@ -39,6 +39,7 @@ > > > #define _WANT_SYSVMSG_INTERNALS > > > #include > > > #define _WANT_SYSVSEM_INTERNALS > > > +#define _WANT_SEMUN > > > #include > > > #define _WANT_SYSVSHM_INTERNALS > > > #include > > > > > > And: > > > > > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:14:=20 > > > error: variable has incomplete type 'union semun' > > > union semun sun; > > > ^ > > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:8: note:= > =20 > > > forward declaration of 'union semun' > > > union semun sun; > > > ^ > > > > > > Index: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.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 > > > --- /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (revisi > on= > =20 > > > 330299) > > > +++ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (workin > g= > =20 > > > copy) > > > @@ -49,6 +49,7 @@ > > > #include > > > #include > > > #include > > > +#define _WANT_SEMUN > > > #include > > > #include > > > #include > > > > > > > > > I'm not sure if there are more. > >=20 > > Sorry, this should be reported against r330299. > > Thanks for the reports. Sorry about that. Doing another buildworld > to check for more. Thanks for the prompt fixes. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Mar 3 01:53:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF583F366BD; Sat, 3 Mar 2018 01:53:52 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9715E85DED; Sat, 3 Mar 2018 01:53:52 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E7BB1FB27; Sat, 3 Mar 2018 01:53:52 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w231rqaQ070088; Sat, 3 Mar 2018 01:53:52 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w231rp7p070080; Sat, 3 Mar 2018 01:53:51 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201803030153.w231rp7p070080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Sat, 3 Mar 2018 01:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330304 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/imcsmb sys/i386/conf sys/modules/i2c/controllers sys/modules/i2c/controllers/imcsmb X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/imcsmb sys/i386/conf sys/modules/i2c/controllers sys/modules/i2c/controllers/imcsmb X-SVN-Commit-Revision: 330304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 01:53:53 -0000 Author: rpokala Date: Sat Mar 3 01:53:51 2018 New Revision: 330304 URL: https://svnweb.freebsd.org/changeset/base/330304 Log: imcsmb(4): Intel integrated Memory Controller (iMC) SMBus controller driver imcsmb(4) provides smbus(4) support for the SMBus controller functionality in the integrated Memory Controllers (iMCs) embedded in Intel Sandybridge- Xeon, Ivybridge-Xeon, Haswell-Xeon, and Broadwell-Xeon CPUs. Each CPU implements one or more iMCs, depending on the number of cores; each iMC implements two SMBus controllers (iMC-SMBs). *** IMPORTANT NOTE *** Because motherboard firmware or the BMC might try to use the iMC-SMBs for monitoring DIMM temperatures and/or managing an NVDIMM, the driver might need to temporarily disable those functions, or take a hardware interlock, before using the iMC-SMBs. Details on how to do this may vary from board to board, and the procedure may be proprietary. It is strongly suggested that anyone wishing to use this driver contact their motherboard vendor, and modify the driver as described in the manual page and in the driver itself. (For what it's worth, the driver as-is has been tested on various SuperMicro motherboards.) Reviewed by: avg, jhb MFC after: 1 week Relnotes: yes Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D14447 Discussed with: avg, ian, jhb Tested by: allanjude (previous version), Panasas Added: head/share/man/man4/imcsmb.4 (contents, props changed) head/sys/dev/imcsmb/ head/sys/dev/imcsmb/imcsmb.c (contents, props changed) head/sys/dev/imcsmb/imcsmb_pci.c (contents, props changed) head/sys/dev/imcsmb/imcsmb_reg.h (contents, props changed) head/sys/dev/imcsmb/imcsmb_var.h (contents, props changed) head/sys/modules/i2c/controllers/imcsmb/ head/sys/modules/i2c/controllers/imcsmb/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/modules/i2c/controllers/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Mar 3 00:54:12 2018 (r330303) +++ head/share/man/man4/Makefile Sat Mar 3 01:53:51 2018 (r330304) @@ -218,6 +218,7 @@ MAN= aac.4 \ iicbus.4 \ iicsmb.4 \ iir.4 \ + ${_imcsmb.4} \ inet.4 \ inet6.4 \ intpm.4 \ @@ -824,6 +825,7 @@ _if_vmx.4= if_vmx.4 _if_vtnet.4= if_vtnet.4 _if_vxge.4= if_vxge.4 _if_wpi.4= if_wpi.4 +_imcsmb.4= imcsmb.4 _ipmi.4= ipmi.4 _io.4= io.4 _linux.4= linux.4 Added: head/share/man/man4/imcsmb.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/imcsmb.4 Sat Mar 3 01:53:51 2018 (r330304) @@ -0,0 +1,133 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Panasas +.\" 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$ +.\" +.Dd March 2, 2018 +.Dt IMCSMB 4 +.Os +.Sh NAME +.Nm imcsmb +.Nd Intel integrated Memory Controller (iMC) SMBus controller driver +.Sh SYNOPSIS +.Cd device pci +.Cd device smbus +.Cd device imcsmb +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +imcsmb_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr smbus 4 +support for the SMBus controller functionality in the integrated Memory +Controllers (iMCs) embedded in Intel Sandybridge-Xeon, Ivybridge-Xeon, +Haswell-Xeon, and Broadwell-Xeon CPUs. +Each CPU implements one or more iMCs, depending on the number of cores; +each iMC implements two SMBus controllers (iMC-SMBs). +The iMC-SMBs are used by the iMCs to read configuration information from the +DIMMs during POST. +They may also be used, by motherboard firmware or a BMC, to monitor the +temperature of the DIMMs. +.Pp +The iMC-SMBs are +.Sy not +general-purpose SMBus controllers. +By their nature, they are only ever attached to DIMMs, so they implement only +the SMBus operations need for communicating with DIMMs. +Specifically: +.Pp +.Bl -dash -offset indent -compact +.It +READB +.It +READW +.It +WRITEB +.It +WRITEW +.El +.Pp +A more detailed discussion of the hardware and driver architecture can be found +at the top of +.Pa sys/dev/imcsmb/imcsmb_pci.c . +.Sh WARNINGS +As mentioned above, firmware might use the iMC-SMBs to read DIMM temperatures. +The public iMC documentation does not describe any sort of coordination +mechanism to prevent requests from different sources -- such as the motherboard +firmware, a BMC, or the operating system -- from interfering with each other. +.Pp +.Bf Sy +Therefore, it is highly recommended that developers contact the motherboard +vendor for any board-specific instructions on how to disable and re-enable DIMM +temperature monitoring. +.Ef +.Pp +DIMM temperature monitoring should be disabled before returning from +.Fn imcsmb_pci_request_bus , +and re-enabled before returning from +.Fn imcsmb_pci_release_bus . +The driver includes comments to that effect at the appropriate locations. +The driver has been tested and shown to work, with only that type of +modification, on certain motherboards from Intel. +.Po +Unfortunately, those modifications were based on material covered under a +non-disclosure agreement, and therefore are not included in this driver. +.Pc +The driver has also been tested and shown to work as-is on various motherboards +from SuperMicro. +.Pp +The +.Xr smb 4 +driver will connect to the +.Xr smbus 4 +instances created by +.Nm . +However, since the IMC-SMBs are not general-purpose SMBus controllers, using +.Xr smbmsg 8 +with those +.Xr smb 4 +devices is not supported. +.Sh SEE ALSO +.Xr jedec_dimm 4 , +.Xr smbus 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +driver was originally written for Panasas by +.An Joe Kloss . +It was substantially refactored, and this manual page was written, by +.An Ravi Pokala Aq Mt rpokala@freebsd.org Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sat Mar 3 00:54:12 2018 (r330303) +++ head/sys/amd64/conf/NOTES Sat Mar 3 01:53:51 2018 (r330304) @@ -468,6 +468,11 @@ device hptiop device ips # +# Intel integrated Memory Controller (iMC) SMBus controller +# Sandybridge-Xeon, Ivybridge-Xeon, Haswell-Xeon, Broadwell-Xeon +device imcsmb + +# # Intel C600 (Patsburg) integrated SAS controller device isci options ISCI_LOGGING # enable debugging in isci HAL Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Mar 3 00:54:12 2018 (r330303) +++ head/sys/conf/files.amd64 Sat Mar 3 01:53:51 2018 (r330304) @@ -244,6 +244,8 @@ dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb +dev/imcsmb/imcsmb.c optional imcsmb +dev/imcsmb/imcsmb_pci.c optional imcsmb pci dev/intel/spi.c optional intelspi dev/io/iodev.c optional io dev/ioat/ioat.c optional ioat pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Mar 3 00:54:12 2018 (r330303) +++ head/sys/conf/files.i386 Sat Mar 3 01:53:51 2018 (r330304) @@ -266,6 +266,8 @@ dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb +dev/imcsmb/imcsmb.c optional imcsmb +dev/imcsmb/imcsmb_pci.c optional imcsmb pci dev/intel/spi.c optional intelspi dev/io/iodev.c optional io dev/ipmi/ipmi.c optional ipmi Added: head/sys/dev/imcsmb/imcsmb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/imcsmb/imcsmb.c Sat Mar 3 01:53:51 2018 (r330304) @@ -0,0 +1,557 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) + * + * Copyright (c) 2017-2018 Panasas + * 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$ + */ + +/* A detailed description of this device is present in imcsmb_pci.c */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "imcsmb_reg.h" +#include "imcsmb_var.h" + +/* Device methods */ +static int imcsmb_attach(device_t dev); +static int imcsmb_detach(device_t dev); +static int imcsmb_probe(device_t dev); + +/* SMBus methods */ +static int imcsmb_callback(device_t dev, int index, void *data); +static int imcsmb_readb(device_t dev, u_char slave, char cmd, char *byte); +static int imcsmb_readw(device_t dev, u_char slave, char cmd, short *word); +static int imcsmb_writeb(device_t dev, u_char slave, char cmd, char byte); +static int imcsmb_writew(device_t dev, u_char slave, char cmd, short word); + +/* All the read/write methods wrap around this. */ +static int imcsmb_transfer(device_t dev, u_char slave, char cmd, void *data, + int word_op, int write_op); + +/** + * device_attach() method. Set up the softc, including getting the set of the + * parent imcsmb_pci's registers that we will use. Create the smbus(4) device, + * which any SMBus slave device drivers will connect to. + * + * @author rpokala + * + * @param[in,out] dev + * Device being attached. + */ +static int +imcsmb_attach(device_t dev) +{ + struct imcsmb_softc *sc; + int rc; + + /* Initialize private state */ + sc = device_get_softc(dev); + sc->dev = dev; + sc->imcsmb_pci = device_get_parent(dev); + sc->regs = device_get_ivars(dev); + + /* Create the smbus child */ + sc->smbus = device_add_child(dev, "smbus", -1); + if (sc->smbus == NULL) { + /* Nothing has been allocated, so there's no cleanup. */ + device_printf(dev, "Child smbus not added\n"); + rc = ENXIO; + goto out; + } + + /* Attach the smbus child. */ + if ((rc = bus_generic_attach(dev)) != 0) { + device_printf(dev, "Failed to attach smbus: %d\n", rc); + } + +out: + return (rc); +} + +/** + * device_detach() method. attach() didn't do any allocations, so all that's + * needed here is to free up any downstream drivers and children. + * + * @author Joe Kloss + * + * @param[in] dev + * Device being detached. + */ +static int +imcsmb_detach(device_t dev) +{ + int rc; + + /* Detach any attached drivers */ + rc = bus_generic_detach(dev); + if (rc == 0) { + /* Remove all children */ + rc = device_delete_children(dev); + } + + return (rc); +} + +/** + * device_probe() method. All the actual probing was done by the imcsmb_pci + * parent, so just report success. + * + * @author Joe Kloss + * + * @param[in,out] dev + * Device being probed. + */ +static int +imcsmb_probe(device_t dev) +{ + + device_set_desc(dev, "iMC SMBus controller"); + return (BUS_PROBE_DEFAULT); +} + +/** + * smbus_callback() method. Call the parent imcsmb_pci's request or release + * function to quiesce / restart firmware tasks which might use the SMBus. + * + * @author rpokala + * + * @param[in] dev + * Device being requested or released. + * + * @param[in] index + * Either SMB_REQUEST_BUS or SMB_RELEASE_BUS. + * + * @param[in] data + * Tell's the rest of the SMBus subsystem to allow or disallow waiting; + * this driver only works with SMB_DONTWAIT. + */ +static int +imcsmb_callback(device_t dev, int index, void *data) +{ + struct imcsmb_softc *sc; + int *how; + int rc; + + sc = device_get_softc(dev); + how = (int *) data; + + switch (index) { + case SMB_REQUEST_BUS: { + if (*how != SMB_DONTWAIT) { + rc = EINVAL; + goto out; + } + rc = imcsmb_pci_request_bus(sc->imcsmb_pci); + break; + } + case SMB_RELEASE_BUS: + imcsmb_pci_release_bus(sc->imcsmb_pci); + rc = 0; + break; + default: + rc = EINVAL; + break; + } + +out: + return (rc); +} + +/** + * smbus_readb() method. Thin wrapper around imcsmb_transfer(). + * + * @author Joe Kloss + * + * @param[in] dev + * + * @param[in] slave + * The SMBus address of the target device. + * + * @param[in] cmd + * The SMBus command for the target device; this is the offset for SPDs, + * or the register number for TSODs. + * + * @param[out] byte + * The byte which was read. + */ +static int +imcsmb_readb(device_t dev, u_char slave, char cmd, char *byte) +{ + + return (imcsmb_transfer(dev, slave, cmd, byte, FALSE, FALSE)); +} + +/** + * smbus_readw() method. Thin wrapper around imcsmb_transfer(). + * + * @author Joe Kloss + * + * @param[in] dev + * + * @param[in] slave + * The SMBus address of the target device. + * + * @param[in] cmd + * The SMBus command for the target device; this is the offset for SPDs, + * or the register number for TSODs. + * + * @param[out] word + * The word which was read. + */ +static int +imcsmb_readw(device_t dev, u_char slave, char cmd, short *word) +{ + + return (imcsmb_transfer(dev, slave, cmd, word, TRUE, FALSE)); +} + +/** + * smbus_writeb() method. Thin wrapper around imcsmb_transfer(). + * + * @author Joe Kloss + * + * @param[in] dev + * + * @param[in] slave + * The SMBus address of the target device. + * + * @param[in] cmd + * The SMBus command for the target device; this is the offset for SPDs, + * or the register number for TSODs. + * + * @param[in] byte + * The byte to write. + */ +static int +imcsmb_writeb(device_t dev, u_char slave, char cmd, char byte) +{ + + return (imcsmb_transfer(dev, slave, cmd, &byte, FALSE, TRUE)); +} + +/** + * smbus_writew() method. Thin wrapper around imcsmb_transfer(). + * + * @author Joe Kloss + * + * @param[in] dev + * + * @param[in] slave + * The SMBus address of the target device. + * + * @param[in] cmd + * The SMBus command for the target device; this is the offset for SPDs, + * or the register number for TSODs. + * + * @param[in] word + * The word to write. + */ +static int +imcsmb_writew(device_t dev, u_char slave, char cmd, short word) +{ + + return (imcsmb_transfer(dev, slave, cmd, &word, TRUE, TRUE)); +} + +/** + * Manipulate the PCI control registers to read data from or write data to the + * SMBus controller. + * + * @author Joe Kloss, rpokala + * + * @param[in] dev + * + * @param[in] slave + * The SMBus address of the target device. + * + * @param[in] cmd + * The SMBus command for the target device; this is the offset for SPDs, + * or the register number for TSODs. + * + * @param[in,out] data + * Pointer to either the value to be written, or where to place the value + * which was read. + * + * @param[in] word_op + * Bool: is this a word operation? + * + * @param[in] write_op + * Bool: is this a write operation? + */ +static int +imcsmb_transfer(device_t dev, u_char slave, char cmd, void *data, int word_op, + int write_op) +{ + struct imcsmb_softc *sc; + int i; + int rc; + uint32_t cmd_val; + uint32_t cntl_val; + uint32_t orig_cntl_val; + uint32_t stat_val; + uint16_t *word; + uint16_t lword; + uint8_t *byte; + uint8_t lbyte; + + sc = device_get_softc(dev); + byte = data; + word = data; + lbyte = *byte; + lword = *word; + + /* We modify the value of the control register; save the original, so + * we can restore it later + */ + orig_cntl_val = pci_read_config(sc->imcsmb_pci, + sc->regs->smb_cntl, 4); + cntl_val = orig_cntl_val; + + /* + * Set up the SMBCNTL register + */ + + /* [31:28] Clear the existing value of the DTI bits, then set them to + * the four high bits of the slave address. + */ + cntl_val &= ~IMCSMB_CNTL_DTI_MASK; + cntl_val |= ((uint32_t) slave & 0xf0) << 24; + + /* [27:27] Set the CLK_OVERRIDE bit, to enable normal operation */ + cntl_val |= IMCSMB_CNTL_CLK_OVERRIDE; + + /* [26:26] Clear the WRITE_DISABLE bit; the datasheet says this isn't + * necessary, but empirically, it is. + */ + cntl_val &= ~IMCSMB_CNTL_WRITE_DISABLE_BIT; + + /* [9:9] Clear the POLL_EN bit, to stop the hardware TSOD polling. */ + cntl_val &= ~IMCSMB_CNTL_POLL_EN; + + /* + * Set up the SMBCMD register + */ + + /* [31:31] Set the TRIGGER bit; when this gets written, the controller + * will issue the command. + */ + cmd_val = IMCSMB_CMD_TRIGGER_BIT; + + /* [29:29] For word operations, set the WORD_ACCESS bit. */ + if (word_op) { + cmd_val |= IMCSMB_CMD_WORD_ACCESS; + } + + /* [27:27] For write operations, set the WRITE bit. */ + if (write_op) { + cmd_val |= IMCSMB_CMD_WRITE_BIT; + } + + /* [26:24] The three non-DTI, non-R/W bits of the slave address. */ + cmd_val |= (uint32_t) ((slave & 0xe) << 23); + + /* [23:16] The command (offset in the case of an EEPROM, or register in + * the case of TSOD or NVDIMM controller). + */ + cmd_val |= (uint32_t) ((uint8_t) cmd << 16); + + /* [15:0] The data to be written for a write operation. */ + if (write_op) { + if (word_op) { + /* The datasheet says the controller uses different + * endianness for word operations on I2C vs SMBus! + * I2C: [15:8] = MSB; [7:0] = LSB + * SMB: [15:8] = LSB; [7:0] = MSB + * As a practical matter, this controller is very + * specifically for use with DIMMs, the SPD (and + * NVDIMM controllers) are only accessed as bytes, + * the temperature sensor is only accessed as words, and + * the temperature sensors are I2C. Thus, byte-swap the + * word. + */ + lword = htobe16(lword); + } else { + /* For byte operations, the data goes in the LSB, and + * the MSB is a don't care. + */ + lword = (uint16_t) (lbyte & 0xff); + } + cmd_val |= lword; + } + + /* Write the updated value to the control register first, to disable + * the hardware TSOD polling. + */ + pci_write_config(sc->imcsmb_pci, sc->regs->smb_cntl, cntl_val, 4); + + /* Poll on the BUSY bit in the status register until clear, or timeout. + * We just cleared the auto-poll bit, so we need to make sure the device + * is idle before issuing a command. We can safely timeout after 35 ms, + * as this is the maximum time the SMBus spec allows for a transaction. + */ + for (i = 4; i != 0; i--) { + stat_val = pci_read_config(sc->imcsmb_pci, sc->regs->smb_stat, + 4); + if ((stat_val & IMCSMB_STATUS_BUSY_BIT) == 0) { + break; + } + pause("imcsmb", 10 * hz / 1000); + } + + if (i == 0) { + device_printf(sc->dev, + "transfer: timeout waiting for device to settle\n"); + } + + /* Now that polling has stopped, we can write the command register. This + * starts the SMBus command. + */ + pci_write_config(sc->imcsmb_pci, sc->regs->smb_cmd, cmd_val, 4); + + /* Wait for WRITE_DATA_DONE/READ_DATA_VALID to be set, or timeout and + * fail. We wait up to 35ms. + */ + for (i = 35000; i != 0; i -= 10) + { + DELAY(10); + stat_val = pci_read_config(sc->imcsmb_pci, sc->regs->smb_stat, + 4); + /* For a write, the bits holding the data contain the data being + * written. You'd think that would cause the READ_DATA_VALID bit + * to be cleared, because the data bits no longer contain valid + * data from the most recent read operation. While that would be + * logical, that's not the case here: READ_DATA_VALID is only + * cleared when starting a read operation, and WRITE_DATA_DONE + * is only cleared when starting a write operation. + */ + if (write_op) { + if ((stat_val & IMCSMB_STATUS_WRITE_DATA_DONE) != 0) { + break; + } + } else { + if ((stat_val & IMCSMB_STATUS_READ_DATA_VALID) != 0) { + break; + } + } + } + if (i == 0) { + rc = SMB_ETIMEOUT; + device_printf(dev, "transfer timeout\n"); + goto out; + } + + /* It is generally the case that this bit indicates non-ACK, but it + * could also indicate other bus errors. There's no way to tell the + * difference. + */ + if ((stat_val & IMCSMB_STATUS_BUS_ERROR_BIT) != 0) { + /* While it is not documented, empirically, SPD page-change + * commands (writes with DTI = 0x60) always complete with the + * error bit set. So, ignore it in those cases. + */ + if ((slave & 0xf0) != 0x60) { + rc = SMB_ENOACK; + goto out; + } + } + + /* For a read operation, copy the data out */ + if (write_op == 0) { + if (word_op) { + /* The data is returned in bits [15:0]; as discussed + * above, byte-swap. + */ + lword = (uint16_t) (stat_val & 0xffff); + lword = htobe16(lword); + *word = lword; + } else { + /* The data is returned in bits [7:0] */ + lbyte = (uint8_t) (stat_val & 0xff); + *byte = lbyte; + } + } + + /* A lack of an error is, de facto, success. */ + rc = SMB_ENOERR; + +out: + /* Restore the original value of the control register. */ + pci_write_config(sc->imcsmb_pci, sc->regs->smb_cntl, orig_cntl_val, 4); + return (rc); +} + +/* Our device class */ +static devclass_t imcsmb_devclass; + +/* Device methods */ +static device_method_t imcsmb_methods[] = { + /* Device interface */ + DEVMETHOD(device_attach, imcsmb_attach), + DEVMETHOD(device_detach, imcsmb_detach), + DEVMETHOD(device_probe, imcsmb_probe), + + /* smbus methods */ + DEVMETHOD(smbus_callback, imcsmb_callback), + DEVMETHOD(smbus_readb, imcsmb_readb), + DEVMETHOD(smbus_readw, imcsmb_readw), + DEVMETHOD(smbus_writeb, imcsmb_writeb), + DEVMETHOD(smbus_writew, imcsmb_writew), + + DEVMETHOD_END +}; + +static driver_t imcsmb_driver = { + .name = "imcsmb", + .methods = imcsmb_methods, + .size = sizeof(struct imcsmb_softc), +}; + +DRIVER_MODULE(imcsmb, imcsmb_pci, imcsmb_driver, imcsmb_devclass, 0, 0); +MODULE_DEPEND(imcsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +MODULE_VERSION(imcsmb, 1); + +DRIVER_MODULE(smbus, imcsmb, smbus_driver, smbus_devclass, 0, 0); + +/* vi: set ts=8 sw=4 sts=8 noet: */ Added: head/sys/dev/imcsmb/imcsmb_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/imcsmb/imcsmb_pci.c Sat Mar 3 01:53:51 2018 (r330304) @@ -0,0 +1,345 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) + * + * Copyright (c) 2017-2018 Panasas + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "imcsmb_reg.h" +#include "imcsmb_var.h" + +/* (Sandy,Ivy)bridge-Xeon and (Has,Broad)well-Xeon CPUs contain one or two + * "Integrated Memory Controllers" (iMCs), and each iMC contains two separate + * SMBus controllers. These are used for reading SPD data from the DIMMs, and + * for reading the "Thermal Sensor on DIMM" (TSODs). The iMC SMBus controllers + * are very simple devices, and have limited functionality compared to + * full-fledged SMBus controllers, like the one in Intel ICHs and PCHs. + * + * The publicly available documentation for the iMC SMBus controllers can be + * found in the CPU datasheets for (Sandy,Ivy)bridge-Xeon and + * (Has,broad)well-Xeon, respectively: + * + * https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/ + * Sandybridge xeon-e5-1600-2600-vol-2-datasheet.pdf + * Ivybridge xeon-e5-v2-datasheet-vol-2.pdf + * Haswell xeon-e5-v3-datasheet-vol-2.pdf + * Broadwell xeon-e5-v4-datasheet-vol-2.pdf + * + * Another useful resource is the Linux driver. It is not in the main tree. + * + * https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg840043.html + * + * The iMC SMBus controllers do not support interrupts (thus, they must be + * polled for IO completion). All of the iMC registers are in PCI configuration + * space; there is no support for PIO or MMIO. As a result, this driver does + * not need to perform and newbus resource manipulation. + * + * Because there are multiple SMBus controllers sharing the same PCI device, + * this driver is actually *two* drivers: + * + * - "imcsmb" is an smbus(4)-compliant SMBus controller driver + * + * - "imcsmb_pci" recognizes the PCI device and assigns the appropriate set of + * PCI config registers to a specific "imcsmb" instance. + */ + +/* Depending on the motherboard and firmware, the TSODs might be polled by + * firmware. Therefore, when this driver accesses these SMBus controllers, the + * firmware polling must be disabled as part of requesting the bus, and + * re-enabled when releasing the bus. Unfortunately, the details of how to do + * this are vendor-specific. Contact your motherboard vendor to get the + * information you need to do proper implementations. + * + * For NVDIMMs which conform to the ACPI "NFIT" standard, the ACPI firmware + * manages the NVDIMM; for those which pre-date the standard, the operating + * system interacts with the NVDIMM controller using a vendor-proprietary API + * over the SMBus. In that case, the NVDIMM driver would be an SMBus slave + * device driver, and would interface with the hardware via an SMBus controller + * driver such as this one. + */ + +/* PCIe device IDs for (Sandy,Ivy)bridge)-Xeon and (Has,Broad)well-Xeon */ +#define PCI_VENDOR_INTEL 0x8086 +#define IMCSMB_PCI_DEV_ID_IMC0_SBX 0x3ca8 +#define IMCSMB_PCI_DEV_ID_IMC0_IBX 0x0ea8 +#define IMCSMB_PCI_DEV_ID_IMC0_HSX 0x2fa8 +#define IMCSMB_PCI_DEV_ID_IMC0_BDX 0x6fa8 +/* (Sandy,Ivy)bridge-Xeon only have a single memory controller per socket */ +#define IMCSMB_PCI_DEV_ID_IMC1_HSX 0x2f68 +#define IMCSMB_PCI_DEV_ID_IMC1_BDX 0x6f68 + +/* There are two SMBus controllers in each device. These define the registers + * for each of these devices. + */ +static struct imcsmb_reg_set imcsmb_regs[] = { + { + .smb_stat = IMCSMB_REG_STATUS0, + .smb_cmd = IMCSMB_REG_COMMAND0, + .smb_cntl = IMCSMB_REG_CONTROL0 + }, + { + .smb_stat = IMCSMB_REG_STATUS1, + .smb_cmd = IMCSMB_REG_COMMAND1, + .smb_cntl = IMCSMB_REG_CONTROL1 + }, +}; + +static struct imcsmb_pci_device { + uint16_t id; + char *name; +} imcsmb_pci_devices[] = { + {IMCSMB_PCI_DEV_ID_IMC0_SBX, + "Intel Sandybridge Xeon iMC 0 SMBus controllers" }, + {IMCSMB_PCI_DEV_ID_IMC0_IBX, + "Intel Ivybridge Xeon iMC 0 SMBus controllers" }, + {IMCSMB_PCI_DEV_ID_IMC0_HSX, + "Intel Haswell Xeon iMC 0 SMBus controllers" }, + {IMCSMB_PCI_DEV_ID_IMC1_HSX, + "Intel Haswell Xeon iMC 1 SMBus controllers" }, + {IMCSMB_PCI_DEV_ID_IMC0_BDX, + "Intel Broadwell Xeon iMC 0 SMBus controllers" }, + {IMCSMB_PCI_DEV_ID_IMC1_BDX, + "Intel Broadwell Xeon iMC 1 SMBus controllers" }, + {0, NULL}, +}; + +/* Device methods. */ +static int imcsmb_pci_attach(device_t dev); +static int imcsmb_pci_detach(device_t dev); +static int imcsmb_pci_probe(device_t dev); + +/** + * device_attach() method. Set up the PCI device's softc, then explicitly create + * children for the actual imcsmbX controllers. Set up the child's ivars to + * point to the proper set of the PCI device's config registers. + * + * @author Joe Kloss, rpokala + * + * @param[in,out] dev + * Device being attached. + */ +static int +imcsmb_pci_attach(device_t dev) +{ + struct imcsmb_pci_softc *sc; + device_t child; + int rc; + int unit; + + /* Initialize private state */ + sc = device_get_softc(dev); + sc->dev = dev; + sc->semaphore = 0; + + /* Create the imcsmbX children */ + for (unit = 0; unit < 2; unit++) { + child = device_add_child(dev, "imcsmb", -1); + if (child == NULL) { + /* Nothing has been allocated, so there's no cleanup. */ + device_printf(dev, "Child imcsmb not added\n"); + rc = ENXIO; + goto out; + } + /* Set the child's ivars to point to the appropriate set of + * the PCI device's registers. + */ + device_set_ivars(child, &imcsmb_regs[unit]); + } + + /* Attach the imcsmbX children. */ + if ((rc = bus_generic_attach(dev)) != 0) { + device_printf(dev, "failed to attach children: %d\n", rc); + goto out; + } + +out: + return (rc); +} + +/** + * device_detach() method. attach() didn't do any allocations, so all that's + * needed here is to free up any downstream drivers and children. + * + * @author Joe Kloss + * + * @param[in] dev + * Device being detached. + */ +static int +imcsmb_pci_detach(device_t dev) +{ + int rc; + + /* Detach any attached drivers */ + rc = bus_generic_detach(dev); + if (rc == 0) { + /* Remove all children */ + rc = device_delete_children(dev); + } + + return (rc); +} + +/** + * device_probe() method. Look for the right PCI vendor/device IDs. + * + * @author Joe Kloss, rpokala + * + * @param[in,out] dev + * Device being probed. + */ +static int +imcsmb_pci_probe(device_t dev) +{ + struct imcsmb_pci_device *pci_device; + int rc; + uint16_t pci_dev_id; + + rc = ENXIO; + + if (pci_get_vendor(dev) != PCI_VENDOR_INTEL) { + goto out; + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Mar 3 02:06:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F292DF37656; Sat, 3 Mar 2018 02:06:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EBF186926; Sat, 3 Mar 2018 02:06:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 998E61FD18; Sat, 3 Mar 2018 02:06:48 +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 w2326mXR075199; Sat, 3 Mar 2018 02:06:48 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2326m5N075198; Sat, 3 Mar 2018 02:06:48 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803030206.w2326m5N075198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 3 Mar 2018 02:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330306 - head/sys/powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/ps3 X-SVN-Commit-Revision: 330306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:06:49 -0000 Author: nwhitehorn Date: Sat Mar 3 02:06:48 2018 New Revision: 330306 URL: https://svnweb.freebsd.org/changeset/base/330306 Log: Honor physical memory regions marked unavailable in the FDT, when present. The most notable of these is the FDT itself, which it is a bad idea to overwrite. Modified: head/sys/powerpc/ps3/platform_ps3.c Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Sat Mar 3 02:04:40 2018 (r330305) +++ head/sys/powerpc/ps3/platform_ps3.c Sat Mar 3 02:06:48 2018 (r330306) @@ -141,37 +141,38 @@ void ps3_mem_regions(platform_t plat, struct mem_region *phys, int *physsz, struct mem_region *avail_regions, int *availsz) { - uint64_t lpar_id, junk, ppe_id; + uint64_t lpar_id, junk; + int i; - /* Get real mode memory region */ - avail_regions[0].mr_start = 0; - lv1_get_logical_partition_id(&lpar_id); - lv1_get_logical_ppe_id(&ppe_id); - lv1_get_repository_node_value(lpar_id, - lv1_repository_string("bi") >> 32, lv1_repository_string("pu"), - ppe_id, lv1_repository_string("rm_size"), - &avail_regions[0].mr_size, &junk); + /* Prefer device tree information if available */ + if (OF_finddevice("/") != -1) { + ofw_mem_regions(phys, physsz, avail_regions, availsz); + } else { + /* Real mode memory region is first segment */ + phys[0].mr_start = 0; + phys[0].mr_size = ps3_real_maxaddr(plat); + *physsz = *availsz = 1; + avail_regions[0] = phys[0]; + } /* Now get extended memory region */ + lv1_get_logical_partition_id(&lpar_id); lv1_get_repository_node_value(lpar_id, lv1_repository_string("bi") >> 32, lv1_repository_string("rgntotal"), 0, 0, - &avail_regions[1].mr_size, &junk); + &phys[*physsz].mr_size, &junk); + for (i = 0; i < *physsz; i++) + phys[*physsz].mr_size -= phys[i].mr_size; /* Convert to maximum amount we can allocate in 16 MB pages */ - avail_regions[1].mr_size -= avail_regions[0].mr_size; - avail_regions[1].mr_size -= avail_regions[1].mr_size % (16*1024*1024); + phys[*physsz].mr_size -= phys[*physsz].mr_size % (16*1024*1024); /* Allocate extended memory region */ - lv1_allocate_memory(avail_regions[1].mr_size, 24 /* 16 MB pages */, - 0, 0x04 /* any address */, &avail_regions[1].mr_start, &junk); - - *availsz = 2; - - if (phys != NULL) { - memcpy(phys, avail_regions, sizeof(*phys)*2); - *physsz = 2; - } + lv1_allocate_memory(phys[*physsz].mr_size, 24 /* 16 MB pages */, + 0, 0x04 /* any address */, &phys[*physsz].mr_start, &junk); + avail_regions[*availsz] = phys[*physsz]; + (*physsz)++; + (*availsz)++; } static u_long @@ -260,12 +261,22 @@ ps3_reset(platform_t plat) static vm_offset_t ps3_real_maxaddr(platform_t plat) { - struct mem_region *phys, *avail; - int nphys, navail; + uint64_t lpar_id, junk, ppe_id; + static uint64_t rm_maxaddr = 0; - mem_regions(&phys, &nphys, &avail, &navail); + if (rm_maxaddr == 0) { + /* Get real mode memory region */ + lv1_get_logical_partition_id(&lpar_id); + lv1_get_logical_ppe_id(&ppe_id); - return (phys[0].mr_start + phys[0].mr_size); + lv1_get_repository_node_value(lpar_id, + lv1_repository_string("bi") >> 32, + lv1_repository_string("pu"), + ppe_id, lv1_repository_string("rm_size"), + &rm_maxaddr, &junk); + } + + return (rm_maxaddr); } static void From owner-svn-src-head@freebsd.org Sat Mar 3 02:04:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08678F3735E; Sat, 3 Mar 2018 02:04:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF3BB86638; Sat, 3 Mar 2018 02:04:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA2E11FD04; Sat, 3 Mar 2018 02:04:40 +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 w2324ese075082; Sat, 3 Mar 2018 02:04:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2324eVJ075079; Sat, 3 Mar 2018 02:04:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803030204.w2324eVJ075079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 3 Mar 2018 02:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330305 - in head/sys/powerpc: powerpc ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys/powerpc: powerpc ps3 X-SVN-Commit-Revision: 330305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:04:41 -0000 Author: nwhitehorn Date: Sat Mar 3 02:04:40 2018 New Revision: 330305 URL: https://svnweb.freebsd.org/changeset/base/330305 Log: Remove assumption that all physical memory is available to the kernel and that the physical and available memory arrays are interchangeable. Modified: head/sys/powerpc/powerpc/platform.c head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Sat Mar 3 01:53:51 2018 (r330304) +++ head/sys/powerpc/powerpc/platform.c Sat Mar 3 02:04:40 2018 (r330305) @@ -156,10 +156,14 @@ mem_regions(struct mem_region **phys, int *physsz, str } } - *phys = pregions; - *avail = aregions; - *physsz = npregions; - *availsz = naregions; + if (phys != NULL) + *phys = pregions; + if (avail != NULL) + *avail = aregions; + if (physsz != NULL) + *physsz = npregions; + if (availsz != NULL) + *availsz = naregions; } int Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Sat Mar 3 01:53:51 2018 (r330304) +++ head/sys/powerpc/ps3/ps3bus.c Sat Mar 3 02:04:40 2018 (r330305) @@ -337,7 +337,7 @@ ps3bus_attach(device_t self) rman_manage_region(&sc->sc_intr_rman, 0, ~0); /* Get memory regions for DMA */ - mem_regions(&sc->regions, &sc->rcount, &sc->regions, &sc->rcount); + mem_regions(&sc->regions, &sc->rcount, NULL, NULL); /* * Probe all the PS3's buses. From owner-svn-src-head@freebsd.org Sat Mar 3 02:47:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D2F6F392F6; Sat, 3 Mar 2018 02:47:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 188ED681AF; Sat, 3 Mar 2018 02:47:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 8B7FB3CA145; Sat, 3 Mar 2018 13:47:42 +1100 (AEDT) Date: Sat, 3 Mar 2018 13:47:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Eitan Adler Subject: Re: svn commit: r330285 - head/sys/sys In-Reply-To: <20180302181934.GF3194@kib.kiev.ua> Message-ID: <20180303130511.N1283@besplex.bde.org> References: <201803021647.w22Gl2t7092316@repo.freebsd.org> <20180302181934.GF3194@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=8ggJXkvBAAAA:8 a=ETG4cSW3j0_Y3xsAe1QA:9 a=CjuIK1q_8ugA:10 a=GHEzSmbhvkB-cyu2CITy:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:47:53 -0000 On Fri, 2 Mar 2018, Konstantin Belousov wrote: > On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: >> ... >> I think use of _Nonnull attributes in the threading functions may also >> be a waste (I introduced them mostly to be compatible with Android). >> FWIW, Dragonfly sprinkled some restrict there recently: >> >> http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 >> >> Just in case someone is considering more cleanups. > > This is not a cleanup for me, but a needed change. Right now x86 > copyouts are implemented in asm, so whatever damage is done to the > prototypes, only effect is at the caller side. In my work, i386 copyouts > are done in C, so it starts matter. That seems slow, especially for small sizes as are common for syscall args (in 1 of my versions, copyin() of args is optimized to fuword() in a loop, and fuword() is optimized to not use pcb_onfault, so it is not much more than 1 memory access. However, in your i386 version this optimization would be negative since the slow part is switching the map, so fuword() should never be used to access multiple words). However, copyinstr() and copystr() should never have been "optimized" by writing them in asm. On x86, their asm is badly written so they are slower than simple C versions except on 8088's and maybe 8086's and maybe on the original i386. (8088's were limited mainly by instruction bandwidth and the original i386 wasn't much better, so short CISC instructions like lodsb and stosb tended to be faster than larger separate instructions despite their large setup overheads. > Also I looked at the dragonfly commit because I become curious what do you > mean by threading functions. The first example was > int pthread_attr_getguardsize(const pthread_attr_t * __restrict, > - size_t *); > + size_t * __restrict); > POSIX agrees with the dragonfly change, but I do not understand it. > Aliasing rules already disallow the first and second arguments to point > to the same memory, because they have different types. (1) thread_attr_t is opaque, so the types might be the same. (2) pthread_attr_t might be a pointer to a struct/union containing a size_t. (3) perhaps other reasons. I'm not sure how 'restrict interacts with global variables or even it it prevents the interaction in (2). A previous discussion showed that const doesn't make types different enough to prevent aliasing. Similarly for volatile. Similarly for other pointers to {opaque, struct/union, or even integer} types. size_t can't be aliased to int, but it can be aliased to any unsigned type in C and to any unsigned type not smaller than uint16_t in POSIX (POSIX but not C requires u_char == uint8_t, so size_t can't be u_char in POSIX but it can be u_char in C). Bruce From owner-svn-src-head@freebsd.org Sat Mar 3 02:49:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 595D0F395E6; Sat, 3 Mar 2018 02:49:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B89E683B0; Sat, 3 Mar 2018 02:49:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 064C02042B; Sat, 3 Mar 2018 02:49:50 +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 w232nnCb095288; Sat, 3 Mar 2018 02:49:49 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w232nnXM095284; Sat, 3 Mar 2018 02:49:49 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201803030249.w232nnXM095284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 3 Mar 2018 02:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330309 - in head/share/man: man4 man9 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/share/man: man4 man9 X-SVN-Commit-Revision: 330309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 02:49:50 -0000 Author: gonzo Date: Sat Mar 3 02:49:49 2018 New Revision: 330309 URL: https://svnweb.freebsd.org/changeset/base/330309 Log: [fdt_pinctrl] Add man pages for fdt_pinctrl driver - Add fdt_pinctrl(4) with general information for the driver - Add fdt_pinctrl(9) with fdt_pinctrl KPI description Reviewed by: ian, manu, wblock MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14235 Added: head/share/man/man4/fdt_pinctrl.4 (contents, props changed) head/share/man/man9/fdt_pinctrl.9 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man9/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Mar 3 02:39:54 2018 (r330308) +++ head/share/man/man4/Makefile Sat Mar 3 02:49:49 2018 (r330309) @@ -165,6 +165,7 @@ MAN= aac.4 \ fd.4 \ fdc.4 \ fdt.4 \ + fdt_pinctrl.4 \ fdtbus.4 \ ffclock.4 \ filemon.4 \ Added: head/share/man/man4/fdt_pinctrl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/fdt_pinctrl.4 Sat Mar 3 02:49:49 2018 (r330309) @@ -0,0 +1,127 @@ +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 2, 2018 +.Dt "FDT_PINCTRL" 4 +.Os +.Sh NAME +.Nm fdt_pinctrl +.Nd FDT I/O pin multiplexing support +.Sh SYNOPSIS +.Cd "device fdt_pinctrl" +.Sh DESCRIPTION +.Pp +Pin multiplexing is a technology used to re-purpose a single +physical connection (depending on chip packaging it may be +pin, ball, or pad) to pull signal from one of SoC internal +controllers to peripheral devices. +For example, based on the actual device design, a single SoC chip +pin can perform any of these roles: SPI clock, I2C +data, GPIO pin, or PWM signal. +Function selection is performed by the pinmux controller, a SoC +hardware block, usually controlled a set of registers. +Pinmux controller capabilities and register format depend +on the actual hardware implementation. +.Pp +On +.Xr fdt 4 +based systems, the pinmux controller is represented by a node in +the device tree. +It may have any number of child nodes representing pin +configuration groups. +Properties of such nodes are hardware-specific and handled +by individual pinctrl drivers. +.Ss Example 1 +Pinmux controller device tree node +.Bd -literal +pinctrl@7e220000 { + compatible = "vndr,soc1715-pinctrl"; + reg = <0x7e220000 0x100> + + spi0_pins: spi0 { + vndr,pins = <11 12> + vndr,functions = + } + + i2c0_pins: i2c0 { + ... + } +} +.Ed +.Pp +Client devices are hardware devices that require certain pin +configurations to function properly. +Depending on the state the device is in (active, idle) it might +require different pin configurations. +Each configuration is described by setting the pinctrl-N +property to the list of phandles pointing to specific child +nodes of the pinmux controller node. +N is an integer value starting with 0 and incremented by 1 +for every new set of pin configurations. +pinctrl-0 is a default configuration that is applied in the +.Xr fdt_pinctrl_configure_tree 9 +call. +In addition to referring to pin configurations by index, they +can be referred to by name if the pinctrl-names property is set. +The value of pinctrl-names is a list of strings with names for +each pinctrl-N property. +Client devices can request specific configuration using +.Xr fdt_pinctrl_configure 9 +and +.Xr fdt_pinctrl_configure_by_name 9 . +.Ss Example 2 +.Bd -literal +backlight@7f000000 { + compatible = "vndr,vndr-bl" + reg = <0x7f000000 0x20> + ... + pinctrl-name = "active", "idle" + pinctrl-0 = <&backlight_active_pins> + pinctrl-1 = <&backlight_idle_pins> +} +.Ed +.Pp +The pinctrl driver should implement FDT_PINCTRL_CONFIGURE +method, register itself as pin configuration handler by +calling fdt_pinctrl_register function, and call +.Xr fdt_pinctrl_configure_tree 9 +to configure pins for all enabled devices (device where +the "status" property is not set to "disabled"). +.Sh SEE ALSO +.Xr fdt_pinctrl 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was developed by +.An \&Ian Lepore Aq Mt ian@FreeBSD.org . +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Mar 3 02:39:54 2018 (r330308) +++ head/share/man/man9/Makefile Sat Mar 3 02:49:49 2018 (r330309) @@ -126,6 +126,7 @@ MAN= accept_filter.9 \ eventtimers.9 \ extattr.9 \ fail.9 \ + fdt_pinctrl.9 \ fetch.9 \ firmware.9 \ fpu_kern.9 \ @@ -945,6 +946,10 @@ MLINKS+=fail.9 KFAIL_POINT_CODE.9 \ fail.9 KFAIL_POINT_GOTO.9 \ fail.9 KFAIL_POINT_RETURN.9 \ fail.9 KFAIL_POINT_RETURN_VOID.9 +MLINKS+=fdt_pinctrl.9 fdt_pinctrl_configure.9 \ + fdt_pinctrl.9 fdt_pinctrl_configure_by_name.9 \ + fdt_pinctrl.9 fdt_pinctrl_configure_tree.9 \ + fdt_pinctrl.9 fdt_pinctrl_register.9 MLINKS+=fetch.9 fubyte.9 \ fetch.9 fuswintr.9 \ fetch.9 fuword.9 \ Added: head/share/man/man9/fdt_pinctrl.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/fdt_pinctrl.9 Sat Mar 3 02:49:49 2018 (r330309) @@ -0,0 +1,161 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 2, 2018 +.Dt fdt_pinctrl 9 +.Os +.Sh NAME +.Nm fdt_pinctrl +.Nd helper functions for FDT pinmux controller drivers +.Sh SYNOPSIS +.In dev/fdt/fdt_pinctrl.h +.Ft int +.Fn fdt_pinctrl_configure "device_t client" "u_int index" +.Ft int +.Fn fdt_pinctrl_configure_by_name "device_t client" "const char * name" +.Ft int +.Fn fdt_pinctrl_register "device_t pinctrl" "const char *pinprop" +.Ft int +.Fn fdt_pinctrl_configure_tree "device_t pinctrl" +.Sh DESCRIPTION +.Xr fdt_pinctrl 4 +provides an API for manipulating I/O pin configurations on +pinmux controllers and pinmux clients. +On the controller side, the standard newbus probe and +attach methods are implemented. +This driver also implements the +.Fn fdt_pinctrl_configure +method, in which it calls the +.Fn fdt_pinctrl_register +function to register itself as a pinmux controller. +Then +.Fn fdt_pinctrl_configure_tree +is used to walk the device tree and configure pins specified by the pinctrl-0 +property for all active devices. +If a client device requires a pin configuration change at some +point of its lifecycle, it uses the +.Fn fdt_pinctrl_configure +or +.Fn fdt_pinctrl_configure_by_name +functions. +.Pp +.Fn fdt_pinctrl_configure +is used by client device +.Fa client +to request a pin configuration +described by the pinctrl-N property with index +.Fa index . +.Pp +.Fn fdt_pinctrl_configure_by_name +is used by client device +.Fa client +to request the pin configuration with name +.Fa name . +.Pp +.Fn fdt_pinctrl_register +registers a pinctrl driver so that it can be used by other devices which call +.Fn fdt_pinctrl_configure +or +.Fn fdt_pinctrl_configure_by_name . +The +.Fa pinprop +argument is the name of a property that +identifies each descendant of the pinctrl +node. +The pinctrl node is a pin configuration +node whose xref phandle can be passed to +.Fn FDT_PINCTRL_CONFIGURE . +If +.Fa pinprop +is +.Dv NULL , +every descendant node is registered. +It is possible for the driver to register itself +as a pinmux controller for more than one pin property type +by calling +.Fn fdt_pinctrl_register +multiple types. +.Pp +.Fn fdt_pinctrl_configure_tree +walks through enabled devices in the device tree. +If the pinctrl-0 property contains references +to child nodes of the specified pinctrl device, +their pins are configured. +.Sh EXAMPLES +.Bd -literal +static int +foo_configure_pins(device_t dev, phandle_t cfgxref) +{ + phandle_t cfgnode; + uint32_t *pins, *functions; + int npins, nfunctions; + + cfgnode = OF_node_from_xref(cfgxref); + pins = NULL; + npins = OF_getencprop_alloc(cfgnode, "foo,pins", sizeof(*pins), + (void **)&pins); + functions = NULL; + nfunctions = OF_getencprop_alloc(cfgnode, "foo,functions", + sizeof(*functions), (void **)&functions); + ... +} + +static int +foo_attach(device_t dev) +{ + ... + + fdt_pinctrl_register(dev, "foo,pins"); + /* + * It is possible to register more than one pinprop handler + */ + fdt_pinctrl_register(dev, "bar,pins"); + fdt_pinctrl_configure_tree(dev); + + return (0); +} + +static device_method_t foo_methods[] = { + ... + + /* fdt_pinctrl interface */ + DEVMETHOD(fdt_pinctrl_configure, foo_configure_pins), + + /* Terminate method list */ + DEVMETHOD_END +}; + +DRIVER_MODULE(foo, simplebus, foo_driver, foo_devclass, NULL, NULL); +.Ed +.Sh SEE ALSO +.Xr fdt_pinctrl 4 , +.Sh AUTHORS +This manual page was written by +.An Oleksandr Tymoshenko . From owner-svn-src-head@freebsd.org Sat Mar 3 03:48:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DDDEF3BCF0; Sat, 3 Mar 2018 03:48:16 +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 AB9656AAA0; Sat, 3 Mar 2018 03:48:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id C81BF1058B2; Sat, 3 Mar 2018 14:48:06 +1100 (AEDT) Date: Sat, 3 Mar 2018 14:48:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330294 - head/sys/kern In-Reply-To: <201803022126.w22LQRKH034839@repo.freebsd.org> Message-ID: <20180303135130.L1442@besplex.bde.org> References: <201803022126.w22LQRKH034839@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=EYzh-tRUpJSNR7TSCSsA:9 a=qtO0BB4Uwvb006sz:21 a=UzmnqtpqlAK4NFog:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 03:48:16 -0000 On Fri, 2 Mar 2018, Mateusz Guzik wrote: > Log: > sx: fix adaptive spinning broken in r327397 > > The condition was flipped. > > In particular heavy multithreaded kernel builds on zfs started suffering > due to nested sx locks. > > For instance make -s -j 128 buildkernel: > > before: 3326.67s user 1269.62s system 6981% cpu 1:05.84 total > after: 3365.55s user 911.27s system 6871% cpu 1:02.24 total What are you doing to make builds so slow? Kernel builds here take about 5 seconds. A full world takes about 120 seconds. This is with old (~5.2) worlds. (I don't like newer worlds since they are so much slower. Yesterday I did more than 200 makeworlds looking for a lost wakeup for idle threads. When makeworld has a sys time of 50-100 seconds, it is hard to see the effect of optimizations in the noise. I recently rewrote the statistics reporting to show real, user, sys, interrupt, total = sum of these and idle times for the whole system. Based on kern.cp_time. This is innaccurate, but it is much better than rusage times which can't show times for other threads or even interrupt and idle times for threads in the build's tree. Results look like: 128.57r 566.24u 77.10s 0.83i 644.17t 384.36I 408X i386-12-cold-102-40 168.53r 559.01u 76.95s 1.07i 637.03t 711.19I 735X i386-12-cold-102-40 Here I is the idle time according to kern.cp_time and X is the idle time according to td_runtime. The latter is much more accurate and shows that there is an error of about 24 seconds = 24 * (stathz = 127) = 3048 ticks in the u+s+i vs I ticks (u+s+i is too high by 24 seconds or 3 seconds per CPU, and I is too low by 24 seconds). The second run shows an enormous variance in the idle time -- of 327 seconds or 41 seconds per CPU. This pessimization was mostly the result of enabling PREEMPTION and IPI_PREEMPTION, which was supposed to decrease the variance. Normally I turn these off to reduce context switches, and this somehow reduces the variance to more like 5 seconds per CPU. Context switches turned out to be mostly for waking up idle threads and this should not be affected by PREEMPTION, and my optimization of turning off PREEMPTION makes little difference. That it helps on average and for the best case was determined by running many more than a few hundred makeworlds. Increasing kern.sched.quantum makes similarly little difference. I don't normally use that since it was a pessimization on average. Now I think I understand why it is a pessimization: it saves a little u+s+i time by reducing context switches, but increases I time by reducing compensation for the missing wakeups. These benchmarks are with 4BSD. ULE is slightly slower and has lower variance but its variance is high enough to indicate missed wakeups. I can reduce the variance using spinloops, so that idle threads never sleep. This only works with HTT turned off (the above is wirh 4 cores times 2 threads). With HTT on, spinloops in idle threads slow down running threads by abiut 50%. ULE is aware of this and avoids internal spinloops for HTT cases. 4BSD and lower levels are not aware of this, but it takes the misconfigurations machdep.idle_mwait=0 and machdep.idle= spin to reach the spinloop case. Some times for ULE: 127.06r 565.81u 79.40s 0.65i 645.86t 370.58I 394X i386-12-cold-102-40 125.83r 566.72u 79.10s 0.61i 646.43t 360.24I 382X i386-12-warm-102-40 130.33r 565.56u 79.41s 0.65i 645.62t 397.02I 417X i386-12-cold-102-40 118.70r 566.55u 80.46s 0.54i 647.56t 302.05I 325X i386-12-warm-102-40 127.09r 569.36u 77.07s 0.98i 647.41t 369.28I 390X i386-12-cold-102-40 115.80r 570.67u 79.17s 0.63i 650.46t 275.90I 297X i386-12-warm-102-40 115.80r is the best time seen recently. The u+s+i = t times average a couple of seconds higher for ULE. This is not quite in the noise -- 2 seconds for 8 CPUs is 0.25 seconds in real time. The noise in the I time dominates the signal in the u+s+i = t times, so it isn't clear if ULE is doing anything better or worse. If the u+s+i times can be trusted, then ULE's affinity optimizations are apparently negative. I have some optimizations in 4BSD too. These might be negative too. One seemed to work, but only on 1 system, and recent benchmarks indicated that this is just because it accidentally reduced lost wakeups. Its improvements for u+s+i are in the noise. Bruce From owner-svn-src-head@freebsd.org Sat Mar 3 08:48:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99173F2708F; Sat, 3 Mar 2018 08:48:17 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7D775468; Sat, 3 Mar 2018 08:48:17 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 4766A49F9; Sat, 3 Mar 2018 08:48:17 +0000 (UTC) Date: Sat, 3 Mar 2018 08:48:17 +0000 From: Alexey Dokuchaev To: Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309017 - in head/sys: cddl/compat/opensolaris/sys compat/linprocfs fs/tmpfs sys vm Message-ID: <20180303084817.GA66382@FreeBSD.org> References: <201611221813.uAMIDkHQ071392@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201611221813.uAMIDkHQ071392@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 08:48:17 -0000 On Tue, Nov 22, 2016 at 06:13:46PM +0000, Alan Cox wrote: > New Revision: 309017 > URL: https://svnweb.freebsd.org/changeset/base/309017 > > Log: > Remove PG_CACHED-related fields from struct vmmeter, because they are no > longer used. More precisely, they are always zero because the code that > decremented and incremented them no longer exists. > > Bump __FreeBSD_version to mark this change. > > Reviewed by: kib, markj > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D8583 > > Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h > ... > -#define freemem (vm_cnt.v_free_count + vm_cnt.v_cache_count) > +#define freemem vm_cnt.v_free_count This looks correct now. > Modified: head/sys/compat/linprocfs/linprocfs.c > ... > @@ -176,7 +176,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) > * like unstaticizing it just for linprocfs's sake. > */ > buffers = 0; > - cached = vm_cnt.v_cache_count * PAGE_SIZE; > + cached = vm_cnt.v_inactive_count * PAGE_SIZE; Some applications that make calculations based on the readings from the /usr/compat/linux/proc/meminfo are broken after this change, e.g. those that do things like: return (totalMem - (freeMem + buffers + cache)) / totalMem; because now free memory includes cached one, and above formula gives bogus negative result. In `sys/compat/linprocfs/linprocfs.c', memfree is calculated as follows: memtotal = physmem * PAGE_SIZE; /* * The correct thing here would be: * memfree = vm_cnt.v_free_count * PAGE_SIZE; memused = memtotal - memfree; * * but it might mislead linux binaries into thinking there * is very little memory left, so we cheat and tell them that * all memory that isn't wired down is free. */ memused = vm_cnt.v_wire_count * PAGE_SIZE; memfree = memtotal - memused; So, when vm.stats.vm.v_cache_count was yielding some (typically small) result, using the aforementioned trick made sense (because even when vm_cnt.v_free_count added to vm.stats.vm.v_cache_count it would still be rather small). This logic no longer applies after this change. On my 12-CURRENT i386 system, /usr/compat/linux/proc/meminfo reports: % cat /usr/compat/linux/proc/meminfo | head -4 MemTotal: 3132504 kB MemFree: 2925936 kB <<< that's a lot Buffers: 0 kB Cached: 2212196 kB <<< that's also a lot On an older 4.11-STABLE box (also i386), it reports: MemTotal: 521828 kB MemFree: 383976 kB MemShared: 7480 kB Buffers: 0 kB Cached: 22732 kB (can be added to MemFree and still < MemTotal) So either the "cheat" have to go away and vm_cnt.v_free_count used as it should, or cached memory should not be read from vm_cnt.v_inactive_count but estimated somehow else. Which approach would be more correct? ./danfe From owner-svn-src-head@freebsd.org Sat Mar 3 10:21:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA06F2DE7E; Sat, 3 Mar 2018 10:21:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D62D79205; Sat, 3 Mar 2018 10:21:19 +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 w23AL7DF053122 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 3 Mar 2018 12:21:10 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w23AL7DF053122 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w23AL6Wf053121; Sat, 3 Mar 2018 12:21:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 3 Mar 2018 12:21:06 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330285 - head/sys/sys Message-ID: <20180303102106.GG3194@kib.kiev.ua> References: <201803021647.w22Gl2t7092316@repo.freebsd.org> <20180302181934.GF3194@kib.kiev.ua> <20180303130511.N1283@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180303130511.N1283@besplex.bde.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: 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 Mar 2018 10:21:20 -0000 On Sat, Mar 03, 2018 at 01:47:41PM +1100, Bruce Evans wrote: > On Fri, 2 Mar 2018, Konstantin Belousov wrote: > > > On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: > >> ... > >> I think use of _Nonnull attributes in the threading functions may also > >> be a waste (I introduced them mostly to be compatible with Android). > >> FWIW, Dragonfly sprinkled some restrict there recently: > >> > >> http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 > >> > >> Just in case someone is considering more cleanups. > > > > This is not a cleanup for me, but a needed change. Right now x86 > > copyouts are implemented in asm, so whatever damage is done to the > > prototypes, only effect is at the caller side. In my work, i386 copyouts > > are done in C, so it starts matter. > > That seems slow, especially for small sizes as are common for syscall args > (in 1 of my versions, copyin() of args is optimized to fuword() in a loop, > and fuword() is optimized to not use pcb_onfault, so it is not much more > than 1 memory access. However, in your i386 version this optimization > would be negative since the slow part is switching the map, so fuword() > should never be used to access multiple words). Yes. I already explained it in private, the current choice for i386 is either to be neglected very fast, or to get this change to still be a Tier 1 32 bit platform. The change is to make 4/4g split for UVA/KVA. In particular, the change ensures that it is possible to self-host i386 for forthcoming years, which is not practical for armv7 now and would be less so with clang grow. In other news, my system already boots single-user on SMP machine and I have torture tests like setting invalid %ss segment by sigreturn(2), work. There is (much) more to come, but I am happy how the patch progressed so far. > However, copyinstr() and > copystr() should never have been "optimized" by writing them in asm. On > x86, their asm is badly written so they are slower than simple C versions > except on 8088's and maybe 8086's and maybe on the original i386. (8088's > were limited mainly by instruction bandwidth and the original i386 wasn't > much better, so short CISC instructions like lodsb and stosb tended to be > faster than larger separate instructions despite their large setup overheads. Sure, copyinstr() is rewritten in C. The current version of copyout stuff is there: https://kib.kiev.ua/git/gitweb.cgi?p=deviant2.git;a=blob;f=sys/i386/i386/copyout.c;h=9747c06a84d7d2b5faac946f5de57f6a34d96c8c;hb=refs/heads/pcid > > > Also I looked at the dragonfly commit because I become curious what do you > > mean by threading functions. The first example was > > int pthread_attr_getguardsize(const pthread_attr_t * __restrict, > > - size_t *); > > + size_t * __restrict); > > POSIX agrees with the dragonfly change, but I do not understand it. > > Aliasing rules already disallow the first and second arguments to point > > to the same memory, because they have different types. > > (1) thread_attr_t is opaque, so the types might be the same. > (2) pthread_attr_t might be a pointer to a struct/union containing a size_t. > (3) perhaps other reasons. I'm not sure how 'restrict interacts with global > variables or even it it prevents the interaction in (2). A previous > discussion showed that const doesn't make types different enough to > prevent aliasing. Similarly for volatile. > > Similarly for other pointers to {opaque, struct/union, or even integer} types. > size_t can't be aliased to int, but it can be aliased to any unsigned type > in C and to any unsigned type not smaller than uint16_t in POSIX (POSIX > but not C requires u_char == uint8_t, so size_t can't be u_char in POSIX > but it can be u_char in C). I can only summarize it as 'there is no use to have restrict on the pthread_attr_getguardsize() arguments'. From owner-svn-src-head@freebsd.org Sat Mar 3 12:09:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDB1FF362A6; Sat, 3 Mar 2018 12:09:30 +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 3D7437E1E9; Sat, 3 Mar 2018 12:09:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id ABA8F1A47D4; Sat, 3 Mar 2018 23:09:21 +1100 (AEDT) Date: Sat, 3 Mar 2018 23:09:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330285 - head/sys/sys In-Reply-To: <20180303102106.GG3194@kib.kiev.ua> Message-ID: <20180303224422.U3460@besplex.bde.org> References: <201803021647.w22Gl2t7092316@repo.freebsd.org> <20180302181934.GF3194@kib.kiev.ua> <20180303130511.N1283@besplex.bde.org> <20180303102106.GG3194@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=8ggJXkvBAAAA:8 a=pKfNTG1ak-NQXwge5X8A:9 a=CjuIK1q_8ugA:10 a=GHEzSmbhvkB-cyu2CITy:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 12:09:31 -0000 On Sat, 3 Mar 2018, Konstantin Belousov wrote: > On Sat, Mar 03, 2018 at 01:47:41PM +1100, Bruce Evans wrote: >> On Fri, 2 Mar 2018, Konstantin Belousov wrote: >> >>> On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: >>>> ... >>>> I think use of _Nonnull attributes in the threading functions may also >>>> be a waste (I introduced them mostly to be compatible with Android). >>>> FWIW, Dragonfly sprinkled some restrict there recently: >>>> >>>> http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 >>>> >>>> Just in case someone is considering more cleanups. >>> >>> This is not a cleanup for me, but a needed change. Right now x86 >>> copyouts are implemented in asm, so whatever damage is done to the >>> prototypes, only effect is at the caller side. In my work, i386 copyouts >>> are done in C, so it starts matter. >> >> That seems slow, especially for small sizes as are common for syscall args >> (in 1 of my versions, copyin() of args is optimized to fuword() in a loop, >> and fuword() is optimized to not use pcb_onfault, so it is not much more >> than 1 memory access. However, in your i386 version this optimization >> would be negative since the slow part is switching the map, so fuword() >> should never be used to access multiple words). > Yes. I already explained it in private, the current choice for i386 is > either to be neglected very fast, or to get this change to still be a > Tier 1 32 bit platform. The change is to make 4/4g split for UVA/KVA. > In particular, the change ensures that it is possible to self-host i386 > for forthcoming years, which is not practical for armv7 now and would be > less so with clang grow. I use i386 since it is 10-20% faster than amd64 for my applications, and don't like changes that fix this by slowing down the fast case. My applications don't include clang. >> ... >>> Also I looked at the dragonfly commit because I become curious what do you >>> mean by threading functions. The first example was >>> int pthread_attr_getguardsize(const pthread_attr_t * __restrict, >>> - size_t *); >>> + size_t * __restrict); >>> POSIX agrees with the dragonfly change, but I do not understand it. >>> Aliasing rules already disallow the first and second arguments to point >>> to the same memory, because they have different types. >> >> (1) thread_attr_t is opaque, so the types might be the same. >> (2) pthread_attr_t might be a pointer to a struct/union containing a size_t. >> (3) perhaps other reasons. I'm not sure how 'restrict interacts with global >> variables or even it it prevents the interaction in (2). A previous >> discussion showed that const doesn't make types different enough to >> prevent aliasing. Similarly for volatile. >> >> Similarly for other pointers to {opaque, struct/union, or even integer} types. >> size_t can't be aliased to int, but it can be aliased to any unsigned type >> in C and to any unsigned type not smaller than uint16_t in POSIX (POSIX >> but not C requires u_char == uint8_t, so size_t can't be u_char in POSIX >> but it can be u_char in C). > > I can only summarize it as 'there is no use to have restrict on the > pthread_attr_getguardsize() arguments'. No, the summary is 'POSIX is correct to declare almost all arg pointers as restrict, since it is not useful for new APIs to allow aliases, and restrict must be used so that implementations can take advantage of this if they want'. Bruce From owner-svn-src-head@freebsd.org Sat Mar 3 12:43:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3D28F38D56; Sat, 3 Mar 2018 12:43:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6744B7F985; Sat, 3 Mar 2018 12:43:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6227B26722; Sat, 3 Mar 2018 12:43:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23ChBFF096309; Sat, 3 Mar 2018 12:43:11 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23ChBMQ096308; Sat, 3 Mar 2018 12:43:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803031243.w23ChBMQ096308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 3 Mar 2018 12:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330335 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 330335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 12:43:11 -0000 Author: manu Date: Sat Mar 3 12:43:11 2018 New Revision: 330335 URL: https://svnweb.freebsd.org/changeset/base/330335 Log: Introduce BUS_PASS_SUPPORTDEV The reason for this new pass is : The earlier pass names are really specific (interrupt, timer, scheduler etc ..) and making a driver that other device driver (that attach at DEFAULT pass) needs probe at earlier pass can be confiusing. We can live with GPIO driver at INTERRUPT pass because they are often an interrupt controller too but having a usb phy driver probed at RESOURCES (or SCHEDULER for example) is silly. The number was choosen to have a lot of margin if we want to introduce other pass in the futur. Reviewed by: ian, imp, kevans Differential Revision: https://reviews.freebsd.org/D14568 Modified: head/sys/sys/bus.h Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sat Mar 3 11:53:44 2018 (r330334) +++ head/sys/sys/bus.h Sat Mar 3 12:43:11 2018 (r330335) @@ -702,6 +702,7 @@ void bus_data_generation_update(void); #define BUS_PASS_INTERRUPT 40 /* Interrupt controllers. */ #define BUS_PASS_TIMER 50 /* Timers and clocks. */ #define BUS_PASS_SCHEDULER 60 /* Start scheduler. */ +#define BUS_PASS_SUPPORTDEV 100000 /* Drivers which support DEFAULT drivers. */ #define BUS_PASS_DEFAULT __INT_MAX /* Everything else. */ #define BUS_PASS_ORDER_FIRST 0 From owner-svn-src-head@freebsd.org Sat Mar 3 13:19:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 400A2F3B569; Sat, 3 Mar 2018 13:19:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E122480C1F; Sat, 3 Mar 2018 13:19:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D63E026C18; Sat, 3 Mar 2018 13:19:08 +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 w23DJ82G011318; Sat, 3 Mar 2018 13:19:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23DJ8r2011317; Sat, 3 Mar 2018 13:19:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803031319.w23DJ8r2011317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Mar 2018 13:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330336 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 13:19:09 -0000 Author: andrew Date: Sat Mar 3 13:19:08 2018 New Revision: 330336 URL: https://svnweb.freebsd.org/changeset/base/330336 Log: Add the missing GICv3 dev info struct to the ACPI dev info.Previously we would read from the resource list when querying from this. Sponsored by: ABT Systems Ltd Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gic_v3_acpi.c Modified: head/sys/arm64/arm64/gic_v3_acpi.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_acpi.c Sat Mar 3 12:43:11 2018 (r330335) +++ head/sys/arm64/arm64/gic_v3_acpi.c Sat Mar 3 13:19:08 2018 (r330336) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include "gic_v3_var.h" struct gic_v3_acpi_devinfo { + struct gic_v3_devinfo di_gic_dinfo; struct resource_list di_rl; }; @@ -315,6 +316,7 @@ gic_v3_add_children(ACPI_SUBTABLE_HEADER *entry, void resource_list_add(&di->di_rl, SYS_RES_MEMORY, 0, gict->BaseAddress, gict->BaseAddress + 128 * 1024 - 1, 128 * 1024); + di->di_gic_dinfo.gic_domain = -1; sc->gic_nchildren++; device_set_ivars(child, di); } From owner-svn-src-head@freebsd.org Sat Mar 3 13:20:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFE9F3B7D6; Sat, 3 Mar 2018 13:20:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C406F80E10; Sat, 3 Mar 2018 13:20:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF1AF26C2F; Sat, 3 Mar 2018 13:20:44 +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 w23DKif7011443; Sat, 3 Mar 2018 13:20:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23DKiSG011442; Sat, 3 Mar 2018 13:20:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803031320.w23DKiSG011442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Mar 2018 13:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330337 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 13:20:45 -0000 Author: andrew Date: Sat Mar 3 13:20:44 2018 New Revision: 330337 URL: https://svnweb.freebsd.org/changeset/base/330337 Log: Move setting the IRQ base and length into the common GICv3 ITS attach function. This is common across both ACPI and FDT. Sponsored by: ABT Systems Ltd Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Sat Mar 3 13:19:08 2018 (r330336) +++ head/sys/arm64/arm64/gicv3_its.c Sat Mar 3 13:20:44 2018 (r330337) @@ -694,6 +694,10 @@ gicv3_its_attach(device_t dev) sc = device_get_softc(dev); + sc->sc_irq_length = gicv3_get_nirqs(dev); + sc->sc_irq_base = GIC_FIRST_LPI; + sc->sc_irq_base += device_get_unit(dev) * sc->sc_irq_length; + rid = 0; sc->sc_its_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1666,11 +1670,6 @@ gicv3_its_fdt_attach(device_t dev) int err; sc = device_get_softc(dev); - - sc->sc_irq_length = gicv3_get_nirqs(dev); - sc->sc_irq_base = GIC_FIRST_LPI; - sc->sc_irq_base += device_get_unit(dev) * sc->sc_irq_length; - err = gicv3_its_attach(dev); if (err != 0) return (err); @@ -1730,11 +1729,10 @@ gicv3_its_acpi_attach(device_t dev) struct gicv3_its_softc *sc; int err; + sc = device_get_softc(dev); err = gicv3_its_attach(dev); if (err != 0) return (err); - - sc = device_get_softc(dev); sc->sc_pic = intr_pic_register(dev, 1); intr_pic_add_handler(device_get_parent(dev), sc->sc_pic, From owner-svn-src-head@freebsd.org Sat Mar 3 15:10:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C411F437CE; Sat, 3 Mar 2018 15:10:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0C338512C; Sat, 3 Mar 2018 15:10:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBCE027D96; Sat, 3 Mar 2018 15:10:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23FAbaH065868; Sat, 3 Mar 2018 15:10:37 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23FAbeC065867; Sat, 3 Mar 2018 15:10:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803031510.w23FAbeC065867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 3 Mar 2018 15:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330338 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 330338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 15:10:38 -0000 Author: avg Date: Sat Mar 3 15:10:37 2018 New Revision: 330338 URL: https://svnweb.freebsd.org/changeset/base/330338 Log: db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common Since that change the system call stack traces look like this: ... sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0 amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0 So, db_nextframe() stopped recognizing the system call frame. This commit should fix that. Reviewed by: kib MFC after: 4 days Modified: head/sys/amd64/amd64/db_trace.c Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Sat Mar 3 13:20:44 2018 (r330337) +++ head/sys/amd64/amd64/db_trace.c Sat Mar 3 15:10:37 2018 (r330338) @@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s strcmp(name, "Xcpususpend") == 0 || strcmp(name, "Xrendezvous") == 0) frame_type = INTERRUPT; - else if (strcmp(name, "Xfast_syscall") == 0) + else if (strcmp(name, "Xfast_syscall") == 0 || + strcmp(name, "Xfast_syscall_pti") == 0 || + strcmp(name, "fast_syscall_common") == 0) frame_type = SYSCALL; #ifdef COMPAT_FREEBSD32 else if (strcmp(name, "Xint0x80_syscall") == 0) From owner-svn-src-head@freebsd.org Sat Mar 3 15:17:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFCEFF44071 for ; Sat, 3 Mar 2018 15:17:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic306-17.consmr.mail.bf2.yahoo.com (sonic306-17.consmr.mail.bf2.yahoo.com [74.6.132.56]) (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 90EB585825 for ; Sat, 3 Mar 2018 15:17:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1520090214; bh=+FTOFOyznmOpmkEeF1WlQHRqWfnUSGawxyl6Cd43aak=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=hnsumFpdNmAGpc0aq113iE7GievA+hP2LBRjEcvEFueJjfYcekSI2osm9fdQCrZoqf0+60DTTQfa5KVV8L0j5b3SRQfTKbz4Yc47BoVs8e4w8yKmCeV2i+xx+Ar/59iet1vwpl2XmjzPtO0MAUoEBzOyFyaxn4OIkS/AmX2+FBQVNYH4eAJbAr+PiesozpbVk94JdwrZi4gjv6LhVPdvDc4UBA2WXhpQNe+pwO+/OaIjyGdN54XKSclx48c/16zDy/d9TNh7+Lv354J9lZZZxPNIjxB368k5XCqsseK55H18lhXp0umI//EiLu5sL39U2PtbUhFrEh6Lljtcsv76uA== X-YMail-OSG: yHJ4kFkVM1mrG9PdKSyAW0mU_5yyWh5AqwG235JRY7OuziMgc9ZmU_yTakHqlZu i3xfkx7vc1xWseESE3CYeJLKnvodUBPIO8ItUGVUeuGTNZNYDVIMAPLzyjZ6Y32MCUAlEoLpyFrh 0fCYVLctYM.OYl65L0Al6Ty4KwifkVkVCAGgFgN4ZD0PAnjcESc_IJwqjjGCoeruHmErrE0B1K5w zKo79GxpPRt0GsPoDLT.cAjf8GrPlD2kZm_Cbk8Zb5VJNN3C7mdpZSrkD_EVyQjhOOk1z2fFb6YO Crulw8LP6QiGxjGYxXvi2fPTtNf8W6MJ4kXniZsPGEpd740j5f2.7MpPmPpObIo9uWVZxolx4EAn QFcwtjImzFZ72OiahxyxzsaqLl_LaqUgmFlxsrm7cXyjQxjvKyUxPocdeFebFwMSVhQ3meVKYqCW uIcmzvgO4ZleHUmpghtHzHjeogePHBnxvYhN1xIXbbi8.0cKPduACwP2E1EpZKCUb54A2uekECtW SeLYRqNMj.D4- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sat, 3 Mar 2018 15:16:54 +0000 Received: from 190.157.137.88 (EHLO [192.168.0.5]) ([190.157.137.88]) by smtp423.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID e78e55bf20016dc30f38ca833b477424; Sat, 03 Mar 2018 15:06:44 +0000 (UTC) Subject: Re: svn commit: r330285 - head/sys/sys To: Konstantin Belousov , Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803021647.w22Gl2t7092316@repo.freebsd.org> <20180302181934.GF3194@kib.kiev.ua> <20180303130511.N1283@besplex.bde.org> <20180303102106.GG3194@kib.kiev.ua> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <0a205e40-16d3-863a-301c-cc537023ecb9@FreeBSD.org> Date: Sat, 3 Mar 2018 10:06:41 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180303102106.GG3194@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 15:17:03 -0000 On 03/03/2018 05:21, Konstantin Belousov wrote: > On Sat, Mar 03, 2018 at 01:47:41PM +1100, Bruce Evans wrote: >> On Fri, 2 Mar 2018, Konstantin Belousov wrote: >> >>> On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: >>>> ... >>>> I think use of _Nonnull attributes in the threading functions may also >>>> be a waste (I introduced them mostly to be compatible with Android). >>>> FWIW, Dragonfly sprinkled some restrict there recently: >>>> >>>> http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 >>>> >>>> Just in case someone is considering more cleanups. >>> This is not a cleanup for me, but a needed change. Right now x86 >>> copyouts are implemented in asm, so whatever damage is done to the >>> prototypes, only effect is at the caller side. In my work, i386 copyouts >>> are done in C, so it starts matter. >> That seems slow, especially for small sizes as are common for syscall args >> (in 1 of my versions, copyin() of args is optimized to fuword() in a loop, >> and fuword() is optimized to not use pcb_onfault, so it is not much more >> than 1 memory access. However, in your i386 version this optimization >> would be negative since the slow part is switching the map, so fuword() >> should never be used to access multiple words). > Yes. I already explained it in private, the current choice for i386 is > either to be neglected very fast, or to get this change to still be a > Tier 1 32 bit platform. The change is to make 4/4g split for UVA/KVA. > In particular, the change ensures that it is possible to self-host i386 > for forthcoming years, which is not practical for armv7 now and would be > less so with clang grow. > > In other news, my system already boots single-user on SMP machine and > I have torture tests like setting invalid %ss segment by sigreturn(2), > work. There is (much) more to come, but I am happy how the patch > progressed so far. Very nice. >> However, copyinstr() and >> copystr() should never have been "optimized" by writing them in asm. On >> x86, their asm is badly written so they are slower than simple C versions >> except on 8088's and maybe 8086's and maybe on the original i386. (8088's >> were limited mainly by instruction bandwidth and the original i386 wasn't >> much better, so short CISC instructions like lodsb and stosb tended to be >> faster than larger separate instructions despite their large setup overheads. > Sure, copyinstr() is rewritten in C. The current version of copyout stuff > is there: > https://kib.kiev.ua/git/gitweb.cgi?p=deviant2.git;a=blob;f=sys/i386/i386/copyout.c;h=9747c06a84d7d2b5faac946f5de57f6a34d96c8c;hb=refs/heads/pcid > >>> Also I looked at the dragonfly commit because I become curious what do you >>> mean by threading functions. The first example was >>> int pthread_attr_getguardsize(const pthread_attr_t * __restrict, >>> - size_t *); >>> + size_t * __restrict); >>> POSIX agrees with the dragonfly change, but I do not understand it. >>> Aliasing rules already disallow the first and second arguments to point >>> to the same memory, because they have different types. >> (1) thread_attr_t is opaque, so the types might be the same. >> (2) pthread_attr_t might be a pointer to a struct/union containing a size_t. >> (3) perhaps other reasons. I'm not sure how 'restrict interacts with global >> variables or even it it prevents the interaction in (2). A previous >> discussion showed that const doesn't make types different enough to >> prevent aliasing. Similarly for volatile. >> >> Similarly for other pointers to {opaque, struct/union, or even integer} types. >> size_t can't be aliased to int, but it can be aliased to any unsigned type >> in C and to any unsigned type not smaller than uint16_t in POSIX (POSIX >> but not C requires u_char == uint8_t, so size_t can't be u_char in POSIX >> but it can be u_char in C). > I can only summarize it as 'there is no use to have restrict on the > pthread_attr_getguardsize() arguments'. > Well, I'll admit I don't understand well the advantages and that's why I brought up a pointer to the changes instead of working on them. Usually, standards compliance is reason enough for such change though. Pedro. From owner-svn-src-head@freebsd.org Sat Mar 3 17:13:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4139AF2A829; Sat, 3 Mar 2018 17:13:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1E6D6BD92; Sat, 3 Mar 2018 17:13:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6FE312E2; Sat, 3 Mar 2018 17:13:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23HDCQl036762; Sat, 3 Mar 2018 17:13:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23HDCYw036761; Sat, 3 Mar 2018 17:13:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031713.w23HDCYw036761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 17:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330339 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 330339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 17:13:13 -0000 Author: kevans Date: Sat Mar 3 17:13:12 2018 New Revision: 330339 URL: https://svnweb.freebsd.org/changeset/base/330339 Log: liblua: Add loader.interpret This allows lua to pass back a command string to be executed as if it were typed at the loader prompt- loader tries to execute the string first as pure lua, then parses it and gives lua a chance to intercept before it tries to execute it itself. This will be used to implement menu_timeout_command, among other things, which *should* be used to execute basic loader commands independent of the chosen interpreter. Modified: head/stand/liblua/lutils.c Modified: head/stand/liblua/lutils.c ============================================================================== --- head/stand/liblua/lutils.c Sat Mar 3 15:10:37 2018 (r330338) +++ head/stand/liblua/lutils.c Sat Mar 3 17:13:12 2018 (r330339) @@ -77,7 +77,26 @@ lua_perform(lua_State *L) return 1; } +/* + * Accepts a space-delimited loader command and runs it through the standard + * loader parsing, as if it were executed at the loader prompt by the user. + */ static int +lua_interpret(lua_State *L) +{ + const char *interp_string; + + if (lua_gettop(L) != 1) { + lua_pushnil(L); + return 1; + } + + interp_string = luaL_checkstring(L, 1); + lua_pushinteger(L, interp_run(interp_string)); + return 1; +} + +static int lua_getchar(lua_State *L) { @@ -305,6 +324,7 @@ lua_writefile(lua_State *L) static const struct luaL_Reg loaderlib[] = { REG_SIMPLE(delay), REG_SIMPLE(command), + REG_SIMPLE(interpret), REG_SIMPLE(getenv), REG_SIMPLE(perform), /* Also registered as the global 'printc' */ From owner-svn-src-head@freebsd.org Sat Mar 3 17:18:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58767F2AECD; Sat, 3 Mar 2018 17:18:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00F876C0B6; Sat, 3 Mar 2018 17:18:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFEE612E8; Sat, 3 Mar 2018 17:18:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23HIeCA036976; Sat, 3 Mar 2018 17:18:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23HIecS036975; Sat, 3 Mar 2018 17:18:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031718.w23HIecS036975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 17:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330340 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 17:18:41 -0000 Author: kevans Date: Sat Mar 3 17:18:40 2018 New Revision: 330340 URL: https://svnweb.freebsd.org/changeset/base/330340 Log: lualoader: Execute menu_timeout_command at the end of menu autoboot Instead of hardcoding "boot", respect menu_timeout_command from Forth. It still defaults to 'boot', so this will not be a functional change for most. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Mar 3 17:13:12 2018 (r330339) +++ head/stand/lua/menu.lua Sat Mar 3 17:18:40 2018 (r330340) @@ -448,8 +448,9 @@ function menu.autoboot() loader.delay(50000) until time <= 0 - core.boot() + local cmd = loader.getenv("menu_timeout_command") or "boot" + loader.interpret(cmd) end return menu From owner-svn-src-head@freebsd.org Sat Mar 3 17:25:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E3EF2B915; Sat, 3 Mar 2018 17:25:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A91836C890; Sat, 3 Mar 2018 17:25:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3D5B1494; Sat, 3 Mar 2018 17:25:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23HPn07042046; Sat, 3 Mar 2018 17:25:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23HPnpk042045; Sat, 3 Mar 2018 17:25:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031725.w23HPnpk042045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 17:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330341 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 17:25:50 -0000 Author: kevans Date: Sat Mar 3 17:25:49 2018 New Revision: 330341 URL: https://svnweb.freebsd.org/changeset/base/330341 Log: lualoader: Respect loader_menu_title, prepare for align Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sat Mar 3 17:18:40 2018 (r330340) +++ head/stand/lua/drawer.lua Sat Mar 3 17:25:49 2018 (r330341) @@ -380,8 +380,13 @@ function drawer.drawbox() printc(vl) end - screen.setcursor(x + (w / 2) - 9, y) - printc("Welcome to FreeBSD") + local menu_header = loader.getenv("loader_menu_title") or + "Welcome to FreeBSD" + local menu_header_x + + menu_header_x = x + (w / 2) - (#menu_header / 2) + screen.setcursor(menu_header_x, y) + printc(menu_header) end function drawer.draw(x, y, logo) From owner-svn-src-head@freebsd.org Sat Mar 3 17:38:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3822F2C5D8; Sat, 3 Mar 2018 17:38:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5C0A6CFDF; Sat, 3 Mar 2018 17:38:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0B17162F; Sat, 3 Mar 2018 17:38:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23HcPD3047047; Sat, 3 Mar 2018 17:38:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23HcPQj047046; Sat, 3 Mar 2018 17:38:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031738.w23HcPQj047046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 17:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330342 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 17:38:26 -0000 Author: kevans Date: Sat Mar 3 17:38:25 2018 New Revision: 330342 URL: https://svnweb.freebsd.org/changeset/base/330342 Log: lualoader: Respect loader_menu_title_align It may be set to "left" or "right" -- any other value will cause the title to be centered. I've chosen to position these things just inside the vertical borders, rather than overlapping the corners. This is an arbitrary choice and easily amendable if this looks terrible. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sat Mar 3 17:25:49 2018 (r330341) +++ head/stand/lua/drawer.lua Sat Mar 3 17:38:25 2018 (r330342) @@ -382,9 +382,22 @@ function drawer.drawbox() local menu_header = loader.getenv("loader_menu_title") or "Welcome to FreeBSD" + local menu_header_align = loader.getenv("loader_menu_title_align") local menu_header_x - menu_header_x = x + (w / 2) - (#menu_header / 2) + if menu_header_align ~= nil then + menu_header_align = menu_header_align:lower() + if menu_header_align == "left" then + -- Just inside the left border on top + menu_header_x = x + 1 + elseif menu_header_align == "right" then + -- Just inside the right border on top + menu_header_x = x + w - #menu_header + end + end + if menu_header_x == nil then + menu_header_x = x + (w / 2) - (#menu_header / 2) + end screen.setcursor(menu_header_x, y) printc(menu_header) end From owner-svn-src-head@freebsd.org Sat Mar 3 18:12:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EBBEF2EC87; Sat, 3 Mar 2018 18:12:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D35196E45A; Sat, 3 Mar 2018 18:12:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE3FA1C7F; Sat, 3 Mar 2018 18:12:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23ICLhB066888; Sat, 3 Mar 2018 18:12:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23ICLRI066887; Sat, 3 Mar 2018 18:12:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803031812.w23ICLRI066887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 3 Mar 2018 18:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330344 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:12:22 -0000 Author: hselasky Date: Sat Mar 3 18:12:21 2018 New Revision: 330344 URL: https://svnweb.freebsd.org/changeset/base/330344 Log: Correct the return code from pause() during cold startup from zero to EWOULDBLOCK. This also matches the description in pause(9). Discussed with: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sat Mar 3 18:11:02 2018 (r330343) +++ head/sys/kern/kern_synch.c Sat Mar 3 18:12:21 2018 (r330344) @@ -326,7 +326,7 @@ pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_ sbt = howmany(sbt, SBT_1US); if (sbt > 0) DELAY(sbt); - return (0); + return (EWOULDBLOCK); } return (_sleep(&pause_wchan[curcpu], NULL, 0, wmesg, sbt, pr, flags)); } From owner-svn-src-head@freebsd.org Sat Mar 3 18:13:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0DBAF2EE1B; Sat, 3 Mar 2018 18:13:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9583F6E61F; Sat, 3 Mar 2018 18:13:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 907051C95; Sat, 3 Mar 2018 18:13:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23IDEln066967; Sat, 3 Mar 2018 18:13:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IDEqU066965; Sat, 3 Mar 2018 18:13:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031813.w23IDEqU066965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 18:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330345 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:13:15 -0000 Author: kevans Date: Sat Mar 3 18:13:14 2018 New Revision: 330345 URL: https://svnweb.freebsd.org/changeset/base/330345 Log: lualoader: Tweak positioning and fix an off-by-one - All of our default positions were offset from forth - Our menu frame size was smaller than in forth - Logo/brand drawing had an off-by-one, drawing one column lower on the screen than they should have been. - While here, switch a print() to printc() as it's expected that logos may contain color and other escpae sequences that we'll need to honor. Modified: head/stand/lua/drawer.lua head/stand/lua/menu.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sat Mar 3 18:12:21 2018 (r330344) +++ head/stand/lua/drawer.lua Sat Mar 3 18:13:14 2018 (r330345) @@ -205,9 +205,9 @@ drawer.menu_name_handlers = { } drawer.brand_position = {x = 2, y = 1} -drawer.logo_position = {x = 46, y = 1} -drawer.menu_position = {x = 6, y = 11} -drawer.box_pos_dim = {x = 3, y = 10, w = 41, h = 11} +drawer.logo_position = {x = 46, y = 4} +drawer.menu_position = {x = 5, y = 10} +drawer.frame_size = {w = 42, h = 13} drawer.branddefs = { -- Indexed by valid values for loader_brand in loader.conf(5). Valid @@ -337,10 +337,10 @@ function drawer.drawmenu(menudef) end function drawer.drawbox() - local x = drawer.box_pos_dim.x - local y = drawer.box_pos_dim.y - local w = drawer.box_pos_dim.w - local h = drawer.box_pos_dim.h + local x = drawer.menu_position.x - 3 + local y = drawer.menu_position.y - 1 + local w = drawer.frame_size.w + local h = drawer.frame_size.h local framestyle = loader.getenv("loader_menu_frame") or "double" local framespec = drawer.frame_styles[framestyle] @@ -404,8 +404,8 @@ end function drawer.draw(x, y, logo) for i = 1, #logo do - screen.setcursor(x, y + i) - print(logo[i]) + screen.setcursor(x, y + i - 1) + printc(logo[i]) end end Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Mar 3 18:12:21 2018 (r330344) +++ head/stand/lua/menu.lua Sat Mar 3 18:13:14 2018 (r330345) @@ -420,8 +420,8 @@ function menu.autoboot() end ab = tonumber(ab) or 10 - local x = loader.getenv("loader_menu_timeout_x") or 5 - local y = loader.getenv("loader_menu_timeout_y") or 22 + local x = loader.getenv("loader_menu_timeout_x") or 4 + local y = loader.getenv("loader_menu_timeout_y") or 23 local endtime = loader.time() + ab local time From owner-svn-src-head@freebsd.org Sat Mar 3 18:25:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F03F2FBBF; Sat, 3 Mar 2018 18:25:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4F66EDD8; Sat, 3 Mar 2018 18:25:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17C911E2E; Sat, 3 Mar 2018 18:25:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23IPoVo071791; Sat, 3 Mar 2018 18:25:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IPoFv071790; Sat, 3 Mar 2018 18:25:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031825.w23IPoFv071790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 18:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330346 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:25:51 -0000 Author: kevans Date: Sat Mar 3 18:25:50 2018 New Revision: 330346 URL: https://svnweb.freebsd.org/changeset/base/330346 Log: lualoader: Shift menu+brand even for logo=none with customized pos Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sat Mar 3 18:13:14 2018 (r330345) +++ head/stand/lua/drawer.lua Sat Mar 3 18:25:50 2018 (r330346) @@ -43,7 +43,6 @@ local fbsd_logo_v local orb_color local orb local none -local none_shifted = false local function menuEntryName(drawing_menu, entry) local name_handler = drawer.menu_name_handlers[entry.entry_type] @@ -57,15 +56,6 @@ local function menuEntryName(drawing_menu, entry) return entry.name end -local function shiftBrandText(shift) - drawer.brand_position.x = drawer.brand_position.x + shift.x - drawer.brand_position.y = drawer.brand_position.y + shift.y - drawer.menu_position.x = drawer.menu_position.x + shift.x - drawer.menu_position.y = drawer.menu_position.y + shift.y - drawer.box_pos_dim.x = drawer.box_pos_dim.x + shift.x - drawer.box_pos_dim.y = drawer.box_pos_dim.y + shift.y -end - fbsd_logo = { " ______ ____ _____ _____ ", " | ____| | _ \\ / ____| __ \\ ", @@ -208,6 +198,8 @@ drawer.brand_position = {x = 2, y = 1} drawer.logo_position = {x = 46, y = 4} drawer.menu_position = {x = 5, y = 10} drawer.frame_size = {w = 42, h = 13} +drawer.default_shift = {x = 0, y = 0} +drawer.shift = drawer.default_shift drawer.branddefs = { -- Indexed by valid values for loader_brand in loader.conf(5). Valid @@ -299,6 +291,9 @@ function drawer.drawmenu(menudef) local x = drawer.menu_position.x local y = drawer.menu_position.y + x = x + drawer.shift.x + y = y + drawer.shift.y + -- print the menu and build the alias table local alias_table = {} local entry_num = 0 @@ -358,6 +353,9 @@ function drawer.drawbox() local tr = framespec.top_right local br = framespec.bottom_right + x = x + drawer.shift.x + y = y + drawer.shift.y + screen.setcursor(x, y); printc(tl) screen.setcursor(x, y + h); printc(bl) screen.setcursor(x + w, y); printc(tr) @@ -419,6 +417,9 @@ function drawer.drawbrand() if graphic == nil then graphic = fbsd_logo end + + x = x + drawer.shift.x + y = y + drawer.shift.y drawer.draw(x, y, graphic) end @@ -434,13 +435,7 @@ function drawer.drawlogo() -- Lookup local logodef = drawer.logodefs[logo] - if logodef ~= nil and logodef.graphic == none then - -- centre brand and text if no logo - if not none_shifted then - shiftBrandText(logodef.shift) - none_shifted = true - end - elseif logodef == nil or logodef.graphic == nil or + if logodef == nil or logodef.graphic == nil or (not colored and logodef.requires_color) then -- Choose a sensible default if colored then @@ -449,10 +444,21 @@ function drawer.drawlogo() logodef = drawer.logodefs["orbbw"] end end - if logodef.shift ~= nil then + + if logodef ~= nil and logodef.graphic == none then + drawer.shift = logodef.shift + else + drawer.shift = drawer.default_shift + end + + x = x + drawer.shift.x + y = y + drawer.shift.y + + if logdef ~= nil and logodef.shift ~= nil then x = x + logodef.shift.x y = y + logodef.shift.y end + drawer.draw(x, y, logodef.graphic) end From owner-svn-src-head@freebsd.org Sat Mar 3 18:28:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 539ABF2FDCF; Sat, 3 Mar 2018 18:28:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F17F96EFCE; Sat, 3 Mar 2018 18:28:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E72B91E30; Sat, 3 Mar 2018 18:28:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23ISJSm071918; Sat, 3 Mar 2018 18:28:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23ISJSA071917; Sat, 3 Mar 2018 18:28:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803031828.w23ISJSA071917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 3 Mar 2018 18:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330347 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 330347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:28:20 -0000 Author: manu Date: Sat Mar 3 18:28:19 2018 New Revision: 330347 URL: https://svnweb.freebsd.org/changeset/base/330347 Log: axp81x: Add support for AXP803 AXP803 and AXP813/818 are very similar, only two regulators differs. AXP803 is the companion chip for A64/R18 AXP813 is the companion chip for A83T AXP818 is the companion chip for H8 (~A83T) Add support for all regulators found in both of them. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Sat Mar 3 18:25:50 2018 (r330346) +++ head/sys/arm/allwinner/axp81x.c Sat Mar 3 18:28:19 2018 (r330347) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2018 Emmanuel Vadot * Copyright (c) 2016 Jared McNeill * All rights reserved. * @@ -27,7 +28,7 @@ */ /* - * X-Powers AXP813/818 PMU for Allwinner SoCs + * X-Powers AXP803/813/818 PMU for Allwinner SoCs */ #include @@ -58,14 +59,59 @@ __FBSDID("$FreeBSD$"); #include "iicbus_if.h" #include "regdev_if.h" -MALLOC_DEFINE(M_AXP81X_REG, "AXP81x regulator", "AXP81x power regulator"); +MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8xx power regulator"); +#define AXP_POWERSRC 0x00 +#define AXP_POWERSRC_ACIN (1 << 7) +#define AXP_POWERSRC_VBUS (1 << 5) +#define AXP_POWERSRC_VBAT (1 << 3) +#define AXP_POWERSRC_CHARING (1 << 2) +#define AXP_POWERSRC_SHORTED (1 << 1) +#define AXP_POWERSRC_STARTUP (1 << 0) #define AXP_ICTYPE 0x03 #define AXP_POWERCTL1 0x10 +#define AXP_POWERCTL1_DCDC7 (1 << 6) /* AXP813/818 only */ +#define AXP_POWERCTL1_DCDC6 (1 << 5) +#define AXP_POWERCTL1_DCDC5 (1 << 4) +#define AXP_POWERCTL1_DCDC4 (1 << 3) +#define AXP_POWERCTL1_DCDC3 (1 << 2) #define AXP_POWERCTL1_DCDC2 (1 << 1) +#define AXP_POWERCTL1_DCDC1 (1 << 0) #define AXP_POWERCTL2 0x12 -#define AXP_POWERCTL2_DC1SW (1 << 7) +#define AXP_POWERCTL2_DC1SW (1 << 7) /* AXP803 only */ +#define AXP_POWERCTL2_DLDO4 (1 << 6) +#define AXP_POWERCTL2_DLDO3 (1 << 5) +#define AXP_POWERCTL2_DLDO2 (1 << 4) +#define AXP_POWERCTL2_DLDO1 (1 << 3) +#define AXP_POWERCTL2_ELDO3 (1 << 2) +#define AXP_POWERCTL2_ELDO2 (1 << 1) +#define AXP_POWERCTL2_ELDO1 (1 << 0) +#define AXP_POWERCTL3 0x13 +#define AXP_POWERCTL3_ALDO3 (1 << 7) +#define AXP_POWERCTL3_ALDO2 (1 << 6) +#define AXP_POWERCTL3_ALDO1 (1 << 5) +#define AXP_POWERCTL3_FLDO3 (1 << 4) /* AXP813/818 only */ +#define AXP_POWERCTL3_FLDO2 (1 << 3) +#define AXP_POWERCTL3_FLDO1 (1 << 2) +#define AXP_VOLTCTL_DLDO1 0x15 +#define AXP_VOLTCTL_DLDO2 0x16 +#define AXP_VOLTCTL_DLDO3 0x17 +#define AXP_VOLTCTL_DLDO4 0x18 +#define AXP_VOLTCTL_ELDO1 0x19 +#define AXP_VOLTCTL_ELDO2 0x1A +#define AXP_VOLTCTL_ELDO3 0x1B +#define AXP_VOLTCTL_FLDO1 0x1C +#define AXP_VOLTCTL_FLDO2 0x1D +#define AXP_VOLTCTL_DCDC1 0x20 #define AXP_VOLTCTL_DCDC2 0x21 +#define AXP_VOLTCTL_DCDC3 0x22 +#define AXP_VOLTCTL_DCDC4 0x23 +#define AXP_VOLTCTL_DCDC5 0x24 +#define AXP_VOLTCTL_DCDC6 0x25 +#define AXP_VOLTCTL_DCDC7 0x26 +#define AXP_VOLTCTL_ALDO1 0x28 +#define AXP_VOLTCTL_ALDO2 0x29 +#define AXP_VOLTCTL_ALDO3 0x2A #define AXP_VOLTCTL_STATUS (1 << 7) #define AXP_VOLTCTL_MASK 0x7f #define AXP_POWERBAT 0x32 @@ -92,23 +138,29 @@ MALLOC_DEFINE(M_AXP81X_REG, "AXP81x regulator", "AXP81 static const struct { const char *name; uint8_t ctrl_reg; -} axp81x_pins[] = { +} axp8xx_pins[] = { { "GPIO0", AXP_GPIO0_CTRL }, { "GPIO1", AXP_GPIO1_CTRL }, }; +enum AXP8XX_TYPE { + AXP803 = 1, + AXP813, +}; + static struct ofw_compat_data compat_data[] = { - { "x-powers,axp813", 1 }, - { "x-powers,axp818", 1 }, + { "x-powers,axp803", AXP803 }, + { "x-powers,axp813", AXP813 }, + { "x-powers,axp818", AXP813 }, { NULL, 0 } }; -static struct resource_spec axp81x_spec[] = { +static struct resource_spec axp8xx_spec[] = { { SYS_RES_IRQ, 0, RF_ACTIVE }, { -1, 0 } }; -struct axp81x_regdef { +struct axp8xx_regdef { intptr_t id; char *name; char *supply_name; @@ -123,20 +175,69 @@ struct axp81x_regdef { int voltage_nstep2; }; -enum axp81x_reg_id { - AXP81X_REG_ID_DC1SW, - AXP81X_REG_ID_DCDC2, +enum axp8xx_reg_id { + AXP8XX_REG_ID_DCDC1 = 100, + AXP8XX_REG_ID_DCDC2, + AXP8XX_REG_ID_DCDC3, + AXP8XX_REG_ID_DCDC4, + AXP8XX_REG_ID_DCDC5, + AXP8XX_REG_ID_DCDC6, + AXP813_REG_ID_DCDC7, + AXP803_REG_ID_DC1SW, + AXP8XX_REG_ID_DLDO1, + AXP8XX_REG_ID_DLDO2, + AXP8XX_REG_ID_DLDO3, + AXP8XX_REG_ID_DLDO4, + AXP8XX_REG_ID_ELDO1, + AXP8XX_REG_ID_ELDO2, + AXP8XX_REG_ID_ELDO3, + AXP8XX_REG_ID_ALDO1, + AXP8XX_REG_ID_ALDO2, + AXP8XX_REG_ID_ALDO3, + AXP8XX_REG_ID_FLDO1, + AXP8XX_REG_ID_FLDO2, + AXP813_REG_ID_FLDO3, }; -static struct axp81x_regdef axp81x_regdefs[] = { +static struct axp8xx_regdef axp803_regdefs[] = { { - .id = AXP81X_REG_ID_DC1SW, + .id = AXP803_REG_ID_DC1SW, .name = "dc1sw", .enable_reg = AXP_POWERCTL2, .enable_mask = AXP_POWERCTL2_DC1SW, }, +}; + +static struct axp8xx_regdef axp813_regdefs[] = { { - .id = AXP81X_REG_ID_DCDC2, + .id = AXP813_REG_ID_DCDC7, + .name = "dcdc7", + .enable_reg = AXP_POWERCTL1, + .enable_mask = AXP_POWERCTL1_DCDC7, + .voltage_reg = AXP_VOLTCTL_DCDC7, + .voltage_min = 600, + .voltage_max = 1520, + .voltage_step1 = 10, + .voltage_nstep1 = 50, + .voltage_step2 = 20, + .voltage_nstep2 = 21, + }, +}; + +static struct axp8xx_regdef axp8xx_common_regdefs[] = { + { + .id = AXP8XX_REG_ID_DCDC1, + .name = "dcdc1", + .enable_reg = AXP_POWERCTL1, + .enable_mask = AXP_POWERCTL1_DCDC1, + .voltage_reg = AXP_VOLTCTL_DCDC1, + .voltage_min = 1600, + .voltage_max = 3400, + .voltage_step1 = 100, + .voltage_nstep1 = 18, + }, + { + .id = AXP8XX_REG_ID_DCDC2, .name = "dcdc2", .enable_reg = AXP_POWERCTL1, .enable_mask = AXP_POWERCTL1_DCDC2, @@ -148,19 +249,197 @@ static struct axp81x_regdef axp81x_regdefs[] = { .voltage_step2 = 20, .voltage_nstep2 = 5, }, + { + .id = AXP8XX_REG_ID_DCDC3, + .name = "dcdc3", + .enable_reg = AXP_POWERCTL1, + .enable_mask = AXP_POWERCTL1_DCDC3, + .voltage_reg = AXP_VOLTCTL_DCDC3, + .voltage_min = 500, + .voltage_max = 1300, + .voltage_step1 = 10, + .voltage_nstep1 = 70, + .voltage_step2 = 20, + .voltage_nstep2 = 5, + }, + { + .id = AXP8XX_REG_ID_DCDC4, + .name = "dcdc4", + .enable_reg = AXP_POWERCTL1, + .enable_mask = AXP_POWERCTL1_DCDC4, + .voltage_reg = AXP_VOLTCTL_DCDC4, + .voltage_min = 500, + .voltage_max = 1300, + .voltage_step1 = 10, + .voltage_nstep1 = 70, + .voltage_step2 = 20, + .voltage_nstep2 = 5, + }, + { + .id = AXP8XX_REG_ID_DCDC5, + .name = "dcdc5", + .enable_reg = AXP_POWERCTL1, + .enable_mask = AXP_POWERCTL1_DCDC5, + .voltage_reg = AXP_VOLTCTL_DCDC5, + .voltage_min = 800, + .voltage_max = 1840, + .voltage_step1 = 10, + .voltage_nstep1 = 42, + .voltage_step2 = 20, + .voltage_nstep2 = 36, + }, + { + .id = AXP8XX_REG_ID_DCDC6, + .name = "dcdc6", + .enable_reg = AXP_POWERCTL1, + .enable_mask = AXP_POWERCTL1_DCDC6, + .voltage_reg = AXP_VOLTCTL_DCDC6, + .voltage_min = 600, + .voltage_max = 1520, + .voltage_step1 = 10, + .voltage_nstep1 = 50, + .voltage_step2 = 20, + .voltage_nstep2 = 21, + }, + { + .id = AXP8XX_REG_ID_DLDO1, + .name = "dldo1", + .enable_reg = AXP_POWERCTL2, + .enable_mask = AXP_POWERCTL2_DLDO1, + .voltage_reg = AXP_VOLTCTL_DLDO1, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_DLDO2, + .name = "dldo2", + .enable_reg = AXP_POWERCTL2, + .enable_mask = AXP_POWERCTL2_DLDO2, + .voltage_reg = AXP_VOLTCTL_DLDO2, + .voltage_min = 700, + .voltage_max = 4200, + .voltage_step1 = 100, + .voltage_nstep1 = 27, + .voltage_step2 = 200, + .voltage_nstep2 = 4, + }, + { + .id = AXP8XX_REG_ID_DLDO3, + .name = "dldo3", + .enable_reg = AXP_POWERCTL2, + .enable_mask = AXP_POWERCTL2_DLDO3, + .voltage_reg = AXP_VOLTCTL_DLDO3, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_DLDO4, + .name = "dldo4", + .enable_reg = AXP_POWERCTL2, + .enable_mask = AXP_POWERCTL2_DLDO4, + .voltage_reg = AXP_VOLTCTL_DLDO4, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_ALDO1, + .name = "aldo1", + .enable_reg = AXP_POWERCTL3, + .enable_mask = AXP_POWERCTL3_ALDO1, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_ALDO2, + .name = "aldo2", + .enable_reg = AXP_POWERCTL3, + .enable_mask = AXP_POWERCTL3_ALDO2, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_ALDO3, + .name = "aldo3", + .enable_reg = AXP_POWERCTL3, + .enable_mask = AXP_POWERCTL3_ALDO3, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_ELDO1, + .name = "eldo1", + .enable_reg = AXP_POWERCTL2, + .enable_mask = AXP_POWERCTL2_ELDO1, + .voltage_min = 700, + .voltage_max = 1900, + .voltage_step1 = 50, + .voltage_nstep1 = 24, + }, + { + .id = AXP8XX_REG_ID_ELDO2, + .name = "eldo2", + .enable_reg = AXP_POWERCTL2, + .enable_mask = AXP_POWERCTL2_ELDO2, + .voltage_min = 700, + .voltage_max = 1900, + .voltage_step1 = 50, + .voltage_nstep1 = 24, + }, + { + .id = AXP8XX_REG_ID_ELDO3, + .name = "eldo3", + .enable_reg = AXP_POWERCTL2, + .enable_mask = AXP_POWERCTL2_ELDO3, + .voltage_min = 700, + .voltage_max = 1900, + .voltage_step1 = 50, + .voltage_nstep1 = 24, + }, + { + .id = AXP8XX_REG_ID_FLDO1, + .name = "fldo1", + .enable_reg = AXP_POWERCTL3, + .enable_mask = AXP_POWERCTL3_FLDO1, + .voltage_min = 700, + .voltage_max = 1450, + .voltage_step1 = 50, + .voltage_nstep1 = 15, + }, + { + .id = AXP8XX_REG_ID_FLDO2, + .name = "fldo2", + .enable_reg = AXP_POWERCTL3, + .enable_mask = AXP_POWERCTL3_FLDO2, + .voltage_min = 700, + .voltage_max = 1450, + .voltage_step1 = 50, + .voltage_nstep1 = 15, + }, }; -struct axp81x_softc; +struct axp8xx_softc; -struct axp81x_reg_sc { +struct axp8xx_reg_sc { struct regnode *regnode; device_t base_dev; - struct axp81x_regdef *def; + struct axp8xx_regdef *def; phandle_t xref; struct regnode_std_param *param; }; -struct axp81x_softc { +struct axp8xx_softc { struct resource *res; uint16_t addr; void *ih; @@ -168,8 +447,10 @@ struct axp81x_softc { struct mtx mtx; int busy; + int type; + /* Regulators */ - struct axp81x_reg_sc **regs; + struct axp8xx_reg_sc **regs; int nregs; }; @@ -177,9 +458,9 @@ struct axp81x_softc { #define AXP_UNLOCK(sc) mtx_unlock(&(sc)->mtx) static int -axp81x_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +axp8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; struct iic_msg msg[2]; sc = device_get_softc(dev); @@ -198,9 +479,9 @@ axp81x_read(device_t dev, uint8_t reg, uint8_t *data, } static int -axp81x_write(device_t dev, uint8_t reg, uint8_t val) +axp8xx_write(device_t dev, uint8_t reg, uint8_t val) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; struct iic_msg msg[2]; sc = device_get_softc(dev); @@ -219,25 +500,31 @@ axp81x_write(device_t dev, uint8_t reg, uint8_t val) } static int -axp81x_regnode_init(struct regnode *regnode) +axp8xx_regnode_init(struct regnode *regnode) { return (0); } static int -axp81x_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +axp8xx_regnode_enable(struct regnode *regnode, bool enable, int *udelay) { - struct axp81x_reg_sc *sc; + struct axp8xx_reg_sc *sc; uint8_t val; sc = regnode_get_softc(regnode); - axp81x_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (bootverbose) + device_printf(sc->base_dev, "%sable %s (%s)\n", + enable ? "En" : "Dis", + regnode_get_name(regnode), + sc->def->name); + + axp8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); if (enable) val |= sc->def->enable_mask; else val &= ~sc->def->enable_mask; - axp81x_write(sc->base_dev, sc->def->enable_reg, val); + axp8xx_write(sc->base_dev, sc->def->enable_reg, val); *udelay = 0; @@ -245,7 +532,7 @@ axp81x_regnode_enable(struct regnode *regnode, bool en } static void -axp81x_regnode_reg_to_voltage(struct axp81x_reg_sc *sc, uint8_t val, int *uv) +axp8xx_regnode_reg_to_voltage(struct axp8xx_reg_sc *sc, uint8_t val, int *uv) { if (val < sc->def->voltage_nstep1) *uv = sc->def->voltage_min + val * sc->def->voltage_step1; @@ -257,7 +544,7 @@ axp81x_regnode_reg_to_voltage(struct axp81x_reg_sc *sc } static int -axp81x_regnode_voltage_to_reg(struct axp81x_reg_sc *sc, int min_uvolt, +axp8xx_regnode_voltage_to_reg(struct axp8xx_reg_sc *sc, int min_uvolt, int max_uvolt, uint8_t *val) { uint8_t nval; @@ -284,21 +571,27 @@ axp81x_regnode_voltage_to_reg(struct axp81x_reg_sc *sc } static int -axp81x_regnode_set_voltage(struct regnode *regnode, int min_uvolt, +axp8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) { - struct axp81x_reg_sc *sc; + struct axp8xx_reg_sc *sc; uint8_t val; sc = regnode_get_softc(regnode); - if (!sc->def->voltage_step1 || !sc->def->voltage_step2) + if (bootverbose) + device_printf(sc->base_dev, "Setting %s (%s) to %d<->%d\n", + regnode_get_name(regnode), + sc->def->name, + min_uvolt, max_uvolt); + + if (sc->def->voltage_step1 == 0) return (ENXIO); - if (axp81x_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) + if (axp8xx_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) return (ERANGE); - axp81x_write(sc->base_dev, sc->def->voltage_reg, val); + axp8xx_write(sc->base_dev, sc->def->voltage_reg, val); *udelay = 0; @@ -306,9 +599,9 @@ axp81x_regnode_set_voltage(struct regnode *regnode, in } static int -axp81x_regnode_get_voltage(struct regnode *regnode, int *uvolt) +axp8xx_regnode_get_voltage(struct regnode *regnode, int *uvolt) { - struct axp81x_reg_sc *sc; + struct axp8xx_reg_sc *sc; uint8_t val; sc = regnode_get_softc(regnode); @@ -316,25 +609,25 @@ axp81x_regnode_get_voltage(struct regnode *regnode, in 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); + axp8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + axp8xx_regnode_reg_to_voltage(sc, val & AXP_VOLTCTL_MASK, uvolt); return (0); } -static regnode_method_t axp81x_regnode_methods[] = { +static regnode_method_t axp8xx_regnode_methods[] = { /* Regulator interface */ - REGNODEMETHOD(regnode_init, axp81x_regnode_init), - REGNODEMETHOD(regnode_enable, axp81x_regnode_enable), - REGNODEMETHOD(regnode_set_voltage, axp81x_regnode_set_voltage), - REGNODEMETHOD(regnode_get_voltage, axp81x_regnode_get_voltage), + REGNODEMETHOD(regnode_init, axp8xx_regnode_init), + REGNODEMETHOD(regnode_enable, axp8xx_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, axp8xx_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, axp8xx_regnode_get_voltage), REGNODEMETHOD_END }; -DEFINE_CLASS_1(axp81x_regnode, axp81x_regnode_class, axp81x_regnode_methods, - sizeof(struct axp81x_reg_sc), regnode_class); +DEFINE_CLASS_1(axp8xx_regnode, axp8xx_regnode_class, axp8xx_regnode_methods, + sizeof(struct axp8xx_reg_sc), regnode_class); static void -axp81x_shutdown(void *devp, int howto) +axp8xx_shutdown(void *devp, int howto) { device_t dev; @@ -344,13 +637,13 @@ axp81x_shutdown(void *devp, int howto) dev = devp; if (bootverbose) - device_printf(dev, "Shutdown AXP81x\n"); + device_printf(dev, "Shutdown Axp8xx\n"); - axp81x_write(dev, AXP_POWERBAT, AXP_POWERBAT_SHUTDOWN); + axp8xx_write(dev, AXP_POWERBAT, AXP_POWERBAT_SHUTDOWN); } static void -axp81x_intr(void *arg) +axp8xx_intr(void *arg) { device_t dev; uint8_t val; @@ -358,7 +651,7 @@ axp81x_intr(void *arg) dev = arg; - error = axp81x_read(dev, AXP_IRQSTAT5, &val, 1); + error = axp8xx_read(dev, AXP_IRQSTAT5, &val, 1); if (error != 0) return; @@ -369,14 +662,14 @@ axp81x_intr(void *arg) shutdown_nice(RB_POWEROFF); } /* Acknowledge */ - axp81x_write(dev, AXP_IRQSTAT5, val); + axp8xx_write(dev, AXP_IRQSTAT5, val); } } static device_t -axp81x_gpio_get_bus(device_t dev) +axp8xx_gpio_get_bus(device_t dev) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; sc = device_get_softc(dev); @@ -384,28 +677,28 @@ axp81x_gpio_get_bus(device_t dev) } static int -axp81x_gpio_pin_max(device_t dev, int *maxpin) +axp8xx_gpio_pin_max(device_t dev, int *maxpin) { - *maxpin = nitems(axp81x_pins) - 1; + *maxpin = nitems(axp8xx_pins) - 1; return (0); } static int -axp81x_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +axp8xx_gpio_pin_getname(device_t dev, uint32_t pin, char *name) { - if (pin >= nitems(axp81x_pins)) + if (pin >= nitems(axp8xx_pins)) return (EINVAL); - snprintf(name, GPIOMAXNAME, "%s", axp81x_pins[pin].name); + snprintf(name, GPIOMAXNAME, "%s", axp8xx_pins[pin].name); return (0); } static int -axp81x_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +axp8xx_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) { - if (pin >= nitems(axp81x_pins)) + if (pin >= nitems(axp8xx_pins)) return (EINVAL); *caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; @@ -414,19 +707,19 @@ axp81x_gpio_pin_getcaps(device_t dev, uint32_t pin, ui } static int -axp81x_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +axp8xx_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; uint8_t data, func; int error; - if (pin >= nitems(axp81x_pins)) + if (pin >= nitems(axp8xx_pins)) return (EINVAL); sc = device_get_softc(dev); AXP_LOCK(sc); - error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + error = axp8xx_read(dev, axp8xx_pins[pin].ctrl_reg, &data, 1); if (error == 0) { func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; if (func == AXP_GPIO_FUNC_INPUT) @@ -443,26 +736,26 @@ axp81x_gpio_pin_getflags(device_t dev, uint32_t pin, u } static int -axp81x_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +axp8xx_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; uint8_t data; int error; - if (pin >= nitems(axp81x_pins)) + if (pin >= nitems(axp8xx_pins)) return (EINVAL); sc = device_get_softc(dev); AXP_LOCK(sc); - error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + error = axp8xx_read(dev, axp8xx_pins[pin].ctrl_reg, &data, 1); if (error == 0) { data &= ~AXP_GPIO_FUNC; if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) != 0) { if ((flags & GPIO_PIN_OUTPUT) == 0) data |= AXP_GPIO_FUNC_INPUT; } - error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); + error = axp8xx_write(dev, axp8xx_pins[pin].ctrl_reg, data); } AXP_UNLOCK(sc); @@ -470,19 +763,19 @@ axp81x_gpio_pin_setflags(device_t dev, uint32_t pin, u } static int -axp81x_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +axp8xx_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; uint8_t data, func; int error; - if (pin >= nitems(axp81x_pins)) + if (pin >= nitems(axp8xx_pins)) return (EINVAL); sc = device_get_softc(dev); AXP_LOCK(sc); - error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + error = axp8xx_read(dev, axp8xx_pins[pin].ctrl_reg, &data, 1); if (error == 0) { func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; switch (func) { @@ -493,7 +786,7 @@ axp81x_gpio_pin_get(device_t dev, uint32_t pin, unsign *val = 1; break; case AXP_GPIO_FUNC_INPUT: - error = axp81x_read(dev, AXP_GPIO_SIGBIT, &data, 1); + error = axp8xx_read(dev, AXP_GPIO_SIGBIT, &data, 1); if (error == 0) *val = (data & (1 << pin)) ? 1 : 0; break; @@ -508,19 +801,19 @@ axp81x_gpio_pin_get(device_t dev, uint32_t pin, unsign } static int -axp81x_gpio_pin_set(device_t dev, uint32_t pin, unsigned int val) +axp8xx_gpio_pin_set(device_t dev, uint32_t pin, unsigned int val) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; uint8_t data, func; int error; - if (pin >= nitems(axp81x_pins)) + if (pin >= nitems(axp8xx_pins)) return (EINVAL); sc = device_get_softc(dev); AXP_LOCK(sc); - error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + error = axp8xx_read(dev, axp8xx_pins[pin].ctrl_reg, &data, 1); if (error == 0) { func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; switch (func) { @@ -535,7 +828,7 @@ axp81x_gpio_pin_set(device_t dev, uint32_t pin, unsign } } if (error == 0) - error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); + error = axp8xx_write(dev, axp8xx_pins[pin].ctrl_reg, data); AXP_UNLOCK(sc); return (error); @@ -543,19 +836,19 @@ axp81x_gpio_pin_set(device_t dev, uint32_t pin, unsign static int -axp81x_gpio_pin_toggle(device_t dev, uint32_t pin) +axp8xx_gpio_pin_toggle(device_t dev, uint32_t pin) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; uint8_t data, func; int error; - if (pin >= nitems(axp81x_pins)) + if (pin >= nitems(axp8xx_pins)) return (EINVAL); sc = device_get_softc(dev); AXP_LOCK(sc); - error = axp81x_read(dev, axp81x_pins[pin].ctrl_reg, &data, 1); + error = axp8xx_read(dev, axp8xx_pins[pin].ctrl_reg, &data, 1); if (error == 0) { func = (data & AXP_GPIO_FUNC) >> AXP_GPIO_FUNC_SHIFT; switch (func) { @@ -573,17 +866,17 @@ axp81x_gpio_pin_toggle(device_t dev, uint32_t pin) } } if (error == 0) - error = axp81x_write(dev, axp81x_pins[pin].ctrl_reg, data); + error = axp8xx_write(dev, axp8xx_pins[pin].ctrl_reg, data); AXP_UNLOCK(sc); return (error); } static int -axp81x_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, +axp8xx_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, uint32_t *flags) { - if (gpios[0] >= nitems(axp81x_pins)) + if (gpios[0] >= nitems(axp8xx_pins)) return (EINVAL); *pin = gpios[0]; @@ -593,16 +886,16 @@ axp81x_gpio_map_gpios(device_t bus, phandle_t dev, pha } static phandle_t -axp81x_get_node(device_t dev, device_t bus) +axp8xx_get_node(device_t dev, device_t bus) { return (ofw_bus_get_node(dev)); } -static struct axp81x_reg_sc * -axp81x_reg_attach(device_t dev, phandle_t node, - struct axp81x_regdef *def) +static struct axp8xx_reg_sc * +axp8xx_reg_attach(device_t dev, phandle_t node, + struct axp8xx_regdef *def) { - struct axp81x_reg_sc *reg_sc; + struct axp8xx_reg_sc *reg_sc; struct regnode_init_def initdef; struct regnode *regnode; @@ -614,7 +907,7 @@ axp81x_reg_attach(device_t dev, phandle_t node, 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); + regnode = regnode_create(dev, &axp8xx_regnode_class, &initdef); if (regnode == NULL) { device_printf(dev, "cannot create regulator\n"); return (NULL); @@ -633,10 +926,10 @@ axp81x_reg_attach(device_t dev, phandle_t node, } static int -axp81x_regdev_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, +axp8xx_regdev_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, intptr_t *num) { - struct axp81x_softc *sc; + struct axp8xx_softc *sc; int i; sc = device_get_softc(dev); @@ -653,24 +946,31 @@ axp81x_regdev_map(device_t dev, phandle_t xref, int nc } static int -axp81x_probe(device_t dev) +axp8xx_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) + { + case AXP803: + device_set_desc(dev, "X-Powers AXP803 Power Management Unit"); + break; + case AXP813: + device_set_desc(dev, "X-Powers AXP813 Power Management Unit"); + break; + default: return (ENXIO); + } - device_set_desc(dev, "X-Powers AXP81x Power Management Unit"); - return (BUS_PROBE_DEFAULT); } static int -axp81x_attach(device_t dev) +axp8xx_attach(device_t dev) { - struct axp81x_softc *sc; - struct axp81x_reg_sc *reg; + struct axp8xx_softc *sc; + struct axp8xx_reg_sc *reg; uint8_t chip_id; phandle_t rnode, child; int error, i; @@ -680,34 +980,65 @@ axp81x_attach(device_t dev) sc->addr = iicbus_get_addr(dev); mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); - error = bus_alloc_resources(dev, axp81x_spec, &sc->res); + error = bus_alloc_resources(dev, axp8xx_spec, &sc->res); if (error != 0) { device_printf(dev, "cannot allocate resources for device\n"); return (error); } if (bootverbose) { - axp81x_read(dev, AXP_ICTYPE, &chip_id, 1); + axp8xx_read(dev, AXP_ICTYPE, &chip_id, 1); device_printf(dev, "chip ID 0x%02x\n", chip_id); } - sc->nregs = nitems(axp81x_regdefs); - sc->regs = malloc(sizeof(struct axp81x_reg_sc *) * sc->nregs, - M_AXP81X_REG, M_WAITOK | M_ZERO); + sc->nregs = nitems(axp8xx_common_regdefs); + sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + switch (sc->type) { + case AXP803: + sc->nregs += nitems(axp803_regdefs); + break; + case AXP813: + sc->nregs += nitems(axp813_regdefs); + break; + } + sc->regs = malloc(sizeof(struct axp8xx_reg_sc *) * sc->nregs, + M_AXP8XX_REG, M_WAITOK | M_ZERO); /* Attach known regulators that exist in the DT */ rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); if (rnode > 0) { for (i = 0; i < sc->nregs; i++) { + char *regname; + struct axp8xx_regdef *regdef; + + if (i <= nitems(axp8xx_common_regdefs)) { + regname = axp8xx_common_regdefs[i].name; + regdef = &axp8xx_common_regdefs[i]; + } else { + int off; + + off = i - nitems(axp8xx_common_regdefs); + switch (sc->type) { + case AXP803: + regname = axp803_regdefs[off].name; + regdef = &axp803_regdefs[off]; + break; + case AXP813: + regname = axp813_regdefs[off].name; + regdef = &axp813_regdefs[off]; + break; + } + } child = ofw_bus_find_child(rnode, - axp81x_regdefs[i].name); + regname); if (child == 0) continue; - reg = axp81x_reg_attach(dev, child, &axp81x_regdefs[i]); + reg = axp8xx_reg_attach(dev, child, + regdef); if (reg == NULL) { device_printf(dev, "cannot attach regulator %s\n", - axp81x_regdefs[i].name); + regname); return (ENXIO); } sc->regs[i] = reg; @@ -715,22 +1046,22 @@ axp81x_attach(device_t dev) } /* Enable IRQ on short power key press */ - axp81x_write(dev, AXP_IRQEN1, 0); - axp81x_write(dev, AXP_IRQEN2, 0); - axp81x_write(dev, AXP_IRQEN3, 0); - axp81x_write(dev, AXP_IRQEN4, 0); - axp81x_write(dev, AXP_IRQEN5, AXP_IRQEN5_POKSIRQ); - axp81x_write(dev, AXP_IRQEN6, 0); + axp8xx_write(dev, AXP_IRQEN1, 0); + axp8xx_write(dev, AXP_IRQEN2, 0); + axp8xx_write(dev, AXP_IRQEN3, 0); + axp8xx_write(dev, AXP_IRQEN4, 0); + axp8xx_write(dev, AXP_IRQEN5, AXP_IRQEN5_POKSIRQ); + axp8xx_write(dev, AXP_IRQEN6, 0); /* Install interrupt handler */ error = bus_setup_intr(dev, sc->res, INTR_TYPE_MISC | INTR_MPSAFE, - NULL, axp81x_intr, dev, &sc->ih); + NULL, axp8xx_intr, dev, &sc->ih); if (error != 0) { device_printf(dev, "cannot setup interrupt handler\n"); return (error); } - EVENTHANDLER_REGISTER(shutdown_final, axp81x_shutdown, dev, + EVENTHANDLER_REGISTER(shutdown_final, axp8xx_shutdown, dev, SHUTDOWN_PRI_LAST); sc->gpiodev = gpiobus_attach_bus(dev); @@ -738,46 +1069,46 @@ axp81x_attach(device_t dev) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Mar 3 18:30:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24148F2FFD2; Sat, 3 Mar 2018 18:30:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5F796F185; Sat, 3 Mar 2018 18:30:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0A7A1E35; Sat, 3 Mar 2018 18:30:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23IUV0b072058; Sat, 3 Mar 2018 18:30:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IUV5K072057; Sat, 3 Mar 2018 18:30:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803031830.w23IUV5K072057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 3 Mar 2018 18:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330348 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 330348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:30:32 -0000 Author: manu Date: Sat Mar 3 18:30:31 2018 New Revision: 330348 URL: https://svnweb.freebsd.org/changeset/base/330348 Log: aw_mmc: Regulator improvement Getting regulator is good, enabling them is better. When the mmc stack decide to change the voltage for IO, don't change the main vcc of the sd/mmc, only the io vcc. Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Sat Mar 3 18:28:19 2018 (r330347) +++ head/sys/arm/allwinner/aw_mmc.c Sat Mar 3 18:30:31 2018 (r330348) @@ -267,11 +267,17 @@ aw_mmc_attach(device_t dev) bus_width = 4; if (regulator_get_by_ofw_property(dev, 0, "vmmc-supply", - &sc->aw_reg_vmmc) == 0 && bootverbose) - device_printf(dev, "vmmc-supply regulator found\n"); + &sc->aw_reg_vmmc) == 0) { + if (bootverbose) + device_printf(dev, "vmmc-supply regulator found\n"); + regulator_enable(sc->aw_reg_vmmc); + } if (regulator_get_by_ofw_property(dev, 0, "vqmmc-supply", - &sc->aw_reg_vqmmc) == 0 && bootverbose) - device_printf(dev, "vqmmc-supply regulator found\n"); + &sc->aw_reg_vqmmc) == 0 && bootverbose) { + if (bootverbose) + device_printf(dev, "vqmmc-supply regulator found\n"); + regulator_enable(sc->aw_reg_vqmmc); + } sc->aw_host.f_min = 400000; sc->aw_host.f_max = 52000000; @@ -861,7 +867,7 @@ aw_mmc_set_power(struct aw_mmc_softc *sc, int32_t vdd) sc->aw_vdd = vdd; - if (sc->aw_reg_vmmc == NULL && sc->aw_reg_vqmmc == NULL) + if (sc->aw_reg_vqmmc == NULL) return; switch (1 << vdd) { @@ -878,13 +884,6 @@ aw_mmc_set_power(struct aw_mmc_softc *sc, int32_t vdd) break; } - if (sc->aw_reg_vmmc) - if (regulator_set_voltage(sc->aw_reg_vmmc, - min_uvolt, max_uvolt) != 0) - device_printf(sc->aw_dev, - "Cannot set vmmc to %d<->%d\n", - min_uvolt, - max_uvolt); if (sc->aw_reg_vqmmc) if (regulator_set_voltage(sc->aw_reg_vqmmc, min_uvolt, max_uvolt) != 0) From owner-svn-src-head@freebsd.org Sat Mar 3 18:36:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1993F306DF; Sat, 3 Mar 2018 18:36:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BAA76F668; Sat, 3 Mar 2018 18:36:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 830A61FDC; Sat, 3 Mar 2018 18:36:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23Iacwg077191; Sat, 3 Mar 2018 18:36:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IacY3077188; Sat, 3 Mar 2018 18:36:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803031836.w23IacY3077188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 3 Mar 2018 18:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330349 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 330349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:36:39 -0000 Author: hselasky Date: Sat Mar 3 18:36:38 2018 New Revision: 330349 URL: https://svnweb.freebsd.org/changeset/base/330349 Log: Allow pause_sbt() to catch signals during sleep by passing C_CATCH flag. Define pause_sig() function macro helper similarly to other kernel functions which catch signals. Update outdated function description. Discussed with: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_synch.c head/sys/sys/callout.h head/sys/sys/systm.h Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sat Mar 3 18:30:31 2018 (r330348) +++ head/sys/kern/kern_synch.c Sat Mar 3 18:36:38 2018 (r330349) @@ -297,16 +297,16 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const ch } /* - * pause() delays the calling thread by the given number of system ticks. - * During cold bootup, pause() uses the DELAY() function instead of - * the tsleep() function to do the waiting. The "timo" argument must be - * greater than or equal to zero. A "timo" value of zero is equivalent - * to a "timo" value of one. + * pause_sbt() delays the calling thread by the given signed binary + * time. During cold bootup, pause_sbt() uses the DELAY() function + * instead of the _sleep() function to do the waiting. The "sbt" + * argument must be greater than or equal to zero. A "sbt" value of + * zero is equivalent to a "sbt" value of one tick. */ int pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags) { - KASSERT(sbt >= 0, ("pause: timeout must be >= 0")); + KASSERT(sbt >= 0, ("pause_sbt: timeout must be >= 0")); /* silently convert invalid timeouts */ if (sbt == 0) @@ -328,7 +328,8 @@ pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_ DELAY(sbt); return (EWOULDBLOCK); } - return (_sleep(&pause_wchan[curcpu], NULL, 0, wmesg, sbt, pr, flags)); + return (_sleep(&pause_wchan[curcpu], NULL, + (flags & C_CATCH) ? PCATCH : 0, wmesg, sbt, pr, flags)); } /* Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Sat Mar 3 18:30:31 2018 (r330348) +++ head/sys/sys/callout.h Sat Mar 3 18:36:38 2018 (r330349) @@ -60,6 +60,7 @@ #define C_HARDCLOCK 0x0100 /* align to hardclock() calls */ #define C_ABSOLUTE 0x0200 /* event time is absolute. */ #define C_PRECALC 0x0400 /* event time is pre-calculated. */ +#define C_CATCH 0x0800 /* catch signals, used by pause_sbt(9) */ struct callout_handle { struct callout *callout; Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Mar 3 18:30:31 2018 (r330348) +++ head/sys/sys/systm.h Sat Mar 3 18:36:38 2018 (r330349) @@ -411,6 +411,8 @@ int pause_sbt(const char *wmesg, sbintime_t sbt, sbint int flags); #define pause(wmesg, timo) \ pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK) +#define pause_sig(wmesg, timo) \ + pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK | C_CATCH) #define tsleep(chan, pri, wmesg, timo) \ _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \ 0, C_HARDCLOCK) From owner-svn-src-head@freebsd.org Sat Mar 3 18:40:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A60F30C5F; Sat, 3 Mar 2018 18:40:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED6576F9C1; Sat, 3 Mar 2018 18:40:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E83421FF8; Sat, 3 Mar 2018 18:40:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23Iekow077395; Sat, 3 Mar 2018 18:40:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IekoB077394; Sat, 3 Mar 2018 18:40:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031840.w23IekoB077394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 18:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330350 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 330350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:40:47 -0000 Author: kevans Date: Sat Mar 3 18:40:46 2018 New Revision: 330350 URL: https://svnweb.freebsd.org/changeset/base/330350 Log: aw_syscon(4): Move to BUS_PASS_SUPPORTDEV It would have been on an actual named pass before, but none were really appropriate in name. Move it to the recently created SUPPORTDEV pass, which perfectly describes it and keeps it in the right order. Modified: head/sys/arm/allwinner/aw_syscon.c Modified: head/sys/arm/allwinner/aw_syscon.c ============================================================================== --- head/sys/arm/allwinner/aw_syscon.c Sat Mar 3 18:36:38 2018 (r330349) +++ head/sys/arm/allwinner/aw_syscon.c Sat Mar 3 18:40:46 2018 (r330350) @@ -80,5 +80,5 @@ DEFINE_CLASS_1(aw_syscon, aw_syscon_driver, aw_syscon_ static devclass_t aw_syscon_devclass; /* aw_syscon needs to attach prior to if_awg */ EARLY_DRIVER_MODULE(aw_syscon, simplebus, aw_syscon_driver, aw_syscon_devclass, - 0, 0, BUS_PASS_DEFAULT - 1000); + 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(aw_syscon, 1); From owner-svn-src-head@freebsd.org Sat Mar 3 18:52:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA2C7F31C6A; Sat, 3 Mar 2018 18:52:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C1C770642; Sat, 3 Mar 2018 18:52:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66C5A22FF; Sat, 3 Mar 2018 18:52:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23IqJHn086043; Sat, 3 Mar 2018 18:52:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IqJB6086042; Sat, 3 Mar 2018 18:52:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031852.w23IqJB6086042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 18:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330351 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 330351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:52:19 -0000 Author: kevans Date: Sat Mar 3 18:52:19 2018 New Revision: 330351 URL: https://svnweb.freebsd.org/changeset/base/330351 Log: Move imx6_usbphy to SUPPORTDEV, massage associated comment No objections from: ian Modified: head/sys/arm/freescale/imx/imx6_usbphy.c Modified: head/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_usbphy.c Sat Mar 3 18:40:46 2018 (r330350) +++ head/sys/arm/freescale/imx/imx6_usbphy.c Sat Mar 3 18:52:19 2018 (r330351) @@ -202,9 +202,9 @@ static devclass_t usbphy_devclass; /* * This driver needs to start before the ehci driver, but later than the usual - * "special" drivers like clocks and cpu. Ehci starts at DEFAULT so - * DEFAULT-1000 seems good. + * "special" drivers like clocks and cpu. Ehci starts at DEFAULT so SUPPORTDEV + * is where this driver fits most. */ EARLY_DRIVER_MODULE(usbphy, simplebus, usbphy_driver, usbphy_devclass, 0, 0, - BUS_PASS_DEFAULT - 1000); + BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-head@freebsd.org Sat Mar 3 18:54:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFABDF31F44; Sat, 3 Mar 2018 18:54:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63ED370858; Sat, 3 Mar 2018 18:54:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43C83230C; Sat, 3 Mar 2018 18:54:17 +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 w23IsH1X086837; Sat, 3 Mar 2018 18:54:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IsHxm086835; Sat, 3 Mar 2018 18:54:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803031854.w23IsHxm086835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 3 Mar 2018 18:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 330352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 18:54:17 -0000 Author: hselasky Date: Sat Mar 3 18:54:16 2018 New Revision: 330352 URL: https://svnweb.freebsd.org/changeset/base/330352 Log: Implement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt() instead of pause() in the msleep() function to avoid rounding errors when converting delay values forth and back. Add a guard for a delay value of zero milliseconds which is undefined. MFC after: 1 week Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h head/sys/compat/linuxkpi/common/src/linux_schedule.c Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar 3 18:52:19 2018 (r330351) +++ head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar 3 18:54:16 2018 (r330352) @@ -36,14 +36,20 @@ #include static inline void -linux_msleep(int ms) +linux_msleep(unsigned int ms) { - pause("lnxsleep", msecs_to_jiffies(ms)); + /* guard against invalid values */ + if (ms == 0) + ms = 1; + pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK); } #undef msleep -#define msleep linux_msleep +#define msleep(ms) linux_msleep(ms) +#undef msleep_interruptible +#define msleep_interruptible(ms) linux_msleep_interruptible(ms) + #define udelay(t) DELAY(t) static inline void @@ -64,5 +70,7 @@ usleep_range(unsigned long min, unsigned long max) { DELAY(min); } + +extern unsigned int linux_msleep_interruptible(unsigned int ms); #endif /* _LINUX_DELAY_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_schedule.c Sat Mar 3 18:52:19 2018 (r330351) +++ head/sys/compat/linuxkpi/common/src/linux_schedule.c Sat Mar 3 18:54:16 2018 (r330352) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -72,6 +73,25 @@ linux_add_to_sleepqueue(void *wchan, struct task_struc ret = -ERESTARTSYS; } return (ret); +} + +unsigned int +linux_msleep_interruptible(unsigned int ms) +{ + int ret; + + /* guard against invalid values */ + if (ms == 0) + ms = 1; + ret = -pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK | C_CATCH); + + switch (ret) { + case -EWOULDBLOCK: + return (0); + default: + linux_schedule_save_interrupt_value(current, ret); + return (ms); + } } static int From owner-svn-src-head@freebsd.org Sat Mar 3 19:14:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E16EF334FB for ; Sat, 3 Mar 2018 19:14:51 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A2371369 for ; Sat, 3 Mar 2018 19:14:50 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0796533b-1f17-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 0796533b-1f17-11e8-b951-f99fef315fd9; Sat, 03 Mar 2018 19:14:01 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w23JEgit090819; Sat, 3 Mar 2018 12:14:42 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520104482.23690.15.camel@freebsd.org> Subject: Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src From: Ian Lepore To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 03 Mar 2018 12:14:42 -0700 In-Reply-To: <201803031854.w23IsHxm086835@repo.freebsd.org> References: <201803031854.w23IsHxm086835@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 19:14:51 -0000 On Sat, 2018-03-03 at 18:54 +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Mar  3 18:54:16 2018 > New Revision: 330352 > URL: https://svnweb.freebsd.org/changeset/base/330352 > > Log: >   Implement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt() >   instead of pause() in the msleep() function to avoid rounding errors when >   converting delay values forth and back. Add a guard for a delay value >   of zero milliseconds which is undefined. >    >   MFC after: 1 week >   Requested by: Johannes Lundberg >   Sponsored by: Mellanox Technologies > > Modified: >   head/sys/compat/linuxkpi/common/include/linux/delay.h >   head/sys/compat/linuxkpi/common/src/linux_schedule.c > > Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar  3 18:52:19 2018 (r330351) > +++ head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar  3 18:54:16 2018 (r330352) > @@ -36,14 +36,20 @@ >  #include >   >  static inline void > -linux_msleep(int ms) > +linux_msleep(unsigned int ms) >  { > - pause("lnxsleep", msecs_to_jiffies(ms)); > + /* guard against invalid values */ > + if (ms == 0) > + ms = 1; > + pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK); >  } >   To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms. The rounding errors when multiplying or dividing by SBT_1MS is not severe like it is with SBT_1NS, but the inline functions still do the arithmetic more correctly to avoid roundoff error. -- Ian From owner-svn-src-head@freebsd.org Sat Mar 3 19:15:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66955F33621; Sat, 3 Mar 2018 19:15:32 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0b-0010f301.pphosted.com (mx0b-0010f301.pphosted.com [148.163.153.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C953771579; Sat, 3 Mar 2018 19:15:31 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102860.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w23J6B95023498; Sat, 3 Mar 2018 13:06:40 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=CeU5WV0Yi/FTWrvgqpwNR72U6e9R5Ds7NvBZgccOmLs=; b=GpsZ4GT36KgVlltcZSSLs6v7G0f1a21C1t4TJ/+t9e+t9+jdp4Zk/0Sjx43yurQWG6P2 3meDoT2okc4Mw8tiWo3vyOHHu+iF6D9Pt59p3rBy4SSiK+/tdjuYq9WiEiOB+FsI69SV IQwD0f7BM2o64f68e0f/Kk8GX9U9gAj+WGpi8Z9z3IKemmFcFFASguSGhzfC6LCjjku6 IQ5HM9gOLWBhxCC1FbwtjYEvoEMRes8hnZmcp1Rd6qP1TsdPPTO7ZKqI5bd3z280NglC HJgRqQsZ7oDZFlmr7tIx4yhaJtbclmDEtlpV7r7dDukjkomANqMh8R6RfABlcTK+dt6s dQ== Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by mx0b-0010f301.pphosted.com with ESMTP id 2gfsy3rapq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 03 Mar 2018 13:06:40 -0600 Received-X: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id A75D1500281; Sat, 3 Mar 2018 13:06:39 -0600 (CST) Received-X: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id A5DF550023A; Sat, 3 Mar 2018 13:06:39 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received-X: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id cjkZKRXwP4wv; Sat, 3 Mar 2018 13:06:39 -0600 (CST) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (162-234-74-167.lightspeed.hstntx.sbcglobal.net [162.234.74.167]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id 483D1500248; Sat, 3 Mar 2018 13:06:39 -0600 (CST) Subject: Re: svn commit: r309017 - in head/sys: cddl/compat/opensolaris/sys compat/linprocfs fs/tmpfs sys vm To: Alexey Dokuchaev , Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201611221813.uAMIDkHQ071392@repo.freebsd.org> <20180303084817.GA66382@FreeBSD.org> From: Alan Cox Message-ID: <40f92b0f-9abf-efdc-f1f8-b222fb036c69@rice.edu> Date: Sat, 3 Mar 2018 13:06:38 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180303084817.GA66382@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-03_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=10 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=788 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803030242 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 19:15:32 -0000 On 03/03/2018 02:48, Alexey Dokuchaev wrote: > On Tue, Nov 22, 2016 at 06:13:46PM +0000, Alan Cox wrote: >> New Revision: 309017 >> URL: https://svnweb.freebsd.org/changeset/base/309017 >> >> Log: >> Remove PG_CACHED-related fields from struct vmmeter, because they are no >> longer used. More precisely, they are always zero because the code that >> decremented and incremented them no longer exists. >> >> Bump __FreeBSD_version to mark this change. >> >> Reviewed by: kib, markj >> Sponsored by: Dell EMC Isilon >> Differential Revision: https://reviews.freebsd.org/D8583 >> >> Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h >> ... >> -#define freemem (vm_cnt.v_free_count + vm_cnt.v_cache_count) >> +#define freemem vm_cnt.v_free_count > This looks correct now. > >> Modified: head/sys/compat/linprocfs/linprocfs.c >> ... >> @@ -176,7 +176,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) >> * like unstaticizing it just for linprocfs's sake. >> */ >> buffers = 0; >> - cached = vm_cnt.v_cache_count * PAGE_SIZE; >> + cached = vm_cnt.v_inactive_count * PAGE_SIZE; > Some applications that make calculations based on the readings from the > /usr/compat/linux/proc/meminfo are broken after this change, e.g. those > that do things like: > > return (totalMem - (freeMem + buffers + cache)) / totalMem; > > because now free memory includes cached one, and above formula gives > bogus negative result. > > In `sys/compat/linprocfs/linprocfs.c', memfree is calculated as follows: > > memtotal = physmem * PAGE_SIZE; > /* > * The correct thing here would be: > * > memfree = vm_cnt.v_free_count * PAGE_SIZE; > memused = memtotal - memfree; > * > * but it might mislead linux binaries into thinking there > * is very little memory left, so we cheat and tell them that > * all memory that isn't wired down is free. > */ > memused = vm_cnt.v_wire_count * PAGE_SIZE; > memfree = memtotal - memused; > > So, when vm.stats.vm.v_cache_count was yielding some (typically small) > result, using the aforementioned trick made sense (because even when > vm_cnt.v_free_count added to vm.stats.vm.v_cache_count it would still > be rather small). This logic no longer applies after this change. > > On my 12-CURRENT i386 system, /usr/compat/linux/proc/meminfo reports: > > % cat /usr/compat/linux/proc/meminfo | head -4 > MemTotal: 3132504 kB > MemFree: 2925936 kB <<< that's a lot > Buffers: 0 kB > Cached: 2212196 kB <<< that's also a lot > > On an older 4.11-STABLE box (also i386), it reports: > > MemTotal: 521828 kB > MemFree: 383976 kB > MemShared: 7480 kB > Buffers: 0 kB > Cached: 22732 kB (can be added to MemFree and still < MemTotal) > > So either the "cheat" have to go away and vm_cnt.v_free_count used as it > should, or cached memory should not be read from vm_cnt.v_inactive_count > but estimated somehow else. Which approach would be more correct? The former. From owner-svn-src-head@freebsd.org Sat Mar 3 19:26:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B894DF34687; Sat, 3 Mar 2018 19:26:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D009722CB; Sat, 3 Mar 2018 19:26:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52F9B27F3; Sat, 3 Mar 2018 19:26:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23JQfYU002849; Sat, 3 Mar 2018 19:26:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23JQfrG002847; Sat, 3 Mar 2018 19:26:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803031926.w23JQfrG002847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 3 Mar 2018 19:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330353 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 330353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 19:26:41 -0000 Author: hselasky Date: Sat Mar 3 19:26:40 2018 New Revision: 330353 URL: https://svnweb.freebsd.org/changeset/base/330353 Log: Use mstosbt() instead of SBT_1MS in the LinuxKPI to get the last few bits of precision. MFC after: 1 week Suggested by: ian@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h head/sys/compat/linuxkpi/common/src/linux_schedule.c Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar 3 18:54:16 2018 (r330352) +++ head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar 3 19:26:40 2018 (r330353) @@ -41,7 +41,7 @@ linux_msleep(unsigned int ms) /* guard against invalid values */ if (ms == 0) ms = 1; - pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK); + pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK); } #undef msleep Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_schedule.c Sat Mar 3 18:54:16 2018 (r330352) +++ head/sys/compat/linuxkpi/common/src/linux_schedule.c Sat Mar 3 19:26:40 2018 (r330353) @@ -83,7 +83,7 @@ linux_msleep_interruptible(unsigned int ms) /* guard against invalid values */ if (ms == 0) ms = 1; - ret = -pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK | C_CATCH); + ret = -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH); switch (ret) { case -EWOULDBLOCK: From owner-svn-src-head@freebsd.org Sat Mar 3 19:28:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 348F7F34940; Sat, 3 Mar 2018 19:28:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D992724CF; Sat, 3 Mar 2018 19:28:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D82722601A6; Sat, 3 Mar 2018 20:28:28 +0100 (CET) Subject: Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803031854.w23IsHxm086835@repo.freebsd.org> <1520104482.23690.15.camel@freebsd.org> From: Hans Petter Selasky Message-ID: <3534a8fa-4018-9b35-47cd-6ffa72a0c2b6@selasky.org> Date: Sat, 3 Mar 2018 20:28:26 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1520104482.23690.15.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 19:28:31 -0000 On 03/03/18 20:14, Ian Lepore wrote: > On Sat, 2018-03-03 at 18:54 +0000, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Sat Mar  3 18:54:16 2018 >> New Revision: 330352 >> URL: https://svnweb.freebsd.org/changeset/base/330352 >> >> Log: >>   Implement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt() >>   instead of pause() in the msleep() function to avoid rounding errors when >>   converting delay values forth and back. Add a guard for a delay value >>   of zero milliseconds which is undefined. >> >>   MFC after: 1 week >>   Requested by: Johannes Lundberg >>   Sponsored by: Mellanox Technologies >> >> Modified: >>   head/sys/compat/linuxkpi/common/include/linux/delay.h >>   head/sys/compat/linuxkpi/common/src/linux_schedule.c >> >> Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h >> ============================================================================== >> --- head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar  3 18:52:19 2018 (r330351) >> +++ head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar  3 18:54:16 2018 (r330352) >> @@ -36,14 +36,20 @@ >>  #include >> >>  static inline void >> -linux_msleep(int ms) >> +linux_msleep(unsigned int ms) >>  { >> - pause("lnxsleep", msecs_to_jiffies(ms)); >> + /* guard against invalid values */ >> + if (ms == 0) >> + ms = 1; >> + pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK); >>  } >> > > To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms. > You're right. See r330353. Really, this only makes a noticable difference for larger timeouts. --HPS From owner-svn-src-head@freebsd.org Sat Mar 3 20:42:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A2BDF3AA4E; Sat, 3 Mar 2018 20:42:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1FF275659; Sat, 3 Mar 2018 20:42:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD02038B6; Sat, 3 Mar 2018 20:42:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23Kgdrr042386; Sat, 3 Mar 2018 20:42:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23Kgdqp042385; Sat, 3 Mar 2018 20:42:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803032042.w23Kgdqp042385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 20:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330354 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 330354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 20:42:40 -0000 Author: eadler Date: Sat Mar 3 20:42:39 2018 New Revision: 330354 URL: https://svnweb.freebsd.org/changeset/base/330354 Log: sys/fuse: fix off by one error Reported by: Ilja Van Sprundel Reported by: Domagoj Stolfa Modified: head/sys/fs/fuse/fuse_internal.c Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Sat Mar 3 19:26:40 2018 (r330353) +++ head/sys/fs/fuse/fuse_internal.c Sat Mar 3 20:42:39 2018 (r330354) @@ -357,7 +357,7 @@ fuse_internal_readdir_processdata(struct uio *uio, memcpy((char *)cookediov->base + sizeof(struct dirent) - MAXNAMLEN - 1, (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - ((char *)cookediov->base)[bytesavail] = '\0'; + ((char *)cookediov->base)[bytesavail - 1] = '\0'; err = uiomove(cookediov->base, cookediov->len, uio); if (err) { From owner-svn-src-head@freebsd.org Sat Mar 3 20:49:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED74F3B254; Sat, 3 Mar 2018 20:49:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D324375B9C; Sat, 3 Mar 2018 20:49:28 +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 w23KnDfs093635 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 3 Mar 2018 22:49:16 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w23KnDfs093635 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w23KnD7U093634; Sat, 3 Mar 2018 22:49:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 3 Mar 2018 22:49:13 +0200 From: Konstantin Belousov To: Ian Lepore Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src Message-ID: <20180303204913.GI3194@kib.kiev.ua> References: <201803031854.w23IsHxm086835@repo.freebsd.org> <1520104482.23690.15.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520104482.23690.15.camel@freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: 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 Mar 2018 20:49:29 -0000 On Sat, Mar 03, 2018 at 12:14:42PM -0700, Ian Lepore wrote: > To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms. > > The rounding errors when multiplying or dividing by SBT_1MS is not > severe like it is with SBT_1NS, but the inline functions still do the > arithmetic more correctly to avoid roundoff error. BTW mstosbt() and other functions have weird bracing in the formula. I think that the formula as calculated by the C operator precedence is fine, i.e. multiplication is done before right shift. But the bracing is redundand then, because the '()' pair next to the return () braces by inclusion is tautological. From owner-svn-src-head@freebsd.org Sat Mar 3 20:54:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64833F3B87A for ; Sat, 3 Mar 2018 20:54:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7D3576050 for ; Sat, 3 Mar 2018 20:54:39 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 04b4a8d0-1f25-11e8-bb8e-b35b57339d60 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 04b4a8d0-1f25-11e8-bb8e-b35b57339d60; Sat, 03 Mar 2018 20:54:09 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w23KsWjE091047; Sat, 3 Mar 2018 13:54:32 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520110472.23690.18.camel@freebsd.org> Subject: Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src From: Ian Lepore To: Konstantin Belousov Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 03 Mar 2018 13:54:32 -0700 In-Reply-To: <20180303204913.GI3194@kib.kiev.ua> References: <201803031854.w23IsHxm086835@repo.freebsd.org> <1520104482.23690.15.camel@freebsd.org> <20180303204913.GI3194@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 20:54:40 -0000 On Sat, 2018-03-03 at 22:49 +0200, Konstantin Belousov wrote: > On Sat, Mar 03, 2018 at 12:14:42PM -0700, Ian Lepore wrote: > > > > To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms. > > > > The rounding errors when multiplying or dividing by SBT_1MS is not > > severe like it is with SBT_1NS, but the inline functions still do the > > arithmetic more correctly to avoid roundoff error. > BTW mstosbt() and other functions have weird bracing in the formula. I > think that the formula as calculated by the C operator precedence is > fine, i.e. multiplication is done before right shift. But the bracing > is redundand then, because the '()' pair next to the return () braces by > inclusion is tautological. Yeah, I noticed earlier today there is an extra set of parens.  I think I might have copied the code from being a multi-line expression to being all in the return and just pasted it without removing the extra parens. In general, I prefer extra parens instead of relying on knowledge of operator precedence, but it makes no sense for the outermost layer of parens. -- Ian From owner-svn-src-head@freebsd.org Sat Mar 3 21:02:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A711EF3C25C for ; Sat, 3 Mar 2018 21:02:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25A9976631 for ; Sat, 3 Mar 2018 21:02:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 226a5aa7-1f26-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 226a5aa7-1f26-11e8-b951-f99fef315fd9; Sat, 03 Mar 2018 21:02:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w23L2oaJ091082; Sat, 3 Mar 2018 14:02:50 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520110970.23690.20.camel@freebsd.org> Subject: Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src From: Ian Lepore To: Konstantin Belousov Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 03 Mar 2018 14:02:50 -0700 In-Reply-To: <20180303204913.GI3194@kib.kiev.ua> References: <201803031854.w23IsHxm086835@repo.freebsd.org> <1520104482.23690.15.camel@freebsd.org> <20180303204913.GI3194@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:02:53 -0000 On Sat, 2018-03-03 at 22:49 +0200, Konstantin Belousov wrote: > On Sat, Mar 03, 2018 at 12:14:42PM -0700, Ian Lepore wrote: > > > > To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms. > > > > The rounding errors when multiplying or dividing by SBT_1MS is not > > severe like it is with SBT_1NS, but the inline functions still do the > > arithmetic more correctly to avoid roundoff error. > BTW mstosbt() and other functions have weird bracing in the formula. I > think that the formula as calculated by the C operator precedence is > fine, i.e. multiplication is done before right shift. But the bracing > is redundand then, because the '()' pair next to the return () braces by > inclusion is tautological. > Oh, on looking closer, it's not a paste-o, I just didn't put the closing paren where I had intended to for making it clear the shift happens last.  (So almost everyone except me is still going to think a fix has redundant parens.) -- Ian From owner-svn-src-head@freebsd.org Sat Mar 3 21:14:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1513F3CFA0; Sat, 3 Mar 2018 21:14:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA1176DD3; Sat, 3 Mar 2018 21:14:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 488E33E5F; Sat, 3 Mar 2018 21:14:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23LEuVr057769; Sat, 3 Mar 2018 21:14:56 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23LEuXv057768; Sat, 3 Mar 2018 21:14:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803032114.w23LEuXv057768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 21:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330356 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 330356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:14:56 -0000 Author: eadler Date: Sat Mar 3 21:14:55 2018 New Revision: 330356 URL: https://svnweb.freebsd.org/changeset/base/330356 Log: sys/linux: Fix a few potential infoleaks in Linux IPC Submitted by: Domagoj Stolfa MFC After: 1 month Modified: head/sys/compat/linux/linux_ipc.c Modified: head/sys/compat/linux/linux_ipc.c ============================================================================== --- head/sys/compat/linux/linux_ipc.c Sat Mar 3 21:05:28 2018 (r330355) +++ head/sys/compat/linux/linux_ipc.c Sat Mar 3 21:14:55 2018 (r330356) @@ -548,6 +548,9 @@ linux_semctl(struct thread *td, struct linux_semctl_ar register_t rval; int cmd, error; + memset(&linux_seminfo, 0, sizeof(linux_seminfo)); + memset(&linux_semid64, 0, sizeof(linux_semid64)); + switch (args->cmd & ~LINUX_IPC_64) { case LINUX_IPC_RMID: cmd = IPC_RMID; @@ -702,12 +705,15 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar struct l_msqid64_ds linux_msqid64; struct msqid_ds bsd_msqid; + memset(&linux_msqid64, 0, sizeof(linux_msqid64)); + bsd_cmd = args->cmd & ~LINUX_IPC_64; switch (bsd_cmd) { case LINUX_IPC_INFO: case LINUX_MSG_INFO: { struct l_msginfo linux_msginfo; + memset(&linux_msginfo, 0, sizeof(linux_msginfo)); /* * XXX MSG_INFO uses the same data structure but returns different * dynamic counters in msgpool, msgmap, and msgtql fields. @@ -832,6 +838,10 @@ linux_shmctl(struct thread *td, struct linux_shmctl_ar struct l_shm_info linux_shm_info; struct shmid_ds bsd_shmid; int error; + + memset(&linux_shm_info, 0, sizeof(linux_shm_info)); + memset(&linux_shmid64, 0, sizeof(linux_shmid64)); + memset(&linux_shminfo64, 0, sizeof(linux_shminfo64)); switch (args->cmd & ~LINUX_IPC_64) { From owner-svn-src-head@freebsd.org Sat Mar 3 21:41:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51511F3EB74; Sat, 3 Mar 2018 21:41:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F407C77DFB; Sat, 3 Mar 2018 21:41:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEDF44220; Sat, 3 Mar 2018 21:41:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23LfGHv069879; Sat, 3 Mar 2018 21:41:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23LfGjf069878; Sat, 3 Mar 2018 21:41:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803032141.w23LfGjf069878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 3 Mar 2018 21:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330358 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 330358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:41:17 -0000 Author: ian Date: Sat Mar 3 21:41:16 2018 New Revision: 330358 URL: https://svnweb.freebsd.org/changeset/base/330358 Log: Minor changes to wording. Modified: head/share/man/man4/fdt_pinctrl.4 Modified: head/share/man/man4/fdt_pinctrl.4 ============================================================================== --- head/share/man/man4/fdt_pinctrl.4 Sat Mar 3 21:23:31 2018 (r330357) +++ head/share/man/man4/fdt_pinctrl.4 Sat Mar 3 21:41:16 2018 (r330358) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2018 +.Dd March 3, 2018 .Dt "FDT_PINCTRL" 4 .Os .Sh NAME @@ -36,13 +36,13 @@ .Pp Pin multiplexing is a technology used to re-purpose a single physical connection (depending on chip packaging it may be -pin, ball, or pad) to pull signal from one of SoC internal -controllers to peripheral devices. +pin, ball, or pad) by routing its signal to any one of several +different SoC internal devices. For example, based on the actual device design, a single SoC chip -pin can perform any of these roles: SPI clock, I2C +pin might perform any of these roles: SPI clock, I2C data, GPIO pin, or PWM signal. Function selection is performed by the pinmux controller, a SoC -hardware block, usually controlled a set of registers. +hardware block which is usually controlled by a set of registers. Pinmux controller capabilities and register format depend on the actual hardware implementation. .Pp @@ -104,11 +104,11 @@ backlight@7f000000 { } .Ed .Pp -The pinctrl driver should implement FDT_PINCTRL_CONFIGURE -method, register itself as pin configuration handler by +The pinctrl driver should implement the FDT_PINCTRL_CONFIGURE +method, register itself as a pin configuration handler by calling fdt_pinctrl_register function, and call .Xr fdt_pinctrl_configure_tree 9 -to configure pins for all enabled devices (device where +to configure pins for all enabled devices (devices where the "status" property is not set to "disabled"). .Sh SEE ALSO .Xr fdt_pinctrl 9 From owner-svn-src-head@freebsd.org Sat Mar 3 21:50:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55FD3F3F6FE; Sat, 3 Mar 2018 21:50:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 074EF7844F; Sat, 3 Mar 2018 21:50:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0233243B5; Sat, 3 Mar 2018 21:50:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23LotrR073256; Sat, 3 Mar 2018 21:50:55 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23LotrP073255; Sat, 3 Mar 2018 21:50:55 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803032150.w23LotrP073255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 21:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330359 - head/sys/compat/cloudabi X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/compat/cloudabi X-SVN-Commit-Revision: 330359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 21:50:56 -0000 Author: eadler Date: Sat Mar 3 21:50:55 2018 New Revision: 330359 URL: https://svnweb.freebsd.org/changeset/base/330359 Log: sys/linux: Fix a few potential infoleaks in cloudabi Submitted by: Domagoj Stolfa MFC After: 1 month Sponsored by: DARPA/AFRL Modified: head/sys/compat/cloudabi/cloudabi_file.c Modified: head/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_file.c Sat Mar 3 21:41:16 2018 (r330358) +++ head/sys/compat/cloudabi/cloudabi_file.c Sat Mar 3 21:50:55 2018 (r330359) @@ -563,6 +563,8 @@ cloudabi_sys_file_stat_fget(struct thread *td, cloudabi_filetype_t filetype; int error; + memset(&csb, 0, sizeof(csb)); + /* Fetch file descriptor attributes. */ error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FSTAT), &fp); if (error != 0) @@ -649,6 +651,8 @@ cloudabi_sys_file_stat_get(struct thread *td, cloudabi_filestat_t csb; char *path; int error; + + memset(&csb, 0, sizeof(csb)); error = copyin_path(uap->path, uap->path_len, &path); if (error != 0) From owner-svn-src-head@freebsd.org Sat Mar 3 22:07:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3765CF405DE; Sat, 3 Mar 2018 22:07:09 +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 A930178E2C; Sat, 3 Mar 2018 22:07:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 15EAE1A5150; Sun, 4 Mar 2018 09:07:06 +1100 (AEDT) Date: Sun, 4 Mar 2018 09:07:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Konstantin Belousov , Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src In-Reply-To: <1520110970.23690.20.camel@freebsd.org> Message-ID: <20180304083915.E6774@besplex.bde.org> References: <201803031854.w23IsHxm086835@repo.freebsd.org> <1520104482.23690.15.camel@freebsd.org> <20180303204913.GI3194@kib.kiev.ua> <1520110970.23690.20.camel@freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=uI0_eJPIWbD8hAyT2Y8A:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:07:09 -0000 On Sat, 3 Mar 2018, Ian Lepore wrote: > On Sat, 2018-03-03 at 22:49 +0200, Konstantin Belousov wrote: >> ,,, >> BTW mstosbt() and other functions have weird bracing in the formula. I >> think that the formula as calculated by the C operator precedence is >> fine, i.e. multiplication is done before right shift. But the bracing >> is redundand then, because the '()' pair next to the return () braces by >> inclusion is tautological. >> > > Oh, on looking closer, it's not a paste-o, I just didn't put the > closing paren where I had intended to for making it clear the shift > happens last. =A0(So almost everyone except me is still going to think a > fix has redundant parens.) It is a good example of how redundant parentheses reduce readability. Redundant parentheses make the non-redundant parentheses hard to see. The most important ones are for _ms * (x / 500) (where x =3D ((uint64_t)1 << 63)). These are needed since the natural expression _ms * x / 500 would overflow since it is evaluated left to right. Then you want to add redundant parentheses for _ms * (x / 500) >> 32, although both left to right evaluation and operator precedence work right for that. Then style(9) requires redundant parentheses for the return value. Normally I would parenthesize x * y >> z since I don't remember the precedence of '>>' and suspect it is broken (*), but here there are too many other parentheses. (*) The precedence of '>>' is indeed broken. It is like a division operato= r so should be at the same level or 1 lower. But it is 2 lower (+ and - are in between). So x + y * z means x + (y * z), but x + y >> z means (x + y) >> z. So x + (y >> z) needs parentheses, and (x + y) >> z should be parenthesized since it is surprising that its parentheses are redundant. Bruce From owner-svn-src-head@freebsd.org Sat Mar 3 22:10:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42C74F4093A; Sat, 3 Mar 2018 22:10:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD3CA7903D; Sat, 3 Mar 2018 22:10:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CED5346C1; Sat, 3 Mar 2018 22:10:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23MAG1j083205; Sat, 3 Mar 2018 22:10:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23MAGXV083204; Sat, 3 Mar 2018 22:10:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803032210.w23MAGXV083204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 3 Mar 2018 22:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330360 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 330360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:10:17 -0000 Author: ian Date: Sat Mar 3 22:10:16 2018 New Revision: 330360 URL: https://svnweb.freebsd.org/changeset/base/330360 Log: Minor (mostly) wording changes. Modified: head/share/man/man9/fdt_pinctrl.9 Modified: head/share/man/man9/fdt_pinctrl.9 ============================================================================== --- head/share/man/man9/fdt_pinctrl.9 Sat Mar 3 21:50:55 2018 (r330359) +++ head/share/man/man9/fdt_pinctrl.9 Sat Mar 3 22:10:16 2018 (r330360) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2018 +.Dd March 3, 2018 .Dt fdt_pinctrl 9 .Os .Sh NAME @@ -50,15 +50,17 @@ provides an API for manipulating I/O pin configuration pinmux controllers and pinmux clients. On the controller side, the standard newbus probe and attach methods are implemented. -This driver also implements the -.Fn fdt_pinctrl_configure -method, in which it calls the +As part of handling attach, it calls the .Fn fdt_pinctrl_register function to register itself as a pinmux controller. Then .Fn fdt_pinctrl_configure_tree is used to walk the device tree and configure pins specified by the pinctrl-0 property for all active devices. +The driver also implements the +.Fn fdt_pinctrl_configure +method, which allows client devices to change their +pin configurations after startup. If a client device requires a pin configuration change at some point of its lifecycle, it uses the .Fn fdt_pinctrl_configure @@ -84,14 +86,9 @@ registers a pinctrl driver so that it can be used by o .Fn fdt_pinctrl_configure or .Fn fdt_pinctrl_configure_by_name . -The -.Fa pinprop -argument is the name of a property that -identifies each descendant of the pinctrl -node. -The pinctrl node is a pin configuration -node whose xref phandle can be passed to -.Fn FDT_PINCTRL_CONFIGURE . +It also registers each child node of the pinctrl driver's node which contains +a property with the name given in +.Fa pinprop . If .Fa pinprop is From owner-svn-src-head@freebsd.org Sat Mar 3 22:28:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F0F6F41A3F; Sat, 3 Mar 2018 22:28:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5520799BA; Sat, 3 Mar 2018 22:28:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFC5C49FF; Sat, 3 Mar 2018 22:28:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23MSKCV092779; Sat, 3 Mar 2018 22:28:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23MSKWk092778; Sat, 3 Mar 2018 22:28:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803032228.w23MSKWk092778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 3 Mar 2018 22:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330361 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 330361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 22:28:21 -0000 Author: ian Date: Sat Mar 3 22:28:20 2018 New Revision: 330361 URL: https://svnweb.freebsd.org/changeset/base/330361 Log: Correct a misplaced closing paren. Does not affect the result, but does clarify (at least for me) that the multiplication happens before the shift. Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sat Mar 3 22:10:16 2018 (r330360) +++ head/sys/sys/time.h Sat Mar 3 22:28:20 2018 (r330361) @@ -173,7 +173,7 @@ static __inline sbintime_t nstosbt(int64_t _ns) { - return ((_ns * (((uint64_t)1 << 63) / 500000000) >> 32)); + return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); } static __inline int64_t @@ -187,7 +187,7 @@ static __inline sbintime_t ustosbt(int64_t _us) { - return ((_us * (((uint64_t)1 << 63) / 500000) >> 32)); + return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); } static __inline int64_t @@ -201,7 +201,7 @@ static __inline sbintime_t mstosbt(int64_t _ms) { - return ((_ms * (((uint64_t)1 << 63) / 500) >> 32)); + return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); } /*- From owner-svn-src-head@freebsd.org Sat Mar 3 22:40:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDE1FF42809; Sat, 3 Mar 2018 22:40:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (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 7E6A87A3C0; Sat, 3 Mar 2018 22:40:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f52.google.com with SMTP id v194so5908056itb.0; Sat, 03 Mar 2018 14:40:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Oih+nmOfIUC2209YkDJYzHMJEEijhPkMX6myh48I/sI=; b=ktxc8mOalWN6y7P5qkWTwGxCReG74yBCtdcUTRdeHG6QjAw0jOQ7CuZHkTk951geBK 0hMH3t28nXFgnrB96wYGRVG2u7PY1ZMwRH+ItQdWuGVC4NxJCxhMXh/IsgO9TB17KRDo iCXhh0Hruykb9fdtRb7uoU9nwsr1AgUbxKybTg8FtJ1/f8t42y+58PFL8xtv4blXJmlu Vg0CLGjpyHAc/uMBhqiORVGiyx8k/w+euGP7UcFcTXErA6CQRrZ7AKNCKFTZGHdsiks2 wEj0HAOzOU1mzceKz3ct2CtF6h31Dz2ofWxkH6Rpl/hbe24ayD/pSR3bzl1Yq7CiPkkB nZfQ== X-Gm-Message-State: AElRT7E/kxxKvDFws3mjDs8RJ99wkGW2yA+Ey+fBxLGS8XemNRjaHa8N ceepf2OuqkPz74Zd1E/Imnfx5h7J X-Google-Smtp-Source: AG47ELsuMHa41u9SpoL1gGTGz0cfAc98vUu+cI33arvoj5FUm+V00NDXCr/zA9k6O98RiVEFu2Id8w== X-Received: by 10.36.244.13 with SMTP id d13mr8421041iti.110.1520116489690; Sat, 03 Mar 2018 14:34:49 -0800 (PST) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com. [209.85.223.174]) by smtp.gmail.com with ESMTPSA id i197sm5993819ioe.54.2018.03.03.14.34.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Mar 2018 14:34:49 -0800 (PST) Received: by mail-io0-f174.google.com with SMTP id f1so14242183iob.0; Sat, 03 Mar 2018 14:34:49 -0800 (PST) X-Received: by 10.107.34.80 with SMTP id i77mr11719958ioi.220.1520116489272; Sat, 03 Mar 2018 14:34:49 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Sat, 3 Mar 2018 14:34:48 -0800 (PST) In-Reply-To: <201803031836.w23IacY3077188@repo.freebsd.org> References: <201803031836.w23IacY3077188@repo.freebsd.org> From: Conrad Meyer Date: Sat, 3 Mar 2018 14:34:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330349 - in head/sys: kern sys To: Hans Petter Selasky 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.25 Precedence: list List-Id: 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 Mar 2018 22:40:48 -0000 Please document the new ABI in the sleep(9) manual page. Thanks, Conrad On Sat, Mar 3, 2018 at 10:36 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Mar 3 18:36:38 2018 > New Revision: 330349 > URL: https://svnweb.freebsd.org/changeset/base/330349 > > Log: > Allow pause_sbt() to catch signals during sleep by passing C_CATCH flag. > Define pause_sig() function macro helper similarly to other kernel functions > which catch signals. Update outdated function description. > > Discussed with: kib@ > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/kern/kern_synch.c > head/sys/sys/callout.h > head/sys/sys/systm.h > > Modified: head/sys/kern/kern_synch.c > ============================================================================== > --- head/sys/kern/kern_synch.c Sat Mar 3 18:30:31 2018 (r330348) > +++ head/sys/kern/kern_synch.c Sat Mar 3 18:36:38 2018 (r330349) > @@ -297,16 +297,16 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const ch > } > > /* > - * pause() delays the calling thread by the given number of system ticks. > - * During cold bootup, pause() uses the DELAY() function instead of > - * the tsleep() function to do the waiting. The "timo" argument must be > - * greater than or equal to zero. A "timo" value of zero is equivalent > - * to a "timo" value of one. > + * pause_sbt() delays the calling thread by the given signed binary > + * time. During cold bootup, pause_sbt() uses the DELAY() function > + * instead of the _sleep() function to do the waiting. The "sbt" > + * argument must be greater than or equal to zero. A "sbt" value of > + * zero is equivalent to a "sbt" value of one tick. > */ > int > pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags) > { > - KASSERT(sbt >= 0, ("pause: timeout must be >= 0")); > + KASSERT(sbt >= 0, ("pause_sbt: timeout must be >= 0")); > > /* silently convert invalid timeouts */ > if (sbt == 0) > @@ -328,7 +328,8 @@ pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_ > DELAY(sbt); > return (EWOULDBLOCK); > } > - return (_sleep(&pause_wchan[curcpu], NULL, 0, wmesg, sbt, pr, flags)); > + return (_sleep(&pause_wchan[curcpu], NULL, > + (flags & C_CATCH) ? PCATCH : 0, wmesg, sbt, pr, flags)); > } > > /* > > Modified: head/sys/sys/callout.h > ============================================================================== > --- head/sys/sys/callout.h Sat Mar 3 18:30:31 2018 (r330348) > +++ head/sys/sys/callout.h Sat Mar 3 18:36:38 2018 (r330349) > @@ -60,6 +60,7 @@ > #define C_HARDCLOCK 0x0100 /* align to hardclock() calls */ > #define C_ABSOLUTE 0x0200 /* event time is absolute. */ > #define C_PRECALC 0x0400 /* event time is pre-calculated. */ > +#define C_CATCH 0x0800 /* catch signals, used by pause_sbt(9) */ > > struct callout_handle { > struct callout *callout; > > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Sat Mar 3 18:30:31 2018 (r330348) > +++ head/sys/sys/systm.h Sat Mar 3 18:36:38 2018 (r330349) > @@ -411,6 +411,8 @@ int pause_sbt(const char *wmesg, sbintime_t sbt, sbint > int flags); > #define pause(wmesg, timo) \ > pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK) > +#define pause_sig(wmesg, timo) \ > + pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK | C_CATCH) > #define tsleep(chan, pri, wmesg, timo) \ > _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \ > 0, C_HARDCLOCK) > From owner-svn-src-head@freebsd.org Sat Mar 3 23:08:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA6AEF446E5; Sat, 3 Mar 2018 23:08:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 885F97B79B; Sat, 3 Mar 2018 23:08:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EF665062; Sat, 3 Mar 2018 23:08:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23N8nwr013140; Sat, 3 Mar 2018 23:08:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23N8nAV013138; Sat, 3 Mar 2018 23:08:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803032308.w23N8nAV013138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 3 Mar 2018 23:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330362 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 330362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:08:50 -0000 Author: hselasky Date: Sat Mar 3 23:08:49 2018 New Revision: 330362 URL: https://svnweb.freebsd.org/changeset/base/330362 Log: Document pause_sig(9) and update prototypes for existing pause(9) and pause_sbt(9) functions. MFC after: 1 week Suggested by: cem@ Sponsored by: Mellanox Technologies Modified: head/share/man/man9/Makefile head/share/man/man9/sleep.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Mar 3 22:28:20 2018 (r330361) +++ head/share/man/man9/Makefile Sat Mar 3 23:08:49 2018 (r330362) @@ -1830,6 +1830,7 @@ MLINKS+=sleep.9 msleep.9 \ sleep.9 msleep_spin.9 \ sleep.9 msleep_spin_sbt.9 \ sleep.9 pause.9 \ + sleep.9 pause_sig.9 \ sleep.9 pause_sbt.9 \ sleep.9 tsleep.9 \ sleep.9 tsleep_sbt.9 \ Modified: head/share/man/man9/sleep.9 ============================================================================== --- head/share/man/man9/sleep.9 Sat Mar 3 22:28:20 2018 (r330361) +++ head/share/man/man9/sleep.9 Sat Mar 3 23:08:49 2018 (r330362) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2015 +.Dd March 4, 2018 .Dt SLEEP 9 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm msleep_spin , .Nm msleep_spin_sbt , .Nm pause , +.Nm pause_sig , .Nm pause_sbt , .Nm tsleep , .Nm tsleep_sbt , @@ -53,9 +54,11 @@ .Ft int .Fn msleep_spin_sbt "void *chan" "struct mtx *mtx" "const char *wmesg" \ "sbintime_t sbt" "sbintime_t pr" "int flags" -.Ft void +.Ft int .Fn pause "const char *wmesg" "int timo" -.Ft void +.Ft int +.Fn pause_sig "const char *wmesg" "int timo" +.Ft int .Fn pause_sbt "const char *wmesg" "sbintime_t sbt" "sbintime_t pr" \ "int flags" .Ft int @@ -73,6 +76,8 @@ The functions .Fn msleep , .Fn msleep_spin , .Fn pause , +.Fn pause_sig , +.Fn pause_sbt , .Fn wakeup , and .Fn wakeup_one @@ -82,8 +87,10 @@ external event, it is put to sleep by .Fn tsleep , .Fn msleep , .Fn msleep_spin , +.Fn pause , +.Fn pause_sig , or -.Fn pause . +.Fn pause_sbt . Threads may also wait using one of the locking primitive sleep routines .Xr mtx_sleep 9 , .Xr rw_sleep 9 , @@ -248,6 +255,11 @@ The thread can not be awakened early by signals or cal .Fn wakeup or .Fn wakeup_one . +The +.Fn pause_sig +function is a variant of +.Fn pause +which can be awakened early by signals. .Pp The .Fn wakeup_one @@ -385,6 +397,10 @@ The .Fn pause function appeared in .Fx 7.0 . +The +.Fn pause_sig +function appeared in +.Fx 12.0 . .Sh AUTHORS .An -nosplit This manual page was written by From owner-svn-src-head@freebsd.org Sat Mar 3 23:09:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 961D5F4479E; Sat, 3 Mar 2018 23:09:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37A717B903; Sat, 3 Mar 2018 23:09:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B855C2601A6; Sun, 4 Mar 2018 00:09:40 +0100 (CET) Subject: Re: svn commit: r330349 - in head/sys: kern sys To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803031836.w23IacY3077188@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <18c524a0-b34d-c4de-7efa-c624b039ee28@selasky.org> Date: Sun, 4 Mar 2018 00:09:38 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:09:42 -0000 On 03/03/18 23:34, Conrad Meyer wrote: > Please document the new ABI in the sleep(9) manual page. > See r330362. --HPS From owner-svn-src-head@freebsd.org Sat Mar 3 23:23:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08056F456A4; Sat, 3 Mar 2018 23:23:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF0087C5DC; Sat, 3 Mar 2018 23:23: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8A43539E; Sat, 3 Mar 2018 23:23: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 w23NN1rX023202; Sat, 3 Mar 2018 23:23:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23NN13t023201; Sat, 3 Mar 2018 23:23:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803032323.w23NN13t023201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Mar 2018 23:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330363 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 330363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:23:02 -0000 Author: bdrewery Date: Sat Mar 3 23:23:01 2018 New Revision: 330363 URL: https://svnweb.freebsd.org/changeset/base/330363 Log: Ignore MAKEOBJDIRPREFIX from src-env.conf in sub-makes. A sub-make, such as in 'make buildworld', may want to override MAKEOBJDIRPREFIX but is unable to do so if src-env.conf is forcing it to another value. Without using '?=' the sub-make may use the wrong .OBJDIR. Reported by: eadler Sponsored by: Dell EMC Modified: head/share/mk/src.sys.env.mk Modified: head/share/mk/src.sys.env.mk ============================================================================== --- head/share/mk/src.sys.env.mk Sat Mar 3 23:08:49 2018 (r330362) +++ head/share/mk/src.sys.env.mk Sat Mar 3 23:23:01 2018 (r330363) @@ -24,10 +24,38 @@ RELOBJTOP?= ${RELTOP} RELSRCTOP?= ${RELTOP} # site customizations that do not depend on anything! + +# Save MAKEOBJDIRPREFIX and don't let src-env.conf modify it. +# MAKEOBJDIRPREFIX is only needed in MAKELEVEL=0. In sub-makes it will +# either be read from environment or OBJDIR/MAKEOBJDIR according to +# src.sys.obj.mk. +.if !(${.MAKE.LEVEL} == 0 || empty(OBJROOT)) +.if defined(MAKEOBJDIRPREFIX) +_saveMAKEOBJDIRPREFIX:= ${MAKEOBJDIRPREFIX} +.else +_undefMAKEOBJDIRPREFIX= t +.endif +.endif + SRC_ENV_CONF?= /etc/src-env.conf .if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_) .-include "${SRC_ENV_CONF}" _src_env_conf_included_: .NOTMAIN +.endif + +.if defined(_saveMAKEOBJDIRPREFIX) || defined(_undefMAKEOBJDIRPREFIX) +.if defined(MAKEOBJDIRPREFIX) && ((defined(_saveMAKEOBJDIRPREFIX) && \ + ${_saveMAKEOBJDIRPREFIX} != ${MAKEOBJDIRPREFIX}) || \ + defined(_undefMAKEOBJDIRPREFIX)) +.warning ${SRC_ENV_CONF}: Ignoring MAKEOBJDIRPREFIX entry in sub-make. Use '?=' to avoid this warning. +.endif +.if defined(_saveMAKEOBJDIRPREFIX) +MAKEOBJDIRPREFIX:= ${_saveMAKEOBJDIRPREFIX} +.undef _saveMAKEOBJDIRPREFIX +.elif defined(_undefMAKEOBJDIRPREFIX) +.undef MAKEOBJDIRPREFIX +.undef _undefMAKEOBJDIRPREFIX +.endif .endif .include From owner-svn-src-head@freebsd.org Sat Mar 3 23:23:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCFFDF456FD; Sat, 3 Mar 2018 23:23:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 806FA7C6E8; Sat, 3 Mar 2018 23:23:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B539539F; Sat, 3 Mar 2018 23:23:23 +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 w23NNNAu023256; Sat, 3 Mar 2018 23:23:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23NNNYI023255; Sat, 3 Mar 2018 23:23:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803032323.w23NNNYI023255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Mar 2018 23:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330364 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 330364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:23:24 -0000 Author: bdrewery Date: Sat Mar 3 23:23:23 2018 New Revision: 330364 URL: https://svnweb.freebsd.org/changeset/base/330364 Log: Don't read SRC_ENV_CONF for MAKEOBJDIRPREFIX guard. This is mostly to allow using MAKEOBJDIRPREFIX in src-env.conf on stable where src.sys.obj.mk is not going to be MFC'd. It is still valid on head but effectively a NOP due to MAKEOBJDIRPREFIX being handled differently in src.sys.obj.mk. Reported by: eadler MFC after: 1 week Sponsored by: Dell EMC Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Mar 3 23:23:01 2018 (r330363) +++ head/Makefile Sat Mar 3 23:23:23 2018 (r330364) @@ -195,11 +195,11 @@ PATH= /sbin:/bin:/usr/sbin:/usr/bin MAKEOBJDIRPREFIX?= /usr/obj _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \ ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ - SRCCONF=${SRCCONF} \ + SRCCONF=${SRCCONF} SRC_ENV_CONF= \ -f /dev/null -V MAKEOBJDIRPREFIX dummy .if !empty(_MAKEOBJDIRPREFIX) -.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ - (in make.conf(5) or src.conf(5)) or command-line variable. +.error MAKEOBJDIRPREFIX can only be set in environment or src-env.conf(5),\ + not as a global (in make.conf(5) or src.conf(5)) or command-line variable. .endif # We often need to use the tree's version of make to build it. From owner-svn-src-head@freebsd.org Sat Mar 3 23:39:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5E7DF46769; Sat, 3 Mar 2018 23:39:08 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F6747D3A3; Sat, 3 Mar 2018 23:39:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88CDB5540; Sat, 3 Mar 2018 23:39:08 +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 w23Nd89B028464; Sat, 3 Mar 2018 23:39:08 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23Nd7aY028456; Sat, 3 Mar 2018 23:39:07 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803032339.w23Nd7aY028456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 3 Mar 2018 23:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330365 - in head/stand: ofw/common ofw/libofw powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/stand: ofw/common ofw/libofw powerpc/ofw X-SVN-Commit-Revision: 330365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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 Mar 2018 23:39:09 -0000 Author: nwhitehorn Date: Sat Mar 3 23:39:07 2018 New Revision: 330365 URL: https://svnweb.freebsd.org/changeset/base/330365 Log: Move "common" Open Firmware parts of the loader used only on PowerPC to the powerpc/ subdirectory. These have never used by SPARC and we have no other (and almost certainly will have no other) Open Firmware platforms. This makes the directory structure simpler and lets us avoid some cargo-cult MI patterns on code that is, and always was, architecture-specific. Added: head/stand/powerpc/ofw/elf_freebsd.c - copied, changed from r330364, head/stand/ofw/libofw/elf_freebsd.c head/stand/powerpc/ofw/main.c - copied unchanged from r330364, head/stand/ofw/common/main.c head/stand/powerpc/ofw/ppc64_elf_freebsd.c - copied unchanged from r330364, head/stand/ofw/libofw/ppc64_elf_freebsd.c Deleted: head/stand/ofw/common/ head/stand/ofw/libofw/elf_freebsd.c head/stand/ofw/libofw/ppc64_elf_freebsd.c Modified: head/stand/ofw/libofw/Makefile head/stand/ofw/libofw/libofw.h head/stand/powerpc/ofw/Makefile head/stand/powerpc/ofw/conf.c Modified: head/stand/ofw/libofw/Makefile ============================================================================== --- head/stand/ofw/libofw/Makefile Sat Mar 3 23:23:23 2018 (r330364) +++ head/stand/ofw/libofw/Makefile Sat Mar 3 23:39:07 2018 (r330365) @@ -4,7 +4,7 @@ LIB= ofw -SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ +SRCS= devicename.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ ofw_time.c openfirm.c .PATH: ${ZFSSRC} @@ -12,10 +12,6 @@ SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} - -.if ${MACHINE_CPUARCH} == "powerpc" -SRCS+= ppc64_elf_freebsd.c -.endif .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative Modified: head/stand/ofw/libofw/libofw.h ============================================================================== --- head/stand/ofw/libofw/libofw.h Sat Mar 3 23:23:23 2018 (r330364) +++ head/stand/ofw/libofw/libofw.h Sat Mar 3 23:39:07 2018 (r330365) @@ -62,17 +62,9 @@ void ofw_memmap(int); struct preloaded_file; struct file_format; -int ofw_elf_loadfile(char *, vm_offset_t, struct preloaded_file **); -int ofw_elf_exec(struct preloaded_file *); - /* MD code implementing MI interfaces */ vm_offset_t md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb); vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb); - -extern struct file_format ofw_elf; -#ifdef __powerpc__ -extern struct file_format ofw_elf64; -#endif extern void reboot(void); Modified: head/stand/powerpc/ofw/Makefile ============================================================================== --- head/stand/powerpc/ofw/Makefile Sat Mar 3 23:23:23 2018 (r330364) +++ head/stand/powerpc/ofw/Makefile Sat Mar 3 23:39:07 2018 (r330365) @@ -17,7 +17,7 @@ NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c vers.c start.c +SRCS= conf.c vers.c main.c elf_freebsd.c ppc64_elf_freebsd.c start.c SRCS+= ucmpdi2.c .include "${BOOTSRC}/fdt.mk" @@ -37,10 +37,6 @@ RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc - -# Pull in common loader code -.PATH: ${BOOTSRC}/ofw/common -.include "${BOOTSRC}/ofw/common/Makefile.inc" # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a Modified: head/stand/powerpc/ofw/conf.c ============================================================================== --- head/stand/powerpc/ofw/conf.c Sat Mar 3 23:23:23 2018 (r330364) +++ head/stand/powerpc/ofw/conf.c Sat Mar 3 23:39:07 2018 (r330365) @@ -97,6 +97,9 @@ struct netif_driver *netif_drivers[] = { * rather than reading the file go first. */ +struct file_format ofw_elf; +struct file_format ofw_elf64; + struct file_format *file_formats[] = { &ofw_elf, &ofw_elf64, Copied and modified: head/stand/powerpc/ofw/elf_freebsd.c (from r330364, head/stand/ofw/libofw/elf_freebsd.c) ============================================================================== --- head/stand/ofw/libofw/elf_freebsd.c Sat Mar 3 23:23:23 2018 (r330364, copy source) +++ head/stand/powerpc/ofw/elf_freebsd.c Sat Mar 3 23:39:07 2018 (r330365) @@ -89,8 +89,8 @@ __elfN(ofw_exec)(struct preloaded_file *fp) dev_cleanup(); if (dtbp != 0) { OF_quiesce(); - ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 0, 0, - (void *)mdp, sizeof(mdp)); + ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, + 0, 0, (void *)mdp, 0xfb5d104d); } else { OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, (void *)mdp, 0xfb5d104d); Copied: head/stand/powerpc/ofw/main.c (from r330364, head/stand/ofw/common/main.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/powerpc/ofw/main.c Sat Mar 3 23:39:07 2018 (r330365, copy of r330364, head/stand/ofw/common/main.c) @@ -0,0 +1,179 @@ +/*- + * Copyright (c) 2000 Benno Rice + * Copyright (c) 2000 Stephane Potvin + * 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 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 "openfirm.h" +#include "libofw.h" +#include "bootstrap.h" + +struct arch_switch archsw; /* MI/MD interface boundary */ + +extern char end[]; +extern char bootprog_info[]; + +u_int32_t acells, scells; + +static char bootargs[128]; + +#define HEAP_SIZE 0x800000 +static char heap[HEAP_SIZE]; // In BSS, so uses no space + +#define OF_puts(fd, text) OF_write(fd, text, strlen(text)) + +void +init_heap(void) +{ + bzero(heap, HEAP_SIZE); + + setheap(heap, (void *)((int)heap + HEAP_SIZE)); +} + +uint64_t +memsize(void) +{ + phandle_t memoryp; + cell_t reg[24]; + int i, sz; + u_int64_t memsz; + + memsz = 0; + memoryp = OF_instance_to_package(memory); + + sz = OF_getprop(memoryp, "reg", ®, sizeof(reg)); + sz /= sizeof(reg[0]); + + for (i = 0; i < sz; i += (acells + scells)) { + if (scells > 1) + memsz += (uint64_t)reg[i + acells] << 32; + memsz += reg[i + acells + scells - 1]; + } + + return (memsz); +} + +int +main(int (*openfirm)(void *)) +{ + phandle_t root; + int i; + char bootpath[64]; + char *ch; + int bargc; + char **bargv; + + /* + * Initialise the Open Firmware routines by giving them the entry point. + */ + OF_init(openfirm); + + root = OF_finddevice("/"); + + scells = acells = 1; + OF_getprop(root, "#address-cells", &acells, sizeof(acells)); + OF_getprop(root, "#size-cells", &scells, sizeof(scells)); + + /* + * Initialise the heap as early as possible. Once this is done, + * alloc() is usable. The stack is buried inside us, so this is + * safe. + */ + init_heap(); + + /* + * Set up console. + */ + cons_probe(); + + /* + * March through the device switch probing for things. + */ + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); + + printf("\n%s", bootprog_info); + printf("Memory: %lldKB\n", memsize() / 1024); + + OF_getprop(chosen, "bootpath", bootpath, 64); + ch = strchr(bootpath, ':'); + *ch = '\0'; + printf("Booted from: %s\n", bootpath); + + printf("\n"); + + /* + * Only parse the first bootarg if present. It should + * be simple to handle extra arguments + */ + OF_getprop(chosen, "bootargs", bootargs, sizeof(bootargs)); + bargc = 0; + parse(&bargc, &bargv, bootargs); + if (bargc == 1) + env_setenv("currdev", EV_VOLATILE, bargv[0], ofw_setcurrdev, + env_nounset); + else + env_setenv("currdev", EV_VOLATILE, bootpath, + ofw_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, + env_nounset); + setenv("LINES", "24", 1); /* optional */ + + archsw.arch_getdev = ofw_getdev; + archsw.arch_copyin = ofw_copyin; + archsw.arch_copyout = ofw_copyout; + archsw.arch_readin = ofw_readin; + archsw.arch_autoload = ofw_autoload; + + interact(); /* doesn't return */ + + OF_exit(); + + return 0; +} + +COMMAND_SET(halt, "halt", "halt the system", command_halt); + +static int +command_halt(int argc, char *argv[]) +{ + + OF_exit(); + return (CMD_OK); +} + +COMMAND_SET(memmap, "memmap", "print memory map", command_memmap); + +int +command_memmap(int argc, char **argv) +{ + + ofw_memmap(acells); + return (CMD_OK); +} Copied: head/stand/powerpc/ofw/ppc64_elf_freebsd.c (from r330364, head/stand/ofw/libofw/ppc64_elf_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/powerpc/ofw/ppc64_elf_freebsd.c Sat Mar 3 23:39:07 2018 (r330365, copy of r330364, head/stand/ofw/libofw/ppc64_elf_freebsd.c) @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 2001 Benno Rice + * 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$"); + +#define __ELF_WORD_SIZE 64 + +#include +#include + +#include +#include +#include + +#include + +#include "bootstrap.h" +#include "libofw.h" +#include "openfirm.h" + +extern char end[]; +extern vm_offset_t reloc; /* From /conf.c */ + +int +ppc64_ofw_elf_loadfile(char *filename, u_int64_t dest, + struct preloaded_file **result) +{ + int r; + + r = __elfN(loadfile)(filename, dest, result); + if (r != 0) + return (r); + + /* + * No need to sync the icache for modules: this will + * be done by the kernel after relocation. + */ + if (!strcmp((*result)->f_type, "elf kernel")) + __syncicache((void *) (*result)->f_addr, (*result)->f_size); + return (0); +} + +int +ppc64_ofw_elf_exec(struct preloaded_file *fp) +{ + struct file_metadata *fmp; + vm_offset_t mdp, dtbp; + Elf_Ehdr *e; + int error; + intptr_t entry; + + if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { + return(EFTYPE); + } + e = (Elf_Ehdr *)&fmp->md_data; + + /* Handle function descriptor for ELFv1 kernels */ + if ((e->e_flags & 3) == 2) + entry = e->e_entry; + else + entry = *(uint64_t *)(intptr_t)e->e_entry; + + if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) + return (error); + + printf("Kernel entry at 0x%lx ...\n", entry); + + dev_cleanup(); + + if (dtbp != 0) { + OF_quiesce(); + ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, + 0, 0, (void *)mdp, 0xfb5d104d); + } else { + OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, + (void *)mdp, 0xfb5d104d); + } + + panic("exec returned"); +} + +struct file_format ofw_elf64 = +{ + ppc64_ofw_elf_loadfile, + ppc64_ofw_elf_exec +};