From owner-svn-src-all@freebsd.org Sun Feb 25 00:25:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 00:32:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E156F3062E; Sun, 25 Feb 2018 00:32:43 +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 0D17F7F974; Sun, 25 Feb 2018 00:32:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07E0D2CF2E; Sun, 25 Feb 2018 00:32:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P0WgI6009797; Sun, 25 Feb 2018 00:32:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P0WgMw009796; Sun, 25 Feb 2018 00:32:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802250032.w1P0WgMw009796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Feb 2018 00:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329942 - stable/11/sys/x86/iommu X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/x86/iommu X-SVN-Commit-Revision: 329942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 00:32:43 -0000 Author: markj Date: Sun Feb 25 00:32:42 2018 New Revision: 329942 URL: https://svnweb.freebsd.org/changeset/base/329942 Log: MFC r329521: Don't include DMAR map entry zone items in kernel dumps. Modified: stable/11/sys/x86/iommu/intel_gas.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/iommu/intel_gas.c ============================================================================== --- stable/11/sys/x86/iommu/intel_gas.c Sat Feb 24 22:34:56 2018 (r329941) +++ stable/11/sys/x86/iommu/intel_gas.c Sun Feb 25 00:32:42 2018 (r329942) @@ -79,7 +79,7 @@ intel_gas_init(void) dmar_map_entry_zone = uma_zcreate("DMAR_MAP_ENTRY", sizeof(struct dmar_map_entry), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NODUMP); } SYSINIT(intel_gas, SI_SUB_DRIVERS, SI_ORDER_FIRST, intel_gas_init, NULL); From owner-svn-src-all@freebsd.org Sun Feb 25 00:35:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 00:57:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 01:02:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 03:30:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 03:33:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 05:00:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 04:44:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 04:11:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 05:14:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 10:14:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4580F2652D; Sun, 25 Feb 2018 10:14:35 +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 90B76747FE; Sun, 25 Feb 2018 10:14:35 +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 8B90338B8; Sun, 25 Feb 2018 10:14:35 +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 w1PAEZhi007025; Sun, 25 Feb 2018 10:14:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAEZTa007024; Sun, 25 Feb 2018 10:14:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251014.w1PAEZTa007024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329951 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 329951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:14:36 -0000 Author: hselasky Date: Sun Feb 25 10:14:35 2018 New Revision: 329951 URL: https://svnweb.freebsd.org/changeset/base/329951 Log: MFC r329371: Allow the cmpxchg() macro in the LinuxKPI to work on pointers without generating compiler warnings, -Wint-conversion . Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 08:56:44 2018 (r329950) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:14:35 2018 (r329951) @@ -159,36 +159,41 @@ atomic_cmpxchg(atomic_t *v, int old, int new) return (ret); } -#define cmpxchg(ptr, old, new) ({ \ - __typeof(*(ptr)) __ret; \ - \ - CTASSERT(sizeof(__ret) == 1 || sizeof(__ret) == 2 || \ - sizeof(__ret) == 4 || sizeof(__ret) == 8); \ - \ - __ret = (old); \ - switch (sizeof(__ret)) { \ - case 1: \ - while (!atomic_fcmpset_8((volatile int8_t *)(ptr), \ - (int8_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 2: \ - while (!atomic_fcmpset_16((volatile int16_t *)(ptr), \ - (int16_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 4: \ - while (!atomic_fcmpset_32((volatile int32_t *)(ptr), \ - (int32_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 8: \ - while (!atomic_fcmpset_64((volatile int64_t *)(ptr), \ - (int64_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - } \ - __ret; \ +#define cmpxchg(ptr, old, new) ({ \ + union { \ + __typeof(*(ptr)) val; \ + u8 u8[]; \ + u16 u16[]; \ + u32 u32[]; \ + u64 u64[]; \ + } __ret = { .val = (old) }, __new = { .val = (new) }; \ + \ + CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ + sizeof(__ret.val) == 4 || sizeof(__ret.val) == 8); \ + \ + switch (sizeof(__ret.val)) { \ + case 1: \ + while (!atomic_fcmpset_8((volatile u8 *)(ptr), \ + __ret.u8, __new.u8[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 2: \ + while (!atomic_fcmpset_16((volatile u16 *)(ptr), \ + __ret.u16, __new.u16[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 4: \ + while (!atomic_fcmpset_32((volatile u32 *)(ptr), \ + __ret.u32, __new.u32[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 8: \ + while (!atomic_fcmpset_64((volatile u64 *)(ptr), \ + __ret.u64, __new.u64[0]) && __ret.val == (old)) \ + ; \ + break; \ + } \ + __ret.val; \ }) #define cmpxchg_relaxed(...) cmpxchg(__VA_ARGS__) From owner-svn-src-all@freebsd.org Sun Feb 25 10:34:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E1D0F279D7; Sun, 25 Feb 2018 10:34:48 +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 CFAE9763C1; Sun, 25 Feb 2018 10:34:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA9563CD0; Sun, 25 Feb 2018 10:34:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAYl8U018298; Sun, 25 Feb 2018 10:34:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAYlWa018296; Sun, 25 Feb 2018 10:34:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251034.w1PAYlWa018296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329971 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:34:48 -0000 Author: hselasky Date: Sun Feb 25 10:34:47 2018 New Revision: 329971 URL: https://svnweb.freebsd.org/changeset/base/329971 Log: MFC r329515: Make the vm_fault structure in the LinuxKPI compatible with newer versions of the Linux kernel. No functional change. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mm.h Sun Feb 25 10:33:55 2018 (r329970) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mm.h Sun Feb 25 10:34:47 2018 (r329971) @@ -118,8 +118,13 @@ struct vm_area_struct { struct vm_fault { unsigned int flags; pgoff_t pgoff; - void *virtual_address; /* user-space address */ + union { + /* user-space address */ + void *virtual_address; + unsigned long address; + }; struct page *page; + struct vm_area_struct *vma; }; struct vm_operations_struct { Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 25 10:33:55 2018 (r329970) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 25 10:34:47 2018 (r329971) @@ -538,6 +538,7 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; vmf.pgoff = 0; vmf.page = NULL; + vmf.vma = vmap; vmap->vm_pfn_count = 0; vmap->vm_pfn_pcount = &vmap->vm_pfn_count; From owner-svn-src-all@freebsd.org Sun Feb 25 10:23:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47932F26E62; Sun, 25 Feb 2018 10:23:24 +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 EC1AF752A3; Sun, 25 Feb 2018 10:23:23 +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 E5C9F3B1D; Sun, 25 Feb 2018 10:23:23 +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 w1PANNRt012749; Sun, 25 Feb 2018 10:23:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PANNs8012746; Sun, 25 Feb 2018 10:23:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251023.w1PANNs8012746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329958 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:23:24 -0000 Author: hselasky Date: Sun Feb 25 10:23:23 2018 New Revision: 329958 URL: https://svnweb.freebsd.org/changeset/base/329958 Log: MFC r329465: Move the IRQ_RETVAL() and irqreturn definitions to irqreturn.h in the LinuxKPI to be compatible with Linux. No functional change. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Added: stable/11/sys/compat/linuxkpi/common/include/linux/irqreturn.h - copied unchanged from r329465, head/sys/compat/linuxkpi/common/include/linux/irqreturn.h Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/device.h Sun Feb 25 10:22:27 2018 (r329957) +++ stable/11/sys/compat/linuxkpi/common/include/linux/device.h Sun Feb 25 10:23:23 2018 (r329958) @@ -46,9 +46,6 @@ #include -enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED, IRQ_WAKE_THREAD, }; -typedef enum irqreturn irqreturn_t; - struct device; struct fwnode_handle; Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:22:27 2018 (r329957) +++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:23:23 2018 (r329958) @@ -33,13 +33,12 @@ #include #include +#include #include #include typedef irqreturn_t (*irq_handler_t)(int, void *); - -#define IRQ_RETVAL(x) ((x) != IRQ_NONE) #define IRQF_SHARED RF_SHAREABLE Copied: stable/11/sys/compat/linuxkpi/common/include/linux/irqreturn.h (from r329465, head/sys/compat/linuxkpi/common/include/linux/irqreturn.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linuxkpi/common/include/linux/irqreturn.h Sun Feb 25 10:23:23 2018 (r329958, copy of r329465, head/sys/compat/linuxkpi/common/include/linux/irqreturn.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2017 Limelight Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_IRQRETURN_H +#define _LINUX_IRQRETURN_H + +typedef enum irqreturn { + IRQ_NONE = 0, + IRQ_HANDLED = 1, + IRQ_WAKE_THREAD = 2 +} irqreturn_t; + +#define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) + +#endif /* _LINUX_IRQRETURN_H */ From owner-svn-src-all@freebsd.org Sun Feb 25 10:25:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5258BF26F37; Sun, 25 Feb 2018 10:25:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 060AB75488; Sun, 25 Feb 2018 10:25:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00FE23B21; Sun, 25 Feb 2018 10:25:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAOxwF012915; Sun, 25 Feb 2018 10:24:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAOxiO012914; Sun, 25 Feb 2018 10:24:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251024.w1PAOxiO012914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329960 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:25:00 -0000 Author: hselasky Date: Sun Feb 25 10:24:59 2018 New Revision: 329960 URL: https://svnweb.freebsd.org/changeset/base/329960 Log: MFC r329467: Add support for mmgrab() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Sun Feb 25 10:24:08 2018 (r329959) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Sun Feb 25 10:24:59 2018 (r329960) @@ -62,6 +62,12 @@ mmput(struct mm_struct *mm) mmdrop(mm); } +static inline void +mmgrab(struct mm_struct *mm) +{ + atomic_inc(&mm->mm_count); +} + extern struct mm_struct *linux_get_task_mm(struct task_struct *); #define get_task_mm(task) linux_get_task_mm(task) From owner-svn-src-all@freebsd.org Sun Feb 25 10:33:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31BA9F276DD; Sun, 25 Feb 2018 10:33:13 +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 DCBA7760F2; Sun, 25 Feb 2018 10:33:12 +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 D74CB3CCE; Sun, 25 Feb 2018 10:33:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAXCWk018125; Sun, 25 Feb 2018 10:33:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAXCnS018124; Sun, 25 Feb 2018 10:33:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251033.w1PAXCnS018124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329969 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:33:13 -0000 Author: hselasky Date: Sun Feb 25 10:33:12 2018 New Revision: 329969 URL: https://svnweb.freebsd.org/changeset/base/329969 Log: MFC r329513: Implement __GFP_BITS_SHIFT and __GFP_BITS_MASK macros in the LinuxKPI. Add compile time asserts to catch conflicts with native defines. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Feb 25 10:32:26 2018 (r329968) +++ stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Feb 25 10:33:12 2018 (r329969) @@ -54,6 +54,8 @@ #define __GFP_NO_KSWAPD 0 #define __GFP_WAIT M_WAITOK #define __GFP_DMA32 (1U << 24) /* LinuxKPI only */ +#define __GFP_BITS_SHIFT 25 +#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) #define GFP_NOWAIT M_NOWAIT #define GFP_ATOMIC (M_NOWAIT | M_USE_RESERVE) @@ -66,6 +68,9 @@ #define GFP_DMA32 __GFP_DMA32 #define GFP_TEMPORARY M_NOWAIT #define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO) + +CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0); +CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK); /* * Resolve a page into a virtual address: From owner-svn-src-all@freebsd.org Sun Feb 25 10:32:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 390A7F275BB; Sun, 25 Feb 2018 10:32: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 D431575F16; Sun, 25 Feb 2018 10:32:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE81B3CBE; Sun, 25 Feb 2018 10:32:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAWQAN017984; Sun, 25 Feb 2018 10:32:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAWQMe017958; Sun, 25 Feb 2018 10:32:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251032.w1PAWQMe017958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329968 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:32:27 -0000 Author: hselasky Date: Sun Feb 25 10:32:26 2018 New Revision: 329968 URL: https://svnweb.freebsd.org/changeset/base/329968 Log: MFC r329512: Implement __list_del_entry() helper functions in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/list.h Sun Feb 25 10:31:27 2018 (r329967) +++ stable/11/sys/compat/linuxkpi/common/include/linux/list.h Sun Feb 25 10:32:26 2018 (r329968) @@ -117,6 +117,13 @@ __list_del(struct list_head *prev, struct list_head *n } static inline void +__list_del_entry(struct list_head *entry) +{ + + __list_del(entry->prev, entry->next); +} + +static inline void list_del(struct list_head *entry) { From owner-svn-src-all@freebsd.org Sun Feb 25 13:52:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 14:18:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 10:15:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8880F266F1; Sun, 25 Feb 2018 10:15:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ADC774970; Sun, 25 Feb 2018 10:15:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6507C38B9; Sun, 25 Feb 2018 10:15:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAFqUw007145; Sun, 25 Feb 2018 10:15:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAFqQG007144; Sun, 25 Feb 2018 10:15:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251015.w1PAFqQG007144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329952 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:15:52 -0000 Author: hselasky Date: Sun Feb 25 10:15:52 2018 New Revision: 329952 URL: https://svnweb.freebsd.org/changeset/base/329952 Log: MFC r329372: Implement enable_irq() and disable_irq() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:14:35 2018 (r329951) +++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:15:52 2018 (r329952) @@ -112,6 +112,38 @@ request_irq(unsigned int irq, irq_handler_t handler, u } static inline int +enable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return -EINVAL; + irqe = linux_irq_ent(dev, irq); + if (irqe == NULL) + return -EINVAL; + return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, linux_irq_handler, irqe, &irqe->tag); +} + +static inline void +disable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return; + irqe = linux_irq_ent(dev, irq); + if (irqe == NULL) + return; + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + irqe->tag = NULL; +} + +static inline int bind_irq_to_cpu(unsigned int irq, int cpu_id) { struct irq_ent *irqe; From owner-svn-src-all@freebsd.org Sun Feb 25 10:24:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87BD7F26ECA; Sun, 25 Feb 2018 10:24:09 +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 3924775387; Sun, 25 Feb 2018 10:24:09 +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 341973B1E; Sun, 25 Feb 2018 10:24:09 +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 w1PAO8L1012832; Sun, 25 Feb 2018 10:24:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAO8dB012831; Sun, 25 Feb 2018 10:24:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251024.w1PAO8dB012831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329959 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:24:09 -0000 Author: hselasky Date: Sun Feb 25 10:24:08 2018 New Revision: 329959 URL: https://svnweb.freebsd.org/changeset/base/329959 Log: MFC r329466: Add support for __percpu and __weak macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Sun Feb 25 10:23:23 2018 (r329958) +++ stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Sun Feb 25 10:24:08 2018 (r329959) @@ -56,6 +56,8 @@ #define __devexit #define __exit #define __rcu +#define __percpu +#define __weak __weak_symbol #define __malloc #define ___stringify(...) #__VA_ARGS__ #define __stringify(...) ___stringify(__VA_ARGS__) From owner-svn-src-all@freebsd.org Sun Feb 25 10:30:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A804F272F7; Sun, 25 Feb 2018 10:30:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 152FB75AFB; Sun, 25 Feb 2018 10:30:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F0E43C37; Sun, 25 Feb 2018 10:30:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAUa00013501; Sun, 25 Feb 2018 10:30:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAUaG8013499; Sun, 25 Feb 2018 10:30:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251030.w1PAUaG8013499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329966 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:30:37 -0000 Author: hselasky Date: Sun Feb 25 10:30:36 2018 New Revision: 329966 URL: https://svnweb.freebsd.org/changeset/base/329966 Log: MFC r329510: Refactor dentry structure into its own header file in the LinuxKPI similary to Linux. No functional change. Implement d_inode() helper function. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Added: stable/11/sys/compat/linuxkpi/common/include/linux/dcache.h - copied unchanged from r329510, head/sys/compat/linuxkpi/common/include/linux/dcache.h Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/compat/linuxkpi/common/include/linux/dcache.h (from r329510, head/sys/compat/linuxkpi/common/include/linux/dcache.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linuxkpi/common/include/linux/dcache.h Sun Feb 25 10:30:36 2018 (r329966, copy of r329510, head/sys/compat/linuxkpi/common/include/linux/dcache.h) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2017 Limelight Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_DCACHE_H +#define __LINUX_DCACHE_H + +struct vnode; +struct pfs_node; + +struct dentry { + struct vnode *d_inode; + struct pfs_node *d_pfs_node; /* FreeBSD specific field */ +}; + +static inline struct vnode * +d_inode(const struct dentry *dentry) +{ + return (dentry->d_inode); +} + +#endif /* __LINUX_DCACHE_H */ Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Sun Feb 25 10:29:43 2018 (r329965) +++ stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Sun Feb 25 10:30:36 2018 (r329966) @@ -42,6 +42,7 @@ #include #include #include +#include struct module; struct kiocb; @@ -64,11 +65,6 @@ struct pfs_node; typedef struct files_struct *fl_owner_t; - -struct dentry { - struct inode *d_inode; - struct pfs_node *d_pfs_node; -}; struct file_operations; From owner-svn-src-all@freebsd.org Sun Feb 25 10:35:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA04F27A56; Sun, 25 Feb 2018 10:35:29 +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 4E1F6764D2; Sun, 25 Feb 2018 10:35:29 +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 492FE3CD1; Sun, 25 Feb 2018 10:35:29 +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 w1PAZTgo018393; Sun, 25 Feb 2018 10:35:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAZTxv018392; Sun, 25 Feb 2018 10:35:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251035.w1PAZTxv018392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329972 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:35:29 -0000 Author: hselasky Date: Sun Feb 25 10:35:28 2018 New Revision: 329972 URL: https://svnweb.freebsd.org/changeset/base/329972 Log: MFC r329516: Implement the KMEM_CACHE() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Sun Feb 25 10:34:47 2018 (r329971) +++ stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Sun Feb 25 10:35:28 2018 (r329972) @@ -65,6 +65,10 @@ MALLOC_DECLARE(M_KMALLOC); #define kmem_cache_free(...) linux_kmem_cache_free(__VA_ARGS__) #define kmem_cache_destroy(...) linux_kmem_cache_destroy(__VA_ARGS__) +#define KMEM_CACHE(__struct, flags) \ + linux_kmem_cache_create(#__struct, sizeof(struct __struct), \ + __alignof(struct __struct), (flags), NULL) + typedef void linux_kmem_ctor_t (void *); struct linux_kmem_cache { From owner-svn-src-all@freebsd.org Sun Feb 25 10:52:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB5DBF28908; Sun, 25 Feb 2018 10:52:46 +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 9C97477857; Sun, 25 Feb 2018 10:52:46 +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 971524046; Sun, 25 Feb 2018 10:52:46 +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 w1PAqkdR028856; Sun, 25 Feb 2018 10:52:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAqkXT028855; Sun, 25 Feb 2018 10:52:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251052.w1PAqkXT028855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329981 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 329981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:52:47 -0000 Author: hselasky Date: Sun Feb 25 10:52:46 2018 New Revision: 329981 URL: https://svnweb.freebsd.org/changeset/base/329981 Log: Bump the FreeBSD version to conclude the recent LinuxKPI related updates. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/11/sys/sys/param.h Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Sun Feb 25 10:51:39 2018 (r329980) +++ stable/11/sys/sys/param.h Sun Feb 25 10:52:46 2018 (r329981) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1101510 /* Master, propagated to newvers */ +#define __FreeBSD_version 1101511 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sun Feb 25 10:25:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E1DFF26FB2; Sun, 25 Feb 2018 10:25:48 +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 514EC75578; Sun, 25 Feb 2018 10:25:48 +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 4C2453B22; Sun, 25 Feb 2018 10:25:48 +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 w1PAPm5b013008; Sun, 25 Feb 2018 10:25:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAPmKK013007; Sun, 25 Feb 2018 10:25:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251025.w1PAPmKK013007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329961 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:25:48 -0000 Author: hselasky Date: Sun Feb 25 10:25:47 2018 New Revision: 329961 URL: https://svnweb.freebsd.org/changeset/base/329961 Log: MFC r329468: Add support for kref_read() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kref.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kref.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kref.h Sun Feb 25 10:24:59 2018 (r329960) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kref.h Sun Feb 25 10:25:47 2018 (r329961) @@ -52,6 +52,13 @@ kref_init(struct kref *kref) refcount_init(&kref->refcount.counter, 1); } +static inline unsigned int +kref_read(const struct kref *kref) +{ + + return (atomic_read(&kref->refcount)); +} + static inline void kref_get(struct kref *kref) { From owner-svn-src-all@freebsd.org Sun Feb 25 10:26:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E65F26FE1; Sun, 25 Feb 2018 10:26:45 +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 CEC897564D; Sun, 25 Feb 2018 10:26:44 +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 C83313B23; Sun, 25 Feb 2018 10:26:44 +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 w1PAQiQE013102; Sun, 25 Feb 2018 10:26:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAQiOt013101; Sun, 25 Feb 2018 10:26:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251026.w1PAQiOt013101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329962 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:26:45 -0000 Author: hselasky Date: Sun Feb 25 10:26:44 2018 New Revision: 329962 URL: https://svnweb.freebsd.org/changeset/base/329962 Log: MFC r329470: Add support for printk_ratelimit() function macro and improve the existing printk_ratelimited() function macro to return a boolean stating if there was a printout, true, or not, false. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/printk.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/printk.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/printk.h Sun Feb 25 10:25:47 2018 (r329961) +++ stable/11/sys/compat/linuxkpi/common/include/linux/printk.h Sun Feb 25 10:26:44 2018 (r329962) @@ -106,10 +106,16 @@ print_hex_dump_bytes(const char *prefix_str, const int print_hex_dump(NULL, prefix_str, prefix_type, 16, 1, buf, len, 0); } -#define printk_ratelimited(...) do { \ +#define printk_ratelimit() ({ \ static linux_ratelimit_t __ratelimited; \ - if (linux_ratelimited(&__ratelimited)) \ + linux_ratelimited(&__ratelimited); \ +}) + +#define printk_ratelimited(...) ({ \ + bool __retval = printk_ratelimit(); \ + if (__retval) \ printk(__VA_ARGS__); \ -} while (0) + __retval; \ +}) #endif /* _LINUX_PRINTK_H_ */ From owner-svn-src-all@freebsd.org Sun Feb 25 10:38:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB3BAF27D2C; Sun, 25 Feb 2018 10:38:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE6076741; Sun, 25 Feb 2018 10:38:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68D2D3CD5; Sun, 25 Feb 2018 10:38:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAcgNu018619; Sun, 25 Feb 2018 10:38:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAcgGY018618; Sun, 25 Feb 2018 10:38:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251038.w1PAcgGY018618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329974 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 329974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:38:42 -0000 Author: hselasky Date: Sun Feb 25 10:38:42 2018 New Revision: 329974 URL: https://svnweb.freebsd.org/changeset/base/329974 Log: MFC r329523 and r329524: Fix implementation of xchg() function macro in the LinuxKPI. The exchange operation must be atomic. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:37:07 2018 (r329973) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:38:42 2018 (r329974) @@ -198,12 +198,41 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define cmpxchg_relaxed(...) cmpxchg(__VA_ARGS__) -#define xchg(ptr, v) ({ \ - __typeof(*(ptr)) __ret; \ - \ - __ret = *(ptr); \ - *(ptr) = v; \ - __ret; \ +#define xchg(ptr, new) ({ \ + union { \ + __typeof(*(ptr)) val; \ + u8 u8[0]; \ + u16 u16[0]; \ + u32 u32[0]; \ + u64 u64[0]; \ + } __ret, __new = { .val = (new) }; \ + \ + CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ + sizeof(__ret.val) == 4 || sizeof(__ret.val) == 8); \ + \ + switch (sizeof(__ret.val)) { \ + case 1: \ + __ret.val = READ_ONCE(*ptr); \ + while (!atomic_fcmpset_8((volatile u8 *)(ptr), \ + __ret.u8, __new.u8[0])) \ + ; \ + break; \ + case 2: \ + __ret.val = READ_ONCE(*ptr); \ + while (!atomic_fcmpset_16((volatile u16 *)(ptr), \ + __ret.u16, __new.u16[0])) \ + ; \ + break; \ + case 4: \ + __ret.u32[0] = atomic_swap_32((volatile u32 *)(ptr), \ + __new.u32[0]); \ + break; \ + case 8: \ + __ret.u64[0] = atomic_swap_64((volatile u64 *)(ptr), \ + __new.u64[0]); \ + break; \ + } \ + __ret.val; \ }) #define LINUX_ATOMIC_OP(op, c_op) \ From owner-svn-src-all@freebsd.org Sun Feb 25 10:47:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F35DF2857E; Sun, 25 Feb 2018 10:47:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5701772BF; Sun, 25 Feb 2018 10:47: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 ABDC13E7B; Sun, 25 Feb 2018 10:47: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 w1PAlXkg023986; Sun, 25 Feb 2018 10:47:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAlXp0023985; Sun, 25 Feb 2018 10:47:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251047.w1PAlXp0023985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329978 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:47:34 -0000 Author: hselasky Date: Sun Feb 25 10:47:33 2018 New Revision: 329978 URL: https://svnweb.freebsd.org/changeset/base/329978 Log: MFC r329472: Allow the put_user() function macro to put constant values by using the existing __put_user() macro. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/uaccess.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/uaccess.h Sun Feb 25 10:44:47 2018 (r329977) +++ stable/11/sys/compat/linuxkpi/common/include/linux/uaccess.h Sun Feb 25 10:47:33 2018 (r329978) @@ -58,7 +58,7 @@ linux_copyout(&(__x), (_p), sizeof(*(_p))); \ }) #define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) -#define put_user(_x, _p) linux_copyout(&(_x), (_p), sizeof(*(_p))) +#define put_user(_x, _p) __put_user(_x, _p) #define clear_user(...) linux_clear_user(__VA_ARGS__) #define access_ok(...) linux_access_ok(__VA_ARGS__) From owner-svn-src-all@freebsd.org Sun Feb 25 10:48:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFFA6F285D5; Sun, 25 Feb 2018 10:48:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C0B9773B2; Sun, 25 Feb 2018 10:48:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 706AB3E7C; Sun, 25 Feb 2018 10:48:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAmqNw024085; Sun, 25 Feb 2018 10:48:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAmqa0024084; Sun, 25 Feb 2018 10:48:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251048.w1PAmqa0024084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329979 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 329979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:48:53 -0000 Author: hselasky Date: Sun Feb 25 10:48:52 2018 New Revision: 329979 URL: https://svnweb.freebsd.org/changeset/base/329979 Log: MFC r329703: Allow LinuxKPI character devices to receive mmap() calls from the Linux binary mode user-space emulation layer. This is a regression issue after r328436, when LinuxKPI character devices started to use DTYPE_DEV in the "f_type" field of the associated file structure(s). Found by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linux/linux_mmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_mmap.c ============================================================================== --- stable/11/sys/compat/linux/linux_mmap.c Sun Feb 25 10:47:33 2018 (r329978) +++ stable/11/sys/compat/linux/linux_mmap.c Sun Feb 25 10:48:52 2018 (r329979) @@ -129,7 +129,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s error = fget(td, fd, cap_rights_init(&rights, CAP_MMAP), &fp); if (error != 0) return (error); - if (fp->f_type != DTYPE_VNODE) { + if (fp->f_type != DTYPE_VNODE && fp->f_type != DTYPE_DEV) { fdrop(fp, td); return (EINVAL); } From owner-svn-src-all@freebsd.org Sun Feb 25 11:29:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0716F297EF; Sun, 25 Feb 2018 11:29:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CBCD78649; Sun, 25 Feb 2018 11:29:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9386E4521; Sun, 25 Feb 2018 11:29:55 +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 w1PBTtNt044080; Sun, 25 Feb 2018 11:29:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PBTtuN044079; Sun, 25 Feb 2018 11:29:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251129.w1PBTtuN044079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 11:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r329982 - stable/10/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/netinet X-SVN-Commit-Revision: 329982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 11:29:56 -0000 Author: hselasky Date: Sun Feb 25 11:29:55 2018 New Revision: 329982 URL: https://svnweb.freebsd.org/changeset/base/329982 Log: Fix for LINT-{NOINET,NOINET6,NOIP} kernel builds. This is a direct commit. Reported by: rpokala@ Sponsored by: Mellanox Technologies Modified: stable/10/sys/netinet/toecore.c Modified: stable/10/sys/netinet/toecore.c ============================================================================== --- stable/10/sys/netinet/toecore.c Sun Feb 25 10:52:46 2018 (r329981) +++ stable/10/sys/netinet/toecore.c Sun Feb 25 11:29:55 2018 (r329982) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(KLD_MODULE) || defined(INET) || defined(INET6) + #include #include #include @@ -357,12 +359,20 @@ toe_4tuple_check(struct in_conninfo *inc, struct tcphd struct inpcb *inp; if (inc->inc_flags & INC_ISIPV6) { +#if defined(KLD_MODULE) || defined(INET6) inp = in6_pcblookup(&V_tcbinfo, &inc->inc6_faddr, inc->inc_fport, &inc->inc6_laddr, inc->inc_lport, INPLOOKUP_WLOCKPCB, ifp); +#else + inp = NULL; +#endif } else { +#if defined(KLD_MODULE) || defined(INET) inp = in_pcblookup(&V_tcbinfo, inc->inc_faddr, inc->inc_fport, inc->inc_laddr, inc->inc_lport, INPLOOKUP_WLOCKPCB, ifp); +#else + inp = NULL; +#endif } if (inp != NULL) { INP_WLOCK_ASSERT(inp); @@ -641,5 +651,8 @@ static moduledata_t mod_data= { 0 }; -MODULE_VERSION(toecore, 1); DECLARE_MODULE(toecore, mod_data, SI_SUB_EXEC, SI_ORDER_ANY); +#endif /* defined(KLD_MODULE) || defined(INET) || defined(INET6) */ + +MODULE_VERSION(toecore, 1); + From owner-svn-src-all@freebsd.org Sun Feb 25 10:21:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87854F26C6E; Sun, 25 Feb 2018 10:21:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34CD274FE0; Sun, 25 Feb 2018 10:21:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F2EF3925; Sun, 25 Feb 2018 10:21:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PALVDV009956; Sun, 25 Feb 2018 10:21:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PALV5b009955; Sun, 25 Feb 2018 10:21:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251021.w1PALV5b009955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329956 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 329956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:21:32 -0000 Author: hselasky Date: Sun Feb 25 10:21:31 2018 New Revision: 329956 URL: https://svnweb.freebsd.org/changeset/base/329956 Log: MFC r329447: Compile in the LinuxKPI. Flexible array members are not allowed in a union. Use a zero length array instead. Reported by: jbeich@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:19:44 2018 (r329955) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:21:31 2018 (r329956) @@ -162,10 +162,10 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define cmpxchg(ptr, old, new) ({ \ union { \ __typeof(*(ptr)) val; \ - u8 u8[]; \ - u16 u16[]; \ - u32 u32[]; \ - u64 u64[]; \ + u8 u8[0]; \ + u16 u16[0]; \ + u32 u32[0]; \ + u64 u64[0]; \ } __ret = { .val = (old) }, __new = { .val = (new) }; \ \ CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ From owner-svn-src-all@freebsd.org Sun Feb 25 10:37:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3976F27BA7; Sun, 25 Feb 2018 10:37:07 +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 6EE66765F6; Sun, 25 Feb 2018 10:37:07 +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 69C653CD3; Sun, 25 Feb 2018 10:37:07 +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 w1PAb7gr018506; Sun, 25 Feb 2018 10:37:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAb7Be018504; Sun, 25 Feb 2018 10:37:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251037.w1PAb7Be018504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329973 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:37:08 -0000 Author: hselasky Date: Sun Feb 25 10:37:07 2018 New Revision: 329973 URL: https://svnweb.freebsd.org/changeset/base/329973 Log: MFC r329519: Implement support for radix_tree_for_each_slot() and radix_tree_exception() in the LinuxKPI and use unsigned long type for the radix tree index. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h Sun Feb 25 10:35:28 2018 (r329972) +++ stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h Sun Feb 25 10:37:07 2018 (r329973) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,11 +34,15 @@ #include #define RADIX_TREE_MAP_SHIFT 6 -#define RADIX_TREE_MAP_SIZE (1 << RADIX_TREE_MAP_SHIFT) -#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE - 1) -#define RADIX_TREE_MAX_HEIGHT \ - DIV_ROUND_UP((sizeof(long) * NBBY), RADIX_TREE_MAP_SHIFT) +#define RADIX_TREE_MAP_SIZE (1UL << RADIX_TREE_MAP_SHIFT) +#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE - 1UL) +#define RADIX_TREE_MAX_HEIGHT \ + howmany(sizeof(long) * NBBY, RADIX_TREE_MAP_SHIFT) +#define RADIX_TREE_ENTRY_MASK 3UL +#define RADIX_TREE_EXCEPTIONAL_ENTRY 2UL +#define RADIX_TREE_EXCEPTIONAL_SHIFT 2 + struct radix_tree_node { void *slots[RADIX_TREE_MAP_SIZE]; int count; @@ -50,6 +54,10 @@ struct radix_tree_root { int height; }; +struct radix_tree_iter { + unsigned long index; +}; + #define RADIX_TREE_INIT(mask) \ { .rnode = NULL, .gfp_mask = mask, .height = 0 }; #define INIT_RADIX_TREE(root, mask) \ @@ -57,8 +65,19 @@ struct radix_tree_root { #define RADIX_TREE(name, mask) \ struct radix_tree_root name = RADIX_TREE_INIT(mask) +#define radix_tree_for_each_slot(slot, root, iter, start) \ + for ((iter)->index = (start); \ + radix_tree_iter_find(root, iter, &(slot)); (iter)->index++) + +static inline int +radix_tree_exception(void *arg) +{ + return ((uintptr_t)arg & RADIX_TREE_ENTRY_MASK); +} + void *radix_tree_lookup(struct radix_tree_root *, unsigned long); void *radix_tree_delete(struct radix_tree_root *, unsigned long); int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); +bool radix_tree_iter_find(struct radix_tree_root *, struct radix_tree_iter *, void ***); #endif /* _LINUX_RADIX_TREE_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_radix.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Sun Feb 25 10:35:28 2018 (r329972) +++ stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Sun Feb 25 10:37:07 2018 (r329973) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,10 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_RADIX, "radix", "Linux radix compat"); -static inline int +static inline unsigned long radix_max(struct radix_tree_root *root) { - return (1 << (root->height * RADIX_TREE_MAP_SHIFT)) - 1; + return ((1UL << (root->height * RADIX_TREE_MAP_SHIFT)) - 1UL); } static inline int @@ -74,6 +74,45 @@ radix_tree_lookup(struct radix_tree_root *root, unsign out: return (item); +} + +bool +radix_tree_iter_find(struct radix_tree_root *root, struct radix_tree_iter *iter, + void ***pppslot) +{ + struct radix_tree_node *node; + unsigned long index = iter->index; + int height; + +restart: + node = root->rnode; + if (node == NULL) + return (false); + height = root->height - 1; + if (height == -1 || index > radix_max(root)) + return (false); + do { + unsigned long mask = RADIX_TREE_MAP_MASK << (RADIX_TREE_MAP_SHIFT * height); + unsigned long step = 1UL << (RADIX_TREE_MAP_SHIFT * height); + int pos = radix_pos(index, height); + struct radix_tree_node *next; + + /* track last slot */ + *pppslot = node->slots + pos; + + next = node->slots[pos]; + if (next == NULL) { + index += step; + index &= -step; + if ((index & mask) == 0) + goto restart; + } else { + node = next; + height--; + } + } while (height != -1); + iter->index = index; + return (true); } void * From owner-svn-src-all@freebsd.org Sun Feb 25 10:22:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38343F26D18; Sun, 25 Feb 2018 10:22:28 +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 DCB2675164; Sun, 25 Feb 2018 10:22: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 D79C53B17; Sun, 25 Feb 2018 10:22: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 w1PAMRTb012656; Sun, 25 Feb 2018 10:22:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAMREM012655; Sun, 25 Feb 2018 10:22:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251022.w1PAMREM012655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329957 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:22:28 -0000 Author: hselasky Date: Sun Feb 25 10:22:27 2018 New Revision: 329957 URL: https://svnweb.freebsd.org/changeset/base/329957 Log: MFC r329464: Add checks for valid IRQ tag before setting up or tearing down an interrupt handler in the LinuxKPI. This is needed when the interrupt handler is disabled before freeing the interrupt. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:21:31 2018 (r329956) +++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:22:27 2018 (r329957) @@ -121,7 +121,7 @@ enable_irq(unsigned int irq) if (dev == NULL) return -EINVAL; irqe = linux_irq_ent(dev, irq); - if (irqe == NULL) + if (irqe == NULL || irqe->tag != NULL) return -EINVAL; return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, linux_irq_handler, irqe, &irqe->tag); @@ -139,7 +139,8 @@ disable_irq(unsigned int irq) irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); irqe->tag = NULL; } @@ -174,7 +175,8 @@ free_irq(unsigned int irq, void *device) irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); list_del(&irqe->links); kfree(irqe); From owner-svn-src-all@freebsd.org Sun Feb 25 10:29:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7185EF2721E; Sun, 25 Feb 2018 10:29:44 +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 490D9759B2; Sun, 25 Feb 2018 10:29:44 +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 441AC3B26; Sun, 25 Feb 2018 10:29:44 +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 w1PATiXx013381; Sun, 25 Feb 2018 10:29:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PATia5013380; Sun, 25 Feb 2018 10:29:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251029.w1PATia5013380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329965 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:29:44 -0000 Author: hselasky Date: Sun Feb 25 10:29:43 2018 New Revision: 329965 URL: https://svnweb.freebsd.org/changeset/base/329965 Log: MFC r329477: Implement spin_trylock_irq() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/spinlock.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/spinlock.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/spinlock.h Sun Feb 25 10:28:52 2018 (r329964) +++ stable/11/sys/compat/linuxkpi/common/include/linux/spinlock.h Sun Feb 25 10:29:43 2018 (r329965) @@ -98,6 +98,9 @@ typedef struct { __ret; \ }) +#define spin_trylock_irq(_l) \ + spin_trylock(_l) + #define spin_lock_nested(_l, _n) do { \ if (SPIN_SKIP()) \ break; \ From owner-svn-src-all@freebsd.org Sun Feb 25 10:31:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A4F7F273A4; Sun, 25 Feb 2018 10:31:28 +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 1118A75C5D; Sun, 25 Feb 2018 10:31:28 +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 0C4013C70; Sun, 25 Feb 2018 10:31:28 +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 w1PAVR5T013587; Sun, 25 Feb 2018 10:31:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAVRCJ013586; Sun, 25 Feb 2018 10:31:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251031.w1PAVRCJ013586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329967 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:31:28 -0000 Author: hselasky Date: Sun Feb 25 10:31:27 2018 New Revision: 329967 URL: https://svnweb.freebsd.org/changeset/base/329967 Log: MFC r329511: Implement file_inode() and call_mmap() helper functions in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Sun Feb 25 10:30:36 2018 (r329966) +++ stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Sun Feb 25 10:31:27 2018 (r329967) @@ -284,6 +284,20 @@ noop_llseek(struct linux_file *file, loff_t offset, in return (file->_file->f_offset); } +static inline struct vnode * +file_inode(const struct linux_file *file) +{ + + return (file->f_vnode); +} + +static inline int +call_mmap(struct linux_file *file, struct vm_area_struct *vma) +{ + + return (file->f_op->mmap(file, vma)); +} + /* Shared memory support */ unsigned long linux_invalidate_mapping_pages(vm_object_t, pgoff_t, pgoff_t); struct page *linux_shmem_read_mapping_page_gfp(vm_object_t, int, gfp_t); From owner-svn-src-all@freebsd.org Sun Feb 25 10:39:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 289F7F27D9C; Sun, 25 Feb 2018 10:39:40 +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 BF50176842; Sun, 25 Feb 2018 10:39:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B60F13CD6; Sun, 25 Feb 2018 10:39:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAddjk018710; Sun, 25 Feb 2018 10:39:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAddTp018709; Sun, 25 Feb 2018 10:39:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251039.w1PAddTp018709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329975 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:39:40 -0000 Author: hselasky Date: Sun Feb 25 10:39:39 2018 New Revision: 329975 URL: https://svnweb.freebsd.org/changeset/base/329975 Log: MFC r329584: Implement list_safe_reset_next() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/list.h Sun Feb 25 10:38:42 2018 (r329974) +++ stable/11/sys/compat/linuxkpi/common/include/linux/list.h Sun Feb 25 10:39:39 2018 (r329975) @@ -179,6 +179,9 @@ list_del_init(struct list_head *entry) #define list_next_entry(ptr, member) \ list_entry(((ptr)->member.next), typeof(*(ptr)), member) +#define list_safe_reset_next(ptr, n, member) \ + (n) = list_next_entry(ptr, member) + #define list_prev_entry(ptr, member) \ list_entry(((ptr)->member.prev), typeof(*(ptr)), member) From owner-svn-src-all@freebsd.org Sun Feb 25 10:40:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E3F6F27DFF; Sun, 25 Feb 2018 10:40:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4DB876948; Sun, 25 Feb 2018 10:40: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 BFC7A3CE5; Sun, 25 Feb 2018 10:40: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 w1PAef8Y018847; Sun, 25 Feb 2018 10:40:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAefMb018839; Sun, 25 Feb 2018 10:40:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251040.w1PAefMb018839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329976 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:40:42 -0000 Author: hselasky Date: Sun Feb 25 10:40:41 2018 New Revision: 329976 URL: https://svnweb.freebsd.org/changeset/base/329976 Log: MFC r329825: Return correct error code to user-space when a system call receives a signal in the LinuxKPI. The read(), write() and mmap() system calls can return either EINTR or ERESTART upon receiving a signal. Add code to figure out the correct return value by temporarily storing the return code from the relevant FreeBSD kernel APIs in the Linux task structure. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h stable/11/sys/compat/linuxkpi/common/include/linux/rwsem.h stable/11/sys/compat/linuxkpi/common/include/linux/sched.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c stable/11/sys/compat/linuxkpi/common/src/linux_lock.c stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Sun Feb 25 10:40:41 2018 (r329976) @@ -63,7 +63,7 @@ typedef struct mutex { #define mutex_lock_interruptible(_m) ({ \ MUTEX_SKIP() ? 0 : \ - (sx_xlock_sig(&(_m)->sx) ? -EINTR : 0); \ + linux_mutex_lock_interruptible(_m); \ }) #define mutex_unlock(_m) do { \ @@ -142,5 +142,7 @@ linux_mutex_destroy(mutex_t *m) mutex_unlock(m); sx_destroy(&m->sx); } + +extern int linux_mutex_lock_interruptible(mutex_t *m); #endif /* _LINUX_MUTEX_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rwsem.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/rwsem.h Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/include/linux/rwsem.h Sun Feb 25 10:40:41 2018 (r329976) @@ -47,7 +47,7 @@ struct rw_semaphore { #define up_read(_rw) sx_sunlock(&(_rw)->sx) #define down_read_trylock(_rw) !!sx_try_slock(&(_rw)->sx) #define down_write_trylock(_rw) !!sx_try_xlock(&(_rw)->sx) -#define down_write_killable(_rw) !!sx_xlock_sig(&(_rw)->sx) +#define down_write_killable(_rw) linux_down_write_killable(_rw) #define downgrade_write(_rw) sx_downgrade(&(_rw)->sx) #define down_read_nested(_rw, _sc) down_read(_rw) #define init_rwsem(_rw) linux_init_rwsem(_rw, rwsem_name("lnxrwsem")) @@ -78,5 +78,7 @@ linux_init_rwsem(struct rw_semaphore *rw, const char * memset(rw, 0, sizeof(*rw)); sx_init_flags(&rw->sx, name, SX_NOWITNESS); } + +extern int linux_down_write_killable(struct rw_semaphore *); #endif /* _LINUX_RWSEM_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Sun Feb 25 10:40:41 2018 (r329976) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,7 @@ struct task_struct { struct completion exited; TAILQ_ENTRY(task_struct) rcu_entry; int rcu_recurse; + int bsd_interrupt_value; }; #define current ({ \ @@ -127,11 +128,25 @@ void linux_send_sig(int signo, struct task_struct *tas #define signal_pending_state(state, task) \ linux_signal_pending_state(state, task) #define send_sig(signo, task, priv) do { \ - CTASSERT(priv == 0); \ + CTASSERT((priv) == 0); \ linux_send_sig(signo, task); \ } while (0) int linux_schedule_timeout(int timeout); + +static inline void +linux_schedule_save_interrupt_value(struct task_struct *task, int value) +{ + task->bsd_interrupt_value = value; +} + +static inline int +linux_schedule_get_interrupt_value(struct task_struct *task) +{ + int value = task->bsd_interrupt_value; + task->bsd_interrupt_value = 0; + return (value); +} #define schedule() \ (void)linux_schedule_timeout(MAX_SCHEDULE_TIMEOUT) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 25 10:40:41 2018 (r329976) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -828,10 +828,27 @@ linux_access_ok(int rw, const void *uaddr, size_t len) (eaddr > saddr && eaddr <= VM_MAXUSER_ADDRESS)); } +/* + * This function should return either EINTR or ERESTART depending on + * the signal type sent to this thread: + */ static int +linux_get_error(struct task_struct *task, int error) +{ + /* check for signal type interrupt code */ + if (error == EINTR || error == ERESTARTSYS || error == ERESTART) { + error = -linux_schedule_get_interrupt_value(task); + if (error == 0) + error = EINTR; + } + return (error); +} + +static int linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, u_long cmd, caddr_t data, struct thread *td) { + struct task_struct *task = current; unsigned size; int error; @@ -844,8 +861,8 @@ linux_file_ioctl_sub(struct file *fp, struct linux_fil * Background: Linux code expects a user-space address * while FreeBSD supplies a kernel-space address. */ - current->bsd_ioctl_data = data; - current->bsd_ioctl_len = size; + task->bsd_ioctl_data = data; + task->bsd_ioctl_len = size; data = (void *)LINUX_IOCTL_MIN_PTR; } else { /* fetch user-space pointer */ @@ -869,16 +886,17 @@ linux_file_ioctl_sub(struct file *fp, struct linux_fil else error = ENOTTY; if (size > 0) { - current->bsd_ioctl_data = NULL; - current->bsd_ioctl_len = 0; + task->bsd_ioctl_data = NULL; + task->bsd_ioctl_len = 0; } if (error == EWOULDBLOCK) { /* update kqfilter status, if any */ linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE); - } else if (error == ERESTARTSYS) - error = ERESTART; + } else { + error = linux_get_error(task, error); + } return (error); } @@ -1111,6 +1129,7 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * vm_size_t size, struct vm_object **object, int nprot, struct thread *td) { + struct task_struct *task; struct vm_area_struct *vmap; struct mm_struct *mm; struct linux_file *filp; @@ -1132,7 +1151,8 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * * The atomic reference below makes sure the mm_struct is * available as long as the vmap is in the linux_vma_head. */ - mm = current->mm; + task = current; + mm = task->mm; if (atomic_inc_not_zero(&mm->mm_users) == 0) return (EINVAL); @@ -1147,11 +1167,10 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * vmap->vm_mm = mm; if (unlikely(down_write_killable(&vmap->vm_mm->mmap_sem))) { - error = EINTR; + error = linux_get_error(task, EINTR); } else { error = -OPW(fp, td, filp->f_op->mmap(filp, vmap)); - if (error == ERESTARTSYS) - error = ERESTART; + error = linux_get_error(task, error); up_write(&vmap->vm_mm->mmap_sem); } @@ -1290,9 +1309,7 @@ linux_file_read(struct file *file, struct uio *uio, st uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; } else { - error = -bytes; - if (error == ERESTARTSYS) - error = ERESTART; + error = linux_get_error(current, -bytes); } } else error = ENXIO; @@ -1329,9 +1346,7 @@ linux_file_write(struct file *file, struct uio *uio, s uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; } else { - error = -bytes; - if (error == ERESTARTSYS) - error = ERESTART; + error = linux_get_error(current, -bytes); } } else error = ENXIO; @@ -1780,6 +1795,7 @@ linux_complete_common(struct completion *c, int all) int linux_wait_for_common(struct completion *c, int flags) { + struct task_struct *task; int error; if (SCHEDULER_STOPPED()) @@ -1787,6 +1803,8 @@ linux_wait_for_common(struct completion *c, int flags) DROP_GIANT(); + task = current; + if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; else @@ -1798,7 +1816,9 @@ linux_wait_for_common(struct completion *c, int flags) break; sleepq_add(c, NULL, "completion", flags, 0); if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_wait_sig(c, 0) != 0) { + error = -sleepq_wait_sig(c, 0); + if (error != 0) { + linux_schedule_save_interrupt_value(task, error); error = -ERESTARTSYS; goto intr; } @@ -1820,22 +1840,22 @@ intr: int linux_wait_for_timeout_common(struct completion *c, int timeout, int flags) { + struct task_struct *task; int end = jiffies + timeout; int error; - int ret; if (SCHEDULER_STOPPED()) return (0); DROP_GIANT(); + task = current; + if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; else flags = SLEEPQ_SLEEP; - error = 0; - ret = 0; for (;;) { sleepq_lock(c); if (c->done) @@ -1843,26 +1863,30 @@ linux_wait_for_timeout_common(struct completion *c, in sleepq_add(c, NULL, "completion", flags, 0); sleepq_set_timeout(c, linux_timer_jiffies_until(end)); if (flags & SLEEPQ_INTERRUPTIBLE) - ret = sleepq_timedwait_sig(c, 0); + error = -sleepq_timedwait_sig(c, 0); else - ret = sleepq_timedwait(c, 0); - if (ret != 0) { - /* check for timeout or signal */ - if (ret == EWOULDBLOCK) - error = 0; - else + error = -sleepq_timedwait(c, 0); + if (error != 0) { + /* check for timeout */ + if (error == -EWOULDBLOCK) { + error = 0; /* timeout */ + } else { + /* signal happened */ + linux_schedule_save_interrupt_value(task, error); error = -ERESTARTSYS; - goto intr; + } + goto done; } } c->done--; sleepq_release(c); -intr: + /* return how many jiffies are left */ + error = linux_timer_jiffies_until(end); +done: PICKUP_GIANT(); - /* return how many jiffies are left */ - return (ret != 0 ? error : linux_timer_jiffies_until(end)); + return (error); } int Modified: stable/11/sys/compat/linuxkpi/common/src/linux_lock.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_lock.c Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/src/linux_lock.c Sun Feb 25 10:40:41 2018 (r329976) @@ -28,6 +28,7 @@ #include +#include #include struct ww_mutex_thread { @@ -72,10 +73,13 @@ linux_ww_unlock(void) int linux_ww_mutex_lock_sub(struct ww_mutex *lock, int catch_signal) { + struct task_struct *task; struct ww_mutex_thread entry; struct ww_mutex_thread *other; int retval = 0; + task = current; + linux_ww_lock(); if (unlikely(sx_try_xlock(&lock->base.sx) == 0)) { entry.thread = curthread; @@ -105,7 +109,9 @@ linux_ww_mutex_lock_sub(struct ww_mutex *lock, int cat } } if (catch_signal) { - if (cv_wait_sig(&lock->condvar, &ww_mutex_global) != 0) { + retval = -cv_wait_sig(&lock->condvar, &ww_mutex_global); + if (retval != 0) { + linux_schedule_save_interrupt_value(task, retval); retval = -EINTR; goto done; } @@ -133,4 +139,30 @@ linux_ww_mutex_unlock_sub(struct ww_mutex *lock) /* wakeup a lock waiter, if any */ cv_signal(&lock->condvar); linux_ww_unlock(); +} + +int +linux_mutex_lock_interruptible(mutex_t *m) +{ + int error; + + error = -sx_xlock_sig(&m->sx); + if (error != 0) { + linux_schedule_save_interrupt_value(current, error); + error = -EINTR; + } + return (error); +} + +int +linux_down_write_killable(struct rw_semaphore *rw) +{ + int error; + + error = -sx_xlock_sig(&rw->sx); + if (error != 0) { + linux_schedule_save_interrupt_value(current, error); + error = -EINTR; + } + return (error); } Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Sun Feb 25 10:40:41 2018 (r329976) @@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$"); #include static int -linux_add_to_sleepqueue(void *wchan, const char *wmesg, int timeout, int state) +linux_add_to_sleepqueue(void *wchan, struct task_struct *task, + const char *wmesg, int timeout, int state) { int flags, ret; @@ -66,8 +67,10 @@ linux_add_to_sleepqueue(void *wchan, const char *wmesg ret = -sleepq_timedwait(wchan, 0); } /* filter return value */ - if (ret != 0 && ret != -EWOULDBLOCK) + if (ret != 0 && ret != -EWOULDBLOCK) { + linux_schedule_save_interrupt_value(task, ret); ret = -ERESTARTSYS; + } return (ret); } @@ -235,10 +238,10 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q PHOLD(task->task_thread->td_proc); sleepq_lock(task); if (atomic_read(&task->state) != TASK_WAKING) { - ret = linux_add_to_sleepqueue(task, "wevent", timeout, state); + ret = linux_add_to_sleepqueue(task, task, "wevent", timeout, state); } else { sleepq_release(task); - ret = linux_signal_pending_state(state, task) ? -ERESTARTSYS : 0; + ret = 0; } PRELE(task->task_thread->td_proc); @@ -253,6 +256,7 @@ int linux_schedule_timeout(int timeout) { struct task_struct *task; + int ret; int state; int remainder; @@ -270,10 +274,12 @@ linux_schedule_timeout(int timeout) sleepq_lock(task); state = atomic_read(&task->state); - if (state != TASK_WAKING) - (void)linux_add_to_sleepqueue(task, "sched", timeout, state); - else + if (state != TASK_WAKING) { + ret = linux_add_to_sleepqueue(task, task, "sched", timeout, state); + } else { sleepq_release(task); + ret = 0; + } set_task_state(task, TASK_RUNNING); PICKUP_GIANT(); @@ -283,7 +289,11 @@ linux_schedule_timeout(int timeout) /* range check return value */ remainder -= ticks; - if (remainder < 0) + + /* range check return value */ + if (ret == -ERESTARTSYS && remainder < 1) + remainder = 1; + else if (remainder < 0) remainder = 0; else if (remainder > timeout) remainder = timeout; @@ -337,7 +347,7 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit break; } set_task_state(task, state); - ret = linux_add_to_sleepqueue(wchan, "wbit", timeout, state); + ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout, state); if (ret != 0) break; } @@ -374,7 +384,7 @@ linux_wait_on_atomic_t(atomic_t *a, unsigned int state break; } set_task_state(task, state); - ret = linux_add_to_sleepqueue(wchan, "watomic", 0, state); + ret = linux_add_to_sleepqueue(wchan, task, "watomic", 0, state); if (ret != 0) break; } From owner-svn-src-all@freebsd.org Sun Feb 25 10:18:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F6B9F269C6; Sun, 25 Feb 2018 10:18:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D85DE74C3C; Sun, 25 Feb 2018 10:18: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 D370F38BB; Sun, 25 Feb 2018 10:18: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 w1PAInsG007363; Sun, 25 Feb 2018 10:18:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAInj4007362; Sun, 25 Feb 2018 10:18:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251018.w1PAInj4007362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329954 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:18:50 -0000 Author: hselasky Date: Sun Feb 25 10:18:49 2018 New Revision: 329954 URL: https://svnweb.freebsd.org/changeset/base/329954 Log: MFC r329377: Implement memdup_user_nul() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/string.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/string.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/string.h Sun Feb 25 10:18:02 2018 (r329953) +++ stable/11/sys/compat/linuxkpi/common/include/linux/string.h Sun Feb 25 10:18:49 2018 (r329954) @@ -71,6 +71,22 @@ memdup_user(const void *ptr, size_t len) } static inline void * +memdup_user_nul(const void *ptr, size_t len) +{ + char *retval; + int error; + + retval = malloc(len + 1, M_KMALLOC, M_WAITOK); + error = linux_copyin(ptr, retval, len); + if (error != 0) { + free(retval, M_KMALLOC); + return (ERR_PTR(error)); + } + retval[len] = '\0'; + return (retval); +} + +static inline void * kmemdup(const void *src, size_t len, gfp_t gfp) { void *dst; From owner-svn-src-all@freebsd.org Sun Feb 25 10:51:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8607AF2887A; Sun, 25 Feb 2018 10:51:40 +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 25D21775AF; Sun, 25 Feb 2018 10:51:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20E533ED9; Sun, 25 Feb 2018 10:51:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PApd4U025632; Sun, 25 Feb 2018 10:51:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PApdCQ025631; Sun, 25 Feb 2018 10:51:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251051.w1PApdCQ025631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329980 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:51:40 -0000 Author: hselasky Date: Sun Feb 25 10:51:39 2018 New Revision: 329980 URL: https://svnweb.freebsd.org/changeset/base/329980 Log: MFC r329471: Implement BUILD_BUG_ON_INVALID() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Feb 25 10:48:52 2018 (r329979) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Feb 25 10:51:39 2018 (r329980) @@ -89,6 +89,7 @@ #define BUILD_BUG_ON(x) CTASSERT(!(x)) #define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) +#define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); } #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) #define BUG_ON(cond) do { \ From owner-svn-src-all@freebsd.org Sun Feb 25 08:56:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 17:02:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 13:20:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 16:29:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 10:18:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B456F26944; Sun, 25 Feb 2018 10:18:03 +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 19C3274B4E; Sun, 25 Feb 2018 10:18:03 +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 107DB38BA; Sun, 25 Feb 2018 10:18:03 +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 w1PAI21h007282; Sun, 25 Feb 2018 10:18:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAI2e6007280; Sun, 25 Feb 2018 10:18:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251018.w1PAI2e6007280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329953 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:18:03 -0000 Author: hselasky Date: Sun Feb 25 10:18:02 2018 New Revision: 329953 URL: https://svnweb.freebsd.org/changeset/base/329953 Log: MFC r329376: Implement tasklet_enable() and tasklet_disable() in the LinuxKPI. Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h stable/11/sys/compat/linuxkpi/common/src/linux_tasklet.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:15:52 2018 (r329952) +++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:18:02 2018 (r329953) @@ -200,5 +200,7 @@ extern void tasklet_schedule(struct tasklet_struct *); extern void tasklet_kill(struct tasklet_struct *); extern void tasklet_init(struct tasklet_struct *, tasklet_func_t *, unsigned long data); +extern void tasklet_enable(struct tasklet_struct *); +extern void tasklet_disable(struct tasklet_struct *); #endif /* _LINUX_INTERRUPT_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_tasklet.c Sun Feb 25 10:15:52 2018 (r329952) +++ stable/11/sys/compat/linuxkpi/common/src/linux_tasklet.c Sun Feb 25 10:18:02 2018 (r329953) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #define TASKLET_ST_BUSY 1 #define TASKLET_ST_EXEC 2 #define TASKLET_ST_LOOP 3 +#define TASKLET_ST_PAUSED 4 #define TASKLET_ST_CMPSET(ts, old, new) \ atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) @@ -195,4 +196,22 @@ tasklet_kill(struct tasklet_struct *ts) /* wait until tasklet is no longer busy */ while (TASKLET_ST_GET(ts) != TASKLET_ST_IDLE) pause("W", 1); +} + +void +tasklet_enable(struct tasklet_struct *ts) +{ + (void) TASKLET_ST_CMPSET(ts, TASKLET_ST_PAUSED, TASKLET_ST_IDLE); +} + +void +tasklet_disable(struct tasklet_struct *ts) +{ + while (1) { + if (TASKLET_ST_GET(ts) == TASKLET_ST_PAUSED) + break; + if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_PAUSED)) + break; + pause("W", 1); + } } From owner-svn-src-all@freebsd.org Sun Feb 25 10:19:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 168ADF26A45; Sun, 25 Feb 2018 10:19:45 +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 BAA5174D2C; Sun, 25 Feb 2018 10:19:44 +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 B598538BC; Sun, 25 Feb 2018 10:19:44 +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 w1PAJiXs007451; Sun, 25 Feb 2018 10:19:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAJi9g007450; Sun, 25 Feb 2018 10:19:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251019.w1PAJi9g007450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329955 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:19:45 -0000 Author: hselasky Date: Sun Feb 25 10:19:44 2018 New Revision: 329955 URL: https://svnweb.freebsd.org/changeset/base/329955 Log: MFC r329378: Implement mutex_trylock_recursive() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Sun Feb 25 10:18:49 2018 (r329954) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Sun Feb 25 10:19:44 2018 (r329955) @@ -77,6 +77,21 @@ typedef struct mutex { !!sx_try_xlock(&(_m)->sx); \ }) +enum mutex_trylock_recursive_enum { + MUTEX_TRYLOCK_FAILED = 0, + MUTEX_TRYLOCK_SUCCESS = 1, + MUTEX_TRYLOCK_RECURSIVE = 2, +}; + +static inline __must_check enum mutex_trylock_recursive_enum +mutex_trylock_recursive(struct mutex *lock) +{ + if (unlikely(sx_xholder(&lock->sx) == curthread)) + return (MUTEX_TRYLOCK_RECURSIVE); + + return (mutex_trylock(lock)); +} + #define mutex_init(_m) \ linux_mutex_init(_m, mutex_name(#_m), SX_NOWITNESS) From owner-svn-src-all@freebsd.org Sun Feb 25 10:28:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35DBBF27031; Sun, 25 Feb 2018 10:28:07 +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 D580A75741; Sun, 25 Feb 2018 10:28:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDDB33B24; Sun, 25 Feb 2018 10:28:06 +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 w1PAS69P013206; Sun, 25 Feb 2018 10:28:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAS64v013205; Sun, 25 Feb 2018 10:28:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251028.w1PAS64v013205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329963 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:28:07 -0000 Author: hselasky Date: Sun Feb 25 10:28:06 2018 New Revision: 329963 URL: https://svnweb.freebsd.org/changeset/base/329963 Log: MFC r329475: Implement get_task_pid() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pid.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pid.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pid.h Sun Feb 25 10:26:44 2018 (r329962) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pid.h Sun Feb 25 10:28:06 2018 (r329963) @@ -58,6 +58,11 @@ enum pid_type { __ts; \ }) +#define get_task_pid(task, type) ({ \ + CTASSERT((type) == PIDTYPE_PID); \ + (task)->task_thread->td_tid; \ +}) + struct task_struct; extern struct task_struct *linux_pid_task(pid_t); extern struct task_struct *linux_get_pid_task(pid_t); From owner-svn-src-all@freebsd.org Sun Feb 25 10:28:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7950F27054; Sun, 25 Feb 2018 10:28:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74B517581F; Sun, 25 Feb 2018 10:28:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AD503B25; Sun, 25 Feb 2018 10:28:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PASqi4013289; Sun, 25 Feb 2018 10:28:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PASqrP013288; Sun, 25 Feb 2018 10:28:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251028.w1PASqrP013288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329964 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:28:53 -0000 Author: hselasky Date: Sun Feb 25 10:28:52 2018 New Revision: 329964 URL: https://svnweb.freebsd.org/changeset/base/329964 Log: MFC r329476: Stub more lockdep function macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Sun Feb 25 10:28:06 2018 (r329963) +++ stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Sun Feb 25 10:28:52 2018 (r329964) @@ -48,5 +48,10 @@ struct lock_class_key { #define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) #define might_lock(m) do { } while (0) +#define might_lock_read(m) do { } while (0) + +#define lock_acquire(...) do { } while (0) +#define lock_release(...) do { } while (0) +#define lock_acquire_shared_recursive(...) do { } while (0) #endif /* _LINUX_LOCKDEP_H_ */ From owner-svn-src-all@freebsd.org Sun Feb 25 10:33:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34B45F27892; Sun, 25 Feb 2018 10:33:56 +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 D78AF76294; Sun, 25 Feb 2018 10:33:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D28433CCF; Sun, 25 Feb 2018 10:33:55 +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 w1PAXtiZ018204; Sun, 25 Feb 2018 10:33:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAXtur018203; Sun, 25 Feb 2018 10:33:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251033.w1PAXtur018203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329970 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 329970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:33:56 -0000 Author: hselasky Date: Sun Feb 25 10:33:55 2018 New Revision: 329970 URL: https://svnweb.freebsd.org/changeset/base/329970 Log: MFC r329514: Implement the rcu_dereference_raw() function macro. Make sure all RCU dereferencing use the READ_ONCE() function macro. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h Sun Feb 25 10:33:12 2018 (r329969) +++ stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h Sun Feb 25 10:33:55 2018 (r329970) @@ -74,13 +74,16 @@ } while (0) #define rcu_access_pointer(p) \ - ((__typeof(*p) *)(READ_ONCE(p))) + ((__typeof(*p) *)READ_ONCE(p)) #define rcu_dereference_protected(p, c) \ - ((__typeof(*p) *)(p)) + ((__typeof(*p) *)READ_ONCE(p)) #define rcu_dereference(p) \ rcu_dereference_protected(p, 0) + +#define rcu_dereference_raw(p) \ + ((__typeof(*p) *)READ_ONCE(p)) #define rcu_pointer_handoff(p) (p) From owner-svn-src-all@freebsd.org Sun Feb 25 10:44:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3562CF28472; Sun, 25 Feb 2018 10:44:48 +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 DC30177063; Sun, 25 Feb 2018 10:44:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D722B3E73; Sun, 25 Feb 2018 10:44:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PAil8D023597; Sun, 25 Feb 2018 10:44:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAilPj023595; Sun, 25 Feb 2018 10:44:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251044.w1PAilPj023595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329977 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 10:44:48 -0000 Author: hselasky Date: Sun Feb 25 10:44:47 2018 New Revision: 329977 URL: https://svnweb.freebsd.org/changeset/base/329977 Log: MFC r329509: Update the ktime type in the LinuxKPI to be a signed 64-bit integer similarly to Linux, to avoid compilation issues. Implement ktime_get_real_seconds(). Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Sun Feb 25 10:40:41 2018 (r329976) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Sun Feb 25 10:44:47 2018 (r329977) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2014-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2018 Limelight Networks, Inc. + * Copyright (c) 2014-2018 Mellanox Technologies, Ltd. * Copyright (c) 2015 François Tigeot * All rights reserved. * @@ -34,104 +35,96 @@ #include #include -#define ktime_get_ts(x) getnanouptime(x) +#define ktime_get_ts(x) getnanouptime(x) /* time values in nanoseconds */ -union ktime { - int64_t tv64; -}; +typedef s64 ktime_t; -typedef union ktime ktime_t; +#define KTIME_MAX ((s64)~((u64)1 << 63)) +#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) -#define KTIME_MAX ((s64)~((u64)1 << 63)) -#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) - static inline int64_t ktime_to_ns(ktime_t kt) { - return kt.tv64; + return (kt); } static inline ktime_t ns_to_ktime(uint64_t nsec) { - ktime_t kt; - - kt.tv64 = nsec; - return (kt); + return (nsec); } static inline int64_t ktime_divns(const ktime_t kt, int64_t div) { - return kt.tv64 / div; + return (kt / div); } static inline int64_t ktime_to_us(ktime_t kt) { - return ktime_divns(kt, NSEC_PER_USEC); + return (ktime_divns(kt, NSEC_PER_USEC)); } static inline int64_t ktime_to_ms(ktime_t kt) { - return ktime_divns(kt, NSEC_PER_MSEC); + return (ktime_divns(kt, NSEC_PER_MSEC)); } static inline struct timeval ktime_to_timeval(ktime_t kt) { - return ns_to_timeval(kt.tv64); + return (ns_to_timeval(kt)); } static inline ktime_t ktime_add_ns(ktime_t kt, int64_t ns) { - kt.tv64 += ns; - return kt; + return (kt + ns); } static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { - kt.tv64 -= ns; - return kt; + return (kt - ns); } static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) { - ktime_t retval = { (s64)secs * NSEC_PER_SEC + (s64)nsecs }; + ktime_t retval = {(s64) secs * NSEC_PER_SEC + (s64) nsecs}; + return (retval); } static inline ktime_t ktime_sub(ktime_t lhs, ktime_t rhs) { - lhs.tv64 -= rhs.tv64; - return (lhs); + return (lhs - rhs); } static inline int64_t ktime_us_delta(ktime_t later, ktime_t earlier) { - ktime_t diff = ktime_sub(later, earlier); - return ktime_to_us(diff); + ktime_t diff = ktime_sub(later, earlier); + + return (ktime_to_us(diff)); } static inline int64_t ktime_ms_delta(ktime_t later, ktime_t earlier) { - ktime_t diff = ktime_sub(later, earlier); - return ktime_to_ms(diff); + ktime_t diff = ktime_sub(later, earlier); + + return (ktime_to_ms(diff)); } static inline ktime_t ktime_add(ktime_t lhs, ktime_t rhs) { - lhs.tv64 += rhs.tv64; - return (lhs); + return (lhs + rhs); } static inline ktime_t @@ -146,23 +139,20 @@ timeval_to_ktime(struct timeval tv) return (ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC)); } -#define ktime_to_timespec(kt) ns_to_timespec((kt).tv64) -#define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) -#define ktime_to_ns(kt) ((kt).tv64) +#define ktime_to_timespec(kt) ns_to_timespec(kt) +#define ktime_to_timeval(kt) ns_to_timeval(kt) +#define ktime_to_ns(kt) (kt) static inline int64_t ktime_get_ns(void) { struct timespec ts; - ktime_t kt; ktime_get_ts(&ts); - kt = timespec_to_ktime(ts); - return (ktime_to_ns(kt)); + + return (ktime_to_ns(timespec_to_ktime(ts))); } -#define ktime_get_raw_ns() ktime_get_ns() - static inline ktime_t ktime_get(void) { @@ -188,6 +178,24 @@ ktime_get_real(void) nanotime(&ts); return (timespec_to_ktime(ts)); +} + +static inline ktime_t +ktime_get_real_seconds(void) +{ + struct timespec ts; + + nanotime(&ts); + return (ts.tv_sec); +} + +static inline u64 +ktime_get_raw_ns(void) +{ + struct timespec ts; + + nanouptime(&ts); + return (ktime_to_ns(timespec_to_ktime(ts))); } #endif /* _LINUX_KTIME_H */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Sun Feb 25 10:40:41 2018 (r329976) +++ stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Sun Feb 25 10:44:47 2018 (r329977) @@ -98,7 +98,7 @@ linux_hrtimer_start_range_ns(struct hrtimer *hrtimer, { mtx_lock(&hrtimer->mtx); - callout_reset_sbt(&hrtimer->callout, nstosbt(time.tv64), nstosbt(nsec), + callout_reset_sbt(&hrtimer->callout, nstosbt(time), nstosbt(nsec), hrtimer_call_handler, hrtimer, 0); mtx_unlock(&hrtimer->mtx); } From owner-svn-src-all@freebsd.org Sun Feb 25 14:52:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 14:29:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 15:16:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 18:26:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 18:43:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 19:33:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 19:43:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 20:15:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 20:21:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 23:10:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 23:52:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D750CF33D87 for ; Sun, 25 Feb 2018 23:52:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6670177688 for ; Sun, 25 Feb 2018 23:52:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id o9so8772740itc.1 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=fX1J3XYiQI4K8C13hV5L041RB+LPQN6XZ4tInDsk7L/SoRgRPITcptf/fUcbx73kFP t6LKyjKHeksoe/TmVP8JqNVcmVh4d4vv6ADBIbn3mbc3N4pr36HHU9hV3JHAiW1Z0uel LVjMQwvoo9xJTAaJ8X+vuZvVtgbP1/5AvWf4IdjGrq2SlMY6ee9tBKm43cZY3PZvKb6+ FeXdSQstUvPqnSM03ajMEiDJGqXPPxrd/4k2GTMf0Za86geaURu2IJvWZOcjbNdQ4dF7 mmBSAJQZytZpzz8ACBpRKFbQm7IExL1iq8OVsSsFbGCFcUcmu46Wbs8vHD+2mty3Yzep Iwkg== X-Gm-Message-State: APf1xPBWZh1KsnceR2b6rrEoGjharcgBPOWpFLooWLLjAdu+vi+UscT+ vLpmowJ+iISZh3dGK1C4uBSMUX5p2X7+VmkxkrAy0w== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 23:54:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6B4AF33FAD for ; Sun, 25 Feb 2018 23:54:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E88B7791D for ; Sun, 25 Feb 2018 23:54:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id l12so15322555ioc.10 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=V2eUsaj1YU2BRw7ZFZL245SHCYZvhGogh2BZW9Ju4nHg9YwVJLFXKKmkdnTREbZbKd n7IgfQixriCk1SyfK7ehm6jw8VgHR1JCm3zeP6BpuOV245KFT8xz2K1H7X9xXzWQdm6W XsIwZOTVvSrBeV0TTLpOjesQ0k7dqJNynJCvdPXe3URIQ6YBcSyEfro9I5o+HCfJR32L ZJUlHv+BfskZ+LFVAsFca0U/gri8IKD/rdI+9o2kbtR/b4sN5Ql8dr1KPESoxddLLKCN BfO2w9zcgdWN11MX8F+HvgVzUqXQMW2VpIWIJjqZYz9DzpgCdezdrywwIxjYBuam38R7 D8Wg== X-Gm-Message-State: APf1xPB0QclFYSKjeDldXf+7pzLzssfQD/aECF22XLzQ3hRvVkUyR0hM AyF0S0ubPeL8nZuB4FHbnR89mbv3r9SpOSVDeOFKaQ== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Feb 25 23:59:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Mon Feb 26 00:04:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 00:34:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 02:12:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EA41F11D54; Mon, 26 Feb 2018 02:12:10 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C29E17C2D8; Mon, 26 Feb 2018 02:12:09 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDA33153F5; Mon, 26 Feb 2018 02:12:09 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q2C9cU089571; Mon, 26 Feb 2018 02:12:09 GMT (envelope-from silby@FreeBSD.org) Received: (from silby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q2C9wT089570; Mon, 26 Feb 2018 02:12:09 GMT (envelope-from silby@FreeBSD.org) Message-Id: <201802260212.w1Q2C9wT089570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: silby set sender to silby@FreeBSD.org using -f From: Mike Silbersack Date: Mon, 26 Feb 2018 02:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329998 - stable/11/sbin/savecore X-SVN-Group: stable-11 X-SVN-Commit-Author: silby X-SVN-Commit-Paths: stable/11/sbin/savecore X-SVN-Commit-Revision: 329998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 02:12:10 -0000 Author: silby Date: Mon Feb 26 02:12:09 2018 New Revision: 329998 URL: https://svnweb.freebsd.org/changeset/base/329998 Log: MFC r329362: Prevent savecore from reading bounds from the current directory. Modified: stable/11/sbin/savecore/savecore.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/savecore/savecore.c ============================================================================== --- stable/11/sbin/savecore/savecore.c Mon Feb 26 00:34:56 2018 (r329997) +++ stable/11/sbin/savecore/savecore.c Mon Feb 26 02:12:09 2018 (r329998) @@ -155,6 +155,13 @@ getbounds(void) char buf[6]; int ret; + /* + * If we are just checking, then we haven't done a chdir to the dump + * directory and we should not try to read a bounds file. + */ + if (checkfor) + return (0); + ret = 0; if ((fp = fopen("bounds", "r")) == NULL) { From owner-svn-src-all@freebsd.org Mon Feb 26 02:28:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 02:43:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 02:53:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 03:03:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 03:05:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 03:16:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 03:16:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 03:16:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 03:16:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 03:46:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 03:56:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 04:08:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 04:12:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 04:33:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 04:55:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 07:57:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16307F320EF; Mon, 26 Feb 2018 07:57:12 +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 B845A87F39; Mon, 26 Feb 2018 07:57:11 +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 AEB4118AC0; Mon, 26 Feb 2018 07:57:11 +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 w1Q7vBld061737; Mon, 26 Feb 2018 07:57:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q7vB0P061735; Mon, 26 Feb 2018 07:57:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802260757.w1Q7vB0P061735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Feb 2018 07:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330013 - in stable/11/sys/dev/usb: . quirk X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . quirk X-SVN-Commit-Revision: 330013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 07:57:12 -0000 Author: hselasky Date: Mon Feb 26 07:57:11 2018 New Revision: 330013 URL: https://svnweb.freebsd.org/changeset/base/330013 Log: MFC r329195: Add new USB quirk. PR: 225844 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/11/sys/dev/usb/quirk/usb_quirk.c Mon Feb 26 04:55:08 2018 (r330012) +++ stable/11/sys/dev/usb/quirk/usb_quirk.c Mon Feb 26 07:57:11 2018 (r330013) @@ -136,6 +136,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair K70 RGB keyboard */ + USB_QUIRK(CORSAIR, K70_RGB, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair STRAFE Gaming keyboard */ USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Mon Feb 26 04:55:08 2018 (r330012) +++ stable/11/sys/dev/usb/usbdevs Mon Feb 26 07:57:11 2018 (r330013) @@ -1520,6 +1520,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC /* Corsair products */ product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard +product CORSAIR K70_RGB 0x1b13 Corsair K70 RGB Keyboard product CORSAIR STRAFE 0x1b15 Cossair STRAFE Gaming keyboard /* Creative products */ From owner-svn-src-all@freebsd.org Mon Feb 26 07:57:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C486DF321E4; Mon, 26 Feb 2018 07:57:56 +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 79E116809C; Mon, 26 Feb 2018 07:57:56 +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 7472318AC2; Mon, 26 Feb 2018 07:57:56 +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 w1Q7vuY2061836; Mon, 26 Feb 2018 07:57:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q7vuUH061834; Mon, 26 Feb 2018 07:57:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802260757.w1Q7vuUH061834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Feb 2018 07:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330014 - in stable/10/sys/dev/usb: . quirk X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/usb: . quirk X-SVN-Commit-Revision: 330014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 07:57:57 -0000 Author: hselasky Date: Mon Feb 26 07:57:56 2018 New Revision: 330014 URL: https://svnweb.freebsd.org/changeset/base/330014 Log: MFC r329195: Add new USB quirk. PR: 225844 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Mon Feb 26 07:57:11 2018 (r330013) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Mon Feb 26 07:57:56 2018 (r330014) @@ -136,6 +136,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair K70 RGB keyboard */ + USB_QUIRK(CORSAIR, K70_RGB, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair STRAFE Gaming keyboard */ USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Mon Feb 26 07:57:11 2018 (r330013) +++ stable/10/sys/dev/usb/usbdevs Mon Feb 26 07:57:56 2018 (r330014) @@ -1517,6 +1517,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC /* Corsair products */ product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard +product CORSAIR K70_RGB 0x1b13 Corsair K70 RGB Keyboard product CORSAIR STRAFE 0x1b15 Cossair STRAFE Gaming keyboard /* Creative products */ From owner-svn-src-all@freebsd.org Mon Feb 26 08:00:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1989F32546; Mon, 26 Feb 2018 08:00:01 +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 83C54682D3; Mon, 26 Feb 2018 08:00:01 +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 7AA1418AC7; Mon, 26 Feb 2018 08:00:01 +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 w1Q801pC062055; Mon, 26 Feb 2018 08:00:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q801Zu062054; Mon, 26 Feb 2018 08:00:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802260800.w1Q801Zu062054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Feb 2018 08:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330015 - stable/11/sys/dev/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb X-SVN-Commit-Revision: 330015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 08:00:02 -0000 Author: hselasky Date: Mon Feb 26 08:00:01 2018 New Revision: 330015 URL: https://svnweb.freebsd.org/changeset/base/330015 Log: MFC r329198: Fix for incorrect PnP information used by devmatch(8). Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/usbdi.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usbdi.h ============================================================================== --- stable/11/sys/dev/usb/usbdi.h Mon Feb 26 07:57:56 2018 (r330014) +++ stable/11/sys/dev/usb/usbdi.h Mon Feb 26 08:00:01 2018 (r330015) @@ -334,7 +334,7 @@ struct usb_device_id { unsigned long driver_info; } __aligned(32); -#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:product;G16:product;" \ +#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:release;G16:release;" \ "U8:devclass;U8:devsubclass;U8:devprotocol;" \ "U8:intclass;U8:intsubclass;U8:intprotocol;" #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" From owner-svn-src-all@freebsd.org Mon Feb 26 08:45:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 12:01:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8A0FF40FFF; Mon, 26 Feb 2018 12:01:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E76371956; Mon, 26 Feb 2018 12:01:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 611001B28F; Mon, 26 Feb 2018 12:01:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QC1hpk093847; Mon, 26 Feb 2018 12:01:43 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QC1hhT093845; Mon, 26 Feb 2018 12:01:43 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802261201.w1QC1hhT093845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 26 Feb 2018 12:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330017 - stable/11/sys/netipsec X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netipsec X-SVN-Commit-Revision: 330017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 12:01:44 -0000 Author: ae Date: Mon Feb 26 12:01:42 2018 New Revision: 330017 URL: https://svnweb.freebsd.org/changeset/base/330017 Log: MFC r329563: Remove unused variables and sysctl declaration. Modified: stable/11/sys/netipsec/ipsec.c stable/11/sys/netipsec/ipsec.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/ipsec.c ============================================================================== --- stable/11/sys/netipsec/ipsec.c Mon Feb 26 08:45:38 2018 (r330016) +++ stable/11/sys/netipsec/ipsec.c Mon Feb 26 12:01:42 2018 (r330017) @@ -108,7 +108,6 @@ VNET_PCPUSTAT_SYSINIT(ipsec4stat); VNET_PCPUSTAT_SYSUNINIT(ipsec4stat); #endif /* VIMAGE */ -VNET_DEFINE(int, ip4_ah_offsetmask) = 0; /* maybe IP_DF? */ /* DF bit on encap. 0: clear 1: set 2: copy */ VNET_DEFINE(int, ip4_ipsec_dfbit) = 0; VNET_DEFINE(int, ip4_esp_trans_deflev) = IPSEC_LEVEL_USE; @@ -117,7 +116,6 @@ VNET_DEFINE(int, ip4_ah_trans_deflev) = IPSEC_LEVEL_US VNET_DEFINE(int, ip4_ah_net_deflev) = IPSEC_LEVEL_USE; /* ECN ignore(-1)/forbidden(0)/allowed(1) */ VNET_DEFINE(int, ip4_ipsec_ecn) = 0; -VNET_DEFINE(int, ip4_esp_randpad) = -1; static VNET_DEFINE(int, ip4_filtertunnel) = 0; #define V_ip4_filtertunnel VNET(ip4_filtertunnel) @@ -183,9 +181,6 @@ SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_AH_NETLEV, ah SYSCTL_INT(_net_inet_ipsec, IPSECCTL_AH_CLEARTOS, ah_cleartos, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ah_cleartos), 0, "If set, clear type-of-service field when doing AH computation."); -SYSCTL_INT(_net_inet_ipsec, IPSECCTL_AH_OFFSETMASK, ah_offsetmask, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_ah_offsetmask), 0, - "If not set, clear offset field mask when doing AH computation."); SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DFBIT, dfbit, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_ipsec_dfbit), 0, "Do not fragment bit on encap."); Modified: stable/11/sys/netipsec/ipsec.h ============================================================================== --- stable/11/sys/netipsec/ipsec.h Mon Feb 26 08:45:38 2018 (r330016) +++ stable/11/sys/netipsec/ipsec.h Mon Feb 26 12:01:42 2018 (r330017) @@ -278,10 +278,8 @@ VNET_DECLARE(int, ip4_esp_trans_deflev); VNET_DECLARE(int, ip4_esp_net_deflev); VNET_DECLARE(int, ip4_ah_trans_deflev); VNET_DECLARE(int, ip4_ah_net_deflev); -VNET_DECLARE(int, ip4_ah_offsetmask); VNET_DECLARE(int, ip4_ipsec_dfbit); VNET_DECLARE(int, ip4_ipsec_ecn); -VNET_DECLARE(int, ip4_esp_randpad); VNET_DECLARE(int, crypto_support); VNET_DECLARE(int, natt_cksum_policy); @@ -291,10 +289,8 @@ VNET_DECLARE(int, natt_cksum_policy); #define V_ip4_esp_net_deflev VNET(ip4_esp_net_deflev) #define V_ip4_ah_trans_deflev VNET(ip4_ah_trans_deflev) #define V_ip4_ah_net_deflev VNET(ip4_ah_net_deflev) -#define V_ip4_ah_offsetmask VNET(ip4_ah_offsetmask) #define V_ip4_ipsec_dfbit VNET(ip4_ipsec_dfbit) #define V_ip4_ipsec_ecn VNET(ip4_ipsec_ecn) -#define V_ip4_esp_randpad VNET(ip4_esp_randpad) #define V_crypto_support VNET(crypto_support) #define V_natt_cksum_policy VNET(natt_cksum_policy) From owner-svn-src-all@freebsd.org Mon Feb 26 13:12:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 14:00:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 15:37:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 15:41:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 17:51:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 18:01:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 18:04:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 18:06:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 18:14:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 18:23:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 18:24:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 18:50:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 19:02:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 19:08:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 19:19:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 19:27:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 19:28:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 20:31:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 21:25:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 21:27:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 21:29:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 21:50:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 21:56:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 22:12:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 22:17:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 22:57:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 23:20:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Feb 26 23:58:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Tue Feb 27 00:30:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 00:31:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73A8BF3085C; Tue, 27 Feb 2018 00:31:50 +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 2326F74F6F; Tue, 27 Feb 2018 00:31:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DED122C22; Tue, 27 Feb 2018 00:31:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1R0VnSq088503; Tue, 27 Feb 2018 00:31:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R0VnZQ088502; Tue, 27 Feb 2018 00:31:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802270031.w1R0VnZQ088502@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 00:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330046 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 330046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 00:31:50 -0000 Author: mav Date: Tue Feb 27 00:31:49 2018 New Revision: 330046 URL: https://svnweb.freebsd.org/changeset/base/330046 Log: MFC r328514: Assume Always Running APIC Timer for AMD CPU families >= 0x12. Fallback to HPET may cause locks congestions on many-core systems. This change replicates Linux behavior. Modified: stable/11/sys/x86/x86/local_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/local_apic.c ============================================================================== --- stable/11/sys/x86/x86/local_apic.c Tue Feb 27 00:30:10 2018 (r330045) +++ stable/11/sys/x86/x86/local_apic.c Tue Feb 27 00:31:49 2018 (r330046) @@ -520,6 +520,9 @@ native_lapic_init(vm_paddr_t addr) do_cpuid(0x06, regs); if ((regs[0] & CPUTPM1_ARAT) != 0) arat = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) >= 0x12) { + arat = 1; } bzero(&lapic_et, sizeof(lapic_et)); lapic_et.et_name = "LAPIC"; From owner-svn-src-all@freebsd.org Tue Feb 27 01:28:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EE7CF34D6A; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4048B774EE; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A86F235F9; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1R1SKpK015032; Tue, 27 Feb 2018 01:28:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R1SJfk015029; Tue, 27 Feb 2018 01:28:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802270128.w1R1SJfk015029@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 01:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330047 - in stable: 10/sys/sys 10/usr.bin/vmstat 11/sys/sys 11/usr.bin/vmstat X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/sys 10/usr.bin/vmstat 11/sys/sys 11/usr.bin/vmstat X-SVN-Commit-Revision: 330047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 01:28:20 -0000 Author: jhb Date: Tue Feb 27 01:28:19 2018 New Revision: 330047 URL: https://svnweb.freebsd.org/changeset/base/330047 Log: MFC 328134: Update various statements in vmstat(8) to match reality. - The process stats are actually thread counts rather than process counts. - Simplify various descriptions to remove mention of stats that are updated every 5 seconds (all VM related stats are now "instant", only the load average is updated every 5 seconds). - Don't make any mention of special treatment for processes that have been active in the last 20 seconds. We don't track that stat. - Rework the description of active virtual memory. Call it mapped virtual memory and explicitly point out it is not the same as the active page queue (which corresponds to "Active" in top(1)), and also hint at the possible bogusness of the value (e.g. if a process maps a single page out of a multiple GB file, the entire file's size is considered mapped). - Simplify a few descriptions that implied their output was a value per interval. All of the "rate" values are per-second rates scaled across the interval. - Update a few comments for 'struct vmtotal' along similar lines. Modified: stable/10/sys/sys/vmmeter.h stable/10/usr.bin/vmstat/vmstat.8 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/sys/vmmeter.h stable/11/usr.bin/vmstat/vmstat.8 Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/sys/vmmeter.h ============================================================================== --- stable/10/sys/sys/vmmeter.h Tue Feb 27 00:31:49 2018 (r330046) +++ stable/10/sys/sys/vmmeter.h Tue Feb 27 01:28:19 2018 (r330047) @@ -189,13 +189,12 @@ vm_paging_needed(void) #endif -/* systemwide totals computed every five seconds */ struct vmtotal { int16_t t_rq; /* length of the run queue */ - int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ - int16_t t_pw; /* jobs in page wait */ - int16_t t_sl; /* jobs sleeping in core */ - int16_t t_sw; /* swapped out runnable/short block jobs */ + int16_t t_dw; /* threads in ``disk wait'' (neg priority) */ + int16_t t_pw; /* threads in page wait */ + int16_t t_sl; /* threads sleeping in core */ + int16_t t_sw; /* swapped out runnable/short block threads */ int32_t t_vm; /* total virtual memory */ int32_t t_avm; /* active virtual memory */ int32_t t_rm; /* total real memory in use */ Modified: stable/10/usr.bin/vmstat/vmstat.8 ============================================================================== --- stable/10/usr.bin/vmstat/vmstat.8 Tue Feb 27 00:31:49 2018 (r330046) +++ stable/10/usr.bin/vmstat/vmstat.8 Tue Feb 27 01:28:19 2018 (r330047) @@ -28,7 +28,7 @@ .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 8, 2014 +.Dd January 18, 2018 .Dt VMSTAT 8 .Os .Sh NAME @@ -240,31 +240,39 @@ By default, displays the following information: .Bl -tag -width indent .It procs -Information about the numbers of processes in various states. +Information about the number of threads in various states: .Pp .Bl -tag -width indent -compact .It r -in run queue +running or in run queue .It b blocked for resources (i/o, paging, etc.) .It w -runnable or short sleeper (< 20 secs) but swapped +swapped out .El .It memory Information about the usage of virtual and real memory. -Virtual pages (reported in units of 1024 bytes) are considered active if -they belong to processes which are running or have run in the last 20 -seconds. .Pp +Mapped virtual memory is a sum of all of the virtual pages belonging +to mapped virtual memory objects. +Note that the entire memory object's size is considered mapped even if +only a subset of the object's pages are currently mapped. +This statistic is not related to the active page queue which is used to track +real memory. +.Pp .Bl -tag -width indent -compact .It avm -active virtual pages +mapped virtual memory +.Po previously called active in +.Nm +output +.Pc .It fre size of the free list .El .It page Information about page faults and paging activity. -These are averaged each five seconds, and given in units per second. +These are given in units per second. .Pp .Bl -tag -width indent -compact .It flt @@ -278,11 +286,11 @@ pages paged in .It po pages paged out .It fr -pages freed per second +pages freed .\" .It de .\" anticipated short term memory shortfall .It sr -pages scanned by clock algorithm, per-second +pages scanned by page daemon .El .It disks Disk operations per second (this field is system dependent). @@ -311,15 +319,15 @@ matching pattern is specified (see above), will only display the given devices or the devices matching the pattern, and will not randomly select other devices in the system. .It faults -Trap/interrupt rate averages per second over last 5 seconds. +Trap/interrupt rates per second. .Pp .Bl -tag -width indent -compact .It in -device interrupts per interval (including clock interrupts) +device interrupts (including clock interrupts) .It sy -system calls per interval +system calls .It cs -cpu context switch rate (switches/interval) +cpu context switches .El .It cpu Breakdown of percentage usage of CPU time. @@ -328,7 +336,7 @@ Breakdown of percentage usage of CPU time. .It us user time for normal and low priority processes .It sy -system time +system and interrupt time .It id cpu idle .El @@ -344,10 +352,7 @@ default memory file The command: .Dl vmstat -w 5 will print what the system is doing every five -seconds; this is a good choice of printing interval since this is how often -some of the statistics are sampled in the system. -Others vary every second and running the output for a while will make it -apparent which are recomputed every second. +seconds. .Pp The command: .Dl vmstat -p da -p cd -w 1 From owner-svn-src-all@freebsd.org Tue Feb 27 01:28:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2704F34D70; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72C3A774EF; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D97D235FA; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1R1SK8v015039; Tue, 27 Feb 2018 01:28:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R1SKAe015037; Tue, 27 Feb 2018 01:28:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802270128.w1R1SKAe015037@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 01:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330047 - in stable: 10/sys/sys 10/usr.bin/vmstat 11/sys/sys 11/usr.bin/vmstat X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/sys 10/usr.bin/vmstat 11/sys/sys 11/usr.bin/vmstat X-SVN-Commit-Revision: 330047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 01:28:21 -0000 Author: jhb Date: Tue Feb 27 01:28:19 2018 New Revision: 330047 URL: https://svnweb.freebsd.org/changeset/base/330047 Log: MFC 328134: Update various statements in vmstat(8) to match reality. - The process stats are actually thread counts rather than process counts. - Simplify various descriptions to remove mention of stats that are updated every 5 seconds (all VM related stats are now "instant", only the load average is updated every 5 seconds). - Don't make any mention of special treatment for processes that have been active in the last 20 seconds. We don't track that stat. - Rework the description of active virtual memory. Call it mapped virtual memory and explicitly point out it is not the same as the active page queue (which corresponds to "Active" in top(1)), and also hint at the possible bogusness of the value (e.g. if a process maps a single page out of a multiple GB file, the entire file's size is considered mapped). - Simplify a few descriptions that implied their output was a value per interval. All of the "rate" values are per-second rates scaled across the interval. - Update a few comments for 'struct vmtotal' along similar lines. Modified: stable/11/sys/sys/vmmeter.h stable/11/usr.bin/vmstat/vmstat.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/vmmeter.h stable/10/usr.bin/vmstat/vmstat.8 Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/sys/vmmeter.h ============================================================================== --- stable/11/sys/sys/vmmeter.h Tue Feb 27 00:31:49 2018 (r330046) +++ stable/11/sys/sys/vmmeter.h Tue Feb 27 01:28:19 2018 (r330047) @@ -202,13 +202,12 @@ u_int vm_meter_cnt(size_t); #endif -/* systemwide totals computed every five seconds */ struct vmtotal { int16_t t_rq; /* length of the run queue */ - int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ - int16_t t_pw; /* jobs in page wait */ - int16_t t_sl; /* jobs sleeping in core */ - int16_t t_sw; /* swapped out runnable/short block jobs */ + int16_t t_dw; /* threads in ``disk wait'' (neg priority) */ + int16_t t_pw; /* threads in page wait */ + int16_t t_sl; /* threads sleeping in core */ + int16_t t_sw; /* swapped out runnable/short block threads */ int32_t t_vm; /* total virtual memory */ int32_t t_avm; /* active virtual memory */ int32_t t_rm; /* total real memory in use */ Modified: stable/11/usr.bin/vmstat/vmstat.8 ============================================================================== --- stable/11/usr.bin/vmstat/vmstat.8 Tue Feb 27 00:31:49 2018 (r330046) +++ stable/11/usr.bin/vmstat/vmstat.8 Tue Feb 27 01:28:19 2018 (r330047) @@ -28,7 +28,7 @@ .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 19, 2015 +.Dd January 18, 2018 .Dt VMSTAT 8 .Os .Sh NAME @@ -248,31 +248,39 @@ By default, displays the following information: .Bl -tag -width indent .It procs -Information about the numbers of processes in various states. +Information about the number of threads in various states: .Pp .Bl -tag -width indent -compact .It r -in run queue +running or in run queue .It b blocked for resources (i/o, paging, etc.) .It w -runnable or short sleeper (< 20 secs) but swapped +swapped out .El .It memory Information about the usage of virtual and real memory. -Virtual pages (reported in units of 1024 bytes) are considered active if -they belong to processes which are running or have run in the last 20 -seconds. .Pp +Mapped virtual memory is a sum of all of the virtual pages belonging +to mapped virtual memory objects. +Note that the entire memory object's size is considered mapped even if +only a subset of the object's pages are currently mapped. +This statistic is not related to the active page queue which is used to track +real memory. +.Pp .Bl -tag -width indent -compact .It avm -active virtual pages +mapped virtual memory +.Po previously called active in +.Nm +output +.Pc .It fre size of the free list .El .It page Information about page faults and paging activity. -These are averaged each five seconds, and given in units per second. +These are given in units per second. .Pp .Bl -tag -width indent -compact .It flt @@ -286,11 +294,11 @@ pages paged in .It po pages paged out .It fr -pages freed per second +pages freed .\" .It de .\" anticipated short term memory shortfall .It sr -pages scanned by clock algorithm, per-second +pages scanned by page daemon .El .It disks Disk operations per second (this field is system dependent). @@ -319,15 +327,15 @@ matching pattern is specified (see above), will only display the given devices or the devices matching the pattern, and will not randomly select other devices in the system. .It faults -Trap/interrupt rate averages per second over last 5 seconds. +Trap/interrupt rates per second. .Pp .Bl -tag -width indent -compact .It in -device interrupts per interval (including clock interrupts) +device interrupts (including clock interrupts) .It sy -system calls per interval +system calls .It cs -cpu context switch rate (switches/interval) +cpu context switches .El .It cpu Breakdown of percentage usage of CPU time. @@ -336,7 +344,7 @@ Breakdown of percentage usage of CPU time. .It us user time for normal and low priority processes .It sy -system time +system and interrupt time .It id cpu idle .El @@ -352,10 +360,7 @@ default memory file The command: .Dl vmstat -w 5 will print what the system is doing every five -seconds; this is a good choice of printing interval since this is how often -some of the statistics are sampled in the system. -Others vary every second and running the output for a while will make it -apparent which are recomputed every second. +seconds. .Pp The command: .Dl vmstat -p da -p cd -w 1 From owner-svn-src-all@freebsd.org Tue Feb 27 01:36:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 01:48:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 02:11:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 04:23:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 04:38:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 04:41:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 09:06:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B65F32811 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 171CD6ABAF 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 u8-v6so4572183ybo.10 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=CCyokgxG7DxOW3hqGARiT6DauE5k3g0IQWk7TTljDFOJ/9VecmKyiN8XtRIggcDupZ TtfzRJzbT6DCPEj5ZKLhSMWRUdnWzoAT8nya4FDzfUB42H3d0azkHzBAnUsL1HgzHSeT 3iqK7eY2K6EulKlgZYU+zT1dTJAYQjQItgCYizQcuGRxz/utn9QBAD+e6U/DL7lHbxGh LQ+dwzqubEINq2GkjN1YPcS4lapoLkjJDKzs+HOhBQk4rkxvPnuXhN1gLTb8qn5r9XYG OC/iPWRK4MSTMJi8PApNl9mag7Z9/uEslAx0DLJjDiBrP101PLtmPPyJQcCqXyG7arz8 7/4Q== X-Gm-Message-State: APf1xPCV0gdxhr7TRUZBK149ZKIA1n+giiVKzzJtVYZMn7jf+uRw6D9a 96tNjpPQjsBGmx4TdbSmLvJfg5IqRjwxtiblBXBgIkU0 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 10:54:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 10:55:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 12:53:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 13:43:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 14:08:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 14:17:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC03F298B6; Tue, 27 Feb 2018 14:17:13 +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 555D8792A0; Tue, 27 Feb 2018 14:17:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B7A239F2; Tue, 27 Feb 2018 14:17:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REHDnN001421; Tue, 27 Feb 2018 14:17:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REHD80001420; Tue, 27 Feb 2018 14:17:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271417.w1REHD80001420@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:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330058 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:17:13 -0000 Author: avg Date: Tue Feb 27 14:17:12 2018 New Revision: 330058 URL: https://svnweb.freebsd.org/changeset/base/330058 Log: MFC r328217: zfs: no need to check that size of zfs_cmd_t is not greater than IOCPARM_MAX Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Feb 27 14:08:54 2018 (r330057) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Feb 27 14:17:12 2018 (r330058) @@ -203,7 +203,6 @@ #include "lua.h" #include "lauxlib.h" -CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX); static struct cdev *zfsdev; extern void zfs_init(void); From owner-svn-src-all@freebsd.org Tue Feb 27 14:23:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89024F29FD2; Tue, 27 Feb 2018 14:23:44 +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 3A8D2797BC; Tue, 27 Feb 2018 14:23:44 +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 357613C27; Tue, 27 Feb 2018 14:23:44 +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 w1RENiwk006109; Tue, 27 Feb 2018 14:23:44 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RENiZu006108; Tue, 27 Feb 2018 14:23:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271423.w1RENiZu006108@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:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330059 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:23:44 -0000 Author: avg Date: Tue Feb 27 14:23:43 2018 New Revision: 330059 URL: https://svnweb.freebsd.org/changeset/base/330059 Log: MFC r328217: zfs: no need to check that size of zfs_cmd_t is not greater than IOCPARM_MAX Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Feb 27 14:17:12 2018 (r330058) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Feb 27 14:23:43 2018 (r330059) @@ -197,7 +197,6 @@ #include "zfs_comutil.h" #include "zfs_ioctl_compat.h" -CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX); static struct cdev *zfsdev; From owner-svn-src-all@freebsd.org Tue Feb 27 14:29:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD316F2A5B3; Tue, 27 Feb 2018 14:29:20 +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 7FBED79B2E; Tue, 27 Feb 2018 14:29:20 +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 7428D3C29; Tue, 27 Feb 2018 14:29:20 +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 w1RETK93006409; Tue, 27 Feb 2018 14:29:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RETKsx006408; Tue, 27 Feb 2018 14:29:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271429.w1RETKsx006408@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:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330060 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:29:21 -0000 Author: avg Date: Tue Feb 27 14:29:20 2018 New Revision: 330060 URL: https://svnweb.freebsd.org/changeset/base/330060 Log: MFC r328626: zfs_rezget: drop cached pages before doing anything else Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Feb 27 14:23:43 2018 (r330059) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Feb 27 14:29:20 2018 (r330060) @@ -1250,6 +1250,16 @@ zfs_rezget(znode_t *zp) int count = 0; uint64_t gen; + /* + * Remove cached pages before reloading the znode, so that they are not + * lingering after we run into any error. Ideally, we should vgone() + * the vnode in case of error, but currently we cannot do that + * because of the LOR between the vnode lock and z_teardown_lock. + * So, instead, we have to "doom" the znode in the illumos style. + */ + vp = ZTOV(zp); + vn_pages_remove(vp, 0, 0); + ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num); mutex_enter(&zp->z_acl_lock); @@ -1329,18 +1339,12 @@ zfs_rezget(znode_t *zp) * (e.g. via a look-up). The old vnode and znode will be * recycled when the last vnode reference is dropped. */ - vp = ZTOV(zp); if (vp->v_type != IFTOVT((mode_t)zp->z_mode)) { zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); - return (EIO); + return (SET_ERROR(EIO)); } - zp->z_blksz = doi.doi_data_block_size; - vn_pages_remove(vp, 0, 0); - if (zp->z_size != size) - vnode_pager_setsize(vp, zp->z_size); - /* * If the file has zero links, then it has been unlinked on the send * side and it must be in the received unlinked set. @@ -1351,8 +1355,15 @@ zfs_rezget(znode_t *zp) * when the unlinked set gets processed. */ zp->z_unlinked = (zp->z_links == 0); - if (zp->z_unlinked) + if (zp->z_unlinked) { zfs_znode_dmu_fini(zp); + ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + return (0); + } + + zp->z_blksz = doi.doi_data_block_size; + if (zp->z_size != size) + vnode_pager_setsize(vp, zp->z_size); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); From owner-svn-src-all@freebsd.org Tue Feb 27 14:32:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DAF3F2AA9A; Tue, 27 Feb 2018 14:32:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BACB7A000; Tue, 27 Feb 2018 14:32:34 +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 06C113DD8; Tue, 27 Feb 2018 14:32:34 +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 w1REWXaR011478; Tue, 27 Feb 2018 14:32:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REWX5b011477; Tue, 27 Feb 2018 14:32:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271432.w1REWX5b011477@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:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330061 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:32:34 -0000 Author: avg Date: Tue Feb 27 14:32:33 2018 New Revision: 330061 URL: https://svnweb.freebsd.org/changeset/base/330061 Log: MFC r328776: ZFS ARC: restore illumos uses of 'needfree' that were removed in r325851 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 27 14:29:20 2018 (r330060) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 27 14:32:33 2018 (r330061) @@ -4237,6 +4237,7 @@ arc_available_memory(void) free_memory_reason_t r = FMR_UNKNOWN; #ifdef _KERNEL +#ifdef __FreeBSD__ /* * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. @@ -4247,7 +4248,15 @@ arc_available_memory(void) r = FMR_LOTSFREE; } -#ifdef illumos +#else + if (needfree > 0) { + n = PAGESIZE * (-needfree); + if (n < lowest) { + lowest = n; + r = FMR_NEEDFREE; + } + } + /* * check that we're out of range of the pageout scanner. It starts to * schedule paging if freemem is less than lotsfree and needfree. @@ -4290,7 +4299,7 @@ arc_available_memory(void) r = FMR_PAGES_PP_MAXIMUM; } -#endif /* illumos */ +#endif /* __FreeBSD__ */ #if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC) /* * If we're on an i386 platform, it's possible that we'll exhaust the @@ -4501,6 +4510,11 @@ arc_reclaim_thread(void *dummy __unused) int64_t to_free = (arc_c >> arc_shrink_shift) - free_memory; if (to_free > 0) { +#ifdef _KERNEL +#ifdef illumos + to_free = MAX(to_free, ptob(needfree)); +#endif +#endif arc_shrink(to_free); } } else if (free_memory < arc_c >> arc_no_grow_shift) { From owner-svn-src-all@freebsd.org Tue Feb 27 14:39:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 662A4F2B15A; Tue, 27 Feb 2018 14:39:36 +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 152527A30E; Tue, 27 Feb 2018 14:39:36 +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 0B87D3DDB; Tue, 27 Feb 2018 14:39:36 +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 w1REdZb8012071; Tue, 27 Feb 2018 14:39:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REdZ4l012070; Tue, 27 Feb 2018 14:39:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271439.w1REdZ4l012070@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:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330062 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:39:36 -0000 Author: avg Date: Tue Feb 27 14:39:35 2018 New Revision: 330062 URL: https://svnweb.freebsd.org/changeset/base/330062 Log: MFC r328881: zfs: move a utility function, ioflags, closer to its consumers Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:32:33 2018 (r330061) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:39:35 2018 (r330062) @@ -4515,21 +4515,6 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int fla } static int -ioflags(int ioflags) -{ - int flags = 0; - - if (ioflags & IO_APPEND) - flags |= FAPPEND; - if (ioflags & IO_NDELAY) - flags |= FNONBLOCK; - if (ioflags & IO_SYNC) - flags |= (FSYNC | FDSYNC | FRSYNC); - - return (flags); -} - -static int zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int *rbehind, int *rahead) { @@ -4849,6 +4834,21 @@ zfs_freebsd_ioctl(ap) return (zfs_ioctl(ap->a_vp, ap->a_command, (intptr_t)ap->a_data, ap->a_fflag, ap->a_cred, NULL, NULL)); +} + +static int +ioflags(int ioflags) +{ + int flags = 0; + + if (ioflags & IO_APPEND) + flags |= FAPPEND; + if (ioflags & IO_NDELAY) + flags |= FNONBLOCK; + if (ioflags & IO_SYNC) + flags |= (FSYNC | FDSYNC | FRSYNC); + + return (flags); } static int From owner-svn-src-all@freebsd.org Tue Feb 27 14:41:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE31CF2B37E; Tue, 27 Feb 2018 14:41:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C6957A59D; Tue, 27 Feb 2018 14:41:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 874BF3F40; Tue, 27 Feb 2018 14:41:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REfZVe013746; Tue, 27 Feb 2018 14:41:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REfZiv013745; Tue, 27 Feb 2018 14:41:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271441.w1REfZiv013745@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:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330063 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:41:36 -0000 Author: avg Date: Tue Feb 27 14:41:35 2018 New Revision: 330063 URL: https://svnweb.freebsd.org/changeset/base/330063 Log: MFC r328881: zfs: move a utility function, ioflags, closer to its consumers Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:39:35 2018 (r330062) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:41:35 2018 (r330063) @@ -4514,21 +4514,6 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int fla } static int -ioflags(int ioflags) -{ - int flags = 0; - - if (ioflags & IO_APPEND) - flags |= FAPPEND; - if (ioflags & IO_NDELAY) - flags |= FNONBLOCK; - if (ioflags & IO_SYNC) - flags |= (FSYNC | FDSYNC | FRSYNC); - - return (flags); -} - -static int zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) { znode_t *zp = VTOZ(vp); @@ -4890,6 +4875,21 @@ zfs_freebsd_ioctl(ap) return (zfs_ioctl(ap->a_vp, ap->a_command, (intptr_t)ap->a_data, ap->a_fflag, ap->a_cred, NULL, NULL)); +} + +static int +ioflags(int ioflags) +{ + int flags = 0; + + if (ioflags & IO_APPEND) + flags |= FAPPEND; + if (ioflags & IO_NDELAY) + flags |= FNONBLOCK; + if (ioflags & IO_SYNC) + flags |= (FSYNC | FDSYNC | FRSYNC); + + return (flags); } static int From owner-svn-src-all@freebsd.org Tue Feb 27 14:42:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C0E6F2B789; Tue, 27 Feb 2018 14:42:41 +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 0D3A07A96E; Tue, 27 Feb 2018 14:42:41 +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 0839E3F83; Tue, 27 Feb 2018 14:42:41 +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 w1REgeIi016951; Tue, 27 Feb 2018 14:42:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REgeFa016950; Tue, 27 Feb 2018 14:42:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271442.w1REgeFa016950@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:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330064 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:42:41 -0000 Author: avg Date: Tue Feb 27 14:42:40 2018 New Revision: 330064 URL: https://svnweb.freebsd.org/changeset/base/330064 Log: MFC r329016: remove a duplicate assignment Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:41:35 2018 (r330063) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:42:40 2018 (r330064) @@ -4701,7 +4701,6 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t l } if (zp->z_blksz < PAGE_SIZE) { - i = 0; for (i = 0; len > 0; off += tocopy, len -= tocopy, i++) { tocopy = len > PAGE_SIZE ? PAGE_SIZE : len; va = zfs_map_page(ma[i], &sf); From owner-svn-src-all@freebsd.org Tue Feb 27 14:43:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49B8AF2B96F; Tue, 27 Feb 2018 14:43:20 +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 EF8B77AB0B; Tue, 27 Feb 2018 14:43:19 +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 EA0BA3F84; Tue, 27 Feb 2018 14:43:19 +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 w1REhJv7017057; Tue, 27 Feb 2018 14:43:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REhJti017056; Tue, 27 Feb 2018 14:43:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271443.w1REhJti017056@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:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330065 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:43:20 -0000 Author: avg Date: Tue Feb 27 14:43:19 2018 New Revision: 330065 URL: https://svnweb.freebsd.org/changeset/base/330065 Log: MFC r329016: remove a duplicate assignment Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:42:40 2018 (r330064) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:43:19 2018 (r330065) @@ -4742,7 +4742,6 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t l } if (zp->z_blksz < PAGE_SIZE) { - i = 0; for (i = 0; len > 0; off += tocopy, len -= tocopy, i++) { tocopy = len > PAGE_SIZE ? PAGE_SIZE : len; va = zfs_map_page(ma[i], &sf); From owner-svn-src-all@freebsd.org Tue Feb 27 14:45:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E266F2BB86; Tue, 27 Feb 2018 14:45:11 +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 C7FED7ACD6; Tue, 27 Feb 2018 14:45:10 +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 C2D623F86; Tue, 27 Feb 2018 14:45:10 +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 w1REjAFh017258; Tue, 27 Feb 2018 14:45:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REjA59017257; Tue, 27 Feb 2018 14:45:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271445.w1REjA59017257@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:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330066 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 330066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:45:11 -0000 Author: avg Date: Tue Feb 27 14:45:10 2018 New Revision: 330066 URL: https://svnweb.freebsd.org/changeset/base/330066 Log: MFC r328996: exec_map_first_page: fix an inverse condition introduced in r254138 Modified: stable/11/sys/kern/kern_exec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Tue Feb 27 14:43:19 2018 (r330065) +++ stable/11/sys/kern/kern_exec.c Tue Feb 27 14:45:10 2018 (r330066) @@ -1004,7 +1004,7 @@ exec_map_first_page(imgp) if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { if (ma[i]->valid) break; - if (vm_page_tryxbusy(ma[i])) + if (!vm_page_tryxbusy(ma[i])) break; } else { ma[i] = vm_page_alloc(object, i, From owner-svn-src-all@freebsd.org Tue Feb 27 14:45:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8B23F2BCF3; Tue, 27 Feb 2018 14:45: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 6A2BC7AE3D; Tue, 27 Feb 2018 14:45:55 +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 64F603F89; Tue, 27 Feb 2018 14:45:55 +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 w1REjtZO017363; Tue, 27 Feb 2018 14:45:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REjt81017362; Tue, 27 Feb 2018 14:45:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271445.w1REjt81017362@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:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330067 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 330067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:45:55 -0000 Author: avg Date: Tue Feb 27 14:45:55 2018 New Revision: 330067 URL: https://svnweb.freebsd.org/changeset/base/330067 Log: MFC r328996: exec_map_first_page: fix an inverse condition introduced in r254138 Modified: stable/10/sys/kern/kern_exec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Tue Feb 27 14:45:10 2018 (r330066) +++ stable/10/sys/kern/kern_exec.c Tue Feb 27 14:45:55 2018 (r330067) @@ -991,7 +991,7 @@ exec_map_first_page(imgp) if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { if (ma[i]->valid) break; - if (vm_page_tryxbusy(ma[i])) + if (!vm_page_tryxbusy(ma[i])) break; } else { ma[i] = vm_page_alloc(object, i, From owner-svn-src-all@freebsd.org Tue Feb 27 14:47:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A234F2BF03; Tue, 27 Feb 2018 14:47:17 +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 702AF7B051; Tue, 27 Feb 2018 14:47:17 +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 6B0E83F8A; Tue, 27 Feb 2018 14:47:17 +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 w1RElHfu017512; Tue, 27 Feb 2018 14:47:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RElHPt017511; Tue, 27 Feb 2018 14:47:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271447.w1RElHPt017511@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:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330068 - stable/11/sys/amd64/vmm/amd X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/amd X-SVN-Commit-Revision: 330068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:47:17 -0000 Author: avg Date: Tue Feb 27 14:47:17 2018 New Revision: 330068 URL: https://svnweb.freebsd.org/changeset/base/330068 Log: MFC r329364: move vintr_intercept_enabled under INVARIANTS Modified: stable/11/sys/amd64/vmm/amd/svm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm.c Tue Feb 27 14:45:55 2018 (r330067) +++ stable/11/sys/amd64/vmm/amd/svm.c Tue Feb 27 14:47:17 2018 (r330068) @@ -964,6 +964,7 @@ svm_save_intinfo(struct svm_softc *svm_sc, int vcpu) vm_exit_intinfo(svm_sc->vm, vcpu, intinfo); } +#ifdef INVARIANTS static __inline int vintr_intercept_enabled(struct svm_softc *sc, int vcpu) { @@ -971,6 +972,7 @@ vintr_intercept_enabled(struct svm_softc *sc, int vcpu return (svm_get_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_VINTR)); } +#endif static __inline void enable_intr_window_exiting(struct svm_softc *sc, int vcpu) From owner-svn-src-all@freebsd.org Tue Feb 27 14:47:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA2BEF2C035; Tue, 27 Feb 2018 14:47:56 +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 7DD737B190; Tue, 27 Feb 2018 14:47:56 +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 785243F8B; Tue, 27 Feb 2018 14:47:56 +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 w1REluhA017627; Tue, 27 Feb 2018 14:47:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RElu2M017626; Tue, 27 Feb 2018 14:47:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271447.w1RElu2M017626@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:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330069 - stable/10/sys/amd64/vmm/amd X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/amd64/vmm/amd X-SVN-Commit-Revision: 330069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:47:57 -0000 Author: avg Date: Tue Feb 27 14:47:56 2018 New Revision: 330069 URL: https://svnweb.freebsd.org/changeset/base/330069 Log: MFC r329364: move vintr_intercept_enabled under INVARIANTS Modified: stable/10/sys/amd64/vmm/amd/svm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/10/sys/amd64/vmm/amd/svm.c Tue Feb 27 14:47:17 2018 (r330068) +++ stable/10/sys/amd64/vmm/amd/svm.c Tue Feb 27 14:47:56 2018 (r330069) @@ -965,6 +965,7 @@ svm_save_intinfo(struct svm_softc *svm_sc, int vcpu) vm_exit_intinfo(svm_sc->vm, vcpu, intinfo); } +#ifdef INVARIANTS static __inline int vintr_intercept_enabled(struct svm_softc *sc, int vcpu) { @@ -972,6 +973,7 @@ vintr_intercept_enabled(struct svm_softc *sc, int vcpu return (svm_get_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_VINTR)); } +#endif static __inline void enable_intr_window_exiting(struct svm_softc *sc, int vcpu) From owner-svn-src-all@freebsd.org Tue Feb 27 14:50:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD59F2C2A7; Tue, 27 Feb 2018 14:50:20 +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 319B57B36E; Tue, 27 Feb 2018 14:50:20 +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 284E33F8F; Tue, 27 Feb 2018 14:50:20 +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 w1REoKlx017866; Tue, 27 Feb 2018 14:50:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REoJ03017865; Tue, 27 Feb 2018 14:50:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271450.w1REoJ03017865@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:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330070 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:50:20 -0000 Author: avg Date: Tue Feb 27 14:50:19 2018 New Revision: 330070 URL: https://svnweb.freebsd.org/changeset/base/330070 Log: MFC r329556,r329820 remove an assert in zfsctl_snapdir_lookup to match r323578 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 27 14:47:56 2018 (r330069) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 27 14:50:19 2018 (r330070) @@ -886,13 +886,6 @@ zfsctl_snapdir_lookup(ap) break; /* - * The vnode must be referenced at least by this thread and - * the mount point or the thread doing the mounting. - * There can be more references from concurrent lookups. - */ - KASSERT(vrefcnt(*vpp) > 1, ("found unreferenced mountpoint")); - - /* * Check if a snapshot is already mounted on top of the vnode. */ err = zfsctl_mounted_here(vpp, lkflags); From owner-svn-src-all@freebsd.org Tue Feb 27 14:51:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1093F2C4F8; Tue, 27 Feb 2018 14:51:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E87B7B578; Tue, 27 Feb 2018 14:51:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 498D540F6; Tue, 27 Feb 2018 14:51:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REpM6q019474; Tue, 27 Feb 2018 14:51:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REpM6d019473; Tue, 27 Feb 2018 14:51:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271451.w1REpM6d019473@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:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330071 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 14:51:22 -0000 Author: avg Date: Tue Feb 27 14:51:21 2018 New Revision: 330071 URL: https://svnweb.freebsd.org/changeset/base/330071 Log: MFC r329556,r329820 remove an assert in zfsctl_snapdir_lookup to match r323578 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 27 14:50:19 2018 (r330070) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 27 14:51:21 2018 (r330071) @@ -886,13 +886,6 @@ zfsctl_snapdir_lookup(ap) break; /* - * The vnode must be referenced at least by this thread and - * the mount point or the thread doing the mounting. - * There can be more references from concurrent lookups. - */ - KASSERT(vrefcnt(*vpp) > 1, ("found unreferenced mountpoint")); - - /* * Check if a snapshot is already mounted on top of the vnode. */ err = zfsctl_mounted_here(vpp, lkflags); From owner-svn-src-all@freebsd.org Tue Feb 27 15:01:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 15:29:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 15:31:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 15:34:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 15:35:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 15:51:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 15:51:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 16:06:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 16:08:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 16:36:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFDCBF35437 for ; Tue, 27 Feb 2018 16:36:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6347581C2A for ; Tue, 27 Feb 2018 16:36:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x244.google.com with SMTP id o9so15767706itc.1 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=eGB/LG7De19XbR3j4w/zzpu005sqCQtFtrsNU8jBPc6gl+4iOzVJUjwAc+1WIRJeWt pwa4GnQ2eAOwY3Wva9E03MO9BB3eUlJilw/kj9DSz+ot5sS3iMA6f103bs/TjZQOIMSu DDWCT+Jwxap1iHjTba+eCQouZ4bczETmUBn5Yv5UxlE/iuFcom3NQHe8IAwLZ06YS3Lg WNjwVqGHG+Plkpk1um3ej9lneI1YKqSa5eQacR7NSO00cuI3jQwoec2uGaTt85RLcydI CZ4Z63UUgagxEM2MS9ecRhr5PQSiC6MKLLitcAoVbluiyhzFUjmBiV49gPVH6oAXQPaZ C+zw== X-Gm-Message-State: APf1xPDcnnvFE1/3QTr3GM/QI90/jiFzqgGfu5BjBomjfRkGKNA/r1Wt mld6Tp9Cnc1oYXefmEcGYsqrIOFleVi/T2va3zMfsw== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 16:47:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 16:51:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 16:51:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5360F3689E for ; Tue, 27 Feb 2018 16:51:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 711C082A51 for ; Tue, 27 Feb 2018 16:51:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id a75so15856360itd.0 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=d55aq4Ves/SDsC4q6g65DrWG46R19jJifpf6xqW+lQTesJGrR8p+5ROchdki23HElU YjOsOMXhIyBw1jBa8LAtzsjcTKDepaaeUUZenvrsqwKrXP07egJpOKZbIsNRv1psvm0D L5EMzvmCLRq1MqNMXdqX/JEgvLH55RpFmjPW1uoTYNcKa+wmozEVUOUnbBspRydn9wZF hS2A0ET+hG25keRw+GxmdNXA72tn/nxVID6SG47BmO6oMkToKjq+vpb2ucZhb+FVtLKp QiMfhuFB4ubproEbCZn2o1ZpsE0NfOoZ2d3btOtoqNjj0+ipX74yUcWpA1uM/fQnk8tC Krow== X-Gm-Message-State: APf1xPBg0twEloXFkh9Qt/ACRq5iZude6FjSS55g3sqZPC9pZeUx0v/r Y89apDTNFwDdBN1z7J5XxzDMclk6t4XneGEqB1srvQ== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 17:12:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 17:35:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 17:36:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 17:51:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 18:52:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 18:52:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 19:02:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 205E3F40384; Tue, 27 Feb 2018 19:02:50 +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 C50E669896; Tue, 27 Feb 2018 19:02:49 +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 BFB8E6BA5; Tue, 27 Feb 2018 19:02:49 +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 w1RJ2nxD047280; Tue, 27 Feb 2018 19:02:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RJ2n3X047279; Tue, 27 Feb 2018 19:02:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802271902.w1RJ2n3X047279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 27 Feb 2018 19:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r330080 - in stable: 10/contrib/llvm/tools/clang/lib/Sema 9/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: stable-9 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/contrib/llvm/tools/clang/lib/Sema 9/contrib/llvm/tools/clang/lib/Sema X-SVN-Commit-Revision: 330080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 19:02:50 -0000 Author: dim Date: Tue Feb 27 19:02:49 2018 New Revision: 330080 URL: https://svnweb.freebsd.org/changeset/base/330080 Log: Avoid using the C++11 auto keyword, which was introduced in r328555, as part of an upstream change. This is not supported by gcc 4.2.1, which is still the default system compiler for some architectures. Direct commit to stable/9 and stable/10, since this does not apply to stable/11 and head. Reported by: jau@iki.fi PR: 202665,226068 Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Tue Feb 27 17:51:58 2018 (r330079) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Tue Feb 27 19:02:49 2018 (r330080) @@ -6316,7 +6316,7 @@ static void diagnoseListInit(Sema &S, const Initialize QualType T = DestType->getAs()->getPointeeType(); diagnoseListInit(S, InitializedEntity::InitializeTemporary(T), InitList); SourceLocation Loc = InitList->getLocStart(); - if (auto *D = Entity.getDecl()) + if (DeclaratorDecl *D = Entity.getDecl()) Loc = D->getLocation(); S.Diag(Loc, diag::note_in_reference_temporary_list_initializer) << T; return; From owner-svn-src-all@freebsd.org Tue Feb 27 19:02:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 583CFF40388; Tue, 27 Feb 2018 19:02:50 +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 06B9369897; Tue, 27 Feb 2018 19:02:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 019896BA6; Tue, 27 Feb 2018 19:02:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RJ2n8W047286; Tue, 27 Feb 2018 19:02:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RJ2n3a047285; Tue, 27 Feb 2018 19:02:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802271902.w1RJ2n3a047285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 27 Feb 2018 19:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330080 - in stable: 10/contrib/llvm/tools/clang/lib/Sema 9/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/contrib/llvm/tools/clang/lib/Sema 9/contrib/llvm/tools/clang/lib/Sema X-SVN-Commit-Revision: 330080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 19:02:50 -0000 Author: dim Date: Tue Feb 27 19:02:49 2018 New Revision: 330080 URL: https://svnweb.freebsd.org/changeset/base/330080 Log: Avoid using the C++11 auto keyword, which was introduced in r328555, as part of an upstream change. This is not supported by gcc 4.2.1, which is still the default system compiler for some architectures. Direct commit to stable/9 and stable/10, since this does not apply to stable/11 and head. Reported by: jau@iki.fi PR: 202665,226068 Modified: stable/10/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Modified: stable/10/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Tue Feb 27 17:51:58 2018 (r330079) +++ stable/10/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Tue Feb 27 19:02:49 2018 (r330080) @@ -6316,7 +6316,7 @@ static void diagnoseListInit(Sema &S, const Initialize QualType T = DestType->getAs()->getPointeeType(); diagnoseListInit(S, InitializedEntity::InitializeTemporary(T), InitList); SourceLocation Loc = InitList->getLocStart(); - if (auto *D = Entity.getDecl()) + if (DeclaratorDecl *D = Entity.getDecl()) Loc = D->getLocation(); S.Diag(Loc, diag::note_in_reference_temporary_list_initializer) << T; return; From owner-svn-src-all@freebsd.org Tue Feb 27 19:24:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF603F41CCE; Tue, 27 Feb 2018 19:24: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 87FFA6AB3A; Tue, 27 Feb 2018 19:24:06 +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 82FBA6F0F; Tue, 27 Feb 2018 19:24:06 +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 w1RJO6oD057409; Tue, 27 Feb 2018 19:24:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RJO62A057408; Tue, 27 Feb 2018 19:24:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802271924.w1RJO62A057408@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 19:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330081 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 330081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 19:24:07 -0000 Author: kevans Date: Tue Feb 27 19:24:06 2018 New Revision: 330081 URL: https://svnweb.freebsd.org/changeset/base/330081 Log: MFC r318304: getusershell: don't write paste end of buffer reading shells _local_initshells did not reset cp to the beginning of the line buffer for every iteration that it called fgets(3), leading to writing past the end of line with fairly long /etc/shells or excessively long line lengths. Correct this by properly resetting cp. PR: 192528 Modified: stable/11/lib/libc/gen/getusershell.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/getusershell.c ============================================================================== --- stable/11/lib/libc/gen/getusershell.c Tue Feb 27 19:02:49 2018 (r330080) +++ stable/11/lib/libc/gen/getusershell.c Tue Feb 27 19:24:06 2018 (r330081) @@ -115,8 +115,8 @@ _local_initshells(void *rv, void *cb_data, va_list ap) if ((fp = fopen(_PATH_SHELLS, "re")) == NULL) return NS_UNAVAIL; - cp = line; - while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { + while (fgets(line, MAXPATHLEN + 1, fp) != NULL) { + cp = line; while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; if (*cp == '#' || *cp == '\0') @@ -124,7 +124,7 @@ _local_initshells(void *rv, void *cb_data, va_list ap) sp = cp; while (!isspace(*cp) && *cp != '#' && *cp != '\0') cp++; - *cp++ = '\0'; + *cp = '\0'; sl_add(sl, strdup(sp)); } (void)fclose(fp); From owner-svn-src-all@freebsd.org Tue Feb 27 19:38:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 19:49:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 21:06:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 21:22:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 21:30:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 21:52:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 21:59:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 22:01:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 22:02:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 22:07:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 22:12:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Feb 27 22:22:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Wed Feb 28 00:17:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 00:29:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01311F3894B; Wed, 28 Feb 2018 00:29:53 +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 A8F0C79735; Wed, 28 Feb 2018 00:29: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 A3C5C12183; Wed, 28 Feb 2018 00:29: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 w1S0TqKd022454; Wed, 28 Feb 2018 00:29:52 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S0TqCu022453; Wed, 28 Feb 2018 00:29:52 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802280029.w1S0TqCu022453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 28 Feb 2018 00:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330092 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 330092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 00:29:53 -0000 Author: rpokala Date: Wed Feb 28 00:29:52 2018 New Revision: 330092 URL: https://svnweb.freebsd.org/changeset/base/330092 Log: MFC r329682: mountd: Return proper errno values in a few error paths When attempting to mount a non-directory which exists, return ENOTDIR instead of ENOENT. If stat() or statfs() failed, don't pass part of the invalid (struct statfs) to ex_search(). In that same case, preserve the value of "bad" rather than overwriting with EACCES. Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Wed Feb 28 00:17:08 2018 (r330091) +++ stable/11/usr.sbin/mountd/mountd.c Wed Feb 28 00:29:52 2018 (r330092) @@ -1051,8 +1051,6 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) */ if (realpath(rpcpath, dirpath) == NULL || stat(dirpath, &stb) < 0 || - (!S_ISDIR(stb.st_mode) && - (dir_only || !S_ISREG(stb.st_mode))) || statfs(dirpath, &fsb) < 0) { chdir("/"); /* Just in case realpath doesn't */ syslog(LOG_NOTICE, @@ -1062,10 +1060,23 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) warnx("stat failed on %s", dirpath); bad = ENOENT; /* We will send error reply later */ } + if (!bad && + !S_ISDIR(stb.st_mode) && + (dir_only || !S_ISREG(stb.st_mode))) { + syslog(LOG_NOTICE, + "mount request from %s for non-directory path %s", + numerichost, dirpath); + if (debug) + warnx("mounting non-directory %s", dirpath); + bad = ENOTDIR; /* We will send error reply later */ + } /* Check in the exports list */ sigprocmask(SIG_BLOCK, &sighup_mask, NULL); - ep = ex_search(&fsb.f_fsid); + if (bad) + ep = NULL; + else + ep = ex_search(&fsb.f_fsid); hostset = defset = 0; if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, &numsecflavors, &secflavorsp) || @@ -1116,7 +1127,8 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) "mount request succeeded from %s for %s", numerichost, dirpath); } else { - bad = EACCES; + if (!bad) + bad = EACCES; syslog(LOG_NOTICE, "mount request denied from %s for %s", numerichost, dirpath); From owner-svn-src-all@freebsd.org Wed Feb 28 00:30:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63362F38992; Wed, 28 Feb 2018 00:30:04 +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 103F579823; Wed, 28 Feb 2018 00:30:04 +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 0B0461218A; Wed, 28 Feb 2018 00:30:04 +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 w1S0U3Qu022533; Wed, 28 Feb 2018 00:30:03 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S0U3Ko022532; Wed, 28 Feb 2018 00:30:03 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802280030.w1S0U3Ko022532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 28 Feb 2018 00:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330093 - stable/10/usr.sbin/mountd X-SVN-Group: stable-10 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: stable/10/usr.sbin/mountd X-SVN-Commit-Revision: 330093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 00:30:04 -0000 Author: rpokala Date: Wed Feb 28 00:30:03 2018 New Revision: 330093 URL: https://svnweb.freebsd.org/changeset/base/330093 Log: MFC r329682: mountd: Return proper errno values in a few error paths When attempting to mount a non-directory which exists, return ENOTDIR instead of ENOENT. If stat() or statfs() failed, don't pass part of the invalid (struct statfs) to ex_search(). In that same case, preserve the value of "bad" rather than overwriting with EACCES. Modified: stable/10/usr.sbin/mountd/mountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mountd/mountd.c ============================================================================== --- stable/10/usr.sbin/mountd/mountd.c Wed Feb 28 00:29:52 2018 (r330092) +++ stable/10/usr.sbin/mountd/mountd.c Wed Feb 28 00:30:03 2018 (r330093) @@ -1072,8 +1072,6 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) */ if (realpath(rpcpath, dirpath) == NULL || stat(dirpath, &stb) < 0 || - (!S_ISDIR(stb.st_mode) && - (dir_only || !S_ISREG(stb.st_mode))) || statfs(dirpath, &fsb) < 0) { chdir("/"); /* Just in case realpath doesn't */ syslog(LOG_NOTICE, @@ -1083,10 +1081,23 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) warnx("stat failed on %s", dirpath); bad = ENOENT; /* We will send error reply later */ } + if (!bad && + !S_ISDIR(stb.st_mode) && + (dir_only || !S_ISREG(stb.st_mode))) { + syslog(LOG_NOTICE, + "mount request from %s for non-directory path %s", + numerichost, dirpath); + if (debug) + warnx("mounting non-directory %s", dirpath); + bad = ENOTDIR; /* We will send error reply later */ + } /* Check in the exports list */ sigprocmask(SIG_BLOCK, &sighup_mask, NULL); - ep = ex_search(&fsb.f_fsid); + if (bad) + ep = NULL; + else + ep = ex_search(&fsb.f_fsid); hostset = defset = 0; if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, &numsecflavors, &secflavorsp) || @@ -1137,7 +1148,8 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) "mount request succeeded from %s for %s", numerichost, dirpath); } else { - bad = EACCES; + if (!bad) + bad = EACCES; syslog(LOG_NOTICE, "mount request denied from %s for %s", numerichost, dirpath); From owner-svn-src-all@freebsd.org Wed Feb 28 00:32:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 02:37:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBCFAF413DE; Wed, 28 Feb 2018 02:37:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6657A7E6F1; Wed, 28 Feb 2018 02:37:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E9D3136D4; Wed, 28 Feb 2018 02:37:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S2bx1x087266; Wed, 28 Feb 2018 02:37:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S2bxff087265; Wed, 28 Feb 2018 02:37:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802280237.w1S2bxff087265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Feb 2018 02:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330094 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 330094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 02:38:00 -0000 Author: pfg Date: Wed Feb 28 02:37:59 2018 New Revision: 330094 URL: https://svnweb.freebsd.org/changeset/base/330094 Log: MFC r329846: getpeereid(3): Fix behavior on failure to match documentation. According to the getpeereid(3) documentation, on failure the value -1 is returned and the global variable errno is set to indicate the error. We were returning the error instead. Obtained from: Apple's Libc-1244.30.3 Modified: stable/11/lib/libc/gen/getpeereid.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/getpeereid.c ============================================================================== --- stable/11/lib/libc/gen/getpeereid.c Wed Feb 28 00:30:03 2018 (r330093) +++ stable/11/lib/libc/gen/getpeereid.c Wed Feb 28 02:37:59 2018 (r330094) @@ -48,8 +48,10 @@ getpeereid(int s, uid_t *euid, gid_t *egid) error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); if (error != 0) return (error); - if (xuc.cr_version != XUCRED_VERSION) - return (EINVAL); + if (xuc.cr_version != XUCRED_VERSION) { + errno = EINVAL; + return (-1); + } *euid = xuc.cr_uid; *egid = xuc.cr_gid; return (0); From owner-svn-src-all@freebsd.org Wed Feb 28 02:39:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C27C4F415B6; Wed, 28 Feb 2018 02:39:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7489D7E8B6; Wed, 28 Feb 2018 02:39:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F8FC136D8; Wed, 28 Feb 2018 02:39:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S2dc2Z087363; Wed, 28 Feb 2018 02:39:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S2dcLD087362; Wed, 28 Feb 2018 02:39:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802280239.w1S2dcLD087362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Feb 2018 02:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330095 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 330095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 02:39:38 -0000 Author: pfg Date: Wed Feb 28 02:39:38 2018 New Revision: 330095 URL: https://svnweb.freebsd.org/changeset/base/330095 Log: MFC r329846: getpeereid(3): Fix behavior on failure to match documentation. According to the getpeereid(3) documentation, on failure the value -1 is returned and the global variable errno is set to indicate the error. We were returning the error instead. Obtained from: Apple's Libc-1244.30.3 Modified: stable/10/lib/libc/gen/getpeereid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getpeereid.c ============================================================================== --- stable/10/lib/libc/gen/getpeereid.c Wed Feb 28 02:37:59 2018 (r330094) +++ stable/10/lib/libc/gen/getpeereid.c Wed Feb 28 02:39:38 2018 (r330095) @@ -46,8 +46,10 @@ getpeereid(int s, uid_t *euid, gid_t *egid) error = getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); if (error != 0) return (error); - if (xuc.cr_version != XUCRED_VERSION) - return (EINVAL); + if (xuc.cr_version != XUCRED_VERSION) { + errno = EINVAL; + return (-1); + } *euid = xuc.cr_uid; *egid = xuc.cr_gid; return (0); From owner-svn-src-all@freebsd.org Wed Feb 28 02:49:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEB25F4208F; Wed, 28 Feb 2018 02:49:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 913C37EF86; Wed, 28 Feb 2018 02:49:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C3871388C; Wed, 28 Feb 2018 02:49:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S2n0JN092173; Wed, 28 Feb 2018 02:49:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S2n00r092172; Wed, 28 Feb 2018 02:49:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802280249.w1S2n00r092172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Feb 2018 02:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330096 - stable/11/lib/libc/stdio X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/lib/libc/stdio X-SVN-Commit-Revision: 330096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 02:49:01 -0000 Author: pfg Date: Wed Feb 28 02:49:00 2018 New Revision: 330096 URL: https://svnweb.freebsd.org/changeset/base/330096 Log: MFC r329848: __printf_render_int(): small type change to match use. Variable l is consistently used as an int rather than a char. Sort names while here. Obtained from: Apple's Libc-1244.30.3 Modified: stable/11/lib/libc/stdio/xprintf_int.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdio/xprintf_int.c ============================================================================== --- stable/11/lib/libc/stdio/xprintf_int.c Wed Feb 28 02:39:38 2018 (r330095) +++ stable/11/lib/libc/stdio/xprintf_int.c Wed Feb 28 02:49:00 2018 (r330096) @@ -258,8 +258,8 @@ __printf_render_int(struct __printf_io *io, const stru const union arg *argp; char buf[BUF]; char *p, *pe; - char ns, l; - int rdx, sign, zext, ngrp; + char ns; + int l, ngrp, rdx, sign, zext; const char *nalt, *digit; char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ From owner-svn-src-all@freebsd.org Wed Feb 28 02:49:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02A5AF42187; Wed, 28 Feb 2018 02:49:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8E907F0D9; Wed, 28 Feb 2018 02:49:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3D931388F; Wed, 28 Feb 2018 02:49:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S2nmme092244; Wed, 28 Feb 2018 02:49:48 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S2nmWf092243; Wed, 28 Feb 2018 02:49:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802280249.w1S2nmWf092243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Feb 2018 02:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330097 - stable/10/lib/libc/stdio X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/lib/libc/stdio X-SVN-Commit-Revision: 330097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 02:49:49 -0000 Author: pfg Date: Wed Feb 28 02:49:48 2018 New Revision: 330097 URL: https://svnweb.freebsd.org/changeset/base/330097 Log: MFC r329848: __printf_render_int(): small type change to match use. Variable l is consistently used as an int rather than a char. Sort names while here. Obtained from: Apple's Libc-1244.30.3 Modified: stable/10/lib/libc/stdio/xprintf_int.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/xprintf_int.c ============================================================================== --- stable/10/lib/libc/stdio/xprintf_int.c Wed Feb 28 02:49:00 2018 (r330096) +++ stable/10/lib/libc/stdio/xprintf_int.c Wed Feb 28 02:49:48 2018 (r330097) @@ -258,8 +258,8 @@ __printf_render_int(struct __printf_io *io, const stru const union arg *argp; char buf[BUF]; char *p, *pe; - char ns, l; - int rdx, sign, zext, ngrp; + char ns; + int l, ngrp, rdx, sign, zext; const char *nalt, *digit; char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ From owner-svn-src-all@freebsd.org Wed Feb 28 04:23:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 04:31:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 05:02:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 05:11:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 06:23:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7587CF2D01B; Wed, 28 Feb 2018 06:23:15 +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 1B98187200; Wed, 28 Feb 2018 06:23:15 +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 1467D15D23; Wed, 28 Feb 2018 06:23:15 +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 w1S6NFia002971; Wed, 28 Feb 2018 06:23:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S6NCbo002959; Wed, 28 Feb 2018 06:23:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201802280623.w1S6NCbo002959@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 06:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r330102 - in vendor/ntp/dist: . adjtimed clockstuff html html/drivers include include/isc kernel kernel/sys libntp libparse ntpd ntpdate ntpdc ntpq ntpsnmpd parseutil ports/winnt/includ... X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in vendor/ntp/dist: . adjtimed clockstuff html html/drivers include include/isc kernel kernel/sys libntp libparse ntpd ntpdate ntpdc ntpq ntpsnmpd parseutil ports/winnt/include ports/winnt/instsrv por... X-SVN-Commit-Revision: 330102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 06:23:15 -0000 Author: delphij Date: Wed Feb 28 06:23:12 2018 New Revision: 330102 URL: https://svnweb.freebsd.org/changeset/base/330102 Log: Vendor import of ntp-4.2.8p11. Added: vendor/ntp/dist/sntp/m4/ntp_af_unspec.m4 vendor/ntp/dist/sntp/tests/testconf.yml vendor/ntp/dist/tests/bug-2803/testconf.yml vendor/ntp/dist/tests/libntp/testconf.yml vendor/ntp/dist/tests/ntpd/testconf.yml vendor/ntp/dist/tests/ntpq/testconf.yml vendor/ntp/dist/tests/sandbox/testconf.yml vendor/ntp/dist/tests/sec-2853/testconf.yml Modified: vendor/ntp/dist/ChangeLog vendor/ntp/dist/Makefile.am vendor/ntp/dist/Makefile.in vendor/ntp/dist/NEWS vendor/ntp/dist/aclocal.m4 vendor/ntp/dist/adjtimed/Makefile.in vendor/ntp/dist/clockstuff/Makefile.in vendor/ntp/dist/configure vendor/ntp/dist/configure.ac vendor/ntp/dist/html/access.html vendor/ntp/dist/html/accopt.html vendor/ntp/dist/html/authentic.html vendor/ntp/dist/html/drivers/driver18.html vendor/ntp/dist/html/drivers/driver40-ja.html vendor/ntp/dist/html/drivers/driver40.html vendor/ntp/dist/html/keygen.html vendor/ntp/dist/html/miscopt.html vendor/ntp/dist/html/monopt.html vendor/ntp/dist/html/ntpq.html vendor/ntp/dist/include/Makefile.in vendor/ntp/dist/include/isc/Makefile.in vendor/ntp/dist/include/ntp.h vendor/ntp/dist/include/ntp_calendar.h vendor/ntp/dist/include/ntp_config.h vendor/ntp/dist/include/ntp_fp.h vendor/ntp/dist/include/ntp_keyacc.h vendor/ntp/dist/include/ntp_request.h vendor/ntp/dist/include/ntp_stdlib.h vendor/ntp/dist/include/ntpd.h vendor/ntp/dist/include/recvbuff.h vendor/ntp/dist/include/ssl_applink.c vendor/ntp/dist/kernel/Makefile.in vendor/ntp/dist/kernel/sys/Makefile.in vendor/ntp/dist/libntp/Makefile.in vendor/ntp/dist/libntp/a_md5encrypt.c vendor/ntp/dist/libntp/adjtime.c vendor/ntp/dist/libntp/authkeys.c vendor/ntp/dist/libntp/authreadkeys.c vendor/ntp/dist/libntp/libssl_compat.c vendor/ntp/dist/libntp/ntp_calendar.c vendor/ntp/dist/libntp/ssl_init.c vendor/ntp/dist/libntp/statestr.c vendor/ntp/dist/libntp/systime.c vendor/ntp/dist/libntp/work_thread.c vendor/ntp/dist/libparse/Makefile.in vendor/ntp/dist/ntpd/Makefile.in vendor/ntp/dist/ntpd/complete.conf.in vendor/ntp/dist/ntpd/invoke-ntp.conf.texi vendor/ntp/dist/ntpd/invoke-ntp.keys.texi vendor/ntp/dist/ntpd/invoke-ntpd.texi vendor/ntp/dist/ntpd/keyword-gen-utd vendor/ntp/dist/ntpd/keyword-gen.c vendor/ntp/dist/ntpd/ntp.conf.5man vendor/ntp/dist/ntpd/ntp.conf.5mdoc vendor/ntp/dist/ntpd/ntp.conf.def vendor/ntp/dist/ntpd/ntp.conf.html vendor/ntp/dist/ntpd/ntp.conf.man.in vendor/ntp/dist/ntpd/ntp.conf.mdoc.in vendor/ntp/dist/ntpd/ntp.keys.5man vendor/ntp/dist/ntpd/ntp.keys.5mdoc vendor/ntp/dist/ntpd/ntp.keys.def vendor/ntp/dist/ntpd/ntp.keys.html vendor/ntp/dist/ntpd/ntp.keys.man.in vendor/ntp/dist/ntpd/ntp.keys.mdoc.in vendor/ntp/dist/ntpd/ntp_config.c vendor/ntp/dist/ntpd/ntp_control.c vendor/ntp/dist/ntpd/ntp_crypto.c vendor/ntp/dist/ntpd/ntp_io.c vendor/ntp/dist/ntpd/ntp_keyword.h vendor/ntp/dist/ntpd/ntp_leapsec.c vendor/ntp/dist/ntpd/ntp_parser.c vendor/ntp/dist/ntpd/ntp_parser.h vendor/ntp/dist/ntpd/ntp_parser.y vendor/ntp/dist/ntpd/ntp_peer.c vendor/ntp/dist/ntpd/ntp_proto.c vendor/ntp/dist/ntpd/ntp_refclock.c vendor/ntp/dist/ntpd/ntp_request.c vendor/ntp/dist/ntpd/ntp_restrict.c vendor/ntp/dist/ntpd/ntp_scanner.c vendor/ntp/dist/ntpd/ntp_util.c vendor/ntp/dist/ntpd/ntpd-opts.c vendor/ntp/dist/ntpd/ntpd-opts.h vendor/ntp/dist/ntpd/ntpd.1ntpdman vendor/ntp/dist/ntpd/ntpd.1ntpdmdoc vendor/ntp/dist/ntpd/ntpd.c vendor/ntp/dist/ntpd/ntpd.html vendor/ntp/dist/ntpd/ntpd.man.in vendor/ntp/dist/ntpd/ntpd.mdoc.in vendor/ntp/dist/ntpd/ntpsim.c vendor/ntp/dist/ntpd/refclock_gpsdjson.c vendor/ntp/dist/ntpd/refclock_jjy.c vendor/ntp/dist/ntpd/refclock_palisade.c vendor/ntp/dist/ntpd/refclock_parse.c vendor/ntp/dist/ntpdate/Makefile.in vendor/ntp/dist/ntpdc/Makefile.in vendor/ntp/dist/ntpdc/invoke-ntpdc.texi vendor/ntp/dist/ntpdc/layout.std vendor/ntp/dist/ntpdc/ntpdc-opts.c vendor/ntp/dist/ntpdc/ntpdc-opts.h vendor/ntp/dist/ntpdc/ntpdc.1ntpdcman vendor/ntp/dist/ntpdc/ntpdc.1ntpdcmdoc vendor/ntp/dist/ntpdc/ntpdc.c vendor/ntp/dist/ntpdc/ntpdc.html vendor/ntp/dist/ntpdc/ntpdc.man.in vendor/ntp/dist/ntpdc/ntpdc.mdoc.in vendor/ntp/dist/ntpdc/ntpdc_ops.c vendor/ntp/dist/ntpq/Makefile.am vendor/ntp/dist/ntpq/Makefile.in vendor/ntp/dist/ntpq/invoke-ntpq.texi vendor/ntp/dist/ntpq/ntpq-opts.c vendor/ntp/dist/ntpq/ntpq-opts.def vendor/ntp/dist/ntpq/ntpq-opts.h vendor/ntp/dist/ntpq/ntpq-subs.c vendor/ntp/dist/ntpq/ntpq.1ntpqman vendor/ntp/dist/ntpq/ntpq.1ntpqmdoc vendor/ntp/dist/ntpq/ntpq.c vendor/ntp/dist/ntpq/ntpq.html vendor/ntp/dist/ntpq/ntpq.man.in vendor/ntp/dist/ntpq/ntpq.mdoc.in vendor/ntp/dist/ntpq/ntpq.texi vendor/ntp/dist/ntpsnmpd/Makefile.in vendor/ntp/dist/ntpsnmpd/invoke-ntpsnmpd.texi vendor/ntp/dist/ntpsnmpd/netsnmp_daemonize.c vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h vendor/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdman vendor/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc vendor/ntp/dist/ntpsnmpd/ntpsnmpd.html vendor/ntp/dist/ntpsnmpd/ntpsnmpd.man.in vendor/ntp/dist/ntpsnmpd/ntpsnmpd.mdoc.in vendor/ntp/dist/packageinfo.sh vendor/ntp/dist/parseutil/Makefile.in vendor/ntp/dist/ports/winnt/include/msvc_ssl_autolib.h vendor/ntp/dist/ports/winnt/instsrv/instsrv.c vendor/ntp/dist/ports/winnt/ntpd/nt_ppsimpl.c vendor/ntp/dist/ports/winnt/ntpd/ntp_iocompletionport.c vendor/ntp/dist/ports/winnt/scripts/mkver.bat vendor/ntp/dist/ports/winnt/vs2008/debug-x64.vsprops vendor/ntp/dist/ports/winnt/vs2008/debug.vsprops vendor/ntp/dist/ports/winnt/vs2008/release-x64.vsprops vendor/ntp/dist/ports/winnt/vs2008/release.vsprops vendor/ntp/dist/ports/winnt/vs2013/debug-x64.props vendor/ntp/dist/ports/winnt/vs2013/debug.props vendor/ntp/dist/ports/winnt/vs2013/release-x64.props vendor/ntp/dist/ports/winnt/vs2013/release.props vendor/ntp/dist/ports/winnt/vs2015/debug-x64.props vendor/ntp/dist/ports/winnt/vs2015/debug.props vendor/ntp/dist/ports/winnt/vs2015/release-x64.props vendor/ntp/dist/ports/winnt/vs2015/release.props vendor/ntp/dist/scripts/Makefile.in vendor/ntp/dist/scripts/build/Makefile.in vendor/ntp/dist/scripts/build/UpdatePoint vendor/ntp/dist/scripts/calc_tickadj/Makefile.in vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.html vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.man.in vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.mdoc.in vendor/ntp/dist/scripts/calc_tickadj/invoke-calc_tickadj.texi vendor/ntp/dist/scripts/invoke-plot_summary.texi vendor/ntp/dist/scripts/invoke-summary.texi vendor/ntp/dist/scripts/lib/Makefile.in vendor/ntp/dist/scripts/ntp-wait/Makefile.in vendor/ntp/dist/scripts/ntp-wait/invoke-ntp-wait.texi vendor/ntp/dist/scripts/ntp-wait/ntp-wait-opts vendor/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitman vendor/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc vendor/ntp/dist/scripts/ntp-wait/ntp-wait.html vendor/ntp/dist/scripts/ntp-wait/ntp-wait.man.in vendor/ntp/dist/scripts/ntp-wait/ntp-wait.mdoc.in vendor/ntp/dist/scripts/ntpsweep/Makefile.in vendor/ntp/dist/scripts/ntpsweep/invoke-ntpsweep.texi vendor/ntp/dist/scripts/ntpsweep/ntpsweep-opts vendor/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepman vendor/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc vendor/ntp/dist/scripts/ntpsweep/ntpsweep.html vendor/ntp/dist/scripts/ntpsweep/ntpsweep.man.in vendor/ntp/dist/scripts/ntpsweep/ntpsweep.mdoc.in vendor/ntp/dist/scripts/ntptrace/Makefile.in vendor/ntp/dist/scripts/ntptrace/invoke-ntptrace.texi vendor/ntp/dist/scripts/ntptrace/ntptrace-opts vendor/ntp/dist/scripts/ntptrace/ntptrace.1ntptraceman vendor/ntp/dist/scripts/ntptrace/ntptrace.1ntptracemdoc vendor/ntp/dist/scripts/ntptrace/ntptrace.html vendor/ntp/dist/scripts/ntptrace/ntptrace.man.in vendor/ntp/dist/scripts/ntptrace/ntptrace.mdoc.in vendor/ntp/dist/scripts/plot_summary-opts vendor/ntp/dist/scripts/plot_summary.1plot_summaryman vendor/ntp/dist/scripts/plot_summary.1plot_summarymdoc vendor/ntp/dist/scripts/plot_summary.html vendor/ntp/dist/scripts/plot_summary.man.in vendor/ntp/dist/scripts/plot_summary.mdoc.in vendor/ntp/dist/scripts/summary-opts vendor/ntp/dist/scripts/summary.1summaryman vendor/ntp/dist/scripts/summary.1summarymdoc vendor/ntp/dist/scripts/summary.html vendor/ntp/dist/scripts/summary.man.in vendor/ntp/dist/scripts/summary.mdoc.in vendor/ntp/dist/scripts/update-leap/Makefile.in vendor/ntp/dist/scripts/update-leap/invoke-update-leap.texi vendor/ntp/dist/scripts/update-leap/update-leap-opts vendor/ntp/dist/scripts/update-leap/update-leap.1update-leapman vendor/ntp/dist/scripts/update-leap/update-leap.1update-leapmdoc vendor/ntp/dist/scripts/update-leap/update-leap.html vendor/ntp/dist/scripts/update-leap/update-leap.in vendor/ntp/dist/scripts/update-leap/update-leap.man.in vendor/ntp/dist/scripts/update-leap/update-leap.mdoc.in vendor/ntp/dist/sntp/Makefile.in vendor/ntp/dist/sntp/check-libntp.mf vendor/ntp/dist/sntp/configure vendor/ntp/dist/sntp/crypto.c vendor/ntp/dist/sntp/crypto.h vendor/ntp/dist/sntp/harden/linux vendor/ntp/dist/sntp/include/version.def vendor/ntp/dist/sntp/include/version.texi vendor/ntp/dist/sntp/invoke-sntp.texi vendor/ntp/dist/sntp/m4/ntp_harden.m4 vendor/ntp/dist/sntp/m4/ntp_libevent.m4 vendor/ntp/dist/sntp/m4/ntp_openssl.m4 vendor/ntp/dist/sntp/m4/version.m4 vendor/ntp/dist/sntp/main.c vendor/ntp/dist/sntp/networking.c vendor/ntp/dist/sntp/sntp-opts.c vendor/ntp/dist/sntp/sntp-opts.def vendor/ntp/dist/sntp/sntp-opts.h vendor/ntp/dist/sntp/sntp.1sntpman vendor/ntp/dist/sntp/sntp.1sntpmdoc vendor/ntp/dist/sntp/sntp.html vendor/ntp/dist/sntp/sntp.man.in vendor/ntp/dist/sntp/sntp.mdoc.in vendor/ntp/dist/sntp/tests/Makefile.am vendor/ntp/dist/sntp/tests/Makefile.in vendor/ntp/dist/sntp/tests/crypto.c vendor/ntp/dist/sntp/tests/keyFile.c vendor/ntp/dist/sntp/tests/packetHandling.c vendor/ntp/dist/sntp/tests/packetProcessing.c vendor/ntp/dist/sntp/tests/run-crypto.c vendor/ntp/dist/sntp/tests/run-keyFile.c vendor/ntp/dist/sntp/tests/run-kodDatabase.c vendor/ntp/dist/sntp/tests/run-kodFile.c vendor/ntp/dist/sntp/tests/run-networking.c vendor/ntp/dist/sntp/tests/run-packetHandling.c vendor/ntp/dist/sntp/tests/run-packetProcessing.c vendor/ntp/dist/sntp/tests/run-t-log.c vendor/ntp/dist/sntp/tests/run-utilities.c vendor/ntp/dist/sntp/unity/auto/generate_test_runner.rb vendor/ntp/dist/sntp/utilities.c vendor/ntp/dist/sntp/version.c vendor/ntp/dist/tests/Makefile.in vendor/ntp/dist/tests/bug-2803/Makefile.am vendor/ntp/dist/tests/bug-2803/Makefile.in vendor/ntp/dist/tests/bug-2803/run-bug-2803.c vendor/ntp/dist/tests/libntp/Makefile.am vendor/ntp/dist/tests/libntp/Makefile.in vendor/ntp/dist/tests/libntp/a_md5encrypt.c vendor/ntp/dist/tests/libntp/authkeys.c vendor/ntp/dist/tests/libntp/run-a_md5encrypt.c vendor/ntp/dist/tests/libntp/run-atoint.c vendor/ntp/dist/tests/libntp/run-atouint.c vendor/ntp/dist/tests/libntp/run-authkeys.c vendor/ntp/dist/tests/libntp/run-buftvtots.c vendor/ntp/dist/tests/libntp/run-calendar.c vendor/ntp/dist/tests/libntp/run-caljulian.c vendor/ntp/dist/tests/libntp/run-caltontp.c vendor/ntp/dist/tests/libntp/run-calyearstart.c vendor/ntp/dist/tests/libntp/run-clocktime.c vendor/ntp/dist/tests/libntp/run-decodenetnum.c vendor/ntp/dist/tests/libntp/run-hextoint.c vendor/ntp/dist/tests/libntp/run-hextolfp.c vendor/ntp/dist/tests/libntp/run-humandate.c vendor/ntp/dist/tests/libntp/run-lfpfunc.c vendor/ntp/dist/tests/libntp/run-lfptostr.c vendor/ntp/dist/tests/libntp/run-modetoa.c vendor/ntp/dist/tests/libntp/run-msyslog.c vendor/ntp/dist/tests/libntp/run-netof.c vendor/ntp/dist/tests/libntp/run-numtoa.c vendor/ntp/dist/tests/libntp/run-numtohost.c vendor/ntp/dist/tests/libntp/run-octtoint.c vendor/ntp/dist/tests/libntp/run-prettydate.c vendor/ntp/dist/tests/libntp/run-recvbuff.c vendor/ntp/dist/tests/libntp/run-refidsmear.c vendor/ntp/dist/tests/libntp/run-refnumtoa.c vendor/ntp/dist/tests/libntp/run-sfptostr.c vendor/ntp/dist/tests/libntp/run-socktoa.c vendor/ntp/dist/tests/libntp/run-ssl_init.c vendor/ntp/dist/tests/libntp/run-statestr.c vendor/ntp/dist/tests/libntp/run-strtolfp.c vendor/ntp/dist/tests/libntp/run-timespecops.c vendor/ntp/dist/tests/libntp/run-timevalops.c vendor/ntp/dist/tests/libntp/run-tsafememcmp.c vendor/ntp/dist/tests/libntp/run-tstotv.c vendor/ntp/dist/tests/libntp/run-tvtots.c vendor/ntp/dist/tests/libntp/run-uglydate.c vendor/ntp/dist/tests/libntp/run-vi64ops.c vendor/ntp/dist/tests/libntp/run-ymd2yd.c vendor/ntp/dist/tests/libntp/ssl_init.c vendor/ntp/dist/tests/libntp/timespecops.c vendor/ntp/dist/tests/libntp/timevalops.c vendor/ntp/dist/tests/ntpd/Makefile.am vendor/ntp/dist/tests/ntpd/Makefile.in vendor/ntp/dist/tests/ntpd/leapsec.c vendor/ntp/dist/tests/ntpd/ntp_prio_q.c vendor/ntp/dist/tests/ntpd/ntp_restrict.c vendor/ntp/dist/tests/ntpd/rc_cmdlength.c vendor/ntp/dist/tests/ntpd/run-leapsec.c vendor/ntp/dist/tests/ntpd/run-ntp_prio_q.c vendor/ntp/dist/tests/ntpd/run-ntp_restrict.c vendor/ntp/dist/tests/ntpd/run-rc_cmdlength.c vendor/ntp/dist/tests/ntpd/run-t-ntp_scanner.c vendor/ntp/dist/tests/ntpd/run-t-ntp_signd.c vendor/ntp/dist/tests/ntpd/t-ntp_scanner.c vendor/ntp/dist/tests/ntpq/Makefile.am vendor/ntp/dist/tests/ntpq/Makefile.in vendor/ntp/dist/tests/ntpq/run-t-ntpq.c vendor/ntp/dist/tests/sandbox/Makefile.am vendor/ntp/dist/tests/sandbox/Makefile.in vendor/ntp/dist/tests/sandbox/run-modetoa.c vendor/ntp/dist/tests/sandbox/run-uglydate.c vendor/ntp/dist/tests/sandbox/run-ut-2803.c vendor/ntp/dist/tests/sec-2853/Makefile.am vendor/ntp/dist/tests/sec-2853/Makefile.in vendor/ntp/dist/tests/sec-2853/run-sec-2853.c vendor/ntp/dist/util/Makefile.in vendor/ntp/dist/util/invoke-ntp-keygen.texi vendor/ntp/dist/util/ntp-keygen-opts.c vendor/ntp/dist/util/ntp-keygen-opts.def vendor/ntp/dist/util/ntp-keygen-opts.h vendor/ntp/dist/util/ntp-keygen.1ntp-keygenman vendor/ntp/dist/util/ntp-keygen.1ntp-keygenmdoc vendor/ntp/dist/util/ntp-keygen.html vendor/ntp/dist/util/ntp-keygen.man.in vendor/ntp/dist/util/ntp-keygen.mdoc.in Modified: vendor/ntp/dist/ChangeLog ============================================================================== --- vendor/ntp/dist/ChangeLog Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/ChangeLog Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/Makefile.am ============================================================================== --- vendor/ntp/dist/Makefile.am Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/Makefile.am Wed Feb 28 06:23:12 2018 (r330102) @@ -5,10 +5,10 @@ NULL = # moved sntp first to get libtool and libevent built. SUBDIRS = \ - sntp \ scripts \ include \ libntp \ + sntp \ libparse \ ntpd \ ntpdate \ Modified: vendor/ntp/dist/Makefile.in ============================================================================== --- vendor/ntp/dist/Makefile.in Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/Makefile.in Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/NEWS ============================================================================== --- vendor/ntp/dist/NEWS Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/NEWS Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/aclocal.m4 ============================================================================== --- vendor/ntp/dist/aclocal.m4 Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/aclocal.m4 Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/adjtimed/Makefile.in ============================================================================== --- vendor/ntp/dist/adjtimed/Makefile.in Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/adjtimed/Makefile.in Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/clockstuff/Makefile.in ============================================================================== --- vendor/ntp/dist/clockstuff/Makefile.in Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/clockstuff/Makefile.in Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/configure ============================================================================== --- vendor/ntp/dist/configure Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/configure Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/configure.ac ============================================================================== --- vendor/ntp/dist/configure.ac Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/configure.ac Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/html/access.html ============================================================================== --- vendor/ntp/dist/html/access.html Wed Feb 28 05:11:10 2018 (r330101) +++ vendor/ntp/dist/html/access.html Wed Feb 28 06:23:12 2018 (r330102) @@ -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: vendor/ntp/dist/html/accopt.html
==============================================================================
--- vendor/ntp/dist/html/accopt.html	Wed Feb 28 05:11:10 2018	(r330101)
+++ vendor/ntp/dist/html/accopt.html	Wed Feb 28 06:23:12 2018	(r330102)
@@ -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-all@freebsd.org Wed Feb 28 06:23:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60ADDF2D0C9; Wed, 28 Feb 2018 06:23: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 13FAE87344; Wed, 28 Feb 2018 06:23: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 E93C815D27; Wed, 28 Feb 2018 06:23:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S6Nv7q003032; Wed, 28 Feb 2018 06:23:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S6NvgJ003031; Wed, 28 Feb 2018 06:23:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201802280623.w1S6NvgJ003031@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 06:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r330103 - vendor/ntp/4.2.8p11 X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/ntp/4.2.8p11 X-SVN-Commit-Revision: 330103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 06:23:58 -0000 Author: delphij Date: Wed Feb 28 06:23:57 2018 New Revision: 330103 URL: https://svnweb.freebsd.org/changeset/base/330103 Log: Tag ntp 4.2.8p11. Added: vendor/ntp/4.2.8p11/ - copied from r330102, vendor/ntp/dist/ From owner-svn-src-all@freebsd.org Wed Feb 28 07:59:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 08:53:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 09:01:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1851F35AD3; Wed, 28 Feb 2018 09:01:06 +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 2EDD96CB9D; Wed, 28 Feb 2018 09:01:06 +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 2982D17670; Wed, 28 Feb 2018 09:01:06 +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 w1S916cj081218; Wed, 28 Feb 2018 09:01:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S914Vp080488; Wed, 28 Feb 2018 09:01:04 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201802280901.w1S914Vp080488@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 09:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330106 - in stable/11: 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 ... X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: 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 co... X-SVN-Commit-Revision: 330106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 09:01:08 -0000 Author: delphij Date: Wed Feb 28 09:01:03 2018 New Revision: 330106 URL: https://svnweb.freebsd.org/changeset/base/330106 Log: MFC r330104: MFV r330102: ntp 4.2.8p11 Added: stable/11/contrib/ntp/sntp/m4/ntp_af_unspec.m4 - copied unchanged from r330104, head/contrib/ntp/sntp/m4/ntp_af_unspec.m4 stable/11/contrib/ntp/sntp/tests/testconf.yml - copied unchanged from r330104, head/contrib/ntp/sntp/tests/testconf.yml Modified: stable/11/contrib/ntp/ChangeLog stable/11/contrib/ntp/Makefile.am stable/11/contrib/ntp/Makefile.in stable/11/contrib/ntp/NEWS stable/11/contrib/ntp/aclocal.m4 stable/11/contrib/ntp/adjtimed/Makefile.in stable/11/contrib/ntp/clockstuff/Makefile.in stable/11/contrib/ntp/configure stable/11/contrib/ntp/configure.ac stable/11/contrib/ntp/html/access.html stable/11/contrib/ntp/html/accopt.html stable/11/contrib/ntp/html/authentic.html stable/11/contrib/ntp/html/drivers/driver18.html stable/11/contrib/ntp/html/drivers/driver40-ja.html stable/11/contrib/ntp/html/drivers/driver40.html stable/11/contrib/ntp/html/keygen.html stable/11/contrib/ntp/html/miscopt.html stable/11/contrib/ntp/html/monopt.html stable/11/contrib/ntp/html/ntpq.html stable/11/contrib/ntp/include/Makefile.in stable/11/contrib/ntp/include/isc/Makefile.in stable/11/contrib/ntp/include/ntp.h stable/11/contrib/ntp/include/ntp_calendar.h stable/11/contrib/ntp/include/ntp_config.h stable/11/contrib/ntp/include/ntp_fp.h stable/11/contrib/ntp/include/ntp_keyacc.h stable/11/contrib/ntp/include/ntp_request.h stable/11/contrib/ntp/include/ntp_stdlib.h stable/11/contrib/ntp/include/ntpd.h stable/11/contrib/ntp/include/recvbuff.h stable/11/contrib/ntp/include/ssl_applink.c stable/11/contrib/ntp/kernel/Makefile.in stable/11/contrib/ntp/kernel/sys/Makefile.in stable/11/contrib/ntp/libntp/Makefile.in stable/11/contrib/ntp/libntp/a_md5encrypt.c stable/11/contrib/ntp/libntp/adjtime.c stable/11/contrib/ntp/libntp/authkeys.c stable/11/contrib/ntp/libntp/authreadkeys.c stable/11/contrib/ntp/libntp/libssl_compat.c stable/11/contrib/ntp/libntp/ntp_calendar.c stable/11/contrib/ntp/libntp/ssl_init.c stable/11/contrib/ntp/libntp/statestr.c stable/11/contrib/ntp/libntp/systime.c stable/11/contrib/ntp/libntp/work_thread.c stable/11/contrib/ntp/libparse/Makefile.in stable/11/contrib/ntp/ntpd/Makefile.in stable/11/contrib/ntp/ntpd/complete.conf.in stable/11/contrib/ntp/ntpd/invoke-ntp.conf.texi stable/11/contrib/ntp/ntpd/invoke-ntp.keys.texi stable/11/contrib/ntp/ntpd/invoke-ntpd.texi stable/11/contrib/ntp/ntpd/keyword-gen-utd stable/11/contrib/ntp/ntpd/keyword-gen.c stable/11/contrib/ntp/ntpd/ntp.conf.5man stable/11/contrib/ntp/ntpd/ntp.conf.5mdoc stable/11/contrib/ntp/ntpd/ntp.conf.def stable/11/contrib/ntp/ntpd/ntp.conf.html stable/11/contrib/ntp/ntpd/ntp.conf.man.in stable/11/contrib/ntp/ntpd/ntp.conf.mdoc.in stable/11/contrib/ntp/ntpd/ntp.keys.5man stable/11/contrib/ntp/ntpd/ntp.keys.5mdoc stable/11/contrib/ntp/ntpd/ntp.keys.def stable/11/contrib/ntp/ntpd/ntp.keys.html stable/11/contrib/ntp/ntpd/ntp.keys.man.in stable/11/contrib/ntp/ntpd/ntp.keys.mdoc.in stable/11/contrib/ntp/ntpd/ntp_config.c stable/11/contrib/ntp/ntpd/ntp_control.c stable/11/contrib/ntp/ntpd/ntp_crypto.c stable/11/contrib/ntp/ntpd/ntp_io.c stable/11/contrib/ntp/ntpd/ntp_keyword.h stable/11/contrib/ntp/ntpd/ntp_leapsec.c stable/11/contrib/ntp/ntpd/ntp_parser.c stable/11/contrib/ntp/ntpd/ntp_parser.h stable/11/contrib/ntp/ntpd/ntp_peer.c stable/11/contrib/ntp/ntpd/ntp_proto.c stable/11/contrib/ntp/ntpd/ntp_refclock.c stable/11/contrib/ntp/ntpd/ntp_request.c stable/11/contrib/ntp/ntpd/ntp_restrict.c stable/11/contrib/ntp/ntpd/ntp_scanner.c stable/11/contrib/ntp/ntpd/ntp_util.c stable/11/contrib/ntp/ntpd/ntpd-opts.c stable/11/contrib/ntp/ntpd/ntpd-opts.h stable/11/contrib/ntp/ntpd/ntpd.1ntpdman stable/11/contrib/ntp/ntpd/ntpd.1ntpdmdoc stable/11/contrib/ntp/ntpd/ntpd.c stable/11/contrib/ntp/ntpd/ntpd.html stable/11/contrib/ntp/ntpd/ntpd.man.in stable/11/contrib/ntp/ntpd/ntpd.mdoc.in stable/11/contrib/ntp/ntpd/ntpsim.c stable/11/contrib/ntp/ntpd/refclock_gpsdjson.c stable/11/contrib/ntp/ntpd/refclock_jjy.c stable/11/contrib/ntp/ntpd/refclock_palisade.c stable/11/contrib/ntp/ntpd/refclock_parse.c stable/11/contrib/ntp/ntpdate/Makefile.in stable/11/contrib/ntp/ntpdc/Makefile.in stable/11/contrib/ntp/ntpdc/invoke-ntpdc.texi stable/11/contrib/ntp/ntpdc/layout.std stable/11/contrib/ntp/ntpdc/ntpdc-opts.c stable/11/contrib/ntp/ntpdc/ntpdc-opts.h stable/11/contrib/ntp/ntpdc/ntpdc.1ntpdcman stable/11/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc stable/11/contrib/ntp/ntpdc/ntpdc.c stable/11/contrib/ntp/ntpdc/ntpdc.html stable/11/contrib/ntp/ntpdc/ntpdc.man.in stable/11/contrib/ntp/ntpdc/ntpdc.mdoc.in stable/11/contrib/ntp/ntpdc/ntpdc_ops.c stable/11/contrib/ntp/ntpq/Makefile.am stable/11/contrib/ntp/ntpq/Makefile.in stable/11/contrib/ntp/ntpq/invoke-ntpq.texi stable/11/contrib/ntp/ntpq/ntpq-opts.c stable/11/contrib/ntp/ntpq/ntpq-opts.def stable/11/contrib/ntp/ntpq/ntpq-opts.h stable/11/contrib/ntp/ntpq/ntpq-subs.c stable/11/contrib/ntp/ntpq/ntpq.1ntpqman stable/11/contrib/ntp/ntpq/ntpq.1ntpqmdoc stable/11/contrib/ntp/ntpq/ntpq.c stable/11/contrib/ntp/ntpq/ntpq.html stable/11/contrib/ntp/ntpq/ntpq.man.in stable/11/contrib/ntp/ntpq/ntpq.mdoc.in stable/11/contrib/ntp/ntpq/ntpq.texi stable/11/contrib/ntp/ntpsnmpd/Makefile.in stable/11/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi stable/11/contrib/ntp/ntpsnmpd/netsnmp_daemonize.c stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.html stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in stable/11/contrib/ntp/packageinfo.sh stable/11/contrib/ntp/parseutil/Makefile.in stable/11/contrib/ntp/scripts/Makefile.in stable/11/contrib/ntp/scripts/build/Makefile.in stable/11/contrib/ntp/scripts/build/UpdatePoint stable/11/contrib/ntp/scripts/calc_tickadj/Makefile.in stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in stable/11/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi stable/11/contrib/ntp/scripts/invoke-plot_summary.texi stable/11/contrib/ntp/scripts/invoke-summary.texi stable/11/contrib/ntp/scripts/lib/Makefile.in stable/11/contrib/ntp/scripts/ntp-wait/Makefile.in stable/11/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait-opts stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.html stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in stable/11/contrib/ntp/scripts/ntpsweep/Makefile.in stable/11/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep-opts stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.html stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in stable/11/contrib/ntp/scripts/ntptrace/Makefile.in stable/11/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi stable/11/contrib/ntp/scripts/ntptrace/ntptrace-opts stable/11/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman stable/11/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc stable/11/contrib/ntp/scripts/ntptrace/ntptrace.html stable/11/contrib/ntp/scripts/ntptrace/ntptrace.man.in stable/11/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in stable/11/contrib/ntp/scripts/plot_summary-opts stable/11/contrib/ntp/scripts/plot_summary.1plot_summaryman stable/11/contrib/ntp/scripts/plot_summary.1plot_summarymdoc stable/11/contrib/ntp/scripts/plot_summary.html stable/11/contrib/ntp/scripts/plot_summary.man.in stable/11/contrib/ntp/scripts/plot_summary.mdoc.in stable/11/contrib/ntp/scripts/summary-opts stable/11/contrib/ntp/scripts/summary.1summaryman stable/11/contrib/ntp/scripts/summary.1summarymdoc stable/11/contrib/ntp/scripts/summary.html stable/11/contrib/ntp/scripts/summary.man.in stable/11/contrib/ntp/scripts/summary.mdoc.in stable/11/contrib/ntp/scripts/update-leap/Makefile.in stable/11/contrib/ntp/scripts/update-leap/invoke-update-leap.texi stable/11/contrib/ntp/scripts/update-leap/update-leap-opts stable/11/contrib/ntp/scripts/update-leap/update-leap.1update-leapman stable/11/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc stable/11/contrib/ntp/scripts/update-leap/update-leap.html stable/11/contrib/ntp/scripts/update-leap/update-leap.in stable/11/contrib/ntp/scripts/update-leap/update-leap.man.in stable/11/contrib/ntp/scripts/update-leap/update-leap.mdoc.in stable/11/contrib/ntp/sntp/Makefile.in stable/11/contrib/ntp/sntp/check-libntp.mf stable/11/contrib/ntp/sntp/configure stable/11/contrib/ntp/sntp/crypto.c stable/11/contrib/ntp/sntp/crypto.h stable/11/contrib/ntp/sntp/harden/linux stable/11/contrib/ntp/sntp/include/version.def stable/11/contrib/ntp/sntp/include/version.texi stable/11/contrib/ntp/sntp/invoke-sntp.texi stable/11/contrib/ntp/sntp/m4/ntp_harden.m4 stable/11/contrib/ntp/sntp/m4/ntp_libevent.m4 stable/11/contrib/ntp/sntp/m4/ntp_openssl.m4 stable/11/contrib/ntp/sntp/m4/version.m4 stable/11/contrib/ntp/sntp/main.c stable/11/contrib/ntp/sntp/networking.c stable/11/contrib/ntp/sntp/sntp-opts.c stable/11/contrib/ntp/sntp/sntp-opts.def stable/11/contrib/ntp/sntp/sntp-opts.h stable/11/contrib/ntp/sntp/sntp.1sntpman stable/11/contrib/ntp/sntp/sntp.1sntpmdoc stable/11/contrib/ntp/sntp/sntp.html stable/11/contrib/ntp/sntp/sntp.man.in stable/11/contrib/ntp/sntp/sntp.mdoc.in stable/11/contrib/ntp/sntp/tests/Makefile.am stable/11/contrib/ntp/sntp/tests/Makefile.in stable/11/contrib/ntp/sntp/tests/crypto.c stable/11/contrib/ntp/sntp/tests/keyFile.c stable/11/contrib/ntp/sntp/tests/packetHandling.c stable/11/contrib/ntp/sntp/tests/packetProcessing.c stable/11/contrib/ntp/sntp/tests/run-crypto.c stable/11/contrib/ntp/sntp/tests/run-keyFile.c stable/11/contrib/ntp/sntp/tests/run-kodDatabase.c stable/11/contrib/ntp/sntp/tests/run-kodFile.c stable/11/contrib/ntp/sntp/tests/run-networking.c stable/11/contrib/ntp/sntp/tests/run-packetHandling.c stable/11/contrib/ntp/sntp/tests/run-packetProcessing.c stable/11/contrib/ntp/sntp/tests/run-t-log.c stable/11/contrib/ntp/sntp/tests/run-utilities.c stable/11/contrib/ntp/sntp/unity/auto/generate_test_runner.rb stable/11/contrib/ntp/sntp/utilities.c stable/11/contrib/ntp/sntp/version.c stable/11/contrib/ntp/util/Makefile.in stable/11/contrib/ntp/util/invoke-ntp-keygen.texi stable/11/contrib/ntp/util/ntp-keygen-opts.c stable/11/contrib/ntp/util/ntp-keygen-opts.def stable/11/contrib/ntp/util/ntp-keygen-opts.h stable/11/contrib/ntp/util/ntp-keygen.1ntp-keygenman stable/11/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc stable/11/contrib/ntp/util/ntp-keygen.html stable/11/contrib/ntp/util/ntp-keygen.man.in stable/11/contrib/ntp/util/ntp-keygen.mdoc.in stable/11/usr.sbin/ntp/config.h stable/11/usr.sbin/ntp/doc/ntp-keygen.8 stable/11/usr.sbin/ntp/doc/ntp.conf.5 stable/11/usr.sbin/ntp/doc/ntp.keys.5 stable/11/usr.sbin/ntp/doc/ntpd.8 stable/11/usr.sbin/ntp/doc/ntpdc.8 stable/11/usr.sbin/ntp/doc/ntpq.8 stable/11/usr.sbin/ntp/doc/sntp.8 stable/11/usr.sbin/ntp/ntp-keygen/Makefile stable/11/usr.sbin/ntp/ntptime/Makefile stable/11/usr.sbin/ntp/scripts/mkver Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ntp/ChangeLog ============================================================================== --- stable/11/contrib/ntp/ChangeLog Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/ChangeLog Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/Makefile.am ============================================================================== --- stable/11/contrib/ntp/Makefile.am Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/Makefile.am Wed Feb 28 09:01:03 2018 (r330106) @@ -5,10 +5,10 @@ NULL = # moved sntp first to get libtool and libevent built. SUBDIRS = \ - sntp \ scripts \ include \ libntp \ + sntp \ libparse \ ntpd \ ntpdate \ Modified: stable/11/contrib/ntp/Makefile.in ============================================================================== --- stable/11/contrib/ntp/Makefile.in Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/Makefile.in Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/NEWS ============================================================================== --- stable/11/contrib/ntp/NEWS Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/NEWS Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/aclocal.m4 ============================================================================== --- stable/11/contrib/ntp/aclocal.m4 Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/aclocal.m4 Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/adjtimed/Makefile.in ============================================================================== --- stable/11/contrib/ntp/adjtimed/Makefile.in Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/adjtimed/Makefile.in Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/clockstuff/Makefile.in ============================================================================== --- stable/11/contrib/ntp/clockstuff/Makefile.in Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/clockstuff/Makefile.in Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/configure ============================================================================== --- stable/11/contrib/ntp/configure Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/configure Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/configure.ac ============================================================================== --- stable/11/contrib/ntp/configure.ac Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/configure.ac Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/html/access.html ============================================================================== --- stable/11/contrib/ntp/html/access.html Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/html/access.html Wed Feb 28 09:01:03 2018 (r330106) @@ -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: stable/11/contrib/ntp/html/accopt.html
==============================================================================
--- stable/11/contrib/ntp/html/accopt.html	Wed Feb 28 08:53:07 2018	(r330105)
+++ stable/11/contrib/ntp/html/accopt.html	Wed Feb 28 09:01:03 2018	(r330106)
@@ -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-all@freebsd.org Wed Feb 28 09:59:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5417F399F4; Wed, 28 Feb 2018 09:59:45 +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 756BD6EE6B; Wed, 28 Feb 2018 09:59:45 +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 703E217F2D; Wed, 28 Feb 2018 09:59:45 +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 w1S9xjh1009534; Wed, 28 Feb 2018 09:59:45 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S9xikg009529; Wed, 28 Feb 2018 09:59:44 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802280959.w1S9xikg009529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 28 Feb 2018 09:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330107 - in stable/11: share/man/man4 sys/conf sys/dev/jedec_dimm sys/modules/i2c sys/modules/i2c/jedec_dimm X-SVN-Group: stable-11 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/conf sys/dev/jedec_dimm sys/modules/i2c sys/modules/i2c/jedec_dimm X-SVN-Commit-Revision: 330107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 09:59:46 -0000 Author: rpokala Date: Wed Feb 28 09:59:44 2018 New Revision: 330107 URL: https://svnweb.freebsd.org/changeset/base/330107 Log: MFC r329843: jedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMs A super-set of the functionality of jedec_ts(4). jedec_dimm(4) reports asset information (Part Number, Serial Number) encoded in the "Serial Presence Detect" (SPD) data on JEDEC DDR3 and DDR4 DIMMs. It also calculates and reports the memory capacity of the DIMM, in megabytes. If the DIMM includes a "Thermal Sensor On DIMM" (TSOD), the temperature is also reported. Added: stable/11/share/man/man4/jedec_dimm.4 - copied unchanged from r329843, head/share/man/man4/jedec_dimm.4 stable/11/sys/dev/jedec_dimm/ - copied from r329843, head/sys/dev/jedec_dimm/ stable/11/sys/modules/i2c/jedec_dimm/ - copied from r329843, head/sys/modules/i2c/jedec_dimm/ Modified: stable/11/share/man/man4/Makefile stable/11/sys/conf/NOTES stable/11/sys/conf/files stable/11/sys/modules/i2c/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Wed Feb 28 09:01:03 2018 (r330106) +++ stable/11/share/man/man4/Makefile Wed Feb 28 09:59:44 2018 (r330107) @@ -245,6 +245,7 @@ MAN= aac.4 \ ixgbe.4 \ ixl.4 \ ixlv.4 \ + jedec_dimm.4 \ jedec_ts.4 \ jme.4 \ joy.4 \ Copied: stable/11/share/man/man4/jedec_dimm.4 (from r329843, head/share/man/man4/jedec_dimm.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/jedec_dimm.4 Wed Feb 28 09:59:44 2018 (r330107, copy of r329843, head/share/man/man4/jedec_dimm.4) @@ -0,0 +1,240 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2016 Andriy Gapon +.\" Copyright (c) 2018 Ravi Pokala +.\" 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 February 22, 2018 +.Dt JEDEC_DIMM 4 +.Os +.Sh NAME +.Nm jedec_dimm +.Nd report asset information and temperatures for JEDEC DDR3 / DDR4 DIMMs +.Sh SYNOPSIS +.Bd -ragged -offset indent +.Cd "device jedec_dimm" +.Cd "device smbus" +.Ed +.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 +jedec_dimm_load="YES" +.Ed +.Pp +Addressing information must be manually specified in +.Pa /boot/device.hints : +.Bd -literal -offset indent +.Cd hint.jedec_dimm.0.at="smbus0" +.Cd hint.jedec_dimm.0.addr="0xa0" +.Cd hint.jedec_dimm.0.slotid="Silkscreen" +.Ed +.Sh DESCRIPTION +The +.Nm +driver reports asset information (Part Number, Serial Number) encoded in the +.Dq Serial Presence Detect +(SPD) data on JEDEC DDR3 and DDR4 DIMMs. +It also calculates and reports the memory capacity of the DIMM, in megabytes. +If the DIMM includes a +.Dq Thermal Sensor On DIMM +(TSOD), the temperature is also reported. +.Pp +The +.Nm +driver accesses the SPD and TSOD over the +.Xr smbus 4 . +.Pp +The data is reported via a +.Xr sysctl 8 +interface; all values are read-only: +.Bl -tag -width "dev.jedec_dimm.X.capacity" +.It Va dev.jedec_dimm.X.%desc +a string description of the DIMM, including TSOD and slotid info if present. +.It Va dev.jedec_dimm.X.capacity +the DIMM's memory capacity, in megabytes +.It Va dev.jedec_dimm.X.part +the manufacturer's part number of the DIMM +.It Va dev.jedec_dimm.X.serial +the manufacturer's serial number of the DIMM +.It Va dev.jedec_dimm.X.slotid +a copy of the corresponding hint, if set +.It Va dev.jedec_dimm.X.temp +if a TSOD is present, the reported temperature +.It Va dev.jedec_dimm.X.type +the DIMM type (DDR3 or DDR4) +.El +.Pp +These values are configurable for +.Nm +via +.Xr device.hints 5 : +.Bl -tag -width "hint.jedec_dimm.X.slotid" +.It Va hint.jedec_dimm.X.at +the +.Xr smbus 4 +to which the DIMM is connected +.It Va hint.jedec_dimm.X.addr +the SMBus address of the SPD. +JEDEC specifies that the four most-significant bits of the address are the +.Dq Device Type Identifier +(DTI), and that the DTI of the SPD is 0xa. +Since the least-significant bit of an SMBus address is the read/write bit, and +is always written as 0, that means the four least-significant bits of the +address must be even. +.It Va hint.jedec_dimm.X.slotid +optional slot identifier. +If populated with the DIMM slot name silkscreened on the motherboard, this +provides a mapping between the DIMM slot name and the DIMM serial number. +That mapping is useful for detailed asset tracking, and makes it easier to +physically locate a specific DIMM when doing a replacement. +This is useful when assembling multiple identical systems, as might be done by +a system vendor. +The mapping between bus/address and DIMM slot must first be determined, either +through motherboard documentation or trial-and-error. +.El +.Pp +If the DIMMs are on an I2C bus behind an +.Xr iicbus 4 +controller, then the +.Xr iicsmb 4 +bridge driver can be used to attach the +.Xr smbus 4 . +.Sh EXAMPLES +Consider two DDR4 DIMMs with the following hints: +.Bd -literal -offset indent +hint.jedec_dimm.0.at="smbus0" +hint.jedec_dimm.0.addr="0xa0" +hint.jedec_dimm.0.slotid="A1" + +hint.jedec_dimm.6.at="smbus1" +hint.jedec_dimm.6.addr="0xa8" +.Ed +.Pp +Their +.Xr sysctl 8 +output (sorted): +.Bd -literal -offset indent +dev.jedec_dimm.0.%desc: DDR4 DIMM w/ Atmel TSOD (A1) +dev.jedec_dimm.0.%driver: jedec_dimm +dev.jedec_dimm.0.%location: addr=0xa0 +dev.jedec_dimm.0.%parent: smbus0 +dev.jedec_dimm.0.%pnpinfo: +dev.jedec_dimm.0.capacity: 16384 +dev.jedec_dimm.0.part: 36ASF2G72PZ-2G1A2 +dev.jedec_dimm.0.serial: 0ea815de +dev.jedec_dimm.0.slotid: A1 +dev.jedec_dimm.0.temp: 32.7C +dev.jedec_dimm.0.type: DDR4 + +dev.jedec_dimm.6.%desc: DDR4 DIMM w/ TSE2004av compliant TSOD +dev.jedec_dimm.6.%driver: jedec_dimm +dev.jedec_dimm.6.%location: addr=0xa8 +dev.jedec_dimm.6.%parent: smbus1 +dev.jedec_dimm.6.%pnpinfo: +dev.jedec_dimm.6.capacity: 8192 +dev.jedec_dimm.6.part: VRA9MR8B2H1603 +dev.jedec_dimm.6.serial: 0c4c46ad +dev.jedec_dimm.6.temp: 43.1C +dev.jedec_dimm.6.type: DDR4 +.Ed +.Sh COMPATIBILITY +Hints for +.Xr jedec_ts 4 +can be mechanically converted for use with +.Nm . +Two changes are required: +.Bl -enum +.It +In all +.Xr jedec_ts 4 +hints, replace +.Dq jedec_ts +with +.Dq jedec_dimm +.It +In +.Xr jedec_ts 4 +.Dq addr +hints, replace the TSOD DTI +.Dq 0x3 +with the SPD DTI +.Dq 0xa +.El +.Pp +The following +.Xr sed 1 +script will perform the necessary changes: +.Bd -literal -offset indent +sed -i ".old" -e 's/jedec_ts/jedec_dimm/' \\ + -e '/jedec_dimm/s/addr="0x3/addr="0xa/' /boot/device.hints +.Ed +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr iicsmb 4 , +.Xr jedec_ts 4 , +.Xr smbus 4 , +.Xr sysctl 8 +.Sh STANDARDS +.Rs +(DDR3 SPD) +.%A JEDEC +.%T Standard 21-C, Annex K +.Re +.Pp +.Rs +(DDR3 TSOD) +.%A JEDEC +.%T Standard 21-C, TSE2002av +.Re +.Pp +.Rs +(DDR4 SPD) +.%A JEDEC +.%T Standard 21-C, Annex L +.Re +.Pp +.Rs +(DDR4 TSOD) +.%A JEDEC +.%T Standard 21-C, TSE2004av +.Re +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page were written by +.An Ravi Pokala Aq Mt rpokala@freebsd.org . +They are both based in part on the +.Xr jedec_ts 4 +driver and manual page, written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Wed Feb 28 09:01:03 2018 (r330106) +++ stable/11/sys/conf/NOTES Wed Feb 28 09:59:44 2018 (r330107) @@ -2541,8 +2541,10 @@ device smb # SMBus peripheral devices # +# jedec_dimm Asset and temperature reporting for DDR3 and DDR4 DIMMs # jedec_ts Temperature Sensor compliant with JEDEC Standard 21-C # +device jedec_dimm device jedec_ts # I2C Bus Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Feb 28 09:01:03 2018 (r330106) +++ stable/11/sys/conf/files Wed Feb 28 09:59:44 2018 (r330107) @@ -2161,6 +2161,7 @@ dev/ixgbe/ixgbe_dcb_82598.c optional ix inet | ixv ine compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_dcb_82599.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/jedec_dimm/jedec_dimm.c optional jedec_dimm smbus dev/jedec_ts/jedec_ts.c optional jedec_ts smbus dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy Modified: stable/11/sys/modules/i2c/Makefile ============================================================================== --- stable/11/sys/modules/i2c/Makefile Wed Feb 28 09:01:03 2018 (r330106) +++ stable/11/sys/modules/i2c/Makefile Wed Feb 28 09:59:44 2018 (r330107) @@ -14,6 +14,7 @@ SUBDIR = \ iicsmb \ isl \ isl12xx \ + jedec_dimm \ jedec_ts \ nxprtc \ s35390a \ From owner-svn-src-all@freebsd.org Wed Feb 28 09:59:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 10:00:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0778CF39A9E; Wed, 28 Feb 2018 10:00:05 +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 2B24D6F007; Wed, 28 Feb 2018 10:00:04 +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 3AA6517F32; Wed, 28 Feb 2018 10:00:03 +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 w1SA025U009696; Wed, 28 Feb 2018 10:00:02 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SA02hP009691; Wed, 28 Feb 2018 10:00:02 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802281000.w1SA02hP009691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 28 Feb 2018 10:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330109 - in stable/10: share/man/man4 sys/conf sys/dev/jedec_dimm sys/modules/i2c sys/modules/i2c/jedec_dimm X-SVN-Group: stable-10 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in stable/10: share/man/man4 sys/conf sys/dev/jedec_dimm sys/modules/i2c sys/modules/i2c/jedec_dimm X-SVN-Commit-Revision: 330109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 10:00:05 -0000 Author: rpokala Date: Wed Feb 28 10:00:02 2018 New Revision: 330109 URL: https://svnweb.freebsd.org/changeset/base/330109 Log: MFC r329843: jedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMs A super-set of the functionality of jedec_ts(4). jedec_dimm(4) reports asset information (Part Number, Serial Number) encoded in the "Serial Presence Detect" (SPD) data on JEDEC DDR3 and DDR4 DIMMs. It also calculates and reports the memory capacity of the DIMM, in megabytes. If the DIMM includes a "Thermal Sensor On DIMM" (TSOD), the temperature is also reported. Added: stable/10/share/man/man4/jedec_dimm.4 - copied unchanged from r329843, head/share/man/man4/jedec_dimm.4 stable/10/sys/dev/jedec_dimm/ - copied from r329843, head/sys/dev/jedec_dimm/ stable/10/sys/modules/i2c/jedec_dimm/ - copied from r329843, head/sys/modules/i2c/jedec_dimm/ Modified: stable/10/share/man/man4/Makefile stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/modules/i2c/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Wed Feb 28 09:59:58 2018 (r330108) +++ stable/10/share/man/man4/Makefile Wed Feb 28 10:00:02 2018 (r330109) @@ -222,6 +222,7 @@ MAN= aac.4 \ ixgbe.4 \ ixl.4 \ ixlv.4 \ + jedec_dimm.4 \ jedec_ts.4 \ jme.4 \ joy.4 \ Copied: stable/10/share/man/man4/jedec_dimm.4 (from r329843, head/share/man/man4/jedec_dimm.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/jedec_dimm.4 Wed Feb 28 10:00:02 2018 (r330109, copy of r329843, head/share/man/man4/jedec_dimm.4) @@ -0,0 +1,240 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2016 Andriy Gapon +.\" Copyright (c) 2018 Ravi Pokala +.\" 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 February 22, 2018 +.Dt JEDEC_DIMM 4 +.Os +.Sh NAME +.Nm jedec_dimm +.Nd report asset information and temperatures for JEDEC DDR3 / DDR4 DIMMs +.Sh SYNOPSIS +.Bd -ragged -offset indent +.Cd "device jedec_dimm" +.Cd "device smbus" +.Ed +.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 +jedec_dimm_load="YES" +.Ed +.Pp +Addressing information must be manually specified in +.Pa /boot/device.hints : +.Bd -literal -offset indent +.Cd hint.jedec_dimm.0.at="smbus0" +.Cd hint.jedec_dimm.0.addr="0xa0" +.Cd hint.jedec_dimm.0.slotid="Silkscreen" +.Ed +.Sh DESCRIPTION +The +.Nm +driver reports asset information (Part Number, Serial Number) encoded in the +.Dq Serial Presence Detect +(SPD) data on JEDEC DDR3 and DDR4 DIMMs. +It also calculates and reports the memory capacity of the DIMM, in megabytes. +If the DIMM includes a +.Dq Thermal Sensor On DIMM +(TSOD), the temperature is also reported. +.Pp +The +.Nm +driver accesses the SPD and TSOD over the +.Xr smbus 4 . +.Pp +The data is reported via a +.Xr sysctl 8 +interface; all values are read-only: +.Bl -tag -width "dev.jedec_dimm.X.capacity" +.It Va dev.jedec_dimm.X.%desc +a string description of the DIMM, including TSOD and slotid info if present. +.It Va dev.jedec_dimm.X.capacity +the DIMM's memory capacity, in megabytes +.It Va dev.jedec_dimm.X.part +the manufacturer's part number of the DIMM +.It Va dev.jedec_dimm.X.serial +the manufacturer's serial number of the DIMM +.It Va dev.jedec_dimm.X.slotid +a copy of the corresponding hint, if set +.It Va dev.jedec_dimm.X.temp +if a TSOD is present, the reported temperature +.It Va dev.jedec_dimm.X.type +the DIMM type (DDR3 or DDR4) +.El +.Pp +These values are configurable for +.Nm +via +.Xr device.hints 5 : +.Bl -tag -width "hint.jedec_dimm.X.slotid" +.It Va hint.jedec_dimm.X.at +the +.Xr smbus 4 +to which the DIMM is connected +.It Va hint.jedec_dimm.X.addr +the SMBus address of the SPD. +JEDEC specifies that the four most-significant bits of the address are the +.Dq Device Type Identifier +(DTI), and that the DTI of the SPD is 0xa. +Since the least-significant bit of an SMBus address is the read/write bit, and +is always written as 0, that means the four least-significant bits of the +address must be even. +.It Va hint.jedec_dimm.X.slotid +optional slot identifier. +If populated with the DIMM slot name silkscreened on the motherboard, this +provides a mapping between the DIMM slot name and the DIMM serial number. +That mapping is useful for detailed asset tracking, and makes it easier to +physically locate a specific DIMM when doing a replacement. +This is useful when assembling multiple identical systems, as might be done by +a system vendor. +The mapping between bus/address and DIMM slot must first be determined, either +through motherboard documentation or trial-and-error. +.El +.Pp +If the DIMMs are on an I2C bus behind an +.Xr iicbus 4 +controller, then the +.Xr iicsmb 4 +bridge driver can be used to attach the +.Xr smbus 4 . +.Sh EXAMPLES +Consider two DDR4 DIMMs with the following hints: +.Bd -literal -offset indent +hint.jedec_dimm.0.at="smbus0" +hint.jedec_dimm.0.addr="0xa0" +hint.jedec_dimm.0.slotid="A1" + +hint.jedec_dimm.6.at="smbus1" +hint.jedec_dimm.6.addr="0xa8" +.Ed +.Pp +Their +.Xr sysctl 8 +output (sorted): +.Bd -literal -offset indent +dev.jedec_dimm.0.%desc: DDR4 DIMM w/ Atmel TSOD (A1) +dev.jedec_dimm.0.%driver: jedec_dimm +dev.jedec_dimm.0.%location: addr=0xa0 +dev.jedec_dimm.0.%parent: smbus0 +dev.jedec_dimm.0.%pnpinfo: +dev.jedec_dimm.0.capacity: 16384 +dev.jedec_dimm.0.part: 36ASF2G72PZ-2G1A2 +dev.jedec_dimm.0.serial: 0ea815de +dev.jedec_dimm.0.slotid: A1 +dev.jedec_dimm.0.temp: 32.7C +dev.jedec_dimm.0.type: DDR4 + +dev.jedec_dimm.6.%desc: DDR4 DIMM w/ TSE2004av compliant TSOD +dev.jedec_dimm.6.%driver: jedec_dimm +dev.jedec_dimm.6.%location: addr=0xa8 +dev.jedec_dimm.6.%parent: smbus1 +dev.jedec_dimm.6.%pnpinfo: +dev.jedec_dimm.6.capacity: 8192 +dev.jedec_dimm.6.part: VRA9MR8B2H1603 +dev.jedec_dimm.6.serial: 0c4c46ad +dev.jedec_dimm.6.temp: 43.1C +dev.jedec_dimm.6.type: DDR4 +.Ed +.Sh COMPATIBILITY +Hints for +.Xr jedec_ts 4 +can be mechanically converted for use with +.Nm . +Two changes are required: +.Bl -enum +.It +In all +.Xr jedec_ts 4 +hints, replace +.Dq jedec_ts +with +.Dq jedec_dimm +.It +In +.Xr jedec_ts 4 +.Dq addr +hints, replace the TSOD DTI +.Dq 0x3 +with the SPD DTI +.Dq 0xa +.El +.Pp +The following +.Xr sed 1 +script will perform the necessary changes: +.Bd -literal -offset indent +sed -i ".old" -e 's/jedec_ts/jedec_dimm/' \\ + -e '/jedec_dimm/s/addr="0x3/addr="0xa/' /boot/device.hints +.Ed +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr iicsmb 4 , +.Xr jedec_ts 4 , +.Xr smbus 4 , +.Xr sysctl 8 +.Sh STANDARDS +.Rs +(DDR3 SPD) +.%A JEDEC +.%T Standard 21-C, Annex K +.Re +.Pp +.Rs +(DDR3 TSOD) +.%A JEDEC +.%T Standard 21-C, TSE2002av +.Re +.Pp +.Rs +(DDR4 SPD) +.%A JEDEC +.%T Standard 21-C, Annex L +.Re +.Pp +.Rs +(DDR4 TSOD) +.%A JEDEC +.%T Standard 21-C, TSE2004av +.Re +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page were written by +.An Ravi Pokala Aq Mt rpokala@freebsd.org . +They are both based in part on the +.Xr jedec_ts 4 +driver and manual page, written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Wed Feb 28 09:59:58 2018 (r330108) +++ stable/10/sys/conf/NOTES Wed Feb 28 10:00:02 2018 (r330109) @@ -2521,8 +2521,10 @@ device smb # SMBus peripheral devices # +# jedec_dimm Asset and temperature reporting for DDR3 and DDR4 DIMMs # jedec_ts Temperature Sensor compliant with JEDEC Standard 21-C # +device jedec_dimm device jedec_ts # I2C Bus Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Wed Feb 28 09:59:58 2018 (r330108) +++ stable/10/sys/conf/files Wed Feb 28 10:00:02 2018 (r330109) @@ -1829,6 +1829,7 @@ dev/ixl/i40e_nvm.c optional ixl ixlv inet \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/i40e_adminq.c optional ixl ixlv inet \ compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/jedec_dimm/jedec_dimm.c optional jedec_dimm smbus dev/jedec_ts/jedec_ts.c optional jedec_ts smbus dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy Modified: stable/10/sys/modules/i2c/Makefile ============================================================================== --- stable/10/sys/modules/i2c/Makefile Wed Feb 28 09:59:58 2018 (r330108) +++ stable/10/sys/modules/i2c/Makefile Wed Feb 28 10:00:02 2018 (r330109) @@ -2,5 +2,6 @@ SUBDIR = SUBDIR += controllers if_ic smbus iicbus iicbb iicsmb iic smb jedec_ts +SUBDIR += jedec_dimm .include From owner-svn-src-all@freebsd.org Wed Feb 28 14:57:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:02:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:02:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:03:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:17:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:18:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:25:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:27:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:28:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:45:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:47:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 15:48:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 16:03:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 16:08:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 16:19:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 16:24:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 16:24:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 17:20:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 18:31:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06F44F3B523; Wed, 28 Feb 2018 18:31: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 A311686760; Wed, 28 Feb 2018 18:31: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 827011D2F8; Wed, 28 Feb 2018 18:31: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 w1SIVaH3072726; Wed, 28 Feb 2018 18:31:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SIVZHF072718; Wed, 28 Feb 2018 18:31:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281831.w1SIVZHF072718@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 18:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330123 - in stable/11/stand: . arm efi i386 mips powerpc sparc64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . arm efi i386 mips powerpc sparc64 X-SVN-Commit-Revision: 330123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 18:31:37 -0000 Author: kevans Date: Wed Feb 28 18:31:35 2018 New Revision: 330123 URL: https://svnweb.freebsd.org/changeset/base/330123 Log: MFC r330004: 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. PR: 226074 Modified: stable/11/stand/Makefile.i386 stable/11/stand/arm/Makefile stable/11/stand/defs.mk stable/11/stand/efi/Makefile stable/11/stand/i386/Makefile stable/11/stand/mips/Makefile stable/11/stand/powerpc/Makefile stable/11/stand/sparc64/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/Makefile.i386 ============================================================================== --- stable/11/stand/Makefile.i386 Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/Makefile.i386 Wed Feb 28 18:31:35 2018 (r330123) @@ -6,5 +6,3 @@ SUBDIR+= geli .if ${MK_ZFS} != "no" SUBDIR+= zfs .endif - -SUBDIR+= efi Modified: stable/11/stand/arm/Makefile ============================================================================== --- stable/11/stand/arm/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/arm/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + SUBDIR= uboot .include Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/defs.mk Wed Feb 28 18:31:35 2018 (r330123) @@ -149,6 +149,7 @@ CLEANFILES+=${_ILINKS} all: ${PROG} +.if !defined(NO_OBJ) beforedepend: ${_ILINKS} beforebuild: ${_ILINKS} @@ -176,5 +177,5 @@ ${_ILINKS}: path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} - +.endif .endif # __BOOT_DEFS_MK__ Modified: stable/11/stand/efi/Makefile ============================================================================== --- stable/11/stand/efi/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/efi/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer Modified: stable/11/stand/i386/Makefile ============================================================================== --- stable/11/stand/i386/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/i386/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ Modified: stable/11/stand/mips/Makefile ============================================================================== --- stable/11/stand/mips/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/mips/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + SUBDIR= uboot # Modified: stable/11/stand/powerpc/Makefile ============================================================================== --- stable/11/stand/powerpc/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/powerpc/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= boot1.chrp ofw uboot Modified: stable/11/stand/sparc64/Makefile ============================================================================== --- stable/11/stand/sparc64/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/sparc64/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= boot1 loader From owner-svn-src-all@freebsd.org Wed Feb 28 18:34:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DF40F3B98F; Wed, 28 Feb 2018 18:34: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 3D48886B68; Wed, 28 Feb 2018 18:34: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 382081D345; Wed, 28 Feb 2018 18:34: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 w1SIYN57074281; Wed, 28 Feb 2018 18:34:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SIYNVs074280; Wed, 28 Feb 2018 18:34:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281834.w1SIYNVs074280@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 18:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330124 - stable/11/stand X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand X-SVN-Commit-Revision: 330124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 18:34:23 -0000 Author: kevans Date: Wed Feb 28 18:34:22 2018 New Revision: 330124 URL: https://svnweb.freebsd.org/changeset/base/330124 Log: Revert part of r330123 The SUBDIR+= efi removal was part of local testing; revert that part. This is a direct commit to stable/11. Modified: stable/11/stand/Makefile.i386 Modified: stable/11/stand/Makefile.i386 ============================================================================== --- stable/11/stand/Makefile.i386 Wed Feb 28 18:31:35 2018 (r330123) +++ stable/11/stand/Makefile.i386 Wed Feb 28 18:34:22 2018 (r330124) @@ -6,3 +6,5 @@ SUBDIR+= geli .if ${MK_ZFS} != "no" SUBDIR+= zfs .endif + +SUBDIR+= efi From owner-svn-src-all@freebsd.org Wed Feb 28 19:05:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 19:08:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 20:06:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 20:51:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 21:41:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4D8F2550C; Wed, 28 Feb 2018 21:41:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 726DB8ECE0; Wed, 28 Feb 2018 21:41:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D07F1F190; Wed, 28 Feb 2018 21:41:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SLfqoA078175; Wed, 28 Feb 2018 21:41:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SLfqme078174; Wed, 28 Feb 2018 21:41:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282141.w1SLfqme078174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 21:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330129 - stable/11/sys/opencrypto X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/opencrypto X-SVN-Commit-Revision: 330129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 21:41:52 -0000 Author: jhb Date: Wed Feb 28 21:41:52 2018 New Revision: 330129 URL: https://svnweb.freebsd.org/changeset/base/330129 Log: MFC 327838: Axe tmp_iv from the cryptodev session structure. Just copyin the IV into the crypto descriptor directly. This avoids copying the IV twice for each operation. Sponsored by: Chelsio Communications Modified: stable/11/sys/opencrypto/cryptodev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/opencrypto/cryptodev.c ============================================================================== --- stable/11/sys/opencrypto/cryptodev.c Wed Feb 28 20:51:21 2018 (r330128) +++ stable/11/sys/opencrypto/cryptodev.c Wed Feb 28 21:41:52 2018 (r330129) @@ -278,7 +278,6 @@ struct csession { caddr_t key; int keylen; - u_char tmp_iv[EALG_MAX_BLOCK_LEN]; caddr_t mackey; int mackeylen; @@ -818,12 +817,11 @@ cryptodev_op( error = EINVAL; goto bail; } - if ((error = copyin(cop->iv, cse->tmp_iv, + if ((error = copyin(cop->iv, crde->crd_iv, cse->txform->blocksize))) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - bcopy(cse->tmp_iv, crde->crd_iv, cse->txform->blocksize); crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; crde->crd_skip = 0; } else if (cse->cipher == CRYPTO_ARC4) { /* XXX use flag? */ @@ -987,17 +985,16 @@ cryptodev_aead( crp->crp_opaque = (void *)cse; if (caead->iv) { - if (caead->ivlen > sizeof cse->tmp_iv) { + if (caead->ivlen > sizeof(crde->crd_iv)) { error = EINVAL; SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - if ((error = copyin(caead->iv, cse->tmp_iv, caead->ivlen))) { + if ((error = copyin(caead->iv, crde->crd_iv, caead->ivlen))) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - bcopy(cse->tmp_iv, crde->crd_iv, caead->ivlen); crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; } else { crde->crd_flags |= CRD_F_IV_PRESENT; From owner-svn-src-all@freebsd.org Wed Feb 28 21:49:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7A07F260CE; Wed, 28 Feb 2018 21:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 950128F39C; Wed, 28 Feb 2018 21:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7149D1F2B7; Wed, 28 Feb 2018 21:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SLniFu079515; Wed, 28 Feb 2018 21:49:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SLniN3079513; Wed, 28 Feb 2018 21:49:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282149.w1SLniN3079513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 21:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330130 - stable/11/bin/ps X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/bin/ps X-SVN-Commit-Revision: 330130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 21:49:45 -0000 Author: jhb Date: Wed Feb 28 21:49:44 2018 New Revision: 330130 URL: https://svnweb.freebsd.org/changeset/base/330130 Log: MFC 328306: Remove some KSE references from ps(1). - Simplify the description of -H to assume 1:1 threading. - Drop 'process' from description of 'lwp' field and the corresponding XO field name. - Do add an expansion of LWP in the description of 'lwp' and 'nlwps'. - Add 'tid' as an alias for the 'lwp' field. Modified: stable/11/bin/ps/keyword.c stable/11/bin/ps/ps.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ps/keyword.c ============================================================================== --- stable/11/bin/ps/keyword.c Wed Feb 28 21:41:52 2018 (r330129) +++ stable/11/bin/ps/keyword.c Wed Feb 28 21:49:44 2018 (r330130) @@ -120,7 +120,7 @@ static VAR var[] = { {"logname", "", "login", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"lstart", "STARTED", NULL, "start-time", LJUST|USER, lstarted, 0, CHAR, NULL, 0}, - {"lwp", "LWP", NULL, "process-thread-id", 0, kvar, KOFF(ki_tid), UINT, + {"lwp", "LWP", NULL, "thread-id", 0, kvar, KOFF(ki_tid), UINT, LWPFMT, 0}, {"majflt", "MAJFLT", NULL, "major-faults", USER, rvar, ROFF(ru_majflt), LONG, "ld", 0}, @@ -202,6 +202,7 @@ static VAR var[] = { {"tdnam", "", "tdname", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"tdname", "TDNAME", NULL, "thread-name", LJUST, tdnam, 0, CHAR, NULL, 0}, + {"tid", "", "lwp", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, Modified: stable/11/bin/ps/ps.1 ============================================================================== --- stable/11/bin/ps/ps.1 Wed Feb 28 21:41:52 2018 (r330129) +++ stable/11/bin/ps/ps.1 Wed Feb 28 21:49:44 2018 (r330130) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 9, 2017 +.Dd January 23, 2018 .Dt PS 1 .Os .Sh NAME @@ -148,12 +148,7 @@ This option is honored only if the UID of the user is Display information about processes which are running with the specified real group IDs. .It Fl H -Show all of the -.Em kernel visible -threads associated with each process. -Depending on the threading package that -is in use, this may show only the process, only the kernel scheduled entities, -or all of the process threads. +Show all of the threads associated with each process. .It Fl h Repeat the information header as often as necessary to guarantee one header per page of information. @@ -588,7 +583,8 @@ login name of user who started the session .It Cm lstart time started .It Cm lwp -process thread-id +thread (light-weight process) ID (alias +.Cm tid ) .It Cm majflt total page faults .It Cm minflt @@ -605,7 +601,7 @@ nice value (alias .It Cm nivcsw total involuntary context switches .It Cm nlwp -number of threads tied to a process +number of threads (light-weight processes) tied to a process .It Cm nsigs total signals taken (alias .Cm nsignals ) From owner-svn-src-all@freebsd.org Wed Feb 28 21:51:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Feb 28 22:33:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E5BFF2920F; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41A96694B0; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C0561FAB0; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SMX8dE010877; Wed, 28 Feb 2018 22:33:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SMX8Rc010876; Wed, 28 Feb 2018 22:33:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282233.w1SMX8Rc010876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 22:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330132 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 X-SVN-Commit-Revision: 330132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 22:33:08 -0000 Author: jhb Date: Wed Feb 28 22:33:07 2018 New Revision: 330132 URL: https://svnweb.freebsd.org/changeset/base/330132 Log: MFC 328610: Ensure 'name' is not NULL before passing to strcmp(). This avoids a nested page fault when obtaining a stack trace in DDB if the address from the first frame does not resolve to a known symbol. Modified: stable/10/sys/amd64/amd64/db_trace.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/amd64/db_trace.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/10/sys/amd64/amd64/db_trace.c Wed Feb 28 21:51:51 2018 (r330131) +++ stable/10/sys/amd64/amd64/db_trace.c Wed Feb 28 22:33:07 2018 (r330132) @@ -335,7 +335,8 @@ db_backtrace(struct thread *td, struct trapframe *tf, /* Probably an assembler symbol. */ actframe = (void *)(tf->tf_rsp - 8); } - } else if (strcmp(name, "fork_trampoline") == 0) { + } else if (name != NULL && + strcmp(name, "fork_trampoline") == 0) { /* * Don't try to walk back on a stack for a * process that hasn't actually been run yet. From owner-svn-src-all@freebsd.org Wed Feb 28 22:33:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8609F29210; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C24F694B1; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56FEB1FAB1; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SMX83F010884; Wed, 28 Feb 2018 22:33:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SMX8kN010883; Wed, 28 Feb 2018 22:33:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282233.w1SMX8kN010883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 22:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330132 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 X-SVN-Commit-Revision: 330132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 22:33:08 -0000 Author: jhb Date: Wed Feb 28 22:33:07 2018 New Revision: 330132 URL: https://svnweb.freebsd.org/changeset/base/330132 Log: MFC 328610: Ensure 'name' is not NULL before passing to strcmp(). This avoids a nested page fault when obtaining a stack trace in DDB if the address from the first frame does not resolve to a known symbol. Modified: stable/11/sys/amd64/amd64/db_trace.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/db_trace.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/11/sys/amd64/amd64/db_trace.c Wed Feb 28 21:51:51 2018 (r330131) +++ stable/11/sys/amd64/amd64/db_trace.c Wed Feb 28 22:33:07 2018 (r330132) @@ -336,7 +336,8 @@ db_backtrace(struct thread *td, struct trapframe *tf, /* Probably an assembler symbol. */ actframe = (void *)(tf->tf_rsp - 8); } - } else if (strcmp(name, "fork_trampoline") == 0) { + } else if (name != NULL && + strcmp(name, "fork_trampoline") == 0) { /* * Don't try to walk back on a stack for a * process that hasn't actually been run yet. From owner-svn-src-all@freebsd.org Wed Feb 28 22:39:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0510CF297D3; Wed, 28 Feb 2018 22:39:48 +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 A37DE69896; Wed, 28 Feb 2018 22:39:47 +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 9A3C81FAB2; Wed, 28 Feb 2018 22:39:47 +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 w1SMdljf012025; Wed, 28 Feb 2018 22:39:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SMdlTu012024; Wed, 28 Feb 2018 22:39:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282239.w1SMdlTu012024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 22:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330133 - in stable: 10/lib/libc/gen 11/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/lib/libc/gen 11/lib/libc/gen X-SVN-Commit-Revision: 330133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 22:39:48 -0000 Author: jhb Date: Wed Feb 28 22:39:47 2018 New Revision: 330133 URL: https://svnweb.freebsd.org/changeset/base/330133 Log: MFC 328630: Clarify that the additional arguments to makecontext() are of type int. Modified: stable/10/lib/libc/gen/makecontext.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/gen/makecontext.3 Directory Properties: stable/11/ (props changed) Modified: stable/10/lib/libc/gen/makecontext.3 ============================================================================== --- stable/10/lib/libc/gen/makecontext.3 Wed Feb 28 22:33:07 2018 (r330132) +++ stable/10/lib/libc/gen/makecontext.3 Wed Feb 28 22:39:47 2018 (r330133) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2002 +.Dd January 31, 2018 .Dt MAKECONTEXT 3 .Os .Sh NAME @@ -68,11 +68,16 @@ with the arguments provided. The .Fa argc argument -must be equal to the number of additional arguments provided to +must be equal to the number of additional arguments of type +.Vt int +provided to .Fn makecontext -and also equal to the number of arguments to -.Fn func , -or else the behavior is undefined. +and also equal to the number of arguments of type +.Vt int +to +.Fn func ; +otherwise , +the behavior is undefined. .Pp The .Fa "ucp->uc_link" From owner-svn-src-all@freebsd.org Wed Feb 28 22:39:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 255D7F297D5; Wed, 28 Feb 2018 22:39:48 +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 CB01A69897; Wed, 28 Feb 2018 22:39:47 +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 C5E1A1FAB3; Wed, 28 Feb 2018 22:39:47 +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 w1SMdlZA012031; Wed, 28 Feb 2018 22:39:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SMdl5O012030; Wed, 28 Feb 2018 22:39:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282239.w1SMdl5O012030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 22:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330133 - in stable: 10/lib/libc/gen 11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/lib/libc/gen 11/lib/libc/gen X-SVN-Commit-Revision: 330133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 22:39:48 -0000 Author: jhb Date: Wed Feb 28 22:39:47 2018 New Revision: 330133 URL: https://svnweb.freebsd.org/changeset/base/330133 Log: MFC 328630: Clarify that the additional arguments to makecontext() are of type int. Modified: stable/11/lib/libc/gen/makecontext.3 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libc/gen/makecontext.3 Directory Properties: stable/10/ (props changed) Modified: stable/11/lib/libc/gen/makecontext.3 ============================================================================== --- stable/11/lib/libc/gen/makecontext.3 Wed Feb 28 22:33:07 2018 (r330132) +++ stable/11/lib/libc/gen/makecontext.3 Wed Feb 28 22:39:47 2018 (r330133) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2002 +.Dd January 31, 2018 .Dt MAKECONTEXT 3 .Os .Sh NAME @@ -68,11 +68,16 @@ with the arguments provided. The .Fa argc argument -must be equal to the number of additional arguments provided to +must be equal to the number of additional arguments of type +.Vt int +provided to .Fn makecontext -and also equal to the number of arguments to -.Fn func , -or else the behavior is undefined. +and also equal to the number of arguments of type +.Vt int +to +.Fn func ; +otherwise , +the behavior is undefined. .Pp The .Fa "ucp->uc_link" From owner-svn-src-all@freebsd.org Thu Mar 1 00:05:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55481F2F4BB; Thu, 1 Mar 2018 00:05:15 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED5B56CE74; Thu, 1 Mar 2018 00:05:14 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3EBE20934; Thu, 1 Mar 2018 00:05:14 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2105EUL059951; Thu, 1 Mar 2018 00:05:14 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2105Eat059950; Thu, 1 Mar 2018 00:05:14 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201803010005.w2105Eat059950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Thu, 1 Mar 2018 00:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r330134 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: matthew X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 330134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 00:05:15 -0000 Author: matthew (ports committer) Date: Thu Mar 1 00:05:14 2018 New Revision: 330134 URL: https://svnweb.freebsd.org/changeset/base/330134 Log: Take in remko's src commit bit for archiving, at his own request. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Feb 28 22:39:47 2018 (r330133) +++ svnadmin/conf/access Thu Mar 1 00:05:14 2018 (r330134) @@ -175,7 +175,6 @@ pluknet pstef qingli ray -remko rgrimes rlibby rmacklem From owner-svn-src-all@freebsd.org Thu Mar 1 00:29:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 00:59:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 00:59:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 01:21:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9FA6F34765 for ; Thu, 1 Mar 2018 01:21:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47F446FDB9 for ; Thu, 1 Mar 2018 01:21:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id v6so5356333iog.7 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=KhtLknbmACNNP7iX7K43uT4DMs8qxz5Kt57QmaWZq+xt9WZ5vw6EtvLaDkc1ZTHUBI geeMGmXjP8al5y/UeRKlmp9YuWNa2uhRj37TeSkyxbPZfqBS2jwM32m7bc2o8ZHp7hWb wTY4UZHPDhNdZCdapNk5MIGzSRhVpy/403q8BWOOnMkEf2O/+4Vz7rpVbJS+H+bohZxM CD2zX1GZa5D1qGc+nBXLIrNWtESA/0MdZ2slME38l3Wus2yeD7PozBo33RrTUx7Oq8kT FcbZdBYfgHNmVDsw8G15VM/K98hV4gMfznGjaQLHLwMctOHkh5D0qwJaEE332h4xXXW9 LMJQ== X-Gm-Message-State: APf1xPA/S08v+qfykV+YfqgmraeTLm4DRGrugabR1/ZqOikM4DszAFOj Su0qM3c4GdvTzQOVPCZG9xMf9GUkmwCwCpctvaie4Q== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 01:49:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 02:05:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 02:04:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 02:31:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 03:05:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89BF2F3C565; Thu, 1 Mar 2018 03:05:01 +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 3CC2D751C5; Thu, 1 Mar 2018 03:05:01 +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 3792D22998; Thu, 1 Mar 2018 03:05:01 +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 w21351F1050289; Thu, 1 Mar 2018 03:05:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21351rQ050288; Thu, 1 Mar 2018 03:05:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010305.w21351rQ050288@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 03:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330140 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 03:05:01 -0000 Author: eadler Date: Thu Mar 1 03:05:00 2018 New Revision: 330140 URL: https://svnweb.freebsd.org/changeset/base/330140 Log: MFC r314073: [iwm] Remove OpenBSD-specific comment. Beautify pci cfg space accesses. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 02:31:28 2018 (r330139) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 03:05:00 2018 (r330140) @@ -3091,11 +3091,6 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, if (--ring->queued < IWM_TX_RING_LOMARK) { sc->qfullmsk &= ~(1 << ring->qid); if (sc->qfullmsk == 0) { - /* - * Well, we're in interrupt context, but then again - * I guess net80211 does all sorts of stunts in - * interrupt context, so maybe this is no biggie. - */ iwm_start(sc); } } @@ -5598,6 +5593,9 @@ iwm_dev_check(device_t dev) } } +/* PCI registers */ +#define PCI_CFG_RETRY_TIMEOUT 0x041 + static int iwm_pci_attach(device_t dev) { @@ -5607,9 +5605,9 @@ iwm_pci_attach(device_t dev) sc = device_get_softc(dev); - /* Clear device-specific "PCI retry timeout" register (41h). */ - reg = pci_read_config(dev, 0x40, sizeof(reg)); - pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); + /* We disable the RETRY_TIMEOUT register (0x41) to keep + * PCI Tx retries from interfering with C3 CPU state */ + pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); /* Enable bus-mastering and hardware bug workaround. */ pci_enable_busmaster(dev); @@ -6071,11 +6069,12 @@ iwm_resume(device_t dev) { struct iwm_softc *sc = device_get_softc(dev); int do_reinit = 0; - uint16_t reg; - /* Clear device-specific "PCI retry timeout" register (41h). */ - reg = pci_read_config(dev, 0x40, sizeof(reg)); - pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); + /* + * We disable the RETRY_TIMEOUT register (0x41) to keep + * PCI Tx retries from interfering with C3 CPU state. + */ + pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); iwm_init_task(device_get_softc(dev)); IWM_LOCK(sc); From owner-svn-src-all@freebsd.org Thu Mar 1 04:06:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948A8F415D8; Thu, 1 Mar 2018 04:06:52 +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 3F87B77B29; Thu, 1 Mar 2018 04:06:52 +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 39D31233CE; Thu, 1 Mar 2018 04:06:52 +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 w2146q51080469; Thu, 1 Mar 2018 04:06:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2146oLL080457; Thu, 1 Mar 2018 04:06:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201803010406.w2146oLL080457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 1 Mar 2018 04:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330141 - in stable/10: 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 ... X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/10: 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 co... X-SVN-Commit-Revision: 330141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:06:53 -0000 Author: delphij Date: Thu Mar 1 04:06:49 2018 New Revision: 330141 URL: https://svnweb.freebsd.org/changeset/base/330141 Log: MFC r330104: MFV r330102: ntp 4.2.8p11 Added: stable/10/contrib/ntp/sntp/m4/ntp_af_unspec.m4 - copied unchanged from r330104, head/contrib/ntp/sntp/m4/ntp_af_unspec.m4 stable/10/contrib/ntp/sntp/tests/testconf.yml - copied unchanged from r330104, head/contrib/ntp/sntp/tests/testconf.yml Modified: stable/10/contrib/ntp/ChangeLog stable/10/contrib/ntp/Makefile.am stable/10/contrib/ntp/Makefile.in stable/10/contrib/ntp/NEWS stable/10/contrib/ntp/aclocal.m4 stable/10/contrib/ntp/adjtimed/Makefile.in stable/10/contrib/ntp/clockstuff/Makefile.in stable/10/contrib/ntp/configure stable/10/contrib/ntp/configure.ac stable/10/contrib/ntp/html/access.html stable/10/contrib/ntp/html/accopt.html stable/10/contrib/ntp/html/authentic.html stable/10/contrib/ntp/html/drivers/driver18.html stable/10/contrib/ntp/html/drivers/driver40-ja.html stable/10/contrib/ntp/html/drivers/driver40.html stable/10/contrib/ntp/html/keygen.html stable/10/contrib/ntp/html/miscopt.html stable/10/contrib/ntp/html/monopt.html stable/10/contrib/ntp/html/ntpq.html stable/10/contrib/ntp/include/Makefile.in stable/10/contrib/ntp/include/isc/Makefile.in stable/10/contrib/ntp/include/ntp.h stable/10/contrib/ntp/include/ntp_calendar.h stable/10/contrib/ntp/include/ntp_config.h stable/10/contrib/ntp/include/ntp_fp.h stable/10/contrib/ntp/include/ntp_keyacc.h stable/10/contrib/ntp/include/ntp_request.h stable/10/contrib/ntp/include/ntp_stdlib.h stable/10/contrib/ntp/include/ntpd.h stable/10/contrib/ntp/include/recvbuff.h stable/10/contrib/ntp/include/ssl_applink.c stable/10/contrib/ntp/kernel/Makefile.in stable/10/contrib/ntp/kernel/sys/Makefile.in stable/10/contrib/ntp/libntp/Makefile.in stable/10/contrib/ntp/libntp/a_md5encrypt.c stable/10/contrib/ntp/libntp/adjtime.c stable/10/contrib/ntp/libntp/authkeys.c stable/10/contrib/ntp/libntp/authreadkeys.c stable/10/contrib/ntp/libntp/libssl_compat.c stable/10/contrib/ntp/libntp/ntp_calendar.c stable/10/contrib/ntp/libntp/ssl_init.c stable/10/contrib/ntp/libntp/statestr.c stable/10/contrib/ntp/libntp/systime.c stable/10/contrib/ntp/libntp/work_thread.c stable/10/contrib/ntp/libparse/Makefile.in stable/10/contrib/ntp/ntpd/Makefile.in stable/10/contrib/ntp/ntpd/complete.conf.in stable/10/contrib/ntp/ntpd/invoke-ntp.conf.texi stable/10/contrib/ntp/ntpd/invoke-ntp.keys.texi stable/10/contrib/ntp/ntpd/invoke-ntpd.texi stable/10/contrib/ntp/ntpd/keyword-gen-utd stable/10/contrib/ntp/ntpd/keyword-gen.c stable/10/contrib/ntp/ntpd/ntp.conf.5man stable/10/contrib/ntp/ntpd/ntp.conf.5mdoc stable/10/contrib/ntp/ntpd/ntp.conf.def stable/10/contrib/ntp/ntpd/ntp.conf.html stable/10/contrib/ntp/ntpd/ntp.conf.man.in stable/10/contrib/ntp/ntpd/ntp.conf.mdoc.in stable/10/contrib/ntp/ntpd/ntp.keys.5man stable/10/contrib/ntp/ntpd/ntp.keys.5mdoc stable/10/contrib/ntp/ntpd/ntp.keys.def stable/10/contrib/ntp/ntpd/ntp.keys.html stable/10/contrib/ntp/ntpd/ntp.keys.man.in stable/10/contrib/ntp/ntpd/ntp.keys.mdoc.in stable/10/contrib/ntp/ntpd/ntp_config.c stable/10/contrib/ntp/ntpd/ntp_control.c stable/10/contrib/ntp/ntpd/ntp_crypto.c stable/10/contrib/ntp/ntpd/ntp_io.c stable/10/contrib/ntp/ntpd/ntp_keyword.h stable/10/contrib/ntp/ntpd/ntp_leapsec.c stable/10/contrib/ntp/ntpd/ntp_parser.c stable/10/contrib/ntp/ntpd/ntp_parser.h stable/10/contrib/ntp/ntpd/ntp_peer.c stable/10/contrib/ntp/ntpd/ntp_proto.c stable/10/contrib/ntp/ntpd/ntp_refclock.c stable/10/contrib/ntp/ntpd/ntp_request.c stable/10/contrib/ntp/ntpd/ntp_restrict.c stable/10/contrib/ntp/ntpd/ntp_scanner.c stable/10/contrib/ntp/ntpd/ntp_util.c stable/10/contrib/ntp/ntpd/ntpd-opts.c stable/10/contrib/ntp/ntpd/ntpd-opts.h stable/10/contrib/ntp/ntpd/ntpd.1ntpdman stable/10/contrib/ntp/ntpd/ntpd.1ntpdmdoc stable/10/contrib/ntp/ntpd/ntpd.c stable/10/contrib/ntp/ntpd/ntpd.html stable/10/contrib/ntp/ntpd/ntpd.man.in stable/10/contrib/ntp/ntpd/ntpd.mdoc.in stable/10/contrib/ntp/ntpd/ntpsim.c stable/10/contrib/ntp/ntpd/refclock_gpsdjson.c stable/10/contrib/ntp/ntpd/refclock_jjy.c stable/10/contrib/ntp/ntpd/refclock_palisade.c stable/10/contrib/ntp/ntpd/refclock_parse.c stable/10/contrib/ntp/ntpdate/Makefile.in stable/10/contrib/ntp/ntpdc/Makefile.in stable/10/contrib/ntp/ntpdc/invoke-ntpdc.texi stable/10/contrib/ntp/ntpdc/layout.std stable/10/contrib/ntp/ntpdc/ntpdc-opts.c stable/10/contrib/ntp/ntpdc/ntpdc-opts.h stable/10/contrib/ntp/ntpdc/ntpdc.1ntpdcman stable/10/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc stable/10/contrib/ntp/ntpdc/ntpdc.c stable/10/contrib/ntp/ntpdc/ntpdc.html stable/10/contrib/ntp/ntpdc/ntpdc.man.in stable/10/contrib/ntp/ntpdc/ntpdc.mdoc.in stable/10/contrib/ntp/ntpdc/ntpdc_ops.c stable/10/contrib/ntp/ntpq/Makefile.am stable/10/contrib/ntp/ntpq/Makefile.in stable/10/contrib/ntp/ntpq/invoke-ntpq.texi stable/10/contrib/ntp/ntpq/ntpq-opts.c stable/10/contrib/ntp/ntpq/ntpq-opts.def stable/10/contrib/ntp/ntpq/ntpq-opts.h stable/10/contrib/ntp/ntpq/ntpq-subs.c stable/10/contrib/ntp/ntpq/ntpq.1ntpqman stable/10/contrib/ntp/ntpq/ntpq.1ntpqmdoc stable/10/contrib/ntp/ntpq/ntpq.c stable/10/contrib/ntp/ntpq/ntpq.html stable/10/contrib/ntp/ntpq/ntpq.man.in stable/10/contrib/ntp/ntpq/ntpq.mdoc.in stable/10/contrib/ntp/ntpq/ntpq.texi stable/10/contrib/ntp/ntpsnmpd/Makefile.in stable/10/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi stable/10/contrib/ntp/ntpsnmpd/netsnmp_daemonize.c stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.html stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in stable/10/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in stable/10/contrib/ntp/packageinfo.sh stable/10/contrib/ntp/parseutil/Makefile.in stable/10/contrib/ntp/scripts/Makefile.in stable/10/contrib/ntp/scripts/build/Makefile.in stable/10/contrib/ntp/scripts/build/UpdatePoint stable/10/contrib/ntp/scripts/calc_tickadj/Makefile.in stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in stable/10/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in stable/10/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi stable/10/contrib/ntp/scripts/invoke-plot_summary.texi stable/10/contrib/ntp/scripts/invoke-summary.texi stable/10/contrib/ntp/scripts/lib/Makefile.in stable/10/contrib/ntp/scripts/ntp-wait/Makefile.in stable/10/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait-opts stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.html stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in stable/10/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in stable/10/contrib/ntp/scripts/ntpsweep/Makefile.in stable/10/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep-opts stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.html stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in stable/10/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in stable/10/contrib/ntp/scripts/ntptrace/Makefile.in stable/10/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi stable/10/contrib/ntp/scripts/ntptrace/ntptrace-opts stable/10/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman stable/10/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc stable/10/contrib/ntp/scripts/ntptrace/ntptrace.html stable/10/contrib/ntp/scripts/ntptrace/ntptrace.man.in stable/10/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in stable/10/contrib/ntp/scripts/plot_summary-opts stable/10/contrib/ntp/scripts/plot_summary.1plot_summaryman stable/10/contrib/ntp/scripts/plot_summary.1plot_summarymdoc stable/10/contrib/ntp/scripts/plot_summary.html stable/10/contrib/ntp/scripts/plot_summary.man.in stable/10/contrib/ntp/scripts/plot_summary.mdoc.in stable/10/contrib/ntp/scripts/summary-opts stable/10/contrib/ntp/scripts/summary.1summaryman stable/10/contrib/ntp/scripts/summary.1summarymdoc stable/10/contrib/ntp/scripts/summary.html stable/10/contrib/ntp/scripts/summary.man.in stable/10/contrib/ntp/scripts/summary.mdoc.in stable/10/contrib/ntp/scripts/update-leap/Makefile.in stable/10/contrib/ntp/scripts/update-leap/invoke-update-leap.texi stable/10/contrib/ntp/scripts/update-leap/update-leap-opts stable/10/contrib/ntp/scripts/update-leap/update-leap.1update-leapman stable/10/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc stable/10/contrib/ntp/scripts/update-leap/update-leap.html stable/10/contrib/ntp/scripts/update-leap/update-leap.in stable/10/contrib/ntp/scripts/update-leap/update-leap.man.in stable/10/contrib/ntp/scripts/update-leap/update-leap.mdoc.in stable/10/contrib/ntp/sntp/Makefile.in stable/10/contrib/ntp/sntp/check-libntp.mf stable/10/contrib/ntp/sntp/configure stable/10/contrib/ntp/sntp/crypto.c stable/10/contrib/ntp/sntp/crypto.h stable/10/contrib/ntp/sntp/harden/linux stable/10/contrib/ntp/sntp/include/version.def stable/10/contrib/ntp/sntp/include/version.texi stable/10/contrib/ntp/sntp/invoke-sntp.texi stable/10/contrib/ntp/sntp/m4/ntp_harden.m4 stable/10/contrib/ntp/sntp/m4/ntp_libevent.m4 stable/10/contrib/ntp/sntp/m4/ntp_openssl.m4 stable/10/contrib/ntp/sntp/m4/version.m4 stable/10/contrib/ntp/sntp/main.c stable/10/contrib/ntp/sntp/networking.c stable/10/contrib/ntp/sntp/sntp-opts.c stable/10/contrib/ntp/sntp/sntp-opts.def stable/10/contrib/ntp/sntp/sntp-opts.h stable/10/contrib/ntp/sntp/sntp.1sntpman stable/10/contrib/ntp/sntp/sntp.1sntpmdoc stable/10/contrib/ntp/sntp/sntp.html stable/10/contrib/ntp/sntp/sntp.man.in stable/10/contrib/ntp/sntp/sntp.mdoc.in stable/10/contrib/ntp/sntp/tests/Makefile.am stable/10/contrib/ntp/sntp/tests/Makefile.in stable/10/contrib/ntp/sntp/tests/crypto.c stable/10/contrib/ntp/sntp/tests/keyFile.c stable/10/contrib/ntp/sntp/tests/packetHandling.c stable/10/contrib/ntp/sntp/tests/packetProcessing.c stable/10/contrib/ntp/sntp/tests/run-crypto.c stable/10/contrib/ntp/sntp/tests/run-keyFile.c stable/10/contrib/ntp/sntp/tests/run-kodDatabase.c stable/10/contrib/ntp/sntp/tests/run-kodFile.c stable/10/contrib/ntp/sntp/tests/run-networking.c stable/10/contrib/ntp/sntp/tests/run-packetHandling.c stable/10/contrib/ntp/sntp/tests/run-packetProcessing.c stable/10/contrib/ntp/sntp/tests/run-t-log.c stable/10/contrib/ntp/sntp/tests/run-utilities.c stable/10/contrib/ntp/sntp/unity/auto/generate_test_runner.rb stable/10/contrib/ntp/sntp/utilities.c stable/10/contrib/ntp/sntp/version.c stable/10/contrib/ntp/util/Makefile.in stable/10/contrib/ntp/util/invoke-ntp-keygen.texi stable/10/contrib/ntp/util/ntp-keygen-opts.c stable/10/contrib/ntp/util/ntp-keygen-opts.def stable/10/contrib/ntp/util/ntp-keygen-opts.h stable/10/contrib/ntp/util/ntp-keygen.1ntp-keygenman stable/10/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc stable/10/contrib/ntp/util/ntp-keygen.html stable/10/contrib/ntp/util/ntp-keygen.man.in stable/10/contrib/ntp/util/ntp-keygen.mdoc.in stable/10/usr.sbin/ntp/config.h stable/10/usr.sbin/ntp/doc/ntp-keygen.8 stable/10/usr.sbin/ntp/doc/ntp.conf.5 stable/10/usr.sbin/ntp/doc/ntp.keys.5 stable/10/usr.sbin/ntp/doc/ntpd.8 stable/10/usr.sbin/ntp/doc/ntpdc.8 stable/10/usr.sbin/ntp/doc/ntpq.8 stable/10/usr.sbin/ntp/doc/sntp.8 stable/10/usr.sbin/ntp/ntp-keygen/Makefile stable/10/usr.sbin/ntp/ntptime/Makefile stable/10/usr.sbin/ntp/scripts/mkver Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ntp/ChangeLog ============================================================================== --- stable/10/contrib/ntp/ChangeLog Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/ChangeLog Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/Makefile.am ============================================================================== --- stable/10/contrib/ntp/Makefile.am Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/Makefile.am Thu Mar 1 04:06:49 2018 (r330141) @@ -5,10 +5,10 @@ NULL = # moved sntp first to get libtool and libevent built. SUBDIRS = \ - sntp \ scripts \ include \ libntp \ + sntp \ libparse \ ntpd \ ntpdate \ Modified: stable/10/contrib/ntp/Makefile.in ============================================================================== --- stable/10/contrib/ntp/Makefile.in Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/Makefile.in Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/NEWS ============================================================================== --- stable/10/contrib/ntp/NEWS Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/NEWS Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/aclocal.m4 ============================================================================== --- stable/10/contrib/ntp/aclocal.m4 Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/aclocal.m4 Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/adjtimed/Makefile.in ============================================================================== --- stable/10/contrib/ntp/adjtimed/Makefile.in Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/adjtimed/Makefile.in Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/clockstuff/Makefile.in ============================================================================== --- stable/10/contrib/ntp/clockstuff/Makefile.in Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/clockstuff/Makefile.in Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/configure ============================================================================== --- stable/10/contrib/ntp/configure Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/configure Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/configure.ac ============================================================================== --- stable/10/contrib/ntp/configure.ac Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/configure.ac Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/html/access.html ============================================================================== --- stable/10/contrib/ntp/html/access.html Thu Mar 1 03:05:00 2018 (r330140) +++ stable/10/contrib/ntp/html/access.html Thu Mar 1 04:06:49 2018 (r330141) @@ -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: stable/10/contrib/ntp/html/accopt.html
==============================================================================
--- stable/10/contrib/ntp/html/accopt.html	Thu Mar  1 03:05:00 2018	(r330140)
+++ stable/10/contrib/ntp/html/accopt.html	Thu Mar  1 04:06:49 2018	(r330141)
@@ -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-all@freebsd.org Thu Mar 1 04:21:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86985F42765; Thu, 1 Mar 2018 04:21:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38E447871E; Thu, 1 Mar 2018 04:21:19 +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 33B17236D6; Thu, 1 Mar 2018 04:21:19 +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 w214LIBL085407; Thu, 1 Mar 2018 04:21:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214LIYF085406; Thu, 1 Mar 2018 04:21:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010421.w214LIYF085406@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 04:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330142 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:21:19 -0000 Author: eadler Date: Thu Mar 1 04:21:18 2018 New Revision: 330142 URL: https://svnweb.freebsd.org/changeset/base/330142 Log: MFC r304880: iwm: add 'command accepted' debug notification (copied from wpi(4)). Now it should be easier to find out which command causes firmware panics when few commands are sent in a short period of time. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:06:49 2018 (r330141) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:21:18 2018 (r330142) @@ -3115,6 +3115,11 @@ iwm_cmd_done(struct iwm_softc *sc, struct iwm_rx_packe return; /* Not a command ack. */ } + /* XXX wide commands? */ + IWM_DPRINTF(sc, IWM_DEBUG_CMD, + "cmd notification type 0x%x qid %d idx %d\n", + pkt->hdr.code, pkt->hdr.qid, pkt->hdr.idx); + data = &ring->data[pkt->hdr.idx]; /* If the command was mapped in an mbuf, free it. */ From owner-svn-src-all@freebsd.org Thu Mar 1 04:23:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C573F42B96; Thu, 1 Mar 2018 04:23:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8181789F5; Thu, 1 Mar 2018 04:23:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B164C23740; Thu, 1 Mar 2018 04:23:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214NpOm090105; Thu, 1 Mar 2018 04:23:51 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214NpXP090104; Thu, 1 Mar 2018 04:23:51 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010423.w214NpXP090104@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 04:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330143 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:23:52 -0000 Author: eadler Date: Thu Mar 1 04:23:51 2018 New Revision: 330143 URL: https://svnweb.freebsd.org/changeset/base/330143 Log: MFC r304891: iwm: fix few comment typos. Modified: stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:21:18 2018 (r330142) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:23:51 2018 (r330143) @@ -3219,7 +3219,7 @@ enum iwm_sf_scenario { #define IWM_SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ #define IWM_SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ -#define IWM_SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */ +#define IWM_SF_MCAST_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ #define IWM_SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */ @@ -3244,7 +3244,7 @@ enum iwm_sf_scenario { /** * Smart Fifo configuration command. - * @state: smart fifo state, types listed in iwm_sf_sate. + * @state: smart fifo state, types listed in iwm_sf_state. * @watermark: Minimum allowed available free space in RXF for transient state. * @long_delay_timeouts: aging and idle timer values for each scenario * in long delay state. From owner-svn-src-all@freebsd.org Thu Mar 1 04:26:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92FA3F42E29; Thu, 1 Mar 2018 04:26:34 +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 426C378BB8; Thu, 1 Mar 2018 04:26:34 +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 3C8C523744; Thu, 1 Mar 2018 04:26:34 +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 w214QYNs090256; Thu, 1 Mar 2018 04:26:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214QYJ6090255; Thu, 1 Mar 2018 04:26:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010426.w214QYJ6090255@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 04:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330144 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:26:34 -0000 Author: eadler Date: Thu Mar 1 04:26:33 2018 New Revision: 330144 URL: https://svnweb.freebsd.org/changeset/base/330144 Log: MFC r305917: [iwm] fix up RSSI calculations for both scan results and normal RX operations. * hard code a noise floor of -96 for now. The noise floor update * code returns some "interesting" values that I can't map to anything useful right now. * Ensure a default noise floor is set - otherwise the initial * scan results have a noise floor of '0'. * Fix up the RSSI calculation to be correctly relative * to the noise floor. The RSSI routines return an absolute value in dBm - so fix this up. * Cap RSSI values appropriately. * Ensure we pass in a 1/2 dB unit value in to * net80211. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:23:51 2018 (r330143) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:26:33 2018 (r330144) @@ -312,7 +312,8 @@ static int iwm_mvm_get_signal_strength(struct iwm_soft static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_rx_data *); -static int iwm_get_noise(const struct iwm_mvm_statistics_rx_non_phy *); +static int iwm_get_noise(struct iwm_softc *sc, + const struct iwm_mvm_statistics_rx_non_phy *); static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_rx_data *); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, @@ -2871,21 +2872,34 @@ iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, * Retrieve the average noise (in dBm) among receivers. */ static int -iwm_get_noise(const struct iwm_mvm_statistics_rx_non_phy *stats) +iwm_get_noise(struct iwm_softc *sc, + const struct iwm_mvm_statistics_rx_non_phy *stats) { int i, total, nbant, noise; total = nbant = noise = 0; for (i = 0; i < 3; i++) { noise = le32toh(stats->beacon_silence_rssi[i]) & 0xff; + IWM_DPRINTF(sc, IWM_DEBUG_RECV, "%s: i=%d, noise=%d\n", + __func__, + i, + noise); + if (noise) { total += noise; nbant++; } } + IWM_DPRINTF(sc, IWM_DEBUG_RECV, "%s: nbant=%d, total=%d\n", + __func__, nbant, total); +#if 0 /* There should be at least one antenna but check anyway. */ return (nbant == 0) ? -127 : (total / nbant) - 107; +#else + /* For now, just hard-code it to -96 to be safe */ + return (-96); +#endif } /* @@ -2940,9 +2954,16 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, } else { rssi = iwm_mvm_calc_rssi(sc, phy_info); } - rssi = (0 - IWM_MIN_DBM) + rssi; /* normalize */ - rssi = MIN(rssi, sc->sc_max_rssi); /* clip to max. 100% */ + /* Note: RSSI is absolute (ie a -ve value) */ + if (rssi < IWM_MIN_DBM) + rssi = IWM_MIN_DBM; + else if (rssi > IWM_MAX_DBM) + rssi = IWM_MAX_DBM; + + /* Map it to relative value */ + rssi = rssi - sc->sc_noise; + /* replenish ring for the buffer we're going to feed to the sharks */ if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { device_printf(sc->sc_dev, "%s: unable to add more buffers\n", @@ -2950,6 +2971,9 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, return; } + IWM_DPRINTF(sc, IWM_DEBUG_RECV, + "%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise); + ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); IWM_DPRINTF(sc, IWM_DEBUG_RECV, @@ -2970,7 +2994,9 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, } else { rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ); } - rxs.rssi = rssi - sc->sc_noise; + + /* rssi is in 1/2db units */ + rxs.rssi = rssi * 2; rxs.nf = sc->sc_noise; if (ieee80211_radiotap_active_vap(vap)) { @@ -5167,7 +5193,7 @@ iwm_notif_intr(struct iwm_softc *sc) struct iwm_notif_statistics *stats; SYNC_RESP_STRUCT(stats, pkt); memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); - sc->sc_noise = iwm_get_noise(&stats->rx.general); + sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); break; } case IWM_NVM_ACCESS_CMD: @@ -5821,8 +5847,12 @@ iwm_attach(device_t dev) sc->sc_phyctxt[i].channel = NULL; } + /* Default noise floor */ + sc->sc_noise = -96; + /* Max RSSI */ sc->sc_max_rssi = IWM_MAX_DBM - IWM_MIN_DBM; + sc->sc_preinit_hook.ich_func = iwm_preinit; sc->sc_preinit_hook.ich_arg = sc; if (config_intrhook_establish(&sc->sc_preinit_hook) != 0) { From owner-svn-src-all@freebsd.org Thu Mar 1 04:28:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2882F4306A; Thu, 1 Mar 2018 04:28:54 +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 96A6F78D7E; Thu, 1 Mar 2018 04:28:54 +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 9191D23747; Thu, 1 Mar 2018 04:28:54 +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 w214Ss9g090389; Thu, 1 Mar 2018 04:28:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214SsnC090388; Thu, 1 Mar 2018 04:28:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010428.w214SsnC090388@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 04:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330145 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:28:55 -0000 Author: eadler Date: Thu Mar 1 04:28:54 2018 New Revision: 330145 URL: https://svnweb.freebsd.org/changeset/base/330145 Log: MFC r305999: [iwm] Use htole16 for policy field in struct iwm_time_event_cmd_v2. The htole32 was working fine for little-endian machines, but would have been broken on big-endian. Modified: stable/11/sys/dev/iwm/if_iwm_time_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 04:26:33 2018 (r330144) +++ stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 04:28:54 2018 (r330145) @@ -266,7 +266,7 @@ iwm_mvm_protect_session(struct iwm_softc *sc, struct i time_cmd.duration = htole32(duration); time_cmd.repeat = 1; time_cmd.policy - = htole32(IWM_TE_V2_NOTIF_HOST_EVENT_START | + = htole16(IWM_TE_V2_NOTIF_HOST_EVENT_START | IWM_TE_V2_NOTIF_HOST_EVENT_END | IWM_T2_V2_START_IMMEDIATELY); From owner-svn-src-all@freebsd.org Thu Mar 1 04:43:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 404D4F440D1; Thu, 1 Mar 2018 04:43:53 +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 E370279A30; Thu, 1 Mar 2018 04:43:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE61023A7B; Thu, 1 Mar 2018 04:43:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214hqT4000416; Thu, 1 Mar 2018 04:43:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214hq3F000414; Thu, 1 Mar 2018 04:43:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010443.w214hq3F000414@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 04:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330146 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:43:53 -0000 Author: eadler Date: Thu Mar 1 04:43:52 2018 New Revision: 330146 URL: https://svnweb.freebsd.org/changeset/base/330146 Log: MFC r306000 [iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type. The wantresp field in struct iwm_rx_data has never been used for anything, so we can just delete it. Apparently struct iwm_sf_cfg_cmd was compiled correctly (using a 32bit value to represent the enum), but it still seems like a very bad idea to use an enum type in a __packed struct. Modified: stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:28:54 2018 (r330145) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:43:52 2018 (r330146) @@ -3251,7 +3251,7 @@ enum iwm_sf_scenario { * @full_on_timeouts: timer values for each scenario in full on state. */ struct iwm_sf_cfg_cmd { - enum iwm_sf_state state; + uint32_t state; uint32_t watermark[IWM_SF_TRANSIENT_STATES_NUMBER]; uint32_t long_delay_timeouts[IWM_SF_NUM_SCENARIO][IWM_SF_NUM_TIMEOUT_TYPES]; uint32_t full_on_timeouts[IWM_SF_NUM_SCENARIO][IWM_SF_NUM_TIMEOUT_TYPES]; Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 04:28:54 2018 (r330145) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 04:43:52 2018 (r330146) @@ -275,7 +275,6 @@ struct iwm_tx_ring { struct iwm_rx_data { struct mbuf *m; bus_dmamap_t map; - int wantresp; }; struct iwm_rx_ring { From owner-svn-src-all@freebsd.org Thu Mar 1 04:44:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 04:46:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F269F444A1; Thu, 1 Mar 2018 04:46:59 +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 E65BC79D7B; Thu, 1 Mar 2018 04:46:58 +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 E0A0723A83; Thu, 1 Mar 2018 04:46:58 +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 w214kw07000655; Thu, 1 Mar 2018 04:46:58 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214kwK9000654; Thu, 1 Mar 2018 04:46:58 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010446.w214kwK9000654@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 04:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330148 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:46:59 -0000 Author: eadler Date: Thu Mar 1 04:46:58 2018 New Revision: 330148 URL: https://svnweb.freebsd.org/changeset/base/330148 Log: MFC r306001 [iwm] Fix off-by-one check in iwm_read_firmware(). This fixes a potential buffer overrun in the firmware parsing code. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:44:17 2018 (r330147) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:46:58 2018 (r330148) @@ -739,7 +739,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode } capa = (const struct iwm_ucode_capa *)tlv_data; idx = le32toh(capa->api_index); - if (idx > howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { + if (idx >= howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { device_printf(sc->sc_dev, "unsupported API index %d\n", idx); goto parse_out; From owner-svn-src-all@freebsd.org Thu Mar 1 04:49:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA73F4475D; Thu, 1 Mar 2018 04:49:43 +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 F36DD79F68; Thu, 1 Mar 2018 04:49:42 +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 EE74D23A8A; Thu, 1 Mar 2018 04:49:42 +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 w214ngK2000806; Thu, 1 Mar 2018 04:49:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214ngvO000805; Thu, 1 Mar 2018 04:49:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010449.w214ngvO000805@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 04:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330149 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:49:43 -0000 Author: eadler Date: Thu Mar 1 04:49:42 2018 New Revision: 330149 URL: https://svnweb.freebsd.org/changeset/base/330149 Log: MFC r306002 [iwm] Fix iwm_poll_bit() error value check in iwm_attach(). The iwm(4) iwm_poll_bit() function returns 1 on success, and 0 on failure, whereas the iwl_poll_bit() in Linux iwlwifi returns < 0 on failure. So the (ret < 0) check ended up ignoring any error returned by iwm_poll_bit(). Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:46:58 2018 (r330148) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:49:42 2018 (r330149) @@ -5760,7 +5760,7 @@ iwm_attach(device_t dev) IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); - if (ret < 0) { + if (!ret) { device_printf(sc->sc_dev, "Failed to wake up the nic\n"); goto fail; From owner-svn-src-all@freebsd.org Thu Mar 1 04:50:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F945F448AF; Thu, 1 Mar 2018 04:50:43 +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 D23017A0E0; Thu, 1 Mar 2018 04:50:42 +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 B418723A9B; Thu, 1 Mar 2018 04:50:42 +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 w214ogQt000918; Thu, 1 Mar 2018 04:50:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214oglu000917; Thu, 1 Mar 2018 04:50:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010450.w214oglu000917@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 04:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330150 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:50:43 -0000 Author: eadler Date: Thu Mar 1 04:50:42 2018 New Revision: 330150 URL: https://svnweb.freebsd.org/changeset/base/330150 Log: MFC r30600 [iwm] Remove wrappers around iwm_dma_contig_free() calls. No functional changes. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:49:42 2018 (r330149) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:50:42 2018 (r330150) @@ -234,13 +234,9 @@ static int iwm_dma_contig_alloc(bus_dma_tag_t, struct bus_size_t, bus_size_t); static void iwm_dma_contig_free(struct iwm_dma_info *); static int iwm_alloc_fwmem(struct iwm_softc *); -static void iwm_free_fwmem(struct iwm_softc *); static int iwm_alloc_sched(struct iwm_softc *); -static void iwm_free_sched(struct iwm_softc *); static int iwm_alloc_kw(struct iwm_softc *); -static void iwm_free_kw(struct iwm_softc *); static int iwm_alloc_ict(struct iwm_softc *); -static void iwm_free_ict(struct iwm_softc *); static int iwm_alloc_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); static void iwm_disable_rx_dma(struct iwm_softc *); static void iwm_reset_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); @@ -902,12 +898,6 @@ iwm_alloc_fwmem(struct iwm_softc *sc) sc->sc_fwdmasegsz, 16); } -static void -iwm_free_fwmem(struct iwm_softc *sc) -{ - iwm_dma_contig_free(&sc->fw_dma); -} - /* tx scheduler rings. not used? */ static int iwm_alloc_sched(struct iwm_softc *sc) @@ -917,12 +907,6 @@ iwm_alloc_sched(struct iwm_softc *sc) nitems(sc->txq) * sizeof(struct iwm_agn_scd_bc_tbl), 1024); } -static void -iwm_free_sched(struct iwm_softc *sc) -{ - iwm_dma_contig_free(&sc->sched_dma); -} - /* keep-warm page is used internally by the card. see iwl-fh.h for more info */ static int iwm_alloc_kw(struct iwm_softc *sc) @@ -930,12 +914,6 @@ iwm_alloc_kw(struct iwm_softc *sc) return iwm_dma_contig_alloc(sc->sc_dmat, &sc->kw_dma, 4096, 4096); } -static void -iwm_free_kw(struct iwm_softc *sc) -{ - iwm_dma_contig_free(&sc->kw_dma); -} - /* interrupt cause table */ static int iwm_alloc_ict(struct iwm_softc *sc) @@ -944,12 +922,6 @@ iwm_alloc_ict(struct iwm_softc *sc) IWM_ICT_SIZE, 1<ict_dma); -} - static int iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring) { @@ -6173,13 +6145,10 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 iwm_fw_info_free(fw); /* Free scheduler */ - iwm_free_sched(sc); - if (sc->ict_dma.vaddr != NULL) - iwm_free_ict(sc); - if (sc->kw_dma.vaddr != NULL) - iwm_free_kw(sc); - if (sc->fw_dma.vaddr != NULL) - iwm_free_fwmem(sc); + iwm_dma_contig_free(&sc->sched_dma); + iwm_dma_contig_free(&sc->ict_dma); + iwm_dma_contig_free(&sc->kw_dma); + iwm_dma_contig_free(&sc->fw_dma); /* Finished with the hardware - detach things */ iwm_pci_detach(dev); From owner-svn-src-all@freebsd.org Thu Mar 1 04:52:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B14E6F44BFD; Thu, 1 Mar 2018 04:52:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 637217A4B6; Thu, 1 Mar 2018 04:52:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DC6E23C26; Thu, 1 Mar 2018 04:52:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214qOLQ005599; Thu, 1 Mar 2018 04:52:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214qOJN005597; Thu, 1 Mar 2018 04:52:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010452.w214qOJN005597@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 04:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330151 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:52:25 -0000 Author: eadler Date: Thu Mar 1 04:52:23 2018 New Revision: 330151 URL: https://svnweb.freebsd.org/changeset/base/330151 Log: MFC r306004: [iwm] Remove deprecated scan API definitions. * This removes deprecated scan API definitions, which have been unused since the upgrade to version 16 firmware in change r303327. * Part of this change matches the header-file changes in Linux git commit 1f9403863c080478ad78247c89b018e95bdfb027. * No functional change. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:50:42 2018 (r330150) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:52:23 2018 (r330151) @@ -5202,7 +5202,6 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_PHY_CONTEXT_CMD: case IWM_BINDING_CONTEXT_CMD: case IWM_TIME_EVENT_CMD: - case IWM_SCAN_REQUEST_CMD: case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_CFG_CMD): case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_REQ_UMAC): case IWM_SCAN_OFFLOAD_REQUEST_CMD: Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:50:42 2018 (r330150) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:52:23 2018 (r330151) @@ -1839,11 +1839,9 @@ enum { IWM_REPLY_THERMAL_MNG_BACKOFF = 0x7e, /* Scanning */ - IWM_SCAN_REQUEST_CMD = 0x80, IWM_SCAN_ABORT_CMD = 0x81, IWM_SCAN_START_NOTIFICATION = 0x82, IWM_SCAN_RESULTS_NOTIFICATION = 0x83, - IWM_SCAN_COMPLETE_NOTIFICATION = 0x84, /* NVM */ IWM_NVM_ACCESS_CMD = 0x88, @@ -4767,53 +4765,11 @@ struct iwm_scd_txq_cfg_rsp { /* Masks for iwm_scan_channel.type flags */ #define IWM_SCAN_CHANNEL_TYPE_ACTIVE (1 << 0) #define IWM_SCAN_CHANNEL_NSSIDS(x) (((1 << (x)) - 1) << 1) -#define IWM_SCAN_CHANNEL_NARROW_BAND (1 << 22) /* Max number of IEs for direct SSID scans in a command */ #define IWM_PROBE_OPTION_MAX 20 /** - * struct iwm_scan_channel - entry in IWM_REPLY_SCAN_CMD channel table - * @channel: band is selected by iwm_scan_cmd "flags" field - * @tx_gain: gain for analog radio - * @dsp_atten: gain for DSP - * @active_dwell: dwell time for active scan in TU, typically 5-50 - * @passive_dwell: dwell time for passive scan in TU, typically 20-500 - * @type: type is broken down to these bits: - * bit 0: 0 = passive, 1 = active - * bits 1-20: SSID direct bit map. If any of these bits is set then - * the corresponding SSID IE is transmitted in probe request - * (bit i adds IE in position i to the probe request) - * bit 22: channel width, 0 = regular, 1 = TGj narrow channel - * - * @iteration_count: - * @iteration_interval: - * This struct is used once for each channel in the scan list. - * Each channel can independently select: - * 1) SSID for directed active scans - * 2) Txpower setting (for rate specified within Tx command) - * 3) How long to stay on-channel (behavior may be modified by quiet_time, - * quiet_plcp_th, good_CRC_th) - * - * To avoid uCode errors, make sure the following are true (see comments - * under struct iwm_scan_cmd about max_out_time and quiet_time): - * 1) If using passive_dwell (i.e. passive_dwell != 0): - * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0) - * 2) quiet_time <= active_dwell - * 3) If restricting off-channel time (i.e. max_out_time !=0): - * passive_dwell < max_out_time - * active_dwell < max_out_time - */ -struct iwm_scan_channel { - uint32_t type; - uint16_t channel; - uint16_t iteration_count; - uint32_t iteration_interval; - uint16_t active_dwell; - uint16_t passive_dwell; -} __packed; /* IWM_SCAN_CHANNEL_CONTROL_API_S_VER_1 */ - -/** * struct iwm_ssid_ie - directed scan network information element * * Up to 20 of these may appear in IWM_REPLY_SCAN_CMD, @@ -4828,7 +4784,6 @@ struct iwm_ssid_ie { } __packed; /* IWM_SCAN_DIRECT_SSID_IE_API_S_VER_1 */ /* scan offload */ -#define IWM_MAX_SCAN_CHANNELS 40 #define IWM_SCAN_MAX_BLACKLIST_LEN 64 #define IWM_SCAN_SHORT_BLACKLIST_LEN 16 #define IWM_SCAN_MAX_PROFILES 11 @@ -4844,45 +4799,6 @@ struct iwm_ssid_ie { #define IWM_FAST_SCHED_SCAN_ITERATIONS 3 #define IWM_MAX_SCHED_SCAN_PLANS 2 -/** - * iwm_scan_flags - masks for scan command flags - *@IWM_SCAN_FLAGS_PERIODIC_SCAN: - *@IWM_SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX: - *@IWM_SCAN_FLAGS_DELAYED_SCAN_LOWBAND: - *@IWM_SCAN_FLAGS_DELAYED_SCAN_HIGHBAND: - *@IWM_SCAN_FLAGS_FRAGMENTED_SCAN: - *@IWM_SCAN_FLAGS_PASSIVE2ACTIVE: use active scan on channels that was active - * in the past hour, even if they are marked as passive. - */ -enum iwm_scan_flags { - IWM_SCAN_FLAGS_PERIODIC_SCAN = (1 << 0), - IWM_SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX = (1 << 1), - IWM_SCAN_FLAGS_DELAYED_SCAN_LOWBAND = (1 << 2), - IWM_SCAN_FLAGS_DELAYED_SCAN_HIGHBAND = (1 << 3), - IWM_SCAN_FLAGS_FRAGMENTED_SCAN = (1 << 4), - IWM_SCAN_FLAGS_PASSIVE2ACTIVE = (1 << 5), -}; - -/** - * enum iwm_scan_type - Scan types for scan command - * @IWM_SCAN_TYPE_FORCED: - * @IWM_SCAN_TYPE_BACKGROUND: - * @IWM_SCAN_TYPE_OS: - * @IWM_SCAN_TYPE_ROAMING: - * @IWM_SCAN_TYPE_ACTION: - * @IWM_SCAN_TYPE_DISCOVERY: - * @IWM_SCAN_TYPE_DISCOVERY_FORCED: - */ -enum iwm_scan_type { - IWM_SCAN_TYPE_FORCED = 0, - IWM_SCAN_TYPE_BACKGROUND = 1, - IWM_SCAN_TYPE_OS = 2, - IWM_SCAN_TYPE_ROAMING = 3, - IWM_SCAN_TYPE_ACTION = 4, - IWM_SCAN_TYPE_DISCOVERY = 5, - IWM_SCAN_TYPE_DISCOVERY_FORCED = 6, -}; /* IWM_SCAN_ACTIVITY_TYPE_E_VER_1 */ - /* Maximal number of channels to scan */ #define IWM_MAX_NUM_SCAN_CHANNELS 0x24 @@ -5076,52 +4992,6 @@ struct iwm_periodic_scan_complete { uint32_t reserved; } __packed; -/* Response to scan request contains only status with one of these values */ -#define IWM_SCAN_RESPONSE_OK 0x1 -#define IWM_SCAN_RESPONSE_ERROR 0x2 - -/* - * IWM_SCAN_ABORT_CMD = 0x81 - * When scan abort is requested, the command has no fields except the common - * header. The response contains only a status with one of these values. - */ -#define IWM_SCAN_ABORT_POSSIBLE 0x1 -#define IWM_SCAN_ABORT_IGNORED 0x2 /* no pending scans */ - -/* TODO: complete documentation */ -#define IWM_SCAN_OWNER_STATUS 0x1 -#define IWM_MEASURE_OWNER_STATUS 0x2 - -/** - * struct iwm_scan_start_notif - notifies start of scan in the device - * ( IWM_SCAN_START_NOTIFICATION = 0x82 ) - * @tsf_low: TSF timer (lower half) in usecs - * @tsf_high: TSF timer (higher half) in usecs - * @beacon_timer: structured as follows: - * bits 0:19 - beacon interval in usecs - * bits 20:23 - reserved (0) - * bits 24:31 - number of beacons - * @channel: which channel is scanned - * @band: 0 for 5.2 GHz, 1 for 2.4 GHz - * @status: one of *_OWNER_STATUS - */ -struct iwm_scan_start_notif { - uint32_t tsf_low; - uint32_t tsf_high; - uint32_t beacon_timer; - uint8_t channel; - uint8_t band; - uint8_t reserved[2]; - uint32_t status; -} __packed; /* IWM_SCAN_START_NTF_API_S_VER_1 */ - -/* scan results probe_status first bit indicates success */ -#define IWM_SCAN_PROBE_STATUS_OK 0 -#define IWM_SCAN_PROBE_STATUS_TX_FAILED (1 << 0) -/* error statuses combined with TX_FAILED */ -#define IWM_SCAN_PROBE_STATUS_FAIL_TTL (1 << 1) -#define IWM_SCAN_PROBE_STATUS_FAIL_BT (1 << 2) - /* How many statistics are gathered for each channel */ #define IWM_SCAN_RESULTS_STATISTICS 1 @@ -5176,27 +5046,6 @@ struct iwm_scan_results_notif { uint32_t statistics[IWM_SCAN_RESULTS_STATISTICS]; } __packed; /* IWM_SCAN_RESULT_NTF_API_S_VER_2 */ -/** - * struct iwm_scan_complete_notif - notifies end of scanning (all channels) - * ( IWM_SCAN_COMPLETE_NOTIFICATION = 0x84 ) - * @scanned_channels: number of channels scanned (and number of valid results) - * @status: one of IWM_SCAN_COMP_STATUS_* - * @bt_status: BT on/off status - * @last_channel: last channel that was scanned - * @tsf_low: TSF timer (lower half) in usecs - * @tsf_high: TSF timer (higher half) in usecs - * @results: all scan results, only "scanned_channels" of them are valid - */ -struct iwm_scan_complete_notif { - uint8_t scanned_channels; - uint8_t status; - uint8_t bt_status; - uint8_t last_channel; - uint32_t tsf_low; - uint32_t tsf_high; - struct iwm_scan_results_notif results[IWM_MAX_NUM_SCAN_CHANNELS]; -} __packed; /* IWM_SCAN_COMPLETE_NTF_API_S_VER_2 */ - enum iwm_scan_framework_client { IWM_SCAN_CLIENT_SCHED_SCAN = (1 << 0), IWM_SCAN_CLIENT_NETDETECT = (1 << 1), @@ -5204,83 +5053,6 @@ enum iwm_scan_framework_client { }; /** - * struct iwm_scan_offload_cmd - IWM_SCAN_REQUEST_FIXED_PART_API_S_VER_6 - * @scan_flags: see enum iwm_scan_flags - * @channel_count: channels in channel list - * @quiet_time: dwell time, in milisiconds, on quiet channel - * @quiet_plcp_th: quiet channel num of packets threshold - * @good_CRC_th: passive to active promotion threshold - * @rx_chain: RXON rx chain. - * @max_out_time: max uSec to be out of assoceated channel - * @suspend_time: pause scan this long when returning to service channel - * @flags: RXON flags - * @filter_flags: RXONfilter - * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz. - * @direct_scan: list of SSIDs for directed active scan - * @scan_type: see enum iwm_scan_type. - * @rep_count: repetition count for each scheduled scan iteration. - */ -struct iwm_scan_offload_cmd { - uint16_t len; - uint8_t scan_flags; - uint8_t channel_count; - uint16_t quiet_time; - uint16_t quiet_plcp_th; - uint16_t good_CRC_th; - uint16_t rx_chain; - uint32_t max_out_time; - uint32_t suspend_time; - /* IWM_RX_ON_FLAGS_API_S_VER_1 */ - uint32_t flags; - uint32_t filter_flags; - struct iwm_tx_cmd tx_cmd[2]; - /* IWM_SCAN_DIRECT_SSID_IE_API_S_VER_1 */ - struct iwm_ssid_ie direct_scan[IWM_PROBE_OPTION_MAX]; - uint32_t scan_type; - uint32_t rep_count; -} __packed; - -enum iwm_scan_offload_channel_flags { - IWM_SCAN_OFFLOAD_CHANNEL_ACTIVE = (1 << 0), - IWM_SCAN_OFFLOAD_CHANNEL_NARROW = (1 << 22), - IWM_SCAN_OFFLOAD_CHANNEL_FULL = (1 << 24), - IWM_SCAN_OFFLOAD_CHANNEL_PARTIAL = (1 << 25), -}; - -/** - * iwm_scan_channel_cfg - IWM_SCAN_CHANNEL_CFG_S - * @type: bitmap - see enum iwm_scan_offload_channel_flags. - * 0: passive (0) or active (1) scan. - * 1-20: directed scan to i'th ssid. - * 22: channel width configuation - 1 for narrow. - * 24: full scan. - * 25: partial scan. - * @channel_number: channel number 1-13 etc. - * @iter_count: repetition count for the channel. - * @iter_interval: interval between two innteration on one channel. - * @dwell_time: entry 0 - active scan, entry 1 - passive scan. - */ -struct iwm_scan_channel_cfg { - uint32_t type[IWM_MAX_SCAN_CHANNELS]; - uint16_t channel_number[IWM_MAX_SCAN_CHANNELS]; - uint16_t iter_count[IWM_MAX_SCAN_CHANNELS]; - uint32_t iter_interval[IWM_MAX_SCAN_CHANNELS]; - uint8_t dwell_time[IWM_MAX_SCAN_CHANNELS][2]; -} __packed; - -/** - * iwm_scan_offload_cfg - IWM_SCAN_OFFLOAD_CONFIG_API_S - * @scan_cmd: scan command fixed part - * @channel_cfg: scan channel configuration - * @data: probe request frames (one per band) - */ -struct iwm_scan_offload_cfg { - struct iwm_scan_offload_cmd scan_cmd; - struct iwm_scan_channel_cfg channel_cfg; - uint8_t data[0]; -} __packed; - -/** * iwm_scan_offload_blacklist - IWM_SCAN_OFFLOAD_BLACKLIST_S * @ssid: MAC address to filter out * @reported_rssi: AP rssi reported to the host @@ -5345,48 +5117,7 @@ struct iwm_scan_offload_profile_cfg { uint8_t reserved[2]; } __packed; -/** - * iwm_scan_offload_schedule - schedule of scan offload - * @delay: delay between iterations, in seconds. - * @iterations: num of scan iterations - * @full_scan_mul: number of partial scans before each full scan - */ -struct iwm_scan_offload_schedule { - uint16_t delay; - uint8_t iterations; - uint8_t full_scan_mul; -} __packed; - -/* - * iwm_scan_offload_flags - * - * IWM_SCAN_OFFLOAD_FLAG_PASS_ALL: pass all results - no filtering. - * IWM_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL: add cached channels to partial scan. - * IWM_SCAN_OFFLOAD_FLAG_ENERGY_SCAN: use energy based scan before partial scan - * on A band. - */ -enum iwm_scan_offload_flags { - IWM_SCAN_OFFLOAD_FLAG_PASS_ALL = (1 << 0), - IWM_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL = (1 << 2), - IWM_SCAN_OFFLOAD_FLAG_ENERGY_SCAN = (1 << 3), -}; - -/** - * iwm_scan_offload_req - scan offload request command - * @flags: bitmap - enum iwm_scan_offload_flags. - * @watchdog: maximum scan duration in TU. - * @delay: delay in seconds before first iteration. - * @schedule_line: scan offload schedule, for fast and regular scan. - */ -struct iwm_scan_offload_req { - uint16_t flags; - uint16_t watchdog; - uint16_t delay; - uint16_t reserved; - struct iwm_scan_offload_schedule schedule_line[2]; -} __packed; - -enum iwm_scan_offload_compleate_status { +enum iwm_scan_offload_complete_status { IWM_SCAN_OFFLOAD_COMPLETED = 1, IWM_SCAN_OFFLOAD_ABORTED = 2, }; @@ -5412,30 +5143,6 @@ struct iwm_lmac_scan_complete_notif { struct iwm_scan_results_notif results[]; } __packed; - -/** - * iwm_scan_offload_complete - IWM_SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1 - * @last_schedule_line: last schedule line executed (fast or regular) - * @last_schedule_iteration: last scan iteration executed before scan abort - * @status: enum iwm_scan_offload_compleate_status - */ -struct iwm_scan_offload_complete { - uint8_t last_schedule_line; - uint8_t last_schedule_iteration; - uint8_t status; - uint8_t reserved; -} __packed; - -/** - * iwm_sched_scan_results - IWM_SCAN_OFFLOAD_MATCH_FOUND_NTF_API_S_VER_1 - * @ssid_bitmap: SSIDs indexes found in this iteration - * @client_bitmap: clients that are active and wait for this notification - */ -struct iwm_sched_scan_results { - uint16_t ssid_bitmap; - uint8_t client_bitmap; - uint8_t reserved; -}; /* * END mvm/fw-api-scan.h From owner-svn-src-all@freebsd.org Thu Mar 1 04:53:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6376EF44D8D; Thu, 1 Mar 2018 04:53:55 +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 15B1D7A653; Thu, 1 Mar 2018 04:53:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F47B23C35; Thu, 1 Mar 2018 04:53:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214rs9I005690; Thu, 1 Mar 2018 04:53:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214rsVa005688; Thu, 1 Mar 2018 04:53:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010453.w214rsVa005688@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 04:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330152 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:53:55 -0000 Author: eadler Date: Thu Mar 1 04:53:54 2018 New Revision: 330152 URL: https://svnweb.freebsd.org/changeset/base/330152 Log: MFC r306005: [iwm] Use IWM_DEFAULT_SCAN_CHANNELS define as default for sc_capa_n_scan_channels. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:52:23 2018 (r330151) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:53:54 2018 (r330152) @@ -442,6 +442,8 @@ iwm_firmware_store_section(struct iwm_softc *sc, return 0; } +#define IWM_DEFAULT_SCAN_CHANNELS 40 + /* iwlwifi: iwl-drv.c */ struct iwm_tlv_calib_data { uint32_t ucode_type; @@ -518,7 +520,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode /* (Re-)Initialize default values. */ sc->sc_capaflags = 0; - sc->sc_capa_n_scan_channels = IWM_MAX_NUM_SCAN_CHANNELS; + sc->sc_capa_n_scan_channels = IWM_DEFAULT_SCAN_CHANNELS; memset(sc->sc_enabled_capa, 0, sizeof(sc->sc_enabled_capa)); memset(sc->sc_fw_mcc, 0, sizeof(sc->sc_fw_mcc)); Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:52:23 2018 (r330151) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:53:54 2018 (r330152) @@ -4799,9 +4799,6 @@ struct iwm_ssid_ie { #define IWM_FAST_SCHED_SCAN_ITERATIONS 3 #define IWM_MAX_SCHED_SCAN_PLANS 2 -/* Maximal number of channels to scan */ -#define IWM_MAX_NUM_SCAN_CHANNELS 0x24 - /** * iwm_scan_schedule_lmac - schedule of scan offload * @delay: delay between iterations, in seconds. From owner-svn-src-all@freebsd.org Thu Mar 1 04:55:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7B95F44E95; Thu, 1 Mar 2018 04:55:00 +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 7D2587A79F; Thu, 1 Mar 2018 04:55:00 +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 780ED23C37; Thu, 1 Mar 2018 04:55:00 +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 w214t0XO005811; Thu, 1 Mar 2018 04:55:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214t0e6005809; Thu, 1 Mar 2018 04:55:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010455.w214t0e6005809@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 04:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330153 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:55:01 -0000 Author: eadler Date: Thu Mar 1 04:55:00 2018 New Revision: 330153 URL: https://svnweb.freebsd.org/changeset/base/330153 Log: MFC r306005: [iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data. * No functional change, none of these values were ever read. * The values removed from struct iwm_nvm_data are only used for old dvm devices in Linux iwlwifi, and irrelevant to iwm hence. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:53:54 2018 (r330152) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:55:00 2018 (r330153) @@ -437,7 +437,6 @@ iwm_firmware_store_section(struct iwm_softc *sc, fwone->fws_len = dlen - sizeof(uint32_t); fws->fw_count++; - fws->fw_totlen += fwone->fws_len; return 0; } @@ -2151,11 +2150,6 @@ iwm_parse_nvm_data(struct iwm_softc *sc, memcpy(data->nvm_ch_flags, ®ulatory[IWM_NVM_CHANNELS_8000], IWM_NUM_CHANNELS_8000 * sizeof(uint16_t)); } - data->calib_version = 255; /* TODO: - this value will prevent some checks from - failing, we need to check if this - field is still needed, and if it does, - where is it in the NVM */ return 0; } Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 04:53:54 2018 (r330152) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 04:55:00 2018 (r330153) @@ -170,7 +170,6 @@ struct iwm_fw_info { uint32_t fws_len; uint32_t fws_devoff; } fw_sect[IWM_UCODE_SECT_MAX]; - size_t fw_totlen; int fw_count; } fw_sects[IWM_UCODE_TYPE_MAX]; }; @@ -178,14 +177,6 @@ struct iwm_fw_info { struct iwm_nvm_data { int n_hw_addrs; uint8_t hw_addr[IEEE80211_ADDR_LEN]; - - uint8_t calib_version; - uint16_t calib_voltage; - - uint16_t raw_temperature; - uint16_t kelvin_temperature; - uint16_t kelvin_voltage; - uint16_t xtal_calib[2]; int sku_cap_band_24GHz_enable; int sku_cap_band_52GHz_enable; From owner-svn-src-all@freebsd.org Thu Mar 1 04:56:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D79B1F0E0D9; Thu, 1 Mar 2018 04:56:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 889217A948; Thu, 1 Mar 2018 04:56:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 830EC23C3B; Thu, 1 Mar 2018 04:56:49 +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 w214un9J005911; Thu, 1 Mar 2018 04:56:49 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214unx3005910; Thu, 1 Mar 2018 04:56:49 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010456.w214unx3005910@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 04:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330154 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:56:50 -0000 Author: eadler Date: Thu Mar 1 04:56:49 2018 New Revision: 330154 URL: https://svnweb.freebsd.org/changeset/base/330154 Log: MFC r306007: [iwm] Improve reliability of iwm_release on disassociation a bit. * We need to first call ivp->iv_newstate(), to enqueue the deauth/deassoc mgmt frame, then flush the tx queue, before actually calling iwm_release(). * cycling a wlan connection via wpa_cli frontend to wpa_supplicant, by issuing disconnect and reconnect commandos works quite well. (There is still an issue when disconnecting/reconnecting too quickly) * Reassociating or roaming via wpa_supplicant is still broken. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:55:00 2018 (r330153) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:56:49 2018 (r330154) @@ -329,6 +329,8 @@ static int iwm_tx(struct iwm_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); +static int iwm_mvm_flush_tx_path(struct iwm_softc *sc, + uint32_t tfd_msk, uint32_t flags); static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *, struct iwm_mvm_add_sta_cmd_v7 *, int *); @@ -3512,7 +3514,6 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m * mvm/tx.c */ -#if 0 /* * Note that there are transports that buffer frames before they reach * the firmware. This means that after flush_tx_path is called, the @@ -3522,23 +3523,21 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m * 3) wait for the transport queues to be empty */ int -iwm_mvm_flush_tx_path(struct iwm_softc *sc, int tfd_msk, int sync) +iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags) { + int ret; struct iwm_tx_path_flush_cmd flush_cmd = { .queues_ctl = htole32(tfd_msk), .flush_ctl = htole16(IWM_DUMP_TX_FIFO_FLUSH), }; - int ret; - ret = iwm_mvm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, - sync ? IWM_CMD_SYNC : IWM_CMD_ASYNC, + ret = iwm_mvm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, flags, sizeof(flush_cmd), &flush_cmd); if (ret) device_printf(sc->sc_dev, "Flushing tx queue failed: %d\n", ret); return ret; } -#endif /* * BEGIN mvm/sta.c @@ -3894,6 +3893,8 @@ iwm_assoc(struct ieee80211vap *vap, struct iwm_softc * static int iwm_release(struct iwm_softc *sc, struct iwm_node *in) { + uint32_t tfd_msk; + /* * Ok, so *technically* the proper set of calls for going * from RUN back to SCAN is: @@ -3913,7 +3914,18 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * back to nothing anyway, we'll just do a complete device reset. * Up your's, device! */ - /* iwm_mvm_flush_tx_path(sc, 0xf, 1); */ + /* + * Just using 0xf for the queues mask is fine as long as we only + * get here from RUN state. + */ + tfd_msk = 0xf; + mbufq_drain(&sc->sc_snd); + iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC); + /* + * We seem to get away with just synchronously sending the + * IWM_TXPATH_FLUSH command. + */ +// iwm_trans_wait_tx_queue_empty(sc, tfd_msk); iwm_stop_device(sc); iwm_init_hw(sc); if (in) @@ -4120,7 +4132,17 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; - iwm_release(sc, NULL); + if (nstate == IEEE80211_S_INIT) { + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + error = ivp->iv_newstate(vap, nstate, arg); + IEEE80211_UNLOCK(ic); + IWM_LOCK(sc); + iwm_release(sc, NULL); + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + return error; + } /* * It's impossible to directly go RUN->SCAN. If we iwm_release() From owner-svn-src-all@freebsd.org Thu Mar 1 04:58:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF3FF0E290; Thu, 1 Mar 2018 04:58:01 +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 403837AABD; Thu, 1 Mar 2018 04:58:01 +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 3B26323C3C; Thu, 1 Mar 2018 04:58:01 +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 w214w1HS005994; Thu, 1 Mar 2018 04:58:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214w1Jp005993; Thu, 1 Mar 2018 04:58:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010458.w214w1Jp005993@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 04:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330155 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:58:01 -0000 Author: eadler Date: Thu Mar 1 04:58:00 2018 New Revision: 330155 URL: https://svnweb.freebsd.org/changeset/base/330155 Log: MFC r306142: [iwm] use rate control info from the node txrates; use mgmtrate for EAPOL frames This changes the transmit rate control code to do a few things: * use fixed rates (mcast, ucast, mgmt) where required. * Don't use a hard-coded 11a or 11bg rate for non-data frames - use what net80211 says we should use. * use mgmtrate for EAPOL frames. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:56:49 2018 (r330154) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:58:00 2018 (r330155) @@ -324,7 +324,7 @@ static void iwm_update_sched(struct iwm_softc *, int, #endif static const struct iwm_rate * iwm_tx_fill_cmd(struct iwm_softc *, struct iwm_node *, - struct ieee80211_frame *, struct iwm_tx_cmd *); + struct mbuf *, struct iwm_tx_cmd *); static int iwm_tx(struct iwm_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, @@ -3192,24 +3192,36 @@ iwm_tx_rateidx_lookup(struct iwm_softc *sc, struct iwm */ static const struct iwm_rate * iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node *in, - struct ieee80211_frame *wh, struct iwm_tx_cmd *tx) + struct mbuf *m, struct iwm_tx_cmd *tx) { - struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni = &in->in_ni; + struct ieee80211_frame *wh; + const struct ieee80211_txparam *tp = ni->ni_txparms; const struct iwm_rate *rinfo; - int type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - int ridx, rate_flags; + int type; + int ridx, rate_flags, i; + wh = mtod(m, struct ieee80211_frame *); + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + tx->rts_retry_limit = IWM_RTS_DFAULT_RETRY_LIMIT; tx->data_retry_limit = IWM_DEFAULT_TX_RETRY; - /* - * XXX TODO: everything about the rate selection here is terrible! - */ - - if (type == IEEE80211_FC0_TYPE_DATA) { - int i; + if (type == IEEE80211_FC0_TYPE_MGT) { + i = iwm_tx_rateidx_lookup(sc, in, tp->mgmtrate); + ridx = in->in_ridx[i]; + } else if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + i = iwm_tx_rateidx_lookup(sc, in, tp->mcastrate); + ridx = in->in_ridx[i]; + } else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) { + i = iwm_tx_rateidx_lookup(sc, in, tp->ucastrate); + ridx = in->in_ridx[i]; + } else if (m->m_flags & M_EAPOL) { + i = iwm_tx_rateidx_lookup(sc, in, tp->mgmtrate); + ridx = in->in_ridx[i]; + } else { /* for data frames, use RS table */ + /* XXX pass pktlen */ (void) ieee80211_ratectl_rate(ni, NULL, 0); i = iwm_tx_rateidx_lookup(sc, in, ni->ni_txrate); ridx = in->in_ridx[i]; @@ -3220,28 +3232,6 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, "%s: start with i=%d, txrate %d\n", __func__, i, iwm_rates[ridx].rate); - } else { - /* - * For non-data, use the lowest supported rate for the given - * operational mode. - * - * Note: there may not be any rate control information available. - * This driver currently assumes if we're transmitting data - * frames, use the rate control table. Grr. - * - * XXX TODO: use the configured rate for the traffic type! - * XXX TODO: this should be per-vap, not curmode; as we later - * on we'll want to handle off-channel stuff (eg TDLS). - */ - if (ic->ic_curmode == IEEE80211_MODE_11A) { - /* - * XXX this assumes the mode is either 11a or not 11a; - * definitely won't work for 11n. - */ - ridx = IWM_RIDX_OFDM; - } else { - ridx = IWM_RIDX_CCK; - } } rinfo = &iwm_rates[ridx]; @@ -3303,7 +3293,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie tx = (void *)cmd->data; memset(tx, 0, sizeof(*tx)); - rinfo = iwm_tx_fill_cmd(sc, in, wh, tx); + rinfo = iwm_tx_fill_cmd(sc, in, m, tx); /* Encrypt the frame if need be. */ if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { From owner-svn-src-all@freebsd.org Thu Mar 1 04:59:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9744EF0E4C1; Thu, 1 Mar 2018 04:59: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 4857A7AC4B; Thu, 1 Mar 2018 04:59: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 432F023C40; Thu, 1 Mar 2018 04:59: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 w214xuI5006095; Thu, 1 Mar 2018 04:59:56 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214xuoR006094; Thu, 1 Mar 2018 04:59:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010459.w214xuoR006094@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 04:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330156 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 04:59:56 -0000 Author: eadler Date: Thu Mar 1 04:59:55 2018 New Revision: 330156 URL: https://svnweb.freebsd.org/changeset/base/330156 Log: MFC r306286: [iwm] fix default antenna selection a bit; fix 5GHz rate control handling. * Don't do the antenna switching when setting up the rate table - we don't take into account whether it's an active antenna or not (eg shared with BT.) I'll look into this a bit more later. * The default antenna is still 1, I'll look into that a bit more later. (So no, this doesn't fix it for Larry who needs ANT_B to be active, not ANT_A.) * My changes to the rate control setup used the wrong method for finding a suitable rate, which led to 1M CCK frames being queued for 11a operation. This is .. sub-optimal. Change the rate control lookup path to use the global table instead of the per-node table, which won't be setup until the node rate table is setup (which happens way too late in this game.) Tested: * Intel 7260, 2G and 5G operation. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:58:00 2018 (r330155) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:59:55 2018 (r330156) @@ -2672,6 +2672,15 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn if (error != 0) return error; + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "%s: phy_txant=0x%08x, nvm_valid_tx_ant=0x%02x, valid=0x%02x\n", + __func__, + ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) + >> IWM_FW_PHY_CFG_TX_CHAIN_POS), + sc->sc_nvm.valid_tx_ant, + iwm_fw_valid_tx_ant(sc)); + + /* Send TX valid antennas before triggering calibrations */ if ((error = iwm_send_tx_ant_cfg(sc, iwm_fw_valid_tx_ant(sc))) != 0) { device_printf(sc->sc_dev, @@ -3182,11 +3191,34 @@ iwm_tx_rateidx_lookup(struct iwm_softc *sc, struct iwm if (rate == r) return (i); } + + IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, + "%s: couldn't find an entry for rate=%d\n", + __func__, + rate); + /* XXX Return the first */ /* XXX TODO: have it return the /lowest/ */ return (0); } +static int +iwm_tx_rateidx_global_lookup(struct iwm_softc *sc, uint8_t rate) +{ + int i; + + for (i = 0; i < nitems(iwm_rates); i++) { + if (iwm_rates[i].rate == rate) + return (i); + } + /* XXX error? */ + IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, + "%s: couldn't find an entry for rate=%d\n", + __func__, + rate); + return (0); +} + /* * Fill in the rate related information for a transmit command. */ @@ -3199,7 +3231,7 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node const struct ieee80211_txparam *tp = ni->ni_txparms; const struct iwm_rate *rinfo; int type; - int ridx, rate_flags, i; + int ridx, rate_flags; wh = mtod(m, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; @@ -3208,19 +3240,26 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node tx->data_retry_limit = IWM_DEFAULT_TX_RETRY; if (type == IEEE80211_FC0_TYPE_MGT) { - i = iwm_tx_rateidx_lookup(sc, in, tp->mgmtrate); - ridx = in->in_ridx[i]; + ridx = iwm_tx_rateidx_global_lookup(sc, tp->mgmtrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "%s: MGT (%d)\n", __func__, tp->mgmtrate); } else if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { - i = iwm_tx_rateidx_lookup(sc, in, tp->mcastrate); - ridx = in->in_ridx[i]; + ridx = iwm_tx_rateidx_global_lookup(sc, tp->mcastrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "%s: MCAST (%d)\n", __func__, tp->mcastrate); } else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) { - i = iwm_tx_rateidx_lookup(sc, in, tp->ucastrate); - ridx = in->in_ridx[i]; + ridx = iwm_tx_rateidx_global_lookup(sc, tp->ucastrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "%s: FIXED_RATE (%d)\n", __func__, tp->ucastrate); } else if (m->m_flags & M_EAPOL) { - i = iwm_tx_rateidx_lookup(sc, in, tp->mgmtrate); - ridx = in->in_ridx[i]; - } else { + ridx = iwm_tx_rateidx_global_lookup(sc, tp->mgmtrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "%s: EAPOL\n", __func__); + } else if (type == IEEE80211_FC0_TYPE_DATA) { + int i; + /* for data frames, use RS table */ + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: DATA\n", __func__); /* XXX pass pktlen */ (void) ieee80211_ratectl_rate(ni, NULL, 0); i = iwm_tx_rateidx_lookup(sc, in, ni->ni_txrate); @@ -3229,11 +3268,20 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node /* This is the index into the programmed table */ tx->initial_rate_index = i; tx->tx_flags |= htole32(IWM_TX_CMD_FLG_STA_RATE); + IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, "%s: start with i=%d, txrate %d\n", __func__, i, iwm_rates[ridx].rate); + } else { + ridx = iwm_tx_rateidx_global_lookup(sc, tp->mgmtrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: DEFAULT (%d)\n", + __func__, tp->mgmtrate); } + IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, + "%s: frame type=%d txrate %d\n", + __func__, type, iwm_rates[ridx].rate); + rinfo = &iwm_rates[ridx]; IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: ridx=%d; rate=%d, CCK=%d\n", @@ -3965,7 +4013,7 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in struct iwm_lq_cmd *lq = &in->in_lq; int nrates = ni->ni_rates.rs_nrates; int i, ridx, tab = 0; - int txant = 0; +// int txant = 0; if (nrates > nitems(lq->rs_table)) { device_printf(sc->sc_dev, @@ -4047,11 +4095,14 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in for (i = 0; i < nrates; i++) { int nextant; +#if 0 if (txant == 0) txant = iwm_fw_valid_tx_ant(sc); nextant = 1<<(ffs(txant)-1); txant &= ~nextant; - +#else + nextant = iwm_fw_valid_tx_ant(sc); +#endif /* * Map the rate id into a rate index into * our hardware table containing the From owner-svn-src-all@freebsd.org Thu Mar 1 05:01:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 781BBF49BD5; Thu, 1 Mar 2018 05:01: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 2AB3C7B273; Thu, 1 Mar 2018 05:01: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 25B9523DA5; Thu, 1 Mar 2018 05:01: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 w2151u5v009921; Thu, 1 Mar 2018 05:01:56 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2151ub4009920; Thu, 1 Mar 2018 05:01:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010501.w2151ub4009920@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 05:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330157 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:01:56 -0000 Author: eadler Date: Thu Mar 1 05:01:55 2018 New Revision: 330157 URL: https://svnweb.freebsd.org/changeset/base/330157 Log: MFC r306900: iwm: add missing 'Rx errors' counter incrementation. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:59:55 2018 (r330156) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:01:55 2018 (r330157) @@ -2918,14 +2918,14 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, device_printf(sc->sc_dev, "dsp size out of range [0,20]: %d\n", phy_info->cfg_phy_cnt); - return; + goto fail; } if (!(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_CRC_OK) || !(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_OVERRUN_OK)) { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "Bad CRC or FIFO: 0x%08X.\n", rx_pkt_status); - return; /* drop */ + goto fail; } if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_RX_ENERGY_API) { @@ -2947,7 +2947,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { device_printf(sc->sc_dev, "%s: unable to add more buffers\n", __func__); - return; + goto fail; } IWM_DPRINTF(sc, IWM_DEBUG_RECV, @@ -3020,6 +3020,10 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, ieee80211_input_mimo_all(ic, m, &rxs); } IWM_LOCK(sc); + + return; + +fail: counter_u64_add(ic->ic_ierrors, 1); } static int From owner-svn-src-all@freebsd.org Thu Mar 1 05:03:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDE86F4A5FF; Thu, 1 Mar 2018 05:03:18 +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 9191A7B62B; Thu, 1 Mar 2018 05:03:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C37A23DDA; Thu, 1 Mar 2018 05:03:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2153IIw010705; Thu, 1 Mar 2018 05:03:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2153IYv010704; Thu, 1 Mar 2018 05:03:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010503.w2153IYv010704@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 05:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330158 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:03:19 -0000 Author: eadler Date: Thu Mar 1 05:03:18 2018 New Revision: 330158 URL: https://svnweb.freebsd.org/changeset/base/330158 Log: MFC r308183: [iwm] Get rid of SYNC_RESP_STRUCT and SYNC_RESP_PTR macros. * SYNC_RESP_STRUCT and SYNC_RESP_PTR originate from the OpenBSD version of iwm, and they weren't serving any real purpose in the FreeBSD port. * We just do a single bus_dmamap_sync for syncing the complete received frame, instead of explicitly bus_dmamap_sync-ing subranges of the frame like in the OpenBSD iwm code. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:01:55 2018 (r330157) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:03:18 2018 (r330158) @@ -5049,18 +5049,6 @@ iwm_nic_error(struct iwm_softc *sc) } #endif -#define SYNC_RESP_STRUCT(_var_, _pkt_) \ -do { \ - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD);\ - _var_ = (void *)((_pkt_)+1); \ -} while (/*CONSTCOND*/0) - -#define SYNC_RESP_PTR(_ptr_, _len_, _pkt_) \ -do { \ - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD);\ - _ptr_ = (void *)((_pkt_)+1); \ -} while (/*CONSTCOND*/0) - #define ADVANCE_RXQ(sc) (sc->rxq.cur = (sc->rxq.cur + 1) % IWM_RX_RING_COUNT); /* @@ -5083,12 +5071,12 @@ iwm_notif_intr(struct iwm_softc *sc) */ while (sc->rxq.cur != hw) { struct iwm_rx_ring *ring = &sc->rxq; - struct iwm_rx_data *data = &sc->rxq.data[sc->rxq.cur]; + struct iwm_rx_data *data = &ring->data[ring->cur]; struct iwm_rx_packet *pkt; struct iwm_cmd_response *cresp; int qid, idx, code; - bus_dmamap_sync(sc->rxq.data_dmat, data->map, + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); pkt = mtod(data->m, struct iwm_rx_packet *); @@ -5098,7 +5086,7 @@ iwm_notif_intr(struct iwm_softc *sc) code = IWM_WIDE_ID(pkt->hdr.flags, pkt->hdr.code); IWM_DPRINTF(sc, IWM_DEBUG_INTR, "rx packet qid=%d idx=%d type=%x %d %d\n", - pkt->hdr.qid & ~0x80, pkt->hdr.idx, code, sc->rxq.cur, hw); + pkt->hdr.qid & ~0x80, pkt->hdr.idx, code, ring->cur, hw); /* * randomly get these from the firmware, no idea why. @@ -5130,7 +5118,7 @@ iwm_notif_intr(struct iwm_softc *sc) /* XXX look at mac_id to determine interface ID */ struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - SYNC_RESP_STRUCT(resp, pkt); + resp = (void *)pkt->data; missed = le32toh(resp->consec_missed_beacons); IWM_DPRINTF(sc, IWM_DEBUG_BEACON | IWM_DEBUG_STATE, @@ -5170,7 +5158,7 @@ iwm_notif_intr(struct iwm_softc *sc) struct iwm_mvm_alive_resp_v3 *resp3; if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp1)) { - SYNC_RESP_STRUCT(resp1, pkt); + resp1 = (void *)pkt->data; sc->sc_uc.uc_error_event_table = le32toh(resp1->error_event_table_ptr); sc->sc_uc.uc_log_event_table @@ -5183,7 +5171,7 @@ iwm_notif_intr(struct iwm_softc *sc) } if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp2)) { - SYNC_RESP_STRUCT(resp2, pkt); + resp2 = (void *)pkt->data; sc->sc_uc.uc_error_event_table = le32toh(resp2->error_event_table_ptr); sc->sc_uc.uc_log_event_table @@ -5198,7 +5186,7 @@ iwm_notif_intr(struct iwm_softc *sc) } if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp3)) { - SYNC_RESP_STRUCT(resp3, pkt); + resp3 = (void *)pkt->data; sc->sc_uc.uc_error_event_table = le32toh(resp3->error_event_table_ptr); sc->sc_uc.uc_log_event_table @@ -5218,7 +5206,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_CALIB_RES_NOTIF_PHY_DB: { struct iwm_calib_res_notif_phy_db *phy_db_notif; - SYNC_RESP_STRUCT(phy_db_notif, pkt); + phy_db_notif = (void *)pkt->data; iwm_phy_db_set_section(sc, phy_db_notif); @@ -5226,7 +5214,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_STATISTICS_NOTIFICATION: { struct iwm_notif_statistics *stats; - SYNC_RESP_STRUCT(stats, pkt); + stats = (void *)pkt->data; memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); break; } @@ -5234,8 +5222,6 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: if (sc->sc_wantresp == ((qid << 16) | idx)) { - bus_dmamap_sync(sc->rxq.data_dmat, data->map, - BUS_DMASYNC_POSTREAD); memcpy(sc->sc_cmd_resp, pkt, sizeof(sc->sc_cmd_resp)); } @@ -5243,7 +5229,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_MCC_CHUB_UPDATE_CMD: { struct iwm_mcc_chub_notif *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; sc->sc_fw_mcc[0] = (notif->mcc & 0xff00) >> 8; sc->sc_fw_mcc[1] = notif->mcc & 0xff; @@ -5276,7 +5262,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_LQ_CMD: case IWM_BT_CONFIG: case IWM_REPLY_THERMAL_MNG_BACKOFF: - SYNC_RESP_STRUCT(cresp, pkt); + cresp = (void *)pkt->data; if (sc->sc_wantresp == ((qid << 16) | idx)) { memcpy(sc->sc_cmd_resp, pkt, sizeof(*pkt)+sizeof(*cresp)); @@ -5294,20 +5280,20 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCAN_OFFLOAD_COMPLETE: { struct iwm_periodic_scan_complete *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; break; } case IWM_SCAN_ITERATION_COMPLETE: { struct iwm_lmac_scan_complete_notif *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; ieee80211_runtask(&sc->sc_ic, &sc->sc_es_task); break; } case IWM_SCAN_COMPLETE_UMAC: { struct iwm_umac_scan_complete *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "UMAC scan complete, status=0x%x\n", @@ -5320,7 +5306,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCAN_ITERATION_COMPLETE_UMAC: { struct iwm_umac_scan_iter_complete_notif *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "UMAC scan iteration " "complete, status=0x%x, %d channels scanned\n", @@ -5331,7 +5317,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_REPLY_ERROR: { struct iwm_error_resp *resp; - SYNC_RESP_STRUCT(resp, pkt); + resp = (void *)pkt->data; device_printf(sc->sc_dev, "firmware error 0x%x, cmd 0x%x\n", @@ -5342,7 +5328,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_TIME_EVENT_NOTIFICATION: { struct iwm_time_event_notif *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_INTR, "TE notif status = 0x%x action = 0x%x\n", @@ -5355,7 +5341,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCD_QUEUE_CFG: { struct iwm_scd_txq_cfg_rsp *rsp; - SYNC_RESP_STRUCT(rsp, pkt); + rsp = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_CMD, "queue cfg token=0x%x sta_id=%d " From owner-svn-src-all@freebsd.org Thu Mar 1 05:05:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA3F5F4A8A4; Thu, 1 Mar 2018 05:05:09 +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 68F1E7BA5F; Thu, 1 Mar 2018 05:05:09 +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 63E3E23DE0; Thu, 1 Mar 2018 05:05:09 +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 w21559MZ010821; Thu, 1 Mar 2018 05:05:09 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21559tD010820; Thu, 1 Mar 2018 05:05:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010505.w21559tD010820@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 05:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330159 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:05:09 -0000 Author: eadler Date: Thu Mar 1 05:05:08 2018 New Revision: 330159 URL: https://svnweb.freebsd.org/changeset/base/330159 Log: MFC r308577: iwm: If firmware load fails during init via iwm_preinit() we bail out before calling ieee80211_ifattach() so the taskqueue hasn't been initialized. Don't try to drain it, we'll panic. Looks like this issue was introduced in r303326. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:03:18 2018 (r330158) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:05:08 2018 (r330159) @@ -6172,7 +6172,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 device_t dev = sc->sc_dev; int i; - ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); + if (do_net80211) + ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); callout_drain(&sc->sc_led_blink_to); callout_drain(&sc->sc_watchdog_to); From owner-svn-src-all@freebsd.org Thu Mar 1 05:06:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D146F4AA87; Thu, 1 Mar 2018 05:06:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B537BD34; Thu, 1 Mar 2018 05:06:17 +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 3382423DE6; Thu, 1 Mar 2018 05:06:17 +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 w2156Hk4010908; Thu, 1 Mar 2018 05:06:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2156Hil010907; Thu, 1 Mar 2018 05:06:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010506.w2156Hil010907@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 05:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330160 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:06:17 -0000 Author: eadler Date: Thu Mar 1 05:06:16 2018 New Revision: 330160 URL: https://svnweb.freebsd.org/changeset/base/330160 Log: MFC r308777: [iwm] Sync iwm_nvm_read_chunk() function with Linux iwlwifi. This fixes an error handling detail in iwm_nvm_read_chunk(), where an error response from the firmware for an NVM read shouldn't be fatal if the offset was non-zero. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:05:08 2018 (r330159) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:06:16 2018 (r330160) @@ -1666,8 +1666,10 @@ const int nvm_to_read[] = { #define IWM_NVM_READ_OPCODE 0 /* load nvm chunk response */ -#define IWM_READ_NVM_CHUNK_SUCCEED 0 -#define IWM_READ_NVM_CHUNK_INVALID_ADDRESS 1 +enum { + IWM_READ_NVM_CHUNK_SUCCEED = 0, + IWM_READ_NVM_CHUNK_NOT_VALID_ADDRESS = 1 +}; static int iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t section, @@ -1684,12 +1686,10 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect struct iwm_rx_packet *pkt; struct iwm_host_cmd cmd = { .id = IWM_NVM_ACCESS_CMD, - .flags = IWM_CMD_SYNC | IWM_CMD_WANT_SKB | - IWM_CMD_SEND_IN_RFKILL, + .flags = IWM_CMD_WANT_SKB | IWM_CMD_SEND_IN_RFKILL, .data = { &nvm_access_cmd, }, }; - int ret, offset_read; - size_t bytes_read; + int ret, bytes_read, offset_read; uint8_t *resp_data; cmd.len[0] = sizeof(struct iwm_nvm_access_cmd); @@ -1718,9 +1718,26 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect offset_read = le16toh(nvm_resp->offset); resp_data = nvm_resp->data; if (ret) { - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "NVM access command failed with status %d\n", ret); - ret = EINVAL; + if ((offset != 0) && + (ret == IWM_READ_NVM_CHUNK_NOT_VALID_ADDRESS)) { + /* + * meaning of NOT_VALID_ADDRESS: + * driver try to read chunk from address that is + * multiple of 2K and got an error since addr is empty. + * meaning of (offset != 0): driver already + * read valid data from another chunk so this case + * is not an error. + */ + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "NVM access command failed on offset 0x%x since that section size is multiple 2K\n", + offset); + *len = 0; + ret = 0; + } else { + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "NVM access command failed with status %d\n", ret); + ret = EIO; + } goto exit; } @@ -1735,7 +1752,7 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect if (bytes_read > length) { device_printf(sc->sc_dev, "NVM ACCESS response with too much data " - "(%d bytes requested, %zd bytes received)\n", + "(%d bytes requested, %d bytes received)\n", length, bytes_read); ret = EINVAL; goto exit; From owner-svn-src-all@freebsd.org Thu Mar 1 05:08:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9DF7F4AD9E; Thu, 1 Mar 2018 05:08:27 +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 6B2B27C29C; Thu, 1 Mar 2018 05:08:27 +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 6625D23DEC; Thu, 1 Mar 2018 05:08:27 +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 w2158Rib011156; Thu, 1 Mar 2018 05:08:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2158R5e011155; Thu, 1 Mar 2018 05:08:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010508.w2158R5e011155@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 05:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330161 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:08:27 -0000 Author: eadler Date: Thu Mar 1 05:08:27 2018 New Revision: 330161 URL: https://svnweb.freebsd.org/changeset/base/330161 Log: MFC r313307: [iwm] TODO for QOS support. Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 05:06:16 2018 (r330160) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 05:08:27 2018 (r330161) @@ -318,6 +318,11 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru = htole32((ic->ic_flags & IEEE80211_F_SHSLOT) ? IWM_MAC_FLG_SHORT_SLOT : 0); + /* + * XXX TODO: if we're doing QOS.. + * cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA) + */ + /* XXX TODO: set wme parameters; also handle getting updated wme parameters */ for (i = 0; i < IWM_AC_NUM+1; i++) { int txf = i; From owner-svn-src-all@freebsd.org Thu Mar 1 05:09:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F75F4AED9; Thu, 1 Mar 2018 05:09:09 +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 361007C4AC; Thu, 1 Mar 2018 05:09:09 +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 30E6023DEF; Thu, 1 Mar 2018 05:09:09 +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 w215985A011224; Thu, 1 Mar 2018 05:09:08 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21598PW011222; Thu, 1 Mar 2018 05:09:08 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010509.w21598PW011222@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 05:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330162 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:09:09 -0000 Author: eadler Date: Thu Mar 1 05:09:08 2018 New Revision: 330162 URL: https://svnweb.freebsd.org/changeset/base/330162 Log: MFC r313308: [iwm] The HW Revision stepping constants should be in if_iwmreg.h. Modified: stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:08:27 2018 (r330161) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:09:08 2018 (r330162) @@ -297,6 +297,16 @@ #define IWM_CSR_HW_REV_DASH(_val) (((_val) & 0x0000003) >> 0) #define IWM_CSR_HW_REV_STEP(_val) (((_val) & 0x000000C) >> 2) +/** + * hw_rev values + */ +enum { + IWM_SILICON_A_STEP = 0, + IWM_SILICON_B_STEP, + IWM_SILICON_C_STEP, +}; + + #define IWM_CSR_HW_REV_TYPE_MSK (0x000FFF0) #define IWM_CSR_HW_REV_TYPE_5300 (0x0000020) #define IWM_CSR_HW_REV_TYPE_5350 (0x0000030) Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:08:27 2018 (r330161) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:08 2018 (r330162) @@ -431,10 +431,6 @@ struct iwm_softc { int ict_cur; int sc_hw_rev; -#define IWM_SILICON_A_STEP 0 -#define IWM_SILICON_B_STEP 1 -#define IWM_SILICON_C_STEP 2 -#define IWM_SILICON_D_STEP 3 int sc_hw_id; int sc_device_family; #define IWM_DEVICE_FAMILY_7000 1 From owner-svn-src-all@freebsd.org Thu Mar 1 05:09:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3ED5F4AFB7; Thu, 1 Mar 2018 05:09:50 +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 75EC47C6AE; Thu, 1 Mar 2018 05:09:50 +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 70BE923DF0; Thu, 1 Mar 2018 05:09:50 +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 w2159ovh011300; Thu, 1 Mar 2018 05:09:50 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2159o1B011295; Thu, 1 Mar 2018 05:09:50 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010509.w2159o1B011295@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 05:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330163 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:09:51 -0000 Author: eadler Date: Thu Mar 1 05:09:49 2018 New Revision: 330163 URL: https://svnweb.freebsd.org/changeset/base/330163 Log: MFC r313309: [iwm] Sync if_iwm_phy_db code with Linux iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_phy_db.c stable/11/sys/dev/iwm/if_iwm_phy_db.h stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:09:49 2018 (r330163) @@ -4593,11 +4593,9 @@ iwm_init_hw(struct iwm_softc *sc) goto error; } - /* Send phy db control command and then phy db calibration*/ - if ((error = iwm_send_phy_db_data(sc)) != 0) { - device_printf(sc->sc_dev, "phy_db_data failed\n"); + /* Send phy db control command and then phy db calibration */ + if ((error = iwm_send_phy_db_data(sc->sc_phy_db)) != 0) goto error; - } if ((error = iwm_send_phy_cfg_cmd(sc)) != 0) { device_printf(sc->sc_dev, "phy_cfg_cmd failed\n"); @@ -5225,7 +5223,7 @@ iwm_notif_intr(struct iwm_softc *sc) struct iwm_calib_res_notif_phy_db *phy_db_notif; phy_db_notif = (void *)pkt->data; - iwm_phy_db_set_section(sc, phy_db_notif); + iwm_phy_db_set_section(sc->sc_phy_db, phy_db_notif); break; } @@ -5751,6 +5749,13 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); + /* Init phy db */ + sc->sc_phy_db = iwm_phy_db_init(sc); + if (!sc->sc_phy_db) { + device_printf(dev, "Cannot init phy_db\n"); + goto fail; + } + /* PCI attach */ error = iwm_pci_attach(dev); if (error != 0) @@ -6199,7 +6204,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 ieee80211_ifdetach(&sc->sc_ic); } - iwm_phy_db_free(sc); + iwm_phy_db_free(sc->sc_phy_db); + sc->sc_phy_db = NULL; /* Free descriptor rings */ iwm_free_rx_ring(sc, &sc->rxq); Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 05:09:49 2018 (r330163) @@ -150,26 +150,104 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include +#include "if_iwmreg.h" +#include "if_iwmvar.h" +#include "if_iwm_debug.h" +#include "if_iwm_util.h" +#include "if_iwm_phy_db.h" +#define CHANNEL_NUM_SIZE 4 /* num of channels in calib_ch size */ + +struct iwm_phy_db_entry { + uint16_t size; + uint8_t *data; +}; + +/** + * struct iwm_phy_db - stores phy configuration and calibration data. + * + * @cfg: phy configuration. + * @calib_nch: non channel specific calibration data. + * @calib_ch: channel specific calibration data. + * @n_group_papd: number of entries in papd channel group. + * @calib_ch_group_papd: calibration data related to papd channel group. + * @n_group_txp: number of entries in tx power channel group. + * @calib_ch_group_txp: calibration data related to tx power chanel group. + */ +struct iwm_phy_db { + struct iwm_phy_db_entry cfg; + struct iwm_phy_db_entry calib_nch; + int n_group_papd; + struct iwm_phy_db_entry *calib_ch_group_papd; + int n_group_txp; + struct iwm_phy_db_entry *calib_ch_group_txp; + + struct iwm_softc *sc; +}; + +enum iwm_phy_db_section_type { + IWM_PHY_DB_CFG = 1, + IWM_PHY_DB_CALIB_NCH, + IWM_PHY_DB_UNUSED, + IWM_PHY_DB_CALIB_CHG_PAPD, + IWM_PHY_DB_CALIB_CHG_TXP, + IWM_PHY_DB_MAX +}; + +#define PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */ + /* - * BEGIN iwl-phy-db.c + * phy db - configure operational ucode */ +struct iwm_phy_db_cmd { + uint16_t type; + uint16_t length; + uint8_t data[]; +} __packed; + +/* for parsing of tx power channel group data that comes from the firmware*/ +struct iwm_phy_db_chg_txp { + uint32_t space; + uint16_t max_channel_idx; +} __packed; + /* + * phy db - Receive phy db chunk after calibrations + */ +struct iwm_calib_res_notif_phy_db { + uint16_t type; + uint16_t length; + uint8_t data[]; +} __packed; + +struct iwm_phy_db * +iwm_phy_db_init(struct iwm_softc *sc) +{ + struct iwm_phy_db *phy_db = malloc(sizeof(struct iwm_phy_db), + M_DEVBUF, M_NOWAIT | M_ZERO); + + if (!phy_db) + return phy_db; + + phy_db->sc = sc; + + phy_db->n_group_txp = -1; + phy_db->n_group_papd = -1; + + /* TODO: add default values of the phy db. */ + return phy_db; +} + +/* * get phy db section: returns a pointer to a phy db section specified by * type and channel group id. */ static struct iwm_phy_db_entry * -iwm_phy_db_get_section(struct iwm_softc *sc, - enum iwm_phy_db_section_type type, uint16_t chg_id) +iwm_phy_db_get_section(struct iwm_phy_db *phy_db, + enum iwm_phy_db_section_type type, + uint16_t chg_id) { - struct iwm_phy_db *phy_db = &sc->sc_phy_db; - - if (type >= IWM_PHY_DB_MAX) + if (!phy_db || type >= IWM_PHY_DB_MAX) return NULL; switch (type) { @@ -178,11 +256,11 @@ iwm_phy_db_get_section(struct iwm_softc *sc, case IWM_PHY_DB_CALIB_NCH: return &phy_db->calib_nch; case IWM_PHY_DB_CALIB_CHG_PAPD: - if (chg_id >= IWM_NUM_PAPD_CH_GROUPS) + if (chg_id >= phy_db->n_group_papd) return NULL; return &phy_db->calib_ch_group_papd[chg_id]; case IWM_PHY_DB_CALIB_CHG_TXP: - if (chg_id >= IWM_NUM_TXP_CH_GROUPS) + if (chg_id >= phy_db->n_group_txp) return NULL; return &phy_db->calib_ch_group_txp[chg_id]; default: @@ -191,24 +269,92 @@ iwm_phy_db_get_section(struct iwm_softc *sc, return NULL; } +static void +iwm_phy_db_free_section(struct iwm_phy_db *phy_db, + enum iwm_phy_db_section_type type, uint16_t chg_id) +{ + struct iwm_phy_db_entry *entry = + iwm_phy_db_get_section(phy_db, type, chg_id); + if (!entry) + return; + + if (entry->data != NULL) + free(entry->data, M_DEVBUF); + entry->data = NULL; + entry->size = 0; +} + +void +iwm_phy_db_free(struct iwm_phy_db *phy_db) +{ + int i; + + if (!phy_db) + return; + + iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CFG, 0); + iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_NCH, 0); + + for (i = 0; i < phy_db->n_group_papd; i++) + iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_PAPD, i); + if (phy_db->calib_ch_group_papd != NULL) + free(phy_db->calib_ch_group_papd, M_DEVBUF); + + for (i = 0; i < phy_db->n_group_txp; i++) + iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_TXP, i); + if (phy_db->calib_ch_group_txp != NULL) + free(phy_db->calib_ch_group_txp, M_DEVBUF); + + free(phy_db, M_DEVBUF); +} + int -iwm_phy_db_set_section(struct iwm_softc *sc, - struct iwm_calib_res_notif_phy_db *phy_db_notif) +iwm_phy_db_set_section(struct iwm_phy_db *phy_db, + struct iwm_calib_res_notif_phy_db *phy_db_notif) { enum iwm_phy_db_section_type type = le16toh(phy_db_notif->type); - uint16_t size = le16toh(phy_db_notif->length); - struct iwm_phy_db_entry *entry; - uint16_t chg_id = 0; + uint16_t size = le16toh(phy_db_notif->length); + struct iwm_phy_db_entry *entry; + uint16_t chg_id = 0; - if (type == IWM_PHY_DB_CALIB_CHG_PAPD || - type == IWM_PHY_DB_CALIB_CHG_TXP) + if (!phy_db) + return EINVAL; + + if (type == IWM_PHY_DB_CALIB_CHG_PAPD) { chg_id = le16toh(*(uint16_t *)phy_db_notif->data); + if (phy_db && !phy_db->calib_ch_group_papd) { + /* + * Firmware sends the largest index first, so we can use + * it to know how much we should allocate. + */ + phy_db->calib_ch_group_papd = malloc( + (chg_id + 1) * sizeof(struct iwm_phy_db_entry), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!phy_db->calib_ch_group_papd) + return ENOMEM; + phy_db->n_group_papd = chg_id + 1; + } + } else if (type == IWM_PHY_DB_CALIB_CHG_TXP) { + chg_id = le16toh(*(uint16_t *)phy_db_notif->data); + if (phy_db && !phy_db->calib_ch_group_txp) { + /* + * Firmware sends the largest index first, so we can use + * it to know how much we should allocate. + */ + phy_db->calib_ch_group_txp = malloc( + (chg_id + 1) * sizeof(struct iwm_phy_db_entry), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!phy_db->calib_ch_group_txp) + return ENOMEM; + phy_db->n_group_txp = chg_id + 1; + } + } - entry = iwm_phy_db_get_section(sc, type, chg_id); + entry = iwm_phy_db_get_section(phy_db, type, chg_id); if (!entry) return EINVAL; - if (entry->data) + if (entry->data != NULL) free(entry->data, M_DEVBUF); entry->data = malloc(size, M_DEVBUF, M_NOWAIT); if (!entry->data) { @@ -216,17 +362,18 @@ iwm_phy_db_set_section(struct iwm_softc *sc, return ENOMEM; } memcpy(entry->data, phy_db_notif->data, size); + entry->size = size; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s(%d): [PHYDB]SET: Type %d , Size: %d, data: %p\n", - __func__, __LINE__, type, size, entry->data); + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET, + "%s(%d): [PHYDB]SET: Type %d , Size: %d\n", + __func__, __LINE__, type, size); return 0; } static int -iwm_is_valid_channel(uint16_t ch_id) +is_valid_channel(uint16_t ch_id) { if (ch_id <= 14 || (36 <= ch_id && ch_id <= 64 && ch_id % 4 == 0) || @@ -237,10 +384,10 @@ iwm_is_valid_channel(uint16_t ch_id) } static uint8_t -iwm_ch_id_to_ch_index(uint16_t ch_id) +ch_id_to_ch_index(uint16_t ch_id) { - if (!iwm_is_valid_channel(ch_id)) - return 0xff; + if (!is_valid_channel(ch_id)) + return 0xff; if (ch_id <= 14) return ch_id - 1; @@ -253,9 +400,9 @@ iwm_ch_id_to_ch_index(uint16_t ch_id) static uint16_t -iwm_channel_id_to_papd(uint16_t ch_id) +channel_id_to_papd(uint16_t ch_id) { - if (!iwm_is_valid_channel(ch_id)) + if (!is_valid_channel(ch_id)) return 0xff; if (1 <= ch_id && ch_id <= 14) @@ -268,17 +415,15 @@ iwm_channel_id_to_papd(uint16_t ch_id) } static uint16_t -iwm_channel_id_to_txp(struct iwm_softc *sc, uint16_t ch_id) +channel_id_to_txp(struct iwm_phy_db *phy_db, uint16_t ch_id) { - struct iwm_phy_db *phy_db = &sc->sc_phy_db; struct iwm_phy_db_chg_txp *txp_chg; int i; - uint8_t ch_index = iwm_ch_id_to_ch_index(ch_id); - + uint8_t ch_index = ch_id_to_ch_index(ch_id); if (ch_index == 0xff) return 0xff; - for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++) { + for (i = 0; i < phy_db->n_group_txp; i++) { txp_chg = (void *)phy_db->calib_ch_group_txp[i].data; if (!txp_chg) return 0xff; @@ -293,71 +438,79 @@ iwm_channel_id_to_txp(struct iwm_softc *sc, uint16_t c } static int -iwm_phy_db_get_section_data(struct iwm_softc *sc, - uint32_t type, uint8_t **data, uint16_t *size, uint16_t ch_id) +iwm_phy_db_get_section_data(struct iwm_phy_db *phy_db, + uint32_t type, uint8_t **data, uint16_t *size, + uint16_t ch_id) { struct iwm_phy_db_entry *entry; uint16_t ch_group_id = 0; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, "->%s\n", __func__); + if (!phy_db) + return EINVAL; + /* find wanted channel group */ if (type == IWM_PHY_DB_CALIB_CHG_PAPD) - ch_group_id = iwm_channel_id_to_papd(ch_id); + ch_group_id = channel_id_to_papd(ch_id); else if (type == IWM_PHY_DB_CALIB_CHG_TXP) - ch_group_id = iwm_channel_id_to_txp(sc, ch_id); + ch_group_id = channel_id_to_txp(phy_db, ch_id); - entry = iwm_phy_db_get_section(sc, type, ch_group_id); + entry = iwm_phy_db_get_section(phy_db, type, ch_group_id); if (!entry) return EINVAL; *data = entry->data; *size = entry->size; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s(%d): [PHYDB] GET: Type %d , Size: %d\n", - __func__, __LINE__, type, *size); + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET, + "%s(%d): [PHYDB] GET: Type %d , Size: %d\n", + __func__, __LINE__, type, *size); return 0; } static int -iwm_send_phy_db_cmd(struct iwm_softc *sc, uint16_t type, - uint16_t length, void *data) +iwm_send_phy_db_cmd(struct iwm_phy_db *phy_db, uint16_t type, + uint16_t length, void *data) { struct iwm_phy_db_cmd phy_db_cmd; struct iwm_host_cmd cmd = { - .id = IWM_PHY_DB_CMD, - .flags = IWM_CMD_SYNC, + .id = PHY_DB_CMD, }; - IWM_DPRINTF(sc, IWM_DEBUG_CMD, - "Sending PHY-DB hcmd of type %d, of length %d\n", - type, length); + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET, + "Sending PHY-DB hcmd of type %d, of length %d\n", + type, length); /* Set phy db cmd variables */ - phy_db_cmd.type = le16toh(type); - phy_db_cmd.length = le16toh(length); + phy_db_cmd.type = htole16(type); + phy_db_cmd.length = htole16(length); /* Set hcmd variables */ cmd.data[0] = &phy_db_cmd; cmd.len[0] = sizeof(struct iwm_phy_db_cmd); cmd.data[1] = data; cmd.len[1] = length; +#ifdef notyet + cmd.dataflags[1] = IWM_HCMD_DFL_NOCOPY; +#endif - return iwm_send_cmd(sc, &cmd); + return iwm_send_cmd(phy_db->sc, &cmd); } static int -iwm_phy_db_send_all_channel_groups(struct iwm_softc *sc, - enum iwm_phy_db_section_type type, uint8_t max_ch_groups) +iwm_phy_db_send_all_channel_groups(struct iwm_phy_db *phy_db, + enum iwm_phy_db_section_type type, + uint8_t max_ch_groups) { uint16_t i; int err; struct iwm_phy_db_entry *entry; - /* Send all the channel-specific groups to operational fw */ + /* Send all the channel specific groups to operational fw */ for (i = 0; i < max_ch_groups; i++) { - entry = iwm_phy_db_get_section(sc, type, i); + entry = iwm_phy_db_get_section(phy_db, + type, + i); if (!entry) return EINVAL; @@ -365,16 +518,18 @@ iwm_phy_db_send_all_channel_groups(struct iwm_softc *s continue; /* Send the requested PHY DB section */ - err = iwm_send_phy_db_cmd(sc, type, entry->size, entry->data); + err = iwm_send_phy_db_cmd(phy_db, + type, + entry->size, + entry->data); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD, - "%s: Can't SEND phy_db section %d (%d), " - "err %d\n", __func__, type, i, err); + device_printf(phy_db->sc->sc_dev, + "Can't SEND phy_db section %d (%d), err %d\n", + type, i, err); return err; } - DELAY(1000); - IWM_DPRINTF(sc, IWM_DEBUG_CMD, + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD, "Sent PHY_DB HCMD, type = %d num = %d\n", type, i); } @@ -382,102 +537,73 @@ iwm_phy_db_send_all_channel_groups(struct iwm_softc *s } int -iwm_send_phy_db_data(struct iwm_softc *sc) +iwm_send_phy_db_data(struct iwm_phy_db *phy_db) { uint8_t *data = NULL; uint16_t size = 0; int err; - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "%s: Sending phy db data and configuration to runtime image\n", __func__); /* Send PHY DB CFG section */ - err = iwm_phy_db_get_section_data(sc, IWM_PHY_DB_CFG, &data, &size, 0); + err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CFG, + &data, &size, 0); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot get Phy DB cfg section, %d\n", __func__, err); return err; } - err = iwm_send_phy_db_cmd(sc, IWM_PHY_DB_CFG, size, data); + err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CFG, size, data); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot send HCMD of Phy DB cfg section, %d\n", __func__, err); return err; } - err = iwm_phy_db_get_section_data(sc, IWM_PHY_DB_CALIB_NCH, + err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CALIB_NCH, &data, &size, 0); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot get Phy DB non specific channel section, " "%d\n", __func__, err); return err; } - err = iwm_send_phy_db_cmd(sc, IWM_PHY_DB_CALIB_NCH, size, data); + err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CALIB_NCH, size, data); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot send HCMD of Phy DB non specific channel " "sect, %d\n", __func__, err); return err; } /* Send all the TXP channel specific data */ - err = iwm_phy_db_send_all_channel_groups(sc, - IWM_PHY_DB_CALIB_CHG_PAPD, IWM_NUM_PAPD_CH_GROUPS); + err = iwm_phy_db_send_all_channel_groups(phy_db, + IWM_PHY_DB_CALIB_CHG_PAPD, phy_db->n_group_papd); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot send channel specific PAPD groups, %d\n", __func__, err); return err; } /* Send all the TXP channel specific data */ - err = iwm_phy_db_send_all_channel_groups(sc, - IWM_PHY_DB_CALIB_CHG_TXP, IWM_NUM_TXP_CH_GROUPS); + err = iwm_phy_db_send_all_channel_groups(phy_db, + IWM_PHY_DB_CALIB_CHG_TXP, phy_db->n_group_txp); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot send channel specific TX power groups, " "%d\n", __func__, err); return err; } - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "%s: Finished sending phy db non channel data\n", __func__); return 0; -} - -static void -iwm_phy_db_free_section(struct iwm_softc *sc, - enum iwm_phy_db_section_type type, uint16_t chg_id) -{ - struct iwm_phy_db_entry *entry = - iwm_phy_db_get_section(sc, type, chg_id); - if (!entry) - return; - - if (entry->data != NULL) - free(entry->data, M_DEVBUF); - entry->data = NULL; - entry->size = 0; -} - -void -iwm_phy_db_free(struct iwm_softc *sc) -{ - int i; - - iwm_phy_db_free_section(sc, IWM_PHY_DB_CFG, 0); - iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_NCH, 0); - - for (i = 0; i < IWM_NUM_PAPD_CH_GROUPS; i++) - iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_PAPD, i); - - for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++) - iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_TXP, i); } Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.h Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.h Thu Mar 1 05:09:49 2018 (r330163) @@ -106,8 +106,12 @@ #ifndef __IF_IWM_PHY_DB_H__ #define __IF_IWM_PHY_DB_H__ -extern int iwm_phy_db_set_section(struct iwm_softc *sc, +struct iwm_calib_res_notif_phy_db; + +extern struct iwm_phy_db *iwm_phy_db_init(struct iwm_softc *sc); +extern void iwm_phy_db_free(struct iwm_phy_db *phy_db); +extern int iwm_phy_db_set_section(struct iwm_phy_db *phy_db, struct iwm_calib_res_notif_phy_db *phy_db_notif); -extern int iwm_send_phy_db_data(struct iwm_softc *sc); -extern void iwm_phy_db_free(struct iwm_softc *sc); +extern int iwm_send_phy_db_data(struct iwm_phy_db *phy_db); + #endif /* __IF_IWM_PHY_DB_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:09:49 2018 (r330163) @@ -2013,45 +2013,6 @@ struct iwm_phy_cfg_cmd { #define IWM_PHY_CFG_RX_CHAIN_B (1 << 13) #define IWM_PHY_CFG_RX_CHAIN_C (1 << 14) -/* - * PHY db - */ - -enum iwm_phy_db_section_type { - IWM_PHY_DB_CFG = 1, - IWM_PHY_DB_CALIB_NCH, - IWM_PHY_DB_UNUSED, - IWM_PHY_DB_CALIB_CHG_PAPD, - IWM_PHY_DB_CALIB_CHG_TXP, - IWM_PHY_DB_MAX -}; - -#define IWM_PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */ - -/* - * phy db - configure operational ucode - */ -struct iwm_phy_db_cmd { - uint16_t type; - uint16_t length; - uint8_t data[]; -} __packed; - -/* for parsing of tx power channel group data that comes from the firmware */ -struct iwm_phy_db_chg_txp { - uint32_t space; - uint16_t max_channel_idx; -} __packed; - -/* - * phy db - Receive phy db chunk after calibrations - */ -struct iwm_calib_res_notif_phy_db { - uint16_t type; - uint16_t length; - uint8_t data[]; -} __packed; - /* Target of the IWM_NVM_ACCESS_CMD */ enum { Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:49 2018 (r330163) @@ -314,25 +314,6 @@ enum iwm_hcmd_dataflag { IWM_HCMD_DFL_DUP = (1 << 1), }; -/* - * iwlwifi/iwl-phy-db - */ - -#define IWM_NUM_PAPD_CH_GROUPS 9 -#define IWM_NUM_TXP_CH_GROUPS 9 - -struct iwm_phy_db_entry { - uint16_t size; - uint8_t *data; -}; - -struct iwm_phy_db { - struct iwm_phy_db_entry cfg; - struct iwm_phy_db_entry calib_nch; - struct iwm_phy_db_entry calib_ch_group_papd[IWM_NUM_PAPD_CH_GROUPS]; - struct iwm_phy_db_entry calib_ch_group_txp[IWM_NUM_TXP_CH_GROUPS]; -}; - struct iwm_int_sta { uint32_t sta_id; uint32_t tfd_queue_msk; @@ -473,7 +454,7 @@ struct iwm_softc { struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; struct iwm_nvm_data sc_nvm; - struct iwm_phy_db sc_phy_db; + struct iwm_phy_db *sc_phy_db; struct iwm_bf_data sc_bf; From owner-svn-src-all@freebsd.org Thu Mar 1 05:40:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C96F5F22DD6; Thu, 1 Mar 2018 05:40:00 +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 7BD0380C35; Thu, 1 Mar 2018 05:40:00 +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 76C5E2438D; Thu, 1 Mar 2018 05:40:00 +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 w215e0Hu026558; Thu, 1 Mar 2018 05:40:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215e0qX026555; Thu, 1 Mar 2018 05:40:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010540.w215e0qX026555@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 05:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330164 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:40:01 -0000 Author: eadler Date: Thu Mar 1 05:40:00 2018 New Revision: 330164 URL: https://svnweb.freebsd.org/changeset/base/330164 Log: MFC r313310: [iwm] make sure we call iwm_detach_local() only once. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:09:49 2018 (r330163) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:40:00 2018 (r330164) @@ -5743,6 +5743,7 @@ iwm_attach(device_t dev) int txq_i, i; sc->sc_dev = dev; + sc->sc_attached = 1; IWM_LOCK_INIT(sc); mbufq_init(&sc->sc_snd, ifqmaxlen); callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0); @@ -6193,6 +6194,10 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 struct iwm_fw_info *fw = &sc->sc_fw; device_t dev = sc->sc_dev; int i; + + if (!sc->sc_attached) + return 0; + sc->sc_attached = 0; if (do_net80211) ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:49 2018 (r330163) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:40:00 2018 (r330164) @@ -369,6 +369,7 @@ struct iwm_node { struct iwm_softc { device_t sc_dev; uint32_t sc_debug; + int sc_attached; struct mtx sc_mtx; struct mbufq sc_snd; From owner-svn-src-all@freebsd.org Thu Mar 1 05:42:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2D8FF232D6; Thu, 1 Mar 2018 05:42:01 +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 64B89812B0; Thu, 1 Mar 2018 05:42:01 +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 46C64244F0; Thu, 1 Mar 2018 05:42:01 +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 w215g1Te029525; Thu, 1 Mar 2018 05:42:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215g0DJ029520; Thu, 1 Mar 2018 05:42:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010542.w215g0DJ029520@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 05:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330165 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:42:02 -0000 Author: eadler Date: Thu Mar 1 05:42:00 2018 New Revision: 330165 URL: https://svnweb.freebsd.org/changeset/base/330165 Log: MFC r313311: [iwm] Sync nvm parsing code with Linux iwlwifi. * sc->sc_nvm becomes sc->nvm_data and is now a pointer instead of an inlined struct. * Add sc->eeprom_size and sc->nvm_hw_section_num configuration values to struct iwm_softc. * For now continue to avoid negative error return-values, and use pointer variables for some return values, as before. * Continue to omit LAR (location aware regulatory) related code as well. Tested: * Intel 7260, STA mode (2GHz) Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:42:00 2018 (r330165) @@ -260,20 +260,23 @@ static int iwm_post_alive(struct iwm_softc *); static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t, uint16_t, uint8_t *, uint16_t *); static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *, - uint16_t *, size_t); + uint16_t *, uint32_t); static uint32_t iwm_eeprom_channel_flags(uint16_t); static void iwm_add_channel_band(struct iwm_softc *, struct ieee80211_channel[], int, int *, int, size_t, const uint8_t[]); static void iwm_init_channel_map(struct ieee80211com *, int, int *, struct ieee80211_channel[]); -static int iwm_parse_nvm_data(struct iwm_softc *, const uint16_t *, - const uint16_t *, const uint16_t *, - const uint16_t *, const uint16_t *, - const uint16_t *); -static void iwm_set_hw_address_8000(struct iwm_softc *, - struct iwm_nvm_data *, - const uint16_t *, const uint16_t *); +static struct iwm_nvm_data * + iwm_parse_nvm_data(struct iwm_softc *, const uint16_t *, + const uint16_t *, const uint16_t *, + const uint16_t *, const uint16_t *, + const uint16_t *); +static void iwm_free_nvm_data(struct iwm_nvm_data *); +static void iwm_set_hw_address_family_8000(struct iwm_softc *, + struct iwm_nvm_data *, + const uint16_t *, + const uint16_t *); static int iwm_get_sku(const struct iwm_softc *, const uint16_t *, const uint16_t *); static int iwm_get_nvm_version(const struct iwm_softc *, const uint16_t *); @@ -283,8 +286,8 @@ static int iwm_get_n_hw_addrs(const struct iwm_softc * const uint16_t *); static void iwm_set_radio_cfg(const struct iwm_softc *, struct iwm_nvm_data *, uint32_t); -static int iwm_parse_nvm_sections(struct iwm_softc *, - struct iwm_nvm_section *); +static struct iwm_nvm_data * + iwm_parse_nvm_sections(struct iwm_softc *, struct iwm_nvm_section *); static int iwm_nvm_init(struct iwm_softc *); static int iwm_firmware_load_sect(struct iwm_softc *, uint32_t, const uint8_t *, uint32_t); @@ -1646,21 +1649,11 @@ iwm_post_alive(struct iwm_softc *sc) * iwlwifi/mvm/nvm.c */ -/* list of NVM sections we are allowed/need to read */ -const int nvm_to_read[] = { - IWM_NVM_SECTION_TYPE_HW, - IWM_NVM_SECTION_TYPE_SW, - IWM_NVM_SECTION_TYPE_REGULATORY, - IWM_NVM_SECTION_TYPE_CALIBRATION, - IWM_NVM_SECTION_TYPE_PRODUCTION, - IWM_NVM_SECTION_TYPE_HW_8000, - IWM_NVM_SECTION_TYPE_MAC_OVERRIDE, - IWM_NVM_SECTION_TYPE_PHY_SKU, -}; +#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 +#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 /* Default NVM size to read */ #define IWM_NVM_DEFAULT_CHUNK_SIZE (2*1024) -#define IWM_MAX_NVM_SECTION_SIZE 8192 #define IWM_NVM_WRITE_OPCODE 1 #define IWM_NVM_READ_OPCODE 0 @@ -1675,7 +1668,6 @@ static int iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t section, uint16_t offset, uint16_t length, uint8_t *data, uint16_t *len) { - offset = 0; struct iwm_nvm_access_cmd nvm_access_cmd = { .offset = htole16(offset), .length = htole16(length), @@ -1702,17 +1694,9 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect } pkt = cmd.resp_pkt; - if (pkt->hdr.flags & IWM_CMD_FAILED_MSK) { - device_printf(sc->sc_dev, - "Bad return from IWM_NVM_ACCES_COMMAND (0x%08X)\n", - pkt->hdr.flags); - ret = EIO; - goto exit; - } /* Extract NVM response */ nvm_resp = (void *)pkt->data; - ret = le16toh(nvm_resp->status); bytes_read = le16toh(nvm_resp->length); offset_read = le16toh(nvm_resp->offset); @@ -1758,6 +1742,7 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect goto exit; } + /* Write data to NVM */ memcpy(data + offset, resp_data, bytes_read); *len = bytes_read; @@ -1778,34 +1763,40 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect */ static int iwm_nvm_read_section(struct iwm_softc *sc, - uint16_t section, uint8_t *data, uint16_t *len, size_t max_len) + uint16_t section, uint8_t *data, uint16_t *len, uint32_t size_read) { - uint16_t chunklen, seglen; - int error = 0; + uint16_t seglen, length, offset = 0; + int ret; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "reading NVM section %d\n", section); + /* Set nvm section read length */ + length = IWM_NVM_DEFAULT_CHUNK_SIZE; - chunklen = seglen = IWM_NVM_DEFAULT_CHUNK_SIZE; - *len = 0; + seglen = length; - /* Read NVM chunks until exhausted (reading less than requested) */ - while (seglen == chunklen && *len < max_len) { - error = iwm_nvm_read_chunk(sc, - section, *len, chunklen, data, &seglen); - if (error) { - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "Cannot read from NVM section " - "%d at offset %d\n", section, *len); - return error; + /* Read the NVM until exhausted (reading less than requested) */ + while (seglen == length) { + /* Check no memory assumptions fail and cause an overflow */ + if ((size_read + offset + length) > + sc->eeprom_size) { + device_printf(sc->sc_dev, + "EEPROM size is too small for NVM\n"); + return ENOBUFS; } - *len += seglen; + + ret = iwm_nvm_read_chunk(sc, section, offset, length, data, &seglen); + if (ret) { + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "Cannot read NVM from section %d offset %d, length %d\n", + section, offset, length); + return ret; + } + offset += seglen; } - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "NVM section %d read completed (%d bytes, error=%d)\n", - section, *len, error); - return error; + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "NVM section %d read completed\n", section); + *len = offset; + return 0; } /* @@ -1889,7 +1880,7 @@ enum nvm_sku_bits { * @IWM_NVM_CHANNEL_IBSS: usable as an IBSS channel * @IWM_NVM_CHANNEL_ACTIVE: active scanning allowed * @IWM_NVM_CHANNEL_RADAR: radar detection required - * XXX cannot find this (DFS) flag in iwl-nvm-parse.c + * XXX cannot find this (DFS) flag in iwm-nvm-parse.c * @IWM_NVM_CHANNEL_DFS: dynamic freq selection candidate * @IWM_NVM_CHANNEL_WIDE: 20 MHz channel okay (?) * @IWM_NVM_CHANNEL_40MHZ: 40 MHz channel okay (?) @@ -1908,6 +1899,10 @@ enum iwm_nvm_channel_flags { IWM_NVM_CHANNEL_160MHZ = (1 << 11), }; +/* lower blocks contain EEPROM image and calibration data */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ + /* * Translate EEPROM flags to net80211. */ @@ -1935,7 +1930,7 @@ iwm_add_channel_band(struct iwm_softc *sc, struct ieee int maxchans, int *nchans, int ch_idx, size_t ch_num, const uint8_t bands[]) { - const uint16_t * const nvm_ch_flags = sc->sc_nvm.nvm_ch_flags; + const uint16_t * const nvm_ch_flags = sc->nvm_data->nvm_ch_flags; uint32_t nflags; uint16_t ch_flags; uint8_t ieee; @@ -1976,7 +1971,7 @@ iwm_init_channel_map(struct ieee80211com *ic, int maxc struct ieee80211_channel chans[]) { struct iwm_softc *sc = ic->ic_softc; - struct iwm_nvm_data *data = &sc->sc_nvm; + struct iwm_nvm_data *data = sc->nvm_data; uint8_t bands[IEEE80211_MODE_BYTES]; size_t ch_num; @@ -2005,7 +2000,7 @@ iwm_init_channel_map(struct ieee80211com *ic, int maxc } static void -iwm_set_hw_address_8000(struct iwm_softc *sc, struct iwm_nvm_data *data, +iwm_set_hw_address_family_8000(struct iwm_softc *sc, struct iwm_nvm_data *data, const uint16_t *mac_override, const uint16_t *nvm_hw) { const uint8_t *hw_addr; @@ -2128,15 +2123,57 @@ iwm_set_radio_cfg(const struct iwm_softc *sc, struct i } static int +iwm_set_hw_address(struct iwm_softc *sc, struct iwm_nvm_data *data, + const uint16_t *nvm_hw, const uint16_t *mac_override) +{ +#ifdef notyet /* for FAMILY 9000 */ + if (cfg->mac_addr_from_csr) { + iwm_set_hw_address_from_csr(sc, data); + } else +#endif + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + const uint8_t *hw_addr = (const uint8_t *)(nvm_hw + IWM_HW_ADDR); + + /* The byte order is little endian 16 bit, meaning 214365 */ + data->hw_addr[0] = hw_addr[1]; + data->hw_addr[1] = hw_addr[0]; + data->hw_addr[2] = hw_addr[3]; + data->hw_addr[3] = hw_addr[2]; + data->hw_addr[4] = hw_addr[5]; + data->hw_addr[5] = hw_addr[4]; + } else { + iwm_set_hw_address_family_8000(sc, data, mac_override, nvm_hw); + } + + if (!iwm_is_valid_ether_addr(data->hw_addr)) { + device_printf(sc->sc_dev, "no valid mac address was found\n"); + return EINVAL; + } + + return 0; +} + +static struct iwm_nvm_data * iwm_parse_nvm_data(struct iwm_softc *sc, const uint16_t *nvm_hw, const uint16_t *nvm_sw, const uint16_t *nvm_calib, const uint16_t *mac_override, const uint16_t *phy_sku, const uint16_t *regulatory) { - struct iwm_nvm_data *data = &sc->sc_nvm; - uint8_t hw_addr[IEEE80211_ADDR_LEN]; + struct iwm_nvm_data *data; uint32_t sku, radio_cfg; + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + data = malloc(sizeof(*data) + + IWM_NUM_CHANNELS * sizeof(uint16_t), + M_DEVBUF, M_NOWAIT | M_ZERO); + } else { + data = malloc(sizeof(*data) + + IWM_NUM_CHANNELS_8000 * sizeof(uint16_t), + M_DEVBUF, M_NOWAIT | M_ZERO); + } + if (!data) + return NULL; + data->nvm_version = iwm_get_nvm_version(sc, nvm_sw); radio_cfg = iwm_get_radio_cfg(sc, nvm_sw, phy_sku); @@ -2149,17 +2186,10 @@ iwm_parse_nvm_data(struct iwm_softc *sc, data->n_hw_addrs = iwm_get_n_hw_addrs(sc, nvm_sw); - /* The byte order is little endian 16 bit, meaning 214365 */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { - IEEE80211_ADDR_COPY(hw_addr, nvm_hw + IWM_HW_ADDR); - data->hw_addr[0] = hw_addr[1]; - data->hw_addr[1] = hw_addr[0]; - data->hw_addr[2] = hw_addr[3]; - data->hw_addr[3] = hw_addr[2]; - data->hw_addr[4] = hw_addr[5]; - data->hw_addr[5] = hw_addr[4]; - } else { - iwm_set_hw_address_8000(sc, data, mac_override, nvm_hw); + /* If no valid mac address was found - bail out */ + if (iwm_set_hw_address(sc, data, nvm_hw, mac_override)) { + free(data, M_DEVBUF); + return NULL; } if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { @@ -2170,14 +2200,17 @@ iwm_parse_nvm_data(struct iwm_softc *sc, IWM_NUM_CHANNELS_8000 * sizeof(uint16_t)); } - return 0; + return data; } -/* - * END NVM PARSE - */ +static void +iwm_free_nvm_data(struct iwm_nvm_data *data) +{ + if (data != NULL) + free(data, M_DEVBUF); +} -static int +static struct iwm_nvm_data * iwm_parse_nvm_sections(struct iwm_softc *sc, struct iwm_nvm_section *sections) { const uint16_t *hw, *sw, *calib, *regulatory, *mac_override, *phy_sku; @@ -2185,42 +2218,38 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw /* Checking for required sections */ if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { if (!sections[IWM_NVM_SECTION_TYPE_SW].data || - !sections[IWM_NVM_SECTION_TYPE_HW].data) { + !sections[sc->nvm_hw_section_num].data) { device_printf(sc->sc_dev, "Can't parse empty OTP/NVM sections\n"); - return ENOENT; + return NULL; } - - hw = (const uint16_t *) sections[IWM_NVM_SECTION_TYPE_HW].data; } else if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) { /* SW and REGULATORY sections are mandatory */ if (!sections[IWM_NVM_SECTION_TYPE_SW].data || !sections[IWM_NVM_SECTION_TYPE_REGULATORY].data) { device_printf(sc->sc_dev, "Can't parse empty OTP/NVM sections\n"); - return ENOENT; + return NULL; } /* MAC_OVERRIDE or at least HW section must exist */ - if (!sections[IWM_NVM_SECTION_TYPE_HW_8000].data && + if (!sections[sc->nvm_hw_section_num].data && !sections[IWM_NVM_SECTION_TYPE_MAC_OVERRIDE].data) { device_printf(sc->sc_dev, "Can't parse mac_address, empty sections\n"); - return ENOENT; + return NULL; } /* PHY_SKU section is mandatory in B0 */ if (!sections[IWM_NVM_SECTION_TYPE_PHY_SKU].data) { device_printf(sc->sc_dev, "Can't parse phy_sku in B0, empty sections\n"); - return ENOENT; + return NULL; } - - hw = (const uint16_t *) - sections[IWM_NVM_SECTION_TYPE_HW_8000].data; } else { panic("unknown device family %d\n", sc->sc_device_family); } + hw = (const uint16_t *) sections[sc->nvm_hw_section_num].data; sw = (const uint16_t *)sections[IWM_NVM_SECTION_TYPE_SW].data; calib = (const uint16_t *) sections[IWM_NVM_SECTION_TYPE_CALIBRATION].data; @@ -2237,46 +2266,57 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw static int iwm_nvm_init(struct iwm_softc *sc) { - struct iwm_nvm_section nvm_sections[IWM_NVM_NUM_OF_SECTIONS]; - int i, section, error; + struct iwm_nvm_section nvm_sections[IWM_NVM_MAX_NUM_SECTIONS]; + int i, ret, section; + uint32_t size_read = 0; + uint8_t *nvm_buffer, *temp; uint16_t len; - uint8_t *buf; - const size_t bufsz = IWM_MAX_NVM_SECTION_SIZE; - memset(nvm_sections, 0 , sizeof(nvm_sections)); + memset(nvm_sections, 0, sizeof(nvm_sections)); - buf = malloc(bufsz, M_DEVBUF, M_NOWAIT); - if (buf == NULL) - return ENOMEM; + if (sc->nvm_hw_section_num >= IWM_NVM_MAX_NUM_SECTIONS) + return EINVAL; - for (i = 0; i < nitems(nvm_to_read); i++) { - section = nvm_to_read[i]; - KASSERT(section <= nitems(nvm_sections), - ("too many sections")); + /* load NVM values from nic */ + /* Read From FW NVM */ + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM, "Read from NVM\n"); - error = iwm_nvm_read_section(sc, section, buf, &len, bufsz); - if (error) { - error = 0; + nvm_buffer = malloc(sc->eeprom_size, M_DEVBUF, M_NOWAIT | M_ZERO); + if (!nvm_buffer) + return ENOMEM; + for (section = 0; section < IWM_NVM_MAX_NUM_SECTIONS; section++) { + /* we override the constness for initial read */ + ret = iwm_nvm_read_section(sc, section, nvm_buffer, + &len, size_read); + if (ret) continue; - } - nvm_sections[section].data = malloc(len, M_DEVBUF, M_NOWAIT); - if (nvm_sections[section].data == NULL) { - error = ENOMEM; + size_read += len; + temp = malloc(len, M_DEVBUF, M_NOWAIT); + if (!temp) { + ret = ENOMEM; break; } - memcpy(nvm_sections[section].data, buf, len); + memcpy(temp, nvm_buffer, len); + + nvm_sections[section].data = temp; nvm_sections[section].length = len; } - free(buf, M_DEVBUF); - if (error == 0) - error = iwm_parse_nvm_sections(sc, nvm_sections); + if (!size_read) + device_printf(sc->sc_dev, "OTP is blank\n"); + free(nvm_buffer, M_DEVBUF); - for (i = 0; i < IWM_NVM_NUM_OF_SECTIONS; i++) { + sc->nvm_data = iwm_parse_nvm_sections(sc, nvm_sections); + if (!sc->nvm_data) + return EINVAL; + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "nvm version = %x\n", sc->nvm_data->nvm_version); + + for (i = 0; i < IWM_NVM_MAX_NUM_SECTIONS; i++) { if (nvm_sections[i].data != NULL) free(nvm_sections[i].data, M_DEVBUF); } - return error; + return 0; } /* @@ -2673,7 +2713,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn device_printf(sc->sc_dev, "failed to read nvm\n"); return error; } - IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, sc->sc_nvm.hw_addr); + IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, sc->nvm_data->hw_addr); return 0; } @@ -2694,7 +2734,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn __func__, ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) >> IWM_FW_PHY_CFG_TX_CHAIN_POS), - sc->sc_nvm.valid_tx_ant, + sc->nvm_data->valid_tx_ant, iwm_fw_valid_tx_ant(sc)); @@ -5622,6 +5662,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_3160_2: sc->sc_fwname = "iwm3160fw"; sc->host_interrupt_operation_mode = 1; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; sc->sc_device_family = IWM_DEVICE_FAMILY_7000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); @@ -5629,6 +5671,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_3165_2: sc->sc_fwname = "iwm7265fw"; sc->host_interrupt_operation_mode = 0; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; sc->sc_device_family = IWM_DEVICE_FAMILY_7000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); @@ -5636,6 +5680,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_7260_2: sc->sc_fwname = "iwm7260fw"; sc->host_interrupt_operation_mode = 1; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; sc->sc_device_family = IWM_DEVICE_FAMILY_7000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); @@ -5643,6 +5689,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_7265_2: sc->sc_fwname = "iwm7265fw"; sc->host_interrupt_operation_mode = 0; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; sc->sc_device_family = IWM_DEVICE_FAMILY_7000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); @@ -5650,6 +5698,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_8260_2: sc->sc_fwname = "iwm8000Cfw"; sc->host_interrupt_operation_mode = 0; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000; sc->sc_device_family = IWM_DEVICE_FAMILY_8000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000; return (0); @@ -5968,10 +6018,10 @@ iwm_preinit(void *arg) device_printf(dev, "hw rev 0x%x, fw ver %s, address %s\n", sc->sc_hw_rev & IWM_CSR_HW_REV_TYPE_MSK, - sc->sc_fwver, ether_sprintf(sc->sc_nvm.hw_addr)); + sc->sc_fwver, ether_sprintf(sc->nvm_data->hw_addr)); /* not all hardware can do 5GHz band */ - if (!sc->sc_nvm.sku_cap_band_52GHz_enable) + if (!sc->nvm_data->sku_cap_band_52GHz_enable) memset(&ic->ic_sup_rates[IEEE80211_MODE_11A], 0, sizeof(ic->ic_sup_rates[IEEE80211_MODE_11A])); IWM_UNLOCK(sc); @@ -6211,6 +6261,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 iwm_phy_db_free(sc->sc_phy_db); sc->sc_phy_db = NULL; + + iwm_free_nvm_data(sc->nvm_data); /* Free descriptor rings */ iwm_free_rx_ring(sc, &sc->rxq); Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:42:00 2018 (r330165) @@ -407,7 +407,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *sc, struct iw remain -= 3; } - if (sc->sc_nvm.sku_cap_band_52GHz_enable) { + if (sc->nvm_data->sku_cap_band_52GHz_enable) { /* Fill in 5GHz IEs. */ rs = &ic->ic_sup_rates[IEEE80211_MODE_11A]; if (rs->rs_nrates > IEEE80211_RATE_SIZE) { @@ -674,7 +674,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); req->flags = htole32(IWM_PHY_BAND_24); - if (sc->sc_nvm.sku_cap_band_52GHz_enable) + if (sc->nvm_data->sku_cap_band_52GHz_enable) req->flags |= htole32(IWM_PHY_BAND_5); req->filter_flags = htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON); Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:42:00 2018 (r330165) @@ -437,8 +437,8 @@ iwm_fw_valid_tx_ant(struct iwm_softc *sc) tx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) >> IWM_FW_PHY_CFG_TX_CHAIN_POS); - if (sc->sc_nvm.valid_tx_ant) - tx_ant &= sc->sc_nvm.valid_tx_ant; + if (sc->nvm_data->valid_tx_ant) + tx_ant &= sc->nvm_data->valid_tx_ant; return tx_ant; } @@ -451,8 +451,8 @@ iwm_fw_valid_rx_ant(struct iwm_softc *sc) rx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RX_CHAIN) >> IWM_FW_PHY_CFG_RX_CHAIN_POS); - if (sc->sc_nvm.valid_rx_ant) - rx_ant &= sc->sc_nvm.valid_rx_ant; + if (sc->nvm_data->valid_rx_ant) + rx_ant &= sc->nvm_data->valid_rx_ant; return rx_ant; } Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:42:00 2018 (r330165) @@ -2023,18 +2023,13 @@ enum { /* Section types for IWM_NVM_ACCESS_CMD */ enum { - IWM_NVM_SECTION_TYPE_HW = 0, - IWM_NVM_SECTION_TYPE_SW, - IWM_NVM_SECTION_TYPE_PAPD, - IWM_NVM_SECTION_TYPE_REGULATORY, - IWM_NVM_SECTION_TYPE_CALIBRATION, - IWM_NVM_SECTION_TYPE_PRODUCTION, - IWM_NVM_SECTION_TYPE_POST_FCS_CALIB, - /* 7, 8, 9 unknown */ - IWM_NVM_SECTION_TYPE_HW_8000 = 10, - IWM_NVM_SECTION_TYPE_MAC_OVERRIDE, - IWM_NVM_SECTION_TYPE_PHY_SKU, - IWM_NVM_NUM_OF_SECTIONS, + IWM_NVM_SECTION_TYPE_SW = 1, + IWM_NVM_SECTION_TYPE_REGULATORY = 3, + IWM_NVM_SECTION_TYPE_CALIBRATION = 4, + IWM_NVM_SECTION_TYPE_PRODUCTION = 5, + IWM_NVM_SECTION_TYPE_MAC_OVERRIDE = 11, + IWM_NVM_SECTION_TYPE_PHY_SKU = 12, + IWM_NVM_MAX_NUM_SECTIONS = 13, }; /** Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:42:00 2018 (r330165) @@ -192,10 +192,10 @@ struct iwm_nvm_data { #define IWM_NUM_CHANNELS 39 #define IWM_NUM_CHANNELS_8000 51 - uint16_t nvm_ch_flags[IWM_NUM_CHANNELS_8000]; - uint16_t nvm_version; uint8_t max_tx_pwr_half_dbm; + + uint16_t nvm_ch_flags[]; }; /* max bufs per tfd the driver will use */ @@ -291,10 +291,6 @@ struct iwm_ucode_status { #define IWM_CMD_RESP_MAX PAGE_SIZE -/* lower blocks contain EEPROM image and calibration data */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 16384 -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 32768 - #define IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS 500 #define IWM_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS 400 @@ -454,7 +450,7 @@ struct iwm_softc { int sc_fw_phy_config; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; - struct iwm_nvm_data sc_nvm; + struct iwm_nvm_data *nvm_data; struct iwm_phy_db *sc_phy_db; struct iwm_bf_data sc_bf; @@ -492,6 +488,9 @@ struct iwm_softc { struct iwm_tx_radiotap_header sc_txtap; int sc_max_rssi; + + uint16_t eeprom_size; + uint8_t nvm_hw_section_num; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Mar 1 05:43:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD23DF234CB; Thu, 1 Mar 2018 05:43:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8826C815F8; Thu, 1 Mar 2018 05:43:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82DE12451F; Thu, 1 Mar 2018 05:43:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215hARc031191; Thu, 1 Mar 2018 05:43:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215hAa0031188; Thu, 1 Mar 2018 05:43:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010543.w215hAa0031188@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 05:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330166 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:43:11 -0000 Author: eadler Date: Thu Mar 1 05:43:10 2018 New Revision: 330166 URL: https://svnweb.freebsd.org/changeset/base/330166 Log: MFC r313312: [iwm] Use chipset configuration structs like iwlwifi does. * This makes it a bit easier to factor out common parts for e.g. the 7000 chipset family. * Add iwm7265d config, and recognize the 7265D chipset variant via the hardware revision. Tested: * 7260, STA mode (2ghz) Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:42:00 2018 (r330165) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:43:10 2018 (r330166) @@ -165,6 +165,67 @@ __FBSDID("$FreeBSD$"); #include #include +#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 +#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 + +/* lower blocks contain EEPROM image and calibration data */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ + +#define IWM7260_FW "iwm7260fw" +#define IWM3160_FW "iwm3160fw" +#define IWM7265_FW "iwm7265fw" +#define IWM7265D_FW "iwm7265Dfw" +#define IWM8000_FW "iwm8000Cfw" + +#define IWM_DEVICE_7000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_7000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000 + +const struct iwm_cfg iwm7260_cfg = { + .fw_name = IWM7260_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 1, +}; + +const struct iwm_cfg iwm3160_cfg = { + .fw_name = IWM3160_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 1, +}; + +const struct iwm_cfg iwm3165_cfg = { + /* XXX IWM7265D_FW doesn't seem to work properly yet */ + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm7265_cfg = { + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm7265d_cfg = { + /* XXX IWM7265D_FW doesn't seem to work properly yet */ + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +#define IWM_DEVICE_8000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_8000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000 + +const struct iwm_cfg iwm8260_cfg = { + .fw_name = IWM8000_FW, + IWM_DEVICE_8000_COMMON, + .host_interrupt_operation_mode = 0, +}; + const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, @@ -512,12 +573,12 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode * fw_fp will be set. */ IWM_UNLOCK(sc); - fwp = firmware_get(sc->sc_fwname); + fwp = firmware_get(sc->cfg->fw_name); IWM_LOCK(sc); if (fwp == NULL) { device_printf(sc->sc_dev, "could not read firmware %s (error %d)\n", - sc->sc_fwname, error); + sc->cfg->fw_name, error); goto out; } fw->fw_fp = fwp; @@ -536,7 +597,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode if (*(const uint32_t *)fw->fw_fp->data != 0 || le32toh(uhdr->magic) != IWM_TLV_UCODE_MAGIC) { device_printf(sc->sc_dev, "invalid firmware %s\n", - sc->sc_fwname); + sc->cfg->fw_name); error = EINVAL; goto out; } @@ -1370,7 +1431,7 @@ iwm_mvm_nic_config(struct iwm_softc *sc) * (PCIe power is lost before PERST# is asserted), causing ME FW * to lose ownership and not being able to obtain it back. */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { iwm_set_bits_mask_prph(sc, IWM_APMG_PS_CTRL_REG, IWM_APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, ~IWM_APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); @@ -1416,7 +1477,7 @@ iwm_nic_rx_init(struct iwm_softc *sc) IWM_WRITE_1(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_TIMEOUT_DEF); /* W/A for interrupt coalescing bug in 7260 and 3160 */ - if (sc->host_interrupt_operation_mode) + if (sc->cfg->host_interrupt_operation_mode) IWM_SETBITS(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_OPER_MODE); /* @@ -1473,7 +1534,7 @@ iwm_nic_init(struct iwm_softc *sc) int error; iwm_apm_init(sc); - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) iwm_set_pwr(sc); iwm_mvm_nic_config(sc); @@ -1633,7 +1694,7 @@ iwm_post_alive(struct iwm_softc *sc) IWM_FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); /* Enable L1-Active */ - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG, IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); } @@ -1649,9 +1710,6 @@ iwm_post_alive(struct iwm_softc *sc) * iwlwifi/mvm/nvm.c */ -#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 -#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 - /* Default NVM size to read */ #define IWM_NVM_DEFAULT_CHUNK_SIZE (2*1024) @@ -1777,7 +1835,7 @@ iwm_nvm_read_section(struct iwm_softc *sc, while (seglen == length) { /* Check no memory assumptions fail and cause an overflow */ if ((size_read + offset + length) > - sc->eeprom_size) { + sc->cfg->eeprom_size) { device_printf(sc->sc_dev, "EEPROM size is too small for NVM\n"); return ENOBUFS; @@ -1899,10 +1957,6 @@ enum iwm_nvm_channel_flags { IWM_NVM_CHANNEL_160MHZ = (1 << 11), }; -/* lower blocks contain EEPROM image and calibration data */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ - /* * Translate EEPROM flags to net80211. */ @@ -1938,7 +1992,7 @@ iwm_add_channel_band(struct iwm_softc *sc, struct ieee for (; ch_idx < ch_num; ch_idx++) { ch_flags = le16_to_cpup(nvm_ch_flags + ch_idx); - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) ieee = iwm_nvm_channels[ch_idx]; else ieee = iwm_nvm_channels_8000[ch_idx]; @@ -1988,7 +2042,7 @@ iwm_init_channel_map(struct ieee80211com *ic, int maxc IWM_NUM_2GHZ_CHANNELS - 1, IWM_NUM_2GHZ_CHANNELS, bands); if (data->sku_cap_band_52GHz_enable) { - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) ch_num = nitems(iwm_nvm_channels); else ch_num = nitems(iwm_nvm_channels_8000); @@ -2062,7 +2116,7 @@ static int iwm_get_sku(const struct iwm_softc *sc, const uint16_t *nvm_sw, const uint16_t *phy_sku) { - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_SKU); return le32_to_cpup((const uint32_t *)(phy_sku + IWM_SKU_8000)); @@ -2071,7 +2125,7 @@ iwm_get_sku(const struct iwm_softc *sc, const uint16_t static int iwm_get_nvm_version(const struct iwm_softc *sc, const uint16_t *nvm_sw) { - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_NVM_VERSION); else return le32_to_cpup((const uint32_t *)(nvm_sw + @@ -2082,7 +2136,7 @@ static int iwm_get_radio_cfg(const struct iwm_softc *sc, const uint16_t *nvm_sw, const uint16_t *phy_sku) { - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_RADIO_CFG); return le32_to_cpup((const uint32_t *)(phy_sku + IWM_RADIO_CFG_8000)); @@ -2093,7 +2147,7 @@ iwm_get_n_hw_addrs(const struct iwm_softc *sc, const u { int n_hw_addr; - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_N_HW_ADDRS); n_hw_addr = le32_to_cpup((const uint32_t *)(nvm_sw + IWM_N_HW_ADDRS_8000)); @@ -2105,7 +2159,7 @@ static void iwm_set_radio_cfg(const struct iwm_softc *sc, struct iwm_nvm_data *data, uint32_t radio_cfg) { - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { data->radio_cfg_type = IWM_NVM_RF_CFG_TYPE_MSK(radio_cfg); data->radio_cfg_step = IWM_NVM_RF_CFG_STEP_MSK(radio_cfg); data->radio_cfg_dash = IWM_NVM_RF_CFG_DASH_MSK(radio_cfg); @@ -2131,7 +2185,7 @@ iwm_set_hw_address(struct iwm_softc *sc, struct iwm_nv iwm_set_hw_address_from_csr(sc, data); } else #endif - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { const uint8_t *hw_addr = (const uint8_t *)(nvm_hw + IWM_HW_ADDR); /* The byte order is little endian 16 bit, meaning 214365 */ @@ -2162,7 +2216,7 @@ iwm_parse_nvm_data(struct iwm_softc *sc, struct iwm_nvm_data *data; uint32_t sku, radio_cfg; - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { data = malloc(sizeof(*data) + IWM_NUM_CHANNELS * sizeof(uint16_t), M_DEVBUF, M_NOWAIT | M_ZERO); @@ -2192,7 +2246,7 @@ iwm_parse_nvm_data(struct iwm_softc *sc, return NULL; } - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { memcpy(data->nvm_ch_flags, &nvm_sw[IWM_NVM_CHANNELS], IWM_NUM_CHANNELS * sizeof(uint16_t)); } else { @@ -2216,14 +2270,14 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw const uint16_t *hw, *sw, *calib, *regulatory, *mac_override, *phy_sku; /* Checking for required sections */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { if (!sections[IWM_NVM_SECTION_TYPE_SW].data || - !sections[sc->nvm_hw_section_num].data) { + !sections[sc->cfg->nvm_hw_section_num].data) { device_printf(sc->sc_dev, "Can't parse empty OTP/NVM sections\n"); return NULL; } - } else if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) { + } else if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { /* SW and REGULATORY sections are mandatory */ if (!sections[IWM_NVM_SECTION_TYPE_SW].data || !sections[IWM_NVM_SECTION_TYPE_REGULATORY].data) { @@ -2232,7 +2286,7 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw return NULL; } /* MAC_OVERRIDE or at least HW section must exist */ - if (!sections[sc->nvm_hw_section_num].data && + if (!sections[sc->cfg->nvm_hw_section_num].data && !sections[IWM_NVM_SECTION_TYPE_MAC_OVERRIDE].data) { device_printf(sc->sc_dev, "Can't parse mac_address, empty sections\n"); @@ -2246,10 +2300,10 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw return NULL; } } else { - panic("unknown device family %d\n", sc->sc_device_family); + panic("unknown device family %d\n", sc->cfg->device_family); } - hw = (const uint16_t *) sections[sc->nvm_hw_section_num].data; + hw = (const uint16_t *) sections[sc->cfg->nvm_hw_section_num].data; sw = (const uint16_t *)sections[IWM_NVM_SECTION_TYPE_SW].data; calib = (const uint16_t *) sections[IWM_NVM_SECTION_TYPE_CALIBRATION].data; @@ -2274,14 +2328,14 @@ iwm_nvm_init(struct iwm_softc *sc) memset(nvm_sections, 0, sizeof(nvm_sections)); - if (sc->nvm_hw_section_num >= IWM_NVM_MAX_NUM_SECTIONS) + if (sc->cfg->nvm_hw_section_num >= IWM_NVM_MAX_NUM_SECTIONS) return EINVAL; /* load NVM values from nic */ /* Read From FW NVM */ IWM_DPRINTF(sc, IWM_DEBUG_EEPROM, "Read from NVM\n"); - nvm_buffer = malloc(sc->eeprom_size, M_DEVBUF, M_NOWAIT | M_ZERO); + nvm_buffer = malloc(sc->cfg->eeprom_size, M_DEVBUF, M_NOWAIT | M_ZERO); if (!nvm_buffer) return ENOMEM; for (section = 0; section < IWM_NVM_MAX_NUM_SECTIONS; section++) { @@ -2562,7 +2616,7 @@ iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode { int error, w; - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) error = iwm_load_firmware_8000(sc, ucode_type); else error = iwm_load_firmware_7000(sc, ucode_type); @@ -2575,7 +2629,7 @@ iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode } if (error || !sc->sc_uc.uc_ok) { device_printf(sc->sc_dev, "could not load firmware\n"); - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { device_printf(sc->sc_dev, "cpu1 status: 0x%x\n", iwm_read_prph(sc, IWM_SB_CPU_1_STATUS)); device_printf(sc->sc_dev, "cpu2 status: 0x%x\n", @@ -4472,7 +4526,7 @@ iwm_mvm_sf_config(struct iwm_softc *sc, enum iwm_sf_st }; int ret = 0; - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) sf_cmd.state |= htole32(IWM_SF_CFG_DUMMY_NOTIF_OFF); switch (new_state) { @@ -4660,7 +4714,7 @@ iwm_init_hw(struct iwm_softc *sc) } /* Initialize tx backoffs to the minimum. */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) iwm_mvm_tt_tx_backoff(sc, 0); error = iwm_mvm_power_update_device(sc); @@ -5656,51 +5710,30 @@ iwm_dev_check(device_t dev) sc = device_get_softc(dev); - sc->sc_hw_rev = IWM_READ(sc, IWM_CSR_HW_REV); switch (pci_get_device(dev)) { case PCI_PRODUCT_INTEL_WL_3160_1: case PCI_PRODUCT_INTEL_WL_3160_2: - sc->sc_fwname = "iwm3160fw"; - sc->host_interrupt_operation_mode = 1; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; - sc->sc_device_family = IWM_DEVICE_FAMILY_7000; + sc->cfg = &iwm3160_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_3165_1: case PCI_PRODUCT_INTEL_WL_3165_2: - sc->sc_fwname = "iwm7265fw"; - sc->host_interrupt_operation_mode = 0; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; - sc->sc_device_family = IWM_DEVICE_FAMILY_7000; + sc->cfg = &iwm3165_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_7260_1: case PCI_PRODUCT_INTEL_WL_7260_2: - sc->sc_fwname = "iwm7260fw"; - sc->host_interrupt_operation_mode = 1; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; - sc->sc_device_family = IWM_DEVICE_FAMILY_7000; + sc->cfg = &iwm7260_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_7265_1: case PCI_PRODUCT_INTEL_WL_7265_2: - sc->sc_fwname = "iwm7265fw"; - sc->host_interrupt_operation_mode = 0; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; - sc->sc_device_family = IWM_DEVICE_FAMILY_7000; + sc->cfg = &iwm7265_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_8260_1: case PCI_PRODUCT_INTEL_WL_8260_2: - sc->sc_fwname = "iwm8000Cfw"; - sc->host_interrupt_operation_mode = 0; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000; - sc->sc_device_family = IWM_DEVICE_FAMILY_8000; + sc->cfg = &iwm8260_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000; return (0); default: @@ -5819,16 +5852,14 @@ iwm_attach(device_t dev) if (error != 0) goto fail; + sc->sc_hw_rev = IWM_READ(sc, IWM_CSR_HW_REV); /* - * We now start fiddling with the hardware - */ - /* * In the 8000 HW family the format of the 4 bytes of CSR_HW_REV have * changed, and now the revision step also includes bit 0-1 (no more * "dash" value). To keep hw_rev backwards compatible - we'll store it * in the old format. */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) | (IWM_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2); @@ -5837,7 +5868,7 @@ iwm_attach(device_t dev) goto fail; } - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { int ret; uint32_t hw_step; @@ -5873,6 +5904,12 @@ iwm_attach(device_t dev) device_printf(sc->sc_dev, "Failed to lock the nic\n"); goto fail; } + } + + /* special-case 7265D, it has the same PCI IDs. */ + if (sc->cfg == &iwm7265_cfg && + (sc->sc_hw_rev & IWM_CSR_HW_REV_TYPE_MSK) == IWM_CSR_HW_REV_TYPE_7265D) { + sc->cfg = &iwm7265d_cfg; } /* Allocate DMA memory for firmware transfers. */ Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:42:00 2018 (r330165) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:43:10 2018 (r330166) @@ -256,7 +256,7 @@ iwm_nic_lock(struct iwm_softc *sc) IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) DELAY(2); if (iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, @@ -425,7 +425,7 @@ iwm_apm_init(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_RESET, "iwm apm start\n"); /* Disable L0S exit timer (platform NMI Work/Around) */ - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { IWM_SETBITS(sc, IWM_CSR_GIO_CHICKEN_BITS, IWM_CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); } @@ -476,7 +476,7 @@ iwm_apm_init(struct iwm_softc *sc) goto out; } - if (sc->host_interrupt_operation_mode) { + if (sc->cfg->host_interrupt_operation_mode) { /* * This is a bit of an abuse - This is needed for 7260 / 3160 * only check host_interrupt_operation_mode even if this is @@ -505,7 +505,7 @@ iwm_apm_init(struct iwm_softc *sc) * do not disable clocks. This preserves any hardware bits already * set by default in "CLK_CTRL_REG" after reset. */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { iwm_write_prph(sc, IWM_APMG_CLK_EN_REG, IWM_APMG_CLK_VAL_DMA_CLK_RQT); DELAY(20); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:42:00 2018 (r330165) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:43:10 2018 (r330166) @@ -362,6 +362,27 @@ struct iwm_node { #define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t)) #define IWM_ICT_PADDR_SHIFT 12 +enum iwm_device_family { + IWM_DEVICE_FAMILY_UNDEFINED, + IWM_DEVICE_FAMILY_7000, + IWM_DEVICE_FAMILY_8000, +}; + +/** + * struct iwm_cfg + * @fw_name: Firmware filename. + * @host_interrupt_operation_mode: device needs host interrupt operation + * mode set + * @nvm_hw_section_num: the ID of the HW NVM section + */ +struct iwm_cfg { + const char *fw_name; + uint16_t eeprom_size; + enum iwm_device_family device_family; + int host_interrupt_operation_mode; + uint8_t nvm_hw_section_num; +}; + struct iwm_softc { device_t sc_dev; uint32_t sc_debug; @@ -410,9 +431,6 @@ struct iwm_softc { int sc_hw_rev; int sc_hw_id; - int sc_device_family; -#define IWM_DEVICE_FAMILY_7000 1 -#define IWM_DEVICE_FAMILY_8000 2 struct iwm_dma_info kw_dma; struct iwm_dma_info fw_dma; @@ -444,12 +462,12 @@ struct iwm_softc { */ int sc_generation; - const char *sc_fwname; bus_size_t sc_fwdmasegsz; struct iwm_fw_info sc_fw; int sc_fw_phy_config; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; + const struct iwm_cfg *cfg; struct iwm_nvm_data *nvm_data; struct iwm_phy_db *sc_phy_db; @@ -480,17 +498,12 @@ struct iwm_softc { struct iwm_notif_statistics sc_stats; int sc_noise; - int host_interrupt_operation_mode; - caddr_t sc_drvbpf; struct iwm_rx_radiotap_header sc_rxtap; struct iwm_tx_radiotap_header sc_txtap; int sc_max_rssi; - - uint16_t eeprom_size; - uint8_t nvm_hw_section_num; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Mar 1 05:44:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2077F23662; Thu, 1 Mar 2018 05:44:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72B00818B2; Thu, 1 Mar 2018 05:44:17 +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 6D12A24521; Thu, 1 Mar 2018 05:44:17 +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 w215iHbF031298; Thu, 1 Mar 2018 05:44:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215iGSi031292; Thu, 1 Mar 2018 05:44:16 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010544.w215iGSi031292@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 05:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330167 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:44:18 -0000 Author: eadler Date: Thu Mar 1 05:44:16 2018 New Revision: 330167 URL: https://svnweb.freebsd.org/changeset/base/330167 Log: MFC r313314: [iwm] Sync valid_tx_ant and valid_rx_ant mask handling with iwlwifi. * This fixes the phy_cfg field sent in the iwm_send_phy_cfg_cmd() command, which wasn't taking into account the valid_rx_ant and valid_tx_ant masks from nvm_data before. Tested: * 7260, STA mode, 2G and 5G Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:44:16 2018 (r330167) @@ -771,8 +771,14 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode (int) tlv_len); goto parse_out; } - sc->sc_fw_phy_config = + sc->sc_fw.phy_config = le32toh(*(const uint32_t *)tlv_data); + sc->sc_fw.valid_tx_ant = (sc->sc_fw.phy_config & + IWM_FW_PHY_CFG_TX_CHAIN) >> + IWM_FW_PHY_CFG_TX_CHAIN_POS; + sc->sc_fw.valid_rx_ant = (sc->sc_fw.phy_config & + IWM_FW_PHY_CFG_RX_CHAIN) >> + IWM_FW_PHY_CFG_RX_CHAIN_POS; break; case IWM_UCODE_TLV_API_CHANGES_SET: { @@ -1401,12 +1407,13 @@ iwm_mvm_nic_config(struct iwm_softc *sc) { uint8_t radio_cfg_type, radio_cfg_step, radio_cfg_dash; uint32_t reg_val = 0; + uint32_t phy_config = iwm_mvm_get_phy_config(sc); - radio_cfg_type = (sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RADIO_TYPE) >> + radio_cfg_type = (phy_config & IWM_FW_PHY_CFG_RADIO_TYPE) >> IWM_FW_PHY_CFG_RADIO_TYPE_POS; - radio_cfg_step = (sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RADIO_STEP) >> + radio_cfg_step = (phy_config & IWM_FW_PHY_CFG_RADIO_STEP) >> IWM_FW_PHY_CFG_RADIO_STEP_POS; - radio_cfg_dash = (sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RADIO_DASH) >> + radio_cfg_dash = (phy_config & IWM_FW_PHY_CFG_RADIO_DASH) >> IWM_FW_PHY_CFG_RADIO_DASH_POS; /* SKU control */ @@ -2696,7 +2703,7 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) enum iwm_ucode_type ucode_type = sc->sc_uc_current; /* Set parameters */ - phy_cfg_cmd.phy_cfg = htole32(sc->sc_fw_phy_config); + phy_cfg_cmd.phy_cfg = htole32(iwm_mvm_get_phy_config(sc)); phy_cfg_cmd.calib_control.event_trigger = sc->sc_default_calib[ucode_type].event_trigger; phy_cfg_cmd.calib_control.flow_trigger = @@ -2783,6 +2790,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn if (error != 0) return error; +#if 0 IWM_DPRINTF(sc, IWM_DEBUG_RESET, "%s: phy_txant=0x%08x, nvm_valid_tx_ant=0x%02x, valid=0x%02x\n", __func__, @@ -2790,10 +2798,11 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn >> IWM_FW_PHY_CFG_TX_CHAIN_POS), sc->nvm_data->valid_tx_ant, iwm_fw_valid_tx_ant(sc)); +#endif - /* Send TX valid antennas before triggering calibrations */ - if ((error = iwm_send_tx_ant_cfg(sc, iwm_fw_valid_tx_ant(sc))) != 0) { + error = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + if (error != 0) { device_printf(sc->sc_dev, "failed to send antennas before calibration: %d\n", error); return error; @@ -4212,11 +4221,11 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in #if 0 if (txant == 0) - txant = iwm_fw_valid_tx_ant(sc); + txant = iwm_mvm_get_valid_tx_ant(sc); nextant = 1<<(ffs(txant)-1); txant &= ~nextant; #else - nextant = iwm_fw_valid_tx_ant(sc); + nextant = iwm_mvm_get_valid_tx_ant(sc); #endif /* * Map the rate id into a rate index into @@ -4682,7 +4691,8 @@ iwm_init_hw(struct iwm_softc *sc) goto error; } - if ((error = iwm_send_tx_ant_cfg(sc, iwm_fw_valid_tx_ant(sc))) != 0) { + error = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + if (error != 0) { device_printf(sc->sc_dev, "antenna config failed\n"); goto error; } Modified: stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c Thu Mar 1 05:44:16 2018 (r330167) @@ -202,8 +202,8 @@ iwm_mvm_phy_ctxt_cmd_data(struct iwm_softc *sc, ieee80211_chan2ieee(ic, chan), chains_static, chains_dynamic, - iwm_fw_valid_rx_ant(sc), - iwm_fw_valid_tx_ant(sc)); + iwm_mvm_get_valid_rx_ant(sc), + iwm_mvm_get_valid_tx_ant(sc)); cmd->ci.band = IEEE80211_IS_CHAN_2GHZ(chan) ? @@ -217,13 +217,13 @@ iwm_mvm_phy_ctxt_cmd_data(struct iwm_softc *sc, idle_cnt = chains_static; active_cnt = chains_dynamic; - cmd->rxchain_info = htole32(iwm_fw_valid_rx_ant(sc) << + cmd->rxchain_info = htole32(iwm_mvm_get_valid_rx_ant(sc) << IWM_PHY_RX_CHAIN_VALID_POS); cmd->rxchain_info |= htole32(idle_cnt << IWM_PHY_RX_CHAIN_CNT_POS); cmd->rxchain_info |= htole32(active_cnt << IWM_PHY_RX_CHAIN_MIMO_CNT_POS); - cmd->txchain_info = htole32(iwm_fw_valid_tx_ant(sc)); + cmd->txchain_info = htole32(iwm_mvm_get_valid_tx_ant(sc)); } /* Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:44:16 2018 (r330167) @@ -172,7 +172,7 @@ iwm_mvm_scan_rx_chain(struct iwm_softc *sc) uint16_t rx_chain; uint8_t rx_ant; - rx_ant = iwm_fw_valid_rx_ant(sc); + rx_ant = iwm_mvm_get_valid_rx_ant(sc); rx_chain = rx_ant << IWM_PHY_RX_CHAIN_VALID_POS; rx_chain |= rx_ant << IWM_PHY_RX_CHAIN_FORCE_MIMO_SEL_POS; rx_chain |= rx_ant << IWM_PHY_RX_CHAIN_FORCE_SEL_POS; @@ -209,7 +209,7 @@ iwm_mvm_scan_rate_n_flags(struct iwm_softc *sc, int fl for (i = 0, ind = sc->sc_scan_last_antenna; i < IWM_RATE_MCS_ANT_NUM; i++) { ind = (ind + 1) % IWM_RATE_MCS_ANT_NUM; - if (iwm_fw_valid_tx_ant(sc) & (1 << ind)) { + if (iwm_mvm_get_valid_tx_ant(sc) & (1 << ind)) { sc->sc_scan_last_antenna = ind; break; } @@ -469,8 +469,8 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) if (scan_config == NULL) return ENOMEM; - scan_config->tx_chains = htole32(iwm_fw_valid_tx_ant(sc)); - scan_config->rx_chains = htole32(iwm_fw_valid_rx_ant(sc)); + scan_config->tx_chains = htole32(iwm_mvm_get_valid_tx_ant(sc)); + scan_config->rx_chains = htole32(iwm_mvm_get_valid_rx_ant(sc)); scan_config->legacy_rates = htole32(rates | IWM_SCAN_CONFIG_SUPPORTED_RATE(rates)); Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:44:16 2018 (r330167) @@ -428,31 +428,3 @@ iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cm sc->sc_wantresp = -1; wakeup(&sc->sc_wantresp); } - -uint8_t -iwm_fw_valid_tx_ant(struct iwm_softc *sc) -{ - uint8_t tx_ant; - - tx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) - >> IWM_FW_PHY_CFG_TX_CHAIN_POS); - - if (sc->nvm_data->valid_tx_ant) - tx_ant &= sc->nvm_data->valid_tx_ant; - - return tx_ant; -} - -uint8_t -iwm_fw_valid_rx_ant(struct iwm_softc *sc) -{ - uint8_t rx_ant; - - rx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RX_CHAIN) - >> IWM_FW_PHY_CFG_RX_CHAIN_POS); - - if (sc->nvm_data->valid_rx_ant) - rx_ant &= sc->nvm_data->valid_rx_ant; - - return rx_ant; -} Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 05:44:16 2018 (r330167) @@ -116,7 +116,34 @@ extern int iwm_mvm_send_cmd_pdu_status(struct iwm_soft uint16_t len, const void *data, uint32_t *status); extern void iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cmd *hcmd); -extern uint8_t iwm_fw_valid_tx_ant(struct iwm_softc *sc); -extern uint8_t iwm_fw_valid_rx_ant(struct iwm_softc *sc); +static inline uint8_t +iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc) +{ + return sc->nvm_data && sc->nvm_data->valid_tx_ant ? + sc->sc_fw.valid_tx_ant & sc->nvm_data->valid_tx_ant : + sc->sc_fw.valid_tx_ant; +} + +static inline uint8_t +iwm_mvm_get_valid_rx_ant(struct iwm_softc *sc) +{ + return sc->nvm_data && sc->nvm_data->valid_rx_ant ? + sc->sc_fw.valid_rx_ant & sc->nvm_data->valid_rx_ant : + sc->sc_fw.valid_rx_ant; +} + +static inline uint32_t +iwm_mvm_get_phy_config(struct iwm_softc *sc) +{ + uint32_t phy_config = ~(IWM_FW_PHY_CFG_TX_CHAIN | + IWM_FW_PHY_CFG_RX_CHAIN); + uint32_t valid_rx_ant = iwm_mvm_get_valid_rx_ant(sc); + uint32_t valid_tx_ant = iwm_mvm_get_valid_tx_ant(sc); + + phy_config |= valid_tx_ant << IWM_FW_PHY_CFG_TX_CHAIN_POS | + valid_rx_ant << IWM_FW_PHY_CFG_RX_CHAIN_POS; + + return sc->sc_fw.phy_config & phy_config; +} #endif /* __IF_IWM_UTIL_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:44:16 2018 (r330167) @@ -172,6 +172,10 @@ struct iwm_fw_info { } fw_sect[IWM_UCODE_SECT_MAX]; int fw_count; } fw_sects[IWM_UCODE_TYPE_MAX]; + + uint32_t phy_config; + uint8_t valid_tx_ant; + uint8_t valid_rx_ant; }; struct iwm_nvm_data { @@ -464,7 +468,6 @@ struct iwm_softc { bus_size_t sc_fwdmasegsz; struct iwm_fw_info sc_fw; - int sc_fw_phy_config; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; const struct iwm_cfg *cfg; From owner-svn-src-all@freebsd.org Thu Mar 1 05:45:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7725AF23815; Thu, 1 Mar 2018 05:45:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25FAF81B6D; Thu, 1 Mar 2018 05:45:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20EB924525; Thu, 1 Mar 2018 05:45:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215jNf7031388; Thu, 1 Mar 2018 05:45:23 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215jMn0031385; Thu, 1 Mar 2018 05:45:22 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010545.w215jMn0031385@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 05:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330168 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:45:23 -0000 Author: eadler Date: Thu Mar 1 05:45:22 2018 New Revision: 330168 URL: https://svnweb.freebsd.org/changeset/base/330168 Log: MFC r313315,r313316: [iwm] Get rid of some gratuitous constant renaming wrt. Linux iwlwifi. * IWM_UCODE_SECT_MAX -> IWM_UCODE_SECTION_MAX * IWM_UCODE_TYPE_* -> IWM_UCODE_* (except for IWM_UCODE_TYPE_MAX which stays). [iwm] Store paging_mem_size field in firmware image information struct. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:44:16 2018 (r330167) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:45:22 2018 (r330168) @@ -490,7 +490,7 @@ iwm_firmware_store_section(struct iwm_softc *sc, return EINVAL; fws = &sc->sc_fw.fw_sects[type]; - if (fws->fw_count >= IWM_UCODE_SECT_MAX) + if (fws->fw_count >= IWM_UCODE_SECTION_MAX) return EINVAL; fwone = &fws->fw_sect[fws->fw_count]; @@ -554,11 +554,13 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode enum iwm_ucode_tlv_type tlv_type; const struct firmware *fwp; const uint8_t *data; + uint32_t usniffer_img; + uint32_t paging_mem_size; int error = 0; size_t len; if (fw->fw_status == IWM_FW_STATUS_DONE && - ucode_type != IWM_UCODE_TYPE_INIT) + ucode_type != IWM_UCODE_INIT) return 0; while (fw->fw_status == IWM_FW_STATUS_INPROGRESS) @@ -716,9 +718,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode } case IWM_UCODE_TLV_SEC_RT: if ((error = iwm_firmware_store_section(sc, - IWM_UCODE_TYPE_REGULAR, tlv_data, tlv_len)) != 0) { + IWM_UCODE_REGULAR, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TYPE_REGULAR: iwm_firmware_store_section() failed; %d\n", + "%s: IWM_UCODE_REGULAR: iwm_firmware_store_section() failed; %d\n", __func__, error); goto parse_out; @@ -726,9 +728,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode break; case IWM_UCODE_TLV_SEC_INIT: if ((error = iwm_firmware_store_section(sc, - IWM_UCODE_TYPE_INIT, tlv_data, tlv_len)) != 0) { + IWM_UCODE_INIT, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TYPE_INIT: iwm_firmware_store_section() failed; %d\n", + "%s: IWM_UCODE_INIT: iwm_firmware_store_section() failed; %d\n", __func__, error); goto parse_out; @@ -736,9 +738,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode break; case IWM_UCODE_TLV_SEC_WOWLAN: if ((error = iwm_firmware_store_section(sc, - IWM_UCODE_TYPE_WOW, tlv_data, tlv_len)) != 0) { + IWM_UCODE_WOWLAN, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TYPE_WOW: iwm_firmware_store_section() failed; %d\n", + "%s: IWM_UCODE_WOWLAN: iwm_firmware_store_section() failed; %d\n", __func__, error); goto parse_out; @@ -829,11 +831,43 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode case IWM_UCODE_TLV_SEC_RT_USNIFFER: if ((error = iwm_firmware_store_section(sc, - IWM_UCODE_TYPE_REGULAR_USNIFFER, tlv_data, + IWM_UCODE_REGULAR_USNIFFER, tlv_data, tlv_len)) != 0) goto parse_out; break; + case IWM_UCODE_TLV_PAGING: + if (tlv_len != sizeof(uint32_t)) { + error = EINVAL; + goto parse_out; + } + paging_mem_size = le32toh(*(const uint32_t *)tlv_data); + + IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, + "%s: Paging: paging enabled (size = %u bytes)\n", + __func__, paging_mem_size); + if (paging_mem_size > IWM_MAX_PAGING_IMAGE_SIZE) { + device_printf(sc->sc_dev, + "%s: Paging: driver supports up to %u bytes for paging image\n", + __func__, IWM_MAX_PAGING_IMAGE_SIZE); + error = EINVAL; + goto out; + } + if (paging_mem_size & (IWM_FW_PAGING_SIZE - 1)) { + device_printf(sc->sc_dev, + "%s: Paging: image isn't multiple %u\n", + __func__, IWM_FW_PAGING_SIZE); + error = EINVAL; + goto out; + } + + sc->sc_fw.fw_sects[IWM_UCODE_REGULAR].paging_mem_size = + paging_mem_size; + usniffer_img = IWM_UCODE_REGULAR_USNIFFER; + sc->sc_fw.fw_sects[usniffer_img].paging_mem_size = + paging_mem_size; + break; + case IWM_UCODE_TLV_N_SCAN_CHANNELS: if (tlv_len != sizeof(uint32_t)) { error = EINVAL; @@ -2492,7 +2526,7 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struc (*first_ucode_section)++; } - for (i = *first_ucode_section; i < IWM_UCODE_SECT_MAX; i++) { + for (i = *first_ucode_section; i < IWM_UCODE_SECTION_MAX; i++) { last_read_idx = i; data = fws->fw_sect[i].fws_data; dlen = fws->fw_sect[i].fws_len; @@ -2764,7 +2798,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn sc->sc_init_complete = 0; if ((error = iwm_mvm_load_ucode_wait_alive(sc, - IWM_UCODE_TYPE_INIT)) != 0) { + IWM_UCODE_INIT)) != 0) { device_printf(sc->sc_dev, "failed to load init firmware\n"); return error; } @@ -4680,7 +4714,7 @@ iwm_init_hw(struct iwm_softc *sc) } /* omstart, this time with the regular firmware */ - error = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_TYPE_REGULAR); + error = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_REGULAR); if (error) { device_printf(sc->sc_dev, "could not load firmware\n"); goto error; Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:44:16 2018 (r330167) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:45:22 2018 (r330168) @@ -888,6 +888,28 @@ struct iwm_fw_cipher_scheme { uint8_t hw_cipher; } __packed; +/* + * Block paging calculations + */ +#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */ +#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */ +#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3 +/* 8 pages per group */ +#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE) +/* don't change, support only 32KB size */ +#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE) +/* 32K == 2^15 */ +#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + IWM_PAGE_PER_GROUP_2_EXP_SIZE) + +/* + * Image paging calculations + */ +#define IWM_BLOCK_PER_IMAGE_2_EXP_SIZE 5 +/* 2^5 == 32 blocks per image */ +#define IWM_NUM_OF_BLOCK_PER_IMAGE (1 << IWM_BLOCK_PER_IMAGE_2_EXP_SIZE) +/* maximum image size 1024KB */ +#define IWM_MAX_PAGING_IMAGE_SIZE (IWM_NUM_OF_BLOCK_PER_IMAGE * IWM_PAGING_BLOCK_SIZE) + /** * struct iwm_fw_cscheme_list - a cipher scheme list * @size: a number of entries Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:44:16 2018 (r330167) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:45:22 2018 (r330168) @@ -137,7 +137,7 @@ struct iwm_tx_radiotap_header { (1 << IEEE80211_RADIOTAP_CHANNEL)) -#define IWM_UCODE_SECT_MAX 16 +#define IWM_UCODE_SECTION_MAX 16 #define IWM_FWDMASEGSZ (192*1024) #define IWM_FWDMASEGSZ_8000 (320*1024) /* sanity check value */ @@ -152,11 +152,21 @@ struct iwm_tx_radiotap_header { #define IWM_FW_STATUS_INPROGRESS 1 #define IWM_FW_STATUS_DONE 2 +/** + * enum iwm_ucode_type + * + * The type of ucode. + * + * @IWM_UCODE_REGULAR: Normal runtime ucode + * @IWM_UCODE_INIT: Initial ucode + * @IWM_UCODE_WOWLAN: Wake on Wireless enabled ucode + * @IWM_UCODE_REGULAR_USNIFFER: Normal runtime ucode when using usniffer image + */ enum iwm_ucode_type { - IWM_UCODE_TYPE_REGULAR, - IWM_UCODE_TYPE_INIT, - IWM_UCODE_TYPE_WOW, - IWM_UCODE_TYPE_REGULAR_USNIFFER, + IWM_UCODE_REGULAR, + IWM_UCODE_INIT, + IWM_UCODE_WOWLAN, + IWM_UCODE_REGULAR_USNIFFER, IWM_UCODE_TYPE_MAX }; @@ -169,8 +179,9 @@ struct iwm_fw_info { const void *fws_data; uint32_t fws_len; uint32_t fws_devoff; - } fw_sect[IWM_UCODE_SECT_MAX]; + } fw_sect[IWM_UCODE_SECTION_MAX]; int fw_count; + uint32_t paging_mem_size; } fw_sects[IWM_UCODE_TYPE_MAX]; uint32_t phy_config; From owner-svn-src-all@freebsd.org Thu Mar 1 05:46:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A84F6F2398E; Thu, 1 Mar 2018 05:46:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C54781DAC; Thu, 1 Mar 2018 05:46:12 +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 575A524527; Thu, 1 Mar 2018 05:46:12 +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 w215kCug031469; Thu, 1 Mar 2018 05:46:12 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215kC4J031466; Thu, 1 Mar 2018 05:46:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010546.w215kC4J031466@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 05:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330169 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:46:13 -0000 Author: eadler Date: Thu Mar 1 05:46:11 2018 New Revision: 330169 URL: https://svnweb.freebsd.org/changeset/base/330169 Log: MFC r313317: [iwm] Change 2nd arg of iwm_phy_db_set_section() to struct iwm_rx_packet. * This matches the function declaration in Linux's iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_phy_db.c stable/11/sys/dev/iwm/if_iwm_phy_db.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:45:22 2018 (r330168) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:46:11 2018 (r330169) @@ -5357,13 +5357,9 @@ iwm_notif_intr(struct iwm_softc *sc) wakeup(&sc->sc_uc); break; } - case IWM_CALIB_RES_NOTIF_PHY_DB: { - struct iwm_calib_res_notif_phy_db *phy_db_notif; - phy_db_notif = (void *)pkt->data; - - iwm_phy_db_set_section(sc->sc_phy_db, phy_db_notif); - - break; } + case IWM_CALIB_RES_NOTIF_PHY_DB: + iwm_phy_db_set_section(sc->sc_phy_db, pkt); + break; case IWM_STATISTICS_NOTIFICATION: { struct iwm_notif_statistics *stats; Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 05:45:22 2018 (r330168) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 05:46:11 2018 (r330169) @@ -310,8 +310,10 @@ iwm_phy_db_free(struct iwm_phy_db *phy_db) int iwm_phy_db_set_section(struct iwm_phy_db *phy_db, - struct iwm_calib_res_notif_phy_db *phy_db_notif) + struct iwm_rx_packet *pkt) { + struct iwm_calib_res_notif_phy_db *phy_db_notif = + (struct iwm_calib_res_notif_phy_db *)pkt->data; enum iwm_phy_db_section_type type = le16toh(phy_db_notif->type); uint16_t size = le16toh(phy_db_notif->length); struct iwm_phy_db_entry *entry; Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.h Thu Mar 1 05:45:22 2018 (r330168) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.h Thu Mar 1 05:46:11 2018 (r330169) @@ -111,7 +111,7 @@ struct iwm_calib_res_notif_phy_db; extern struct iwm_phy_db *iwm_phy_db_init(struct iwm_softc *sc); extern void iwm_phy_db_free(struct iwm_phy_db *phy_db); extern int iwm_phy_db_set_section(struct iwm_phy_db *phy_db, - struct iwm_calib_res_notif_phy_db *phy_db_notif); + struct iwm_rx_packet *pkt); extern int iwm_send_phy_db_data(struct iwm_phy_db *phy_db); #endif /* __IF_IWM_PHY_DB_H__ */ From owner-svn-src-all@freebsd.org Thu Mar 1 05:48:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41411F23CD0; Thu, 1 Mar 2018 05:48:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAB1D82249; Thu, 1 Mar 2018 05:48:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E576F2452D; Thu, 1 Mar 2018 05:48:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215mKnE031585; Thu, 1 Mar 2018 05:48:20 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215mK5o031578; Thu, 1 Mar 2018 05:48:20 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010548.w215mK5o031578@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 05:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330170 - in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Commit-Revision: 330170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:48:21 -0000 Author: eadler Date: Thu Mar 1 05:48:20 2018 New Revision: 330170 URL: https://svnweb.freebsd.org/changeset/base/330170 Log: MFC r313322,r313354: [iwm] Add implementation of the notification wait api from iwlwifi. Added: stable/11/sys/dev/iwm/if_iwm_notif_wait.c - copied unchanged from r313322, head/sys/dev/iwm/if_iwm_notif_wait.c stable/11/sys/dev/iwm/if_iwm_notif_wait.h - copied unchanged from r313322, head/sys/dev/iwm/if_iwm_notif_wait.h Modified: stable/11/sys/conf/files stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h stable/11/sys/modules/iwm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 05:46:11 2018 (r330169) +++ stable/11/sys/conf/files Thu Mar 1 05:48:20 2018 (r330170) @@ -1872,6 +1872,7 @@ dev/iwm/if_iwm.c optional iwm dev/iwm/if_iwm_binding.c optional iwm dev/iwm/if_iwm_led.c optional iwm dev/iwm/if_iwm_mac_ctxt.c optional iwm +dev/iwm/if_iwm_notif_wait.c optional iwm dev/iwm/if_iwm_pcie_trans.c optional iwm dev/iwm/if_iwm_phy_ctxt.c optional iwm dev/iwm/if_iwm_phy_db.c optional iwm Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:46:11 2018 (r330169) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:48:20 2018 (r330170) @@ -153,6 +153,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -5251,6 +5252,8 @@ iwm_notif_intr(struct iwm_softc *sc) continue; } + iwm_notification_wait_notify(sc->sc_notif_wait, code, pkt); + switch (code) { case IWM_REPLY_RX_PHY_CMD: iwm_mvm_rx_rx_phy_cmd(sc, pkt, data); @@ -5873,6 +5876,12 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); + sc->sc_notif_wait = iwm_notification_wait_init(sc); + if (sc->sc_notif_wait == NULL) { + device_printf(dev, "failed to init notification wait struct\n"); + goto fail; + } + /* Init phy db */ sc->sc_phy_db = iwm_phy_db_init(sc); if (!sc->sc_phy_db) { @@ -6358,6 +6367,11 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 /* Finished with the hardware - detach things */ iwm_pci_detach(dev); + + if (sc->sc_notif_wait != NULL) { + iwm_notification_wait_free(sc->sc_notif_wait); + sc->sc_notif_wait = NULL; + } mbufq_drain(&sc->sc_snd); IWM_LOCK_DESTROY(sc); Copied: stable/11/sys/dev/iwm/if_iwm_notif_wait.c (from r313322, head/sys/dev/iwm/if_iwm_notif_wait.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_notif_wait.c Thu Mar 1 05:48:20 2018 (r330170, copy of r313322, head/sys/dev/iwm/if_iwm_notif_wait.c) @@ -0,0 +1,219 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2015 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define IWM_WAIT_LOCK_INIT(_n, _s) \ + mtx_init(&(_n)->lk_mtx, (_s), "iwm wait_notif", MTX_DEF); +#define IWM_WAIT_LOCK(_n) mtx_lock(&(_n)->lk_mtx) +#define IWM_WAIT_UNLOCK(_n) mtx_unlock(&(_n)->lk_mtx) +#define IWM_WAIT_LOCK_DESTROY(_n) mtx_destroy(&(_n)->lk_mtx) + +struct iwm_notif_wait_data { + struct mtx lk_mtx; + char lk_buf[32]; + STAILQ_HEAD(, iwm_notification_wait) list; + struct iwm_softc *sc; +}; + +struct iwm_notif_wait_data * +iwm_notification_wait_init(struct iwm_softc *sc) +{ + struct iwm_notif_wait_data *data; + + data = malloc(sizeof(*data), M_DEVBUF, M_NOWAIT | M_ZERO); + if (data != NULL) { + snprintf(data->lk_buf, 32, "iwm wait_notif"); + IWM_WAIT_LOCK_INIT(data, data->lk_buf); + STAILQ_INIT(&data->list); + data->sc = sc; + } + + return data; +} + +void +iwm_notification_wait_free(struct iwm_notif_wait_data *notif_data) +{ + KASSERT(STAILQ_EMPTY(¬if_data->list), ("notif list isn't empty")); + IWM_WAIT_LOCK_DESTROY(notif_data); + free(notif_data, M_DEVBUF); +} + +/* XXX Get rid of separate cmd argument, like in iwlwifi's code */ +void +iwm_notification_wait_notify(struct iwm_notif_wait_data *notif_data, + uint16_t cmd, struct iwm_rx_packet *pkt) +{ + struct iwm_notification_wait *wait_entry; + + IWM_WAIT_LOCK(notif_data); + STAILQ_FOREACH(wait_entry, ¬if_data->list, entry) { + int found = FALSE; + int i; + + /* + * If it already finished (triggered) or has been + * aborted then don't evaluate it again to avoid races, + * Otherwise the function could be called again even + * though it returned true before + */ + if (wait_entry->triggered || wait_entry->aborted) + continue; + + for (i = 0; i < wait_entry->n_cmds; i++) { + if (cmd == wait_entry->cmds[i]) { + found = TRUE; + break; + } + } + if (!found) + continue; + + if (!wait_entry->fn || + wait_entry->fn(notif_data->sc, pkt, wait_entry->fn_data)) { + wait_entry->triggered = 1; + wakeup(wait_entry); + } + } + IWM_WAIT_UNLOCK(notif_data); +} + +void +iwm_abort_notification_waits(struct iwm_notif_wait_data *notif_data) +{ + struct iwm_notification_wait *wait_entry; + + IWM_WAIT_LOCK(notif_data); + STAILQ_FOREACH(wait_entry, ¬if_data->list, entry) { + wait_entry->aborted = 1; + wakeup(wait_entry); + } + IWM_WAIT_UNLOCK(notif_data); +} + +void +iwm_init_notification_wait(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry, const uint16_t *cmds, int n_cmds, + int (*fn)(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data), + void *fn_data) +{ + KASSERT(n_cmds <= IWM_MAX_NOTIF_CMDS, + ("n_cmds %d is too large", n_cmds)); + wait_entry->fn = fn; + wait_entry->fn_data = fn_data; + wait_entry->n_cmds = n_cmds; + memcpy(wait_entry->cmds, cmds, n_cmds * sizeof(uint16_t)); + wait_entry->triggered = 0; + wait_entry->aborted = 0; + + IWM_WAIT_LOCK(notif_data); + STAILQ_INSERT_TAIL(¬if_data->list, wait_entry, entry); + IWM_WAIT_UNLOCK(notif_data); +} + +int +iwm_wait_notification(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry, int timeout) +{ + int ret = 0; + + IWM_WAIT_LOCK(notif_data); + if (!wait_entry->triggered && !wait_entry->aborted) { + ret = msleep(wait_entry, ¬if_data->lk_mtx, 0, "iwm_notif", + timeout); + } + STAILQ_REMOVE(¬if_data->list, wait_entry, iwm_notification_wait, + entry); + IWM_WAIT_UNLOCK(notif_data); + + return ret; +} + +void +iwm_remove_notification(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry) +{ + IWM_WAIT_LOCK(notif_data); + STAILQ_REMOVE(¬if_data->list, wait_entry, iwm_notification_wait, + entry); + IWM_WAIT_UNLOCK(notif_data); +} Copied: stable/11/sys/dev/iwm/if_iwm_notif_wait.h (from r313322, head/sys/dev/iwm/if_iwm_notif_wait.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_notif_wait.h Thu Mar 1 05:48:20 2018 (r330170, copy of r313322, head/sys/dev/iwm/if_iwm_notif_wait.h) @@ -0,0 +1,138 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2015 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/* $FreeBSD$ */ + +#ifndef __IF_IWN_NOTIF_WAIT_H__ +#define __IF_IWN_NOTIF_WAIT_H__ + +#include + +#define IWM_MAX_NOTIF_CMDS 5 + +struct iwm_rx_packet; +struct iwm_softc; + +/** + * struct iwm_notification_wait - notification wait entry + * @entry: link for global list + * @fn: Function called with the notification. If the function + * returns true, the wait is over, if it returns false then + * the waiter stays blocked. If no function is given, any + * of the listed commands will unblock the waiter. + * @cmds: command IDs + * @n_cmds: number of command IDs + * @triggered: waiter should be woken up + * @aborted: wait was aborted + * + * This structure is not used directly, to wait for a + * notification declare it on the stack, and call + * iwm_init_notification_wait() with appropriate + * parameters. Then do whatever will cause the ucode + * to notify the driver, and to wait for that then + * call iwm_wait_notification(). + * + * Each notification is one-shot. If at some point we + * need to support multi-shot notifications (which + * can't be allocated on the stack) we need to modify + * the code for them. + */ +struct iwm_notification_wait { + STAILQ_ENTRY(iwm_notification_wait) entry; + + int (*fn)(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data); + void *fn_data; + + uint16_t cmds[IWM_MAX_NOTIF_CMDS]; + uint8_t n_cmds; + int triggered, aborted; +}; + +/* caller functions */ +extern struct iwm_notif_wait_data *iwm_notification_wait_init( + struct iwm_softc *sc); +extern void iwm_notification_wait_free(struct iwm_notif_wait_data *notif_data); +extern void iwm_notification_wait_notify( + struct iwm_notif_wait_data *notif_data, uint16_t cmd, + struct iwm_rx_packet *pkt); +extern void iwm_abort_notification_waits( + struct iwm_notif_wait_data *notif_data); + +/* user functions */ +extern void iwm_init_notification_wait(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry, + const uint16_t *cmds, int n_cmds, + int (*fn)(struct iwm_softc *sc, + struct iwm_rx_packet *pkt, void *data), + void *fn_data); +extern int iwm_wait_notification(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry, int timeout); +extern void iwm_remove_notification(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry); + +#endif /* __IF_IWN_NOTIF_WAIT_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:46:11 2018 (r330169) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:48:20 2018 (r330170) @@ -518,6 +518,8 @@ struct iwm_softc { struct iwm_tx_radiotap_header sc_txtap; int sc_max_rssi; + + struct iwm_notif_wait_data *sc_notif_wait; }; #define IWM_LOCK_INIT(_sc) \ Modified: stable/11/sys/modules/iwm/Makefile ============================================================================== --- stable/11/sys/modules/iwm/Makefile Thu Mar 1 05:46:11 2018 (r330169) +++ stable/11/sys/modules/iwm/Makefile Thu Mar 1 05:48:20 2018 (r330170) @@ -6,7 +6,7 @@ KMOD= if_iwm # Main driver SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c -SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c +SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c # bus layer SRCS+= if_iwm_pcie_trans.c SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h From owner-svn-src-all@freebsd.org Thu Mar 1 05:49:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BA16F23E73; Thu, 1 Mar 2018 05:49:33 +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 085D48253C; Thu, 1 Mar 2018 05:49:33 +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 032B824530; Thu, 1 Mar 2018 05:49:33 +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 w215nWfE031669; Thu, 1 Mar 2018 05:49:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215nWTi031667; Thu, 1 Mar 2018 05:49:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010549.w215nWTi031667@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 05:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330171 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:49:33 -0000 Author: eadler Date: Thu Mar 1 05:49:32 2018 New Revision: 330171 URL: https://svnweb.freebsd.org/changeset/base/330171 Log: MFC r313325: [iwm] Use notification wait API to wait for calibration to complete. Tested: * 7260, STA mode (2g, 5g) Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:48:20 2018 (r330170) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:49:32 2018 (r330171) @@ -284,6 +284,8 @@ struct iwm_nvm_section { uint8_t *data; }; +#define IWM_MVM_UCODE_CALIB_TIMEOUT (2*hz) + static int iwm_store_cscheme(struct iwm_softc *, const uint8_t *, size_t); static int iwm_firmware_store_section(struct iwm_softc *, enum iwm_ucode_type, @@ -2751,6 +2753,28 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) } static int +iwm_wait_phy_db_entry(struct iwm_softc *sc, + struct iwm_rx_packet *pkt, void *data) +{ + struct iwm_phy_db *phy_db = data; + + if (pkt->hdr.code != IWM_CALIB_RES_NOTIF_PHY_DB) { + if(pkt->hdr.code != IWM_INIT_COMPLETE_NOTIF) { + device_printf(sc->sc_dev, "%s: Unexpected cmd: %d\n", + __func__, pkt->hdr.code); + } + return TRUE; + } + + if (iwm_phy_db_set_section(phy_db, pkt)) { + device_printf(sc->sc_dev, + "%s: iwm_phy_db_set_section failed\n", __func__); + } + + return FALSE; +} + +static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) { @@ -2788,7 +2812,12 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, static int iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justnvm) { - int error; + struct iwm_notification_wait calib_wait; + static const uint16_t init_complete[] = { + IWM_INIT_COMPLETE_NOTIF, + IWM_CALIB_RES_NOTIF_PHY_DB + }; + int ret; /* do not operate with rfkill switch turned on */ if ((sc->sc_flags & IWM_FLAG_RFKILL) && !justnvm) { @@ -2797,81 +2826,80 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn return EPERM; } - sc->sc_init_complete = 0; - if ((error = iwm_mvm_load_ucode_wait_alive(sc, - IWM_UCODE_INIT)) != 0) { - device_printf(sc->sc_dev, "failed to load init firmware\n"); - return error; + iwm_init_notification_wait(sc->sc_notif_wait, + &calib_wait, + init_complete, + nitems(init_complete), + iwm_wait_phy_db_entry, + sc->sc_phy_db); + + /* Will also start the device */ + ret = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_INIT); + if (ret) { + device_printf(sc->sc_dev, "Failed to start INIT ucode: %d\n", + ret); + goto error; } if (justnvm) { - if ((error = iwm_nvm_init(sc)) != 0) { + /* Read nvm */ + ret = iwm_nvm_init(sc); + if (ret) { device_printf(sc->sc_dev, "failed to read nvm\n"); - return error; + goto error; } IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, sc->nvm_data->hw_addr); - - return 0; + goto error; } - if ((error = iwm_send_bt_init_conf(sc)) != 0) { + ret = iwm_send_bt_init_conf(sc); + if (ret) { device_printf(sc->sc_dev, - "failed to send bt coex configuration: %d\n", error); - return error; + "failed to send bt coex configuration: %d\n", ret); + goto error; } /* Init Smart FIFO. */ - error = iwm_mvm_sf_config(sc, IWM_SF_INIT_OFF); - if (error != 0) - return error; + ret = iwm_mvm_sf_config(sc, IWM_SF_INIT_OFF); + if (ret) + goto error; -#if 0 - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s: phy_txant=0x%08x, nvm_valid_tx_ant=0x%02x, valid=0x%02x\n", - __func__, - ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) - >> IWM_FW_PHY_CFG_TX_CHAIN_POS), - sc->nvm_data->valid_tx_ant, - iwm_fw_valid_tx_ant(sc)); -#endif - /* Send TX valid antennas before triggering calibrations */ - error = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); - if (error != 0) { + ret = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + if (ret) { device_printf(sc->sc_dev, - "failed to send antennas before calibration: %d\n", error); - return error; + "failed to send antennas before calibration: %d\n", ret); + goto error; } /* * Send phy configurations command to init uCode * to start the 16.0 uCode init image internal calibrations. */ - if ((error = iwm_send_phy_cfg_cmd(sc)) != 0 ) { + ret = iwm_send_phy_cfg_cmd(sc); + if (ret) { device_printf(sc->sc_dev, - "%s: failed to run internal calibration: %d\n", - __func__, error); - return error; + "%s: Failed to run INIT calibrations: %d\n", + __func__, ret); + goto error; } /* * Nothing to do but wait for the init complete notification - * from the firmware + * from the firmware. */ - while (!sc->sc_init_complete) { - error = msleep(&sc->sc_init_complete, &sc->sc_mtx, - 0, "iwminit", 2*hz); - if (error) { - device_printf(sc->sc_dev, "init complete failed: %d\n", - sc->sc_init_complete); - break; - } - } + IWM_UNLOCK(sc); + ret = iwm_wait_notification(sc->sc_notif_wait, &calib_wait, + IWM_MVM_UCODE_CALIB_TIMEOUT); + IWM_LOCK(sc); - IWM_DPRINTF(sc, IWM_DEBUG_RESET, "init %scomplete\n", - sc->sc_init_complete ? "" : "not "); - return error; + goto out; + +error: + iwm_remove_notification(sc->sc_notif_wait, &calib_wait); +out: + return ret; } /* @@ -5361,7 +5389,6 @@ iwm_notif_intr(struct iwm_softc *sc) break; } case IWM_CALIB_RES_NOTIF_PHY_DB: - iwm_phy_db_set_section(sc->sc_phy_db, pkt); break; case IWM_STATISTICS_NOTIFICATION: { @@ -5426,8 +5453,6 @@ iwm_notif_intr(struct iwm_softc *sc) break; case IWM_INIT_COMPLETE_NOTIF: - sc->sc_init_complete = 1; - wakeup(&sc->sc_init_complete); break; case IWM_SCAN_OFFLOAD_COMPLETE: { Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:48:20 2018 (r330170) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:49:32 2018 (r330171) @@ -451,7 +451,6 @@ struct iwm_softc { struct iwm_dma_info fw_dma; int sc_fw_chunk_done; - int sc_init_complete; struct iwm_ucode_status sc_uc; enum iwm_ucode_type sc_uc_current; From owner-svn-src-all@freebsd.org Thu Mar 1 05:50:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA21F24061; Thu, 1 Mar 2018 05:50:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51D858286B; Thu, 1 Mar 2018 05:50:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CD3024546; Thu, 1 Mar 2018 05:50:49 +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 w215on2b031783; Thu, 1 Mar 2018 05:50:49 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215omcR031780; Thu, 1 Mar 2018 05:50:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010550.w215omcR031780@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 05:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330172 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:50:49 -0000 Author: eadler Date: Thu Mar 1 05:50:48 2018 New Revision: 330172 URL: https://svnweb.freebsd.org/changeset/base/330172 Log: MFC r313412: [iwm] Get rid of iwm_disable_rx_dma, just use iwm_pcie_rx_stop directly. * This also fixes one of many small nic lock handling bugs, and matches iwlwifi's code. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:49:32 2018 (r330171) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:50:48 2018 (r330172) @@ -302,7 +302,6 @@ static int iwm_alloc_sched(struct iwm_softc *); static int iwm_alloc_kw(struct iwm_softc *); static int iwm_alloc_ict(struct iwm_softc *); static int iwm_alloc_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); -static void iwm_disable_rx_dma(struct iwm_softc *); static void iwm_reset_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); static void iwm_free_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); static int iwm_alloc_tx_ring(struct iwm_softc *, struct iwm_tx_ring *, @@ -1104,18 +1103,6 @@ fail: iwm_free_rx_ring(sc, ring); } static void -iwm_disable_rx_dma(struct iwm_softc *sc) -{ - /* XXX conditional nic locks are stupid */ - /* XXX print out if we can't lock the NIC? */ - if (iwm_nic_lock(sc)) { - /* XXX handle if RX stop doesn't finish? */ - (void) iwm_pcie_rx_stop(sc); - iwm_nic_unlock(sc); - } -} - -static void iwm_reset_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring) { /* Reset the ring state */ @@ -1401,7 +1388,7 @@ iwm_stop_device(struct iwm_softc *sc) } iwm_nic_unlock(sc); } - iwm_disable_rx_dma(sc); + iwm_pcie_rx_stop(sc); /* Stop RX ring. */ iwm_reset_rx_ring(sc, &sc->rxq); @@ -1485,16 +1472,18 @@ iwm_mvm_nic_config(struct iwm_softc *sc) static int iwm_nic_rx_init(struct iwm_softc *sc) { - if (!iwm_nic_lock(sc)) - return EBUSY; - /* * Initialize RX ring. This is from the iwn driver. */ memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); - /* stop DMA */ - iwm_disable_rx_dma(sc); + /* Stop Rx DMA */ + iwm_pcie_rx_stop(sc); + + if (!iwm_nic_lock(sc)) + return EBUSY; + + /* reset and flush pointers */ IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_RBDCB_WPTR, 0); IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_FLUSH_RB_REQ, 0); IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_RDPTR, 0); Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:49:32 2018 (r330171) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:50:48 2018 (r330172) @@ -572,10 +572,14 @@ iwm_set_pwr(struct iwm_softc *sc) int iwm_pcie_rx_stop(struct iwm_softc *sc) { - - IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, 0); - return (iwm_poll_bit(sc, IWM_FH_MEM_RSSR_RX_STATUS_REG, - IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, - IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, - 1000)); + int ret = 0; + if (iwm_nic_lock(sc)) { + IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, 0); + ret = iwm_poll_bit(sc, IWM_FH_MEM_RSSR_RX_STATUS_REG, + IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, + IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, + 1000); + iwm_nic_unlock(sc); + } + return ret; } From owner-svn-src-all@freebsd.org Thu Mar 1 05:51:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48A82F2416C; Thu, 1 Mar 2018 05:51:36 +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 EDE9382B2F; Thu, 1 Mar 2018 05:51:35 +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 E8D4324676; Thu, 1 Mar 2018 05:51:35 +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 w215pZbc035810; Thu, 1 Mar 2018 05:51:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215pZv9035806; Thu, 1 Mar 2018 05:51:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010551.w215pZv9035806@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 05:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330173 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:51:36 -0000 Author: eadler Date: Thu Mar 1 05:51:35 2018 New Revision: 330173 URL: https://svnweb.freebsd.org/changeset/base/330173 Log: MFC r313413: [iwm] Add scan abort functions, to properly cancel a running scan. * Uses the notification wait api to wait for the corresponding scan complete notification after sending the abort command. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwm_scan.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:50:48 2018 (r330172) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:51:35 2018 (r330173) @@ -5421,7 +5421,9 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_TIME_EVENT_CMD: case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_CFG_CMD): case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_REQ_UMAC): + case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_ABORT_UMAC): case IWM_SCAN_OFFLOAD_REQUEST_CMD: + case IWM_SCAN_OFFLOAD_ABORT_CMD: case IWM_REPLY_BEACON_FILTERING_CMD: case IWM_MAC_PM_POWER_TABLE: case IWM_TIME_QUOTA_CMD: Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:50:48 2018 (r330172) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:51:35 2018 (r330173) @@ -153,6 +153,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -735,5 +736,88 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) "Scan request was sent successfully\n"); } free(req, M_DEVBUF); + return ret; +} + +static int +iwm_mvm_lmac_scan_abort(struct iwm_softc *sc) +{ + int ret; + struct iwm_host_cmd hcmd = { + .id = IWM_SCAN_OFFLOAD_ABORT_CMD, + .len = { 0, }, + .data = { NULL, }, + .flags = IWM_CMD_SYNC, + }; + uint32_t status; + + ret = iwm_mvm_send_cmd_status(sc, &hcmd, &status); + if (ret) + return ret; + + if (status != IWM_CAN_ABORT_STATUS) { + /* + * The scan abort will return 1 for success or + * 2 for "failure". A failure condition can be + * due to simply not being in an active scan which + * can occur if we send the scan abort before the + * microcode has notified us that a scan is completed. + */ + IWM_DPRINTF(sc, IWM_DEBUG_SCAN, + "SCAN OFFLOAD ABORT ret %d.\n", status); + ret = ENOENT; + } + + return ret; +} + +static int +iwm_mvm_umac_scan_abort(struct iwm_softc *sc) +{ + struct iwm_umac_scan_abort cmd = {}; + int uid, ret; + + uid = 0; + cmd.uid = htole32(uid); + + IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Sending scan abort, uid %u\n", uid); + + ret = iwm_mvm_send_cmd_pdu(sc, + iwm_cmd_id(IWM_SCAN_ABORT_UMAC, + IWM_ALWAYS_LONG_GROUP, 0), + 0, sizeof(cmd), &cmd); + + return ret; +} + +int +iwm_mvm_scan_stop_wait(struct iwm_softc *sc) +{ + struct iwm_notification_wait wait_scan_done; + static const uint16_t scan_done_notif[] = { IWM_SCAN_COMPLETE_UMAC, + IWM_SCAN_OFFLOAD_COMPLETE, }; + int ret; + + iwm_init_notification_wait(sc->sc_notif_wait, &wait_scan_done, + scan_done_notif, nitems(scan_done_notif), + NULL, NULL); + + IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Preparing to stop scan\n"); + + if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + ret = iwm_mvm_umac_scan_abort(sc); + else + ret = iwm_mvm_lmac_scan_abort(sc); + + if (ret) { + IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "couldn't stop scan\n"); + iwm_remove_notification(sc->sc_notif_wait, &wait_scan_done); + return ret; + } + + IWM_UNLOCK(sc); + ret = iwm_wait_notification(sc->sc_notif_wait, &wait_scan_done, hz); + IWM_LOCK(sc); + return ret; } Modified: stable/11/sys/dev/iwm/if_iwm_scan.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.h Thu Mar 1 05:50:48 2018 (r330172) +++ stable/11/sys/dev/iwm/if_iwm_scan.h Thu Mar 1 05:51:35 2018 (r330173) @@ -109,5 +109,6 @@ extern int iwm_mvm_lmac_scan(struct iwm_softc *sc); extern int iwm_mvm_config_umac_scan(struct iwm_softc *); extern int iwm_mvm_umac_scan(struct iwm_softc *); +extern int iwm_mvm_scan_stop_wait(struct iwm_softc *sc); #endif /* __IF_IWN_SCAN_H__ */ From owner-svn-src-all@freebsd.org Thu Mar 1 05:52:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D99DDF242EC; Thu, 1 Mar 2018 05:52:27 +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 8FFE482F45; Thu, 1 Mar 2018 05:52:27 +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 8AC69246BB; Thu, 1 Mar 2018 05:52:27 +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 w215qR9t036667; Thu, 1 Mar 2018 05:52:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215qRx2036665; Thu, 1 Mar 2018 05:52:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010552.w215qRx2036665@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 05:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330174 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:52:28 -0000 Author: eadler Date: Thu Mar 1 05:52:27 2018 New Revision: 330174 URL: https://svnweb.freebsd.org/changeset/base/330174 Log: MFC r313414: [iwm] Use iwm_mvm_scan_stop_wait to properly abort scans. * Add IWM_FLAG_SCAN_RUNNING to sc->sc_flags to track whether the firmware is currently running a scan, in order to decide wheter iwm_scan_end needs to abort a running scan. * In iwm_scan_end, if the scan is still running, we now abort it, in order to keep the firmware scanning state in sync. * Try to make things a bit simpler, by reacting on the IWM_SCAN_OFFLOAD_COMPLETE and IWM_SCAN_COMPLETE_UMAC notifications, instead of IWM_SCAN_ITERATION_COMPLETE and IWM_SCAN_ITERATION_COMPLETE_UMAC. This should be fine since we always only tell the firmware to do a single scan iteration anyway. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:51:35 2018 (r330173) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:52:27 2018 (r330174) @@ -4925,6 +4925,7 @@ iwm_stop(struct iwm_softc *sc) iwm_led_blink_stop(sc); sc->sc_tx_timer = 0; iwm_stop_device(sc); + sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; } static void @@ -5449,6 +5450,10 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCAN_OFFLOAD_COMPLETE: { struct iwm_periodic_scan_complete *notif; notif = (void *)pkt->data; + if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { + sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; + ieee80211_runtask(ic, &sc->sc_es_task); + } break; } @@ -5466,9 +5471,10 @@ iwm_notif_intr(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "UMAC scan complete, status=0x%x\n", notif->status); -#if 0 /* XXX This would be a duplicate scan end call */ - taskqueue_enqueue(sc->sc_tq, &sc->sc_es_task); -#endif + if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { + sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; + ieee80211_runtask(ic, &sc->sc_es_task); + } break; } @@ -6229,15 +6235,21 @@ iwm_scan_start(struct ieee80211com *ic) int error; IWM_LOCK(sc); + if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { + /* This should not be possible */ + device_printf(sc->sc_dev, + "%s: Previous scan not completed yet\n", __func__); + } if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) error = iwm_mvm_umac_scan(sc); else error = iwm_mvm_lmac_scan(sc); if (error != 0) { - device_printf(sc->sc_dev, "could not initiate 2 GHz scan\n"); + device_printf(sc->sc_dev, "could not initiate scan\n"); IWM_UNLOCK(sc); ieee80211_cancel_scan(vap); } else { + sc->sc_flags |= IWM_FLAG_SCAN_RUNNING; iwm_led_blink_start(sc); IWM_UNLOCK(sc); } @@ -6253,7 +6265,23 @@ iwm_scan_end(struct ieee80211com *ic) iwm_led_blink_stop(sc); if (vap->iv_state == IEEE80211_S_RUN) iwm_mvm_led_enable(sc); + if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { + /* + * Removing IWM_FLAG_SCAN_RUNNING now, is fine because + * both iwm_scan_end and iwm_scan_start run in the ic->ic_tq + * taskqueue. + */ + sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; + iwm_mvm_scan_stop_wait(sc); + } IWM_UNLOCK(sc); + + /* + * Make sure we don't race, if sc_es_task is still enqueued here. + * This is to make sure that it won't call ieee80211_scan_done + * when we have already started the next scan. + */ + taskqueue_cancel(ic->ic_tq, &sc->sc_es_task, NULL); } static void Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:51:35 2018 (r330173) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:52:27 2018 (r330174) @@ -414,6 +414,7 @@ struct iwm_softc { #define IWM_FLAG_RFKILL (1 << 3) #define IWM_FLAG_BUSY (1 << 4) #define IWM_FLAG_SCANNING (1 << 5) +#define IWM_FLAG_SCAN_RUNNING (1 << 6) struct intr_config_hook sc_preinit_hook; struct callout sc_watchdog_to; From owner-svn-src-all@freebsd.org Thu Mar 1 05:53:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0003AF24657; Thu, 1 Mar 2018 05:53:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DC9183224; Thu, 1 Mar 2018 05:53:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98A6C246F1; Thu, 1 Mar 2018 05:53:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215rDBK036743; Thu, 1 Mar 2018 05:53:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215rDT7036738; Thu, 1 Mar 2018 05:53:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010553.w215rDT7036738@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 05:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330175 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:53:14 -0000 Author: eadler Date: Thu Mar 1 05:53:12 2018 New Revision: 330175 URL: https://svnweb.freebsd.org/changeset/base/330175 Log: MFC r313415: [iwm] Implement apmg_wake_up_wa workaround properly for 7000 family. * Add iwm_pcie_set_cmd_in_flight() and iwm_pcie_clear_cmd_in_flight() helper methods. * Use ring->queued tracking in the command queue to set/clear the cmd_hold_nic_awake bit at the right points. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.h stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:53:12 2018 (r330175) @@ -182,7 +182,8 @@ __FBSDID("$FreeBSD$"); #define IWM_DEVICE_7000_COMMON \ .device_family = IWM_DEVICE_FAMILY_7000, \ .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000, \ - .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000 + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000, \ + .apmg_wake_up_wa = 1 const struct iwm_cfg iwm7260_cfg = { .fw_name = IWM7260_FW, @@ -1251,6 +1252,9 @@ iwm_reset_tx_ring(struct iwm_softc *sc, struct iwm_tx_ sc->qfullmsk &= ~(1 << ring->qid); ring->queued = 0; ring->cur = 0; + + if (ring->qid == IWM_MVM_CMD_QUEUE && sc->cmd_hold_nic_awake) + iwm_pcie_clear_cmd_in_flight(sc); } static void @@ -3312,6 +3316,18 @@ iwm_cmd_done(struct iwm_softc *sc, struct iwm_rx_packe data->m = NULL; } wakeup(&ring->desc[pkt->hdr.idx]); + + if (((pkt->hdr.idx + ring->queued) % IWM_TX_RING_COUNT) != ring->cur) { + device_printf(sc->sc_dev, + "%s: Some HCMDs skipped?: idx=%d queued=%d cur=%d\n", + __func__, pkt->hdr.idx, ring->queued, ring->cur); + /* XXX call iwm_force_nmi() */ + } + + KASSERT(ring->queued > 0, ("ring->queued is empty?")); + ring->queued--; + if (ring->queued == 0) + iwm_pcie_clear_cmd_in_flight(sc); } #if 0 @@ -5553,9 +5569,6 @@ iwm_notif_intr(struct iwm_softc *sc) ADVANCE_RXQ(sc); } - - IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, - IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); /* * Tell the firmware what we have processed. Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:53:12 2018 (r330175) @@ -253,6 +253,9 @@ iwm_nic_lock(struct iwm_softc *sc) { int rv = 0; + if (sc->cmd_hold_nic_awake) + return 1; + IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); @@ -277,6 +280,9 @@ iwm_nic_lock(struct iwm_softc *sc) void iwm_nic_unlock(struct iwm_softc *sc) { + if (sc->cmd_hold_nic_awake) + return; + IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); } @@ -582,4 +588,56 @@ iwm_pcie_rx_stop(struct iwm_softc *sc) iwm_nic_unlock(sc); } return ret; +} + +void +iwm_pcie_clear_cmd_in_flight(struct iwm_softc *sc) +{ + if (!sc->cfg->apmg_wake_up_wa) + return; + + if (!sc->cmd_hold_nic_awake) { + device_printf(sc->sc_dev, + "%s: cmd_hold_nic_awake not set\n", __func__); + return; + } + + sc->cmd_hold_nic_awake = 0; + IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); +} + +int +iwm_pcie_set_cmd_in_flight(struct iwm_softc *sc) +{ + int ret; + + /* + * wake up the NIC to make sure that the firmware will see the host + * command - we will let the NIC sleep once all the host commands + * returned. This needs to be done only on NICs that have + * apmg_wake_up_wa set. + */ + if (sc->cfg->apmg_wake_up_wa && + !sc->cmd_hold_nic_awake) { + + IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); + + ret = iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, + (IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | + IWM_CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), + 15000); + if (ret == 0) { + IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); + device_printf(sc->sc_dev, + "%s: Failed to wake NIC for hcmd\n", __func__); + return EIO; + } + sc->cmd_hold_nic_awake = 1; + } + + return 0; } Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.h Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.h Thu Mar 1 05:53:12 2018 (r330175) @@ -129,4 +129,7 @@ extern int iwm_start_hw(struct iwm_softc *sc); extern void iwm_set_pwr(struct iwm_softc *sc); extern int iwm_pcie_rx_stop(struct iwm_softc *sc); +extern int iwm_pcie_set_cmd_in_flight(struct iwm_softc *sc); +extern void iwm_pcie_clear_cmd_in_flight(struct iwm_softc *sc); + #endif Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:53:12 2018 (r330175) @@ -305,17 +305,10 @@ iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); - IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, - IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); - if (!iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, - IWM_CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, - (IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | - IWM_CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 15000)) { - device_printf(sc->sc_dev, - "%s: acquiring device failed\n", __func__); - error = EBUSY; + error = iwm_pcie_set_cmd_in_flight(sc); + if (error) goto out; - } + ring->queued++; #if 0 iwm_update_sched(sc, ring->qid, ring->cur, 0, 0); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:53:12 2018 (r330175) @@ -389,6 +389,8 @@ enum iwm_device_family { * @host_interrupt_operation_mode: device needs host interrupt operation * mode set * @nvm_hw_section_num: the ID of the HW NVM section + * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command + * is in flight. This is due to a HW bug in 7260, 3160 and 7265. */ struct iwm_cfg { const char *fw_name; @@ -396,6 +398,7 @@ struct iwm_cfg { enum iwm_device_family device_family; int host_interrupt_operation_mode; uint8_t nvm_hw_section_num; + int apmg_wake_up_wa; }; struct iwm_softc { @@ -520,6 +523,8 @@ struct iwm_softc { int sc_max_rssi; struct iwm_notif_wait_data *sc_notif_wait; + + int cmd_hold_nic_awake; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Mar 1 05:53:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB562F247AE; Thu, 1 Mar 2018 05:53:55 +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 6286E83422; Thu, 1 Mar 2018 05:53:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D8CA246F4; Thu, 1 Mar 2018 05:53:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215rtB3036808; Thu, 1 Mar 2018 05:53:55 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215rtVX036807; Thu, 1 Mar 2018 05:53:55 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010553.w215rtVX036807@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 05:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330176 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:53:56 -0000 Author: eadler Date: Thu Mar 1 05:53:55 2018 New Revision: 330176 URL: https://svnweb.freebsd.org/changeset/base/330176 Log: MFC r313416: [iwm] Only for family 7000 power-down busmaster DMA clocks when stopping. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:53:12 2018 (r330175) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:53:55 2018 (r330176) @@ -1401,11 +1401,12 @@ iwm_stop_device(struct iwm_softc *sc) for (qid = 0; qid < nitems(sc->txq); qid++) iwm_reset_tx_ring(sc, &sc->txq[qid]); - /* - * Power-down device's busmaster DMA clocks - */ - iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, IWM_APMG_CLK_VAL_DMA_CLK_RQT); - DELAY(5); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { + /* Power-down device's busmaster DMA clocks */ + iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, + IWM_APMG_CLK_VAL_DMA_CLK_RQT); + DELAY(5); + } /* Make sure (redundant) we've released our request to stay awake */ IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, From owner-svn-src-all@freebsd.org Thu Mar 1 05:54:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 308F8F24907; Thu, 1 Mar 2018 05:54: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 C389883632; Thu, 1 Mar 2018 05:54: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 BDFA6246F6; Thu, 1 Mar 2018 05:54: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 w215sd56036878; Thu, 1 Mar 2018 05:54:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215sdQG036875; Thu, 1 Mar 2018 05:54:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010554.w215sdQG036875@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 05:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330177 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:54:40 -0000 Author: eadler Date: Thu Mar 1 05:54:39 2018 New Revision: 330177 URL: https://svnweb.freebsd.org/changeset/base/330177 Log: MFC r313417: [iwm] Very basic DTS thermal sensor support (prints temp as debug msg). * Adds IWM_DEBUG_TEMP debug message type, for printing messages related to temperature sensors and thermal/TDP infos. * The firmware regularly sends us DTS measurement notifications, so just print the temperature value as a debugging message. (Adrian's addition): * Eventually this can be used by the driver to limit transmit rate / power to try and do some thermal throttling. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_debug.h stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:53:55 2018 (r330176) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:54:39 2018 (r330177) @@ -5425,8 +5425,20 @@ iwm_notif_intr(struct iwm_softc *sc) notif->source_id, sc->sc_fw_mcc); break; } - case IWM_DTS_MEASUREMENT_NOTIFICATION: + case IWM_DTS_MEASUREMENT_NOTIFICATION: { + struct iwm_dts_measurement_notif_v1 *notif; + + if (iwm_rx_packet_payload_len(pkt) < sizeof(*notif)) { + device_printf(sc->sc_dev, + "Invalid DTS_MEASUREMENT_NOTIFICATION\n"); + break; + } + notif = (void *)pkt->data; + IWM_DPRINTF(sc, IWM_DEBUG_TEMP, + "IWM_DTS_MEASUREMENT_NOTIFICATION - %d\n", + notif->temp); break; + } case IWM_PHY_CONFIGURATION_CMD: case IWM_TX_ANT_CONFIGURATION_CMD: Modified: stable/11/sys/dev/iwm/if_iwm_debug.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 05:53:55 2018 (r330176) +++ stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 05:54:39 2018 (r330177) @@ -41,6 +41,7 @@ enum { IWM_DEBUG_FIRMWARE_TLV = 0x00020000, /* Firmware TLV parsing */ IWM_DEBUG_TRANS = 0x00040000, /* Transport layer (eg PCIe) */ IWM_DEBUG_EEPROM = 0x00080000, /* EEPROM/channel information */ + IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:53:55 2018 (r330176) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:54:39 2018 (r330177) @@ -5978,6 +5978,30 @@ enum iwm_mcc_source { IWM_MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11, }; +/** + * struct iwm_dts_measurement_notif_v1 - measurements notification + * + * @temp: the measured temperature + * @voltage: the measured voltage + */ +struct iwm_dts_measurement_notif_v1 { + int32_t temp; + int32_t voltage; +} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/ + +/** + * struct iwm_dts_measurement_notif_v2 - measurements notification + * + * @temp: the measured temperature + * @voltage: the measured voltage + * @threshold_idx: the trip index that was crossed + */ +struct iwm_dts_measurement_notif_v2 { + int32_t temp; + int32_t voltage; + int32_t threshold_idx; +} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */ + /* * Some cherry-picked definitions */ From owner-svn-src-all@freebsd.org Thu Mar 1 05:58:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C750F24F39; Thu, 1 Mar 2018 05:58:54 +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 2458483EE4; Thu, 1 Mar 2018 05:58:54 +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 1F69624700; Thu, 1 Mar 2018 05:58:54 +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 w215wsEe037096; Thu, 1 Mar 2018 05:58:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215wr0w037094; Thu, 1 Mar 2018 05:58:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010558.w215wr0w037094@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 05:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330178 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 05:58:54 -0000 Author: eadler Date: Thu Mar 1 05:58:53 2018 New Revision: 330178 URL: https://svnweb.freebsd.org/changeset/base/330178 Log: MFC r313418: [iwm] Recognize IWM_DTS_MEASUREMENT_NOTIF_WIDE notification. * Add the command groups enum, and the iwm_phy_ops_subcmd_ids enum to if_iwmreg.h definitions. * The IWM_DTS_MEASUREMENT_NOTIF_WIDE notification will be generated by version 17 firmware. Taken-From: Linux iwlwifi Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:54:39 2018 (r330177) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:58:53 2018 (r330178) @@ -5425,7 +5425,9 @@ iwm_notif_intr(struct iwm_softc *sc) notif->source_id, sc->sc_fw_mcc); break; } - case IWM_DTS_MEASUREMENT_NOTIFICATION: { + case IWM_DTS_MEASUREMENT_NOTIFICATION: + case IWM_WIDE_ID(IWM_PHY_OPS_GROUP, + IWM_DTS_MEASUREMENT_NOTIF_WIDE): { struct iwm_dts_measurement_notif_v1 *notif; if (iwm_rx_packet_payload_len(pkt) < sizeof(*notif)) { Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:54:39 2018 (r330177) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:58:53 2018 (r330178) @@ -1949,6 +1949,25 @@ enum { IWM_REPLY_MAX = 0xff, }; +enum iwm_phy_ops_subcmd_ids { + IWM_CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0, + IWM_CTDP_CONFIG_CMD = 0x03, + IWM_TEMP_REPORTING_THRESHOLDS_CMD = 0x04, + IWM_CT_KILL_NOTIFICATION = 0xFE, + IWM_DTS_MEASUREMENT_NOTIF_WIDE = 0xFF, +}; + +/* command groups */ +enum { + IWM_LEGACY_GROUP = 0x0, + IWM_LONG_GROUP = 0x1, + IWM_SYSTEM_GROUP = 0x2, + IWM_MAC_CONF_GROUP = 0x3, + IWM_PHY_OPS_GROUP = 0x4, + IWM_DATA_PATH_GROUP = 0x5, + IWM_PROT_OFFLOAD_GROUP = 0xb, +}; + /** * struct iwm_cmd_response - generic response struct for most commands * @status: status of the command asked, changes for each one From owner-svn-src-all@freebsd.org Thu Mar 1 06:00:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C95C4F250EF; Thu, 1 Mar 2018 05:59:59 +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 0BA818419F; Thu, 1 Mar 2018 05:59:59 +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 06AEE24704; Thu, 1 Mar 2018 05:59:59 +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 w215xwF0037176; Thu, 1 Mar 2018 05:59:58 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215xwYo037174; Thu, 1 Mar 2018 05:59:58 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010559.w215xwYo037174@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 05:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330179 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:00:00 -0000 Author: eadler Date: Thu Mar 1 05:59:58 2018 New Revision: 330179 URL: https://svnweb.freebsd.org/changeset/base/330179 Log: MFC r313427: [iwm] Recognize the IWM_UCODE_TLV_FW_MEM_SEG firmware section type. * Will be needed for loading version 22 of 7265D firmware. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:58:53 2018 (r330178) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:59:58 2018 (r330179) @@ -892,6 +892,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode le32toh(((const uint32_t *)tlv_data)[2])); break; + case IWM_UCODE_TLV_FW_MEM_SEG: + break; + default: device_printf(sc->sc_dev, "%s: unknown firmware section %d, abort\n", Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:58:53 2018 (r330178) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:59:58 2018 (r330179) @@ -1006,6 +1006,7 @@ enum iwm_ucode_tlv_type { IWM_UCODE_TLV_FW_DBG_CONF = 39, IWM_UCODE_TLV_FW_DBG_TRIGGER = 40, IWM_UCODE_TLV_FW_GSCAN_CAPA = 50, + IWM_UCODE_TLV_FW_MEM_SEG = 51, }; struct iwm_ucode_tlv { From owner-svn-src-all@freebsd.org Thu Mar 1 06:00:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F313BF251F4; Thu, 1 Mar 2018 06:00:31 +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 8652D8436A; Thu, 1 Mar 2018 06:00:31 +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 8130624708; Thu, 1 Mar 2018 06:00:31 +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 w2160VD7037298; Thu, 1 Mar 2018 06:00:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2160VZr037297; Thu, 1 Mar 2018 06:00:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010600.w2160VZr037297@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 06:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330180 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:00:32 -0000 Author: eadler Date: Thu Mar 1 06:00:31 2018 New Revision: 330180 URL: https://svnweb.freebsd.org/changeset/base/330180 Log: MFC r313429: [iwm] SCAN_ABORT_UMAC response doesn't use a wide id Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:59:58 2018 (r330179) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:00:31 2018 (r330180) @@ -5456,7 +5456,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_TIME_EVENT_CMD: case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_CFG_CMD): case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_REQ_UMAC): - case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_ABORT_UMAC): + case IWM_SCAN_ABORT_UMAC: case IWM_SCAN_OFFLOAD_REQUEST_CMD: case IWM_SCAN_OFFLOAD_ABORT_CMD: case IWM_REPLY_BEACON_FILTERING_CMD: From owner-svn-src-all@freebsd.org Thu Mar 1 06:01:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBF71F252BD; Thu, 1 Mar 2018 06:00:59 +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 A241884557; Thu, 1 Mar 2018 06:00:59 +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 9D63A2472D; Thu, 1 Mar 2018 06:00:59 +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 w2160xKb037359; Thu, 1 Mar 2018 06:00:59 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2160xXg037358; Thu, 1 Mar 2018 06:00:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010600.w2160xXg037358@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 06:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330181 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:01:00 -0000 Author: eadler Date: Thu Mar 1 06:00:59 2018 New Revision: 330181 URL: https://svnweb.freebsd.org/changeset/base/330181 Log: MFC r313430: [iwm] Remove 1s delay after fw loading. Can't reproduce issues on AC8260. The 1s delay was added in the update to version 16 fw, where Family 8000 support was added. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:00:31 2018 (r330180) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:00:59 2018 (r330181) @@ -2678,12 +2678,6 @@ iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode } } - /* - * Give the firmware some time to initialize. - * Accessing it too early causes errors. - */ - msleep(&w, &sc->sc_mtx, 0, "iwmfwinit", hz); - return error; } From owner-svn-src-all@freebsd.org Thu Mar 1 06:01:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA3DF2536A; Thu, 1 Mar 2018 06:01:33 +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 5A76D8476C; Thu, 1 Mar 2018 06:01:33 +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 5563624753; Thu, 1 Mar 2018 06:01:33 +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 w2161XLY039599; Thu, 1 Mar 2018 06:01:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2161X2x039597; Thu, 1 Mar 2018 06:01:33 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010601.w2161X2x039597@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 06:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330182 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:01:34 -0000 Author: eadler Date: Thu Mar 1 06:01:33 2018 New Revision: 330182 URL: https://svnweb.freebsd.org/changeset/base/330182 Log: MFC r314065: [iwm] Synchronize firmware loading code with Linux iwlwifi. * While there, rename some functions to match the names and functionality of the similarly named functions in Linux iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:00:59 2018 (r330181) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:01:33 2018 (r330182) @@ -353,15 +353,20 @@ static void iwm_set_radio_cfg(const struct iwm_softc * static struct iwm_nvm_data * iwm_parse_nvm_sections(struct iwm_softc *, struct iwm_nvm_section *); static int iwm_nvm_init(struct iwm_softc *); -static int iwm_firmware_load_sect(struct iwm_softc *, uint32_t, - const uint8_t *, uint32_t); -static int iwm_firmware_load_chunk(struct iwm_softc *, uint32_t, - const uint8_t *, uint32_t); -static int iwm_load_firmware_7000(struct iwm_softc *, enum iwm_ucode_type); -static int iwm_load_cpu_sections_8000(struct iwm_softc *, - struct iwm_fw_sects *, int , int *); -static int iwm_load_firmware_8000(struct iwm_softc *, enum iwm_ucode_type); -static int iwm_load_firmware(struct iwm_softc *, enum iwm_ucode_type); +static int iwm_pcie_load_section(struct iwm_softc *, uint8_t, + const struct iwm_fw_desc *); +static int iwm_pcie_load_firmware_chunk(struct iwm_softc *, uint32_t, + bus_addr_t, uint32_t); +static int iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, + const struct iwm_fw_sects *, + int, int *); +static int iwm_pcie_load_cpu_sections(struct iwm_softc *, + const struct iwm_fw_sects *, + int, int *); +static int iwm_pcie_load_given_ucode_8000(struct iwm_softc *, + const struct iwm_fw_sects *); +static int iwm_pcie_load_given_ucode(struct iwm_softc *, + const struct iwm_fw_sects *); static int iwm_start_fw(struct iwm_softc *, enum iwm_ucode_type); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); static int iwm_send_phy_cfg_cmd(struct iwm_softc *); @@ -485,7 +490,7 @@ iwm_firmware_store_section(struct iwm_softc *sc, enum iwm_ucode_type type, const uint8_t *data, size_t dlen) { struct iwm_fw_sects *fws; - struct iwm_fw_onesect *fwone; + struct iwm_fw_desc *fwone; if (type >= IWM_UCODE_TYPE_MAX) return EINVAL; @@ -499,11 +504,11 @@ iwm_firmware_store_section(struct iwm_softc *sc, fwone = &fws->fw_sect[fws->fw_count]; /* first 32bit are device load offset */ - memcpy(&fwone->fws_devoff, data, sizeof(uint32_t)); + memcpy(&fwone->offset, data, sizeof(uint32_t)); /* rest is data */ - fwone->fws_data = data + sizeof(uint32_t); - fwone->fws_len = dlen - sizeof(uint32_t); + fwone->data = data + sizeof(uint32_t); + fwone->len = dlen - sizeof(uint32_t); fws->fw_count++; @@ -559,6 +564,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode const uint8_t *data; uint32_t usniffer_img; uint32_t paging_mem_size; + int num_of_cpus; int error = 0; size_t len; @@ -699,18 +705,24 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } break; - case IWM_UCODE_TLV_NUM_OF_CPU: { - uint32_t num_cpu; + case IWM_UCODE_TLV_NUM_OF_CPU: if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) < sizeof(uint32_t)\n", + "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) != sizeof(uint32_t)\n", __func__, (int) tlv_len); error = EINVAL; goto parse_out; } - num_cpu = le32toh(*(const uint32_t *)tlv_data); - if (num_cpu < 1 || num_cpu > 2) { + num_of_cpus = le32toh(*(const uint32_t *)tlv_data); + if (num_of_cpus == 2) { + fw->fw_sects[IWM_UCODE_REGULAR].is_dual_cpus = + TRUE; + fw->fw_sects[IWM_UCODE_INIT].is_dual_cpus = + TRUE; + fw->fw_sects[IWM_UCODE_WOWLAN].is_dual_cpus = + TRUE; + } else if ((num_of_cpus > 2) || (num_of_cpus < 1)) { device_printf(sc->sc_dev, "%s: Driver supports only 1 or 2 CPUs\n", __func__); @@ -718,7 +730,6 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } break; - } case IWM_UCODE_TLV_SEC_RT: if ((error = iwm_firmware_store_section(sc, IWM_UCODE_REGULAR, tlv_data, tlv_len)) != 0) { @@ -2414,53 +2425,68 @@ iwm_nvm_init(struct iwm_softc *sc) return 0; } -/* - * Firmware loading gunk. This is kind of a weird hybrid between the - * iwn driver and the Linux iwlwifi driver. - */ - static int -iwm_firmware_load_sect(struct iwm_softc *sc, uint32_t dst_addr, - const uint8_t *section, uint32_t byte_cnt) +iwm_pcie_load_section(struct iwm_softc *sc, uint8_t section_num, + const struct iwm_fw_desc *section) { - int error = EINVAL; - uint32_t chunk_sz, offset; + struct iwm_dma_info *dma = &sc->fw_dma; + uint8_t *v_addr; + bus_addr_t p_addr; + uint32_t offset, chunk_sz = MIN(IWM_FH_MEM_TB_MAX_LENGTH, section->len); + int ret = 0; - chunk_sz = MIN(IWM_FH_MEM_TB_MAX_LENGTH, byte_cnt); + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "%s: [%d] uCode section being loaded...\n", + __func__, section_num); - for (offset = 0; offset < byte_cnt; offset += chunk_sz) { - uint32_t addr, len; - const uint8_t *data; + v_addr = dma->vaddr; + p_addr = dma->paddr; - addr = dst_addr + offset; - len = MIN(chunk_sz, byte_cnt - offset); - data = section + offset; + for (offset = 0; offset < section->len; offset += chunk_sz) { + uint32_t copy_size, dst_addr; + int extended_addr = FALSE; - error = iwm_firmware_load_chunk(sc, addr, data, len); - if (error) + copy_size = MIN(chunk_sz, section->len - offset); + dst_addr = section->offset + offset; + + if (dst_addr >= IWM_FW_MEM_EXTENDED_START && + dst_addr <= IWM_FW_MEM_EXTENDED_END) + extended_addr = TRUE; + + if (extended_addr) + iwm_set_bits_prph(sc, IWM_LMPM_CHICK, + IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE); + + memcpy(v_addr, (const uint8_t *)section->data + offset, + copy_size); + bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); + ret = iwm_pcie_load_firmware_chunk(sc, dst_addr, p_addr, + copy_size); + + if (extended_addr) + iwm_clear_bits_prph(sc, IWM_LMPM_CHICK, + IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE); + + if (ret) { + device_printf(sc->sc_dev, + "%s: Could not load the [%d] uCode section\n", + __func__, section_num); break; + } } - return error; + return ret; } +/* + * ucode + */ static int -iwm_firmware_load_chunk(struct iwm_softc *sc, uint32_t dst_addr, - const uint8_t *chunk, uint32_t byte_cnt) +iwm_pcie_load_firmware_chunk(struct iwm_softc *sc, uint32_t dst_addr, + bus_addr_t phy_addr, uint32_t byte_cnt) { - struct iwm_dma_info *dma = &sc->fw_dma; - int error; + int ret; - /* Copy firmware chunk into pre-allocated DMA-safe memory. */ - memcpy(dma->vaddr, chunk, byte_cnt); - bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); - - if (dst_addr >= IWM_FW_MEM_EXTENDED_START && - dst_addr <= IWM_FW_MEM_EXTENDED_END) { - iwm_set_bits_prph(sc, IWM_LMPM_CHICK, - IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE); - } - sc->sc_fw_chunk_done = 0; if (!iwm_nic_lock(sc)) @@ -2468,17 +2494,22 @@ iwm_firmware_load_chunk(struct iwm_softc *sc, uint32_t IWM_WRITE(sc, IWM_FH_TCSR_CHNL_TX_CONFIG_REG(IWM_FH_SRVC_CHNL), IWM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE); + IWM_WRITE(sc, IWM_FH_SRVC_CHNL_SRAM_ADDR_REG(IWM_FH_SRVC_CHNL), dst_addr); + IWM_WRITE(sc, IWM_FH_TFDIB_CTRL0_REG(IWM_FH_SRVC_CHNL), - dma->paddr & IWM_FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK); + phy_addr & IWM_FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK); + IWM_WRITE(sc, IWM_FH_TFDIB_CTRL1_REG(IWM_FH_SRVC_CHNL), - (iwm_get_dma_hi_addr(dma->paddr) - << IWM_FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_cnt); + (iwm_get_dma_hi_addr(phy_addr) + << IWM_FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_cnt); + IWM_WRITE(sc, IWM_FH_TCSR_CHNL_TX_BUF_STS_REG(IWM_FH_SRVC_CHNL), 1 << IWM_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM | 1 << IWM_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_IDX | IWM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID); + IWM_WRITE(sc, IWM_FH_TCSR_CHNL_TX_CONFIG_REG(IWM_FH_SRVC_CHNL), IWM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE | IWM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE | @@ -2486,37 +2517,31 @@ iwm_firmware_load_chunk(struct iwm_softc *sc, uint32_t iwm_nic_unlock(sc); - /* wait 1s for this segment to load */ - while (!sc->sc_fw_chunk_done) - if ((error = msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfw", hz)) != 0) + /* wait up to 5s for this segment to load */ + ret = 0; + while (!sc->sc_fw_chunk_done) { + ret = msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfw", hz); + if (ret) break; + } - if (!sc->sc_fw_chunk_done) { + if (ret != 0) { device_printf(sc->sc_dev, "fw chunk addr 0x%x len %d failed to load\n", dst_addr, byte_cnt); + return ETIMEDOUT; } - if (dst_addr >= IWM_FW_MEM_EXTENDED_START && - dst_addr <= IWM_FW_MEM_EXTENDED_END && iwm_nic_lock(sc)) { - iwm_clear_bits_prph(sc, IWM_LMPM_CHICK, - IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE); - iwm_nic_unlock(sc); - } - - return error; + return 0; } -int -iwm_load_cpu_sections_8000(struct iwm_softc *sc, struct iwm_fw_sects *fws, - int cpu, int *first_ucode_section) +static int +iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, + const struct iwm_fw_sects *image, int cpu, int *first_ucode_section) { int shift_param; - int i, error = 0, sec_num = 0x1; + int i, ret = 0, sec_num = 0x1; uint32_t val, last_read_idx = 0; - const void *data; - uint32_t dlen; - uint32_t offset; if (cpu == 1) { shift_param = 0; @@ -2528,9 +2553,6 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struc for (i = *first_ucode_section; i < IWM_UCODE_SECTION_MAX; i++) { last_read_idx = i; - data = fws->fw_sect[i].fws_data; - dlen = fws->fw_sect[i].fws_len; - offset = fws->fw_sect[i].fws_devoff; /* * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between @@ -2538,27 +2560,17 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struc * PAGING_SEPARATOR_SECTION delimiter - separate between * CPU2 non paged to CPU2 paging sec. */ - if (!data || offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || - offset == IWM_PAGING_SEPARATOR_SECTION) - break; - - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "LOAD FIRMWARE chunk %d offset 0x%x len %d for cpu %d\n", - i, offset, dlen, cpu); - - if (dlen > sc->sc_fwdmasegsz) { + if (!image->fw_sect[i].data || + image->fw_sect[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || + image->fw_sect[i].offset == IWM_PAGING_SEPARATOR_SECTION) { IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "chunk %d too large (%d bytes)\n", i, dlen); - error = EFBIG; - } else { - error = iwm_firmware_load_sect(sc, offset, data, dlen); + "Break since Data not valid or Empty section, sec = %d\n", + i); + break; } - if (error) { - device_printf(sc->sc_dev, - "could not load firmware chunk %d (error %d)\n", - i, error); - return error; - } + ret = iwm_pcie_load_section(sc, i, &image->fw_sect[i]); + if (ret) + return ret; /* Notify the ucode of the loaded section number and status */ if (iwm_nic_lock(sc)) { @@ -2588,63 +2600,85 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struc return 0; } -int -iwm_load_firmware_8000(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +static int +iwm_pcie_load_cpu_sections(struct iwm_softc *sc, + const struct iwm_fw_sects *image, int cpu, int *first_ucode_section) { - struct iwm_fw_sects *fws; - int error = 0; - int first_ucode_section; + int shift_param; + int i, ret = 0; + uint32_t last_read_idx = 0; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, "loading ucode type %d\n", - ucode_type); + if (cpu == 1) { + shift_param = 0; + *first_ucode_section = 0; + } else { + shift_param = 16; + (*first_ucode_section)++; + } - fws = &sc->sc_fw.fw_sects[ucode_type]; + for (i = *first_ucode_section; i < IWM_UCODE_SECTION_MAX; i++) { + last_read_idx = i; - /* configure the ucode to be ready to get the secured image */ - /* release CPU reset */ - iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, IWM_RELEASE_CPU_RESET_BIT); + /* + * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between + * CPU1 to CPU2. + * PAGING_SEPARATOR_SECTION delimiter - separate between + * CPU2 non paged to CPU2 paging sec. + */ + if (!image->fw_sect[i].data || + image->fw_sect[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || + image->fw_sect[i].offset == IWM_PAGING_SEPARATOR_SECTION) { + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Break since Data not valid or Empty section, sec = %d\n", + i); + break; + } - /* load to FW the binary Secured sections of CPU1 */ - error = iwm_load_cpu_sections_8000(sc, fws, 1, &first_ucode_section); - if (error) - return error; + ret = iwm_pcie_load_section(sc, i, &image->fw_sect[i]); + if (ret) + return ret; + } - /* load to FW the binary sections of CPU2 */ - return iwm_load_cpu_sections_8000(sc, fws, 2, &first_ucode_section); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + iwm_set_bits_prph(sc, + IWM_CSR_UCODE_LOAD_STATUS_ADDR, + (IWM_LMPM_CPU_UCODE_LOADING_COMPLETED | + IWM_LMPM_CPU_HDRS_LOADING_COMPLETED | + IWM_LMPM_CPU_UCODE_LOADING_STARTED) << + shift_param); + + *first_ucode_section = last_read_idx; + + return 0; + } static int -iwm_load_firmware_7000(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +iwm_pcie_load_given_ucode(struct iwm_softc *sc, + const struct iwm_fw_sects *image) { - struct iwm_fw_sects *fws; - int error, i; - const void *data; - uint32_t dlen; - uint32_t offset; + int ret = 0; + int first_ucode_section; - sc->sc_uc.uc_intr = 0; + IWM_DPRINTF(sc, IWM_DEBUG_RESET, "working with %s CPU\n", + image->is_dual_cpus ? "Dual" : "Single"); - fws = &sc->sc_fw.fw_sects[ucode_type]; - for (i = 0; i < fws->fw_count; i++) { - data = fws->fw_sect[i].fws_data; - dlen = fws->fw_sect[i].fws_len; - offset = fws->fw_sect[i].fws_devoff; - IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, - "LOAD FIRMWARE type %d offset %u len %d\n", - ucode_type, offset, dlen); - if (dlen > sc->sc_fwdmasegsz) { - IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, - "chunk %d too large (%d bytes)\n", i, dlen); - error = EFBIG; - } else { - error = iwm_firmware_load_sect(sc, offset, data, dlen); - } - if (error) { - device_printf(sc->sc_dev, - "could not load firmware chunk %u of %u " - "(error=%d)\n", i, fws->fw_count, error); - return error; - } + /* load to FW the binary non secured sections of CPU1 */ + ret = iwm_pcie_load_cpu_sections(sc, image, 1, &first_ucode_section); + if (ret) + return ret; + + if (image->is_dual_cpus) { + /* set CPU2 header address */ + iwm_write_prph(sc, + IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR, + IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE); + + /* load to FW the binary sections of CPU2 */ + ret = iwm_pcie_load_cpu_sections(sc, image, 2, + &first_ucode_section); + if (ret) + return ret; } IWM_WRITE(sc, IWM_CSR_RESET, 0); @@ -2652,15 +2686,43 @@ iwm_load_firmware_7000(struct iwm_softc *sc, enum iwm_ return 0; } +int +iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, + const struct iwm_fw_sects *image) +{ + int ret = 0; + int first_ucode_section; + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, "working with %s CPU\n", + image->is_dual_cpus ? "Dual" : "Single"); + + /* configure the ucode to be ready to get the secured image */ + /* release CPU reset */ + iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, IWM_RELEASE_CPU_RESET_BIT); + + /* load to FW the binary Secured sections of CPU1 */ + ret = iwm_pcie_load_cpu_sections_8000(sc, image, 1, + &first_ucode_section); + if (ret) + return ret; + + /* load to FW the binary sections of CPU2 */ + return iwm_pcie_load_cpu_sections_8000(sc, image, 2, + &first_ucode_section); +} + static int iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) { int error, w; - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) - error = iwm_load_firmware_8000(sc, ucode_type); - else - error = iwm_load_firmware_7000(sc, ucode_type); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + error = iwm_pcie_load_given_ucode_8000(sc, + &sc->sc_fw.fw_sects[ucode_type]); + } else { + error = iwm_pcie_load_given_ucode(sc, + &sc->sc_fw.fw_sects[ucode_type]); + } if (error) return error; Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:00:59 2018 (r330181) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:01:33 2018 (r330182) @@ -170,17 +170,21 @@ enum iwm_ucode_type { IWM_UCODE_TYPE_MAX }; +/* one for each uCode image (inst/data, init/runtime/wowlan) */ +struct iwm_fw_desc { + const void *data; /* vmalloc'ed data */ + uint32_t len; /* size in bytes */ + uint32_t offset; /* offset in the device */ +}; + struct iwm_fw_info { const struct firmware *fw_fp; int fw_status; struct iwm_fw_sects { - struct iwm_fw_onesect { - const void *fws_data; - uint32_t fws_len; - uint32_t fws_devoff; - } fw_sect[IWM_UCODE_SECTION_MAX]; + struct iwm_fw_desc fw_sect[IWM_UCODE_SECTION_MAX]; int fw_count; + int is_dual_cpus; uint32_t paging_mem_size; } fw_sects[IWM_UCODE_TYPE_MAX]; From owner-svn-src-all@freebsd.org Thu Mar 1 06:13:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C42F2674D; Thu, 1 Mar 2018 06:13:02 +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 4D0DA86307; Thu, 1 Mar 2018 06:13:02 +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 474C724A69; Thu, 1 Mar 2018 06:13:02 +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 w216D2A7046759; Thu, 1 Mar 2018 06:13:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216D1OZ046756; Thu, 1 Mar 2018 06:13:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010613.w216D1OZ046756@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 06:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330183 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:13:03 -0000 Author: eadler Date: Thu Mar 1 06:13:01 2018 New Revision: 330183 URL: https://svnweb.freebsd.org/changeset/base/330183 Log: MFC r314066: [iwm] Sync IWM_MVM_ALIVE waiting and start_fw handling with iwlwifi. * Use the notification wait API, like it's done in the Linux iwlwifi code, to wait for the IWM_MVM_ALIVE notification. * This also should fix some firmware load interrupt issues, and errors in the nic lock using. Tested: * (adrian) Intel 7260, STA mode Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:01:33 2018 (r330182) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:13:01 2018 (r330183) @@ -285,8 +285,14 @@ struct iwm_nvm_section { uint8_t *data; }; +#define IWM_MVM_UCODE_ALIVE_TIMEOUT hz #define IWM_MVM_UCODE_CALIB_TIMEOUT (2*hz) +struct iwm_mvm_alive_data { + int valid; + uint32_t scd_base_addr; +}; + static int iwm_store_cscheme(struct iwm_softc *, const uint8_t *, size_t); static int iwm_firmware_store_section(struct iwm_softc *, enum iwm_ucode_type, @@ -320,7 +326,7 @@ static int iwm_nic_rx_init(struct iwm_softc *); static int iwm_nic_tx_init(struct iwm_softc *); static int iwm_nic_init(struct iwm_softc *); static int iwm_enable_txq(struct iwm_softc *, int, int, int); -static int iwm_post_alive(struct iwm_softc *); +static int iwm_trans_pcie_fw_alive(struct iwm_softc *, uint32_t); static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t, uint16_t, uint8_t *, uint16_t *); static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *, @@ -367,7 +373,7 @@ static int iwm_pcie_load_given_ucode_8000(struct iwm_s const struct iwm_fw_sects *); static int iwm_pcie_load_given_ucode(struct iwm_softc *, const struct iwm_fw_sects *); -static int iwm_start_fw(struct iwm_softc *, enum iwm_ucode_type); +static int iwm_start_fw(struct iwm_softc *, const struct iwm_fw_sects *); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); static int iwm_send_phy_cfg_cmd(struct iwm_softc *); static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *, @@ -1633,20 +1639,33 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q (0 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) | (1 << IWM_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN)); + iwm_nic_unlock(sc); + iwm_clear_bits_prph(sc, IWM_SCD_AGGR_SEL, (1 << qid)); + if (!iwm_nic_lock(sc)) { + device_printf(sc->sc_dev, + "%s: cannot enable txq %d\n", __func__, qid); + return EBUSY; + } iwm_write_prph(sc, IWM_SCD_QUEUE_RDPTR(qid), 0); + iwm_nic_unlock(sc); - iwm_write_mem32(sc, sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0); + iwm_write_mem32(sc, sc->scd_base_addr + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0); /* Set scheduler window size and frame limit. */ iwm_write_mem32(sc, - sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) + + sc->scd_base_addr + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) + sizeof(uint32_t), ((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_POS) & IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_MSK) | ((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) & IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK)); + if (!iwm_nic_lock(sc)) { + device_printf(sc->sc_dev, + "%s: cannot enable txq %d\n", __func__, qid); + return EBUSY; + } iwm_write_prph(sc, IWM_SCD_QUEUE_STATUS_BITS(qid), (1 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) | (fifo << IWM_SCD_QUEUE_STTS_REG_POS_TXF) | @@ -1690,34 +1709,38 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q } static int -iwm_post_alive(struct iwm_softc *sc) +iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t scd_base_addr) { - int nwords; int error, chnl; - uint32_t base; + int clear_dwords = (IWM_SCD_TRANS_TBL_MEM_UPPER_BOUND - + IWM_SCD_CONTEXT_MEM_LOWER_BOUND) / sizeof(uint32_t); + if (!iwm_nic_lock(sc)) return EBUSY; - base = iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR); - if (sc->sched_base != base) { + iwm_ict_reset(sc); + + iwm_nic_unlock(sc); + + sc->scd_base_addr = iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR); + if (scd_base_addr != 0 && + scd_base_addr != sc->scd_base_addr) { device_printf(sc->sc_dev, "%s: sched addr mismatch: alive: 0x%x prph: 0x%x\n", - __func__, sc->sched_base, base); + __func__, sc->scd_base_addr, scd_base_addr); } - iwm_ict_reset(sc); - - /* Clear TX scheduler state in SRAM. */ - nwords = (IWM_SCD_TRANS_TBL_MEM_UPPER_BOUND - - IWM_SCD_CONTEXT_MEM_LOWER_BOUND) - / sizeof(uint32_t); + /* reset context data, TX status and translation data */ error = iwm_write_mem(sc, - sc->sched_base + IWM_SCD_CONTEXT_MEM_LOWER_BOUND, - NULL, nwords); + sc->scd_base_addr + IWM_SCD_CONTEXT_MEM_LOWER_BOUND, + NULL, clear_dwords); if (error) - goto out; + return EBUSY; + if (!iwm_nic_lock(sc)) + return EBUSY; + /* Set physical address of TX scheduler rings (1KB aligned). */ iwm_write_prph(sc, IWM_SCD_DRAM_BASE_ADDR, sc->sched_dma.paddr >> 10); @@ -1745,14 +1768,14 @@ iwm_post_alive(struct iwm_softc *sc) IWM_SETBITS(sc, IWM_FH_TX_CHICKEN_BITS_REG, IWM_FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); + iwm_nic_unlock(sc); + /* Enable L1-Active */ if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG, IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); } - out: - iwm_nic_unlock(sc); return error; } @@ -2589,6 +2612,8 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, *first_ucode_section = last_read_idx; + iwm_enable_interrupts(sc); + if (iwm_nic_lock(sc)) { if (cpu == 1) IWM_WRITE(sc, IWM_FH_UCODE_LOAD_STATUS, 0xFFFF); @@ -2681,6 +2706,9 @@ iwm_pcie_load_given_ucode(struct iwm_softc *sc, return ret; } + iwm_enable_interrupts(sc); + + /* release CPU reset */ IWM_WRITE(sc, IWM_CSR_RESET, 0); return 0; @@ -2711,67 +2739,72 @@ iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, &first_ucode_section); } -static int -iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +/* XXX Get rid of this definition */ +static inline void +iwm_enable_fw_load_int(struct iwm_softc *sc) { - int error, w; - - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { - error = iwm_pcie_load_given_ucode_8000(sc, - &sc->sc_fw.fw_sects[ucode_type]); - } else { - error = iwm_pcie_load_given_ucode(sc, - &sc->sc_fw.fw_sects[ucode_type]); - } - if (error) - return error; - - /* wait for the firmware to load */ - for (w = 0; !sc->sc_uc.uc_intr && w < 10; w++) { - error = msleep(&sc->sc_uc, &sc->sc_mtx, 0, "iwmuc", hz/10); - } - if (error || !sc->sc_uc.uc_ok) { - device_printf(sc->sc_dev, "could not load firmware\n"); - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { - device_printf(sc->sc_dev, "cpu1 status: 0x%x\n", - iwm_read_prph(sc, IWM_SB_CPU_1_STATUS)); - device_printf(sc->sc_dev, "cpu2 status: 0x%x\n", - iwm_read_prph(sc, IWM_SB_CPU_2_STATUS)); - } - } - - return error; + IWM_DPRINTF(sc, IWM_DEBUG_INTR, "Enabling FW load interrupt\n"); + sc->sc_intmask = IWM_CSR_INT_BIT_FH_TX; + IWM_WRITE(sc, IWM_CSR_INT_MASK, sc->sc_intmask); } -/* iwlwifi: pcie/trans.c */ +/* XXX Add proper rfkill support code */ static int -iwm_start_fw(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +iwm_start_fw(struct iwm_softc *sc, + const struct iwm_fw_sects *fw) { - int error; + int ret; - IWM_WRITE(sc, IWM_CSR_INT, ~0); - - if ((error = iwm_nic_init(sc)) != 0) { - device_printf(sc->sc_dev, "unable to init nic\n"); - return error; + /* This may fail if AMT took ownership of the device */ + if (iwm_prepare_card_hw(sc)) { + device_printf(sc->sc_dev, + "%s: Exit HW not ready\n", __func__); + ret = EIO; + goto out; } + IWM_WRITE(sc, IWM_CSR_INT, 0xFFFFFFFF); + + iwm_disable_interrupts(sc); + /* make sure rfkill handshake bits are cleared */ IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_SW_BIT_RFKILL); IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); /* clear (again), then enable host interrupts */ - IWM_WRITE(sc, IWM_CSR_INT, ~0); - iwm_enable_interrupts(sc); + IWM_WRITE(sc, IWM_CSR_INT, 0xFFFFFFFF); + ret = iwm_nic_init(sc); + if (ret) { + device_printf(sc->sc_dev, "%s: Unable to init nic\n", __func__); + goto out; + } + + /* + * Now, we load the firmware and don't want to be interrupted, even + * by the RF-Kill interrupt (hence mask all the interrupt besides the + * FH_TX interrupt which is needed to load the firmware). If the + * RF-Kill switch is toggled, we will find out after having loaded + * the firmware and return the proper value to the caller. + */ + iwm_enable_fw_load_int(sc); + /* really make sure rfkill handshake bits are cleared */ /* maybe we should write a few times more? just to make sure */ IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_SW_BIT_RFKILL); IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_SW_BIT_RFKILL); /* Load the given image to the HW */ - return iwm_load_firmware(sc, ucode_type); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + ret = iwm_pcie_load_given_ucode_8000(sc, fw); + else + ret = iwm_pcie_load_given_ucode(sc, fw); + + /* XXX re-check RF-Kill state */ + +out: + return ret; } static int @@ -2790,7 +2823,7 @@ static int iwm_send_phy_cfg_cmd(struct iwm_softc *sc) { struct iwm_phy_cfg_cmd phy_cfg_cmd; - enum iwm_ucode_type ucode_type = sc->sc_uc_current; + enum iwm_ucode_type ucode_type = sc->cur_ucode; /* Set parameters */ phy_cfg_cmd.phy_cfg = htole32(iwm_mvm_get_phy_config(sc)); @@ -2806,6 +2839,83 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) } static int +iwm_alive_fn(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) +{ + struct iwm_mvm_alive_data *alive_data = data; + struct iwm_mvm_alive_resp_ver1 *palive1; + struct iwm_mvm_alive_resp_ver2 *palive2; + struct iwm_mvm_alive_resp *palive; + + if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive1)) { + palive1 = (void *)pkt->data; + + sc->support_umac_log = FALSE; + sc->error_event_table = + le32toh(palive1->error_event_table_ptr); + sc->log_event_table = + le32toh(palive1->log_event_table_ptr); + alive_data->scd_base_addr = le32toh(palive1->scd_base_ptr); + + alive_data->valid = le16toh(palive1->status) == + IWM_ALIVE_STATUS_OK; + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Alive VER1 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", + le16toh(palive1->status), palive1->ver_type, + palive1->ver_subtype, palive1->flags); + } else if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive2)) { + palive2 = (void *)pkt->data; + sc->error_event_table = + le32toh(palive2->error_event_table_ptr); + sc->log_event_table = + le32toh(palive2->log_event_table_ptr); + alive_data->scd_base_addr = le32toh(palive2->scd_base_ptr); + sc->umac_error_event_table = + le32toh(palive2->error_info_addr); + + alive_data->valid = le16toh(palive2->status) == + IWM_ALIVE_STATUS_OK; + if (sc->umac_error_event_table) + sc->support_umac_log = TRUE; + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Alive VER2 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", + le16toh(palive2->status), palive2->ver_type, + palive2->ver_subtype, palive2->flags); + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "UMAC version: Major - 0x%x, Minor - 0x%x\n", + palive2->umac_major, palive2->umac_minor); + } else if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive)) { + palive = (void *)pkt->data; + + sc->error_event_table = + le32toh(palive->error_event_table_ptr); + sc->log_event_table = + le32toh(palive->log_event_table_ptr); + alive_data->scd_base_addr = le32toh(palive->scd_base_ptr); + sc->umac_error_event_table = + le32toh(palive->error_info_addr); + + alive_data->valid = le16toh(palive->status) == + IWM_ALIVE_STATUS_OK; + if (sc->umac_error_event_table) + sc->support_umac_log = TRUE; + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Alive VER3 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", + le16toh(palive->status), palive->ver_type, + palive->ver_subtype, palive->flags); + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "UMAC version: Major - 0x%x, Minor - 0x%x\n", + le32toh(palive->umac_major), + le32toh(palive->umac_minor)); + } + + return TRUE; +} + +static int iwm_wait_phy_db_entry(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) { @@ -2831,27 +2941,76 @@ static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) { - enum iwm_ucode_type old_type = sc->sc_uc_current; + struct iwm_notification_wait alive_wait; + struct iwm_mvm_alive_data alive_data; + const struct iwm_fw_sects *fw; + enum iwm_ucode_type old_type = sc->cur_ucode; int error; + static const uint16_t alive_cmd[] = { IWM_MVM_ALIVE }; if ((error = iwm_read_firmware(sc, ucode_type)) != 0) { device_printf(sc->sc_dev, "iwm_read_firmware: failed %d\n", error); return error; } + fw = &sc->sc_fw.fw_sects[ucode_type]; + sc->cur_ucode = ucode_type; + sc->ucode_loaded = FALSE; - sc->sc_uc_current = ucode_type; - error = iwm_start_fw(sc, ucode_type); + memset(&alive_data, 0, sizeof(alive_data)); + iwm_init_notification_wait(sc->sc_notif_wait, &alive_wait, + alive_cmd, nitems(alive_cmd), + iwm_alive_fn, &alive_data); + + error = iwm_start_fw(sc, fw); if (error) { device_printf(sc->sc_dev, "iwm_start_fw: failed %d\n", error); - sc->sc_uc_current = old_type; + sc->cur_ucode = old_type; + iwm_remove_notification(sc->sc_notif_wait, &alive_wait); return error; } - error = iwm_post_alive(sc); + /* + * Some things may run in the background now, but we + * just wait for the ALIVE notification here. + */ + IWM_UNLOCK(sc); + error = iwm_wait_notification(sc->sc_notif_wait, &alive_wait, + IWM_MVM_UCODE_ALIVE_TIMEOUT); + IWM_LOCK(sc); if (error) { - device_printf(sc->sc_dev, "iwm_fw_alive: failed %d\n", error); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + device_printf(sc->sc_dev, + "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", + iwm_read_prph(sc, IWM_SB_CPU_1_STATUS), + iwm_read_prph(sc, IWM_SB_CPU_2_STATUS)); + } + sc->cur_ucode = old_type; + return error; } + + if (!alive_data.valid) { + device_printf(sc->sc_dev, "%s: Loaded ucode is not valid\n", + __func__); + sc->cur_ucode = old_type; + return EIO; + } + + iwm_trans_pcie_fw_alive(sc, alive_data.scd_base_addr); + + /* + * configure and operate fw paging mechanism. + * driver configures the paging flow only once, CPU2 paging image + * included in the IWM_UCODE_INIT image. + */ + if (fw->paging_mem_size) { + /* XXX implement FW paging */ + device_printf(sc->sc_dev, + "%s: XXX FW paging not implemented yet\n", __func__); + } + + if (!error) + sc->ucode_loaded = TRUE; return error; } @@ -5175,7 +5334,7 @@ iwm_nic_umac_error(struct iwm_softc *sc) struct iwm_umac_error_event_table table; uint32_t base; - base = sc->sc_uc.uc_umac_error_event_table; + base = sc->umac_error_event_table; if (base < 0x800000) { device_printf(sc->sc_dev, "Invalid error log pointer 0x%08x\n", @@ -5230,7 +5389,7 @@ iwm_nic_error(struct iwm_softc *sc) uint32_t base; device_printf(sc->sc_dev, "dumping device error log\n"); - base = sc->sc_uc.uc_error_event_table; + base = sc->umac_error_event_table; if (base < 0x800000) { device_printf(sc->sc_dev, "Invalid error log pointer 0x%08x\n", base); @@ -5292,7 +5451,7 @@ iwm_nic_error(struct iwm_softc *sc) device_printf(sc->sc_dev, "%08X | timestamp\n", table.u_timestamp); device_printf(sc->sc_dev, "%08X | flow_handler\n", table.flow_handler); - if (sc->sc_uc.uc_umac_error_event_table) + if (sc->umac_error_event_table) iwm_nic_umac_error(sc); } #endif @@ -5402,58 +5561,9 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_MFUART_LOAD_NOTIFICATION: break; - case IWM_MVM_ALIVE: { - struct iwm_mvm_alive_resp_v1 *resp1; - struct iwm_mvm_alive_resp_v2 *resp2; - struct iwm_mvm_alive_resp_v3 *resp3; + case IWM_MVM_ALIVE: + break; - if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp1)) { - resp1 = (void *)pkt->data; - sc->sc_uc.uc_error_event_table - = le32toh(resp1->error_event_table_ptr); - sc->sc_uc.uc_log_event_table - = le32toh(resp1->log_event_table_ptr); - sc->sched_base = le32toh(resp1->scd_base_ptr); - if (resp1->status == IWM_ALIVE_STATUS_OK) - sc->sc_uc.uc_ok = 1; - else - sc->sc_uc.uc_ok = 0; - } - - if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp2)) { - resp2 = (void *)pkt->data; - sc->sc_uc.uc_error_event_table - = le32toh(resp2->error_event_table_ptr); - sc->sc_uc.uc_log_event_table - = le32toh(resp2->log_event_table_ptr); - sc->sched_base = le32toh(resp2->scd_base_ptr); - sc->sc_uc.uc_umac_error_event_table - = le32toh(resp2->error_info_addr); - if (resp2->status == IWM_ALIVE_STATUS_OK) - sc->sc_uc.uc_ok = 1; - else - sc->sc_uc.uc_ok = 0; - } - - if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp3)) { - resp3 = (void *)pkt->data; - sc->sc_uc.uc_error_event_table - = le32toh(resp3->error_event_table_ptr); - sc->sc_uc.uc_log_event_table - = le32toh(resp3->log_event_table_ptr); - sc->sched_base = le32toh(resp3->scd_base_ptr); - sc->sc_uc.uc_umac_error_event_table - = le32toh(resp3->error_info_addr); - if (resp3->status == IWM_ALIVE_STATUS_OK) - sc->sc_uc.uc_ok = 1; - else - sc->sc_uc.uc_ok = 0; - } - - sc->sc_uc.uc_intr = 1; - wakeup(&sc->sc_uc); - break; } - case IWM_CALIB_RES_NOTIF_PHY_DB: break; @@ -5704,8 +5814,8 @@ iwm_intr(void *arg) IWM_WRITE(sc, IWM_CSR_INT, r1 | ~sc->sc_intmask); - /* ignored */ - handled |= (r1 & (IWM_CSR_INT_BIT_ALIVE /*| IWM_CSR_INT_BIT_SCD*/)); + /* Safely ignore these bits for debug checks below */ + r1 &= ~(IWM_CSR_INT_BIT_ALIVE | IWM_CSR_INT_BIT_SCD); if (r1 & IWM_CSR_INT_BIT_SW_ERR) { int i; Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:01:33 2018 (r330182) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:13:01 2018 (r330183) @@ -2141,7 +2141,7 @@ enum { #define IWM_ALIVE_FLG_RFKILL (1 << 0) -struct iwm_mvm_alive_resp_v1 { +struct iwm_mvm_alive_resp_ver1 { uint16_t status; uint16_t flags; uint8_t ucode_minor; @@ -2163,7 +2163,7 @@ struct iwm_mvm_alive_resp_v1 { uint32_t scd_base_ptr; /* SRAM address for SCD */ } __packed; /* IWM_ALIVE_RES_API_S_VER_1 */ -struct iwm_mvm_alive_resp_v2 { +struct iwm_mvm_alive_resp_ver2 { uint16_t status; uint16_t flags; uint8_t ucode_minor; @@ -2185,14 +2185,14 @@ struct iwm_mvm_alive_resp_v2 { uint32_t scd_base_ptr; /* SRAM address for SCD */ uint32_t st_fwrd_addr; /* pointer to Store and forward */ uint32_t st_fwrd_size; - uint8_t umac_minor; /* UMAC version: minor */ - uint8_t umac_major; /* UMAC version: major */ - uint16_t umac_id; /* UMAC version: id */ - uint32_t error_info_addr; /* SRAM address for UMAC error log */ + uint8_t umac_minor; /* UMAC version: minor */ + uint8_t umac_major; /* UMAC version: major */ + uint16_t umac_id; /* UMAC version: id */ + uint32_t error_info_addr; /* SRAM address for UMAC error log */ uint32_t dbg_print_buff_addr; } __packed; /* ALIVE_RES_API_S_VER_2 */ -struct iwm_mvm_alive_resp_v3 { +struct iwm_mvm_alive_resp { uint16_t status; uint16_t flags; uint32_t ucode_minor; @@ -2212,7 +2212,7 @@ struct iwm_mvm_alive_resp_v3 { uint32_t st_fwrd_size; uint32_t umac_minor; /* UMAC version: minor */ uint32_t umac_major; /* UMAC version: major */ - uint32_t error_info_addr; /* SRAM address for UMAC error log */ + uint32_t error_info_addr; /* SRAM address for UMAC error log */ uint32_t dbg_print_buff_addr; } __packed; /* ALIVE_RES_API_S_VER_3 */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:01:33 2018 (r330182) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:13:01 2018 (r330183) @@ -299,15 +299,6 @@ struct iwm_rx_ring { int cur; }; -struct iwm_ucode_status { - uint32_t uc_error_event_table; - uint32_t uc_umac_error_event_table; - uint32_t uc_log_event_table; - - int uc_ok; - int uc_intr; -}; - #define IWM_CMD_RESP_MAX PAGE_SIZE #define IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS 500 @@ -439,7 +430,7 @@ struct iwm_softc { /* TX scheduler rings. */ struct iwm_dma_info sched_dma; - uint32_t sched_base; + uint32_t scd_base_addr; /* TX/RX rings. */ struct iwm_tx_ring txq[IWM_MVM_MAX_QUEUES]; @@ -460,8 +451,8 @@ struct iwm_softc { int sc_fw_chunk_done; - struct iwm_ucode_status sc_uc; - enum iwm_ucode_type sc_uc_current; + enum iwm_ucode_type cur_ucode; + int ucode_loaded; char sc_fwver[32]; int sc_capaflags; @@ -529,6 +520,12 @@ struct iwm_softc { struct iwm_notif_wait_data *sc_notif_wait; int cmd_hold_nic_awake; + + /* Firmware status */ + uint32_t error_event_table; + uint32_t log_event_table; + uint32_t umac_error_event_table; + int support_umac_log; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Mar 1 06:14:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E286F26933; Thu, 1 Mar 2018 06:14:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF588865D2; Thu, 1 Mar 2018 06:14:09 +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 BA45E24A6C; Thu, 1 Mar 2018 06:14:09 +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 w216E96B046842; Thu, 1 Mar 2018 06:14:09 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216E9Jt046841; Thu, 1 Mar 2018 06:14:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010614.w216E9Jt046841@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 06:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330184 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:14:10 -0000 Author: eadler Date: Thu Mar 1 06:14:09 2018 New Revision: 330184 URL: https://svnweb.freebsd.org/changeset/base/330184 Log: MFC r314067: [iwm] With the previous commits, this DELAY no longer seems to be needed. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:13:01 2018 (r330183) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:14:09 2018 (r330184) @@ -2602,11 +2602,6 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, IWM_WRITE(sc, IWM_FH_UCODE_LOAD_STATUS, val); sec_num = (sec_num << 1) | 0x1; iwm_nic_unlock(sc); - - /* - * The firmware won't load correctly without this delay. - */ - DELAY(8000); } } From owner-svn-src-all@freebsd.org Thu Mar 1 06:15:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E09F26ADA; Thu, 1 Mar 2018 06:15:01 +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 9E4328683A; Thu, 1 Mar 2018 06:15:01 +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 8015224A71; Thu, 1 Mar 2018 06:15:01 +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 w216F1ha046928; Thu, 1 Mar 2018 06:15:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216F1qm046926; Thu, 1 Mar 2018 06:15:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010615.w216F1qm046926@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 06:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330185 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:15:02 -0000 Author: eadler Date: Thu Mar 1 06:15:01 2018 New Revision: 330185 URL: https://svnweb.freebsd.org/changeset/base/330185 Log: MFC r314069: [iwm] Get rid of unneeded IWM_FWDMASEGSZ and IWM_FWMAXSIZE constants * We only need IWM_FH_MEM_TB_MAX_LENGTH bytes for the fw_dma memory. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:14:09 2018 (r330184) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:15:01 2018 (r330185) @@ -1025,7 +1025,7 @@ iwm_alloc_fwmem(struct iwm_softc *sc) { /* Must be aligned on a 16-byte boundary. */ return iwm_dma_contig_alloc(sc->sc_dmat, &sc->fw_dma, - sc->sc_fwdmasegsz, 16); + IWM_FH_MEM_TB_MAX_LENGTH, 16); } /* tx scheduler rings. not used? */ @@ -5971,27 +5971,22 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_3160_1: case PCI_PRODUCT_INTEL_WL_3160_2: sc->cfg = &iwm3160_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_3165_1: case PCI_PRODUCT_INTEL_WL_3165_2: sc->cfg = &iwm3165_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_7260_1: case PCI_PRODUCT_INTEL_WL_7260_2: sc->cfg = &iwm7260_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_7265_1: case PCI_PRODUCT_INTEL_WL_7265_2: sc->cfg = &iwm7265_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_8260_1: case PCI_PRODUCT_INTEL_WL_8260_2: sc->cfg = &iwm8260_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000; return (0); default: device_printf(dev, "unknown adapter type\n"); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:14:09 2018 (r330184) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:15:01 2018 (r330185) @@ -138,10 +138,6 @@ struct iwm_tx_radiotap_header { #define IWM_UCODE_SECTION_MAX 16 -#define IWM_FWDMASEGSZ (192*1024) -#define IWM_FWDMASEGSZ_8000 (320*1024) -/* sanity check value */ -#define IWM_FWMAXSIZE (2*1024*1024) /* * fw_status is used to determine if we've already parsed the firmware file @@ -475,7 +471,6 @@ struct iwm_softc { */ int sc_generation; - bus_size_t sc_fwdmasegsz; struct iwm_fw_info sc_fw; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; From owner-svn-src-all@freebsd.org Thu Mar 1 06:16:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA52EF26C6E; Thu, 1 Mar 2018 06:16:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 725FA86B15; Thu, 1 Mar 2018 06:16:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D59F24A75; Thu, 1 Mar 2018 06:16:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216GB7o047016; Thu, 1 Mar 2018 06:16:11 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216GBTE047015; Thu, 1 Mar 2018 06:16:11 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010616.w216GBTE047015@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 06:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330186 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:16:12 -0000 Author: eadler Date: Thu Mar 1 06:16:11 2018 New Revision: 330186 URL: https://svnweb.freebsd.org/changeset/base/330186 Log: MFC r314070: [iwm] Fix typo in commit a7697ea01c11fd493aec52260a02f31df680eb91. * The sc->sc_uc.uc_error_event_table value is now at sc->error_event_table, and not sc->umac_error_event_table. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:15:01 2018 (r330185) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:16:11 2018 (r330186) @@ -5384,7 +5384,7 @@ iwm_nic_error(struct iwm_softc *sc) uint32_t base; device_printf(sc->sc_dev, "dumping device error log\n"); - base = sc->umac_error_event_table; + base = sc->error_event_table; if (base < 0x800000) { device_printf(sc->sc_dev, "Invalid error log pointer 0x%08x\n", base); From owner-svn-src-all@freebsd.org Thu Mar 1 06:16:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C42F3F26DBD; Thu, 1 Mar 2018 06:16:41 +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 297CA86D71; Thu, 1 Mar 2018 06:16:41 +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 2465724A7A; Thu, 1 Mar 2018 06:16:41 +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 w216Gede047194; Thu, 1 Mar 2018 06:16:40 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216GeTh047193; Thu, 1 Mar 2018 06:16:40 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010616.w216GeTh047193@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 06:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330187 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:16:42 -0000 Author: eadler Date: Thu Mar 1 06:16:40 2018 New Revision: 330187 URL: https://svnweb.freebsd.org/changeset/base/330187 Log: MFC r314074: [iwm] Simplify device id matching code a bit. * Just add the struct iwm_cfg pointers to the iwm_devices array, to get rid of the large switch clause. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:16:11 2018 (r330186) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:16:40 2018 (r330187) @@ -5929,19 +5929,30 @@ iwm_intr(void *arg) #define PCI_PRODUCT_INTEL_WL_8260_2 0x24f4 static const struct iwm_devices { - uint16_t device; - const char *name; + uint16_t device; + const char *name; + const struct iwm_cfg *cfg; } iwm_devices[] = { - { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160" }, - { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160" }, - { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165" }, - { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165" }, - { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260" }, - { PCI_PRODUCT_INTEL_WL_7260_2, "Intel Dual Band Wireless AC 7260" }, - { PCI_PRODUCT_INTEL_WL_7265_1, "Intel Dual Band Wireless AC 7265" }, - { PCI_PRODUCT_INTEL_WL_7265_2, "Intel Dual Band Wireless AC 7265" }, - { PCI_PRODUCT_INTEL_WL_8260_1, "Intel Dual Band Wireless AC 8260" }, - { PCI_PRODUCT_INTEL_WL_8260_2, "Intel Dual Band Wireless AC 8260" }, + { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160", + &iwm3160_cfg }, + { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160", + &iwm3160_cfg }, + { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165", + &iwm3165_cfg }, + { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165", + &iwm3165_cfg }, + { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260", + &iwm7260_cfg }, + { PCI_PRODUCT_INTEL_WL_7260_2, "Intel Dual Band Wireless AC 7260", + &iwm7260_cfg }, + { PCI_PRODUCT_INTEL_WL_7265_1, "Intel Dual Band Wireless AC 7265", + &iwm7265_cfg }, + { PCI_PRODUCT_INTEL_WL_7265_2, "Intel Dual Band Wireless AC 7265", + &iwm7265_cfg }, + { PCI_PRODUCT_INTEL_WL_8260_1, "Intel Dual Band Wireless AC 8260", + &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_8260_2, "Intel Dual Band Wireless AC 8260", + &iwm8260_cfg }, }; static int @@ -5964,34 +5975,20 @@ static int iwm_dev_check(device_t dev) { struct iwm_softc *sc; + uint16_t devid; + int i; sc = device_get_softc(dev); - switch (pci_get_device(dev)) { - case PCI_PRODUCT_INTEL_WL_3160_1: - case PCI_PRODUCT_INTEL_WL_3160_2: - sc->cfg = &iwm3160_cfg; - return (0); - case PCI_PRODUCT_INTEL_WL_3165_1: - case PCI_PRODUCT_INTEL_WL_3165_2: - sc->cfg = &iwm3165_cfg; - return (0); - case PCI_PRODUCT_INTEL_WL_7260_1: - case PCI_PRODUCT_INTEL_WL_7260_2: - sc->cfg = &iwm7260_cfg; - return (0); - case PCI_PRODUCT_INTEL_WL_7265_1: - case PCI_PRODUCT_INTEL_WL_7265_2: - sc->cfg = &iwm7265_cfg; - return (0); - case PCI_PRODUCT_INTEL_WL_8260_1: - case PCI_PRODUCT_INTEL_WL_8260_2: - sc->cfg = &iwm8260_cfg; - return (0); - default: - device_printf(dev, "unknown adapter type\n"); - return ENXIO; + devid = pci_get_device(dev); + for (i = 0; i < nitems(iwm_devices); i++) { + if (iwm_devices[i].device == devid) { + sc->cfg = iwm_devices[i].cfg; + return (0); + } } + device_printf(dev, "unknown adapter type\n"); + return ENXIO; } /* PCI registers */ From owner-svn-src-all@freebsd.org Thu Mar 1 06:18:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83F40F2709D; Thu, 1 Mar 2018 06:18:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8018717A; Thu, 1 Mar 2018 06:18:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 294AE24A82; Thu, 1 Mar 2018 06:18:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216ISJS047307; Thu, 1 Mar 2018 06:18:28 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216IROV047300; Thu, 1 Mar 2018 06:18:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010618.w216IROV047300@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 06:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330188 - in stable/11/sys: conf dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf dev/iwm X-SVN-Commit-Revision: 330188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:18:28 -0000 Author: eadler Date: Thu Mar 1 06:18:27 2018 New Revision: 330188 URL: https://svnweb.freebsd.org/changeset/base/330188 Log: MFC r314076: [iwm] Move struct iwm_cfg chipset configs to if_iwm_7000.c and _8000.c * This is more similar to how code/definitions are distributed in Linux's iwlwifi. * This should make recognizing new chipset variants, and adding additional flags from the Linux iwlwifi code easier, without blowing up if_iwm.c Added: stable/11/sys/dev/iwm/if_iwm_7000.c - copied unchanged from r314076, head/sys/dev/iwm/if_iwm_7000.c stable/11/sys/dev/iwm/if_iwm_8000.c - copied unchanged from r314076, head/sys/dev/iwm/if_iwm_8000.c stable/11/sys/dev/iwm/if_iwm_config.h - copied unchanged from r314076, head/sys/dev/iwm/if_iwm_config.h Modified: stable/11/sys/conf/files stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 06:16:40 2018 (r330187) +++ stable/11/sys/conf/files Thu Mar 1 06:18:27 2018 (r330188) @@ -1869,6 +1869,8 @@ iwi_monitor.fw optional iwimonitorfw | iwifw \ no-obj no-implicit-rule \ clean "iwi_monitor.fw" dev/iwm/if_iwm.c optional iwm +dev/iwm/if_iwm_7000.c optional iwm +dev/iwm/if_iwm_8000.c optional iwm dev/iwm/if_iwm_binding.c optional iwm dev/iwm/if_iwm_led.c optional iwm dev/iwm/if_iwm_mac_ctxt.c optional iwm Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:16:40 2018 (r330187) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:18:27 2018 (r330188) @@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -166,68 +167,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 -#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 - -/* lower blocks contain EEPROM image and calibration data */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ - -#define IWM7260_FW "iwm7260fw" -#define IWM3160_FW "iwm3160fw" -#define IWM7265_FW "iwm7265fw" -#define IWM7265D_FW "iwm7265Dfw" -#define IWM8000_FW "iwm8000Cfw" - -#define IWM_DEVICE_7000_COMMON \ - .device_family = IWM_DEVICE_FAMILY_7000, \ - .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000, \ - .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000, \ - .apmg_wake_up_wa = 1 - -const struct iwm_cfg iwm7260_cfg = { - .fw_name = IWM7260_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 1, -}; - -const struct iwm_cfg iwm3160_cfg = { - .fw_name = IWM3160_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 1, -}; - -const struct iwm_cfg iwm3165_cfg = { - /* XXX IWM7265D_FW doesn't seem to work properly yet */ - .fw_name = IWM7265_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 0, -}; - -const struct iwm_cfg iwm7265_cfg = { - .fw_name = IWM7265_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 0, -}; - -const struct iwm_cfg iwm7265d_cfg = { - /* XXX IWM7265D_FW doesn't seem to work properly yet */ - .fw_name = IWM7265_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 0, -}; - -#define IWM_DEVICE_8000_COMMON \ - .device_family = IWM_DEVICE_FAMILY_8000, \ - .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000, \ - .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000 - -const struct iwm_cfg iwm8260_cfg = { - .fw_name = IWM8000_FW, - IWM_DEVICE_8000_COMMON, - .host_interrupt_operation_mode = 0, -}; - const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, @@ -5930,29 +5869,18 @@ iwm_intr(void *arg) static const struct iwm_devices { uint16_t device; - const char *name; const struct iwm_cfg *cfg; } iwm_devices[] = { - { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160", - &iwm3160_cfg }, - { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160", - &iwm3160_cfg }, - { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165", - &iwm3165_cfg }, - { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165", - &iwm3165_cfg }, - { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260", - &iwm7260_cfg }, - { PCI_PRODUCT_INTEL_WL_7260_2, "Intel Dual Band Wireless AC 7260", - &iwm7260_cfg }, - { PCI_PRODUCT_INTEL_WL_7265_1, "Intel Dual Band Wireless AC 7265", - &iwm7265_cfg }, - { PCI_PRODUCT_INTEL_WL_7265_2, "Intel Dual Band Wireless AC 7265", - &iwm7265_cfg }, - { PCI_PRODUCT_INTEL_WL_8260_1, "Intel Dual Band Wireless AC 8260", - &iwm8260_cfg }, - { PCI_PRODUCT_INTEL_WL_8260_2, "Intel Dual Band Wireless AC 8260", - &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_3160_1, &iwm3160_cfg }, + { PCI_PRODUCT_INTEL_WL_3160_2, &iwm3160_cfg }, + { PCI_PRODUCT_INTEL_WL_3165_1, &iwm3165_cfg }, + { PCI_PRODUCT_INTEL_WL_3165_2, &iwm3165_cfg }, + { PCI_PRODUCT_INTEL_WL_7260_1, &iwm7260_cfg }, + { PCI_PRODUCT_INTEL_WL_7260_2, &iwm7260_cfg }, + { PCI_PRODUCT_INTEL_WL_7265_1, &iwm7265_cfg }, + { PCI_PRODUCT_INTEL_WL_7265_2, &iwm7265_cfg }, + { PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, }; static int @@ -5963,7 +5891,7 @@ iwm_probe(device_t dev) for (i = 0; i < nitems(iwm_devices); i++) { if (pci_get_vendor(dev) == PCI_VENDOR_INTEL && pci_get_device(dev) == iwm_devices[i].device) { - device_set_desc(dev, iwm_devices[i].name); + device_set_desc(dev, iwm_devices[i].cfg->name); return (BUS_PROBE_DEFAULT); } } Copied: stable/11/sys/dev/iwm/if_iwm_7000.c (from r314076, head/sys/dev/iwm/if_iwm_7000.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_7000.c Thu Mar 1 06:18:27 2018 (r330188, copy of r314076, head/sys/dev/iwm/if_iwm_7000.c) @@ -0,0 +1,128 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "if_iwm_config.h" + +#define IWM7260_FW "iwm7260fw" +#define IWM3160_FW "iwm3160fw" +#define IWM7265_FW "iwm7265fw" +#define IWM7265D_FW "iwm7265Dfw" + +#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 + +#define IWM_DEVICE_7000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_7000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000, \ + .apmg_wake_up_wa = 1 + +const struct iwm_cfg iwm7260_cfg = { + .name = "Intel(R) Dual Band Wireless AC 7260", + .fw_name = IWM7260_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 1, +}; + +const struct iwm_cfg iwm3160_cfg = { + .name = "Intel(R) Dual Band Wireless AC 3160", + .fw_name = IWM3160_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 1, +}; + +const struct iwm_cfg iwm3165_cfg = { + .name = "Intel(R) Dual Band Wireless AC 3165", + /* XXX IWM7265D_FW doesn't seem to work properly yet */ + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm7265_cfg = { + .name = "Intel(R) Dual Band Wireless AC 7265", + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm7265d_cfg = { + .name = "Intel(R) Dual Band Wireless AC 7265", + /* XXX IWM7265D_FW doesn't seem to work properly yet */ + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + Copied: stable/11/sys/dev/iwm/if_iwm_8000.c (from r314076, head/sys/dev/iwm/if_iwm_8000.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_8000.c Thu Mar 1 06:18:27 2018 (r330188, copy of r314076, head/sys/dev/iwm/if_iwm_8000.c) @@ -0,0 +1,92 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "if_iwm_config.h" + +#define IWM8000_FW "iwm8000Cfw" + +#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 + +#define IWM_DEVICE_8000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_8000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000 + +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, +}; Copied: stable/11/sys/dev/iwm/if_iwm_config.h (from r314076, head/sys/dev/iwm/if_iwm_config.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_config.h Thu Mar 1 06:18:27 2018 (r330188, copy of r314076, head/sys/dev/iwm/if_iwm_config.h) @@ -0,0 +1,135 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. + * Copyright (C) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * Copyright (C) 2016 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/* + * $FreeBSD$ + */ + +#ifndef __IWM_CONFIG_H__ +#define __IWM_CONFIG_H__ + +enum iwm_device_family { + IWM_DEVICE_FAMILY_UNDEFINED, + IWM_DEVICE_FAMILY_7000, + IWM_DEVICE_FAMILY_8000, +}; + +/* Antenna presence definitions */ +#define IWM_ANT_NONE 0x0 +#define IWM_ANT_A (1 << 0) +#define IWM_ANT_B (1 << 1) +#define IWM_ANT_C (1 << 2) +#define IWM_ANT_AB (IWM_ANT_A | IWM_ANT_B) +#define IWM_ANT_AC (IWM_ANT_A | IWM_ANT_C) +#define IWM_ANT_BC (IWM_ANT_B | IWM_ANT_C) +#define IWM_ANT_ABC (IWM_ANT_A | IWM_ANT_B | IWM_ANT_C) + +static inline uint8_t num_of_ant(uint8_t mask) +{ + return !!((mask) & IWM_ANT_A) + + !!((mask) & IWM_ANT_B) + + !!((mask) & IWM_ANT_C); +} + +/* lower blocks contain EEPROM image and calibration data */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_9000 IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 + +/** + * struct iwm_cfg + * @name: Official name of the device + * @fw_name: Firmware filename. + * @host_interrupt_operation_mode: device needs host interrupt operation + * mode set + * @nvm_hw_section_num: the ID of the HW NVM section + * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command + * is in flight. This is due to a HW bug in 7260, 3160 and 7265. + */ +struct iwm_cfg { + const char *name; + const char *fw_name; + uint16_t eeprom_size; + enum iwm_device_family device_family; + int host_interrupt_operation_mode; + uint8_t nvm_hw_section_num; + int apmg_wake_up_wa; +}; + +/* + * This list declares the config structures for all devices. + */ +extern const struct iwm_cfg iwm7260_cfg; +extern const struct iwm_cfg iwm3160_cfg; +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; + +#endif /* __IWM_CONFIG_H__ */ Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:16:40 2018 (r330187) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:18:27 2018 (r330188) @@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:16:40 2018 (r330187) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:18:27 2018 (r330188) @@ -368,29 +368,7 @@ struct iwm_node { #define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t)) #define IWM_ICT_PADDR_SHIFT 12 -enum iwm_device_family { - IWM_DEVICE_FAMILY_UNDEFINED, - IWM_DEVICE_FAMILY_7000, - IWM_DEVICE_FAMILY_8000, -}; - -/** - * struct iwm_cfg - * @fw_name: Firmware filename. - * @host_interrupt_operation_mode: device needs host interrupt operation - * mode set - * @nvm_hw_section_num: the ID of the HW NVM section - * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command - * is in flight. This is due to a HW bug in 7260, 3160 and 7265. - */ -struct iwm_cfg { - const char *fw_name; - uint16_t eeprom_size; - enum iwm_device_family device_family; - int host_interrupt_operation_mode; - uint8_t nvm_hw_section_num; - int apmg_wake_up_wa; -}; +struct iwm_cfg; struct iwm_softc { device_t sc_dev; From owner-svn-src-all@freebsd.org Thu Mar 1 06:19:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AFDEF27205; Thu, 1 Mar 2018 06:19:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17D4E873A5; Thu, 1 Mar 2018 06:19:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12DAE24A8B; Thu, 1 Mar 2018 06:19:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216JC6L047381; Thu, 1 Mar 2018 06:19:12 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216JCWa047380; Thu, 1 Mar 2018 06:19:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010619.w216JCWa047380@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 06:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330189 - stable/11/sys/modules/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/modules/iwm X-SVN-Commit-Revision: 330189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:19:13 -0000 Author: eadler Date: Thu Mar 1 06:19:12 2018 New Revision: 330189 URL: https://svnweb.freebsd.org/changeset/base/330189 Log: MFC 314151: Unbreak if_iwm.ko after r314076 Add if_iwm_7000.c/if_iwm_8000.c to SRCS to match similar additions made to sys/conf/files after refactoring done in the commit noted. PR: 217308 Pointyhat to: adrian Submitted by: Andreas Nilsson Reported by: Jakob Alvermark , Juan Ramómon Molina Menor Modified: stable/11/sys/modules/iwm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/iwm/Makefile ============================================================================== --- stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:18:27 2018 (r330188) +++ stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:19:12 2018 (r330189) @@ -7,6 +7,7 @@ KMOD= if_iwm SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c +SRCS+= if_iwm_7000.c if_iwm_8000.c # bus layer SRCS+= if_iwm_pcie_trans.c SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h From owner-svn-src-all@freebsd.org Thu Mar 1 06:19:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A700F27315; Thu, 1 Mar 2018 06:19:54 +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 BDE1E875A8; Thu, 1 Mar 2018 06:19:53 +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 B8E8C24A8F; Thu, 1 Mar 2018 06:19:53 +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 w216Jrfl047460; Thu, 1 Mar 2018 06:19:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216JrPO047459; Thu, 1 Mar 2018 06:19:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010619.w216JrPO047459@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 06:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330190 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:19:54 -0000 Author: eadler Date: Thu Mar 1 06:19:53 2018 New Revision: 330190 URL: https://svnweb.freebsd.org/changeset/base/330190 Log: MFC r314081: [iwm] Switch 7265D and 3165 devices to 7265D firmware. Modified: stable/11/sys/dev/iwm/if_iwm_7000.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_7000.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_7000.c Thu Mar 1 06:19:12 2018 (r330189) +++ stable/11/sys/dev/iwm/if_iwm_7000.c Thu Mar 1 06:19:53 2018 (r330190) @@ -105,8 +105,7 @@ const struct iwm_cfg iwm3160_cfg = { const struct iwm_cfg iwm3165_cfg = { .name = "Intel(R) Dual Band Wireless AC 3165", - /* XXX IWM7265D_FW doesn't seem to work properly yet */ - .fw_name = IWM7265_FW, + .fw_name = IWM7265D_FW, IWM_DEVICE_7000_COMMON, .host_interrupt_operation_mode = 0, }; @@ -120,8 +119,7 @@ const struct iwm_cfg iwm7265_cfg = { const struct iwm_cfg iwm7265d_cfg = { .name = "Intel(R) Dual Band Wireless AC 7265", - /* XXX IWM7265D_FW doesn't seem to work properly yet */ - .fw_name = IWM7265_FW, + .fw_name = IWM7265D_FW, IWM_DEVICE_7000_COMMON, .host_interrupt_operation_mode = 0, }; From owner-svn-src-all@freebsd.org Thu Mar 1 06:20:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5D70F27457; Thu, 1 Mar 2018 06:20:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8890A87738; Thu, 1 Mar 2018 06:20:17 +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 8390424A95; Thu, 1 Mar 2018 06:20:17 +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 w216KHLr047556; Thu, 1 Mar 2018 06:20:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216KHf1047553; Thu, 1 Mar 2018 06:20:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010620.w216KHf1047553@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 06:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330191 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:20:18 -0000 Author: eadler Date: Thu Mar 1 06:20:16 2018 New Revision: 330191 URL: https://svnweb.freebsd.org/changeset/base/330191 Log: MFC r314082: [iwm] Move iwm_dma_contig_alloc/_free functions to if_iwm_util.c. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:19:53 2018 (r330190) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:20:16 2018 (r330191) @@ -239,10 +239,6 @@ static int iwm_firmware_store_section(struct iwm_softc static int iwm_set_default_calib(struct iwm_softc *, const void *); static void iwm_fw_info_free(struct iwm_fw_info *); static int iwm_read_firmware(struct iwm_softc *, enum iwm_ucode_type); -static void iwm_dma_map_addr(void *, bus_dma_segment_t *, int, int); -static int iwm_dma_contig_alloc(bus_dma_tag_t, struct iwm_dma_info *, - bus_size_t, bus_size_t); -static void iwm_dma_contig_free(struct iwm_dma_info *); static int iwm_alloc_fwmem(struct iwm_softc *); static int iwm_alloc_sched(struct iwm_softc *); static int iwm_alloc_kw(struct iwm_softc *); @@ -892,71 +888,6 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode /* * DMA resource routines */ - -static void -iwm_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - if (error != 0) - return; - KASSERT(nsegs == 1, ("too many DMA segments, %d should be 1", nsegs)); - *(bus_addr_t *)arg = segs[0].ds_addr; -} - -static int -iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma, - bus_size_t size, bus_size_t alignment) -{ - int error; - - dma->tag = NULL; - dma->map = NULL; - dma->size = size; - dma->vaddr = NULL; - - error = bus_dma_tag_create(tag, alignment, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, - 1, size, 0, NULL, NULL, &dma->tag); - if (error != 0) - goto fail; - - error = bus_dmamem_alloc(dma->tag, (void **)&dma->vaddr, - BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &dma->map); - if (error != 0) - goto fail; - - error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, - iwm_dma_map_addr, &dma->paddr, BUS_DMA_NOWAIT); - if (error != 0) { - bus_dmamem_free(dma->tag, dma->vaddr, dma->map); - dma->vaddr = NULL; - goto fail; - } - - bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); - - return 0; - -fail: - iwm_dma_contig_free(dma); - - return error; -} - -static void -iwm_dma_contig_free(struct iwm_dma_info *dma) -{ - if (dma->vaddr != NULL) { - bus_dmamap_sync(dma->tag, dma->map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(dma->tag, dma->map); - bus_dmamem_free(dma->tag, dma->vaddr, dma->map); - dma->vaddr = NULL; - } - if (dma->tag != NULL) { - bus_dma_tag_destroy(dma->tag); - dma->tag = NULL; - } -} /* fwmem is used to load firmware onto the card */ static int Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:19:53 2018 (r330190) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:20:16 2018 (r330191) @@ -421,3 +421,68 @@ iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cm sc->sc_wantresp = -1; wakeup(&sc->sc_wantresp); } + +static void +iwm_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error != 0) + return; + KASSERT(nsegs == 1, ("too many DMA segments, %d should be 1", nsegs)); + *(bus_addr_t *)arg = segs[0].ds_addr; +} + +int +iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma, + bus_size_t size, bus_size_t alignment) +{ + int error; + + dma->tag = NULL; + dma->map = NULL; + dma->size = size; + dma->vaddr = NULL; + + error = bus_dma_tag_create(tag, alignment, + 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, + 1, size, 0, NULL, NULL, &dma->tag); + if (error != 0) + goto fail; + + error = bus_dmamem_alloc(dma->tag, (void **)&dma->vaddr, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &dma->map); + if (error != 0) + goto fail; + + error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, + iwm_dma_map_addr, &dma->paddr, BUS_DMA_NOWAIT); + if (error != 0) { + bus_dmamem_free(dma->tag, dma->vaddr, dma->map); + dma->vaddr = NULL; + goto fail; + } + + bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); + + return 0; + +fail: + iwm_dma_contig_free(dma); + + return error; +} + +void +iwm_dma_contig_free(struct iwm_dma_info *dma) +{ + if (dma->vaddr != NULL) { + bus_dmamap_sync(dma->tag, dma->map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(dma->tag, dma->map); + bus_dmamem_free(dma->tag, dma->vaddr, dma->map); + dma->vaddr = NULL; + } + if (dma->tag != NULL) { + bus_dma_tag_destroy(dma->tag); + dma->tag = NULL; + } +} Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:19:53 2018 (r330190) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:20:16 2018 (r330191) @@ -116,6 +116,10 @@ extern int iwm_mvm_send_cmd_pdu_status(struct iwm_soft uint16_t len, const void *data, uint32_t *status); extern void iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cmd *hcmd); +extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma, + bus_size_t size, bus_size_t alignment); +extern void iwm_dma_contig_free(struct iwm_dma_info *); + static inline uint8_t iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc) { From owner-svn-src-all@freebsd.org Thu Mar 1 06:22:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F2E7F27904; Thu, 1 Mar 2018 06:22:16 +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 C5A5487DC0; Thu, 1 Mar 2018 06:22:15 +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 C06D524C0B; Thu, 1 Mar 2018 06:22:15 +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 w216MFPE049272; Thu, 1 Mar 2018 06:22:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216MFEn049264; Thu, 1 Mar 2018 06:22:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010622.w216MFEn049264@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 06:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330192 - in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Commit-Revision: 330192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:22:16 -0000 Author: eadler Date: Thu Mar 1 06:22:14 2018 New Revision: 330192 URL: https://svnweb.freebsd.org/changeset/base/330192 Log: MFC r314192,r314209: [iwm] Add support for Firmware paging, needed for newer 8000C firmware. * Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware what memory ranges to use for paging. Added: stable/11/sys/dev/iwm/if_iwm_fw.c - copied unchanged from r314209, head/sys/dev/iwm/if_iwm_fw.c stable/11/sys/dev/iwm/if_iwm_fw.h - copied unchanged from r314209, head/sys/dev/iwm/if_iwm_fw.h Modified: stable/11/sys/conf/files stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_debug.h stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h stable/11/sys/modules/iwm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/conf/files Thu Mar 1 06:22:14 2018 (r330192) @@ -1872,6 +1872,7 @@ dev/iwm/if_iwm.c optional iwm dev/iwm/if_iwm_7000.c optional iwm dev/iwm/if_iwm_8000.c optional iwm dev/iwm/if_iwm_binding.c optional iwm +dev/iwm/if_iwm_fw.c optional iwm dev/iwm/if_iwm_led.c optional iwm dev/iwm/if_iwm_mac_ctxt.c optional iwm dev/iwm/if_iwm_notif_wait.c optional iwm Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:22:14 2018 (r330192) @@ -166,6 +166,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ @@ -2869,9 +2870,21 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, * included in the IWM_UCODE_INIT image. */ if (fw->paging_mem_size) { - /* XXX implement FW paging */ - device_printf(sc->sc_dev, - "%s: XXX FW paging not implemented yet\n", __func__); + error = iwm_save_fw_paging(sc, fw); + if (error) { + device_printf(sc->sc_dev, + "%s: failed to save the FW paging image\n", + __func__); + return error; + } + + error = iwm_send_paging_cmd(sc, fw); + if (error) { + device_printf(sc->sc_dev, + "%s: failed to send the paging cmd\n", __func__); + iwm_free_fw_paging(sc); + return error; + } } if (!error) @@ -5496,6 +5509,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_REMOVE_STA: case IWM_TXPATH_FLUSH: case IWM_LQ_CMD: + case IWM_FW_PAGING_BLOCK_CMD: case IWM_BT_CONFIG: case IWM_REPLY_THERMAL_MNG_BACKOFF: cresp = (void *)pkt->data; @@ -6451,6 +6465,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 iwm_dma_contig_free(&sc->ict_dma); iwm_dma_contig_free(&sc->kw_dma); iwm_dma_contig_free(&sc->fw_dma); + + iwm_free_fw_paging(sc); /* Finished with the hardware - detach things */ iwm_pci_detach(dev); Modified: stable/11/sys/dev/iwm/if_iwm_debug.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 06:22:14 2018 (r330192) @@ -42,6 +42,7 @@ enum { IWM_DEBUG_TRANS = 0x00040000, /* Transport layer (eg PCIe) */ IWM_DEBUG_EEPROM = 0x00080000, /* EEPROM/channel information */ IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ + IWM_DEBUG_FW = 0x00200000, /* Firmware management */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ Copied: stable/11/sys/dev/iwm/if_iwm_fw.c (from r314209, head/sys/dev/iwm/if_iwm_fw.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_fw.c Thu Mar 1 06:22:14 2018 (r330192, copy of r314209, head/sys/dev/iwm/if_iwm_fw.c) @@ -0,0 +1,341 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 4.7.3 (tag id d7f6728f57e3ecbb7ef34eb7d9f564d514775d75) + * + *********************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +void +iwm_free_fw_paging(struct iwm_softc *sc) +{ + int i; + + if (sc->fw_paging_db[0].fw_paging_block.vaddr == NULL) + return; + + for (i = 0; i < IWM_NUM_OF_FW_PAGING_BLOCKS; i++) { + iwm_dma_contig_free(&sc->fw_paging_db[i].fw_paging_block); + } + + memset(sc->fw_paging_db, 0, sizeof(sc->fw_paging_db)); +} + +static int +iwm_fill_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *image) +{ + int sec_idx, idx; + uint32_t offset = 0; + + /* + * find where is the paging image start point: + * if CPU2 exist and it's in paging format, then the image looks like: + * CPU1 sections (2 or more) + * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between CPU1 to CPU2 + * CPU2 sections (not paged) + * PAGING_SEPARATOR_SECTION delimiter - separate between CPU2 + * non paged to CPU2 paging sec + * CPU2 paging CSS + * CPU2 paging image (including instruction and data) + */ + for (sec_idx = 0; sec_idx < IWM_UCODE_SECTION_MAX; sec_idx++) { + if (image->fw_sect[sec_idx].offset == IWM_PAGING_SEPARATOR_SECTION) { + sec_idx++; + break; + } + } + + /* + * If paging is enabled there should be at least 2 more sections left + * (one for CSS and one for Paging data) + */ + if (sec_idx >= nitems(image->fw_sect) - 1) { + device_printf(sc->sc_dev, + "Paging: Missing CSS and/or paging sections\n"); + iwm_free_fw_paging(sc); + return EINVAL; + } + + /* copy the CSS block to the dram */ + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: load paging CSS to FW, sec = %d\n", + sec_idx); + + memcpy(sc->fw_paging_db[0].fw_paging_block.vaddr, + image->fw_sect[sec_idx].data, + sc->fw_paging_db[0].fw_paging_size); + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: copied %d CSS bytes to first block\n", + sc->fw_paging_db[0].fw_paging_size); + + sec_idx++; + + /* + * copy the paging blocks to the dram + * loop index start from 1 since that CSS block already copied to dram + * and CSS index is 0. + * loop stop at num_of_paging_blk since that last block is not full. + */ + for (idx = 1; idx < sc->num_of_paging_blk; idx++) { + memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr, + (const char *)image->fw_sect[sec_idx].data + offset, + sc->fw_paging_db[idx].fw_paging_size); + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: copied %d paging bytes to block %d\n", + sc->fw_paging_db[idx].fw_paging_size, + idx); + + offset += sc->fw_paging_db[idx].fw_paging_size; + } + + /* copy the last paging block */ + if (sc->num_of_pages_in_last_blk > 0) { + memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr, + (const char *)image->fw_sect[sec_idx].data + offset, + IWM_FW_PAGING_SIZE * sc->num_of_pages_in_last_blk); + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: copied %d pages in the last block %d\n", + sc->num_of_pages_in_last_blk, idx); + } + + return 0; +} + +static int +iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *image) +{ + int blk_idx = 0; + int error, num_of_pages; + + if (sc->fw_paging_db[0].fw_paging_block.vaddr != NULL) { + int i; + /* Device got reset, and we setup firmware paging again */ + for (i = 0; i < sc->num_of_paging_blk + 1; i++) { + bus_dmamap_sync(sc->sc_dmat, + sc->fw_paging_db[i].fw_paging_block.map, + BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); + } + return 0; + } + + /* ensure IWM_BLOCK_2_EXP_SIZE is power of 2 of IWM_PAGING_BLOCK_SIZE */ + _Static_assert((1 << IWM_BLOCK_2_EXP_SIZE) == IWM_PAGING_BLOCK_SIZE, + "IWM_BLOCK_2_EXP_SIZE must be power of 2 of IWM_PAGING_BLOCK_SIZE"); + + num_of_pages = image->paging_mem_size / IWM_FW_PAGING_SIZE; + sc->num_of_paging_blk = ((num_of_pages - 1) / + IWM_NUM_OF_PAGE_PER_GROUP) + 1; + + sc->num_of_pages_in_last_blk = + num_of_pages - + IWM_NUM_OF_PAGE_PER_GROUP * (sc->num_of_paging_blk - 1); + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: allocating mem for %d paging blocks, each block holds 8 pages, last block holds %d pages\n", + sc->num_of_paging_blk, + sc->num_of_pages_in_last_blk); + + /* allocate block of 4Kbytes for paging CSS */ + error = iwm_dma_contig_alloc(sc->sc_dmat, + &sc->fw_paging_db[blk_idx].fw_paging_block, IWM_FW_PAGING_SIZE, + 4096); + if (error) { + /* free all the previous pages since we failed */ + iwm_free_fw_paging(sc); + return ENOMEM; + } + + sc->fw_paging_db[blk_idx].fw_paging_size = IWM_FW_PAGING_SIZE; + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: allocated 4K(CSS) bytes for firmware paging.\n"); + + /* + * allocate blocks in dram. + * since that CSS allocated in fw_paging_db[0] loop start from index 1 + */ + for (blk_idx = 1; blk_idx < sc->num_of_paging_blk + 1; blk_idx++) { + /* allocate block of IWM_PAGING_BLOCK_SIZE (32K) */ + /* XXX Use iwm_dma_contig_alloc for allocating */ + error = iwm_dma_contig_alloc(sc->sc_dmat, + &sc->fw_paging_db[blk_idx].fw_paging_block, + IWM_PAGING_BLOCK_SIZE, 4096); + if (error) { + /* free all the previous pages since we failed */ + iwm_free_fw_paging(sc); + return ENOMEM; + } + + sc->fw_paging_db[blk_idx].fw_paging_size = IWM_PAGING_BLOCK_SIZE; + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: allocated 32K bytes for firmware paging.\n"); + } + + return 0; +} + +int +iwm_save_fw_paging(struct iwm_softc *sc, const struct iwm_fw_sects *fw) +{ + int ret; + + ret = iwm_alloc_fw_paging_mem(sc, fw); + if (ret) + return ret; + + return iwm_fill_paging_mem(sc, fw); +} + +/* send paging cmd to FW in case CPU2 has paging image */ +int +iwm_send_paging_cmd(struct iwm_softc *sc, const struct iwm_fw_sects *fw) +{ + int blk_idx; + uint32_t dev_phy_addr; + struct iwm_fw_paging_cmd fw_paging_cmd = { + .flags = + htole32(IWM_PAGING_CMD_IS_SECURED | + IWM_PAGING_CMD_IS_ENABLED | + (sc->num_of_pages_in_last_blk << + IWM_PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS)), + .block_size = htole32(IWM_BLOCK_2_EXP_SIZE), + .block_num = htole32(sc->num_of_paging_blk), + }; + + /* loop for for all paging blocks + CSS block */ + for (blk_idx = 0; blk_idx < sc->num_of_paging_blk + 1; blk_idx++) { + dev_phy_addr = htole32( + sc->fw_paging_db[blk_idx].fw_paging_block.paddr >> + IWM_PAGE_2_EXP_SIZE); + fw_paging_cmd.device_phy_addr[blk_idx] = dev_phy_addr; + bus_dmamap_sync(sc->sc_dmat, + sc->fw_paging_db[blk_idx].fw_paging_block.map, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + } + + return iwm_mvm_send_cmd_pdu(sc, iwm_cmd_id(IWM_FW_PAGING_BLOCK_CMD, + IWM_ALWAYS_LONG_GROUP, 0), + 0, sizeof(fw_paging_cmd), &fw_paging_cmd); +} Copied: stable/11/sys/dev/iwm/if_iwm_fw.h (from r314209, head/sys/dev/iwm/if_iwm_fw.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_fw.h Thu Mar 1 06:22:14 2018 (r330192, copy of r314209, head/sys/dev/iwm/if_iwm_fw.h) @@ -0,0 +1,113 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 4.7.3 (tag id d7f6728f57e3ecbb7ef34eb7d9f564d514775d75) + * + *********************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * $FreeBSD$ + */ +#ifndef __IF_IWM_FW_H__ +#define __IF_IWM_FW_H__ + +/* + * Block paging calculations + */ +#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */ +#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */ +#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3 +/* 8 pages per group */ +#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE) +/* don't change, support only 32KB size */ +#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE) +/* 32K == 2^15 */ +#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + IWM_PAGE_PER_GROUP_2_EXP_SIZE) + +/* + * Image paging calculations + */ +#define IWM_BLOCK_PER_IMAGE_2_EXP_SIZE 5 +/* 2^5 == 32 blocks per image */ +#define IWM_NUM_OF_BLOCK_PER_IMAGE (1 << IWM_BLOCK_PER_IMAGE_2_EXP_SIZE) +/* maximum image size 1024KB */ +#define IWM_MAX_PAGING_IMAGE_SIZE (IWM_NUM_OF_BLOCK_PER_IMAGE * IWM_PAGING_BLOCK_SIZE) + +/* Virtual address signature */ +#define IWM_PAGING_ADDR_SIG 0xAA000000 + +#define IWM_PAGING_CMD_IS_SECURED (1 << 9) +#define IWM_PAGING_CMD_IS_ENABLED (1 << 8) +#define IWM_PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS 0 +#define IWM_PAGING_TLV_SECURE_MASK 1 + +extern void iwm_free_fw_paging(struct iwm_softc *); +extern int iwm_save_fw_paging(struct iwm_softc *, const struct iwm_fw_sects *); +extern int iwm_send_paging_cmd(struct iwm_softc *, const struct iwm_fw_sects *); + +#endif /* __IF_IWM_FW_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:22:14 2018 (r330192) @@ -888,28 +888,6 @@ struct iwm_fw_cipher_scheme { uint8_t hw_cipher; } __packed; -/* - * Block paging calculations - */ -#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */ -#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */ -#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3 -/* 8 pages per group */ -#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE) -/* don't change, support only 32KB size */ -#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE) -/* 32K == 2^15 */ -#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + IWM_PAGE_PER_GROUP_2_EXP_SIZE) - -/* - * Image paging calculations - */ -#define IWM_BLOCK_PER_IMAGE_2_EXP_SIZE 5 -/* 2^5 == 32 blocks per image */ -#define IWM_NUM_OF_BLOCK_PER_IMAGE (1 << IWM_BLOCK_PER_IMAGE_2_EXP_SIZE) -/* maximum image size 1024KB */ -#define IWM_MAX_PAGING_IMAGE_SIZE (IWM_NUM_OF_BLOCK_PER_IMAGE * IWM_PAGING_BLOCK_SIZE) - /** * struct iwm_fw_cscheme_list - a cipher scheme list * @size: a number of entries @@ -1842,12 +1820,8 @@ enum { IWM_LQ_CMD = 0x4e, - /* Calibration */ - IWM_TEMPERATURE_NOTIFICATION = 0x62, - IWM_CALIBRATION_CFG_CMD = 0x65, - IWM_CALIBRATION_RES_NOTIFICATION = 0x66, - IWM_CALIBRATION_COMPLETE_NOTIFICATION = 0x67, - IWM_RADIO_VERSION_NOTIFICATION = 0x68, + /* paging block to FW cpu2 */ + IWM_FW_PAGING_BLOCK_CMD = 0x4f, /* Scan offload */ IWM_SCAN_OFFLOAD_REQUEST_CMD = 0x51, @@ -2091,6 +2065,44 @@ struct iwm_nvm_access_cmd { uint16_t length; uint8_t data[]; } __packed; /* IWM_NVM_ACCESS_CMD_API_S_VER_2 */ + +#define IWM_NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */ + +/* + * struct iwm_fw_paging_cmd - paging layout + * + * (IWM_FW_PAGING_BLOCK_CMD = 0x4f) + * + * Send to FW the paging layout in the driver. + * + * @flags: various flags for the command + * @block_size: the block size in powers of 2 + * @block_num: number of blocks specified in the command. + * @device_phy_addr: virtual addresses from device side +*/ +struct iwm_fw_paging_cmd { + uint32_t flags; + uint32_t block_size; + uint32_t block_num; + uint32_t device_phy_addr[IWM_NUM_OF_FW_PAGING_BLOCKS]; +} __packed; /* IWM_FW_PAGING_BLOCK_CMD_API_S_VER_1 */ + +/* + * Fw items ID's + * + * @IWM_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload + * download + */ +enum iwm_fw_item_id { + IWM_FW_ITEM_ID_PAGING = 3, +}; + +/* + * struct iwm_fw_get_item_cmd - get an item from the fw + */ +struct iwm_fw_get_item_cmd { + uint32_t item_id; +} __packed; /* IWM_FW_GET_ITEM_CMD_API_S_VER_1 */ /** * struct iwm_nvm_access_resp_ver2 - response to IWM_NVM_ACCESS_CMD Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:22:14 2018 (r330192) @@ -246,6 +246,16 @@ struct iwm_dma_info { bus_size_t size; }; +/** + * struct iwm_fw_paging + * @fw_paging_block: dma memory info + * @fw_paging_size: page size + */ +struct iwm_fw_paging { + struct iwm_dma_info fw_paging_block; + uint32_t fw_paging_size; +}; + #define IWM_TX_RING_COUNT 256 #define IWM_TX_RING_LOMARK 192 #define IWM_TX_RING_HIMARK 224 @@ -499,6 +509,14 @@ struct iwm_softc { uint32_t log_event_table; uint32_t umac_error_event_table; int support_umac_log; + + /* + * Paging parameters - All of the parameters should be set by the + * opmode when paging is enabled + */ + struct iwm_fw_paging fw_paging_db[IWM_NUM_OF_FW_PAGING_BLOCKS]; + uint16_t num_of_paging_blk; + uint16_t num_of_pages_in_last_blk; }; #define IWM_LOCK_INIT(_sc) \ Modified: stable/11/sys/modules/iwm/Makefile ============================================================================== --- stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:22:14 2018 (r330192) @@ -7,7 +7,7 @@ KMOD= if_iwm SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c -SRCS+= if_iwm_7000.c if_iwm_8000.c +SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_fw.c # bus layer SRCS+= if_iwm_pcie_trans.c SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h From owner-svn-src-all@freebsd.org Thu Mar 1 06:24:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04C04F27CBD; Thu, 1 Mar 2018 06:24:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4162682E9; Thu, 1 Mar 2018 06:24:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EECC24C36; Thu, 1 Mar 2018 06:24:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216O38G052862; Thu, 1 Mar 2018 06:24:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216O3RP052861; Thu, 1 Mar 2018 06:24:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010624.w216O3RP052861@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 06:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330193 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:24:04 -0000 Author: eadler Date: Thu Mar 1 06:24:03 2018 New Revision: 330193 URL: https://svnweb.freebsd.org/changeset/base/330193 Log: MFC r315777: [iwm] Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:22:14 2018 (r330192) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:24:03 2018 (r330193) @@ -324,8 +324,7 @@ static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_data *); static int iwm_get_noise(struct iwm_softc *sc, const struct iwm_mvm_statistics_rx_non_phy *); -static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *, - struct iwm_rx_data *); +static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); @@ -3160,30 +3159,26 @@ iwm_get_noise(struct iwm_softc *sc, * Handles the actual data of the Rx packet from the fw */ static void -iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, - struct iwm_rx_packet *pkt, struct iwm_rx_data *data) +iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_frame *wh; struct ieee80211_node *ni; struct ieee80211_rx_stats rxs; - struct mbuf *m; struct iwm_rx_phy_info *phy_info; struct iwm_rx_mpdu_res_start *rx_res; + struct iwm_rx_packet *pkt = mtod(m, struct iwm_rx_packet *); uint32_t len; uint32_t rx_pkt_status; int rssi; - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - phy_info = &sc->sc_last_phy_info; rx_res = (struct iwm_rx_mpdu_res_start *)pkt->data; wh = (struct ieee80211_frame *)(pkt->data + sizeof(*rx_res)); len = le16toh(rx_res->byte_count); rx_pkt_status = le32toh(*(uint32_t *)(pkt->data + sizeof(*rx_res) + len)); - m = data->m; m->m_data = pkt->data + sizeof(*rx_res); m->m_pkthdr.len = m->m_len = len; @@ -5391,7 +5386,7 @@ iwm_notif_intr(struct iwm_softc *sc) break; case IWM_REPLY_RX_MPDU_CMD: - iwm_mvm_rx_rx_mpdu(sc, pkt, data); + iwm_mvm_rx_rx_mpdu(sc, data->m); break; case IWM_TX_CMD: @@ -5434,7 +5429,8 @@ iwm_notif_intr(struct iwm_softc *sc) } } - break; } + break; + } case IWM_MFUART_LOAD_NOTIFICATION: break; @@ -5450,7 +5446,8 @@ iwm_notif_intr(struct iwm_softc *sc) stats = (void *)pkt->data; memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); - break; } + break; + } case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: @@ -5470,7 +5467,8 @@ iwm_notif_intr(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_RESET, "fw source %d sent CC '%s'\n", notif->source_id, sc->sc_fw_mcc); - break; } + break; + } case IWM_DTS_MEASUREMENT_NOTIFICATION: case IWM_WIDE_ID(IWM_PHY_OPS_GROUP, From owner-svn-src-all@freebsd.org Thu Mar 1 06:25:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1195F27E25; Thu, 1 Mar 2018 06:25:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 656E868585; Thu, 1 Mar 2018 06:25:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 606AD24C3C; Thu, 1 Mar 2018 06:25:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216P3U6052946; Thu, 1 Mar 2018 06:25:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216P3vU052945; Thu, 1 Mar 2018 06:25:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010625.w216P3vU052945@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 06:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330194 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:25:04 -0000 Author: eadler Date: Thu Mar 1 06:25:03 2018 New Revision: 330194 URL: https://svnweb.freebsd.org/changeset/base/330194 Log: MFC r315778: [iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu(). * This avoids leaving the mbuf in a weird state, when dropping a packet. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:24:03 2018 (r330193) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:25:03 2018 (r330194) @@ -3179,9 +3179,6 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * len = le16toh(rx_res->byte_count); rx_pkt_status = le32toh(*(uint32_t *)(pkt->data + sizeof(*rx_res) + len)); - m->m_data = pkt->data + sizeof(*rx_res); - m->m_pkthdr.len = m->m_len = len; - if (__predict_false(phy_info->cfg_phy_cnt > 20)) { device_printf(sc->sc_dev, "dsp size out of range [0,20]: %d\n", @@ -3217,6 +3214,9 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * __func__); goto fail; } + + m->m_data = pkt->data + sizeof(*rx_res); + m->m_pkthdr.len = m->m_len = len; IWM_DPRINTF(sc, IWM_DEBUG_RECV, "%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise); From owner-svn-src-all@freebsd.org Thu Mar 1 06:27:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35029F28158; Thu, 1 Mar 2018 06:27:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4C6268A40; Thu, 1 Mar 2018 06:27:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF74A24C44; Thu, 1 Mar 2018 06:27:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216RAuH053073; Thu, 1 Mar 2018 06:27:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216RAtN053069; Thu, 1 Mar 2018 06:27:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010627.w216RAtN053069@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 06:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330195 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:27:11 -0000 Author: eadler Date: Thu Mar 1 06:27:10 2018 New Revision: 330195 URL: https://svnweb.freebsd.org/changeset/base/330195 Log: MFC r315780: [iwm] Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags. * All the supported firmwares have these flags set. * This removes the following flags: IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT, IWM_UCODE_TLV_FLAGS_NEWBT_COEX, IWM_UCODE_TLV_FLAGS_BF_UPDATED, IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API, IWM_UCODE_TLV_FLAGS_STA_KEY_CMD, IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD, IWM_UCODE_TLV_FLAGS_SCHED_SCAN, IWM_UCODE_TLV_FLAGS_RX_ENERGY_API, IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2 * Also remove definitions and code for dealing with the v1 time-event api. * Remove unneeded calc_rssi() function. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_power.c stable/11/sys/dev/iwm/if_iwm_time_event.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:25:03 2018 (r330194) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:27:10 2018 (r330195) @@ -316,7 +316,6 @@ static int iwm_mvm_load_ucode_wait_alive(struct iwm_so enum iwm_ucode_type); static int iwm_run_init_mvm_ucode(struct iwm_softc *, int); static int iwm_rx_addbuf(struct iwm_softc *, int, int); -static int iwm_mvm_calc_rssi(struct iwm_softc *, struct iwm_rx_phy_info *); static int iwm_mvm_get_signal_strength(struct iwm_softc *, struct iwm_rx_phy_info *); static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, @@ -345,7 +344,7 @@ static int iwm_raw_xmit(struct ieee80211_node *, struc static int iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags); static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *, - struct iwm_mvm_add_sta_cmd_v7 *, + struct iwm_mvm_add_sta_cmd *, int *); static int iwm_mvm_sta_send_to_fw(struct iwm_softc *, struct iwm_node *, int); @@ -867,12 +866,6 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode "section type %d\n", error, tlv_type); } - if (!(sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT)) { - device_printf(sc->sc_dev, - "device uses unsupported power ops\n"); - error = ENOTSUP; - } - out: if (error) { fw->fw_status = IWM_FW_STATUS_NONE; @@ -3043,38 +3036,6 @@ fail: } /* iwlwifi: mvm/rx.c */ -#define IWM_RSSI_OFFSET 50 -static int -iwm_mvm_calc_rssi(struct iwm_softc *sc, struct iwm_rx_phy_info *phy_info) -{ - int rssi_a, rssi_b, rssi_a_dbm, rssi_b_dbm, max_rssi_dbm; - uint32_t agc_a, agc_b; - uint32_t val; - - val = le32toh(phy_info->non_cfg_phy[IWM_RX_INFO_AGC_IDX]); - agc_a = (val & IWM_OFDM_AGC_A_MSK) >> IWM_OFDM_AGC_A_POS; - agc_b = (val & IWM_OFDM_AGC_B_MSK) >> IWM_OFDM_AGC_B_POS; - - val = le32toh(phy_info->non_cfg_phy[IWM_RX_INFO_RSSI_AB_IDX]); - rssi_a = (val & IWM_OFDM_RSSI_INBAND_A_MSK) >> IWM_OFDM_RSSI_A_POS; - rssi_b = (val & IWM_OFDM_RSSI_INBAND_B_MSK) >> IWM_OFDM_RSSI_B_POS; - - /* - * dBm = rssi dB - agc dB - constant. - * Higher AGC (higher radio gain) means lower signal. - */ - rssi_a_dbm = rssi_a - IWM_RSSI_OFFSET - agc_a; - rssi_b_dbm = rssi_b - IWM_RSSI_OFFSET - agc_b; - max_rssi_dbm = MAX(rssi_a_dbm, rssi_b_dbm); - - IWM_DPRINTF(sc, IWM_DEBUG_RECV, - "Rssi In A %d B %d Max %d AGCA %d AGCB %d\n", - rssi_a_dbm, rssi_b_dbm, max_rssi_dbm, agc_a, agc_b); - - return max_rssi_dbm; -} - -/* iwlwifi: mvm/rx.c */ /* * iwm_mvm_get_signal_strength - use new rx PHY INFO API * values are reported by the fw as positive values - need to negate @@ -3193,18 +3154,8 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * goto fail; } - if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_RX_ENERGY_API) { - rssi = iwm_mvm_get_signal_strength(sc, phy_info); - } else { - rssi = iwm_mvm_calc_rssi(sc, phy_info); - } + rssi = iwm_mvm_get_signal_strength(sc, phy_info); - /* Note: RSSI is absolute (ie a -ve value) */ - if (rssi < IWM_MIN_DBM) - rssi = IWM_MIN_DBM; - else if (rssi > IWM_MAX_DBM) - rssi = IWM_MAX_DBM; - /* Map it to relative value */ rssi = rssi - sc->sc_noise; @@ -3867,7 +3818,7 @@ iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t t static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *sc, - struct iwm_mvm_add_sta_cmd_v7 *cmd, int *status) + struct iwm_mvm_add_sta_cmd *cmd, int *status) { return iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, sizeof(*cmd), cmd, status); @@ -3877,7 +3828,7 @@ iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *sc, static int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, int update) { - struct iwm_mvm_add_sta_cmd_v7 add_sta_cmd; + struct iwm_mvm_add_sta_cmd add_sta_cmd; int ret; uint32_t status; @@ -3935,7 +3886,7 @@ static int iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struct iwm_int_sta *sta, const uint8_t *addr, uint16_t mac_id, uint16_t color) { - struct iwm_mvm_add_sta_cmd_v7 cmd; + struct iwm_mvm_add_sta_cmd cmd; int ret; uint32_t status; Modified: stable/11/sys/dev/iwm/if_iwm_power.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:25:03 2018 (r330194) +++ stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:27:10 2018 (r330195) @@ -290,9 +290,6 @@ iwm_mvm_power_update_device(struct iwm_softc *sc) .flags = htole16(IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK), }; - if (!(sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD)) - return 0; - cmd.flags |= htole16(IWM_DEVICE_POWER_FLAGS_CAM_MSK); IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, "Sending device power command with flags = 0x%X\n", cmd.flags); @@ -322,12 +319,8 @@ iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, str int iwm_mvm_disable_beacon_filter(struct iwm_softc *sc) { - struct iwm_beacon_filter_cmd cmd; + struct iwm_beacon_filter_cmd cmd = {}; int ret; - - memset(&cmd, 0, sizeof(cmd)); - if ((sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_BF_UPDATED) == 0) - return 0; ret = iwm_mvm_beacon_filter_send_cmd(sc, &cmd); if (ret == 0) Modified: stable/11/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 06:25:03 2018 (r330194) +++ stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 06:27:10 2018 (r330195) @@ -164,77 +164,17 @@ __FBSDID("$FreeBSD$"); #define IWM_MVM_ROC_TE_TYPE_NORMAL IWM_TE_P2P_DEVICE_DISCOVERABLE #define IWM_MVM_ROC_TE_TYPE_MGMT_TX IWM_TE_P2P_CLIENT_ASSOC -/* used to convert from time event API v2 to v1 */ -#define IWM_TE_V2_DEP_POLICY_MSK (IWM_TE_V2_DEP_OTHER | IWM_TE_V2_DEP_TSF |\ - IWM_TE_V2_EVENT_SOCIOPATHIC) -static inline uint16_t -iwm_te_v2_get_notify(uint16_t policy) -{ - return le16toh(policy) & IWM_TE_V2_NOTIF_MSK; -} - -static inline uint16_t -iwm_te_v2_get_dep_policy(uint16_t policy) -{ - return (le16toh(policy) & IWM_TE_V2_DEP_POLICY_MSK) >> - IWM_TE_V2_PLACEMENT_POS; -} - -static inline uint16_t -iwm_te_v2_get_absence(uint16_t policy) -{ - return (le16toh(policy) & IWM_TE_V2_ABSENCE) >> IWM_TE_V2_ABSENCE_POS; -} - -static void -iwm_mvm_te_v2_to_v1(const struct iwm_time_event_cmd_v2 *cmd_v2, - struct iwm_time_event_cmd_v1 *cmd_v1) -{ - cmd_v1->id_and_color = cmd_v2->id_and_color; - cmd_v1->action = cmd_v2->action; - cmd_v1->id = cmd_v2->id; - cmd_v1->apply_time = cmd_v2->apply_time; - cmd_v1->max_delay = cmd_v2->max_delay; - cmd_v1->depends_on = cmd_v2->depends_on; - cmd_v1->interval = cmd_v2->interval; - cmd_v1->duration = cmd_v2->duration; - if (cmd_v2->repeat == IWM_TE_V2_REPEAT_ENDLESS) - cmd_v1->repeat = htole32(IWM_TE_V1_REPEAT_ENDLESS); - else - cmd_v1->repeat = htole32(cmd_v2->repeat); - cmd_v1->max_frags = htole32(cmd_v2->max_frags); - cmd_v1->interval_reciprocal = 0; /* unused */ - - cmd_v1->dep_policy = htole32(iwm_te_v2_get_dep_policy(cmd_v2->policy)); - cmd_v1->is_present = htole32(!iwm_te_v2_get_absence(cmd_v2->policy)); - cmd_v1->notify = htole32(iwm_te_v2_get_notify(cmd_v2->policy)); -} - static int -iwm_mvm_send_time_event_cmd(struct iwm_softc *sc, - const struct iwm_time_event_cmd_v2 *cmd) -{ - struct iwm_time_event_cmd_v1 cmd_v1; - - if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2) - return iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, - IWM_CMD_SYNC, sizeof(*cmd), cmd); - - iwm_mvm_te_v2_to_v1(cmd, &cmd_v1); - return iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, IWM_CMD_SYNC, - sizeof(cmd_v1), &cmd_v1); -} - -static int iwm_mvm_time_event_send_add(struct iwm_softc *sc, struct iwm_node *in, - void *te_data, struct iwm_time_event_cmd_v2 *te_cmd) + void *te_data, struct iwm_time_event_cmd *te_cmd) { int ret; IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "Add new TE, duration %d TU\n", le32toh(te_cmd->duration)); - ret = iwm_mvm_send_time_event_cmd(sc, te_cmd); + ret = iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, IWM_CMD_SYNC, + sizeof(*te_cmd), te_cmd); if (ret) { IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "%s: Couldn't send IWM_TIME_EVENT_CMD: %d\n", @@ -248,9 +188,7 @@ void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, uint32_t duration, uint32_t max_delay) { - struct iwm_time_event_cmd_v2 time_cmd; - - memset(&time_cmd, 0, sizeof(time_cmd)); + struct iwm_time_event_cmd time_cmd = {}; time_cmd.action = htole32(IWM_FW_CTXT_ACTION_ADD); time_cmd.id_and_color = Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:25:03 2018 (r330194) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:27:10 2018 (r330195) @@ -611,21 +611,12 @@ enum iwm_dtd_diode_reg { * @IWM_UCODE_TLV_FLAGS_UAPSD: This uCode image supports uAPSD * @IWM_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of black list instead of 64 in scan * offload profile config command. - * @IWM_UCODE_TLV_FLAGS_RX_ENERGY_API: supports rx signal strength api - * @IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2: using the new time event API. * @IWM_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS: D3 image supports up to six * (rather than two) IPv6 addresses - * @IWM_UCODE_TLV_FLAGS_BF_UPDATED: new beacon filtering API * @IWM_UCODE_TLV_FLAGS_NO_BASIC_SSID: not sending a probe with the SSID element * from the probe request template. - * @IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API: modified D3 API to allow keeping - * connection when going back to D0 * @IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL: new NS offload (small version) * @IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version) - * @IWM_UCODE_TLV_FLAGS_SCHED_SCAN: this uCode image supports scheduled scan. - * @IWM_UCODE_TLV_FLAGS_STA_KEY_CMD: new ADD_STA and ADD_STA_KEY command API - * @IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD: support device wide power command - * containing CAM (Continuous Active Mode) indication. * @IWM_UCODE_TLV_FLAGS_P2P_PS: P2P client power save is supported (only on a * single bound interface). * @IWM_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD @@ -641,20 +632,11 @@ enum iwm_ucode_tlv_flag { IWM_UCODE_TLV_FLAGS_MFP = (1 << 2), IWM_UCODE_TLV_FLAGS_P2P = (1 << 3), IWM_UCODE_TLV_FLAGS_DW_BC_TABLE = (1 << 4), - IWM_UCODE_TLV_FLAGS_NEWBT_COEX = (1 << 5), - IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT = (1 << 6), IWM_UCODE_TLV_FLAGS_SHORT_BL = (1 << 7), - IWM_UCODE_TLV_FLAGS_RX_ENERGY_API = (1 << 8), - IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2 = (1 << 9), IWM_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS = (1 << 10), - IWM_UCODE_TLV_FLAGS_BF_UPDATED = (1 << 11), IWM_UCODE_TLV_FLAGS_NO_BASIC_SSID = (1 << 12), - IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API = (1 << 14), IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL = (1 << 15), IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE = (1 << 16), - IWM_UCODE_TLV_FLAGS_SCHED_SCAN = (1 << 17), - IWM_UCODE_TLV_FLAGS_STA_KEY_CMD = (1 << 19), - IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD = (1 << 20), IWM_UCODE_TLV_FLAGS_P2P_PS = (1 << 21), IWM_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM = (1 << 22), IWM_UCODE_TLV_FLAGS_BSS_P2P_PS_SCM = (1 << 23), @@ -2390,53 +2372,8 @@ enum { IWM_T2_V2_START_IMMEDIATELY = (1 << 11), }; /* IWM_MAC_EVENT_ACTION_API_E_VER_2 */ +/* Time event - defines for command API */ -/** - * struct iwm_time_event_cmd_api_v1 - configuring Time Events - * with struct IWM_MAC_TIME_EVENT_DATA_API_S_VER_1 (see also - * with version 2. determined by IWM_UCODE_TLV_FLAGS) - * ( IWM_TIME_EVENT_CMD = 0x29 ) - * @id_and_color: ID and color of the relevant MAC - * @action: action to perform, one of IWM_FW_CTXT_ACTION_* - * @id: this field has two meanings, depending on the action: - * If the action is ADD, then it means the type of event to add. - * For all other actions it is the unique event ID assigned when the - * event was added by the FW. - * @apply_time: When to start the Time Event (in GP2) - * @max_delay: maximum delay to event's start (apply time), in TU - * @depends_on: the unique ID of the event we depend on (if any) - * @interval: interval between repetitions, in TU - * @interval_reciprocal: 2^32 / interval - * @duration: duration of event in TU - * @repeat: how many repetitions to do, can be IWM_TE_REPEAT_ENDLESS - * @dep_policy: one of IWM_TE_V1_INDEPENDENT, IWM_TE_V1_DEP_OTHER, IWM_TE_V1_DEP_TSF - * and IWM_TE_V1_EVENT_SOCIOPATHIC - * @is_present: 0 or 1, are we present or absent during the Time Event - * @max_frags: maximal number of fragments the Time Event can be divided to - * @notify: notifications using IWM_TE_V1_NOTIF_* (whom to notify when) - */ -struct iwm_time_event_cmd_v1 { - /* COMMON_INDEX_HDR_API_S_VER_1 */ - uint32_t id_and_color; - uint32_t action; - uint32_t id; - /* IWM_MAC_TIME_EVENT_DATA_API_S_VER_1 */ - uint32_t apply_time; - uint32_t max_delay; - uint32_t dep_policy; - uint32_t depends_on; - uint32_t is_present; - uint32_t max_frags; - uint32_t interval; - uint32_t interval_reciprocal; - uint32_t duration; - uint32_t repeat; - uint32_t notify; -} __packed; /* IWM_MAC_TIME_EVENT_CMD_API_S_VER_1 */ - - -/* Time event - defines for command API v2 */ - /* * @IWM_TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed. * @IWM_TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only @@ -2466,7 +2403,7 @@ enum { #define IWM_TE_V2_PLACEMENT_POS 12 #define IWM_TE_V2_ABSENCE_POS 15 -/* Time event policy values (for time event cmd api v2) +/* Time event policy values * A notification (both event and fragment) includes a status indicating weather * the FW was able to schedule the event or not. For fragment start/end * notification the status is always success. There is no start/end fragment @@ -2512,7 +2449,7 @@ enum { }; /** - * struct iwm_time_event_cmd_api_v2 - configuring Time Events + * struct iwm_time_event_cmd_api - configuring Time Events * with struct IWM_MAC_TIME_EVENT_DATA_API_S_VER_2 (see also * with version 1. determined by IWM_UCODE_TLV_FLAGS) * ( IWM_TIME_EVENT_CMD = 0x29 ) @@ -2535,7 +2472,7 @@ enum { * IWM_TE_EVENT_SOCIOPATHIC * using IWM_TE_ABSENCE and using IWM_TE_NOTIF_* */ -struct iwm_time_event_cmd_v2 { +struct iwm_time_event_cmd { /* COMMON_INDEX_HDR_API_S_VER_1 */ uint32_t id_and_color; uint32_t action; @@ -5690,7 +5627,7 @@ struct iwm_mvm_keyinfo { #define IWM_ADD_STA_BAID_SHIFT 8 /** - * struct iwm_mvm_add_sta_cmd_v7 - Add/modify a station in the fw's sta table. + * struct iwm_mvm_add_sta_cmd - Add/modify a station in the fw's sta table. * ( REPLY_ADD_STA = 0x18 ) * @add_modify: 1: modify existing, 0: add new station * @awake_acs: @@ -5726,7 +5663,7 @@ struct iwm_mvm_keyinfo { * ADD_STA sets up the table entry for one station, either creating a new * entry, or modifying a pre-existing one. */ -struct iwm_mvm_add_sta_cmd_v7 { +struct iwm_mvm_add_sta_cmd { uint8_t add_modify; uint8_t awake_acs; uint16_t tid_disable_tx; From owner-svn-src-all@freebsd.org Thu Mar 1 06:27:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8F6EF28240; Thu, 1 Mar 2018 06:27: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 3BD8568BE8; Thu, 1 Mar 2018 06:27:40 +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 36BD724C48; Thu, 1 Mar 2018 06:27:40 +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 w216Reu9053136; Thu, 1 Mar 2018 06:27:40 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216RdmF053133; Thu, 1 Mar 2018 06:27:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010627.w216RdmF053133@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 06:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330196 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:27:41 -0000 Author: eadler Date: Thu Mar 1 06:27:39 2018 New Revision: 330196 URL: https://svnweb.freebsd.org/changeset/base/330196 Log: MFC r315784: [iwm] Make ucode capabilities and api flags handling more like iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:27:10 2018 (r330195) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:27:39 2018 (r330196) @@ -484,6 +484,56 @@ iwm_set_default_calib(struct iwm_softc *sc, const void return 0; } +static int +iwm_set_ucode_api_flags(struct iwm_softc *sc, const uint8_t *data, + struct iwm_ucode_capabilities *capa) +{ + const struct iwm_ucode_api *ucode_api = (const void *)data; + uint32_t api_index = le32toh(ucode_api->api_index); + uint32_t api_flags = le32toh(ucode_api->api_flags); + int i; + + if (api_index >= howmany(IWM_NUM_UCODE_TLV_API, 32)) { + device_printf(sc->sc_dev, + "api flags index %d larger than supported by driver\n", + api_index); + /* don't return an error so we can load FW that has more bits */ + return 0; + } + + for (i = 0; i < 32; i++) { + if (api_flags & (1U << i)) + setbit(capa->enabled_api, i + 32 * api_index); + } + + return 0; +} + +static int +iwm_set_ucode_capabilities(struct iwm_softc *sc, const uint8_t *data, + struct iwm_ucode_capabilities *capa) +{ + const struct iwm_ucode_capa *ucode_capa = (const void *)data; + uint32_t api_index = le32toh(ucode_capa->api_index); + uint32_t api_flags = le32toh(ucode_capa->api_capa); + int i; + + if (api_index >= howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { + device_printf(sc->sc_dev, + "capa flags index %d larger than supported by driver\n", + api_index); + /* don't return an error so we can load FW that has more bits */ + return 0; + } + + for (i = 0; i < 32; i++) { + if (api_flags & (1U << i)) + setbit(capa->enabled_capa, i + 32 * api_index); + } + + return 0; +} + static void iwm_fw_info_free(struct iwm_fw_info *fw) { @@ -499,6 +549,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode struct iwm_fw_info *fw = &sc->sc_fw; const struct iwm_tlv_ucode_header *uhdr; struct iwm_ucode_tlv tlv; + struct iwm_ucode_capabilities *capa = &sc->ucode_capa; enum iwm_ucode_tlv_type tlv_type; const struct firmware *fwp; const uint8_t *data; @@ -535,9 +586,11 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode fw->fw_fp = fwp; /* (Re-)Initialize default values. */ - sc->sc_capaflags = 0; - sc->sc_capa_n_scan_channels = IWM_DEFAULT_SCAN_CHANNELS; - memset(sc->sc_enabled_capa, 0, sizeof(sc->sc_enabled_capa)); + capa->flags = 0; + capa->max_probe_length = IWM_DEFAULT_MAX_PROBE_LENGTH; + capa->n_scan_channels = IWM_DEFAULT_SCAN_CHANNELS; + memset(capa->enabled_capa, 0, sizeof(capa->enabled_capa)); + memset(capa->enabled_api, 0, sizeof(capa->enabled_api)); memset(sc->sc_fw_mcc, 0, sizeof(sc->sc_fw_mcc)); /* @@ -590,10 +643,10 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - sc->sc_capa_max_probe_len - = le32toh(*(const uint32_t *)tlv_data); + capa->max_probe_length = + le32toh(*(const uint32_t *)tlv_data); /* limit it to something sensible */ - if (sc->sc_capa_max_probe_len > + if (capa->max_probe_length > IWM_SCAN_OFFLOAD_PROBE_REQ_SIZE) { IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, "%s: IWM_UCODE_TLV_PROBE_MAX_LEN " @@ -611,7 +664,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - sc->sc_capaflags |= IWM_UCODE_TLV_FLAGS_PAN; + capa->flags |= IWM_UCODE_TLV_FLAGS_PAN; break; case IWM_UCODE_TLV_FLAGS: if (tlv_len < sizeof(uint32_t)) { @@ -633,7 +686,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode * 2) TLV_FLAGS contains TLV_FLAGS_PAN * ==> this resets TLV_PAN to itself... hnnnk */ - sc->sc_capaflags = le32toh(*(const uint32_t *)tlv_data); + capa->flags = le32toh(*(const uint32_t *)tlv_data); break; case IWM_UCODE_TLV_CSCHEME: if ((error = iwm_store_cscheme(sc, @@ -738,42 +791,26 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode break; case IWM_UCODE_TLV_API_CHANGES_SET: { - const struct iwm_ucode_api *api; - if (tlv_len != sizeof(*api)) { + if (tlv_len != sizeof(struct iwm_ucode_api)) { error = EINVAL; goto parse_out; } - api = (const struct iwm_ucode_api *)tlv_data; - /* Flags may exceed 32 bits in future firmware. */ - if (le32toh(api->api_index) > 0) { - device_printf(sc->sc_dev, - "unsupported API index %d\n", - le32toh(api->api_index)); + if (iwm_set_ucode_api_flags(sc, tlv_data, capa)) { + error = EINVAL; goto parse_out; } - sc->sc_ucode_api = le32toh(api->api_flags); break; } case IWM_UCODE_TLV_ENABLED_CAPABILITIES: { - const struct iwm_ucode_capa *capa; - int idx, i; - if (tlv_len != sizeof(*capa)) { + if (tlv_len != sizeof(struct iwm_ucode_capa)) { error = EINVAL; goto parse_out; } - capa = (const struct iwm_ucode_capa *)tlv_data; - idx = le32toh(capa->api_index); - if (idx >= howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { - device_printf(sc->sc_dev, - "unsupported API index %d\n", idx); + if (iwm_set_ucode_capabilities(sc, tlv_data, capa)) { + error = EINVAL; goto parse_out; } - for (i = 0; i < 32; i++) { - if ((le32toh(capa->api_capa) & (1U << i)) == 0) - continue; - setbit(sc->sc_enabled_capa, i + (32 * idx)); - } break; } @@ -827,8 +864,8 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - sc->sc_capa_n_scan_channels = - le32toh(*(const uint32_t *)tlv_data); + capa->n_scan_channels = + le32toh(*(const uint32_t *)tlv_data); break; case IWM_UCODE_TLV_FW_VERSION: @@ -4698,13 +4735,13 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch int n_channels; uint16_t mcc; #endif - int resp_v2 = isset(sc->sc_enabled_capa, + int resp_v2 = fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); memset(&mcc_cmd, 0, sizeof(mcc_cmd)); mcc_cmd.mcc = htole16(alpha2[0] << 8 | alpha2[1]); - if ((sc->sc_ucode_api & IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || - isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC)) + if (fw_has_api(&sc->ucode_capa, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || + fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC)) mcc_cmd.source_id = IWM_MCC_SOURCE_GET_CURRENT; else mcc_cmd.source_id = IWM_MCC_SOURCE_OLD_FW; @@ -4842,12 +4879,12 @@ iwm_init_hw(struct iwm_softc *sc) if (error) goto error; - if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT)) { + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT)) { if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) goto error; } - if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { if ((error = iwm_mvm_config_umac_scan(sc)) != 0) goto error; } @@ -6246,7 +6283,7 @@ iwm_scan_start(struct ieee80211com *ic) device_printf(sc->sc_dev, "%s: Previous scan not completed yet\n", __func__); } - if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) error = iwm_mvm_umac_scan(sc); else error = iwm_mvm_lmac_scan(sc); Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 06:27:10 2018 (r330195) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 06:27:39 2018 (r330196) @@ -272,7 +272,7 @@ iwm_mvm_lmac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->sc_capa_n_scan_channels; j++) { + j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { c = &ic->ic_channels[j]; /* For 2GHz, only populate 11b channels */ /* For 5GHz, only populate 11a channels */ @@ -316,7 +316,7 @@ iwm_mvm_umac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->sc_capa_n_scan_channels; j++) { + j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { c = &ic->ic_channels[j]; /* For 2GHz, only populate 11b channels */ /* For 5GHz, only populate 11a channels */ @@ -398,7 +398,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *sc, struct iw preq->band_data[0].len = htole16(frm - pos); remain -= frm - pos; - if (isset(sc->sc_enabled_capa, + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) { if (remain < 3) return ENOBUFS; @@ -464,7 +464,7 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) IWM_SCAN_CONFIG_RATE_36M | IWM_SCAN_CONFIG_RATE_48M | IWM_SCAN_CONFIG_RATE_54M); - cmd_size = sizeof(*scan_config) + sc->sc_capa_n_scan_channels; + cmd_size = sizeof(*scan_config) + sc->ucode_capa.n_scan_channels; scan_config = malloc(cmd_size, M_DEVBUF, M_NOWAIT | M_ZERO); if (scan_config == NULL) @@ -492,7 +492,7 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) IWM_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->sc_capa_n_scan_channels; j++) { + j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { c = &ic->ic_channels[j]; /* For 2GHz, only populate 11b channels */ /* For 5GHz, only populate 11a channels */ @@ -550,7 +550,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) req_len = sizeof(struct iwm_scan_req_umac) + (sizeof(struct iwm_scan_channel_cfg_umac) * - sc->sc_capa_n_scan_channels) + + sc->ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_req_umac_tail); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; @@ -584,7 +584,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) tail = (void *)((char *)&req->data + sizeof(struct iwm_scan_channel_cfg_umac) * - sc->sc_capa_n_scan_channels); + sc->ucode_capa.n_scan_channels); /* Check if we're doing an active directed scan. */ for (i = 0; i < nssid; i++) { @@ -601,7 +601,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) } else req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASSIVE); - if (isset(sc->sc_enabled_capa, + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED); @@ -644,7 +644,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req_len = sizeof(struct iwm_scan_req_lmac) + (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->sc_capa_n_scan_channels) + sizeof(struct iwm_scan_probe_req); + sc->ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_probe_req); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; req = malloc(req_len, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -670,7 +670,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req->scan_flags = htole32(IWM_MVM_LMAC_SCAN_FLAG_PASS_ALL | IWM_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE | IWM_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL); - if (isset(sc->sc_enabled_capa, + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); @@ -716,7 +716,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) ret = iwm_mvm_fill_probe_req(sc, (struct iwm_scan_probe_req *)(req->data + (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->sc_capa_n_scan_channels))); + sc->ucode_capa.n_scan_channels))); if (ret) { free(req, M_DEVBUF); return ret; @@ -804,7 +804,7 @@ iwm_mvm_scan_stop_wait(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Preparing to stop scan\n"); - if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) ret = iwm_mvm_umac_scan_abort(sc); else ret = iwm_mvm_lmac_scan_abort(sc); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:27:10 2018 (r330195) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:27:39 2018 (r330196) @@ -166,6 +166,28 @@ enum iwm_ucode_type { IWM_UCODE_TYPE_MAX }; +struct iwm_ucode_capabilities { + uint32_t max_probe_length; + uint32_t n_scan_channels; + uint32_t flags; + uint8_t enabled_api[howmany(IWM_NUM_UCODE_TLV_API, NBBY)]; + uint8_t enabled_capa[howmany(IWM_NUM_UCODE_TLV_CAPA, NBBY)]; +}; + +static inline int +fw_has_api(const struct iwm_ucode_capabilities *capabilities, + unsigned int api) +{ + return isset(capabilities->enabled_api, api); +} + +static inline int +fw_has_capa(const struct iwm_ucode_capabilities *capabilities, + unsigned int capa) +{ + return isset(capabilities->enabled_capa, capa); +} + /* one for each uCode image (inst/data, init/runtime/wowlan) */ struct iwm_fw_desc { const void *data; /* vmalloc'ed data */ @@ -439,12 +461,8 @@ struct iwm_softc { int ucode_loaded; char sc_fwver[32]; - int sc_capaflags; - int sc_capa_max_probe_len; - int sc_capa_n_scan_channels; - uint32_t sc_ucode_api; - uint8_t sc_enabled_capa[howmany(IWM_NUM_UCODE_TLV_CAPA, NBBY)]; - char sc_fw_mcc[3]; + struct iwm_ucode_capabilities ucode_capa; + char sc_fw_mcc[3]; int sc_intmask; From owner-svn-src-all@freebsd.org Thu Mar 1 06:29:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2F83F28458; Thu, 1 Mar 2018 06:29:02 +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 7660C68F6C; Thu, 1 Mar 2018 06:29:02 +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 713A524C4C; Thu, 1 Mar 2018 06:29:02 +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 w216T27j053224; Thu, 1 Mar 2018 06:29:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216T2FX053223; Thu, 1 Mar 2018 06:29:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010629.w216T2FX053223@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 06:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330197 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:29:03 -0000 Author: eadler Date: Thu Mar 1 06:29:02 2018 New Revision: 330197 URL: https://svnweb.freebsd.org/changeset/base/330197 Log: MFC r315923: [iwm] Tiny cleanup in iwm_rx_addbuf(). Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:27:39 2018 (r330196) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:29:02 2018 (r330197) @@ -3032,7 +3032,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) struct iwm_rx_ring *ring = &sc->rxq; struct iwm_rx_data *data = &ring->data[idx]; struct mbuf *m; - bus_dmamap_t dmamap = NULL; + bus_dmamap_t dmamap; bus_dma_segment_t seg; int nsegs, error; @@ -3046,7 +3046,8 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) if (error != 0) { device_printf(sc->sc_dev, "%s: can't map mbuf, error %d\n", __func__, error); - goto fail; + m_freem(m); + return error; } if (data->m != NULL) @@ -3067,9 +3068,6 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) BUS_DMASYNC_PREWRITE); return 0; -fail: - m_freem(m); - return error; } /* iwlwifi: mvm/rx.c */ From owner-svn-src-all@freebsd.org Thu Mar 1 06:31:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25E40F288FC; Thu, 1 Mar 2018 06:31:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6090694A1; Thu, 1 Mar 2018 06:31:07 +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 C103F24D74; Thu, 1 Mar 2018 06:31:07 +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 w216V76D053377; Thu, 1 Mar 2018 06:31:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216V75i053374; Thu, 1 Mar 2018 06:31:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010631.w216V75i053374@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 06:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330198 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:31:08 -0000 Author: eadler Date: Thu Mar 1 06:31:07 2018 New Revision: 330198 URL: https://svnweb.freebsd.org/changeset/base/330198 Log: MFC r315926: [iwm] Add the BSS's basic rates to iwm's LQ command, not all the rates. Makes the firmware use appropriate Tx rates for ACKs. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:29:02 2018 (r330197) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:31:07 2018 (r330198) @@ -4276,6 +4276,21 @@ iwm_node_alloc(struct ieee80211vap *vap, const uint8_t M_NOWAIT | M_ZERO); } +uint8_t +iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx) +{ + int i; + uint8_t rval; + + for (i = 0; i < rs->rs_nrates; i++) { + rval = (rs->rs_rates[i] & IEEE80211_RATE_VAL); + if (rval == iwm_rates[ridx].rate) + return rs->rs_rates[i]; + } + + return 0; +} + static void iwm_setrates(struct iwm_softc *sc, struct iwm_node *in) { Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:29:02 2018 (r330197) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:31:07 2018 (r330198) @@ -162,24 +162,28 @@ __FBSDID("$FreeBSD$"); static void iwm_mvm_ack_rates(struct iwm_softc *sc, int is2ghz, - int *cck_rates, int *ofdm_rates) + int *cck_rates, int *ofdm_rates, struct iwm_node *in) { int lowest_present_ofdm = 100; int lowest_present_cck = 100; uint8_t cck = 0; uint8_t ofdm = 0; int i; + struct ieee80211_rateset *rs = &in->in_ni.ni_rates; if (is2ghz) { - for (i = 0; i <= IWM_LAST_CCK_RATE; i++) { + for (i = IWM_FIRST_CCK_RATE; i <= IWM_LAST_CCK_RATE; i++) { + if ((iwm_ridx2rate(rs, i) & IEEE80211_RATE_BASIC) == 0) + continue; cck |= (1 << i); if (lowest_present_cck > i) lowest_present_cck = i; } } for (i = IWM_FIRST_OFDM_RATE; i <= IWM_LAST_NON_HT_RATE; i++) { - int adj = i - IWM_FIRST_OFDM_RATE; - ofdm |= (1 << adj); + if ((iwm_ridx2rate(rs, i) & IEEE80211_RATE_BASIC) == 0) + continue; + ofdm |= (1 << (i - IWM_FIRST_OFDM_RATE)); if (lowest_present_ofdm > i) lowest_present_ofdm = i; } @@ -307,7 +311,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru } else { is2ghz = 1; } - iwm_mvm_ack_rates(sc, is2ghz, &cck_ack_rates, &ofdm_ack_rates); + iwm_mvm_ack_rates(sc, is2ghz, &cck_ack_rates, &ofdm_ack_rates, in); cmd->cck_rates = htole32(cck_ack_rates); cmd->ofdm_rates = htole32(ofdm_ack_rates); @@ -446,12 +450,10 @@ iwm_mvm_mac_ctxt_cmd_station(struct iwm_softc *sc, str { struct ieee80211_node *ni = vap->iv_bss; struct iwm_node *in = IWM_NODE(ni); - struct iwm_mac_ctx_cmd cmd; + struct iwm_mac_ctx_cmd cmd = {}; IWM_DPRINTF(sc, IWM_DEBUG_RESET, "%s: called; action=%d\n", __func__, action); - - memset(&cmd, 0, sizeof(cmd)); /* Fill the common data for all mac context types */ iwm_mvm_mac_ctxt_cmd_common(sc, in, &cmd, action); Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:29:02 2018 (r330197) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:31:07 2018 (r330198) @@ -120,6 +120,8 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, str bus_size_t size, bus_size_t alignment); extern void iwm_dma_contig_free(struct iwm_dma_info *); +extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); + static inline uint8_t iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc) { From owner-svn-src-all@freebsd.org Thu Mar 1 06:32:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B40EF28BDA; Thu, 1 Mar 2018 06:32:47 +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 2D6EF69A94; Thu, 1 Mar 2018 06:32:47 +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 2860024DE8; Thu, 1 Mar 2018 06:32:47 +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 w216Wl4e057824; Thu, 1 Mar 2018 06:32:47 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216WkCj057822; Thu, 1 Mar 2018 06:32:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010632.w216WkCj057822@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 06:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330199 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:32:47 -0000 Author: eadler Date: Thu Mar 1 06:32:46 2018 New Revision: 330199 URL: https://svnweb.freebsd.org/changeset/base/330199 Log: MFC r318002: [iwm] iwm_{read,write}_prph() don't grab the nic lock in iwm themselves. * Fix a couple of cases where the nic lock ended up not being grabbed during an iwm_read_prph() or iwm_write_prph(). Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:31:07 2018 (r330198) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:32:46 2018 (r330199) @@ -1293,9 +1293,9 @@ iwm_stop_device(struct iwm_softc *sc) /* stop tx and rx. tx and rx bits, as usual, are from if_iwn */ - iwm_write_prph(sc, IWM_SCD_TXFACT, 0); - if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_SCD_TXFACT, 0); + /* Stop each Tx DMA channel */ for (chnl = 0; chnl < IWM_FH_TCSR_CHNL_NUM; chnl++) { IWM_WRITE(sc, @@ -1323,8 +1323,10 @@ iwm_stop_device(struct iwm_softc *sc) if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { /* Power-down device's busmaster DMA clocks */ - iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, - IWM_APMG_CLK_VAL_DMA_CLK_RQT); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, + IWM_APMG_CLK_VAL_DMA_CLK_RQT); + } DELAY(5); } @@ -1621,8 +1623,6 @@ iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t iwm_ict_reset(sc); - iwm_nic_unlock(sc); - sc->scd_base_addr = iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR); if (scd_base_addr != 0 && scd_base_addr != sc->scd_base_addr) { @@ -1631,6 +1631,8 @@ iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t __func__, sc->scd_base_addr, scd_base_addr); } + iwm_nic_unlock(sc); + /* reset context data, TX status and translation data */ error = iwm_write_mem(sc, sc->scd_base_addr + IWM_SCD_CONTEXT_MEM_LOWER_BOUND, @@ -2590,9 +2592,11 @@ iwm_pcie_load_given_ucode(struct iwm_softc *sc, if (image->is_dual_cpus) { /* set CPU2 header address */ - iwm_write_prph(sc, - IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR, - IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, + IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR, + IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE); + } /* load to FW the binary sections of CPU2 */ ret = iwm_pcie_load_cpu_sections(sc, image, 2, @@ -2621,7 +2625,10 @@ iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, /* configure the ucode to be ready to get the secured image */ /* release CPU reset */ - iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, IWM_RELEASE_CPU_RESET_BIT); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, + IWM_RELEASE_CPU_RESET_BIT); + } /* load to FW the binary Secured sections of CPU1 */ ret = iwm_pcie_load_cpu_sections_8000(sc, image, 1, @@ -2875,10 +2882,14 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, IWM_LOCK(sc); if (error) { if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + uint32_t a = 0x5a5a5a5a, b = 0x5a5a5a5a; + if (iwm_nic_lock(sc)) { + a = iwm_read_prph(sc, IWM_SB_CPU_1_STATUS); + b = iwm_read_prph(sc, IWM_SB_CPU_2_STATUS); + } device_printf(sc->sc_dev, "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", - iwm_read_prph(sc, IWM_SB_CPU_1_STATUS), - iwm_read_prph(sc, IWM_SB_CPU_2_STATUS)); + a, b); } sc->cur_ucode = old_type; return error; Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:31:07 2018 (r330198) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:32:46 2018 (r330199) @@ -498,11 +498,15 @@ iwm_apm_init(struct iwm_softc *sc) * just to discard the value. But that's the way the hardware * seems to like it. */ - iwm_read_prph(sc, IWM_OSC_CLK); - iwm_read_prph(sc, IWM_OSC_CLK); + if (iwm_nic_lock(sc)) { + iwm_read_prph(sc, IWM_OSC_CLK); + iwm_read_prph(sc, IWM_OSC_CLK); + } iwm_set_bits_prph(sc, IWM_OSC_CLK, IWM_OSC_CLK_FORCE_CONTROL); - iwm_read_prph(sc, IWM_OSC_CLK); - iwm_read_prph(sc, IWM_OSC_CLK); + if (iwm_nic_lock(sc)) { + iwm_read_prph(sc, IWM_OSC_CLK); + iwm_read_prph(sc, IWM_OSC_CLK); + } } /* @@ -513,8 +517,10 @@ iwm_apm_init(struct iwm_softc *sc) * set by default in "CLK_CTRL_REG" after reset. */ if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { - iwm_write_prph(sc, IWM_APMG_CLK_EN_REG, - IWM_APMG_CLK_VAL_DMA_CLK_RQT); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_APMG_CLK_EN_REG, + IWM_APMG_CLK_VAL_DMA_CLK_RQT); + } DELAY(20); /* Disable L1-Active */ @@ -522,8 +528,10 @@ iwm_apm_init(struct iwm_softc *sc) IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); /* Clear the interrupt in APMG if the NIC is in RFKILL */ - iwm_write_prph(sc, IWM_APMG_RTC_INT_STT_REG, - IWM_APMG_RTC_INT_STT_RFKILL); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_APMG_RTC_INT_STT_REG, + IWM_APMG_RTC_INT_STT_RFKILL); + } } out: if (error) @@ -625,12 +633,12 @@ iwm_pcie_set_cmd_in_flight(struct iwm_softc *sc) IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); - ret = iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, + ret = iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, (IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | IWM_CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 15000); - if (ret == 0) { + if (ret == 0) { IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); device_printf(sc->sc_dev, From owner-svn-src-all@freebsd.org Thu Mar 1 06:33:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0740BF28CCD; Thu, 1 Mar 2018 06:33:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B198269C90; Thu, 1 Mar 2018 06:33:27 +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 93DD924DEA; Thu, 1 Mar 2018 06:33:27 +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 w216XRvB057917; Thu, 1 Mar 2018 06:33:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216XREG057915; Thu, 1 Mar 2018 06:33:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010633.w216XREG057915@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 06:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330200 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:33:28 -0000 Author: eadler Date: Thu Mar 1 06:33:27 2018 New Revision: 330200 URL: https://svnweb.freebsd.org/changeset/base/330200 Log: MFC r318003: [iwm] Add iwm_nic_unlock() calls missing from previous commit. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:32:46 2018 (r330199) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:33:27 2018 (r330200) @@ -1326,6 +1326,7 @@ iwm_stop_device(struct iwm_softc *sc) if (iwm_nic_lock(sc)) { iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, IWM_APMG_CLK_VAL_DMA_CLK_RQT); + iwm_nic_unlock(sc); } DELAY(5); } @@ -2596,6 +2597,7 @@ iwm_pcie_load_given_ucode(struct iwm_softc *sc, iwm_write_prph(sc, IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR, IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE); + iwm_nic_unlock(sc); } /* load to FW the binary sections of CPU2 */ @@ -2628,6 +2630,7 @@ iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, if (iwm_nic_lock(sc)) { iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, IWM_RELEASE_CPU_RESET_BIT); + iwm_nic_unlock(sc); } /* load to FW the binary Secured sections of CPU1 */ @@ -2886,6 +2889,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, if (iwm_nic_lock(sc)) { a = iwm_read_prph(sc, IWM_SB_CPU_1_STATUS); b = iwm_read_prph(sc, IWM_SB_CPU_2_STATUS); + iwm_nic_unlock(sc); } device_printf(sc->sc_dev, "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:32:46 2018 (r330199) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:33:27 2018 (r330200) @@ -501,11 +501,13 @@ iwm_apm_init(struct iwm_softc *sc) if (iwm_nic_lock(sc)) { iwm_read_prph(sc, IWM_OSC_CLK); iwm_read_prph(sc, IWM_OSC_CLK); + iwm_nic_unlock(sc); } iwm_set_bits_prph(sc, IWM_OSC_CLK, IWM_OSC_CLK_FORCE_CONTROL); if (iwm_nic_lock(sc)) { iwm_read_prph(sc, IWM_OSC_CLK); iwm_read_prph(sc, IWM_OSC_CLK); + iwm_nic_unlock(sc); } } @@ -520,6 +522,7 @@ iwm_apm_init(struct iwm_softc *sc) if (iwm_nic_lock(sc)) { iwm_write_prph(sc, IWM_APMG_CLK_EN_REG, IWM_APMG_CLK_VAL_DMA_CLK_RQT); + iwm_nic_unlock(sc); } DELAY(20); @@ -531,6 +534,7 @@ iwm_apm_init(struct iwm_softc *sc) if (iwm_nic_lock(sc)) { iwm_write_prph(sc, IWM_APMG_RTC_INT_STT_REG, IWM_APMG_RTC_INT_STT_RFKILL); + iwm_nic_unlock(sc); } } out: From owner-svn-src-all@freebsd.org Thu Mar 1 06:34:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7750BF28EFC; Thu, 1 Mar 2018 06:34: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 2A82669F11; Thu, 1 Mar 2018 06:34: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 254AF24DEE; Thu, 1 Mar 2018 06:34: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 w216YMM9058007; Thu, 1 Mar 2018 06:34:22 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216YLBk058001; Thu, 1 Mar 2018 06:34:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010634.w216YLBk058001@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 06:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330201 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:34:22 -0000 Author: eadler Date: Thu Mar 1 06:34:21 2018 New Revision: 330201 URL: https://svnweb.freebsd.org/changeset/base/330201 Log: MFC r318005: [iwm] Add basic powermanagement support via ifconfig wlan0 powersave. * The DEVICE_POWER_FLAGS_CAM_MSK flag was removed in the upstream iwlwifi in Linux commit ceef91c89480dd18bb3ac51e91280a233d0ca41f. * Add sc_ps_disabled flag to struct iwm_softc, which corresponds to mvm->ps_disabled in struct iwl_mvm in Linux iwlwifi. * Adds a hw.iwm.power_scheme tunable which corresponds to the power_scheme module parameter in Linux iwlwifi. Set this to 1 for completely disabling power management, 2 (default) for balanced powermanagement, and 3 for lowerpower mode (which does dtim period skipping). * Imports the constants.h file from iwlwifi as if_iwm_constants.h. * This doesn't allow changing the powermanagement setting while connected, also one can only choose between enabled and disabled powersaving with ifconfig (so switching between balanced and low-power mode requires rebooting to change the tunable). * After any changes to powermanagement (i.e. "ifconfig wlan0 powersave" to enable powermanagement, or "ifconfig wlan0 -powersave" for disabling powermanagement), one has to disconnect and reconnect to the accespoint for the change to take effect. Added: stable/11/sys/dev/iwm/if_iwm_constants.h - copied unchanged from r318005, head/sys/dev/iwm/if_iwm_constants.h Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_power.c stable/11/sys/dev/iwm/if_iwm_power.h stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:34:21 2018 (r330201) @@ -4155,6 +4155,12 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: failed to add MAC\n", __func__); goto out; } + if ((error = iwm_mvm_power_update_mac(sc)) != 0) { + device_printf(sc->sc_dev, + "%s: failed to update power management\n", + __func__); + goto out; + } if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], in->in_ni.ni_chan, 1, 1)) != 0) { device_printf(sc->sc_dev, @@ -4561,8 +4567,8 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ } in = IWM_NODE(vap->iv_bss); - iwm_mvm_power_mac_update_mode(sc, in); iwm_mvm_enable_beacon_filter(sc, in); + iwm_mvm_power_update_mac(sc); iwm_mvm_update_quotas(sc, in); iwm_setrates(sc, in); @@ -4850,6 +4856,7 @@ iwm_init_hw(struct iwm_softc *sc) * image just loaded */ iwm_stop_device(sc); + sc->sc_ps_disabled = FALSE; if ((error = iwm_start_hw(sc)) != 0) { device_printf(sc->sc_dev, "could not initialize hardware\n"); return error; @@ -6108,6 +6115,7 @@ iwm_attach(device_t dev) IEEE80211_C_STA | IEEE80211_C_WPA | /* WPA/RSN */ IEEE80211_C_WME | + IEEE80211_C_PMGT | IEEE80211_C_SHSLOT | /* short slot time supported */ IEEE80211_C_SHPREAMBLE /* short preamble supported */ // IEEE80211_C_BGSCAN /* capable of bg scanning */ Copied: stable/11/sys/dev/iwm/if_iwm_constants.h (from r318005, head/sys/dev/iwm/if_iwm_constants.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_constants.h Thu Mar 1 06:34:21 2018 (r330201, copy of r318005, head/sys/dev/iwm/if_iwm_constants.h) @@ -0,0 +1,154 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/* $FreeBSD$ */ + +#ifndef __IF_IWM_CONSTANTS_H +#define __IF_IWM_CONSTANTS_H + +/* */ + +#define IWM_MVM_DEFAULT_PS_TX_DATA_TIMEOUT (100 * 1000) +#define IWM_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (100 * 1000) +#define IWM_MVM_WOWLAN_PS_TX_DATA_TIMEOUT (10 * 1000) +#define IWM_MVM_WOWLAN_PS_RX_DATA_TIMEOUT (10 * 1000) +#define IWM_MVM_SHORT_PS_TX_DATA_TIMEOUT (2 * 1024) /* defined in TU */ +#define IWM_MVM_SHORT_PS_RX_DATA_TIMEOUT (40 * 1024) /* defined in TU */ +#define IWM_MVM_P2P_LOWLATENCY_PS_ENABLE 0 +#define IWM_MVM_UAPSD_RX_DATA_TIMEOUT (50 * 1000) +#define IWM_MVM_UAPSD_TX_DATA_TIMEOUT (50 * 1000) +#ifdef notyet +/* XXX Find corresponding values from net80211 */ +#define IWM_MVM_UAPSD_QUEUES (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\ + IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\ + IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\ + IEEE80211_WMM_IE_STA_QOSINFO_AC_BE) +#endif +#define IWM_MVM_PS_HEAVY_TX_THLD_PACKETS 20 +#define IWM_MVM_PS_HEAVY_RX_THLD_PACKETS 8 +#define IWM_MVM_PS_SNOOZE_HEAVY_TX_THLD_PACKETS 30 +#define IWM_MVM_PS_SNOOZE_HEAVY_RX_THLD_PACKETS 20 +#define IWM_MVM_PS_HEAVY_TX_THLD_PERCENT 50 +#define IWM_MVM_PS_HEAVY_RX_THLD_PERCENT 50 +#define IWM_MVM_PS_SNOOZE_INTERVAL 25 +#define IWM_MVM_PS_SNOOZE_WINDOW 50 +#define IWM_MVM_WOWLAN_PS_SNOOZE_WINDOW 25 +#define IWM_MVM_LOWLAT_QUOTA_MIN_PERCENT 64 +#define IWM_MVM_BT_COEX_EN_RED_TXP_THRESH 62 +#define IWM_MVM_BT_COEX_DIS_RED_TXP_THRESH 65 +#define IWM_MVM_BT_COEX_SYNC2SCO 1 +#define IWM_MVM_BT_COEX_CORUNNING 0 +#define IWM_MVM_BT_COEX_MPLUT 1 +#define IWM_MVM_BT_COEX_RRC 1 +#define IWM_MVM_BT_COEX_TTC 1 +#define IWM_MVM_BT_COEX_MPLUT_REG0 0x22002200 +#define IWM_MVM_BT_COEX_MPLUT_REG1 0x11118451 +#define IWM_MVM_BT_COEX_ANTENNA_COUPLING_THRS 30 +#define IWM_MVM_FW_MCAST_FILTER_PASS_ALL 0 +#define IWM_MVM_FW_BCAST_FILTER_PASS_ALL 0 +#define IWM_MVM_QUOTA_THRESHOLD 4 +#define IWM_MVM_RS_RSSI_BASED_INIT_RATE 0 +#define IWM_MVM_RS_80_20_FAR_RANGE_TWEAK 1 +#define IWM_MVM_TOF_IS_RESPONDER 0 +#define IWM_MVM_SW_TX_CSUM_OFFLOAD 0 +#define IWM_MVM_HW_CSUM_DISABLE 0 +#define IWM_MVM_COLLECT_FW_ERR_DUMP 1 +#define IWM_MVM_RS_NUM_TRY_BEFORE_ANT_TOGGLE 1 +#define IWM_MVM_RS_HT_VHT_RETRIES_PER_RATE 2 +#define IWM_MVM_RS_HT_VHT_RETRIES_PER_RATE_TW 1 +#define IWM_MVM_RS_INITIAL_MIMO_NUM_RATES 3 +#define IWM_MVM_RS_INITIAL_SISO_NUM_RATES 3 +#define IWM_MVM_RS_INITIAL_LEGACY_NUM_RATES 2 +#define IWM_MVM_RS_INITIAL_LEGACY_RETRIES 2 +#define IWM_MVM_RS_SECONDARY_LEGACY_RETRIES 1 +#define IWM_MVM_RS_SECONDARY_LEGACY_NUM_RATES 16 +#define IWM_MVM_RS_SECONDARY_SISO_NUM_RATES 3 +#define IWM_MVM_RS_SECONDARY_SISO_RETRIES 1 +#define IWM_MVM_RS_RATE_MIN_FAILURE_TH 3 +#define IWM_MVM_RS_RATE_MIN_SUCCESS_TH 8 +#define IWM_MVM_RS_STAY_IN_COLUMN_TIMEOUT 5 /* Seconds */ +#define IWM_MVM_RS_IDLE_TIMEOUT 5 /* Seconds */ +#define IWM_MVM_RS_MISSED_RATE_MAX 15 +#define IWM_MVM_RS_LEGACY_FAILURE_LIMIT 160 +#define IWM_MVM_RS_LEGACY_SUCCESS_LIMIT 480 +#define IWM_MVM_RS_LEGACY_TABLE_COUNT 160 +#define IWM_MVM_RS_NON_LEGACY_FAILURE_LIMIT 400 +#define IWM_MVM_RS_NON_LEGACY_SUCCESS_LIMIT 4500 +#define IWM_MVM_RS_NON_LEGACY_TABLE_COUNT 1500 +#define IWM_MVM_RS_SR_FORCE_DECREASE 15 /* percent */ +#define IWM_MVM_RS_SR_NO_DECREASE 85 /* percent */ +#define IWM_MVM_RS_AGG_TIME_LIMIT 4000 /* 4 msecs. valid 100-8000 */ +#define IWM_MVM_RS_AGG_DISABLE_START 3 +#define IWM_MVM_RS_TPC_SR_FORCE_INCREASE 75 /* percent */ +#define IWM_MVM_RS_TPC_SR_NO_INCREASE 85 /* percent */ +#define IWM_MVM_RS_TPC_TX_POWER_STEP 3 + +#endif /* __IF_IWM_CONSTANTS_H */ Modified: stable/11/sys/dev/iwm/if_iwm_power.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:34:21 2018 (r330201) @@ -137,9 +137,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +static int iwm_power_scheme = IWM_POWER_SCHEME_BPS; + +TUNABLE_INT("hw.iwm.power_scheme", &iwm_power_scheme); + /* * BEGIN mvm/power.c */ @@ -153,7 +158,7 @@ iwm_mvm_beacon_filter_send_cmd(struct iwm_softc *sc, int ret; ret = iwm_mvm_send_cmd_pdu(sc, IWM_REPLY_BEACON_FILTERING_CMD, - IWM_CMD_SYNC, sizeof(struct iwm_beacon_filter_cmd), cmd); + 0, sizeof(struct iwm_beacon_filter_cmd), cmd); if (!ret) { IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, @@ -200,24 +205,6 @@ iwm_mvm_beacon_filter_set_cqm_params(struct iwm_softc cmd->ba_enable_beacon_abort = htole32(sc->sc_bf.ba_enabled); } -static int -iwm_mvm_update_beacon_abort(struct iwm_softc *sc, struct iwm_node *in, - int enable) -{ - struct iwm_beacon_filter_cmd cmd = { - IWM_BF_CMD_CONFIG_DEFAULTS, - .bf_enable_beacon_filter = htole32(1), - .ba_enable_beacon_abort = htole32(enable), - }; - - if (!sc->sc_bf.bf_enabled) - return 0; - - sc->sc_bf.ba_enabled = enable; - iwm_mvm_beacon_filter_set_cqm_params(sc, in, &cmd); - return iwm_mvm_beacon_filter_send_cmd(sc, &cmd); -} - static void iwm_mvm_power_log(struct iwm_softc *sc, struct iwm_mac_power_cmd *cmd) { @@ -233,9 +220,63 @@ iwm_mvm_power_log(struct iwm_softc *sc, struct iwm_mac "Disable power management\n"); return; } + + IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, + "Rx timeout = %u usec\n", le32toh(cmd->rx_data_timeout)); + IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, + "Tx timeout = %u usec\n", le32toh(cmd->tx_data_timeout)); + if (cmd->flags & htole16(IWM_POWER_FLAGS_SKIP_OVER_DTIM_MSK)) + IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, + "DTIM periods to skip = %u\n", cmd->skip_dtim_periods); } +static boolean_t +iwm_mvm_power_is_radar(struct iwm_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_channel *chan; + boolean_t radar_detect = FALSE; + + chan = ic->ic_bsschan; + if (chan == IEEE80211_CHAN_ANYC || + (chan->ic_flags & IEEE80211_CHAN_DFS) != 0) { + radar_detect = TRUE; + } + + return radar_detect; +} + static void +iwm_mvm_power_config_skip_dtim(struct iwm_softc *sc, + struct iwm_mac_power_cmd *cmd) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + int dtimper = vap->iv_dtim_period ?: 1; + int skip; + + /* disable, in case we're supposed to override */ + cmd->skip_dtim_periods = 0; + cmd->flags &= ~htole16(IWM_POWER_FLAGS_SKIP_OVER_DTIM_MSK); + + if (iwm_mvm_power_is_radar(sc)) + return; + + if (dtimper >= 10) + return; + + /* TODO: check that multicast wake lock is off */ + + if (iwm_power_scheme != IWM_POWER_SCHEME_LP) + return; + skip = 2; + + /* the firmware really expects "look at every X DTIMs", so add 1 */ + cmd->skip_dtim_periods = 1 + skip; + cmd->flags |= htole16(IWM_POWER_FLAGS_SKIP_OVER_DTIM_MSK); +} + +static void iwm_mvm_power_build_cmd(struct iwm_softc *sc, struct iwm_node *in, struct iwm_mac_power_cmd *cmd) { @@ -257,45 +298,49 @@ iwm_mvm_power_build_cmd(struct iwm_softc *sc, struct i */ dtimper_msec = dtimper * ni->ni_intval; keep_alive - = MAX(3 * dtimper_msec, 1000 * IWM_POWER_KEEP_ALIVE_PERIOD_SEC); + = imax(3 * dtimper_msec, 1000 * IWM_POWER_KEEP_ALIVE_PERIOD_SEC); keep_alive = roundup(keep_alive, 1000) / 1000; cmd->keep_alive_seconds = htole16(keep_alive); + + if (sc->sc_ps_disabled) + return; + + cmd->flags |= htole16(IWM_POWER_FLAGS_POWER_SAVE_ENA_MSK); + cmd->flags |= htole16(IWM_POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); + + iwm_mvm_power_config_skip_dtim(sc, cmd); + + cmd->rx_data_timeout = + htole32(IWM_MVM_DEFAULT_PS_RX_DATA_TIMEOUT); + cmd->tx_data_timeout = + htole32(IWM_MVM_DEFAULT_PS_TX_DATA_TIMEOUT); } -int -iwm_mvm_power_mac_update_mode(struct iwm_softc *sc, struct iwm_node *in) +static int +iwm_mvm_power_send_cmd(struct iwm_softc *sc, struct iwm_node *in) { - int ret; - int ba_enable; - struct iwm_mac_power_cmd cmd; + struct iwm_mac_power_cmd cmd = {}; - memset(&cmd, 0, sizeof(cmd)); - iwm_mvm_power_build_cmd(sc, in, &cmd); iwm_mvm_power_log(sc, &cmd); - if ((ret = iwm_mvm_send_cmd_pdu(sc, IWM_MAC_PM_POWER_TABLE, - IWM_CMD_SYNC, sizeof(cmd), &cmd)) != 0) - return ret; - - ba_enable = !!(cmd.flags & - htole16(IWM_POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK)); - return iwm_mvm_update_beacon_abort(sc, in, ba_enable); + return iwm_mvm_send_cmd_pdu(sc, IWM_MAC_PM_POWER_TABLE, 0, + sizeof(cmd), &cmd); } -int -iwm_mvm_power_update_device(struct iwm_softc *sc) +static int +_iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, struct iwm_node *in, + struct iwm_beacon_filter_cmd *cmd) { - struct iwm_device_power_cmd cmd = { - .flags = htole16(IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK), - }; + int ret; - cmd.flags |= htole16(IWM_DEVICE_POWER_FLAGS_CAM_MSK); - IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, - "Sending device power command with flags = 0x%X\n", cmd.flags); + iwm_mvm_beacon_filter_set_cqm_params(sc, in, cmd); + ret = iwm_mvm_beacon_filter_send_cmd(sc, cmd); - return iwm_mvm_send_cmd_pdu(sc, - IWM_POWER_TABLE_CMD, IWM_CMD_SYNC, sizeof(cmd), &cmd); + if (!ret) + sc->sc_bf.bf_enabled = 1; + + return ret; } int @@ -305,15 +350,8 @@ iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, str IWM_BF_CMD_CONFIG_DEFAULTS, .bf_enable_beacon_filter = htole32(1), }; - int ret; - iwm_mvm_beacon_filter_set_cqm_params(sc, in, &cmd); - ret = iwm_mvm_beacon_filter_send_cmd(sc, &cmd); - - if (ret == 0) - sc->sc_bf.bf_enabled = 1; - - return ret; + return _iwm_mvm_enable_beacon_filter(sc, in, &cmd); } int @@ -327,4 +365,106 @@ iwm_mvm_disable_beacon_filter(struct iwm_softc *sc) sc->sc_bf.bf_enabled = 0; return ret; +} + +static int +iwm_mvm_power_set_ps(struct iwm_softc *sc) +{ + struct ieee80211vap *vap = TAILQ_FIRST(&sc->sc_ic.ic_vaps); + boolean_t disable_ps; + int ret; + + /* disable PS if CAM */ + disable_ps = (iwm_power_scheme == IWM_POWER_SCHEME_CAM); + /* ...or if any of the vifs require PS to be off */ + if (vap != NULL && (vap->iv_flags & IEEE80211_F_PMGTON) == 0) + disable_ps = TRUE; + + /* update device power state if it has changed */ + if (sc->sc_ps_disabled != disable_ps) { + boolean_t old_ps_disabled = sc->sc_ps_disabled; + + sc->sc_ps_disabled = disable_ps; + ret = iwm_mvm_power_update_device(sc); + if (ret) { + sc->sc_ps_disabled = old_ps_disabled; + return ret; + } + } + + return 0; +} + +static int +iwm_mvm_power_set_ba(struct iwm_softc *sc, struct iwm_node *in) +{ + struct iwm_beacon_filter_cmd cmd = { + IWM_BF_CMD_CONFIG_DEFAULTS, + .bf_enable_beacon_filter = htole32(1), + }; + + if (!sc->sc_bf.bf_enabled) + return 0; + + sc->sc_bf.ba_enabled = !sc->sc_ps_disabled; + + return _iwm_mvm_enable_beacon_filter(sc, in, &cmd); +} + +int +iwm_mvm_power_update_ps(struct iwm_softc *sc) +{ + struct ieee80211vap *vap = TAILQ_FIRST(&sc->sc_ic.ic_vaps); + int ret; + + ret = iwm_mvm_power_set_ps(sc); + if (ret) + return ret; + + if (vap != NULL) + return iwm_mvm_power_set_ba(sc, IWM_NODE(vap->iv_bss)); + + return 0; +} + +int +iwm_mvm_power_update_mac(struct iwm_softc *sc) +{ + struct ieee80211vap *vap = TAILQ_FIRST(&sc->sc_ic.ic_vaps); + int ret; + + ret = iwm_mvm_power_set_ps(sc); + if (ret) + return ret; + + if (vap != NULL) { + ret = iwm_mvm_power_send_cmd(sc, IWM_NODE(vap->iv_bss)); + if (ret) + return ret; + } + + if (vap != NULL) + return iwm_mvm_power_set_ba(sc, IWM_NODE(vap->iv_bss)); + + return 0; +} + +int +iwm_mvm_power_update_device(struct iwm_softc *sc) +{ + struct iwm_device_power_cmd cmd = { + .flags = 0, + }; + + if (iwm_power_scheme == IWM_POWER_SCHEME_CAM) + sc->sc_ps_disabled = TRUE; + + if (!sc->sc_ps_disabled) + cmd.flags |= htole16(IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK); + + IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, + "Sending device power command with flags = 0x%X\n", cmd.flags); + + return iwm_mvm_send_cmd_pdu(sc, + IWM_POWER_TABLE_CMD, 0, sizeof(cmd), &cmd); } Modified: stable/11/sys/dev/iwm/if_iwm_power.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_power.h Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwm_power.h Thu Mar 1 06:34:21 2018 (r330201) @@ -90,9 +90,9 @@ #ifndef __IF_IWM_POWER_H__ #define __IF_IWM_POWER_H__ -extern int iwm_mvm_power_mac_update_mode(struct iwm_softc *sc, - struct iwm_node *in); extern int iwm_mvm_power_update_device(struct iwm_softc *sc); +extern int iwm_mvm_power_update_mac(struct iwm_softc *sc); +extern int iwm_mvm_power_update_ps(struct iwm_softc *sc); extern int iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, struct iwm_node *in); extern int iwm_mvm_disable_beacon_filter(struct iwm_softc *sc); Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:34:21 2018 (r330201) @@ -3620,17 +3620,11 @@ struct iwm_powertable_cmd { /** * enum iwm_device_power_flags - masks for device power command flags - * @DEVIC_POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off - * receiver and transmitter. '0' - does not allow. This flag should be - * always set to '1' unless one need to disable actual power down for debug - * purposes. - * @IWM_DEVICE_POWER_FLAGS_CAM_MSK: '1' CAM (Continuous Active Mode) is set, meaning - * that power management is disabled. '0' Power management is enabled, one - * of power schemes is applied. -*/ + * @IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off + * receiver and transmitter. '0' - does not allow. + */ enum iwm_device_power_flags { IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = (1 << 0), - IWM_DEVICE_POWER_FLAGS_CAM_MSK = (1 << 13), }; /** @@ -6036,6 +6030,12 @@ struct iwm_cmd_header_wide { uint8_t version; } __packed; +/** + * enum iwm_power_scheme + * @IWM_POWER_LEVEL_CAM - Continuously Active Mode + * @IWM_POWER_LEVEL_BPS - Balanced Power Save (default) + * @IWM_POWER_LEVEL_LP - Low Power + */ enum iwm_power_scheme { IWM_POWER_SCHEME_CAM = 1, IWM_POWER_SCHEME_BPS, Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:34:21 2018 (r330201) @@ -535,6 +535,9 @@ struct iwm_softc { struct iwm_fw_paging fw_paging_db[IWM_NUM_OF_FW_PAGING_BLOCKS]; uint16_t num_of_paging_blk; uint16_t num_of_pages_in_last_blk; + + /* Indicate if device power save is allowed */ + boolean_t sc_ps_disabled; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-all@freebsd.org Thu Mar 1 06:34:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F10CBF28FCC; Thu, 1 Mar 2018 06:34:48 +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 A79A26A09A; Thu, 1 Mar 2018 06:34:48 +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 A2A1F24DEF; Thu, 1 Mar 2018 06:34:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216YmJe058067; Thu, 1 Mar 2018 06:34:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216YmmP058064; Thu, 1 Mar 2018 06:34:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010634.w216YmmP058064@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 06:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330202 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:34:49 -0000 Author: eadler Date: Thu Mar 1 06:34:48 2018 New Revision: 330202 URL: https://svnweb.freebsd.org/changeset/base/330202 Log: MFC r318012: [iwm] Allow listening on both chains/atennas to get diversity. This might improve throughput slightly when far from the accesspoint, apparently by allowing the firmware to listen on either of the two antennas (if there are two, i.e. on 7260/7265/8260), whichever has a better reception. Modified: stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c Thu Mar 1 06:34:21 2018 (r330201) +++ stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c Thu Mar 1 06:34:48 2018 (r330202) @@ -217,6 +217,18 @@ iwm_mvm_phy_ctxt_cmd_data(struct iwm_softc *sc, idle_cnt = chains_static; active_cnt = chains_dynamic; + /* In scenarios where we only ever use a single-stream rates, + * i.e. legacy 11b/g/a associations, single-stream APs or even + * static SMPS, enable both chains to get diversity, improving + * the case where we're far enough from the AP that attenuation + * between the two antennas is sufficiently different to impact + * performance. + */ + if (active_cnt == 1 && iwm_mvm_rx_diversity_allowed(sc)) { + idle_cnt = 2; + active_cnt = 2; + } + cmd->rxchain_info = htole32(iwm_mvm_get_valid_rx_ant(sc) << IWM_PHY_RX_CHAIN_VALID_POS); cmd->rxchain_info |= htole32(idle_cnt << IWM_PHY_RX_CHAIN_CNT_POS); Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:34:21 2018 (r330201) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:34:48 2018 (r330202) @@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -485,4 +486,18 @@ iwm_dma_contig_free(struct iwm_dma_info *dma) bus_dma_tag_destroy(dma->tag); dma->tag = NULL; } +} + +boolean_t +iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc) +{ + if (num_of_ant(iwm_mvm_get_valid_rx_ant(sc)) == 1) + return FALSE; + + /* + * XXX Also return FALSE when SMPS (Spatial Multiplexing Powersave) + * is used on any vap (in the future). + */ + + return TRUE; } Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:34:21 2018 (r330201) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:34:48 2018 (r330202) @@ -120,6 +120,8 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, str bus_size_t size, bus_size_t alignment); extern void iwm_dma_contig_free(struct iwm_dma_info *); +extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc); + extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); static inline uint8_t From owner-svn-src-all@freebsd.org Thu Mar 1 06:35:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D72AF2906B; Thu, 1 Mar 2018 06:35:14 +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 339CB6A225; Thu, 1 Mar 2018 06:35:14 +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 2E7A924DF0; Thu, 1 Mar 2018 06:35:14 +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 w216ZEAI058144; Thu, 1 Mar 2018 06:35:14 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216ZDYc058140; Thu, 1 Mar 2018 06:35:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010635.w216ZDYc058140@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 06:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330203 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:35:14 -0000 Author: eadler Date: Thu Mar 1 06:35:13 2018 New Revision: 330203 URL: https://svnweb.freebsd.org/changeset/base/330203 Log: MFC r318013: [iwm] Move in_phyctxt from struct iwm_node to phy_ctxt in struct iwm_vap. * This better matches how things are organized in Linux's iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_binding.c stable/11/sys/dev/iwm/if_iwm_binding.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:35:13 2018 (r330203) @@ -354,7 +354,7 @@ static int iwm_mvm_add_int_sta_common(struct iwm_softc struct iwm_int_sta *, const uint8_t *, uint16_t, uint16_t); static int iwm_mvm_add_aux_sta(struct iwm_softc *); -static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_node *); +static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); static int iwm_assoc(struct ieee80211vap *, struct iwm_softc *); static int iwm_release(struct iwm_softc *, struct iwm_node *); @@ -1285,6 +1285,7 @@ iwm_stop_device(struct iwm_softc *sc) */ if (vap) { struct iwm_vap *iv = IWM_VAP(vap); + iv->phy_ctxt = NULL; iv->is_uploaded = 0; } @@ -3998,7 +3999,7 @@ iwm_mvm_add_aux_sta(struct iwm_softc *sc) */ static int -iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm_vap *ivp) { struct iwm_time_quota_cmd cmd; int i, idx, ret, num_active_macs, quota, quota_rem; @@ -4009,10 +4010,10 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm memset(&cmd, 0, sizeof(cmd)); /* currently, PHY ID == binding ID */ - if (in) { - id = in->in_phyctxt->id; + if (ivp) { + id = ivp->phy_ctxt->id; KASSERT(id < IWM_MAX_BINDINGS, ("invalid id")); - colors[id] = in->in_phyctxt->color; + colors[id] = ivp->phy_ctxt->color; if (1) n_ifs[id] = 1; @@ -4137,9 +4138,9 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: failed update phy ctxt\n", __func__); goto out; } - in->in_phyctxt = &sc->sc_phyctxt[0]; + iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_update(sc, in)) != 0) { + if ((error = iwm_mvm_binding_update(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding update cmd\n", __func__); goto out; @@ -4168,9 +4169,9 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s error = ETIMEDOUT; goto out; } - in->in_phyctxt = &sc->sc_phyctxt[0]; + iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_add_vif(sc, in)) != 0) { + if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding add cmd\n", __func__); goto out; @@ -4569,7 +4570,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ in = IWM_NODE(vap->iv_bss); iwm_mvm_enable_beacon_filter(sc, in); iwm_mvm_power_update_mac(sc); - iwm_mvm_update_quotas(sc, in); + iwm_mvm_update_quotas(sc, ivp); iwm_setrates(sc, in); cmd.data[0] = &in->in_lq; @@ -5750,7 +5751,6 @@ iwm_intr(void *arg) device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; " "restarting\n", __func__, vap->iv_state); - /* XXX TODO: turn this into a callout/taskqueue */ ieee80211_restart_all(ic); return; } Modified: stable/11/sys/dev/iwm/if_iwm_binding.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:35:13 2018 (r330203) @@ -161,10 +161,10 @@ __FBSDID("$FreeBSD$"); */ int -iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_node *in, uint32_t action) +iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t action) { struct iwm_binding_cmd cmd; - struct iwm_mvm_phy_ctxt *phyctxt = in->in_phyctxt; + struct iwm_mvm_phy_ctxt *phyctxt = ivp->phy_ctxt; int i, ret; uint32_t status; @@ -203,13 +203,13 @@ iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_n } int -iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp) { - return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_MODIFY); + return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_MODIFY); } int -iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp) { - return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_ADD); + return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_ADD); } Modified: stable/11/sys/dev/iwm/if_iwm_binding.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:35:13 2018 (r330203) @@ -105,9 +105,9 @@ #ifndef __IF_IWM_BINDING_H__ #define __IF_IWM_BINDING_H__ -extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_node *in, +extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t action); -extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in); -extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in); +extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp); +extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp); #endif /* __IF_IWM_BINDING_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:35:13 2018 (r330203) @@ -373,12 +373,13 @@ struct iwm_vap { int (*iv_newstate)(struct ieee80211vap *, enum ieee80211_state, int); + + struct iwm_mvm_phy_ctxt *phy_ctxt; }; #define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) struct iwm_node { struct ieee80211_node in_ni; - struct iwm_mvm_phy_ctxt *in_phyctxt; /* status "bits" */ int in_assoc; From owner-svn-src-all@freebsd.org Thu Mar 1 06:36:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A372DF29265; Thu, 1 Mar 2018 06:36:42 +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 58DF86A59E; Thu, 1 Mar 2018 06:36:42 +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 53BBB24DF3; Thu, 1 Mar 2018 06:36:42 +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 w216agSd058246; Thu, 1 Mar 2018 06:36:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216af0m058238; Thu, 1 Mar 2018 06:36:41 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010636.w216af0m058238@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 06:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330204 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:36:43 -0000 Author: eadler Date: Thu Mar 1 06:36:41 2018 New Revision: 330204 URL: https://svnweb.freebsd.org/changeset/base/330204 Log: MFC r318214: [iwm] Sanity check channel for IEEE80211_CHAN_ANYC in if_iwm_mac_ctxt.c. * This avoids panicing in some broken vap state handling cases. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_binding.c stable/11/sys/dev/iwm/if_iwm_binding.h stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c stable/11/sys/dev/iwm/if_iwm_power.c stable/11/sys/dev/iwm/if_iwm_time_event.c stable/11/sys/dev/iwm/if_iwm_time_event.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:36:41 2018 (r330204) @@ -3879,6 +3879,7 @@ iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *sc, static int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, int update) { + struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); struct iwm_mvm_add_sta_cmd add_sta_cmd; int ret; uint32_t status; @@ -3887,8 +3888,7 @@ iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iw add_sta_cmd.sta_id = IWM_STATION_ID; add_sta_cmd.mac_id_n_color - = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, - IWM_DEFAULT_COLOR)); + = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); if (!update) { int ac; for (ac = 0; ac < WME_NUM_AC; ac++) { @@ -4140,7 +4140,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s } iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_update(sc, iv)) != 0) { + if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding update cmd\n", __func__); goto out; @@ -4189,7 +4189,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s */ /* XXX duration is in units of TU, not MS */ duration = IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS; - iwm_mvm_protect_session(sc, in, duration, 500 /* XXX magic number */); + iwm_mvm_protect_session(sc, iv, duration, 500 /* XXX magic number */); DELAY(100); error = 0; @@ -4234,7 +4234,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * iwm_mvm_rm_sta(sc, in); * iwm_mvm_update_quotas(sc, NULL); * iwm_mvm_mac_ctxt_changed(sc, in); - * iwm_mvm_binding_remove_vif(sc, in); + * iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap)); * iwm_mvm_mac_ctxt_remove(sc, in); * * However, that freezes the device not matter which permutations @@ -4283,7 +4283,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) device_printf(sc->sc_dev, "mac ctxt change fail 2 %d\n", error); return error; } - iwm_mvm_binding_remove_vif(sc, in); + iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap)); iwm_mvm_mac_ctxt_remove(sc, in); @@ -6286,6 +6286,9 @@ iwm_vap_create(struct ieee80211com *ic, const char nam /* Override with driver methods. */ ivp->iv_newstate = vap->iv_newstate; vap->iv_newstate = iwm_newstate; + + ivp->id = IWM_DEFAULT_MACID; + ivp->color = IWM_DEFAULT_COLOR; ieee80211_ratectl_init(vap); /* Complete setup. */ Modified: stable/11/sys/dev/iwm/if_iwm_binding.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:36:41 2018 (r330204) @@ -31,7 +31,7 @@ * * GPL LICENSE SUMMARY * - * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved. + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as @@ -51,13 +51,12 @@ * in the file called COPYING. * * Contact Information: - * Intel Linux Wireless + * Intel Linux Wireless * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * - * * BSD LICENSE * - * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved. + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,21 +86,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*- - * Copyright (c) 2007-2010 Damien Bergamini - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ #include __FBSDID("$FreeBSD$"); @@ -160,11 +144,21 @@ __FBSDID("$FreeBSD$"); * BEGIN iwlwifi/mvm/binding.c */ -int -iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t action) +struct iwm_mvm_iface_iterator_data { + int idx; + + struct iwm_mvm_phy_ctxt *phyctxt; + + uint16_t ids[IWM_MAX_MACS_IN_BINDING]; + int16_t colors[IWM_MAX_MACS_IN_BINDING]; +}; + +static int +iwm_mvm_binding_cmd(struct iwm_softc *sc, uint32_t action, + struct iwm_mvm_iface_iterator_data *data) { struct iwm_binding_cmd cmd; - struct iwm_mvm_phy_ctxt *phyctxt = ivp->phy_ctxt; + struct iwm_mvm_phy_ctxt *phyctxt = data->phyctxt; int i, ret; uint32_t status; @@ -175,41 +169,88 @@ iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_v cmd.action = htole32(action); cmd.phy = htole32(IWM_FW_CMD_ID_AND_COLOR(phyctxt->id, phyctxt->color)); - cmd.macs[0] = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, - IWM_DEFAULT_COLOR)); - /* We use MACID 0 here.. */ - for (i = 1; i < IWM_MAX_MACS_IN_BINDING; i++) + for (i = 0; i < IWM_MAX_MACS_IN_BINDING; i++) cmd.macs[i] = htole32(IWM_FW_CTXT_INVALID); + for (i = 0; i < data->idx; i++) + cmd.macs[i] = htole32(IWM_FW_CMD_ID_AND_COLOR(data->ids[i], + data->colors[i])); status = 0; ret = iwm_mvm_send_cmd_pdu_status(sc, IWM_BINDING_CONTEXT_CMD, sizeof(cmd), &cmd, &status); if (ret) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, - "%s: Failed to send binding (action:%d): %d\n", - __func__, action, ret); + device_printf(sc->sc_dev, + "Failed to send binding (action:%d): %d\n", action, ret); return ret; } if (status) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, - "%s: Binding command failed: %u\n", - __func__, - status); + device_printf(sc->sc_dev, + "Binding command failed: %u\n", status); ret = EIO; } return ret; } -int -iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp) +static int +iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp, + struct iwm_mvm_phy_ctxt *phyctxt, boolean_t add) { - return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_MODIFY); + struct iwm_mvm_iface_iterator_data data = { + .phyctxt = phyctxt, + }; + uint32_t action; + + if (add) + action = IWM_FW_CTXT_ACTION_ADD; + else + action = IWM_FW_CTXT_ACTION_REMOVE; + + if (add) { + data.ids[0] = ivp->id; + data.colors[0] = ivp->color; + data.idx++; + } + + return iwm_mvm_binding_cmd(sc, action, &data); } int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp) { - return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_ADD); + if (!ivp->phy_ctxt) + return EINVAL; + +#ifdef notyet + /* + * Update SF - Disable if needed. if this fails, SF might still be on + * while many macs are bound, which is forbidden - so fail the binding. + */ + if (iwm_mvm_sf_update(sc, ivp, FALSE)) + return EINVAL; +#endif + + return iwm_mvm_binding_update(sc, ivp, ivp->phy_ctxt, TRUE); +} + +int +iwm_mvm_binding_remove_vif(struct iwm_softc *sc, struct iwm_vap *ivp) +{ + int ret; + + if (!ivp->phy_ctxt) + return EINVAL; + + ret = iwm_mvm_binding_update(sc, ivp, ivp->phy_ctxt, FALSE); + +#ifdef notyet + if (!ret) { + if (iwm_mvm_sf_update(sc, ivp, TRUE)) + device_printf(sc->sc_dev, + "Failed to update SF state\n"); + } +#endif + + return ret; } Modified: stable/11/sys/dev/iwm/if_iwm_binding.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:36:41 2018 (r330204) @@ -105,9 +105,7 @@ #ifndef __IF_IWM_BINDING_H__ #define __IF_IWM_BINDING_H__ -extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, - uint32_t action); -extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp); extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp); +extern int iwm_mvm_binding_remove_vif(struct iwm_softc *sc, struct iwm_vap *ivp); #endif /* __IF_IWM_BINDING_H__ */ Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:36:41 2018 (r330204) @@ -251,6 +251,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_node *ni = vap->iv_bss; + struct iwm_vap *ivp = IWM_VAP(vap); int cck_ack_rates, ofdm_ack_rates; int i; int is2ghz; @@ -262,8 +263,8 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru * These are both functions of the vap, not of the node. * So, for now, hard-code both to 0 (default). */ - cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, - IWM_DEFAULT_COLOR)); + cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, + ivp->color)); cmd->action = htole32(action); cmd->mac_type = htole32(IWM_FW_MAC_TYPE_BSS_STA); @@ -306,7 +307,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru /* * Default to 2ghz if no node information is given. */ - if (in) { + if (in && in->in_ni.ni_chan != IEEE80211_CHAN_ANYC) { is2ghz = !! IEEE80211_IS_CHAN_2GHZ(in->in_ni.ni_chan); } else { is2ghz = 1; Modified: stable/11/sys/dev/iwm/if_iwm_power.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:36:41 2018 (r330204) @@ -285,9 +285,10 @@ iwm_mvm_power_build_cmd(struct iwm_softc *sc, struct i int keep_alive; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct iwm_vap *ivp = IWM_VAP(vap); - cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, - IWM_DEFAULT_COLOR)); + cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, + ivp->color)); dtimper = vap->iv_dtim_period ?: 1; /* Modified: stable/11/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 06:36:41 2018 (r330204) @@ -165,7 +165,7 @@ __FBSDID("$FreeBSD$"); #define IWM_MVM_ROC_TE_TYPE_MGMT_TX IWM_TE_P2P_CLIENT_ASSOC static int -iwm_mvm_time_event_send_add(struct iwm_softc *sc, struct iwm_node *in, +iwm_mvm_time_event_send_add(struct iwm_softc *sc, struct iwm_vap *ivp, void *te_data, struct iwm_time_event_cmd *te_cmd) { int ret; @@ -185,14 +185,14 @@ iwm_mvm_time_event_send_add(struct iwm_softc *sc, stru } void -iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, +iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t duration, uint32_t max_delay) { struct iwm_time_event_cmd time_cmd = {}; time_cmd.action = htole32(IWM_FW_CTXT_ACTION_ADD); time_cmd.id_and_color = - htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, IWM_DEFAULT_COLOR)); + htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); time_cmd.id = htole32(IWM_TE_BSS_STA_AGGRESSIVE_ASSOC); time_cmd.apply_time = htole32(0); @@ -208,5 +208,5 @@ iwm_mvm_protect_session(struct iwm_softc *sc, struct i IWM_TE_V2_NOTIF_HOST_EVENT_END | IWM_T2_V2_START_IMMEDIATELY); - iwm_mvm_time_event_send_add(sc, in, /*te_data*/NULL, &time_cmd); + iwm_mvm_time_event_send_add(sc, ivp, /*te_data*/NULL, &time_cmd); } Modified: stable/11/sys/dev/iwm/if_iwm_time_event.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_time_event.h Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_time_event.h Thu Mar 1 06:36:41 2018 (r330204) @@ -107,7 +107,7 @@ #ifndef __IF_IWM_TIME_EVENT_H__ #define __IF_IWM_TIME_EVENT_H__ -extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, +extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t duration, uint32_t max_delay); #endif /* __IF_IWM_TIME_EVENT_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:36:41 2018 (r330204) @@ -375,6 +375,9 @@ struct iwm_vap { enum ieee80211_state, int); struct iwm_mvm_phy_ctxt *phy_ctxt; + + uint16_t id; + uint16_t color; }; #define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) From owner-svn-src-all@freebsd.org Thu Mar 1 06:38:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85FE9F2946D; Thu, 1 Mar 2018 06:38:07 +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 3BE506A913; Thu, 1 Mar 2018 06:38:07 +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 36F1424DF6; Thu, 1 Mar 2018 06:38:07 +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 w216c7rc058343; Thu, 1 Mar 2018 06:38:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216c7Xr058342; Thu, 1 Mar 2018 06:38:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010638.w216c7Xr058342@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 06:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330205 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:38:07 -0000 Author: eadler Date: Thu Mar 1 06:38:06 2018 New Revision: 330205 URL: https://svnweb.freebsd.org/changeset/base/330205 Log: MFC r318215: [iwm] change the check for ADD_STA status, use IWM_ADD_STA_STATUS_MASK. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:36:41 2018 (r330204) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:38:06 2018 (r330205) @@ -3909,7 +3909,7 @@ iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iw if (ret) return ret; - switch (status) { + switch (status & IWM_ADD_STA_STATUS_MASK) { case IWM_ADD_STA_SUCCESS: break; default: @@ -3955,7 +3955,7 @@ iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struc if (ret) return ret; - switch (status) { + switch (status & IWM_ADD_STA_STATUS_MASK) { case IWM_ADD_STA_SUCCESS: IWM_DPRINTF(sc, IWM_DEBUG_RESET, "%s: Internal station added.\n", __func__); From owner-svn-src-all@freebsd.org Thu Mar 1 06:38:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D54E9F294F2 for ; Thu, 1 Mar 2018 06:38:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::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 411EE6AA86 for ; Thu, 1 Mar 2018 06:38:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22b.google.com with SMTP id w12so1739423ywa.8 for ; Wed, 28 Feb 2018 22:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=gMmxkGmB/Obn04kDLrXb7jMaz0qaUj3u2sv8CLxfinQ=; b=ogmRQENHvQGcHhe5X9QOXANS/UPvFup+SRCogvgIZ+btA7twSR4xC9CHHO9DU3s6Xu LfOgp+Bt3dStEoHVdrt6h0Vjh4uI8si+6uJn1u6JMMxt1dZrhin2pZXYnaaD+TcLo6+4 0FM5AlckDUwf4BWLp0G1nrTfoR+iVEziMEGIM= 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; bh=gMmxkGmB/Obn04kDLrXb7jMaz0qaUj3u2sv8CLxfinQ=; b=Wvdmx6WUMd717GxR3Z1Vt1X84oI/NmyBOQp6t2v8XUj9Qsin1VuiijGkOkcOhC2RQL GlTIajEKe7JgLZSKd1NBMS0klXVPASL574t7R0rYkDsMzMcMdIFWX4RoVyM8DXQRkaDw 5i0z3sJvCTx6cWLb3cnIYB2wv41u6ipK2n8QPMHZBUpsS9nAs3uSmV4rj0B8pXnK6uGV cea3guHvJJCWtEY92o+O7dm1LR42xqBP8ADGemNBqQZVwYZTQM61Ro+twfgHe4wIQLj0 tLCn6MJyDKmacUhtIcCq3A3xMtyAtAiD4iEE8gSmdvTnBWcRVZQH6O16IhjNsBCMUhfZ 4xrw== X-Gm-Message-State: APf1xPDEenYRczZQntfmh+SNxaBbW1dvSulMDghnALoaMwuevcXoI5c7 VOnA9Lgv0voXxt+eNbeyjYdgUzniRyHs6Pd+ybbaOA== X-Google-Smtp-Source: AG47ELujHZ4hv97o9XrhAC//VXhc8xtODtIN/CpkMqlqk+cnYI2bEllmnJrikgnMbU9NsWloz8Ia4R8fo2/lNWxp1oE= X-Received: by 10.13.219.79 with SMTP id d76mr398813ywe.182.1519886309325; Wed, 28 Feb 2018 22:38:29 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 2002:a25:c68c:0:0:0:0:0 with HTTP; Wed, 28 Feb 2018 22:37:58 -0800 (PST) In-Reply-To: <201803010636.w216af0m058238@repo.freebsd.org> References: <201803010636.w216af0m058238@repo.freebsd.org> From: Eitan Adler Date: Wed, 28 Feb 2018 22:37:58 -0800 X-Google-Sender-Auth: kIS91hhZXkuroyO3Ilf2D7leO80 Message-ID: Subject: Re: svn commit: r330204 - stable/11/sys/dev/iwm To: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:38:31 -0000 On 28 February 2018 at 22:36, Eitan Adler wrote: > Author: eadler > Date: Thu Mar 1 06:36:41 2018 > New Revision: 330204 > URL: https://svnweb.freebsd.org/changeset/base/330204 > > Log: > MFC r318214: This one is actually r318213, r318214, r318215 accidently. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Thu Mar 1 06:38:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BE21F29561; Thu, 1 Mar 2018 06:38:43 +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 E68016ABA1; Thu, 1 Mar 2018 06:38:42 +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 E152624DF7; Thu, 1 Mar 2018 06:38:42 +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 w216cgVq058406; Thu, 1 Mar 2018 06:38:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216cgcb058405; Thu, 1 Mar 2018 06:38:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010638.w216cgcb058405@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 06:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330206 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:38:43 -0000 Author: eadler Date: Thu Mar 1 06:38:42 2018 New Revision: 330206 URL: https://svnweb.freebsd.org/changeset/base/330206 Log: MFC r318216: [iwm] Sync iwm_read_firmware()'s loop to iwlwifi's code. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:38:06 2018 (r330205) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:38:42 2018 (r330206) @@ -548,12 +548,14 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode { struct iwm_fw_info *fw = &sc->sc_fw; const struct iwm_tlv_ucode_header *uhdr; - struct iwm_ucode_tlv tlv; + const struct iwm_ucode_tlv *tlv; struct iwm_ucode_capabilities *capa = &sc->ucode_capa; enum iwm_ucode_tlv_type tlv_type; const struct firmware *fwp; const uint8_t *data; + uint32_t tlv_len; uint32_t usniffer_img; + const uint8_t *tlv_data; uint32_t paging_mem_size; int num_of_cpus; int error = 0; @@ -606,25 +608,21 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto out; } - snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), "%d.%d (API ver %d)", + snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), "%u.%u (API ver %u)", IWM_UCODE_MAJOR(le32toh(uhdr->ver)), IWM_UCODE_MINOR(le32toh(uhdr->ver)), IWM_UCODE_API(le32toh(uhdr->ver))); data = uhdr->data; len = fw->fw_fp->datasize - sizeof(*uhdr); - while (len >= sizeof(tlv)) { - size_t tlv_len; - const void *tlv_data; + while (len >= sizeof(*tlv)) { + len -= sizeof(*tlv); + tlv = (const void *)data; - memcpy(&tlv, data, sizeof(tlv)); - tlv_len = le32toh(tlv.length); - tlv_type = le32toh(tlv.type); + tlv_len = le32toh(tlv->length); + tlv_type = le32toh(tlv->type); + tlv_data = tlv->data; - len -= sizeof(tlv); - data += sizeof(tlv); - tlv_data = data; - if (len < tlv_len) { device_printf(sc->sc_dev, "firmware too short: %zu bytes\n", @@ -632,19 +630,21 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } + len -= roundup2(tlv_len, 4); + data += sizeof(tlv) + roundup2(tlv_len, 4); switch ((int)tlv_type) { case IWM_UCODE_TLV_PROBE_MAX_LEN: - if (tlv_len < sizeof(uint32_t)) { + if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: PROBE_MAX_LEN (%d) < sizeof(uint32_t)\n", + "%s: PROBE_MAX_LEN (%d) != sizeof(uint32_t)\n", __func__, (int) tlv_len); error = EINVAL; goto parse_out; } capa->max_probe_length = - le32toh(*(const uint32_t *)tlv_data); + le32_to_cpup((const uint32_t *)tlv_data); /* limit it to something sensible */ if (capa->max_probe_length > IWM_SCAN_OFFLOAD_PROBE_REQ_SIZE) { @@ -675,6 +675,14 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } + if (tlv_len % sizeof(uint32_t)) { + device_printf(sc->sc_dev, + "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%d) %% sizeof(uint32_t)\n", + __func__, + (int) tlv_len); + error = EINVAL; + goto parse_out; + } /* * Apparently there can be many flags, but Linux driver * parses only the first one, and so do we. @@ -686,7 +694,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode * 2) TLV_FLAGS contains TLV_FLAGS_PAN * ==> this resets TLV_PAN to itself... hnnnk */ - capa->flags = le32toh(*(const uint32_t *)tlv_data); + capa->flags = le32_to_cpup((const uint32_t *)tlv_data); break; case IWM_UCODE_TLV_CSCHEME: if ((error = iwm_store_cscheme(sc, @@ -707,7 +715,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - num_of_cpus = le32toh(*(const uint32_t *)tlv_data); + num_of_cpus = le32_to_cpup((const uint32_t *)tlv_data); if (num_of_cpus == 2) { fw->fw_sects[IWM_UCODE_REGULAR].is_dual_cpus = TRUE; @@ -781,7 +789,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } sc->sc_fw.phy_config = - le32toh(*(const uint32_t *)tlv_data); + le32_to_cpup((const uint32_t *)tlv_data); sc->sc_fw.valid_tx_ant = (sc->sc_fw.phy_config & IWM_FW_PHY_CFG_TX_CHAIN) >> IWM_FW_PHY_CFG_TX_CHAIN_POS; @@ -832,7 +840,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - paging_mem_size = le32toh(*(const uint32_t *)tlv_data); + paging_mem_size = le32_to_cpup((const uint32_t *)tlv_data); IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, "%s: Paging: paging enabled (size = %u bytes)\n", @@ -865,7 +873,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } capa->n_scan_channels = - le32toh(*(const uint32_t *)tlv_data); + le32_to_cpup((const uint32_t *)tlv_data); break; case IWM_UCODE_TLV_FW_VERSION: @@ -890,9 +898,6 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - - len -= roundup(tlv_len, 4); - data += roundup(tlv_len, 4); } KASSERT(error == 0, ("unhandled error")); From owner-svn-src-all@freebsd.org Thu Mar 1 06:39:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 824CAF29651; Thu, 1 Mar 2018 06:39:15 +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 31B9E6AD62; Thu, 1 Mar 2018 06:39:15 +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 2CC0D24DFA; Thu, 1 Mar 2018 06:39:15 +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 w216dFLD058474; Thu, 1 Mar 2018 06:39:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216dF2a058473; Thu, 1 Mar 2018 06:39:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010639.w216dF2a058473@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 06:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330207 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:39:15 -0000 Author: eadler Date: Thu Mar 1 06:39:14 2018 New Revision: 330207 URL: https://svnweb.freebsd.org/changeset/base/330207 Log: MFC r318217: [iwm] Change UCODE_TLV_API #define-s from bitmasks to indexes. * Fixes oversight from commit 757eecf0e6c92745aa2eee95811e573c8300850e. fw_has_api now uses the isset macro instead of a simple logical-and. Modified: stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:38:42 2018 (r330206) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:39:14 2018 (r330207) @@ -669,12 +669,12 @@ P2P_PS_SCM\31UAPSD_SUPPORT\32EBS\33P2P_PS_UAPSD\36BCAS * @IWM_NUM_UCODE_TLV_API: number of bits used */ enum iwm_ucode_tlv_api { - IWM_UCODE_TLV_API_FRAGMENTED_SCAN = (1 << 8), - IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = (1 << 9), - IWM_UCODE_TLV_API_WIDE_CMD_HDR = (1 << 14), - IWM_UCODE_TLV_API_LQ_SS_PARAMS = (1 << 18), - IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = (1 << 24), - IWM_UCODE_TLV_API_TX_POWER_CHAIN = (1 << 27), + IWM_UCODE_TLV_API_FRAGMENTED_SCAN = 8, + IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = 9, + IWM_UCODE_TLV_API_WIDE_CMD_HDR = 14, + IWM_UCODE_TLV_API_LQ_SS_PARAMS = 18, + IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = 24, + IWM_UCODE_TLV_API_TX_POWER_CHAIN = 27, IWM_NUM_UCODE_TLV_API = 32 }; From owner-svn-src-all@freebsd.org Thu Mar 1 06:39:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18FF2F296E8; Thu, 1 Mar 2018 06:39:45 +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 C06E66AF08; Thu, 1 Mar 2018 06:39:44 +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 BB49524DFC; Thu, 1 Mar 2018 06:39:44 +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 w216dinc058538; Thu, 1 Mar 2018 06:39:44 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216dik6058535; Thu, 1 Mar 2018 06:39:44 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010639.w216dik6058535@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 06:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330208 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:39:45 -0000 Author: eadler Date: Thu Mar 1 06:39:44 2018 New Revision: 330208 URL: https://svnweb.freebsd.org/changeset/base/330208 Log: MFC r318218: [iwm] Process multiple frames per RX buffer. * Factor out iwm_handle_rxb() function from iwm_notif_intr(). * Removing the IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK flag allows the device to put multiple frames (both command responses and 80211 frames) into a single RX buffer. * Uses m_copym() to split up the receive buffers when multiple 80211 frames are received in one RX buffer. The effect is basically the same as when using m_split(), but we want to keep the original mbuf around when calling iwm_mvm_rx_rx_mpdu() to make error handling a bit easier for now. * Contains a small optimization to avoid the m_copym() when only a single 80211 frame is received in one RX buffer (i.e. matching the existing behaviour). Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:39:14 2018 (r330207) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:39:44 2018 (r330208) @@ -168,6 +168,9 @@ __FBSDID("$FreeBSD$"); #include #include +/* From DragonflyBSD */ +#define mtodoff(m, t, off) ((t)((m)->m_data + (off))) + const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, @@ -319,16 +322,15 @@ static int iwm_rx_addbuf(struct iwm_softc *, int, int) static int iwm_mvm_get_signal_strength(struct iwm_softc *, struct iwm_rx_phy_info *); static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, - struct iwm_rx_packet *, - struct iwm_rx_data *); + struct iwm_rx_packet *); static int iwm_get_noise(struct iwm_softc *sc, const struct iwm_mvm_statistics_rx_non_phy *); -static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *); +static boolean_t iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *, + uint32_t, boolean_t); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); -static void iwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *, - struct iwm_rx_data *); +static void iwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *); static void iwm_cmd_done(struct iwm_softc *, struct iwm_rx_packet *); #if 0 static void iwm_update_sched(struct iwm_softc *, int, int, uint8_t, @@ -384,6 +386,7 @@ static const char * static void iwm_nic_error(struct iwm_softc *); static void iwm_nic_umac_error(struct iwm_softc *); #endif +static void iwm_handle_rxb(struct iwm_softc *, struct mbuf *); static void iwm_notif_intr(struct iwm_softc *); static void iwm_intr(void *); static int iwm_attach(device_t); @@ -1431,14 +1434,21 @@ iwm_nic_rx_init(struct iwm_softc *sc) IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_STTS_WPTR_REG, sc->rxq.stat_dma.paddr >> 4); - /* Enable RX. */ + /* Enable Rx DMA + * XXX 5000 HW isn't supported by the iwm(4) driver. + * IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY is set because of HW bug in + * the credit mechanism in 5000 HW RX FIFO + * Direct rx interrupts to hosts + * Rx buffer size 4 or 8k or 12k + * RB timeout 0x10 + * 256 RBDs + */ IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL | IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY | /* HW bug */ IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL | - IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK | - (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) | IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K | + (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) | IWM_RX_QUEUE_SIZE_LOG << IWM_FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS); IWM_WRITE_1(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_TIMEOUT_DEF); @@ -3125,13 +3135,11 @@ iwm_mvm_get_signal_strength(struct iwm_softc *sc, stru } static void -iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, - struct iwm_rx_packet *pkt, struct iwm_rx_data *data) +iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_rx_phy_info *phy_info = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_RECV, "received PHY stats\n"); - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); memcpy(&sc->sc_last_phy_info, phy_info, sizeof(sc->sc_last_phy_info)); } @@ -3175,8 +3183,9 @@ iwm_get_noise(struct iwm_softc *sc, * * Handles the actual data of the Rx packet from the fw */ -static void -iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m) +static boolean_t +iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, + boolean_t stolen) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); @@ -3185,7 +3194,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * struct ieee80211_rx_stats rxs; struct iwm_rx_phy_info *phy_info; struct iwm_rx_mpdu_res_start *rx_res; - struct iwm_rx_packet *pkt = mtod(m, struct iwm_rx_packet *); + struct iwm_rx_packet *pkt = mtodoff(m, struct iwm_rx_packet *, offset); uint32_t len; uint32_t rx_pkt_status; int rssi; @@ -3216,7 +3225,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * rssi = rssi - sc->sc_noise; /* replenish ring for the buffer we're going to feed to the sharks */ - if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { + if (!stolen && iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { device_printf(sc->sc_dev, "%s: unable to add more buffers\n", __func__); goto fail; @@ -3296,9 +3305,10 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * } IWM_LOCK(sc); - return; + return TRUE; fail: counter_u64_add(ic->ic_ierrors, 1); + return FALSE; } static int @@ -3338,8 +3348,7 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct } static void -iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, - struct iwm_rx_packet *pkt, struct iwm_rx_data *data) +iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_cmd_header *cmd_hdr = &pkt->hdr; int idx = cmd_hdr->idx; @@ -3354,8 +3363,6 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, KASSERT(txd->in != NULL, ("txd without node")); KASSERT(txd->m != NULL, ("txd without mbuf")); - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - sc->sc_tx_timer = 0; status = iwm_mvm_rx_tx_cmd_single(sc, pkt, in); @@ -5358,68 +5365,95 @@ iwm_nic_error(struct iwm_softc *sc) } #endif -#define ADVANCE_RXQ(sc) (sc->rxq.cur = (sc->rxq.cur + 1) % IWM_RX_RING_COUNT); - -/* - * Process an IWM_CSR_INT_BIT_FH_RX or IWM_CSR_INT_BIT_SW_RX interrupt. - * Basic structure from if_iwn - */ static void -iwm_notif_intr(struct iwm_softc *sc) +iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) { struct ieee80211com *ic = &sc->sc_ic; - uint16_t hw; + struct iwm_cmd_response *cresp; + struct mbuf *m1; + uint32_t offset = 0; + uint32_t maxoff = IWM_RBUF_SIZE; + uint32_t nextoff; + boolean_t stolen = FALSE; - bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map, - BUS_DMASYNC_POSTREAD); +#define HAVEROOM(a) \ + ((a) + sizeof(uint32_t) + sizeof(struct iwm_cmd_header) < maxoff) - hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff; + while (HAVEROOM(offset)) { + struct iwm_rx_packet *pkt = mtodoff(m, struct iwm_rx_packet *, + offset); + int qid, idx, code, len; - /* - * Process responses - */ - while (sc->rxq.cur != hw) { - struct iwm_rx_ring *ring = &sc->rxq; - struct iwm_rx_data *data = &ring->data[ring->cur]; - struct iwm_rx_packet *pkt; - struct iwm_cmd_response *cresp; - int qid, idx, code; - - bus_dmamap_sync(ring->data_dmat, data->map, - BUS_DMASYNC_POSTREAD); - pkt = mtod(data->m, struct iwm_rx_packet *); - - qid = pkt->hdr.qid & ~0x80; + qid = pkt->hdr.qid; idx = pkt->hdr.idx; code = IWM_WIDE_ID(pkt->hdr.flags, pkt->hdr.code); - IWM_DPRINTF(sc, IWM_DEBUG_INTR, - "rx packet qid=%d idx=%d type=%x %d %d\n", - pkt->hdr.qid & ~0x80, pkt->hdr.idx, code, ring->cur, hw); /* * randomly get these from the firmware, no idea why. * they at least seem harmless, so just ignore them for now */ - if (__predict_false((pkt->hdr.code == 0 && qid == 0 && idx == 0) - || pkt->len_n_flags == htole32(0x55550000))) { - ADVANCE_RXQ(sc); - continue; + if ((pkt->hdr.code == 0 && (qid & ~0x80) == 0 && idx == 0) || + pkt->len_n_flags == htole32(IWM_FH_RSCSR_FRAME_INVALID)) { + break; } + IWM_DPRINTF(sc, IWM_DEBUG_INTR, + "rx packet qid=%d idx=%d type=%x\n", + qid & ~0x80, pkt->hdr.idx, code); + + len = le32toh(pkt->len_n_flags) & IWM_FH_RSCSR_FRAME_SIZE_MSK; + len += sizeof(uint32_t); /* account for status word */ + nextoff = offset + roundup2(len, IWM_FH_RSCSR_FRAME_ALIGN); + iwm_notification_wait_notify(sc->sc_notif_wait, code, pkt); switch (code) { case IWM_REPLY_RX_PHY_CMD: - iwm_mvm_rx_rx_phy_cmd(sc, pkt, data); + iwm_mvm_rx_rx_phy_cmd(sc, pkt); break; - case IWM_REPLY_RX_MPDU_CMD: - iwm_mvm_rx_rx_mpdu(sc, data->m); + case IWM_REPLY_RX_MPDU_CMD: { + /* + * If this is the last frame in the RX buffer, we + * can directly feed the mbuf to the sharks here. + */ + struct iwm_rx_packet *nextpkt = mtodoff(m, + struct iwm_rx_packet *, nextoff); + if (!HAVEROOM(nextoff) || + (nextpkt->hdr.code == 0 && + (nextpkt->hdr.qid & ~0x80) == 0 && + nextpkt->hdr.idx == 0) || + (nextpkt->len_n_flags == + htole32(IWM_FH_RSCSR_FRAME_INVALID))) { + if (iwm_mvm_rx_rx_mpdu(sc, m, offset, stolen)) { + stolen = FALSE; + /* Make sure we abort the loop */ + nextoff = maxoff; + } + break; + } + + /* + * Use m_copym instead of m_split, because that + * makes it easier to keep a valid rx buffer in + * the ring, when iwm_mvm_rx_rx_mpdu() fails. + * + * We need to start m_copym() at offset 0, to get the + * M_PKTHDR flag preserved. + */ + m1 = m_copym(m, 0, M_COPYALL, M_NOWAIT); + if (m1) { + if (iwm_mvm_rx_rx_mpdu(sc, m1, offset, stolen)) + stolen = TRUE; + else + m_freem(m1); + } break; + } case IWM_TX_CMD: - iwm_mvm_rx_tx_cmd(sc, pkt, data); + iwm_mvm_rx_tx_cmd(sc, pkt); break; case IWM_MISSED_BEACONS_NOTIFICATION: { @@ -5480,7 +5514,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: - if (sc->sc_wantresp == ((qid << 16) | idx)) { + if (sc->sc_wantresp == (((qid & ~0x80) << 16) | idx)) { memcpy(sc->sc_cmd_resp, pkt, sizeof(sc->sc_cmd_resp)); } @@ -5540,7 +5574,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_BT_CONFIG: case IWM_REPLY_THERMAL_MNG_BACKOFF: cresp = (void *)pkt->data; - if (sc->sc_wantresp == ((qid << 16) | idx)) { + if (sc->sc_wantresp == (((qid & ~0x80) << 16) | idx)) { memcpy(sc->sc_cmd_resp, pkt, sizeof(*pkt)+sizeof(*cresp)); } @@ -5634,7 +5668,7 @@ iwm_notif_intr(struct iwm_softc *sc) default: device_printf(sc->sc_dev, "frame %d/%d %x UNHANDLED (this should " - "not happen)\n", qid, idx, + "not happen)\n", qid & ~0x80, idx, pkt->len_n_flags); break; } @@ -5653,20 +5687,55 @@ iwm_notif_intr(struct iwm_softc *sc) * uses a slightly different format for pkt->hdr, and "qid" * is actually the upper byte of a two-byte field. */ - if (!(pkt->hdr.qid & (1 << 7))) { + if (!(qid & (1 << 7))) iwm_cmd_done(sc, pkt); - } - ADVANCE_RXQ(sc); + offset = nextoff; } + if (stolen) + m_freem(m); +#undef HAVEROOM +} +/* + * Process an IWM_CSR_INT_BIT_FH_RX or IWM_CSR_INT_BIT_SW_RX interrupt. + * Basic structure from if_iwn + */ +static void +iwm_notif_intr(struct iwm_softc *sc) +{ + uint16_t hw; + + bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map, + BUS_DMASYNC_POSTREAD); + + hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff; + /* - * Tell the firmware what we have processed. + * Process responses + */ + while (sc->rxq.cur != hw) { + struct iwm_rx_ring *ring = &sc->rxq; + struct iwm_rx_data *data = &ring->data[ring->cur]; + + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTREAD); + + IWM_DPRINTF(sc, IWM_DEBUG_INTR, + "%s: hw = %d cur = %d\n", __func__, hw, ring->cur); + iwm_handle_rxb(sc, data->m); + + ring->cur = (ring->cur + 1) % IWM_RX_RING_COUNT; + } + + /* + * Tell the firmware that it can reuse the ring entries that + * we have just processed. * Seems like the hardware gets upset unless we align * the write by 8?? */ hw = (hw == 0) ? IWM_RX_RING_COUNT - 1 : hw - 1; - IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_WPTR, hw & ~7); + IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_WPTR, rounddown2(hw, 8)); } static void Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:39:14 2018 (r330207) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:39:44 2018 (r330208) @@ -5972,16 +5972,9 @@ struct iwm_dts_measurement_notif_v2 { #define IWM_FRAME_LIMIT 64 /* - * From Linux commit ab02165ccec4c78162501acedeef1a768acdb811: - * As the firmware is slowly running out of command IDs and grouping of - * commands is desirable anyway, the firmware is extending the command - * header from 4 bytes to 8 bytes to introduce a group (in place of the - * former flags field, since that's always 0 on commands and thus can - * be easily used to distinguish between the two). - * * These functions retrieve specific information from the id field in * the iwm_host_cmd struct which contains the command id, the group id, - * and the version of the command. + * and the version of the command and vice versa. */ static inline uint8_t iwm_cmd_opcode(uint32_t cmdid) @@ -5992,7 +5985,7 @@ iwm_cmd_opcode(uint32_t cmdid) static inline uint8_t iwm_cmd_groupid(uint32_t cmdid) { - return ((cmdid & 0Xff00) >> 8); + return ((cmdid & 0xff00) >> 8); } static inline uint8_t @@ -6085,6 +6078,8 @@ struct iwm_rx_packet { } __packed; #define IWM_FH_RSCSR_FRAME_SIZE_MSK 0x00003fff +#define IWM_FH_RSCSR_FRAME_INVALID 0x55550000 +#define IWM_FH_RSCSR_FRAME_ALIGN 0x40 static inline uint32_t iwm_rx_packet_len(const struct iwm_rx_packet *pkt) Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:39:14 2018 (r330207) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:39:44 2018 (r330208) @@ -304,7 +304,6 @@ struct iwm_tx_ring { }; #define IWM_RX_RING_COUNT 256 -#define IWM_RBUF_COUNT (IWM_RX_RING_COUNT + 32) /* Linux driver optionally uses 8k buffer */ #define IWM_RBUF_SIZE 4096 From owner-svn-src-all@freebsd.org Thu Mar 1 06:40:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02F99F297DB; Thu, 1 Mar 2018 06:40:09 +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 A3F216B09C; Thu, 1 Mar 2018 06:40:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E79A24E05; Thu, 1 Mar 2018 06:40:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216e8Nu058636; Thu, 1 Mar 2018 06:40:08 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216e81c058632; Thu, 1 Mar 2018 06:40:08 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010640.w216e81c058632@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 06:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330209 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:40:09 -0000 Author: eadler Date: Thu Mar 1 06:40:08 2018 New Revision: 330209 URL: https://svnweb.freebsd.org/changeset/base/330209 Log: MFC r318219: [iwm] Properly implement iwm_wme_update callback function. * Inspired by iwn(4) and Linux iwlwifi. * Read wme parameters into a buffer within struct iwm_vap in iwm_wme_update(). * If we aren't associated yet, the new settings will soon be sent by iwm_mvm_mac_ctxt_changed() during association. * If we are already associated, explicitly call iwm_mvm_mac_ctxt_changed() from iwm_wme_update() to send the new settings to the firmware. * Change iwm_mvm_ac_to_tx_fifo mapping, to fit the freebsd net80211 WME stream class numbering, instead of Linux's enum ieee80211_ac_numbers. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c stable/11/sys/dev/iwm/if_iwm_mac_ctxt.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:39:44 2018 (r330208) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:40:08 2018 (r330209) @@ -1532,13 +1532,6 @@ iwm_nic_init(struct iwm_softc *sc) return 0; } -const uint8_t iwm_mvm_ac_to_tx_fifo[] = { - IWM_MVM_TX_FIFO_VO, - IWM_MVM_TX_FIFO_VI, - IWM_MVM_TX_FIFO_BE, - IWM_MVM_TX_FIFO_BK, -}; - static int iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo) { @@ -4242,7 +4235,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * from RUN back to SCAN is: * * iwm_mvm_power_mac_disable(sc, in); - * iwm_mvm_mac_ctxt_changed(sc, in); + * iwm_mvm_mac_ctxt_changed(sc, vap); * iwm_mvm_rm_sta(sc, in); * iwm_mvm_update_quotas(sc, NULL); * iwm_mvm_mac_ctxt_changed(sc, in); @@ -4279,7 +4272,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) iwm_mvm_power_mac_disable(sc, in); - if ((error = iwm_mvm_mac_ctxt_changed(sc, in)) != 0) { + if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, "mac ctxt change fail 1 %d\n", error); return error; } @@ -4291,7 +4284,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) error = iwm_mvm_rm_sta(sc, in); in->in_assoc = 0; iwm_mvm_update_quotas(sc, NULL); - if ((error = iwm_mvm_mac_ctxt_changed(sc, in)) != 0) { + if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, "mac ctxt change fail 2 %d\n", error); return error; } @@ -6244,12 +6237,47 @@ iwm_is_valid_ether_addr(uint8_t *addr) } static int -iwm_update_edca(struct ieee80211com *ic) +iwm_wme_update(struct ieee80211com *ic) { +#define IWM_EXP2(x) ((1 << (x)) - 1) /* CWmin = 2^ECWmin - 1 */ struct iwm_softc *sc = ic->ic_softc; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct iwm_vap *ivp = IWM_VAP(vap); + struct iwm_node *in; + struct wmeParams tmp[WME_NUM_AC]; + int aci, error; - device_printf(sc->sc_dev, "%s: called\n", __func__); + if (vap == NULL) + return (0); + + IEEE80211_LOCK(ic); + for (aci = 0; aci < WME_NUM_AC; aci++) + tmp[aci] = ic->ic_wme.wme_chanParams.cap_wmeParams[aci]; + IEEE80211_UNLOCK(ic); + + IWM_LOCK(sc); + for (aci = 0; aci < WME_NUM_AC; aci++) { + const struct wmeParams *ac = &tmp[aci]; + ivp->queue_params[aci].aifsn = ac->wmep_aifsn; + ivp->queue_params[aci].cw_min = IWM_EXP2(ac->wmep_logcwmin); + ivp->queue_params[aci].cw_max = IWM_EXP2(ac->wmep_logcwmax); + ivp->queue_params[aci].edca_txop = + IEEE80211_TXOP_TO_US(ac->wmep_txopLimit); + } + ivp->have_wme = TRUE; + if (ivp->is_uploaded && vap->iv_bss != NULL) { + in = IWM_NODE(vap->iv_bss); + if (in->in_assoc) { + if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { + device_printf(sc->sc_dev, + "%s: failed to update MAC\n", __func__); + } + } + } + IWM_UNLOCK(sc); + return (0); +#undef IWM_EXP2 } static void @@ -6306,7 +6334,7 @@ iwm_preinit(void *arg) ic->ic_set_channel = iwm_set_channel; ic->ic_scan_curchan = iwm_scan_curchan; ic->ic_scan_mindwell = iwm_scan_mindwell; - ic->ic_wme.wme_update = iwm_update_edca; + ic->ic_wme.wme_update = iwm_wme_update; ic->ic_parent = iwm_parent; ic->ic_transmit = iwm_transmit; iwm_radiotap_attach(sc); @@ -6363,6 +6391,8 @@ iwm_vap_create(struct ieee80211com *ic, const char nam ivp->id = IWM_DEFAULT_MACID; ivp->color = IWM_DEFAULT_COLOR; + + ivp->have_wme = FALSE; ieee80211_ratectl_init(vap); /* Complete setup. */ Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:39:44 2018 (r330208) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:40:08 2018 (r330209) @@ -160,6 +160,13 @@ __FBSDID("$FreeBSD$"); * BEGIN mvm/mac-ctxt.c */ +const uint8_t iwm_mvm_ac_to_tx_fifo[] = { + IWM_MVM_TX_FIFO_BE, + IWM_MVM_TX_FIFO_BK, + IWM_MVM_TX_FIFO_VI, + IWM_MVM_TX_FIFO_VO, +}; + static void iwm_mvm_ack_rates(struct iwm_softc *sc, int is2ghz, int *cck_rates, int *ofdm_rates, struct iwm_node *in) @@ -328,16 +335,19 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru * cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA) */ - /* XXX TODO: set wme parameters; also handle getting updated wme parameters */ - for (i = 0; i < IWM_AC_NUM+1; i++) { - int txf = i; + for (i = 0; i < WME_NUM_AC; i++) { + uint8_t txf = iwm_mvm_ac_to_tx_fifo[i]; - cmd->ac[txf].cw_min = htole16(0x0f); - cmd->ac[txf].cw_max = htole16(0x3f); - cmd->ac[txf].aifsn = 1; + cmd->ac[txf].cw_min = htole16(ivp->queue_params[i].cw_min); + cmd->ac[txf].cw_max = htole16(ivp->queue_params[i].cw_max); + cmd->ac[txf].edca_txop = + htole16(ivp->queue_params[i].edca_txop); + cmd->ac[txf].aifsn = ivp->queue_params[i].aifsn; cmd->ac[txf].fifos_mask = (1 << txf); - cmd->ac[txf].edca_txop = 0; } + + if (ivp->have_wme) + cmd->qos_flags |= htole32(IWM_MAC_QOS_FLG_UPDATE_EDCA); if (ic->ic_flags & IEEE80211_F_USEPROT) cmd->protection_flags |= htole32(IWM_MAC_PROT_FLG_TGG_PROTECT); Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.h Thu Mar 1 06:39:44 2018 (r330208) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.h Thu Mar 1 06:40:08 2018 (r330209) @@ -106,6 +106,8 @@ #ifndef __IF_IWM_MAC_CTXT_H__ #define __IF_IWM_MAC_CTXT_H__ +extern const uint8_t iwm_mvm_ac_to_tx_fifo[]; + extern int iwm_mvm_mac_ctxt_add(struct iwm_softc *sc, struct ieee80211vap *vap); extern int iwm_mvm_mac_ctxt_changed(struct iwm_softc *sc, struct ieee80211vap *vap); extern int iwm_mvm_mac_ctxt_remove(struct iwm_softc *sc, struct ieee80211vap *vap); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:39:44 2018 (r330208) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:40:08 2018 (r330209) @@ -377,6 +377,19 @@ struct iwm_vap { uint16_t id; uint16_t color; + + boolean_t have_wme; + /* + * QoS data from net80211, need to store this here + * as net80211 has a separate callback but we need + * to have the data for the MAC context + */ + struct { + uint16_t cw_min; + uint16_t cw_max; + uint16_t edca_txop; + uint8_t aifsn; + } queue_params[WME_NUM_AC]; }; #define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) From owner-svn-src-all@freebsd.org Thu Mar 1 06:41:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0F7F29AF9; Thu, 1 Mar 2018 06:41:36 +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 1648C6B5C6; Thu, 1 Mar 2018 06:41:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10F0624E58; Thu, 1 Mar 2018 06:41:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216fa4n059433; Thu, 1 Mar 2018 06:41:36 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216fZAX059427; Thu, 1 Mar 2018 06:41:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010641.w216fZAX059427@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 06:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330210 - in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Commit-Revision: 330210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:41:36 -0000 Author: eadler Date: Thu Mar 1 06:41:35 2018 New Revision: 330210 URL: https://svnweb.freebsd.org/changeset/base/330210 Log: MFC r318222: [iwm] Factor out firmware station handling into if_iwm_sta.c. * This adds iwm_mvm_rm_sta(), which will be used to tear down firmware state for better/cleaner iwm_newstate() handling. * Makes iwm_enable_txq() and iwm_mvm_flush_tx_path() non-static, add the declarations to if_iwm_util.h for now. Added: stable/11/sys/dev/iwm/if_iwm_sta.c - copied unchanged from r318222, head/sys/dev/iwm/if_iwm_sta.c stable/11/sys/dev/iwm/if_iwm_sta.h - copied unchanged from r318222, head/sys/dev/iwm/if_iwm_sta.h Modified: stable/11/sys/conf/files stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_util.h stable/11/sys/modules/iwm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 06:40:08 2018 (r330209) +++ stable/11/sys/conf/files Thu Mar 1 06:41:35 2018 (r330210) @@ -1881,6 +1881,7 @@ dev/iwm/if_iwm_phy_ctxt.c optional iwm dev/iwm/if_iwm_phy_db.c optional iwm dev/iwm/if_iwm_power.c optional iwm dev/iwm/if_iwm_scan.c optional iwm +dev/iwm/if_iwm_sta.c optional iwm dev/iwm/if_iwm_time_event.c optional iwm dev/iwm/if_iwm_util.c optional iwm iwm3160fw.c optional iwm3160fw | iwmfw \ Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:40:08 2018 (r330209) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:41:35 2018 (r330210) @@ -163,6 +163,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -264,7 +265,6 @@ static void iwm_mvm_nic_config(struct iwm_softc *); static int iwm_nic_rx_init(struct iwm_softc *); static int iwm_nic_tx_init(struct iwm_softc *); static int iwm_nic_init(struct iwm_softc *); -static int iwm_enable_txq(struct iwm_softc *, int, int, int); static int iwm_trans_pcie_fw_alive(struct iwm_softc *, uint32_t); static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t, uint16_t, uint8_t *, uint16_t *); @@ -343,19 +343,6 @@ static int iwm_tx(struct iwm_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); -static int iwm_mvm_flush_tx_path(struct iwm_softc *sc, - uint32_t tfd_msk, uint32_t flags); -static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *, - struct iwm_mvm_add_sta_cmd *, - int *); -static int iwm_mvm_sta_send_to_fw(struct iwm_softc *, struct iwm_node *, - int); -static int iwm_mvm_add_sta(struct iwm_softc *, struct iwm_node *); -static int iwm_mvm_update_sta(struct iwm_softc *, struct iwm_node *); -static int iwm_mvm_add_int_sta_common(struct iwm_softc *, - struct iwm_int_sta *, - const uint8_t *, uint16_t, uint16_t); -static int iwm_mvm_add_aux_sta(struct iwm_softc *); static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); static int iwm_assoc(struct ieee80211vap *, struct iwm_softc *); @@ -1532,7 +1519,7 @@ iwm_nic_init(struct iwm_softc *sc) return 0; } -static int +int iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo) { if (!iwm_nic_lock(sc)) { @@ -3867,137 +3854,6 @@ iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t t "Flushing tx queue failed: %d\n", ret); return ret; } - -/* - * BEGIN mvm/sta.c - */ - -static int -iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *sc, - struct iwm_mvm_add_sta_cmd *cmd, int *status) -{ - return iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, sizeof(*cmd), - cmd, status); -} - -/* send station add/update command to firmware */ -static int -iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, int update) -{ - struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); - struct iwm_mvm_add_sta_cmd add_sta_cmd; - int ret; - uint32_t status; - - memset(&add_sta_cmd, 0, sizeof(add_sta_cmd)); - - add_sta_cmd.sta_id = IWM_STATION_ID; - add_sta_cmd.mac_id_n_color - = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); - if (!update) { - int ac; - for (ac = 0; ac < WME_NUM_AC; ac++) { - add_sta_cmd.tfd_queue_msk |= - htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); - } - IEEE80211_ADDR_COPY(&add_sta_cmd.addr, in->in_ni.ni_bssid); - } - add_sta_cmd.add_modify = update ? 1 : 0; - add_sta_cmd.station_flags_msk - |= htole32(IWM_STA_FLG_FAT_EN_MSK | IWM_STA_FLG_MIMO_EN_MSK); - add_sta_cmd.tid_disable_tx = htole16(0xffff); - if (update) - add_sta_cmd.modify_mask |= (IWM_STA_MODIFY_TID_DISABLE_TX); - - status = IWM_ADD_STA_SUCCESS; - ret = iwm_mvm_send_add_sta_cmd_status(sc, &add_sta_cmd, &status); - if (ret) - return ret; - - switch (status & IWM_ADD_STA_STATUS_MASK) { - case IWM_ADD_STA_SUCCESS: - break; - default: - ret = EIO; - device_printf(sc->sc_dev, "IWM_ADD_STA failed\n"); - break; - } - - return ret; -} - -static int -iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in) -{ - return iwm_mvm_sta_send_to_fw(sc, in, 0); -} - -static int -iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in) -{ - return iwm_mvm_sta_send_to_fw(sc, in, 1); -} - -static int -iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struct iwm_int_sta *sta, - const uint8_t *addr, uint16_t mac_id, uint16_t color) -{ - struct iwm_mvm_add_sta_cmd cmd; - int ret; - uint32_t status; - - memset(&cmd, 0, sizeof(cmd)); - cmd.sta_id = sta->sta_id; - cmd.mac_id_n_color = htole32(IWM_FW_CMD_ID_AND_COLOR(mac_id, color)); - - cmd.tfd_queue_msk = htole32(sta->tfd_queue_msk); - cmd.tid_disable_tx = htole16(0xffff); - - if (addr) - IEEE80211_ADDR_COPY(cmd.addr, addr); - - ret = iwm_mvm_send_add_sta_cmd_status(sc, &cmd, &status); - if (ret) - return ret; - - switch (status & IWM_ADD_STA_STATUS_MASK) { - case IWM_ADD_STA_SUCCESS: - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s: Internal station added.\n", __func__); - return 0; - default: - device_printf(sc->sc_dev, - "%s: Add internal station failed, status=0x%x\n", - __func__, status); - ret = EIO; - break; - } - return ret; -} - -static int -iwm_mvm_add_aux_sta(struct iwm_softc *sc) -{ - int ret; - - sc->sc_aux_sta.sta_id = IWM_AUX_STA_ID; - sc->sc_aux_sta.tfd_queue_msk = (1 << IWM_MVM_AUX_QUEUE); - - ret = iwm_enable_txq(sc, 0, IWM_MVM_AUX_QUEUE, IWM_MVM_TX_FIFO_MCAST); - if (ret) - return ret; - - ret = iwm_mvm_add_int_sta_common(sc, - &sc->sc_aux_sta, NULL, IWM_MAC_INDEX_AUX, 0); - - if (ret) - memset(&sc->sc_aux_sta, 0, sizeof(sc->sc_aux_sta)); - return ret; -} - -/* - * END mvm/sta.c - */ /* * BEGIN mvm/quota.c Copied: stable/11/sys/dev/iwm/if_iwm_sta.c (from r318222, head/sys/dev/iwm/if_iwm_sta.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:41:35 2018 (r330210, copy of r318222, head/sys/dev/iwm/if_iwm_sta.c) @@ -0,0 +1,378 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 4.7.3 (tag id d7f6728f57e3ecbb7ef34eb7d9f564d514775d75) + * + *********************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" +#include "opt_iwm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * New version of ADD_STA_sta command added new fields at the end of the + * structure, so sending the size of the relevant API's structure is enough to + * support both API versions. + */ +static inline int +iwm_mvm_add_sta_cmd_size(struct iwm_softc *sc) +{ +#ifdef notyet + return iwm_mvm_has_new_rx_api(mvm) ? + sizeof(struct iwm_mvm_add_sta_cmd) : + sizeof(struct iwm_mvm_add_sta_cmd_v7); +#else + return sizeof(struct iwm_mvm_add_sta_cmd); +#endif +} + +/* send station add/update command to firmware */ +int +iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, + boolean_t update) +{ + struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); + struct iwm_mvm_add_sta_cmd add_sta_cmd = { + .sta_id = IWM_STATION_ID, + .mac_id_n_color = + htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)), + .add_modify = update ? 1 : 0, + .station_flags_msk = htole32(IWM_STA_FLG_FAT_EN_MSK | + IWM_STA_FLG_MIMO_EN_MSK), + .tid_disable_tx = htole16(0xffff), + }; + int ret; + uint32_t status; + uint32_t agg_size = 0, mpdu_dens = 0; + + if (!update) { + int ac; + for (ac = 0; ac < WME_NUM_AC; ac++) { + add_sta_cmd.tfd_queue_msk |= + htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); + } + IEEE80211_ADDR_COPY(&add_sta_cmd.addr, in->in_ni.ni_bssid); + } + + add_sta_cmd.station_flags |= + htole32(agg_size << IWM_STA_FLG_MAX_AGG_SIZE_SHIFT); + add_sta_cmd.station_flags |= + htole32(mpdu_dens << IWM_STA_FLG_AGG_MPDU_DENS_SHIFT); + + status = IWM_ADD_STA_SUCCESS; + ret = iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, + iwm_mvm_add_sta_cmd_size(sc), + &add_sta_cmd, &status); + if (ret) + return ret; + + switch (status & IWM_ADD_STA_STATUS_MASK) { + case IWM_ADD_STA_SUCCESS: + IWM_DPRINTF(sc, IWM_DEBUG_NODE, "IWM_ADD_STA PASSED\n"); + break; + default: + ret = EIO; + device_printf(sc->sc_dev, "IWM_ADD_STA failed\n"); + break; + } + + return ret; +} + +int +iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in) +{ + return iwm_mvm_sta_send_to_fw(sc, in, FALSE); +} + +int +iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in) +{ + return iwm_mvm_sta_send_to_fw(sc, in, TRUE); +} + +int +iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, boolean_t drain) +{ + struct iwm_mvm_add_sta_cmd cmd = {}; + struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); + int ret; + uint32_t status; + + cmd.mac_id_n_color = + htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); + cmd.sta_id = IWM_STATION_ID; + cmd.add_modify = IWM_STA_MODE_MODIFY; + cmd.station_flags = drain ? htole32(IWM_STA_FLG_DRAIN_FLOW) : 0; + cmd.station_flags_msk = htole32(IWM_STA_FLG_DRAIN_FLOW); + + status = IWM_ADD_STA_SUCCESS; + ret = iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, + iwm_mvm_add_sta_cmd_size(sc), + &cmd, &status); + if (ret) + return ret; + + switch (status & IWM_ADD_STA_STATUS_MASK) { + case IWM_ADD_STA_SUCCESS: + IWM_DPRINTF(sc, IWM_DEBUG_NODE, + "Frames for staid %d will drained in fw\n", IWM_STATION_ID); + break; + default: + ret = EIO; + device_printf(sc->sc_dev, + "Couldn't drain frames for staid %d\n", IWM_STATION_ID); + break; + } + + return ret; +} + +/* + * Remove a station from the FW table. Before sending the command to remove + * the station validate that the station is indeed known to the driver (sanity + * only). + */ +static int +iwm_mvm_rm_sta_common(struct iwm_softc *sc) +{ + struct iwm_mvm_rm_sta_cmd rm_sta_cmd = { + .sta_id = IWM_STATION_ID, + }; + int ret; + + ret = iwm_mvm_send_cmd_pdu(sc, IWM_REMOVE_STA, 0, + sizeof(rm_sta_cmd), &rm_sta_cmd); + if (ret) { + device_printf(sc->sc_dev, + "Failed to remove station. Id=%d\n", IWM_STATION_ID); + return ret; + } + + return 0; +} + +int +iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap, + struct iwm_node *in) +{ + uint32_t tfd_queue_msk = 0; + int ret; + int ac; + + ret = iwm_mvm_drain_sta(sc, in, TRUE); + if (ret) + return ret; + mbufq_drain(&sc->sc_snd); /* XXX needed ? */ + for (ac = 0; ac < WME_NUM_AC; ac++) { + tfd_queue_msk |= htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); + } + ret = iwm_mvm_flush_tx_path(sc, tfd_queue_msk, 0); + if (ret) + return ret; +#ifdef notyet /* function not yet implemented */ + ret = iwl_trans_wait_tx_queue_empty(mvm->trans, + mvm_sta->tfd_queue_msk); + if (ret) + return ret; +#endif + ret = iwm_mvm_drain_sta(sc, in, FALSE); + +#if 0 + /* if we are associated - we can't remove the AP STA now */ + if (sta->assoc) + return ret; +#endif + /* XXX wait until STA is drained */ + + ret = iwm_mvm_rm_sta_common(sc); + + return ret; +} + +static int +iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struct iwm_int_sta *sta, + const uint8_t *addr, uint16_t mac_id, uint16_t color) +{ + struct iwm_mvm_add_sta_cmd cmd; + int ret; + uint32_t status; + + memset(&cmd, 0, sizeof(cmd)); + cmd.sta_id = sta->sta_id; + cmd.mac_id_n_color = htole32(IWM_FW_CMD_ID_AND_COLOR(mac_id, color)); + + cmd.tfd_queue_msk = htole32(sta->tfd_queue_msk); + cmd.tid_disable_tx = htole16(0xffff); + + if (addr) + IEEE80211_ADDR_COPY(cmd.addr, addr); + + ret = iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, + iwm_mvm_add_sta_cmd_size(sc), + &cmd, &status); + if (ret) + return ret; + + switch (status & IWM_ADD_STA_STATUS_MASK) { + case IWM_ADD_STA_SUCCESS: + IWM_DPRINTF(sc, IWM_DEBUG_NODE, "Internal station added.\n"); + return 0; + default: + ret = EIO; + device_printf(sc->sc_dev, + "Add internal station failed, status=0x%x\n", status); + break; + } + return ret; +} + +int +iwm_mvm_add_aux_sta(struct iwm_softc *sc) +{ + int ret; + + sc->sc_aux_sta.sta_id = IWM_AUX_STA_ID; + sc->sc_aux_sta.tfd_queue_msk = (1 << IWM_MVM_AUX_QUEUE); + + /* Map Aux queue to fifo - needs to happen before adding Aux station */ + ret = iwm_enable_txq(sc, 0, IWM_MVM_AUX_QUEUE, IWM_MVM_TX_FIFO_MCAST); + if (ret) + return ret; + + ret = iwm_mvm_add_int_sta_common(sc, &sc->sc_aux_sta, NULL, + IWM_MAC_INDEX_AUX, 0); + + if (ret) { + memset(&sc->sc_aux_sta, 0, sizeof(sc->sc_aux_sta)); + sc->sc_aux_sta.sta_id = IWM_MVM_STATION_COUNT; + } + return ret; +} + +void iwm_mvm_del_aux_sta(struct iwm_softc *sc) +{ + memset(&sc->sc_aux_sta, 0, sizeof(sc->sc_aux_sta)); + sc->sc_aux_sta.sta_id = IWM_MVM_STATION_COUNT; +} Copied: stable/11/sys/dev/iwm/if_iwm_sta.h (from r318222, head/sys/dev/iwm/if_iwm_sta.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_sta.h Thu Mar 1 06:41:35 2018 (r330210, copy of r318222, head/sys/dev/iwm/if_iwm_sta.h) @@ -0,0 +1,222 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 4.7.3 (tag id d7f6728f57e3ecbb7ef34eb7d9f564d514775d75) + * + *********************************************************************** + * + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2016 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/* $FreeBSD$ */ + +#ifndef __IF_IWM_STA_H__ +#define __IF_IWM_STA_H__ + +/** + * DOC: station table - introduction + * + * The station table is a list of data structure that reprensent the stations. + * In STA/P2P client mode, the driver will hold one station for the AP/ GO. + * In GO/AP mode, the driver will have as many stations as associated clients. + * All these stations are reflected in the fw's station table. The driver + * keeps the fw's station table up to date with the ADD_STA command. Stations + * can be removed by the REMOVE_STA command. + * + * All the data related to a station is held in the structure %iwl_mvm_sta + * which is embed in the mac80211's %ieee80211_sta (in the drv_priv) area. + * This data includes the index of the station in the fw, per tid information + * (sequence numbers, Block-ack state machine, etc...). The stations are + * created and deleted by the %sta_state callback from %ieee80211_ops. + * + * The driver holds a map: %fw_id_to_mac_id that allows to fetch a + * %ieee80211_sta (and the %iwl_mvm_sta embedded into it) based on a fw + * station index. That way, the driver is able to get the tid related data in + * O(1) in time sensitive paths (Tx / Tx response / BA notification). These + * paths are triggered by the fw, and the driver needs to get a pointer to the + * %ieee80211 structure. This map helps to get that pointer quickly. + */ + +/** + * DOC: station table - locking + * + * As stated before, the station is created / deleted by mac80211's %sta_state + * callback from %ieee80211_ops which can sleep. The next paragraph explains + * the locking of a single stations, the next ones relates to the station + * table. + * + * The station holds the sequence number per tid. So this data needs to be + * accessed in the Tx path (which is softIRQ). It also holds the Block-Ack + * information (the state machine / and the logic that checks if the queues + * were drained), so it also needs to be accessible from the Tx response flow. + * In short, the station needs to be access from sleepable context as well as + * from tasklets, so the station itself needs a spinlock. + * + * The writers of %fw_id_to_mac_id map are serialized by the global mutex of + * the mvm op_mode. This is possible since %sta_state can sleep. + * The pointers in this map are RCU protected, hence we won't replace the + * station while we have Tx / Tx response / BA notification running. + * + * If a station is deleted while it still has packets in its A-MPDU queues, + * then the reclaim flow will notice that there is no station in the map for + * sta_id and it will dump the responses. + */ + +/** + * DOC: station table - internal stations + * + * The FW needs a few internal stations that are not reflected in + * mac80211, such as broadcast station in AP / GO mode, or AUX sta for + * scanning and P2P device (during the GO negotiation). + * For these kind of stations we have %iwl_mvm_int_sta struct which holds the + * data relevant for them from both %iwl_mvm_sta and %ieee80211_sta. + * Usually the data for these stations is static, so no locking is required, + * and no TID data as this is also not needed. + * One thing to note, is that these stations have an ID in the fw, but not + * in mac80211. In order to "reserve" them a sta_id in %fw_id_to_mac_id + * we fill ERR_PTR(EINVAL) in this mapping and all other dereferencing of + * pointers from this mapping need to check that the value is not error + * or NULL. + * + * Currently there is only one auxiliary station for scanning, initialized + * on init. + */ + +/** + * DOC: station table - AP Station in STA mode + * + * %iwl_mvm_vif includes the index of the AP station in the fw's STA table: + * %ap_sta_id. To get the point to the corresponding %ieee80211_sta, + * &fw_id_to_mac_id can be used. Due to the way the fw works, we must not remove + * the AP station from the fw before setting the MAC context as unassociated. + * Hence, %fw_id_to_mac_id[%ap_sta_id] will be NULLed when the AP station is + * removed by mac80211, but the station won't be removed in the fw until the + * VIF is set as unassociated. Then, %ap_sta_id will be invalidated. + */ + +/** + * DOC: station table - Drain vs. Flush + * + * Flush means that all the frames in the SCD queue are dumped regardless the + * station to which they were sent. We do that when we disassociate and before + * we remove the STA of the AP. The flush can be done synchronously against the + * fw. + * Drain means that the fw will drop all the frames sent to a specific station. + * This is useful when a client (if we are IBSS / GO or AP) disassociates. In + * that case, we need to drain all the frames for that client from the AC queues + * that are shared with the other clients. Only then, we can remove the STA in + * the fw. In order to do so, we track the non-AMPDU packets for each station. + * If mac80211 removes a STA and if it still has non-AMPDU packets pending in + * the queues, we mark this station as %EBUSY in %fw_id_to_mac_id, and drop all + * the frames for this STA (%iwl_mvm_rm_sta). When the last frame is dropped + * (we know about it with its Tx response), we remove the station in fw and set + * it as %NULL in %fw_id_to_mac_id: this is the purpose of + * %iwl_mvm_sta_drained_wk. + */ + +/** + * DOC: station table - fw restart + * + * When the fw asserts, or we have any other issue that requires to reset the + * driver, we require mac80211 to reconfigure the driver. Since the private + * data of the stations is embed in mac80211's %ieee80211_sta, that data will + * not be zeroed and needs to be reinitialized manually. + * %IWL_MVM_STATUS_IN_HW_RESTART is set during restart and that will hint us + * that we must not allocate a new sta_id but reuse the previous one. This + * means that the stations being re-added after the reset will have the same + * place in the fw as before the reset. We do need to zero the %fw_id_to_mac_id + * map, since the stations aren't in the fw any more. Internal stations that + * are not added by mac80211 will be re-added in the init flow that is called + * after the restart: mac80211 call's %iwl_mvm_mac_start which calls to + * %iwl_mvm_up. + */ + +/** + * Send the STA info to the FW. + * + * @sc: the iwm_softc* to use + * @sta: the STA + * @update: this is true if the FW is being updated about a STA it already knows + * about. Otherwise (if this is a new STA), this should be false. + * @flags: if update==true, this marks what is being changed via ORs of values + * from enum iwm_sta_modify_flag. Otherwise, this is ignored. + */ +extern int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, + boolean_t update); +extern int iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in); +extern int iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in); +extern int iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap, + struct iwm_node *in); + +extern int iwm_mvm_add_aux_sta(struct iwm_softc *sc); +extern void iwm_mvm_del_aux_sta(struct iwm_softc *sc); + +extern int iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, + boolean_t drain); + +#endif /* __IF_IWM_STA_H__ */ Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:40:08 2018 (r330209) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:41:35 2018 (r330210) @@ -123,6 +123,9 @@ extern void iwm_dma_contig_free(struct iwm_dma_info *) extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc); extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); +extern int iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo); +extern int iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, + uint32_t flags); static inline uint8_t iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc) Modified: stable/11/sys/modules/iwm/Makefile ============================================================================== --- stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:40:08 2018 (r330209) +++ stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:41:35 2018 (r330210) @@ -7,10 +7,10 @@ KMOD= if_iwm SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c -SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_fw.c +SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_fw.c if_iwm_sta.c # bus layer SRCS+= if_iwm_pcie_trans.c -SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h +SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h opt_iwm.h CFLAGS+= -DIWM_DEBUG From owner-svn-src-all@freebsd.org Thu Mar 1 06:42:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFCEEF29C53; Thu, 1 Mar 2018 06:42:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 621EB6B91A; Thu, 1 Mar 2018 06:42:19 +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 5D28524F9C; Thu, 1 Mar 2018 06:42:19 +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 w216gJiT063501; Thu, 1 Mar 2018 06:42:19 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216gJNJ063500; Thu, 1 Mar 2018 06:42:19 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010642.w216gJNJ063500@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 06:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330211 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:42:19 -0000 Author: eadler Date: Thu Mar 1 06:42:19 2018 New Revision: 330211 URL: https://svnweb.freebsd.org/changeset/base/330211 Log: MFC r318223: [iwm] Handle AUTH->SCAN/INIT and ASSOC->SCAN/INIT better * Tear down the relevant firmware state (i.e. the station, the vif binding) in these transition cases. * Before this case would leave the firmware state lying around, resulting in errors and firmware panics in the subsequent association attempts. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:41:35 2018 (r330210) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:19 2018 (r330211) @@ -4389,6 +4389,39 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ switch (nstate) { case IEEE80211_S_INIT: + case IEEE80211_S_SCAN: + if (vap->iv_state == IEEE80211_S_AUTH || + vap->iv_state == IEEE80211_S_ASSOC) { + int myerr; + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + myerr = ivp->iv_newstate(vap, nstate, arg); + IEEE80211_UNLOCK(ic); + IWM_LOCK(sc); + in = IWM_NODE(vap->iv_bss); + error = iwm_mvm_rm_sta(sc, vap, in); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove station: %d\n", + __func__, error); + } + error = iwm_mvm_mac_ctxt_changed(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to change mac context: %d\n", + __func__, error); + } + error = iwm_mvm_binding_remove_vif(sc, ivp); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove channel ctx: %d\n", + __func__, error); + } + ivp->phy_ctxt = NULL; + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + return myerr; + } break; case IEEE80211_S_AUTH: From owner-svn-src-all@freebsd.org Thu Mar 1 06:42:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 555D9F29DDE; Thu, 1 Mar 2018 06:42:48 +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 2BF506BADF; Thu, 1 Mar 2018 06:42:48 +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 2696D24FAF; Thu, 1 Mar 2018 06:42:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216gm2n063559; Thu, 1 Mar 2018 06:42:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216gmgs063558; Thu, 1 Mar 2018 06:42:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010642.w216gmgs063558@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 06:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330212 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:42:48 -0000 Author: eadler Date: Thu Mar 1 06:42:47 2018 New Revision: 330212 URL: https://svnweb.freebsd.org/changeset/base/330212 Log: MFC r318224: [iwm] Refuse connection to APs with beacon interval < 16. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:19 2018 (r330211) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:47 2018 (r330212) @@ -3961,6 +3961,21 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s in->in_assoc = 0; + /* + * Firmware bug - it'll crash if the beacon interval is less + * than 16. We can't avoid connecting at all, so refuse the + * station state change, this will cause net80211 to abandon + * attempts to connect to this AP, and eventually wpa_s will + * blacklist the AP... + */ + if (ni->ni_intval < 16) { + device_printf(sc->sc_dev, + "AP %s beacon interval is %d, refusing due to firmware bug!\n", + ether_sprintf(ni->ni_bssid), ni->ni_intval); + error = EINVAL; + goto out; + } + error = iwm_mvm_sf_config(sc, IWM_SF_FULL_ON); if (error != 0) return error; From owner-svn-src-all@freebsd.org Thu Mar 1 06:44:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C247F2A2FF; Thu, 1 Mar 2018 06:44:33 +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 D29836BEE2; Thu, 1 Mar 2018 06:44:32 +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 CD90524FB4; Thu, 1 Mar 2018 06:44:32 +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 w216iWGi063702; Thu, 1 Mar 2018 06:44:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216iWh5063699; Thu, 1 Mar 2018 06:44:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010644.w216iWh5063699@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 06:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330213 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:44:33 -0000 Author: eadler Date: Thu Mar 1 06:44:32 2018 New Revision: 330213 URL: https://svnweb.freebsd.org/changeset/base/330213 Log: MFC r318229: [iwm] Adjust if_iwm_sta.h prototypes, don't pass iwm_node to rm_sta(). * Since a RUN -> INIT/SCAN transition seems to immediately destroy the ieee80211_node for the AP, we can't read the in_assoc value from there. Instead just directly pass that information via a boolean_t argument. * Adds iwm_mvm_rm_sta_id() function, which just unconditionally removes the station from the firmware. * The iwm_mvm_rm_sta() function shouldn't actually remove the station from firmware when we are still associated (i.e. during a RUN -> INIT/SCAN transition). * So when disassociating we will first call iwm_mvm_rm_sta() to drain the queues/fifos. Later during disassociation we will then use iwm_mvm_rm_sta_id() to actually remove the station. Inspired-By: Linux iwlwifi Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_sta.c stable/11/sys/dev/iwm/if_iwm_sta.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:47 2018 (r330212) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:44:32 2018 (r330213) @@ -4413,8 +4413,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ myerr = ivp->iv_newstate(vap, nstate, arg); IEEE80211_UNLOCK(ic); IWM_LOCK(sc); - in = IWM_NODE(vap->iv_bss); - error = iwm_mvm_rm_sta(sc, vap, in); + error = iwm_mvm_rm_sta(sc, vap, FALSE); if (error) { device_printf(sc->sc_dev, "%s: Failed to remove station: %d\n", Modified: stable/11/sys/dev/iwm/if_iwm_sta.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:42:47 2018 (r330212) +++ stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:44:32 2018 (r330213) @@ -213,10 +213,9 @@ iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_no } int -iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, boolean_t drain) +iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_vap *ivp, boolean_t drain) { struct iwm_mvm_add_sta_cmd cmd = {}; - struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); int ret; uint32_t status; @@ -275,13 +274,13 @@ iwm_mvm_rm_sta_common(struct iwm_softc *sc) int iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap, - struct iwm_node *in) + boolean_t is_assoc) { uint32_t tfd_queue_msk = 0; int ret; int ac; - ret = iwm_mvm_drain_sta(sc, in, TRUE); + ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), TRUE); if (ret) return ret; mbufq_drain(&sc->sc_snd); /* XXX needed ? */ @@ -297,18 +296,25 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211v if (ret) return ret; #endif - ret = iwm_mvm_drain_sta(sc, in, FALSE); + ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), FALSE); -#if 0 /* if we are associated - we can't remove the AP STA now */ - if (sta->assoc) + if (is_assoc) return ret; -#endif + /* XXX wait until STA is drained */ ret = iwm_mvm_rm_sta_common(sc); return ret; +} + +int +iwm_mvm_rm_sta_id(struct iwm_softc *sc, struct ieee80211vap *vap) +{ + /* XXX wait until STA is drained */ + + return iwm_mvm_rm_sta_common(sc); } static int Modified: stable/11/sys/dev/iwm/if_iwm_sta.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_sta.h Thu Mar 1 06:42:47 2018 (r330212) +++ stable/11/sys/dev/iwm/if_iwm_sta.h Thu Mar 1 06:44:32 2018 (r330213) @@ -211,12 +211,13 @@ extern int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc extern int iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in); extern int iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in); extern int iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap, - struct iwm_node *in); + boolean_t is_assoc); +extern int iwm_mvm_rm_sta_id(struct iwm_softc *sc, struct ieee80211vap *vap); extern int iwm_mvm_add_aux_sta(struct iwm_softc *sc); extern void iwm_mvm_del_aux_sta(struct iwm_softc *sc); -extern int iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, +extern int iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_vap *ivp, boolean_t drain); #endif /* __IF_IWM_STA_H__ */ From owner-svn-src-all@freebsd.org Thu Mar 1 06:45:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA5D9F2A611; Thu, 1 Mar 2018 06:45:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B376C0FA; Thu, 1 Mar 2018 06:45:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BA3124FB6; Thu, 1 Mar 2018 06:45:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216jORv063782; Thu, 1 Mar 2018 06:45:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216jOb2063781; Thu, 1 Mar 2018 06:45:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010645.w216jOb2063781@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 06:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330214 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:45:24 -0000 Author: eadler Date: Thu Mar 1 06:45:24 2018 New Revision: 330214 URL: https://svnweb.freebsd.org/changeset/base/330214 Log: MFC r318231: [iwm] Revert "if_iwm - SCAN_ABORT_UMAC response doesn't use a wide id" This reverts commit cef47a9cbb0a3ce5f18369fed9403d2764884bc2. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:44:32 2018 (r330213) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:45:24 2018 (r330214) @@ -5457,7 +5457,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_TIME_EVENT_CMD: case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_CFG_CMD): case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_REQ_UMAC): - case IWM_SCAN_ABORT_UMAC: + case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_ABORT_UMAC): case IWM_SCAN_OFFLOAD_REQUEST_CMD: case IWM_SCAN_OFFLOAD_ABORT_CMD: case IWM_REPLY_BEACON_FILTERING_CMD: From owner-svn-src-all@freebsd.org Thu Mar 1 06:46:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4444BF2A992; Thu, 1 Mar 2018 06:46:32 +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 E68AA6C393; Thu, 1 Mar 2018 06:46:31 +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 E178C24FBC; Thu, 1 Mar 2018 06:46:31 +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 w216kVia063862; Thu, 1 Mar 2018 06:46:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216kVpx063860; Thu, 1 Mar 2018 06:46:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010646.w216kVpx063860@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 06:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330215 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:46:32 -0000 Author: eadler Date: Thu Mar 1 06:46:31 2018 New Revision: 330215 URL: https://svnweb.freebsd.org/changeset/base/330215 Log: MFC r318230: [iwm] Fix iwm_mvm_send_cmd_pdu(_status) declarations. Make id a uint32_t. * This fixes cases where the group id of wide commands got lost, e.g. this happened to the IWM_SCAN_ABORT_UMAC command. Modified: stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:45:24 2018 (r330214) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:46:31 2018 (r330215) @@ -345,7 +345,7 @@ iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd /* iwlwifi: mvm/utils.c */ int -iwm_mvm_send_cmd_pdu(struct iwm_softc *sc, uint8_t id, +iwm_mvm_send_cmd_pdu(struct iwm_softc *sc, uint32_t id, uint32_t flags, uint16_t len, const void *data) { struct iwm_host_cmd cmd = { @@ -401,7 +401,7 @@ iwm_mvm_send_cmd_status(struct iwm_softc *sc, /* iwlwifi/mvm/utils.c */ int -iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint8_t id, +iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint32_t id, uint16_t len, const void *data, uint32_t *status) { struct iwm_host_cmd cmd = { Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:45:24 2018 (r330214) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:46:31 2018 (r330215) @@ -107,12 +107,12 @@ #define __IF_IWM_UTIL_H__ extern int iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd *hcmd); -extern int iwm_mvm_send_cmd_pdu(struct iwm_softc *sc, uint8_t id, +extern int iwm_mvm_send_cmd_pdu(struct iwm_softc *sc, uint32_t id, uint32_t flags, uint16_t len, const void *data); extern int iwm_mvm_send_cmd_status(struct iwm_softc *sc, struct iwm_host_cmd *cmd, uint32_t *status); -extern int iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint8_t id, +extern int iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint32_t id, uint16_t len, const void *data, uint32_t *status); extern void iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cmd *hcmd); From owner-svn-src-all@freebsd.org Thu Mar 1 06:46:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0AD1F2AAE4; Thu, 1 Mar 2018 06:46: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 6F8996C4F7; Thu, 1 Mar 2018 06:46: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 6A55D24FC0; Thu, 1 Mar 2018 06:46: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 w216kucb063922; Thu, 1 Mar 2018 06:46:56 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216kuAj063921; Thu, 1 Mar 2018 06:46:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010646.w216kuAj063921@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 06:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330216 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:46:56 -0000 Author: eadler Date: Thu Mar 1 06:46:56 2018 New Revision: 330216 URL: https://svnweb.freebsd.org/changeset/base/330216 Log: MFC r318232: [iwm] Recognize IWM_FW_PAGING_BLOCK_CMD wide cmd response correctly. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:46:31 2018 (r330215) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:46:56 2018 (r330216) @@ -5466,7 +5466,8 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_REMOVE_STA: case IWM_TXPATH_FLUSH: case IWM_LQ_CMD: - case IWM_FW_PAGING_BLOCK_CMD: + case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, + IWM_FW_PAGING_BLOCK_CMD): case IWM_BT_CONFIG: case IWM_REPLY_THERMAL_MNG_BACKOFF: cresp = (void *)pkt->data; From owner-svn-src-all@freebsd.org Thu Mar 1 06:48:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3488EF2B072; Thu, 1 Mar 2018 06:48:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6026C8DA; Thu, 1 Mar 2018 06:48:19 +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 0643D24FC7; Thu, 1 Mar 2018 06:48:19 +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 w216mInU064065; Thu, 1 Mar 2018 06:48:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216mIDd064063; Thu, 1 Mar 2018 06:48:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010648.w216mIDd064063@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 06:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330218 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:48:19 -0000 Author: eadler Date: Thu Mar 1 06:48:18 2018 New Revision: 330218 URL: https://svnweb.freebsd.org/changeset/base/330218 Log: MFC r319579: [iwm] Remove dead code from iwm_pcie_load_cpu_sections(). * If device family is 8000 then iwm_pcie_load_cpu_sections() won't be called at all (iwm_pcie_load_cpu_sections_8000() is called in that case) so this piece of code never gets called. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:47:52 2018 (r330217) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:48:18 2018 (r330218) @@ -2574,14 +2574,6 @@ iwm_pcie_load_cpu_sections(struct iwm_softc *sc, return ret; } - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) - iwm_set_bits_prph(sc, - IWM_CSR_UCODE_LOAD_STATUS_ADDR, - (IWM_LMPM_CPU_UCODE_LOADING_COMPLETED | - IWM_LMPM_CPU_HDRS_LOADING_COMPLETED | - IWM_LMPM_CPU_UCODE_LOADING_STARTED) << - shift_param); - *first_ucode_section = last_read_idx; return 0; Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:47:52 2018 (r330217) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:48:18 2018 (r330218) @@ -439,23 +439,11 @@ enum iwm_secure_boot_status_reg { }; #define IWM_FH_UCODE_LOAD_STATUS 0x1af0 -#define IWM_CSR_UCODE_LOAD_STATUS_ADDR 0x1e70 -enum iwm_secure_load_status_reg { - IWM_LMPM_CPU_UCODE_LOADING_STARTED = 0x00000001, - IWM_LMPM_CPU_HDRS_LOADING_COMPLETED = 0x00000003, - IWM_LMPM_CPU_UCODE_LOADING_COMPLETED = 0x00000007, - IWM_LMPM_CPU_STATUS_NUM_OF_LAST_COMPLETED = 0x000000F8, - IWM_LMPM_CPU_STATUS_NUM_OF_LAST_LOADED_BLOCK = 0x0000FF00, -}; #define IWM_FH_MEM_TB_MAX_LENGTH 0x20000 -#define IWM_LMPM_SECURE_INSPECTOR_CODE_ADDR 0x1e38 -#define IWM_LMPM_SECURE_INSPECTOR_DATA_ADDR 0x1e3c #define IWM_LMPM_SECURE_UCODE_LOAD_CPU1_HDR_ADDR 0x1e78 #define IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR 0x1e7c -#define IWM_LMPM_SECURE_INSPECTOR_CODE_MEM_SPACE 0x400000 -#define IWM_LMPM_SECURE_INSPECTOR_DATA_MEM_SPACE 0x402000 #define IWM_LMPM_SECURE_CPU1_HDR_MEM_SPACE 0x420000 #define IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE 0x420400 From owner-svn-src-all@freebsd.org Thu Mar 1 06:47:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28FF7F2AE2F; Thu, 1 Mar 2018 06:47:53 +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 0013A6C73E; Thu, 1 Mar 2018 06:47:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF12724FC5; Thu, 1 Mar 2018 06:47:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216lqd3064003; Thu, 1 Mar 2018 06:47:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216lqrx064000; Thu, 1 Mar 2018 06:47:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010647.w216lqrx064000@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 06:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330217 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:47:53 -0000 Author: eadler Date: Thu Mar 1 06:47:52 2018 New Revision: 330217 URL: https://svnweb.freebsd.org/changeset/base/330217 Log: MFC r319578: [iwm] Check for lar_disable tunable, and lar_enabled flag from NVM. * LAR can be disabled with the hw.iwm.lar.disable tunable now. * On Family 8000 devices we need to check the lar_enabled flag from nvm_data in addition to the TLV_CAPA_LAR_SUPPORT flag from the firmware. * Add a separate IWM_DEBUG_LAR debugging flag. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_debug.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:46:56 2018 (r330216) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:47:52 2018 (r330217) @@ -359,6 +359,8 @@ static void iwm_mvm_fill_sf_command(struct iwm_softc * struct ieee80211_node *); static int iwm_mvm_sf_config(struct iwm_softc *, enum iwm_sf_state); static int iwm_send_bt_init_conf(struct iwm_softc *); +static boolean_t iwm_mvm_is_lar_supported(struct iwm_softc *); +static boolean_t iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *); static int iwm_send_update_mcc_cmd(struct iwm_softc *, const char *); static void iwm_mvm_tt_tx_backoff(struct iwm_softc *, uint32_t); static int iwm_init_hw(struct iwm_softc *); @@ -397,6 +399,9 @@ static void iwm_scan_curchan(struct ieee80211_scan_sta static void iwm_scan_mindwell(struct ieee80211_scan_state *); static int iwm_detach(device_t); +static int iwm_lar_disable = 0; +TUNABLE_INT("hw.iwm.lar.disable", &iwm_lar_disable); + /* * Firmware parser. */ @@ -2189,6 +2194,7 @@ iwm_parse_nvm_data(struct iwm_softc *sc, { struct iwm_nvm_data *data; uint32_t sku, radio_cfg; + uint16_t lar_config; if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { data = malloc(sizeof(*data) + @@ -2214,6 +2220,16 @@ iwm_parse_nvm_data(struct iwm_softc *sc, data->n_hw_addrs = iwm_get_n_hw_addrs(sc, nvm_sw); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + uint16_t lar_offset = data->nvm_version < 0xE39 ? + IWM_NVM_LAR_OFFSET_8000_OLD : + IWM_NVM_LAR_OFFSET_8000; + + lar_config = le16_to_cpup(regulatory + lar_offset); + data->lar_enabled = !!(lar_config & + IWM_NVM_LAR_ENABLED_8000); + } + /* If no valid mac address was found - bail out */ if (iwm_set_hw_address(sc, data, nvm_hw, mac_override)) { free(data, M_DEVBUF); @@ -4661,6 +4677,35 @@ iwm_send_bt_init_conf(struct iwm_softc *sc) &bt_cmd); } +static boolean_t +iwm_mvm_is_lar_supported(struct iwm_softc *sc) +{ + boolean_t nvm_lar = sc->nvm_data->lar_enabled; + boolean_t tlv_lar = fw_has_capa(&sc->ucode_capa, + IWM_UCODE_TLV_CAPA_LAR_SUPPORT); + + if (iwm_lar_disable) + return FALSE; + + /* + * Enable LAR only if it is supported by the FW (TLV) && + * enabled in the NVM + */ + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + return nvm_lar && tlv_lar; + else + return tlv_lar; +} + +static boolean_t +iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *sc) +{ + return fw_has_api(&sc->ucode_capa, + IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || + fw_has_capa(&sc->ucode_capa, + IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC); +} + static int iwm_send_update_mcc_cmd(struct iwm_softc *sc, const char *alpha2) { @@ -4681,10 +4726,15 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch int resp_v2 = fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); + if (!iwm_mvm_is_lar_supported(sc)) { + IWM_DPRINTF(sc, IWM_DEBUG_LAR, "%s: no LAR support\n", + __func__); + return 0; + } + memset(&mcc_cmd, 0, sizeof(mcc_cmd)); mcc_cmd.mcc = htole16(alpha2[0] << 8 | alpha2[1]); - if (fw_has_api(&sc->ucode_capa, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || - fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC)) + if (iwm_mvm_is_wifi_mcc_supported(sc)) mcc_cmd.source_id = IWM_MCC_SOURCE_GET_CURRENT; else mcc_cmd.source_id = IWM_MCC_SOURCE_OLD_FW; @@ -4694,7 +4744,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch else hcmd.len[0] = sizeof(struct iwm_mcc_update_cmd_v1); - IWM_DPRINTF(sc, IWM_DEBUG_NODE, + IWM_DPRINTF(sc, IWM_DEBUG_LAR, "send MCC update to FW with '%c%c' src = %d\n", alpha2[0], alpha2[1], mcc_cmd.source_id); @@ -4720,7 +4770,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch if (mcc == 0) mcc = 0x3030; /* "00" - world */ - IWM_DPRINTF(sc, IWM_DEBUG_NODE, + IWM_DPRINTF(sc, IWM_DEBUG_LAR, "regulatory domain '%c%c' (%d channels available)\n", mcc >> 8, mcc & 0xff, n_channels); #endif @@ -4823,10 +4873,8 @@ iwm_init_hw(struct iwm_softc *sc) if (error) goto error; - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT)) { - if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) - goto error; - } + if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) + goto error; if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { if ((error = iwm_mvm_config_umac_scan(sc)) != 0) @@ -5423,7 +5471,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) sc->sc_fw_mcc[0] = (notif->mcc & 0xff00) >> 8; sc->sc_fw_mcc[1] = notif->mcc & 0xff; sc->sc_fw_mcc[2] = '\0'; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, + IWM_DPRINTF(sc, IWM_DEBUG_LAR, "fw source %d sent CC '%s'\n", notif->source_id, sc->sc_fw_mcc); break; Modified: stable/11/sys/dev/iwm/if_iwm_debug.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 06:46:56 2018 (r330216) +++ stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 06:47:52 2018 (r330217) @@ -43,6 +43,7 @@ enum { IWM_DEBUG_EEPROM = 0x00080000, /* EEPROM/channel information */ IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ IWM_DEBUG_FW = 0x00200000, /* Firmware management */ + IWM_DEBUG_LAR = 0x00400000, /* Location Aware Regulatory */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:46:56 2018 (r330216) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:47:52 2018 (r330217) @@ -232,6 +232,7 @@ struct iwm_nvm_data { uint16_t nvm_version; uint8_t max_tx_pwr_half_dbm; + boolean_t lar_enabled; uint16_t nvm_ch_flags[]; }; From owner-svn-src-all@freebsd.org Thu Mar 1 06:50:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0677F2B7EA; Thu, 1 Mar 2018 06:50:06 +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 802216CD6A; Thu, 1 Mar 2018 06:50:06 +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 77A0624FD4; Thu, 1 Mar 2018 06:50:06 +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 w216o6Wi064301; Thu, 1 Mar 2018 06:50:06 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216o69u064298; Thu, 1 Mar 2018 06:50:06 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010650.w216o69u064298@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 06:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330219 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:50:07 -0000 Author: eadler Date: Thu Mar 1 06:50:05 2018 New Revision: 330219 URL: https://svnweb.freebsd.org/changeset/base/330219 Log: MFC r319581: [iwm] Set command code for PHY_DB as well. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_phy_db.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:48:18 2018 (r330218) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:50:05 2018 (r330219) @@ -5518,7 +5518,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) break; /* ignore */ - case 0x6c: /* IWM_PHY_DB_CMD, no idea why it's not in fw-api.h */ + case IWM_PHY_DB_CMD: break; case IWM_INIT_COMPLETE_NOTIF: Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 06:48:18 2018 (r330218) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 06:50:05 2018 (r330219) @@ -194,7 +194,7 @@ enum iwm_phy_db_section_type { IWM_PHY_DB_MAX }; -#define PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */ +#define PHY_DB_CMD 0x6c /* * phy db - configure operational ucode Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:48:18 2018 (r330218) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:50:05 2018 (r330219) @@ -1806,7 +1806,7 @@ enum { /* Phy */ IWM_PHY_CONFIGURATION_CMD = 0x6a, IWM_CALIB_RES_NOTIF_PHY_DB = 0x6b, - /* IWM_PHY_DB_CMD = 0x6c, */ + IWM_PHY_DB_CMD = 0x6c, /* Power - legacy power table command */ IWM_POWER_TABLE_CMD = 0x77, From owner-svn-src-all@freebsd.org Thu Mar 1 06:50:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A2BAF2B9BF; Thu, 1 Mar 2018 06:50:35 +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 208BF6CF00; Thu, 1 Mar 2018 06:50:35 +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 1B63524FDA; Thu, 1 Mar 2018 06:50:35 +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 w216oYvk064363; Thu, 1 Mar 2018 06:50:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216oYOJ064362; Thu, 1 Mar 2018 06:50:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010650.w216oYOJ064362@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 06:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330220 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:50:35 -0000 Author: eadler Date: Thu Mar 1 06:50:34 2018 New Revision: 330220 URL: https://svnweb.freebsd.org/changeset/base/330220 Log: MFC r319582: [iwm] Ignore IWM_DEBUG_LOG_MSG notifications. * Firmware versions 21 and 22 generate some IWM_DEBUG_LOG_MSG notifications, which seem to be harmless. Avoid spamming the system log with "frame ... UNHANDLED (this should not happen)" messages. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:50:05 2018 (r330219) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:50:34 2018 (r330220) @@ -5338,7 +5338,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) "rx packet qid=%d idx=%d type=%x\n", qid & ~0x80, pkt->hdr.idx, code); - len = le32toh(pkt->len_n_flags) & IWM_FH_RSCSR_FRAME_SIZE_MSK; + len = iwm_rx_packet_len(pkt); len += sizeof(uint32_t); /* account for status word */ nextoff = offset + roundup2(len, IWM_FH_RSCSR_FRAME_ALIGN); @@ -5586,6 +5586,13 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) notif->status, notif->action); break; } + + /* + * Firmware versions 21 and 22 generate some DEBUG_LOG_MSG + * messages. Just ignore them for now. + */ + case IWM_DEBUG_LOG_MSG: + break; case IWM_MCAST_FILTER_CMD: break; From owner-svn-src-all@freebsd.org Thu Mar 1 06:54:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25787F2CA2E; Thu, 1 Mar 2018 06:54:04 +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 C7F606D89F; Thu, 1 Mar 2018 06:54:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C28052516D; Thu, 1 Mar 2018 06:54:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216s3rt069018; Thu, 1 Mar 2018 06:54:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216s3Db069017; Thu, 1 Mar 2018 06:54:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010654.w216s3Db069017@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 06:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330222 - stable/11/tests/sys/aio X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/tests/sys/aio X-SVN-Commit-Revision: 330222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:54:04 -0000 Author: eadler Date: Thu Mar 1 06:54:03 2018 New Revision: 330222 URL: https://svnweb.freebsd.org/changeset/base/330222 Log: MFC r319590: Modified: stable/11/tests/sys/aio/aio_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/aio/aio_test.c ============================================================================== --- stable/11/tests/sys/aio/aio_test.c Thu Mar 1 06:53:37 2018 (r330221) +++ stable/11/tests/sys/aio/aio_test.c Thu Mar 1 06:54:03 2018 (r330222) @@ -336,7 +336,7 @@ aio_file_test(completion comp, struct sigevent *sev) ATF_REQUIRE_KERNEL_MODULE("aio"); ATF_REQUIRE_UNSAFE_AIO(); - fd = open(FILE_PATHNAME, O_RDWR | O_CREAT); + fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600); ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); aio_context_init(&ac, fd, fd, FILE_LEN); @@ -806,7 +806,7 @@ ATF_TC_BODY(aio_large_read_test, tc) len = INT_MAX; #endif - fd = open(FILE_PATHNAME, O_RDWR | O_CREAT); + fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600); ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); unlink(FILE_PATHNAME); @@ -1060,7 +1060,7 @@ ATF_TC_BODY(aio_fsync_test, tc) ATF_REQUIRE_KERNEL_MODULE("aio"); ATF_REQUIRE_UNSAFE_AIO(); - fd = open(FILE_PATHNAME, O_RDWR | O_CREAT); + fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600); ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); unlink(FILE_PATHNAME); From owner-svn-src-all@freebsd.org Thu Mar 1 06:53:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43022F2C86C; Thu, 1 Mar 2018 06:53:38 +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 19F956D73A; Thu, 1 Mar 2018 06:53:38 +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 14A2F2516B; Thu, 1 Mar 2018 06:53:38 +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 w216rbT1068950; Thu, 1 Mar 2018 06:53:37 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216rbsi068948; Thu, 1 Mar 2018 06:53:37 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010653.w216rbsi068948@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 06:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330221 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:53:38 -0000 Author: eadler Date: Thu Mar 1 06:53:37 2018 New Revision: 330221 URL: https://svnweb.freebsd.org/changeset/base/330221 Log: MFC r319589: [iwm] Remove support for fw older than -17 and -22 * iwm(4) didn't use any of these definitions yet, anyway. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:50:34 2018 (r330220) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:53:37 2018 (r330221) @@ -3438,8 +3438,7 @@ iwm_update_sched(struct iwm_softc *sc, int qid, int id scd_bc_tbl = sc->sched_dma.vaddr; len += 8; /* magic numbers came naturally from paris */ - if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_DW_BC_TABLE) - len = roundup(len, 4) / 4; + len = roundup(len, 4) / 4; w_val = htole16(sta_id << 12 | len); Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:50:34 2018 (r330220) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:53:37 2018 (r330221) @@ -594,8 +594,6 @@ enum iwm_dtd_diode_reg { * @IWM_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behaviour on hidden SSID, * treats good CRC threshold as a boolean * @IWM_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w). - * @IWM_UCODE_TLV_FLAGS_P2P: This uCode image supports P2P. - * @IWM_UCODE_TLV_FLAGS_DW_BC_TABLE: The SCD byte count table is in DWORDS * @IWM_UCODE_TLV_FLAGS_UAPSD: This uCode image supports uAPSD * @IWM_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of black list instead of 64 in scan * offload profile config command. @@ -605,35 +603,24 @@ enum iwm_dtd_diode_reg { * from the probe request template. * @IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL: new NS offload (small version) * @IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version) - * @IWM_UCODE_TLV_FLAGS_P2P_PS: P2P client power save is supported (only on a - * single bound interface). * @IWM_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD * @IWM_UCODE_TLV_FLAGS_EBS_SUPPORT: this uCode image supports EBS. * @IWM_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save * @IWM_UCODE_TLV_FLAGS_BCAST_FILTERING: uCode supports broadcast filtering. - * @IWM_UCODE_TLV_FLAGS_GO_UAPSD: AP/GO interfaces support uAPSD clients - * */ enum iwm_ucode_tlv_flag { IWM_UCODE_TLV_FLAGS_PAN = (1 << 0), IWM_UCODE_TLV_FLAGS_NEWSCAN = (1 << 1), IWM_UCODE_TLV_FLAGS_MFP = (1 << 2), - IWM_UCODE_TLV_FLAGS_P2P = (1 << 3), - IWM_UCODE_TLV_FLAGS_DW_BC_TABLE = (1 << 4), IWM_UCODE_TLV_FLAGS_SHORT_BL = (1 << 7), IWM_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS = (1 << 10), IWM_UCODE_TLV_FLAGS_NO_BASIC_SSID = (1 << 12), IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL = (1 << 15), IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE = (1 << 16), - IWM_UCODE_TLV_FLAGS_P2P_PS = (1 << 21), - IWM_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM = (1 << 22), - IWM_UCODE_TLV_FLAGS_BSS_P2P_PS_SCM = (1 << 23), IWM_UCODE_TLV_FLAGS_UAPSD_SUPPORT = (1 << 24), IWM_UCODE_TLV_FLAGS_EBS_SUPPORT = (1 << 25), IWM_UCODE_TLV_FLAGS_P2P_PS_UAPSD = (1 << 26), IWM_UCODE_TLV_FLAGS_BCAST_FILTERING = (1 << 29), - IWM_UCODE_TLV_FLAGS_GO_UAPSD = (1 << 30), - IWM_UCODE_TLV_FLAGS_LTE_COEX = (1 << 31), }; #define IWM_UCODE_TLV_FLAG_BITS \ @@ -647,22 +634,14 @@ P2P_PS_SCM\31UAPSD_SUPPORT\32EBS\33P2P_PS_UAPSD\36BCAS * @IWM_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time * longer than the passive one, which is essential for fragmented scan. * @IWM_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source. - * @IWM_UCODE_TLV_API_WIDE_CMD_HDR: ucode supports wide command header * @IWM_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params - * @IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY: scan APIs use 8-level priority - * instead of 3. - * @IWM_UCODE_TLV_API_TX_POWER_CHAIN: TX power API has larger command size - * (command version 3) that supports per-chain limits * * @IWM_NUM_UCODE_TLV_API: number of bits used */ enum iwm_ucode_tlv_api { IWM_UCODE_TLV_API_FRAGMENTED_SCAN = 8, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = 9, - IWM_UCODE_TLV_API_WIDE_CMD_HDR = 14, IWM_UCODE_TLV_API_LQ_SS_PARAMS = 18, - IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = 24, - IWM_UCODE_TLV_API_TX_POWER_CHAIN = 27, IWM_NUM_UCODE_TLV_API = 32 }; @@ -4144,7 +4123,6 @@ struct iwm_lq_cmd { * @IWM_TX_CMD_FLG_MH_PAD: driver inserted 2 byte padding after MAC header. * Should be set for 26/30 length MAC headers * @IWM_TX_CMD_FLG_RESP_TO_DRV: zero this if the response should go only to FW - * @IWM_TX_CMD_FLG_CCMP_AGG: this frame uses CCMP for aggregation acceleration * @IWM_TX_CMD_FLG_TKIP_MIC_DONE: FW already performed TKIP MIC calculation * @IWM_TX_CMD_FLG_DUR: disable duration overwriting used in PS-Poll Assoc-id * @IWM_TX_CMD_FLG_FW_DROP: FW should mark frame to be dropped @@ -4172,7 +4150,6 @@ enum iwm_tx_flags { IWM_TX_CMD_FLG_AGG_START = (1 << 19), IWM_TX_CMD_FLG_MH_PAD = (1 << 20), IWM_TX_CMD_FLG_RESP_TO_DRV = (1 << 21), - IWM_TX_CMD_FLG_CCMP_AGG = (1 << 22), IWM_TX_CMD_FLG_TKIP_MIC_DONE = (1 << 23), IWM_TX_CMD_FLG_DUR = (1 << 25), IWM_TX_CMD_FLG_FW_DROP = (1 << 26), From owner-svn-src-all@freebsd.org Thu Mar 1 06:55:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91B98F2D0F3; Thu, 1 Mar 2018 06:55:47 +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 3A0066DC57; Thu, 1 Mar 2018 06:55:47 +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 18F1325173; Thu, 1 Mar 2018 06:55:47 +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 w216tkb5069161; Thu, 1 Mar 2018 06:55:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216tkLu069159; Thu, 1 Mar 2018 06:55:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010655.w216tkLu069159@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 06:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330223 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:55:47 -0000 Author: eadler Date: Thu Mar 1 06:55:46 2018 New Revision: 330223 URL: https://svnweb.freebsd.org/changeset/base/330223 Log: MFC r321508: [iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4). * iwm_xmit_queue_drain() calls ieee80211_free_node(), removing a possible memory leak, compared to using just mbufq_drain(). * Remove duplicate mbufq_drain() from iwm_mvm_rm_sta(), this should be handled in the caller. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_sta.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:54:03 2018 (r330222) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:55:46 2018 (r330223) @@ -391,6 +391,7 @@ static struct ieee80211vap * const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void iwm_vap_delete(struct ieee80211vap *); +static void iwm_xmit_queue_drain(struct iwm_softc *); static void iwm_scan_start(struct ieee80211com *); static void iwm_scan_end(struct ieee80211com *); static void iwm_update_mcast(struct ieee80211com *); @@ -4132,7 +4133,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * get here from RUN state. */ tfd_msk = 0xf; - mbufq_drain(&sc->sc_snd); + iwm_xmit_queue_drain(sc); iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC); /* * We seem to get away with just synchronously sending the @@ -6364,6 +6365,19 @@ iwm_vap_delete(struct ieee80211vap *vap) } static void +iwm_xmit_queue_drain(struct iwm_softc *sc) +{ + struct mbuf *m; + struct ieee80211_node *ni; + + while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) { + ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; + ieee80211_free_node(ni); + m_freem(m); + } +} + +static void iwm_scan_start(struct ieee80211com *ic) { struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); @@ -6522,6 +6536,9 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 callout_drain(&sc->sc_watchdog_to); iwm_stop_device(sc); if (do_net80211) { + IWM_LOCK(sc); + iwm_xmit_queue_drain(sc); + IWM_UNLOCK(sc); ieee80211_ifdetach(&sc->sc_ic); } @@ -6555,7 +6572,6 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 sc->sc_notif_wait = NULL; } - mbufq_drain(&sc->sc_snd); IWM_LOCK_DESTROY(sc); return (0); Modified: stable/11/sys/dev/iwm/if_iwm_sta.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:54:03 2018 (r330222) +++ stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:55:46 2018 (r330223) @@ -283,7 +283,6 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211v ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), TRUE); if (ret) return ret; - mbufq_drain(&sc->sc_snd); /* XXX needed ? */ for (ac = 0; ac < WME_NUM_AC; ac++) { tfd_queue_msk |= htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); } From owner-svn-src-all@freebsd.org Thu Mar 1 06:57:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862CFF2D63B; Thu, 1 Mar 2018 06:57:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC016E08C; Thu, 1 Mar 2018 06:57:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ABEB2517A; Thu, 1 Mar 2018 06:57:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216v2fj069349; Thu, 1 Mar 2018 06:57:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216v21j069348; Thu, 1 Mar 2018 06:57:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010657.w216v21j069348@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 06:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330226 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:57:03 -0000 Author: eadler Date: Thu Mar 1 06:57:02 2018 New Revision: 330226 URL: https://svnweb.freebsd.org/changeset/base/330226 Log: MFC r321511: [iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi. * While there clean up alignments and line wrapping in existing definitions for rs API in if_iwmreg.h Modified: stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:56:34 2018 (r330225) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:57:02 2018 (r330226) @@ -3981,12 +3981,12 @@ enum { * Bit 11-12: (0) 20MHz, (1) 40MHz, (2) 80MHz, (3) 160MHz * 0 and 1 are valid for HT and VHT, 2 and 3 only for VHT */ -#define IWM_RATE_MCS_CHAN_WIDTH_POS 11 -#define IWM_RATE_MCS_CHAN_WIDTH_MSK (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_20 (0 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_40 (1 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_80 (2 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_160 (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_POS 11 +#define IWM_RATE_MCS_CHAN_WIDTH_MSK (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_20 (0 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_40 (1 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_80 (2 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_160 (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) /* Bit 13: (1) Short guard interval (0.4 usec), (0) normal GI (0.8 usec) */ #define IWM_RATE_MCS_SGI_POS 13 @@ -3999,7 +3999,7 @@ enum { #define IWM_RATE_MCS_ANT_C_MSK (4 << IWM_RATE_MCS_ANT_POS) #define IWM_RATE_MCS_ANT_AB_MSK (IWM_RATE_MCS_ANT_A_MSK | \ IWM_RATE_MCS_ANT_B_MSK) -#define IWM_RATE_MCS_ANT_ABC_MSK (IWM_RATE_MCS_ANT_AB_MSK | \ +#define IWM_RATE_MCS_ANT_ABC_MSK (IWM_RATE_MCS_ANT_AB_MSK | \ IWM_RATE_MCS_ANT_C_MSK) #define IWM_RATE_MCS_ANT_MSK IWM_RATE_MCS_ANT_ABC_MSK #define IWM_RATE_MCS_ANT_NUM 3 @@ -4009,8 +4009,8 @@ enum { #define IWM_RATE_MCS_STBC_MSK (1 << IWM_RATE_MCS_STBC_POS) /* Bit 19: (0) Beamforming is off, (1) Beamforming is on */ -#define IWM_RATE_MCS_BF_POS 19 -#define IWM_RATE_MCS_BF_MSK (1 << IWM_RATE_MCS_BF_POS) +#define IWM_RATE_MCS_BF_POS 19 +#define IWM_RATE_MCS_BF_MSK (1 << IWM_RATE_MCS_BF_POS) /* Bit 20: (0) ZLF is off, (1) ZLF is on */ #define IWM_RATE_MCS_ZLF_POS 20 @@ -4033,29 +4033,65 @@ enum { /* Link quality command flags bit fields */ /* Bit 0: (0) Don't use RTS (1) Use RTS */ -#define IWM_LQ_FLAG_USE_RTS_POS 0 -#define IWM_LQ_FLAG_USE_RTS_MSK (1 << IWM_LQ_FLAG_USE_RTS_POS) +#define IWM_LQ_FLAG_USE_RTS_POS 0 +#define IWM_LQ_FLAG_USE_RTS_MSK (1 << IWM_LQ_FLAG_USE_RTS_POS) /* Bit 1-3: LQ command color. Used to match responses to LQ commands */ -#define IWM_LQ_FLAG_COLOR_POS 1 -#define IWM_LQ_FLAG_COLOR_MSK (7 << IWM_LQ_FLAG_COLOR_POS) +#define IWM_LQ_FLAG_COLOR_POS 1 +#define IWM_LQ_FLAG_COLOR_MSK (7 << IWM_LQ_FLAG_COLOR_POS) /* Bit 4-5: Tx RTS BW Signalling * (0) No RTS BW signalling * (1) Static BW signalling * (2) Dynamic BW signalling */ -#define IWM_LQ_FLAG_RTS_BW_SIG_POS 4 -#define IWM_LQ_FLAG_RTS_BW_SIG_NONE (0 << IWM_LQ_FLAG_RTS_BW_SIG_POS) -#define IWM_LQ_FLAG_RTS_BW_SIG_STATIC (1 << IWM_LQ_FLAG_RTS_BW_SIG_POS) -#define IWM_LQ_FLAG_RTS_BW_SIG_DYNAMIC (2 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_POS 4 +#define IWM_LQ_FLAG_RTS_BW_SIG_NONE (0 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_STATIC (1 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_DYNAMIC (2 << IWM_LQ_FLAG_RTS_BW_SIG_POS) /* Bit 6: (0) No dynamic BW selection (1) Allow dynamic BW selection * Dyanmic BW selection allows Tx with narrower BW then requested in rates */ -#define IWM_LQ_FLAG_DYNAMIC_BW_POS 6 -#define IWM_LQ_FLAG_DYNAMIC_BW_MSK (1 << IWM_LQ_FLAG_DYNAMIC_BW_POS) +#define IWM_LQ_FLAG_DYNAMIC_BW_POS 6 +#define IWM_LQ_FLAG_DYNAMIC_BW_MSK (1 << IWM_LQ_FLAG_DYNAMIC_BW_POS) +/* Single Stream Tx Parameters (lq_cmd->ss_params) + * Flags to control a smart FW decision about whether BFER/STBC/SISO will be + * used for single stream Tx. + */ + +/* Bit 0-1: Max STBC streams allowed. Can be 0-3. + * (0) - No STBC allowed + * (1) - 2x1 STBC allowed (HT/VHT) + * (2) - 4x2 STBC allowed (HT/VHT) + * (3) - 3x2 STBC allowed (HT only) + * All our chips are at most 2 antennas so only (1) is valid for now. + */ +#define IWM_LQ_SS_STBC_ALLOWED_POS 0 +#define IWM_LQ_SS_STBC_ALLOWED_MSK (3 << IWM_LQ_SS_STBC_ALLOWED_MSK) + +/* 2x1 STBC is allowed */ +#define IWM_LQ_SS_STBC_1SS_ALLOWED (1 << IWM_LQ_SS_STBC_ALLOWED_POS) + +/* Bit 2: Beamformer (VHT only) is allowed */ +#define IWM_LQ_SS_BFER_ALLOWED_POS 2 +#define IWM_LQ_SS_BFER_ALLOWED (1 << IWM_LQ_SS_BFER_ALLOWED_POS) + +/* Bit 3: Force BFER or STBC for testing + * If this is set: + * If BFER is allowed then force the ucode to choose BFER else + * If STBC is allowed then force the ucode to choose STBC over SISO + */ +#define IWM_LQ_SS_FORCE_POS 3 +#define IWM_LQ_SS_FORCE (1 << IWM_LQ_SS_FORCE_POS) + +/* Bit 31: ss_params field is valid. Used for FW backward compatibility + * with other drivers which don't support the ss_params API yet + */ +#define IWM_LQ_SS_PARAMS_VALID_POS 31 +#define IWM_LQ_SS_PARAMS_VALID (1 << IWM_LQ_SS_PARAMS_VALID_POS) + /** * struct iwm_lq_cmd - link quality command * @sta_id: station to update @@ -4078,11 +4114,11 @@ enum { * 2 - 0x3f: maximal number of frames (up to 3f == 63) * @rs_table: array of rates for each TX try, each is rate_n_flags, * meaning it is a combination of IWM_RATE_MCS_* and IWM_RATE_*_PLCP - * @bf_params: beam forming params, currently not used + * @ss_params: single stream features. declare whether STBC or BFER are allowed. */ struct iwm_lq_cmd { uint8_t sta_id; - uint8_t reserved1; + uint8_t reduced_tpc; uint16_t control; /* LINK_QUAL_GENERAL_PARAMS_API_S_VER_1 */ uint8_t flags; @@ -4096,7 +4132,7 @@ struct iwm_lq_cmd { uint8_t agg_frame_cnt_limit; uint32_t reserved2; uint32_t rs_table[IWM_LQ_MAX_RETRY_NUM]; - uint32_t bf_params; + uint32_t ss_params; }; /* LINK_QUALITY_CMD_API_S_VER_1 */ /* @@ -4533,7 +4569,8 @@ struct iwm_mvm_tx_resp { uint8_t pa_integ_res_b[3]; uint8_t pa_integ_res_c[3]; uint16_t measurement_req_id; - uint16_t reserved; + uint8_t reduced_tpc; + uint8_t reserved; uint32_t tfd_info; uint16_t seq_ctl; From owner-svn-src-all@freebsd.org Thu Mar 1 06:56:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A2FF2D250; Thu, 1 Mar 2018 06:56:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3956DDBD; Thu, 1 Mar 2018 06:56:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18F5B25177; Thu, 1 Mar 2018 06:56:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216uAL6069225; Thu, 1 Mar 2018 06:56:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216uApJ069222; Thu, 1 Mar 2018 06:56:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010656.w216uApJ069222@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 06:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330224 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:56:11 -0000 Author: eadler Date: Thu Mar 1 06:56:10 2018 New Revision: 330224 URL: https://svnweb.freebsd.org/changeset/base/330224 Log: MFC r321509: [iwm] Sync statistics API definitions with Linux iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:55:46 2018 (r330223) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:56:10 2018 (r330224) @@ -323,8 +323,10 @@ static int iwm_mvm_get_signal_strength(struct iwm_soft struct iwm_rx_phy_info *); static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *); -static int iwm_get_noise(struct iwm_softc *sc, +static int iwm_get_noise(struct iwm_softc *, const struct iwm_mvm_statistics_rx_non_phy *); +static void iwm_mvm_handle_rx_statistics(struct iwm_softc *, + struct iwm_rx_packet *); static boolean_t iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *, uint32_t, boolean_t); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, @@ -3167,6 +3169,15 @@ iwm_get_noise(struct iwm_softc *sc, #endif } +static void +iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +{ + struct iwm_notif_statistics_v10 *stats = (void *)&pkt->data; + + memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); + sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); +} + /* * iwm_mvm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler * @@ -5440,13 +5451,9 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_CALIB_RES_NOTIF_PHY_DB: break; - case IWM_STATISTICS_NOTIFICATION: { - struct iwm_notif_statistics *stats; - stats = (void *)pkt->data; - memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); - sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); + case IWM_STATISTICS_NOTIFICATION: + iwm_mvm_handle_rx_statistics(sc, pkt); break; - } case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:55:46 2018 (r330223) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:56:10 2018 (r330224) @@ -2898,6 +2898,18 @@ struct iwm_mcast_filter_cmd { uint8_t addr_list[0]; } __packed; /* IWM_MCAST_FILTERING_CMD_API_S_VER_1 */ +/* + * The first MAC indices (starting from 0) + * are available to the driver, AUX follows + */ +#define IWM_MAC_INDEX_AUX 4 +#define IWM_MAC_INDEX_MIN_DRIVER 0 +#define IWM_NUM_MAC_INDEX_DRIVER IWM_MAC_INDEX_AUX +#define IWM_NUM_MAC_INDEX (IWM_MAC_INDEX_AUX + 1) + +/*********************************** + * Statistics API + ***********************************/ struct iwm_mvm_statistics_dbg { uint32_t burst_check; uint32_t burst_count; @@ -2914,24 +2926,6 @@ struct iwm_mvm_statistics_div { uint32_t reserved2; } __packed; /* IWM_STATISTICS_SLOW_DIV_API_S_VER_2 */ -struct iwm_mvm_statistics_general_common { - uint32_t temperature; /* radio temperature */ - uint32_t temperature_m; /* radio voltage */ - struct iwm_mvm_statistics_dbg dbg; - uint32_t sleep_time; - uint32_t slots_out; - uint32_t slots_idle; - uint32_t ttl_timestamp; - struct iwm_mvm_statistics_div div; - uint32_t rx_enable_counter; - /* - * num_of_sos_states: - * count the number of times we have to re-tune - * in order to get out of bad PHY status - */ - uint32_t num_of_sos_states; -} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_5 */ - struct iwm_mvm_statistics_rx_non_phy { uint32_t bogus_cts; /* CTS received when not expecting CTS */ uint32_t bogus_ack; /* ACK received when not expecting ACK */ @@ -3002,6 +2996,23 @@ struct iwm_mvm_statistics_rx_ht_phy { uint32_t unsupport_mcs; } __packed; /* IWM_STATISTICS_HT_RX_PHY_API_S_VER_1 */ +struct iwm_mvm_statistics_tx_non_phy { + uint32_t preamble_cnt; + uint32_t rx_detected_cnt; + uint32_t bt_prio_defer_cnt; + uint32_t bt_prio_kill_cnt; + uint32_t few_bytes_cnt; + uint32_t cts_timeout; + uint32_t ack_timeout; + uint32_t expected_ack_cnt; + uint32_t actual_ack_cnt; + uint32_t dump_msdu_cnt; + uint32_t burst_abort_next_frame_mismatch_cnt; + uint32_t burst_abort_missing_next_frame_cnt; + uint32_t cts_timeout_collision; + uint32_t ack_or_ba_timeout_collision; +} __packed; /* IWM_STATISTICS_TX_NON_PHY_API_S_VER_3 */ + #define IWM_MAX_CHAINS 3 struct iwm_mvm_statistics_tx_non_phy_agg { @@ -3032,20 +3043,7 @@ struct iwm_mvm_statistics_tx_channel_width { }; /* IWM_STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */ struct iwm_mvm_statistics_tx { - uint32_t preamble_cnt; - uint32_t rx_detected_cnt; - uint32_t bt_prio_defer_cnt; - uint32_t bt_prio_kill_cnt; - uint32_t few_bytes_cnt; - uint32_t cts_timeout; - uint32_t ack_timeout; - uint32_t expected_ack_cnt; - uint32_t actual_ack_cnt; - uint32_t dump_msdu_cnt; - uint32_t burst_abort_next_frame_mismatch_cnt; - uint32_t burst_abort_missing_next_frame_cnt; - uint32_t cts_timeout_collision; - uint32_t ack_or_ba_timeout_collision; + struct iwm_mvm_statistics_tx_non_phy general; struct iwm_mvm_statistics_tx_non_phy_agg agg; struct iwm_mvm_statistics_tx_channel_width channel_width; } __packed; /* IWM_STATISTICS_TX_API_S_VER_4 */ @@ -3062,17 +3060,38 @@ struct iwm_mvm_statistics_bt_activity { uint32_t lo_priority_rx_denied_cnt; } __packed; /* IWM_STATISTICS_BT_ACTIVITY_API_S_VER_1 */ -struct iwm_mvm_statistics_general { - struct iwm_mvm_statistics_general_common common; +struct iwm_mvm_statistics_general_v8 { + uint32_t radio_temperature; + uint32_t radio_voltage; + struct iwm_mvm_statistics_dbg dbg; + uint32_t sleep_time; + uint32_t slots_out; + uint32_t slots_idle; + uint32_t ttl_timestamp; + struct iwm_mvm_statistics_div slow_div; + uint32_t rx_enable_counter; + /* + * num_of_sos_states: + * count the number of times we have to re-tune + * in order to get out of bad PHY status + */ + uint32_t num_of_sos_states; uint32_t beacon_filtered; uint32_t missed_beacons; - int8_t beacon_filter_average_energy; - int8_t beacon_filter_reason; - int8_t beacon_filter_current_energy; - int8_t beacon_filter_reserved; + uint8_t beacon_filter_average_energy; + uint8_t beacon_filter_reason; + uint8_t beacon_filter_current_energy; + uint8_t beacon_filter_reserved; uint32_t beacon_filter_delta_time; struct iwm_mvm_statistics_bt_activity bt_activity; -} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_5 */ + uint64_t rx_time; + uint64_t on_time_rf; + uint64_t on_time_scan; + uint64_t tx_time; + uint32_t beacon_counter[IWM_NUM_MAC_INDEX]; + uint8_t beacon_average_energy[IWM_NUM_MAC_INDEX]; + uint8_t reserved[4 - (IWM_NUM_MAC_INDEX % 4)]; +} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_8 */ struct iwm_mvm_statistics_rx { struct iwm_mvm_statistics_rx_phy ofdm; @@ -3086,24 +3105,23 @@ struct iwm_mvm_statistics_rx { * * By default, uCode issues this notification after receiving a beacon * while associated. To disable this behavior, set DISABLE_NOTIF flag in the - * IWM_REPLY_STATISTICS_CMD 0x9c, above. - * - * Statistics counters continue to increment beacon after beacon, but are - * cleared when changing channels or when driver issues IWM_REPLY_STATISTICS_CMD - * 0x9c with CLEAR_STATS bit set (see above). - * - * uCode also issues this notification during scans. uCode clears statistics - * appropriately so that each notification contains statistics for only the - * one channel that has just been scanned. + * IWM_STATISTICS_CMD (0x9c), below. */ -struct iwm_notif_statistics { /* IWM_STATISTICS_NTFY_API_S_VER_8 */ +struct iwm_notif_statistics_v10 { uint32_t flag; struct iwm_mvm_statistics_rx rx; struct iwm_mvm_statistics_tx tx; - struct iwm_mvm_statistics_general general; -} __packed; + struct iwm_mvm_statistics_general_v8 general; +} __packed; /* IWM_STATISTICS_NTFY_API_S_VER_10 */ +#define IWM_STATISTICS_FLG_CLEAR 0x1 +#define IWM_STATISTICS_FLG_DISABLE_NOTIF 0x2 + +struct iwm_statistics_cmd { + uint32_t flags; +} __packed; /* IWM_STATISTICS_CMD_API_S_VER_1 */ + /*********************************** * Smart Fifo API ***********************************/ @@ -3186,14 +3204,6 @@ struct iwm_sf_cfg_cmd { /* * BEGIN mvm/fw-api-mac.h */ - -/* - * The first MAC indices (starting from 0) - * are available to the driver, AUX follows - */ -#define IWM_MAC_INDEX_AUX 4 -#define IWM_MAC_INDEX_MIN_DRIVER 0 -#define IWM_NUM_MAC_INDEX_DRIVER IWM_MAC_INDEX_AUX enum iwm_ac { IWM_AC_BK, Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:55:46 2018 (r330223) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:56:10 2018 (r330224) @@ -525,7 +525,7 @@ struct iwm_softc { /* phy contexts. we only use the first one */ struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX]; - struct iwm_notif_statistics sc_stats; + struct iwm_notif_statistics_v10 sc_stats; int sc_noise; caddr_t sc_drvbpf; From owner-svn-src-all@freebsd.org Thu Mar 1 06:56:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BE21F2D430; Thu, 1 Mar 2018 06:56:35 +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 707AB6DF0D; Thu, 1 Mar 2018 06:56:35 +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 6AF9E25178; Thu, 1 Mar 2018 06:56:35 +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 w216uZlH069286; Thu, 1 Mar 2018 06:56:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216uZ56069283; Thu, 1 Mar 2018 06:56:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010656.w216uZ56069283@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 06:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330225 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:56:35 -0000 Author: eadler Date: Thu Mar 1 06:56:34 2018 New Revision: 330225 URL: https://svnweb.freebsd.org/changeset/base/330225 Log: MFC r321510: [iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:56:10 2018 (r330224) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:56:34 2018 (r330225) @@ -4476,13 +4476,6 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ break; case IEEE80211_S_RUN: - { - struct iwm_host_cmd cmd = { - .id = IWM_LQ_CMD, - .len = { sizeof(in->in_lq), }, - .flags = IWM_CMD_SYNC, - }; - /* Update the association state, now we have it all */ /* (eg associd comes in at this point */ error = iwm_assoc(vap, sc); @@ -4500,15 +4493,13 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ iwm_mvm_update_quotas(sc, ivp); iwm_setrates(sc, in); - cmd.data[0] = &in->in_lq; - if ((error = iwm_send_cmd(sc, &cmd)) != 0) { + if ((error = iwm_mvm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_LQ_CMD failed\n", __func__); + "%s: IWM_LQ_CMD failed: %d\n", __func__, error); } iwm_mvm_led_enable(sc); break; - } default: break; Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:56:10 2018 (r330224) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:56:34 2018 (r330225) @@ -488,6 +488,32 @@ iwm_dma_contig_free(struct iwm_dma_info *dma) } } +/** + * iwm_mvm_send_lq_cmd() - Send link quality command + * @init: This command is sent as part of station initialization right + * after station has been added. + * + * The link quality command is sent as the last step of station creation. + * This is the special case in which init is set and we call a callback in + * this case to clear the state indicating that station creation is in + * progress. + */ +int +iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq, boolean_t init) +{ + struct iwm_host_cmd cmd = { + .id = IWM_LQ_CMD, + .len = { sizeof(struct iwm_lq_cmd), }, + .flags = init ? 0 : IWM_CMD_ASYNC, + .data = { lq, }, + }; + + if (lq->sta_id == IWM_MVM_STATION_COUNT) + return EINVAL; + + return iwm_send_cmd(sc, &cmd); +} + boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc) { Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:56:10 2018 (r330224) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:56:34 2018 (r330225) @@ -120,6 +120,9 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, str bus_size_t size, bus_size_t alignment); extern void iwm_dma_contig_free(struct iwm_dma_info *); +extern int iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq, + boolean_t init); + extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc); extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); From owner-svn-src-all@freebsd.org Thu Mar 1 06:57:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DCB5F2D87A; Thu, 1 Mar 2018 06:57:39 +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 6D58F6E261; Thu, 1 Mar 2018 06:57: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 667302517D; Thu, 1 Mar 2018 06:57: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 w216vdII069418; Thu, 1 Mar 2018 06:57:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216vdMU069415; Thu, 1 Mar 2018 06:57:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010657.w216vdMU069415@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 06:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330227 - in stable/11/sys: dev/iwm modules/iwmfw/iwm8265fw X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: dev/iwm modules/iwmfw/iwm8265fw X-SVN-Commit-Revision: 330227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:57:39 -0000 Author: eadler Date: Thu Mar 1 06:57:38 2018 New Revision: 330227 URL: https://svnweb.freebsd.org/changeset/base/330227 Log: MFC r324434: Add support for Intel 8265 WiFi Obtained from: OpenBSD Added: stable/11/sys/modules/iwmfw/iwm8265fw/ - copied from r324434, head/sys/modules/iwmfw/iwm8265fw/ Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_8000.c stable/11/sys/dev/iwm/if_iwm_config.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:57:02 2018 (r330226) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:57:38 2018 (r330227) @@ -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 @@ -5848,6 +5848,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; @@ -5863,6 +5864,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: stable/11/sys/dev/iwm/if_iwm_8000.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_8000.c Thu Mar 1 06:57:02 2018 (r330226) +++ stable/11/sys/dev/iwm/if_iwm_8000.c Thu Mar 1 06:57:38 2018 (r330227) @@ -76,6 +76,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 @@ -87,6 +88,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: stable/11/sys/dev/iwm/if_iwm_config.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_config.h Thu Mar 1 06:57:02 2018 (r330226) +++ stable/11/sys/dev/iwm/if_iwm_config.h Thu Mar 1 06:57:38 2018 (r330227) @@ -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__ */ From owner-svn-src-all@freebsd.org Thu Mar 1 07:18:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A2DF32308; Thu, 1 Mar 2018 07:18:29 +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 EDB5C70AD7; Thu, 1 Mar 2018 07:18:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8847254D9; Thu, 1 Mar 2018 07:18:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217ISQl079507; Thu, 1 Mar 2018 07:18:28 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217ISqw079506; Thu, 1 Mar 2018 07:18:28 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010718.w217ISqw079506@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 07:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330228 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 330228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 07:18:29 -0000 Author: eadler Date: Thu Mar 1 07:18:28 2018 New Revision: 330228 URL: https://svnweb.freebsd.org/changeset/base/330228 Log: MFC r325123: Reference iwm8265fw support in iwm(4) as well This documentation update is similar to what was done in iwmfw(4) in r325121. Modified: stable/11/share/man/man4/iwm.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/iwm.4 ============================================================================== --- stable/11/share/man/man4/iwm.4 Thu Mar 1 06:57:38 2018 (r330227) +++ stable/11/share/man/man4/iwm.4 Thu Mar 1 07:18:28 2018 (r330228) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2016 +.Dd October 29, 2017 .Dt IWM 4 .Os .Sh NAME @@ -49,6 +49,7 @@ Choose one from: .Cd "device iwm7260fw" .Cd "device iwm7265fw" .Cd "device iwm8000Cfw" +.Cd "device iwm8265fw" .Ed .Pp Or you can use @@ -67,6 +68,7 @@ iwm3160fw_load="YES" iwm7260fw_load="YES" iwm7265fw_load="YES" iwm8000Cfw_load="YES" +iwm8265fw_load="YES" .Ed .Sh DESCRIPTION The From owner-svn-src-all@freebsd.org Thu Mar 1 07:22:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53C6EF3312D; Thu, 1 Mar 2018 07:22:54 +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 296B9714F3; Thu, 1 Mar 2018 07:22:54 +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 2460E25693; Thu, 1 Mar 2018 07:22:54 +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 w217MrjA084278; Thu, 1 Mar 2018 07:22:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217Mrdk084277; Thu, 1 Mar 2018 07:22:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010722.w217Mrdk084277@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 07:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330229 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 330229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 07:22:54 -0000 Author: eadler Date: Thu Mar 1 07:22:53 2018 New Revision: 330229 URL: https://svnweb.freebsd.org/changeset/base/330229 Log: MFC r325122,r325124,r325125: Fill in the blanks for iwm8265fw(4) rules, missed in r324434 Now using "device iwmfw" or "device iwm8265fw" in one's kernel configuration will potentially result in a working IWM8265 series wireless SoC. This is an alternative to the fix that was made in r324470 for `sys/modules/iwmfw`. Modified: stable/11/sys/conf/files Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 07:18:28 2018 (r330228) +++ stable/11/sys/conf/files Thu Mar 1 07:22:53 2018 (r330229) @@ -1940,6 +1940,20 @@ iwm8000C.fw optional iwm8000Cfw | iwmfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwm8000C.fw" +iwm8265.fw optional iwm8265fw | iwmfw \ + dependency "$S/contrib/dev/iwm/iwm-8265-22.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwm8265.fw" +iwm8265fw.c optional iwm8265fw | iwmfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwm8265.fw:iwm8265fw -miwm8265fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwm8265fw.c" +iwm8265fw.fwo optional iwm8265fw | iwmfw \ + dependency "iwm8265.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwm8265fw.fwo" dev/iwn/if_iwn.c optional iwn iwn1000fw.c optional iwn1000fw | iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn1000.fw:iwn1000fw -miwn1000fw -c${.TARGET}" \ From owner-svn-src-all@freebsd.org Thu Mar 1 07:59:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169DFF3A4ED; Thu, 1 Mar 2018 07:59:15 +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 B5FF573AE6; Thu, 1 Mar 2018 07:59:14 +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 95A6C25BA4; Thu, 1 Mar 2018 07:59:14 +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 w217xE6D099521; Thu, 1 Mar 2018 07:59:14 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217xEfO099517; Thu, 1 Mar 2018 07:59:14 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010759.w217xEfO099517@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 07:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330232 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 330232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 07:59:15 -0000 Author: eadler Date: Thu Mar 1 07:59:14 2018 New Revision: 330232 URL: https://svnweb.freebsd.org/changeset/base/330232 Log: MFC r307602: [net80211] Initial full-offload scan support. This is a very simple addition to the net80211 scan support. It doesn't implement a replacement scan interface - it just disables the pieces that we should disable to make this lifecycle a bit more managable. There's more work to come before full scan offload support is available but it should be good enough for driver work. * add a flag to say "full offload" * don't do probe requests when scanning full-offload - firmware can do that * don't do powersave transitions and buffering - firmware can do that tested: * iwm(4) - STA mode * ath10k port (local, not in freebsd-head yet) Modified: stable/11/sys/net80211/ieee80211_scan_sw.c stable/11/sys/net80211/ieee80211_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- stable/11/sys/net80211/ieee80211_scan_sw.c Thu Mar 1 07:55:48 2018 (r330231) +++ stable/11/sys/net80211/ieee80211_scan_sw.c Thu Mar 1 07:59:14 2018 (r330232) @@ -410,6 +410,12 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanne return (ic->ic_flags & IEEE80211_F_SCAN); } +/* + * Taskqueue work to cancel a scan. + * + * Note: for offload scan devices, we may want to call into the + * driver to try and cancel scanning, however it may not be cancelable. + */ static void cancel_scan(struct ieee80211vap *vap, int any, const char *func) { @@ -506,6 +512,12 @@ ieee80211_swscan_probe_curchan(struct ieee80211vap *va int i; /* + * Full-offload scan devices don't require this. + */ + if (vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) + return; + + /* * Send directed probe requests followed by any * broadcast probe request. * XXX remove dependence on ic/vap->iv_bss @@ -611,7 +623,14 @@ scan_start(void *arg, int pending) return; } - if (vap->iv_opmode == IEEE80211_M_STA && + /* + * Put the station into power save mode. + * + * This is only required if we're not a full-offload devices; + * those devices manage scan/traffic differently. + */ + if (((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0) && + vap->iv_opmode == IEEE80211_M_STA && vap->iv_state == IEEE80211_S_RUN) { if ((vap->iv_bss->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) { /* Enable station power save mode */ @@ -864,7 +883,12 @@ scan_done(struct ieee80211_scan_state *ss, int scandon * waiting for us. */ if (scandone) { - vap->iv_sta_ps(vap, 0); + /* + * If we're not a scan offload device, come back out of + * station powersave. Offload devices handle this themselves. + */ + if ((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0) + vap->iv_sta_ps(vap, 0); if (ss->ss_next >= ss->ss_last) ic->ic_flags_ext &= ~IEEE80211_FEXT_BGSCAN; Modified: stable/11/sys/net80211/ieee80211_var.h ============================================================================== --- stable/11/sys/net80211/ieee80211_var.h Thu Mar 1 07:55:48 2018 (r330231) +++ stable/11/sys/net80211/ieee80211_var.h Thu Mar 1 07:59:14 2018 (r330232) @@ -601,11 +601,12 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FEXT_WDSLEGACY 0x00010000 /* CONF: legacy WDS operation */ #define IEEE80211_FEXT_PROBECHAN 0x00020000 /* CONF: probe passive channel*/ #define IEEE80211_FEXT_UNIQMAC 0x00040000 /* CONF: user or computed mac */ +#define IEEE80211_FEXT_SCAN_OFFLOAD 0x00080000 /* CONF: scan is fully offloaded */ #define IEEE80211_FEXT_BITS \ "\20\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \ "\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT" \ - "\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC" + "\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC\24SCAN_OFFLOAD" /* ic_flags_ht/iv_flags_ht */ #define IEEE80211_FHT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */ From owner-svn-src-all@freebsd.org Thu Mar 1 07:42:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A261F37BE8; Thu, 1 Mar 2018 07:42:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D82472F24; Thu, 1 Mar 2018 07:42:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 181C1259C5; Thu, 1 Mar 2018 07:42:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217gLZq093564; Thu, 1 Mar 2018 07:42:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217gKY4093543; Thu, 1 Mar 2018 07:42:20 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010742.w217gKY4093543@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 07:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330230 - in stable/11/sys: conf contrib/dev/iwm modules/iwmfw modules/iwmfw/iwm3160fw modules/iwmfw/iwm7260fw modules/iwmfw/iwm7265Dfw modules/iwmfw/iwm7265fw modules/iwmfw/iwm8000Cfw X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf contrib/dev/iwm modules/iwmfw modules/iwmfw/iwm3160fw modules/iwmfw/iwm7260fw modules/iwmfw/iwm7265Dfw modules/iwmfw/iwm7265fw modules/iwmfw/iwm8000Cfw X-SVN-Commit-Revision: 330230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 07:42:21 -0000 Author: eadler Date: Thu Mar 1 07:42:20 2018 New Revision: 330230 URL: https://svnweb.freebsd.org/changeset/base/330230 Log: MFC r313419,r313420,r313421,r313423,r313426,r313428,r314078,r314079,r319584,r319586,r319588,r324469,r324470,r324435,r325122: [iwmfw] add version 17 firmware. [iwmfw] add version 17 firmware. [iwmfw] add version 17 firmware. [iwmfw] add this 3 megabyte firmware image. [iwmfw] bump firmware to version 17. [iwmfw] back this out to version 16 for now. [iwmfw] add 7265D firmware. [iwmfw] add 7265D firmware. [iwmfw] add 7265D-22 firmware [iwmfw] 8000C ver 22 firmware. [iwmfw] bump built firmware now to version 22 for 7265D and 8000C. [iwmfw] Add missing SUBDIR needed for iwmfw to load after ^/head@r324434 [iwmfw] Add the firmware for the Intel 8265 WiFi device. Added: stable/11/sys/contrib/dev/iwm/iwm-3160-17.fw.uu - copied unchanged from r313419, head/sys/contrib/dev/iwm/iwm-3160-17.fw.uu stable/11/sys/contrib/dev/iwm/iwm-7260-17.fw.uu - copied unchanged from r313420, head/sys/contrib/dev/iwm/iwm-7260-17.fw.uu stable/11/sys/contrib/dev/iwm/iwm-7265-17.fw.uu - copied unchanged from r313421, head/sys/contrib/dev/iwm/iwm-7265-17.fw.uu stable/11/sys/contrib/dev/iwm/iwm-7265D-22.fw.uu - copied unchanged from r319584, head/sys/contrib/dev/iwm/iwm-7265D-22.fw.uu stable/11/sys/contrib/dev/iwm/iwm-8000C-17.fw.uu - copied unchanged from r313423, head/sys/contrib/dev/iwm/iwm-8000C-17.fw.uu stable/11/sys/contrib/dev/iwm/iwm-8000C-22.fw.uu - copied unchanged from r319586, head/sys/contrib/dev/iwm/iwm-8000C-22.fw.uu stable/11/sys/contrib/dev/iwm/iwm-8265-22.fw.uu - copied unchanged from r324435, head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu stable/11/sys/modules/iwmfw/iwm7265Dfw/ - copied from r314079, head/sys/modules/iwmfw/iwm7265Dfw/ Modified: stable/11/sys/conf/files stable/11/sys/modules/iwmfw/Makefile stable/11/sys/modules/iwmfw/iwm3160fw/Makefile stable/11/sys/modules/iwmfw/iwm7260fw/Makefile stable/11/sys/modules/iwmfw/iwm7265Dfw/Makefile stable/11/sys/modules/iwmfw/iwm7265fw/Makefile stable/11/sys/modules/iwmfw/iwm8000Cfw/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 07:22:53 2018 (r330229) +++ stable/11/sys/conf/files Thu Mar 1 07:42:20 2018 (r330230) @@ -1926,6 +1926,20 @@ iwm7265.fw optional iwm7265fw | iwmfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwm7265.fw" +iwm7265Dfw.c optional iwm7265Dfw | iwmfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwm7265D.fw:iwm7265Dfw -miwm7265Dfw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwm7265Dfw.c" +iwm7265Dfw.fwo optional iwm7265Dfw | iwmfw \ + dependency "iwm7265D.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwm7265Dfw.fwo" +iwm7265D.fw optional iwm7265Dfw | iwmfw \ + dependency "$S/contrib/dev/iwm/iwm-7265D-17.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwm7265D.fw" iwm8000Cfw.c optional iwm8000Cfw | iwmfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwm8000C.fw:iwm8000Cfw -miwm8000Cfw -c${.TARGET}" \ no-implicit-rule before-depend local \ Copied: stable/11/sys/contrib/dev/iwm/iwm-3160-17.fw.uu (from r313419, head/sys/contrib/dev/iwm/iwm-3160-17.fw.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/contrib/dev/iwm/iwm-3160-17.fw.uu Thu Mar 1 07:42:20 2018 (r330230, copy of r313419, head/sys/contrib/dev/iwm/iwm-3160-17.fw.uu) @@ -0,0 +1,20409 @@ +begin 644 iwm-3160-17.fw +M`````$E73`IS=')E86TZ3&EN=7A?0V]R94-Y8VQE,31?````"`````(`````````'````!`````````` +M````````````````&P````0````!````$P````0``0```(```````!$```#B +M804```$```````"$?(``,"B``(RF@`#,F8``Z!.``(";@``````````````` +M``````````````````!L(,`0#QL)(MP=P!`*`!M`(``;;@0``&$0`!MN`0`` +M810``&$/``!A```;)"``&R7D'<`1W`3`$@$`&W`(``!A#QP=(@0`'2;H'<`0 +M`0`;,.@=P!&"!!LD"``;)00HP!'I#P!A```;)0`!&R1<',`1````8=P=P!`` +M`!TD````(0$`6#$/10`B`%P`.?0EP!`!`1,R`0$3,P$`$V+O_P`R!```8@-@ +M`&(``%@X`@!8,6,``&'D!,`2Z!W`$0$`4B2T'\`0`@`3<`,``&$(`%@P"`!D +M,0<``&$/$U(B@@03)`@`$R4!`%)N`0``80$``&$```!A"`!8;NL/`&$``!,E +M```3)"00P!$`@!,D```3)3@!,B!`#* +M$0```20```$E"0``84``$R4&`1,D!"C`$0]V$R(L2,<1#W@3(@``QA$#``$D +M```!)0]%`"(`7``Y[_\`,AD``&0`@!,D`0`3)3@P'P!($*,`1\`?`$LA)QQ$/@=P!`/$P'AX>'AL7 +M%!(*'AX>'AX>'AL7%!(*'AX>'AX>'AL7%!(*'AX````````````````8M@$` +M!0```@0```!#AY.(@< +MB1R*'(L)P```L```!TH@$`#````/3_`0`- +M````6%("``X```"@"6`+X`4````"!.```````````````` +M```$`````0`````````!`````0```!X```````````````$!#@X````````R +M"`(/`P`!``````````$!#@X````````C!`(*`````````````/0!```````` +M````````````````.%"````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````0`````)`!```` +MH``0)P``Z`,``.@#```0(X``$".``/R$@`#XA(``^(2``/"$@`#\A(``^(2` +M`/B$@`#PA(``\(2``/R$@`#\A(``\(2``/R$@`#TA(```````/__```!`0`` +M``````````$`````L!T!`+`=`0"P'0$`!/\``+`=`0"P'0$`.`$!`+`=`0`` +M]```P/T``+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`= +M`0"P'0$`L!T!`+`=`0!D&`$`7!4!`+P8`0"P'0$`L!T!`+`=`0#`#@$`/!T! +M`%`1`0`$$@$`"!$!`+@%`0`(!0$`;`H!`)@4`0#0'0$`L!T!``3R``"<]``` +ML!T!`)CX``#@]@``>`8!`!`"`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P +M'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!``#_ +M``#\_@``^/X``+`=`0"P'0$`L!T!`+`=`0"P'0$`\`$!`+`=`0"P'0$`L!T! +M`+`=`0"P'0$`P!H!`+`=`0"P'0$`-`X!`,`-`0"P'0$`L!T!`+`=`0``#@$` +ML!T!`+`=`0"P'0$`L!T!`+`=`0#(_```W/L``+`=`0"P'0$`L!T!`'0(`0#L +M'P$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`$@4`0"P'0$`%`D!`+`= +M`0#H#0$`L!T!``C_``"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0!L_@``L!T! +M`+`=`0"P'0$`L!T!`+`=`0"P'0$`'!H!`/0,`0"P'0$`L!T!`+`=`0"8_0`` +ML!T!`/C\``!T!@$`L!T!`-@&`0"P'0$`L!T!`+`=`0!X_0``L!T!`+`=`0`T +M_P``L!T!`(P:`0!P`@$`L!T!`+`=`0#<``$`Z!\!`+`=`0`\&@$`L!T!``@, +M`0`H_```G!D!`+`=`0"P'0$`@`P!`+`=`0"P'0$`L!T!`%P&`0"P'0$`L!T! +M`+`=`0"P'0$`L!T!`#P#`0"P'0$`L!T!`+`=`0"P'0$`L!T!`/@3`0"P'0$` +ML!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P +M'0$`L!T!`#0(`0#P'P$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`//8``+`= +M`0"P'0$`L!T!`*0?`0"``P$`L!T!`+`=`0"P'0$`L!T!`,P#`0`$%0$`2/8` +M`+`=`0"P'0$`L!T!`+`=`0"P'0$`Y!\!`+`=`0#```````````````````````````````````````#T*@$`!0```@0` +M``!`8```#_!P!8 +M!P```/\@``P0$``$`1`.$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0#Q`)$!`% +M"A`+$!`0$`(0$`T0$!`0$!`0$!`0$`8#$!`0$!`0$!`0$!`0$!`($!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0!Q`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!``````!(6` +M```````````````````````````````````````````````````````````` +M`````/\```#__________________________P`````````````````````` +M`````````````````````````````````````````````````````````"BP +M`0`@-@$`"+8!`"`V`0#0;@(`(#8!`#PC`0!,3@(`D%8!`"`V`0`@-@$`7%(" +M`%Q2`@!<4@(`7%("`%Q2`@!<4@(`7%("`"`V`0`@-@$`(#8!`"`V`0`HD@`` +M(#8!`"`V`0`@-@$`(#8!`"`V`0!@5@$`2%8!`"`V`0`@-@$````````````` +M`````````````````````````````````````0````$````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````$````"`````P````````#_````_P```/\```#_```` +M````````````````````````````````_P```(@3```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````#_____```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````"``````````````````````````/____\````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````(``````````````````````````_____P`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````@`````````````````````````#_____```````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````"``````````````````````````/____\` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````(`````````````````````````` +M``````````````````````````#_```````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````_____P````#_____`````/____\`````_____P``````````#P`_ +M``$````/`#\``0````\`/P`!````#P`_``$````/`#\``0`````````/`#\` +M`0````\`/P`!````#P`_``$````/`#\``0````\`/P`!``````````\`/P`! +M````#P`_``$````/`#\``0````\`/P`!````#P`_``$`````````#P`_``$` +M```/`#\``0````\`/P`!````#P`_``$````/`#\``0`````````/`#\``0`` +M``\`/P`!````#P`_``$````/`#\``0````\`/P`!``````````````"K```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``#J"J(*7@H="N`)I0EM"3<)!`G3"*0(=PA+""((^@?3!ZX'B@<````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````!42````@````0```!#C($&QY?#C(%(!Y@ +M#C(&)1YB#C('*AYC#C((+QYD#C()-!YE#C(*.1YG#C(+/AYH#C(,0QYI#C(- +M2!YJ#C(.31YL#C(B4$`-(``D8$`/(#$F<$`2(#0H`$$4(#$J$$$7(#$L($$9 +M(#$N,$$<(#,P0$$>(#$R4$$A(#$T8$$C(#$V<$$F(#,X`$(H(#$Z$$(K(#$\ +M($(M(#$^,$(P(#-`0$(R(#%D8$1?(C!F<$1B(C)H`$5D(B]J$$5G(B]L($5I +M(B]N,$5L(C)P0$5N(B]R4$5Q(B]T8$5S(B]V<$5V(C)X`$9X(B]Z$$9[(B]\ +M($9](B]^,$:`(C&`0$:"(B^"4$:%(@"$8$:'(BZ&<$:*(C&(`$>,(BZ*$$>/ +M(BZ,($>1(BZ.,$>4(C"00$>6(BV12$>8(@"5:$>=(BV7>$>?(C"9"$BB)"V; +M&$BD)"V=*$BG)"V?.$BI)#"A2$BL)"VE:$BQ)"T````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````/``\`#P`/ +M``\`#P`/``\````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````0`!``````#``)``T``````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````#QB```*````!````%Q^@``````````````````````````````` +M````````````````````````_____Z#%@````````````$!"#P!`0@\`0$(/ +M`$!"#P!`0@\`0$(/`$!"#P!`0@\`0$(/`$!"#P#@!P``0`$``.`'``!``0`` +M("<``.`'``#@!P``0`$``.`'``!``0```@`````````"```````````````` +M`````````````````````````````````````````-1M@`!\XX``&``````` +M``````````````````#_____```````````````````````````````````` +M`````````````````````````````````````````````````.`3`@`$%`(` +M%!0"`.P3`@#<$P(`&!0"`,03`@```````%`````P```````````````````` +M``````````!```"`,0``@`X``````````````````````````````"X````R +M````(``````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````"0'@(`[!H"`(`>`@!T'0(`8!X"`."H`0`8'@(`'!L" +M`*`<`@#0&@(`U!H"```````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`(````````````````````"`````@("`@("`@("`@("`@("`@("`@("`@("` +M@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("` +M@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("` +M@("`@("`@("`@("`@(```@```````````````````````````````(`````` +M`/\```````````(```````````````````````````````"```````#_```` +M```````"````````````````````````````````@```````_P`````````` +M`@```````````````````````````````(```````/\```````````(````` +M``````````````````````````"```````#_```````````"```````````` +M````````````````````@```````_P```````````@`````````````````` +M`````````````(```````/\```````````(````````````````````````` +M``````"```````#_```````````"```````````````````````````````` +M@```````_P```````````@```````````````````````````````(`````` +M`/\```````````(```````````````````````````````"```````#_```` +M```````"````````````````````````````````@```````_P`````````` +M`@```````````````````````````````(```````/\```````````(````` +M``````````````````````````"```````#_```````````"```````````` +M````````````````````@```````_P```````````@`````````````````` +M`````````````(```````/\``````````````````($`````````@@`````` +M``"#`````````(0`````````A0````````"&`````````(<`````````B``` +M``````")`````````(H`````````BP````````",`````````(T````````` +MC@````````"/`````````,`!```````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`,!G``"09P``%&@``*AG```8:```B&<``,1G``#_````_P```/\```#_```` +M_P```/\```#_````_P```/\```#_````_P```/\```#_````_P```/\```#_ +M````_P```/\```#_````_P```/\```#_````_P```/\```#_````_P```/\` +M``#_````_P```/\```#_```````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````&""@`!P@H``H(*``+""@`#@@H``@ +M(*``)""@`#`@H``T(*``/""@`$`AH`!$(:``:"&@`&PAH`!X(:``2"&@`$PA +MH`!P(:``="&@`'PAH```````_P`````````````````````````````````` +M```````````````````````T+0(`!0```@0```!6]Y:7E]=W9W;W=I=WUU=G5O=6EU?7-VR5T +M)8HC@B-[(W0CBB&"(7LA="&/!8<%?P5X!8\#AP-_`W@#?7EV>6]Y:7E]=W9W +M;W=I=WUU=G5O=6EU?7-V4%R06Q!9D%Z)7,E;25G)7HCB%S +M(6TA9R%]!78%;P5I!7T#=@-O`VD#?7EV>6]Y:7E]=W9W;W=I=WUU=G5O=6EU +M?7-V7)Y;'F`=WEW75R=6QU@'-Y6]R;VQO@&UY;7)M;&V`:WEK6ER:6QI@&=Y9W)G;&>` +M97EE6-R8VQC@&%Y87)A;&%_17A%<45K17]#>$-Q0VM#?T%X07%! +M:T&$)7TE=B5O)80C?2-V(V\CA"%](78A;R&'!7\%>`5R!8<#?P-X`W(#```` +M``````#^````T-"ZN;>WN+>X`````````````````````````.^^K=[OOJW> +M[[ZMWN^^K=X``````````````````````````%1Q```*````!````%Q^@``` +M````S/X``+`=`0"\!`$``````/\````$````````````````````__\``(0U +M``"8-0``K#4``#@U```P-0``0#4``*PT``"D-```<.(``'S>``"$WP``X-\` +M``3?``!DWP``O-\``+CB``#,Z```%.D``,3I```.D``+#I```4Z@`` +M3-\``##?``!PW@`````````````"`@7_`@,```(!`0$#`P#_`P$!`0,``@(# +M`@4&```"_P````,```$#``$$!``#`P4``@4&`0$!_P$``@(!`P`%`0(%!@`` +M```````````````````8+0(`!@````0```!W]\$W@```P4'"0L5 +M#0\1$P```P`&!@8&!@8```````````,-+XF)-T.)B8F)B7.)66$`58)K38F) +MB8F)0TT"T`````!A04%`04%!0"%!04``````0&``8$!@8& +M!@8&!@8&!@8&!@(&!``````+!P,`.S____'____R#___\A____ +M_R+___\C____)/___R7___\F`````````````````````````````,`L```` +M````P"P``````````````@````(````L@0$`Z((````````````````````` +M```````````````````/`#\``@````\`/P`"````#P`_``(````/`#\``@`` +M``\`/P`"(`````````$```"JJJJJJJJJJJJJJNZJJJJJ*/\`S*JJ``"JJ@#, +MJJH```!``,``0`#``%``\`!0`/`````````````````````````````````` +M``````````````````````````````"JJJJJJJJJJJJJJJJJJJJJJJJJJJJJ +MJJJJJJJJJJJJJ@``````````````````````;&UN;W!Q0GMH +M+Z$]FA\6*;27T!XXCN,X',=Q'+V$]A*.XS@.',=Q'([C.`Y>0GL)QW$8!'`*(`M`"=0#J`%\!U`&^`J@#'022!'P%&`;J`-0! +MO@*H`WP%4`=BM>9-FNQ%CYT?0(F'^A7O +MZ[+)C@O[[$%GL_U?ZD6_(_=3EN1;F\)U'.&N/6I,6FQ!?@+U3X-<:/11--$( +M^9/B5/%NW%AM>:56:4$<^*$.D&!('^\*!$>+HE +MXTOSHOY=P("*!:T_O"%(<`3QWV/!=W6O8T(P(!KE#OUMOTR!%!@U)B_#X;ZB +M-JS(Y[HK,I7FH,"8&=&>?Z-F1'Y4JSN#"\J,*:?BO!T6=JT[VU9D3G0>%-N2"@QL2.2X79]NO>]#IL2H.:0Q-].+\C+50XM9 +M;K?:C`%DL=*RWO\J-9M.BP``0($!`8&"`@````1```````````````` +M````9````!````#_``P@"````!(````````````````````L`0``$````/\` +M#"`"````$P```````````````````"P!```0````_P`,(`<````4```````` +M`$`&`````````0```!`````!``Q`!````!4`````````0`8````````!```` +M$`````$`#$`#````%@````````!`!@````````$````0`````0`,0`,````7 +M`````````````````````0```!````#_``0`!````!@`````````0`8````` +M```R````,@````$!S$`#````&0````````````````````$````!`````0$` +M@`$````:`````````````````````0````$```#__P"@!0```!L````````` +M$``````````!````$`````$"!``&````'``````````$``````````$````! +M`````0`,``$````=``````````0``````````0````$````!``P``0```!X` +M````````!``````````!`````0````$``(`!````'P`````````````````` +M``$````(````_P`,(`8````@`````````````````````0````@```#_``P@ +M`@```"$````````````````````!`````0```/\`#*`#````(@`````````` +M``````````$````!`````0(,@`$````C`````````````````````0````$` +M``#_``"@!@```"0````````````````````!`````0````$"1``"````)0`` +M``````````````````$````0````_P`,(`,````F`````````-@````````` +M`0```&0````!``@``@```"<`````````+`$````````!`````0````$`#$`$ +M````*``````````L`0````````$````!````_P`,0`0````I`````````"P! +M`````````0````$````!``Q`!````"H`````````+`$````````!`````0`` +M``$`#$`#````*P`````````L`0````````$````!`````0`,0`4````L```` +M``````(``````````0````$````!``0`!0```"T`````````!``````````! +M`````0````$`#$`!````+@`````````L`0````````$```!I`````0`,0`,` +M```O``````````````````````(``!(```#_``Q@`@```#``````````,@`` +M``````!D````$````/\`#&`&````,0`````````L`0````````$```!N```` +M`0`,0`0````$#`P(%!0$!$````"```````$````"````!````$```$````!` +M````_T%5514`````@(B("`````$``!S_____`!````0!`!C^__]_``@```0" +M`1C_____`!````$!`1C_____`!````,``!S\_U+550T```(``!S\_Z?JJPX` +M``4"`1C\_U+550T```(!`1C\_Z?JJPX```,!`1C\_U+550T```4!`!C\_ZEJ +MJP8```!````7````>*X``!0``````````0```(1\`0``````>-,```,```!` +MLP``!`````C.```(````N,L```P```"LO@``$0`````````3````!*\``!8` +M```\<`(``````##3```$````4&X"``4```"LN0``"````+S+```,````8,$` +M``T`````````$0```````````````````-#2``` Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDB15F39CBA; Thu, 1 Mar 2018 07:55:48 +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 863837379F; Thu, 1 Mar 2018 07:55:48 +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 7D16625B94; Thu, 1 Mar 2018 07:55:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217tmYm099332; Thu, 1 Mar 2018 07:55:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217tmNF099331; Thu, 1 Mar 2018 07:55:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010755.w217tmNF099331@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 07:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330231 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 330231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 07:55:49 -0000 Author: eadler Date: Thu Mar 1 07:55:48 2018 New Revision: 330231 URL: https://svnweb.freebsd.org/changeset/base/330231 Log: MFC r314080: Modified: stable/11/share/man/man4/iwmfw.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/iwmfw.4 ============================================================================== --- stable/11/share/man/man4/iwmfw.4 Thu Mar 1 07:42:20 2018 (r330230) +++ stable/11/share/man/man4/iwmfw.4 Thu Mar 1 07:55:48 2018 (r330231) @@ -55,6 +55,7 @@ module at boot time, place the following line in iwm3160fw_load="YES" iwm7260fw_load="YES" iwm7265fw_load="YES" +iwm7265Dfw_load="YES" iwm8000Cfw_load="YES" .Ed .Sh DESCRIPTION From owner-svn-src-all@freebsd.org Thu Mar 1 08:05:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7CA3F3B518; Thu, 1 Mar 2018 08:05:53 +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 5A5CA740BA; Thu, 1 Mar 2018 08:05:53 +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 5412625D59; Thu, 1 Mar 2018 08:05:53 +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 w2185rbP004642; Thu, 1 Mar 2018 08:05:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2185r4A004640; Thu, 1 Mar 2018 08:05:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010805.w2185r4A004640@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 08:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330233 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 330233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 08:05:54 -0000 Author: eadler Date: Thu Mar 1 08:05:52 2018 New Revision: 330233 URL: https://svnweb.freebsd.org/changeset/base/330233 Log: MFC r324570,r324580: [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path. The duplicate detection code currently expects A-MSDU frames to be encaped - they're decap'ed /after/ duplicate detection. However for ath10k (and iwm hardware later on) the firmware supports doing A-MSDU decap in hardware - which shows up as multiple frames with the same sequence number and IV. This is the first part of decap handling - if we see a stretch of A-MSDU frames from the driver with the MORE bit set, then don't treat them as duplicates. This isn't 100% complete as crypto sequence number handling and "A-MSDU in A-MPDU" needs handling, but it's a start. This should be a glorified no-op for everyone. Please tell me if it isn't. Modified: stable/11/sys/net80211/ieee80211_input.h stable/11/sys/net80211/ieee80211_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_input.h ============================================================================== --- stable/11/sys/net80211/ieee80211_input.h Thu Mar 1 07:59:14 2018 (r330232) +++ stable/11/sys/net80211/ieee80211_input.h Thu Mar 1 08:05:52 2018 (r330233) @@ -131,7 +131,39 @@ ishtinfooui(const uint8_t *frm) return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI); } +static __inline int +ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs) +{ + + return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU)); +} + /* + * Return 1 if the rxseq check should increment the sequence + * number. Return 0 if it's part of an AMSDU batch and it isn't + * the final frame in the decap'ed burst. + */ +static __inline int +ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs) +{ + /* No state? ok */ + if (rxs == NULL) + return (1); + + /* State but no AMSDU set? ok */ + if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0) + return (1); + + /* State, AMSDU set, then _MORE means "don't inc yet" */ + if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) { + return (0); + } + + /* Both are set, so return ok */ + return (1); +} + +/* * Check the current frame sequence number against the current TID * state and return whether it's in sequence or should be dropped. * @@ -225,7 +257,20 @@ ieee80211_check_rxseq(struct ieee80211_node *ni, struc goto fail; ok: - ni->ni_rxseqs[tid] = rxseq; + /* + * Only bump the sequence number if it's the last frame + * in a batch. That way frames in the rest of the batch + * get included, and the last frame in the batch kicks + * it next. + */ + if (ieee80211_check_rxseq_amsdu_more(rxs)) { + ni->ni_rxseqs[tid] = rxseq; + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) + IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); + } else { + /* .. still waiting */ + IEEE80211_NODE_STAT(ni, rx_amsdu_more); + } return 1; Modified: stable/11/sys/net80211/ieee80211_ioctl.h ============================================================================== --- stable/11/sys/net80211/ieee80211_ioctl.h Thu Mar 1 07:59:14 2018 (r330232) +++ stable/11/sys/net80211/ieee80211_ioctl.h Thu Mar 1 08:05:52 2018 (r330233) @@ -84,7 +84,11 @@ struct ieee80211_nodestats { uint32_t ns_tx_deauth_code; /* last deauth reason */ uint32_t ns_tx_disassoc; /* disassociations */ uint32_t ns_tx_disassoc_code; /* last disassociation reason */ - uint32_t ns_spare[8]; + + /* Hardware A-MSDU decode */ + uint32_t ns_rx_amsdu_more; /* RX decap A-MSDU, more coming from A-MSDU */ + uint32_t ns_rx_amsdu_more_end; /* RX decap A-MSDU (or any other frame), no more coming */ + uint32_t ns_spare[6]; }; /* From owner-svn-src-all@freebsd.org Thu Mar 1 08:30:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9450DF3ECFA; Thu, 1 Mar 2018 08:30:09 +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 3D2BD74DE6; Thu, 1 Mar 2018 08:30:09 +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 3759D260C9; Thu, 1 Mar 2018 08:30:09 +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 w218U91s014457; Thu, 1 Mar 2018 08:30:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w218U99B014456; Thu, 1 Mar 2018 08:30:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803010830.w218U99B014456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 1 Mar 2018 08:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330234 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 08:30:09 -0000 Author: avg Date: Thu Mar 1 08:30:08 2018 New Revision: 330234 URL: https://svnweb.freebsd.org/changeset/base/330234 Log: MFC r329711: MFV r329710: 8966 use after end of the lifetime of a local variable PR: 225162 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Mar 1 08:05:52 2018 (r330233) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Mar 1 08:30:08 2018 (r330234) @@ -1174,6 +1174,7 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t sa_bulk_attr_t bulk[5]; uint64_t ctime[2]; int count = 0; + zfs_acl_phys_t acl_phys; mode = zp->z_mode; @@ -1220,7 +1221,6 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t } else { /* Painful legacy way */ zfs_acl_node_t *aclnode; uint64_t off = 0; - zfs_acl_phys_t acl_phys; uint64_t aoid; if ((error = sa_lookup(zp->z_sa_hdl, SA_ZPL_ZNODE_ACL(zfsvfs), From owner-svn-src-all@freebsd.org Thu Mar 1 08:33:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F7DF3F6FB; Thu, 1 Mar 2018 08:33:20 +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 67B1F7532E; Thu, 1 Mar 2018 08:33:20 +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 62A9126260; Thu, 1 Mar 2018 08:33:20 +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 w218XKjw019290; Thu, 1 Mar 2018 08:33:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w218XKWW019289; Thu, 1 Mar 2018 08:33:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803010833.w218XKWW019289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 1 Mar 2018 08:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330235 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 08:33:20 -0000 Author: avg Date: Thu Mar 1 08:33:20 2018 New Revision: 330235 URL: https://svnweb.freebsd.org/changeset/base/330235 Log: MFC r329711: MFV r329710: 8966 use after end of the lifetime of a local variable PR: 225162 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Mar 1 08:30:08 2018 (r330234) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Mar 1 08:33:20 2018 (r330235) @@ -1171,6 +1171,7 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t sa_bulk_attr_t bulk[5]; uint64_t ctime[2]; int count = 0; + zfs_acl_phys_t acl_phys; mode = zp->z_mode; @@ -1217,7 +1218,6 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t } else { /* Painful legacy way */ zfs_acl_node_t *aclnode; uint64_t off = 0; - zfs_acl_phys_t acl_phys; uint64_t aoid; if ((error = sa_lookup(zp->z_sa_hdl, SA_ZPL_ZNODE_ACL(zfsvfs), From owner-svn-src-all@freebsd.org Thu Mar 1 10:35:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EC88F34E01; Thu, 1 Mar 2018 10:35:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3BD27AF69; Thu, 1 Mar 2018 10:35:05 +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 AE81A27655; Thu, 1 Mar 2018 10:35:05 +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 w21AZ5pV079725; Thu, 1 Mar 2018 10:35:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21AZ5eC079723; Thu, 1 Mar 2018 10:35:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803011035.w21AZ5eC079723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 1 Mar 2018 10:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330237 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 330237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 10:35:06 -0000 Author: avg Date: Thu Mar 1 10:35:05 2018 New Revision: 330237 URL: https://svnweb.freebsd.org/changeset/base/330237 Log: MFC r329314: MFV r329313: 8857 zio_remove_child() panic due to already destroyed parent zio PR: 223803 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Mar 1 10:31:51 2018 (r330236) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Mar 1 10:35:05 2018 (r330237) @@ -200,6 +200,9 @@ enum zio_flag { (((zio)->io_flags & ZIO_FLAG_VDEV_INHERIT) | \ ZIO_FLAG_CANFAIL) +#define ZIO_CHILD_BIT(x) (1 << (x)) +#define ZIO_CHILD_BIT_IS_SET(val, x) ((val) & (1 << (x))) + enum zio_child { ZIO_CHILD_VDEV = 0, ZIO_CHILD_GANG, @@ -207,6 +210,14 @@ enum zio_child { ZIO_CHILD_LOGICAL, ZIO_CHILD_TYPES }; + +#define ZIO_CHILD_VDEV_BIT ZIO_CHILD_BIT(ZIO_CHILD_VDEV) +#define ZIO_CHILD_GANG_BIT ZIO_CHILD_BIT(ZIO_CHILD_GANG) +#define ZIO_CHILD_DDT_BIT ZIO_CHILD_BIT(ZIO_CHILD_DDT) +#define ZIO_CHILD_LOGICAL_BIT ZIO_CHILD_BIT(ZIO_CHILD_LOGICAL) +#define ZIO_CHILD_ALL_BITS \ + (ZIO_CHILD_VDEV_BIT | ZIO_CHILD_GANG_BIT | \ + ZIO_CHILD_DDT_BIT | ZIO_CHILD_LOGICAL_BIT) enum zio_wait_type { ZIO_WAIT_READY = 0, Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Mar 1 10:31:51 2018 (r330236) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Mar 1 10:35:05 2018 (r330237) @@ -512,21 +512,26 @@ zio_remove_child(zio_t *pio, zio_t *cio, zio_link_t *z } static boolean_t -zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait) +zio_wait_for_children(zio_t *zio, uint8_t childbits, enum zio_wait_type wait) { - uint64_t *countp = &zio->io_children[child][wait]; boolean_t waiting = B_FALSE; mutex_enter(&zio->io_lock); ASSERT(zio->io_stall == NULL); - if (*countp != 0) { - zio->io_stage >>= 1; - ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); - zio->io_stall = countp; - waiting = B_TRUE; + for (int c = 0; c < ZIO_CHILD_TYPES; c++) { + if (!(ZIO_CHILD_BIT_IS_SET(childbits, c))) + continue; + + uint64_t *countp = &zio->io_children[c][wait]; + if (*countp != 0) { + zio->io_stage >>= 1; + ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); + zio->io_stall = countp; + waiting = B_TRUE; + break; + } } mutex_exit(&zio->io_lock); - return (waiting); } @@ -1330,9 +1335,10 @@ zio_write_compress(zio_t *zio) * If our children haven't all reached the ready stage, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_LOGICAL_BIT | + ZIO_CHILD_GANG_BIT, ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); @@ -2180,8 +2186,9 @@ zio_gang_issue(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == zio); ASSERT(zio->io_child_type > ZIO_CHILD_GANG); @@ -2502,8 +2509,9 @@ zio_ddt_read_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_DDT_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_GET_DEDUP(bp)); ASSERT(BP_GET_PSIZE(bp) == zio->io_size); @@ -3235,8 +3243,9 @@ zio_vdev_io_done(zio_t *zio) vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; boolean_t unexpected_error = B_FALSE; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE); @@ -3312,8 +3321,9 @@ zio_vdev_io_assess(zio_t *zio) { vdev_t *vd = zio->io_vd; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } if (vd == NULL && !(zio->io_flags & ZIO_FLAG_CONFIG_WRITER)) spa_config_exit(zio->io_spa, SCL_ZIO, zio); @@ -3544,9 +3554,10 @@ zio_ready(zio_t *zio) zio_t *pio, *pio_next; zio_link_t *zl = NULL; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT | ZIO_CHILD_DDT_BIT, + ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (zio->io_ready) { ASSERT(IO_IS_ALLOCATING(zio)); @@ -3686,11 +3697,9 @@ zio_done(zio_t *zio) * If our children haven't all completed, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_ALL_BITS, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } /* * If the allocation throttle is enabled, then update the accounting. From owner-svn-src-all@freebsd.org Thu Mar 1 10:31:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 10:57:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06A65F38472; Thu, 1 Mar 2018 10:57:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A209E7C136; Thu, 1 Mar 2018 10:57:50 +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 9B98127993; Thu, 1 Mar 2018 10:57:50 +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 w21Avocv089747; Thu, 1 Mar 2018 10:57:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21AvoCj089745; Thu, 1 Mar 2018 10:57:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803011057.w21AvoCj089745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 1 Mar 2018 10:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330238 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 330238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 10:57:51 -0000 Author: avg Date: Thu Mar 1 10:57:50 2018 New Revision: 330238 URL: https://svnweb.freebsd.org/changeset/base/330238 Log: MFC r329314: MFV r329313: 8857 zio_remove_child() panic due to already destroyed parent zio PR: 223803 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Mar 1 10:35:05 2018 (r330237) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Mar 1 10:57:50 2018 (r330238) @@ -220,6 +220,9 @@ enum zio_flag { (((zio)->io_flags & ZIO_FLAG_VDEV_INHERIT) | \ ZIO_FLAG_CANFAIL) +#define ZIO_CHILD_BIT(x) (1 << (x)) +#define ZIO_CHILD_BIT_IS_SET(val, x) ((val) & (1 << (x))) + enum zio_child { ZIO_CHILD_VDEV = 0, ZIO_CHILD_GANG, @@ -227,6 +230,14 @@ enum zio_child { ZIO_CHILD_LOGICAL, ZIO_CHILD_TYPES }; + +#define ZIO_CHILD_VDEV_BIT ZIO_CHILD_BIT(ZIO_CHILD_VDEV) +#define ZIO_CHILD_GANG_BIT ZIO_CHILD_BIT(ZIO_CHILD_GANG) +#define ZIO_CHILD_DDT_BIT ZIO_CHILD_BIT(ZIO_CHILD_DDT) +#define ZIO_CHILD_LOGICAL_BIT ZIO_CHILD_BIT(ZIO_CHILD_LOGICAL) +#define ZIO_CHILD_ALL_BITS \ + (ZIO_CHILD_VDEV_BIT | ZIO_CHILD_GANG_BIT | \ + ZIO_CHILD_DDT_BIT | ZIO_CHILD_LOGICAL_BIT) enum zio_wait_type { ZIO_WAIT_READY = 0, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Mar 1 10:35:05 2018 (r330237) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Mar 1 10:57:50 2018 (r330238) @@ -515,21 +515,26 @@ zio_remove_child(zio_t *pio, zio_t *cio, zio_link_t *z } static boolean_t -zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait) +zio_wait_for_children(zio_t *zio, uint8_t childbits, enum zio_wait_type wait) { - uint64_t *countp = &zio->io_children[child][wait]; boolean_t waiting = B_FALSE; mutex_enter(&zio->io_lock); ASSERT(zio->io_stall == NULL); - if (*countp != 0) { - zio->io_stage >>= 1; - ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); - zio->io_stall = countp; - waiting = B_TRUE; + for (int c = 0; c < ZIO_CHILD_TYPES; c++) { + if (!(ZIO_CHILD_BIT_IS_SET(childbits, c))) + continue; + + uint64_t *countp = &zio->io_children[c][wait]; + if (*countp != 0) { + zio->io_stage >>= 1; + ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); + zio->io_stall = countp; + waiting = B_TRUE; + break; + } } mutex_exit(&zio->io_lock); - return (waiting); } @@ -1324,9 +1329,10 @@ zio_write_compress(zio_t *zio) * If our children haven't all reached the ready stage, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_LOGICAL_BIT | + ZIO_CHILD_GANG_BIT, ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); @@ -2144,8 +2150,9 @@ zio_gang_issue(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == zio); ASSERT(zio->io_child_type > ZIO_CHILD_GANG); @@ -2454,8 +2461,9 @@ zio_ddt_read_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_DDT_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_GET_DEDUP(bp)); ASSERT(BP_GET_PSIZE(bp) == zio->io_size); @@ -3156,8 +3164,9 @@ zio_vdev_io_done(zio_t *zio) vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; boolean_t unexpected_error = B_FALSE; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE); @@ -3233,8 +3242,9 @@ zio_vdev_io_assess(zio_t *zio) { vdev_t *vd = zio->io_vd; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } if (vd == NULL && !(zio->io_flags & ZIO_FLAG_CONFIG_WRITER)) spa_config_exit(zio->io_spa, SCL_ZIO, zio); @@ -3455,9 +3465,10 @@ zio_ready(zio_t *zio) zio_t *pio, *pio_next; zio_link_t *zl = NULL; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT | ZIO_CHILD_DDT_BIT, + ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (zio->io_ready) { ASSERT(IO_IS_ALLOCATING(zio)); @@ -3597,11 +3608,9 @@ zio_done(zio_t *zio) * If our children haven't all completed, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_ALL_BITS, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } /* * If the allocation throttle is enabled, then update the accounting. From owner-svn-src-all@freebsd.org Thu Mar 1 13:52:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 14:11:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 14:14:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 049CAF2E36E for ; Thu, 1 Mar 2018 14:14:09 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-qt0-x231.google.com (mail-qt0-x231.google.com [IPv6:2607:f8b0:400d:c0d::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9732B87DDD for ; Thu, 1 Mar 2018 14:14:08 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-qt0-x231.google.com with SMTP id n12so7653447qtl.5 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=pdTA7cSSLPTelfaNeXWYqTda/zZ4roy9tUMQaC7WD2A9tBa6augRuYqhRkcYjI2szi TbVlxWYeDq+6/DGlaTxMxuxuTjVtxuiPqRIrDm5gcX1engVnOkIS4PMMq90WOkFB7LhO 1QUEKWopVNTQ5VU/Y7BaJ2u2eXiSVUGtc9F2Y67Ep6s8mZFRLrKPXdv2KiTh9U39wKYu CvP3h3wplq/LAKk8z3aoYTcmJhrlYIyRCmqGIDBfBiTTjWazskxb9odRYprgCXfKPm63 yaor08W6bhS+k8/Bj1dkqvi0dqfNcB4q15X7QvnLvTLaQqn8hIesOGThJKj1TKjQP/A3 wuGQ== X-Gm-Message-State: AElRT7HyJp3Q0yM5DyBh41/neFZykx3muUW04nQ7TYHBO5zlzKfJz2TU 1VAyuK+JU2qUrS61YadOtCJqyT8gw7nKICr+nOpJEM9r 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 15:21:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C8AF34600; Thu, 1 Mar 2018 15:21:53 +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 AA83D6BF59; Thu, 1 Mar 2018 15:21:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B52D270C; Thu, 1 Mar 2018 15:21:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21FLqbe027086; Thu, 1 Mar 2018 15:21:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21FLqOl027084; Thu, 1 Mar 2018 15:21:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803011521.w21FLqOl027084@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 15:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330241 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 330241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 15:21:53 -0000 Author: eadler Date: Thu Mar 1 15:21:52 2018 New Revision: 330241 URL: https://svnweb.freebsd.org/changeset/base/330241 Log: Revert MFC of r330233 This was an additional commit that I did not intend to MFC... and also broke the build Pointy Hat To: me Modified: stable/11/sys/net80211/ieee80211_input.h stable/11/sys/net80211/ieee80211_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_input.h ============================================================================== --- stable/11/sys/net80211/ieee80211_input.h Thu Mar 1 14:11:07 2018 (r330240) +++ stable/11/sys/net80211/ieee80211_input.h Thu Mar 1 15:21:52 2018 (r330241) @@ -131,39 +131,7 @@ ishtinfooui(const uint8_t *frm) return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI); } -static __inline int -ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs) -{ - - return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU)); -} - /* - * Return 1 if the rxseq check should increment the sequence - * number. Return 0 if it's part of an AMSDU batch and it isn't - * the final frame in the decap'ed burst. - */ -static __inline int -ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs) -{ - /* No state? ok */ - if (rxs == NULL) - return (1); - - /* State but no AMSDU set? ok */ - if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0) - return (1); - - /* State, AMSDU set, then _MORE means "don't inc yet" */ - if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) { - return (0); - } - - /* Both are set, so return ok */ - return (1); -} - -/* * Check the current frame sequence number against the current TID * state and return whether it's in sequence or should be dropped. * @@ -257,20 +225,7 @@ ieee80211_check_rxseq(struct ieee80211_node *ni, struc goto fail; ok: - /* - * Only bump the sequence number if it's the last frame - * in a batch. That way frames in the rest of the batch - * get included, and the last frame in the batch kicks - * it next. - */ - if (ieee80211_check_rxseq_amsdu_more(rxs)) { - ni->ni_rxseqs[tid] = rxseq; - if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) - IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); - } else { - /* .. still waiting */ - IEEE80211_NODE_STAT(ni, rx_amsdu_more); - } + ni->ni_rxseqs[tid] = rxseq; return 1; Modified: stable/11/sys/net80211/ieee80211_ioctl.h ============================================================================== --- stable/11/sys/net80211/ieee80211_ioctl.h Thu Mar 1 14:11:07 2018 (r330240) +++ stable/11/sys/net80211/ieee80211_ioctl.h Thu Mar 1 15:21:52 2018 (r330241) @@ -84,11 +84,7 @@ struct ieee80211_nodestats { uint32_t ns_tx_deauth_code; /* last deauth reason */ uint32_t ns_tx_disassoc; /* disassociations */ uint32_t ns_tx_disassoc_code; /* last disassociation reason */ - - /* Hardware A-MSDU decode */ - uint32_t ns_rx_amsdu_more; /* RX decap A-MSDU, more coming from A-MSDU */ - uint32_t ns_rx_amsdu_more_end; /* RX decap A-MSDU (or any other frame), no more coming */ - uint32_t ns_spare[6]; + uint32_t ns_spare[8]; }; /* From owner-svn-src-all@freebsd.org Thu Mar 1 15:43:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 16:03:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0D2FF37C0C; Thu, 1 Mar 2018 16:03:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E1616DE62; Thu, 1 Mar 2018 16:03:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58BF52DD5; Thu, 1 Mar 2018 16:03:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21G3DFj049162; Thu, 1 Mar 2018 16:03:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21G3Dqb049161; Thu, 1 Mar 2018 16:03:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803011603.w21G3Dqb049161@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 16:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330242 - stable/11/sys/contrib/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/contrib/dev/iwm X-SVN-Commit-Revision: 330242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 16:03:14 -0000 Author: eadler Date: Thu Mar 1 16:03:13 2018 New Revision: 330242 URL: https://svnweb.freebsd.org/changeset/base/330242 Log: MFC r314077: Add 7265D firmware. Added: stable/11/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu - copied unchanged from r314077, head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu (from r314077, head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu Thu Mar 1 16:03:13 2018 (r330242, copy of r314077, head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu) @@ -0,0 +1,30750 @@ +begin 644 iwm-7265D-17.fw +M`````$E73`IS=')E86TZ3&EN=7A?0V]R94-Y8VQE,31?````"`````(`````````'````!`````````` +M````````````````&P````0````!````$P````2``0```(```````!$```#B +M804```$```````"`O8``5#2``"ST@`#DY(``"!Z```#G@``````````````` +M``````````````````!L(,`0#QL)(MP=P!`*`!M`(``;;@H``&&``!MN/``` +M80`!&VX]``!A``(;;CX``&$0`!MN`0``84P``&%'``!A```;)"``&R7D'<`1 +MB`;A&!\`"&(``!LE`0`;)```!24!``4D``@%.0$`!6*((,`1`@`%)``(!3D! +M``5BC"#`$00`!20`"`4Y`0`%8I`@P!$(``4D``@%.0$`!6*4(,`1$``%)``( +M!3D!``5BF"#`$2``!20`"`4Y`0`%8IP@P!%```4D``@%.0$`!6*@(,`1```( +M)0``""2(!N$9A`;A&4`&P!(!`!MP"```80\<'2($`!TFZ!W`$`$`&S#H'<`1 +M@@0;)`@`&R4$*,`1O@\`80``&R2``!LEY!W`$0``&R0``1LEY!W`$0``&R0` +M`ALEY!W`$0@`7W`$``!AV!W`$/_^&S+8'<`1KP\`8=@=P!```1LPV!W`$:L/ +M`&$``!LE``$;)%P!,B``#&$0,` +M`20```$E#T4`(@!<`#GO_P`R'```9`"`$R0!`!,E.!S`$0]W$R+@',`1`@`! +M8@\!$R($",`1!P`3)0<.$R0$*,`1C`G`$@0HP!&0"<`2R$G'$0]P$R(!`!,P +M!"C`$9@)P!(8*,`1#Q,#(@@`6#$#`!,D```3)00(P!$``!,D.$7`$04``&$` +M`%@X!`!8,0``$R0!`!,E.!S`$0``%20````AZ!W`$`\3!R(/9`$B"@`!0`@` +M`7`>``!A"`!8;@D``&$(``=P!0``80`"7#$!``@D```()80&X1D"``!A`"!8 +M,````&$!0A,D```3)00HP!&"!!,D&``3)00HP!'H'<`0YO\3,O__$S/H'<`1 +M```!)`@``24/`6,B`0!2)`@`!VX"``!A```5)````"$4``!A0`;`$N@=P!$! +M`%(DM!_`$`(`$W`"``!A"`!D,>,/`&$/$U(B#Q-2(@$`4FX$``!A@@03)`@` +M$R4$*,`1!```88($$R08`!,E!"C`$0```&$L-H"!``#`%@(!$V1"`1,D!"C` +M$>C"@($``,`6!@$38@0(P!`$`!-D#UP`(@H``$``!@!P&@``80``$R0``!,E +M``#`%R``6#'((,`0<$7`$!`(P!```!,E`P`3)!P(P!$<",`1```3)`0(P!$/ +M%!4B!``5)@\P("+[_S`R`P`3)!@(P!$/%!4B`@`5)@\@,"(``!,D$$7`$1@( +MP!$0`%@Q#P`3(@$`$S`$*,`1#WP3(@@`S!$``!,E```3)#1(QQ$/>Q,B`0`3 +M,`0HP!$/%!4B`@`5)@]-$R($$,41`@`3)/``#H!@L`>`!@!P\`%``<#1$`&`!,"A(` +MI`$``!,`#`!`#10``P!,#14`!`!0#0`````````````````````````````` +M`````````````````````````!X````>B!Z(6@```%8```!6B%:(`@$``*H` +M``"JB*J(_@$``(P*``!4C%2,I!\```````````````#^```!`/\``@'_`0#_ +M`0$`_@(!`P+_`0$`_P$!`?\"`/\#`@#^!`(#`O\"`@#_`@(!_P,`_P4#`/X& +M`P`#_P,#`/\#`P'_````````````````V#````H````$````=+^````````` +M`````````#@Q```%````!````'2_@``````````````````````````````` +M```!````Y,D``'C+``!(RP``<,L``)3)``",R0``U'4$`$AV!`"4=@0````` +M``````````````$+_P``!0,```0"```&_P```/\```S_```'_P``"/\```G_ +M```*_P```O\!`/\``0(`$0$!`@$!`0/_`0$$`@$!!0,!`08$`0$'!0$!"`8! +M`0D/`0$*$`$`#/\!`/[_`@#_!P(!`?\"`@((`@(#"0("!`H"`@4+`@(&#`(" +M!PT"`@@.`@()#@(""@T"``S_`@#^_P```````````````````````/\'```` +M_P``!_\``0D(```*_P$"```!`P'_`0,"_P$#`_\!`03_`0(%``$!"_\!`@S_ +M`00&!@$!!_\!``C_`0`*_P("`/\"`P'_`@,"_P(#`_\"`00!`@(%``(!"P$" +M`@P!`@0&!@("!P`"``@!`@`*`0,`_P(#`P#_`P,!_P,#`O\#`P,$`P$$!0," +M!0`#`0L%`P(,!0,$!@8#`P?_`P`(!0,`"@4#`/X#!`0`_P0$`?\$!`+_!`0# +M_P0$!/\$!`7_!`0+_P0$#/\$!`8&!`0'!@0`"/\$``K_`````````````/\` +M```!`P`"`@(``P`"```%_P``!O\```3_```'!```"/\!`/\!`0$``P$"`0(! +M`@("`0`$_P$!!P0!``C_`@,`!@("`@8"``7_`@`&_P(`!/\"``<'`@`(!P,# +M``8#``$%`P("!@,!!?\#``;_`P`$!P,`!P<#``@'```````!`/\!`/\``0`! +M_P$"`O\"`/\!`@`!_P(!`_\"`P3_`@(*_P(""?\"`@C_`P`!_P,!`PH#!04* +M`P0&_P,&"@@#`PG_!`#_`P0``?\$`0,+!`('"P0""`0$`P3_!`(*"00$"?\$ +M!`;_!0#_`@4$!O\%`0,&!0`!_P4%"O\%!0D%!@#__P8$!O\&`0,&!@`!_P8# +M!/\&!@D'!@8*_P```````````````````````````````'"V@``!``-LMH`` +M`0`#"!Z```$``52Y@``!``-8N8```0`#<`8!``(`!````````%52``!'10`` +M3$D``$Y#``!$20``4U4``%I:``!:6@``6EH``%I:``!:6@``6EH``%I:``!: +M6@``6EH``%I:``````````@$#`(*!@X!"04-`PL'#P&1```!/P```I$``#X] +M```#D0``/3T```21```_`P``!9$```D0```&D0``%AP```>1```?'P``")$` +M`!P6```)D0``$`D```J1```#/P``"Y$``#T]```,D0``/3X```V1```_`0`` +M$1`^2$@`X!`$````#2`$````81`B````($,Y`````."$`0``X1`!`````A"7 +MRP4`,&`+````#]($````&-+\__\?`7,0````">")AH2$"N"$A```"^"F5=<@ +M#.`BBRPR#>"JB8>^PQ%^"2C(N*&."*B@``&>!^2><@&N`BBRPR&^"3 +M3;>^PQ)&`"`````G,`````$2`4A0$`&1`&````$=(#````,>#_MW8` +M,N#D)3\`,^`B4@X`-.`N````->``````-N`V-C8V-^`V-@``"1!N7P``&A`` +M````,1"&`0``,A"0`0``,Q#(````-!!0````-1"`````.A!I````.Q#````` +MP1``````)(``/```*N#YY>`>>^PQ*."+BXF)*>") +MB0``#&"#)0``.!!2````.1"6````08`!`````D;@<[G2X'.1P.![?;S08V +MFZT&-1KM!KO?\`C,Y7()2F4R"4@D\@C'X_$(1J.Q"$4BD0A$(G$(P^%0"$)A +M,`C!8#`(P6`0"$#@[P>_W^\'O]_O!S^?SP<^G\\'/I_/!SZ?KP>]7J\'O9[/ +M!SZ?KP>]7J\'O9[/!SZ?SP<^G\\'/I_/![_?[P>_W^\'O]\/"$!@,`C!8#`( +MP6!0"$+A<`C#(9$(1"*1",6BT0C&X_$(QR,2"YG$X'N]V.!SQ>KP>^WP\(0&`P"$*B,0WI=#H-S6:S"_G\\'O]_O![\?$`A`8#`(P6`P",%@$`A`(/`'/Y_/ +M![T>CP>\W6X'NYU.!SJ=;@>[W6X'/!ZO!SV?SP>_'Q`(0&`P",%@,`C!8!`( +M0"#P![_?[P<_G^\'O]\/",!@4`A#HO$(R66S"XFZT&M)E,!K%8#`8T'`\(1"*Q",5BT0A&H_$(Q^/Q +M",?CT0A&8[$(12)Q",.A4`C!8#`(0"`0"$`@$`C`8#`(0:%P",,AD0C%8M$( +M1N/Q",?C\0C'H]$(1F.Q",4BD0A`'HX&,%@L!C&9;`:TFNT&.-UN![O=;@>U +M6JT&-=IL!C)9+`8Q&HX'P*+1",;C$0G(9%()2N5R"'1L:&AHB(B`?'AT;&AH:(B(B +M(B`?'AT;&AH:(B(@'QX=&QH:&B(B(B(@'QX=&QH:&B(B(!\>'1L:&AHB(B(B +M(1\>'1L:%Q +M'AX<&A@5$AX>'AX>'!H8%1(B(B(B(1\>'1P:&!@B(B$?'AT<&A@8(B(B(B$? +M'AT<&A@4(B(A'QX='!H8%B(B("`@'QX<&Q@6$AX>'AX>'!L8%A0B(B(B(1\> +M'1P9%Q'AX>'!L7%1(B(B(B(B`?'1L:&AHB(B(@'QT;&AH:(B(B(B(@'QT; +M&AH:(B(B(!\=&QH:&B(B(B(B(!\=&QH:&B(B(B`?'1L:&AHB(B(B(B$@'AP9 +M%Q'!D6$B`@("`@'AP9%A0B(B$A(2$>'1P9%Q"2@`'PDH`"`)*``A"2@ +M`%`0H`!()J``8!"@`$PFH`!D$*``:!"@`%@0H``P$*``/!"@`#00H``L#*`` +M`(&D``&!I``#@:0`B"2@`(PDH`"0)*``E"2@`)@DH`"<)*``H"2@`*0DH``` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````````O@`9R``&R0`& +MR@`!S``%S0`%RP`$S@`#SP`*T``*T0`"T@`"TP`*U``*U0`"U@`"UP`*V``* +MVP"(W`"(W0"JW@#=WP``XP`(Y``(Y0`*Y@`*Z```ZP`([``([0`*[@`,,0`D +M,@`F=P$P.`(P!`!,.```Y0%SY@$*I@)SIP(*^P#_CP$@5@(@@P$`1`(`C@$/ +M50(/D`$`3@(`D0%]D@%]DP%]3P)]4`)]40)]6@!56P!5_0`!Z@$$_@`3_P`& +M;@`*>0`-=0`!?P`/AP`.F0#%F0#-?`$-@`$-/0(-00(-?0'_/@+_?P'_0`+_ +M)P`<*``8*0`<*@`@('>P(0S@$#CP(#D0(`O0$)?@()QP$,B`(, +MO@$)?P()R`$&B0(&I`$0J@$2I0$0JP$290(0:P(29@(0;`(2WP$!UP$`H`(! +MF`(`>@$!.P(!```T`0`V`0`^`5<_`69``7=!`9A"`0=?`:I@`:IQ`7D?`@`I +M`O\J`O\R`GFA`%NB`!NC`#"D`!*E`""F``>G`!NH`!*I``>J``"L``FM``:N +M``RO``FP``:Q``RR``>S``2T``JU``:X`%Z^`!G(``;)``;*``',``7-``7+ +M``3.``//``K0``K1``+2``+3``K4``K5``+6``+7``K8``K;`(C<`(C=`*K> +M`-W?``#C``CD``CE``KF``KH``#K``CL``CM``KN``PQ`"0R`"9W`3`X`C`$ +M`$PX``#E`7/F`0JF`G.G`@K[`/^/`2!6`B"#`0!$`@".`0]5`@^0`0!.`@"1 +M`7V2`7V3`7U/`GU0`GU1`GU:`%5;`%7]``'J`03^`!/_``9N``IY``UU``%_ +M``^'``Z9`,69`,U\`0V``0T]`@U!`@U]`?\^`O]_`?]``O\G`!PH`!@I`!PJ +M`!RY`0>Z`1!Z`@=[`A#.`0./`@.1`@"]`0E^`@G'`0R(`@R^`0E_`@G(`0:) +M`@:D`1"J`1*E`1"K`1)E`A!K`A)F`A!L`A+?`0'7`0"@`@&8`@!Z`0$[`@%B +M`<]D`<]F`<\L`L\N`L\P`L\0``0`"P````,![`$%`!``!``1`!(``P`*``L` +M-`$=`C4!'@(V`1\")0````H`"P`$``\``P'L`1``.`#D`:4"2``2`",````- +M$2(##!R``.@;@``\'(``X!N```,![`$"`>L!!0`$`!``"@`+``8`"`!\`8`! +M/0)!`G,!=P$T`C@"EP%8`ID!6@*6`9@!5P)9`MP!G0(E`)H!6P*<`5T"```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````8````````````````````!```` +M`@`````````N$2\7,!`Q*#(1,_(V(C@1.1#AY.(@````'/6```$`````````.O6```````#_ +M````_____P`````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````$P>`0`P'@$`,!X!```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````M'X```4```($````=+^````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````(`````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````K"L```````#PP````0```&0G`0`"````;#8$``,```!4-@0`!````"QD +M!``%````]/0$``8```"X>@0`!P```#`H`@`(````+"@"``D````0=`0`"@`` +M`$P1!``+````=&T!``P```"`@@0`#0`````/`@`.````'&`!``\```#@"6`+X`4````"!.```````````````````$`````@`````````!`````0`` +M`!X```````````````$!#@X````````R"`(/`P`!``````````$!#@X````` +M```C!`(*`````````````/0!````````````````````````*'>````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````/____\````````````` +M`````````````````````````````````````````````!``````D`$```"@ +M`!`G``#H`P``Z`,``'PN@`!\+H``M,R``+#,@`"PS(``J,R``+3,@`"PS(`` +ML,R``*C,@`"HS(``M,R``+3,@`"HS(``M,R``*S,@```````__\```$!```` +M`````````0````#H)00`Z"4$`.@E!`#<)00`Z"4$`.@E!`#@)00`Z"4$`*C+ +M``"``+3%@`!``/3*@`#\R(``I,F``$S*@``````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````$````` +M``````````````"0!@```/\#`(@'````_P4`"`<```#_+0#D!@```/\]`#@& +M````_P0`7`8```#_)0"P!@```/\\`"0A`0``_]T`,`<```#_3`"$!P```/\B +M`"P'````_R8`@`<```#_*``T(`$``"```&P?`0``_S``>`8```#_!P!8!P`` +M`/\@``P0$``$`1`.$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0#Q`)$!`%"A`+ +M$!`0$`(0$`T0$!`0$!`0$!`0$`8#$!`0$!`0$!`0$!`0$!`($!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M!Q`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!``````O,R````` +M```````````````````````````````````````````````````````````` +M`/\```#4+8``N!.!`!H``````````0``````````````V"V``/`3@0`8```` +M``````$``````````````/____________________________________\` +M```````````````````````````````````````````````````````````` +M``````````````````"`"AT*X`FE"6T)-PD$"=,(I`AW"$L((@CZ!],' +MK@>*!P`````````````````````````````````````````````````````` +M`````````````````````````````````````````!PT```"````!````'2_ +M@`````````````````!X-```!0````0```!TOX``````````````!0``<@$` +M`*@"```#"0,)!0D,$0``````````````````````````;+P$``H````$```` +M=+^```````````````#_```!`/\``/X!`0#_`@$!`/\!``'_`0$"`P$!`P0! +M`00%`0(&_P$#!_\!`0C_`0#^!@(`_P<"`0#_`@`!_P("`@@"`@,)`@($"@(! +M!?\"`P?_`@$(_P(`_@L#`/\,`P$`_P,``?\#`P(-`P,##@,#!`\#`07_`P(& +M_P,!"/\#`/X0`````````````````````.2]!``*````!````'2_@`!TO`0` +MH+P$`+R\!`#,O`0`T+P$`.R\!`#(O`0`,+T$`#B]!``\O00`9+T$`#2]!`"L +MO00`M+T$`+B]!`#@````````!Z````?P```'H` +M``!_````>@```'\```!Z````?P```'H```!_````>@```'\```!Z````?P`` +M`'H```!_````>@```'\```!Z`````````'H````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````9F8.``````!F9@H`9F8&`&9F!@!F9@(`9F8"`&9F +M/@!F9CX`9F8Z`&9F.@``````9F8V``````!F9C(``````&9F#@`````````` +M`&9F!@`````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````0`!`0$!`0$!`0$``0`!````````_P`` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````!,"*``2`B@`&P'@``````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`/LUC``SL0``````````,P`````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````````'AX> +M'AX>'AX>'AX>'@`9'!X>'AX>'AX>'AX>`!X>'AX>'AX>'@`>'AX>'AX>'AX` +M`08"!`("```$!`8$"`,`````&1X>'AX>'A@9'AX>'AX>&!@>'AX>'AX>'@`5 +M'AX8%1X>&!@>'AX#"``````&````````````_P4````````8&!@8&!T!!@8& +M!@`&```>`!X`'@`8``8&!@$!`0']!@8````````&`0$``!X````````````` +M``$`````````````````%1@8&!@8&!@8&!48&````````````````````/[^ +M_O[^`!06&!@4$A`8&````````````````````````````````````!48&!@8 +M&!@4%1@8&!@8&!02&!@8&!@8&!@```````$````!````$1@8%!$8&!04&!@8 +M``````#[%!04%!08&!@8&!@8&!@8&!@8&``8&!@8&!@8&!@8&!@8`!@8&!@8 +M&!@8&``8&!@8&!@8&!@`&!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@8&``8&!@8 +M&!@8&!@8&!@8&!@8&!@!`0$!`0$````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````5E0``'L````````` +M6E0``#L`````````6E0``'L`````````"B```#L`````````6E0``$,````` +M````"@````$````P,`````````````````````````$````_```````````` +M````````!P````````("`````````````````0`"`@`!```"`@$``0(``@(` +M`````0`!``("`0`````````!`````````@(```$```$```$``````@`"`@`` +M```"```````"`````0`````````````"```!``(`!````````````````@`" +M``````````````````(``@`!``````(````````````"``$"``("`@`````` +M``(``@```0````````````````````$```$````"``$"```````````#`@`` +M`````````@`````"`@````````````````````````$``@(````````````` +M``````(``@$````````````"``````(``@(``@````````(````````````` +M`@("``````(``@("`@`!```"``````$"``("`@`"`0(````"`````@`!```" +M```"`0````````````(````````````````"``````````````````$````! +M`@$"```"`@```````0`"```!``$``@`````````````````````````````` +M`````````@````````````(````"``0``@````(````"`````@`"``("```` +M`````````@`````"``````(```````4````"``$```$```$"```````````` +M```````````!```````!``(````!``(``0`````"```````````````````` +M`````````````````````0`````````````````````````````````````` +M```````````````````````````````"`````````@`````````````````` +M``````````(``````"DI_____P`````````````````````````````````` +M````````````````````````'@$``"P+```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````!`@,$!08'"`D*"PP-#@\0*BHK+"TN+TI+3$U.3U!K +M;&UN<'&+C(V.CY&LK:ZOL+',S,S-SL_0T=+3T]/3T]/3T]/3T]/3T]/3TP!! +M```````````!`@,$!08'"`D*"PP-#@\0*BHK+"TN+TI+3$U.3U!J:VUN;W"* +MBXR-CH^JJZRMKJ_*R\S-SL_0T-#0T-#0T-#0T-#0T-#0T-#0T``^`0(#!`0% +M!@<("0H+#`T.*BLL+2XO2DM,34Y/4&IJ:VQM;F^*BXR-CH^0JJNLK:ZOL+#* +MRLO,S<[/T-'2T]35UM?8V=K:VMK:VMK:VMK:VMK:V@!#`@(#!`4&!@<("0H+ +M#`T.*BLL+2XO2DM,34Y/4%!J:VQM;F^*BXR-CH^0JJNLK:ZOL+#*RLO,S<[/ +MT-'2T]35UM?7U]?7U]?7U]?7U]?7U]?7UP!``@,#!`4&!P@)"@L,#0XJ*RPM +M+B]*2TQ-3D]/4&IK;&UN;XJ+C(V.CY"JJZRMKJ^PL,K*R\S-SL_0T=+3U-34 +MU-34U-34U-34U-34U-34U-34U``\```````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````/]_ +M_W__?_]__W\`````````````````````_W__?_]__W__?_]__W__?_]__W\` +M````````````````````JJH``/\```#_````_P```/\```#_````_P```/\` +M``#_````_P```/\```#_````_P```/\```#_````_P```/\```#_````_P`` +M`/\```#_````_P```/\```#_````_P```/\```#_````_P```/\```#_```` +M_P```````0````$````!`````0````$````!`````0````$````!`````0`` +M``$````!`````0````$````!`````0````$````!`````0````$````!```` +M`0````$````!`````0````$````!`````0````$````!```````````````` +M```````````````````````````````````````````````````````````` +M````````````````?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_```` +M````````````O@```+X````!``````````$```!?````7P````(````````` +M`@```"\````O`````P`````````#````&````!@````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````*```````` +M````````````_P#_``````````````````````#_`/\``````#0````````` +M``````````#_`/\``````````````````````/\`_P``````<``````````` +M`````````/\`_P``````````````````````_P#_``````"9```````````` +M````````_P#_``````````````````````#_`/\````````````````````` +M``$````!``````````$````!``````````$````!```````````````````` +M`0````$``````````0````$``````````0````$````````````````````` +M`````````(P*```````````````````````````````````,`P@````````` +M``#_``````````````````````````````````````````````#_```````` +M``````````````````````````````````````#_```````````````````` +M``````````````````````````#_```````````````````````````````` +M``````````````#_```````````````````````````````````````````` +M``#_``````````````````````````````````````````````#_```````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````0````````#@$H$````````` +M````````````````````````!%4```H````$````=+^````````````````` +M`````````````````````````````0P>M@XR`A$>N0XR`Q8>NPXR!!L>O@XR +M!2`>P`XR!B4>PPXR!RH>Q0XR""\>R`XR"30>R@XR"CD>S0XR"SX>SPXR#$,> +MT@XR#4@>U`XR#DT>UPXR(E!`&2``)&!`'B`V)G!`(R`R*`!!*"`V*A!!+2`U +M+"!!,B`V+C!!-R`Q,$!!/"`V,E!!02``-&!!1B`V-G!!2R`Q.`!"4"`V.A!" +M52`U/"!"6B`U/C!"7R`Q0$!"9"`U9&!$OB(T9G!$PR(P:`!%R"(T:A!%S2(T +M;"!%TB(T;C!%UR(P<$!%W"(T`!&\"(T>A!& +M]2(T?"!&^B(T?C!&_R(P@$!&!"(T@E!&"2(`A&!&#B(TAG!&$R(PB`!'&"(S +MBA!''2(SC"!'(B(TCC!')R(OD$!'+"(SD4A'+R(`E6A'.2(SEWA'/B(OF0A( +M0R0SFQA(2"0RG2A(320SGSA(4B0OH4A(5R0RI6A(820R```````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````````#P`/ +M``\`#P`/``\`#P`/```````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````$``0``````P`"0`-`````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````!@E`0`"@````0```!TOX`````````````````````````` +M``````````````````````````````````````````````````#_____N!2! +M````````````````````````````E%4```H````$````=+^``$!"#P!`0@\` +M0$(/`$!"#P!`0@\`0$(/`$!"#P!`0@\`0$(/`$!"#P#@!P``0`$``.`'``!` +M`0``("<``.`'``#@!P``0`$``.`'``!``0```@`````````"```````````` +M`````````````````````````````````````````````'RJ@``8-($`&``` +M``````````````````````#_____```````````````````````````````` +M````````````````````````````````````````````````-@$``*H````$ +M`0``@@````````!HSP$`C,\!`)S/`0!TSP$`9,\!`*#/`0!,SP$```````#@ +M````@`````````````````````````````"`]```@$L```!````````````` +M``````````````````#D````7````$`````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````Q)X$`("@!`"!`"PF@0`[)T$`$";!`"TH`0`#)T$`(RA!``````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Mar 1 16:41:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9353FF3AB02; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44E9C6F682; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FBBE33EA; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21Gfc8e065076; Thu, 1 Mar 2018 16:41:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21GfcXs065075; Thu, 1 Mar 2018 16:41:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201803011641.w21GfcXs065075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 1 Mar 2018 16:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330243 - in stable: 10/release 11/release X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release 11/release X-SVN-Commit-Revision: 330243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 16:41:38 -0000 Author: gjb Date: Thu Mar 1 16:41:37 2018 New Revision: 330243 URL: https://svnweb.freebsd.org/changeset/base/330243 Log: MFC r330033: 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. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/Makefile.vm Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/Makefile.vm Directory Properties: stable/10/ (props changed) Modified: stable/11/release/Makefile.vm ============================================================================== --- stable/11/release/Makefile.vm Thu Mar 1 16:03:13 2018 (r330242) +++ stable/11/release/Makefile.vm Thu Mar 1 16:41:37 2018 (r330243) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 20G +VMSIZE?= 30G SWAPSIZE?= 1G VMBASE?= vm From owner-svn-src-all@freebsd.org Thu Mar 1 16:41:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C607F3AAFD; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E8796F680; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 096EA33E9; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21Gfbka065045; Thu, 1 Mar 2018 16:41:37 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21GfbnE065044; Thu, 1 Mar 2018 16:41:37 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201803011641.w21GfbnE065044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 1 Mar 2018 16:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330243 - in stable: 10/release 11/release X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release 11/release X-SVN-Commit-Revision: 330243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 16:41:38 -0000 Author: gjb Date: Thu Mar 1 16:41:37 2018 New Revision: 330243 URL: https://svnweb.freebsd.org/changeset/base/330243 Log: MFC r330033: 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. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile.vm Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/Makefile.vm Directory Properties: stable/11/ (props changed) Modified: stable/10/release/Makefile.vm ============================================================================== --- stable/10/release/Makefile.vm Thu Mar 1 16:03:13 2018 (r330242) +++ stable/10/release/Makefile.vm Thu Mar 1 16:41:37 2018 (r330243) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 20G +VMSIZE?= 30G SWAPSIZE?= 1G VMBASE?= vm From owner-svn-src-all@freebsd.org Thu Mar 1 17:47:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 19:50:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 19:59:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 21:46:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 21:51:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 21:57:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 21:59:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 22:00:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 22:04:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 22:38:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 22:57:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Mar 1 23:45:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC81EF34D3D; Thu, 1 Mar 2018 23:45:45 +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 8BC9C80908; Thu, 1 Mar 2018 23:45:45 +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 826097D96; Thu, 1 Mar 2018 23:45:45 +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 w21Njjw7078281; Thu, 1 Mar 2018 23:45:45 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21Njj9S078276; Thu, 1 Mar 2018 23:45:45 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201803012345.w21Njj9S078276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 1 Mar 2018 23:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r330258 - in vendor/NetBSD/bmake/dist: . mk unit-tests X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in vendor/NetBSD/bmake/dist: . mk unit-tests X-SVN-Commit-Revision: 330258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 23:45:46 -0000 Author: sjg Date: Thu Mar 1 23:45:44 2018 New Revision: 330258 URL: https://svnweb.freebsd.org/changeset/base/330258 Log: Import bmake-20180222 From ChangeLog * VERSION: 20180222 Merge with NetBSD make, pick up o parse.c: avoid calling sysconf for every call to loadfile * VERSION: 20180218 Merge with NetBSD make, pick up o var.c: Var_Set handle NULL value anytime. * VERSION: 20180212 Merge with NetBSD make, pick up o parse.c: do not treat .info as warning with -W * 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. * VERSION: 20171126 * aclocal.m4: use AC_LINK_IFELSE for AC_C___ATTRIBUTE__ since AC_TRY_COMPILE puts input inside main() which upsets modern compilers. * 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. Added: vendor/NetBSD/bmake/dist/mk/ldorder.mk (contents, props changed) Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile.config.in vendor/NetBSD/bmake/dist/VERSION vendor/NetBSD/bmake/dist/aclocal.m4 vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/configure vendor/NetBSD/bmake/dist/configure.in vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/FILES vendor/NetBSD/bmake/dist/mk/auto.obj.mk vendor/NetBSD/bmake/dist/mk/dpadd.mk vendor/NetBSD/bmake/dist/mk/final.mk vendor/NetBSD/bmake/dist/mk/gendirdeps.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/own.mk vendor/NetBSD/bmake/dist/mk/prog.mk vendor/NetBSD/bmake/dist/mk/sys.mk vendor/NetBSD/bmake/dist/mk/sys.vars.mk vendor/NetBSD/bmake/dist/os.sh vendor/NetBSD/bmake/dist/parse.c vendor/NetBSD/bmake/dist/stresep.c vendor/NetBSD/bmake/dist/unit-tests/varcmd.exp vendor/NetBSD/bmake/dist/unit-tests/varcmd.mk vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Thu Mar 1 22:57:14 2018 (r330257) +++ vendor/NetBSD/bmake/dist/ChangeLog Thu Mar 1 23:45:44 2018 (r330258) @@ -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: vendor/NetBSD/bmake/dist/Makefile.config.in ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile.config.in Thu Mar 1 22:57:14 2018 (r330257) +++ vendor/NetBSD/bmake/dist/Makefile.config.in Thu Mar 1 23:45:44 2018 (r330258) @@ -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: vendor/NetBSD/bmake/dist/VERSION ============================================================================== --- vendor/NetBSD/bmake/dist/VERSION Thu Mar 1 22:57:14 2018 (r330257) +++ vendor/NetBSD/bmake/dist/VERSION Thu Mar 1 23:45:44 2018 (r330258) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20171028 +_MAKE_VERSION=20180222 Modified: vendor/NetBSD/bmake/dist/aclocal.m4 ============================================================================== --- vendor/NetBSD/bmake/dist/aclocal.m4 Thu Mar 1 22:57:14 2018 (r330257) +++ vendor/NetBSD/bmake/dist/aclocal.m4 Thu Mar 1 23:45:44 2018 (r330258) @@ -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: vendor/NetBSD/bmake/dist/bmake.cat1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.cat1 Thu Mar 1 22:57:14 2018 (r330257) +++ vendor/NetBSD/bmake/dist/bmake.cat1 Thu Mar 1 23:45:44 2018 (r330258) @@ -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-all@freebsd.org Thu Mar 1 23:46:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A615FF34DC3; Thu, 1 Mar 2018 23:46:03 +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 5AACB80A0E; Thu, 1 Mar 2018 23:46:03 +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 3C5417D97; Thu, 1 Mar 2018 23:46:03 +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 w21Nk3Db078338; Thu, 1 Mar 2018 23:46:03 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21Nk3Db078337; Thu, 1 Mar 2018 23:46:03 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201803012346.w21Nk3Db078337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 1 Mar 2018 23:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r330259 - vendor/NetBSD/bmake/20180222 X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/NetBSD/bmake/20180222 X-SVN-Commit-Revision: 330259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 23:46:03 -0000 Author: sjg Date: Thu Mar 1 23:46:02 2018 New Revision: 330259 URL: https://svnweb.freebsd.org/changeset/base/330259 Log: tag bmake-20180222 Added: vendor/NetBSD/bmake/20180222/ - copied from r330258, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Fri Mar 2 00:56:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 01:53:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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 [4mMAKEFLAGS 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-all@freebsd.org Fri Mar 2 02:39:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 02:39:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 03:05:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 03:26:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 04:15:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2E99F46425 for ; Fri, 2 Mar 2018 04:15:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic316-29.consmr.mail.bf2.yahoo.com (sonic316-29.consmr.mail.bf2.yahoo.com [74.6.130.203]) (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 7AA176A57C 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=1519964144; bh=BY5MJPJZq2YfeLDQARiYx+d/MBE4i52CWjWPdKUj0L0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=NHds+l3cIXJXMnpn+Z58N1yOpDn3nd4kstp6H1gOTT1NqgoNkNHL+rBMOtj8qdmlcVVLV6asfof0ZGnrJIvqA/AzTKMW6JqtCkPxoeMZSBi1a5ztlTY+fGgoT7EInK9co+Hd76/TfXBTho+rXPvCmouXUyrMpGF0CFRXv1muPGhElD/PiHt+6FDerth2WGGKXD0IKLkwxTrcsw0b3jNM5h9M+Co25cmTcsI2yoV5WKNvR8xZTviEssqId4qUDcvNHAcGsp/O5MTa86URyMIKNoHRxAidFCJ6IUv3Nj1HrKC+usN5aNitfijkkAl6iYlE2TygTGCJOAxFZ+DKQ2PHnA== 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 sonic316.consmr.mail.bf2.yahoo.com with HTTP; Fri, 2 Mar 2018 04:15:44 +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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 04:34:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 04:41:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B9FF47F52; Fri, 2 Mar 2018 04:41:53 +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 62A8B6B60D; Fri, 2 Mar 2018 04:41:53 +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 5D90012C9B; Fri, 2 Mar 2018 04:41:53 +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 w224fr7d025230; Fri, 2 Mar 2018 04:41:53 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w224fr5K025213; Fri, 2 Mar 2018 04:41:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201803020441.w224fr5K025213@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:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330265 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 330265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2018 04:41:54 -0000 Author: mckusick Date: Fri Mar 2 04:41:52 2018 New Revision: 330265 URL: https://svnweb.freebsd.org/changeset/base/330265 Log: MFC of 329880. Add error number to "fsync: giving up on dirty" message. Modified: stable/11/sys/kern/vfs_default.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_default.c ============================================================================== --- stable/11/sys/kern/vfs_default.c Fri Mar 2 04:34:53 2018 (r330264) +++ stable/11/sys/kern/vfs_default.c Fri Mar 2 04:41:52 2018 (r330265) @@ -712,12 +712,13 @@ loop2: if ((mp != NULL && mp->mnt_secondary_writes > 0) || (error == 0 && --maxretry >= 0)) goto loop1; - error = EAGAIN; + if (error == 0) + error = EAGAIN; } } BO_UNLOCK(bo); - if (error == EAGAIN) - vn_printf(vp, "fsync: giving up on dirty "); + if (error != 0) + vn_printf(vp, "fsync: giving up on dirty (error = %d) ", error); return (error); } From owner-svn-src-all@freebsd.org Fri Mar 2 04:43:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5302FF100BC; Fri, 2 Mar 2018 04:43:08 +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 080186B915; Fri, 2 Mar 2018 04:43:08 +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 02D7A12DDF; Fri, 2 Mar 2018 04:43:08 +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 w224h7vv028280; Fri, 2 Mar 2018 04:43:07 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w224h7xm028279; Fri, 2 Mar 2018 04:43:07 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201803020443.w224h7xm028279@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:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330266 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 330266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2018 04:43:08 -0000 Author: mckusick Date: Fri Mar 2 04:43:07 2018 New Revision: 330266 URL: https://svnweb.freebsd.org/changeset/base/330266 Log: MFC of 329880. Add error number to "fsync: giving up on dirty" message. Modified: stable/10/sys/kern/vfs_default.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_default.c ============================================================================== --- stable/10/sys/kern/vfs_default.c Fri Mar 2 04:41:52 2018 (r330265) +++ stable/10/sys/kern/vfs_default.c Fri Mar 2 04:43:07 2018 (r330266) @@ -722,12 +722,13 @@ loop2: if ((mp != NULL && mp->mnt_secondary_writes > 0) || (error == 0 && --maxretry >= 0)) goto loop1; - error = EAGAIN; + if (error == 0) + error = EAGAIN; } } BO_UNLOCK(bo); - if (error == EAGAIN) - vprint("fsync: giving up on dirty", vp); + if (error != 0) + vn_printf(vp, "fsync: giving up on dirty (error = %d) ", error); return (error); } From owner-svn-src-all@freebsd.org Fri Mar 2 05:35:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 05:36:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 05:38:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 05:46:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 06:02:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 07:01:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 08:52:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 08:56:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 08:58:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 08:59:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 10:57:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F47DF3A36D; Fri, 2 Mar 2018 10:57:47 +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 C08257A64F; Fri, 2 Mar 2018 10:57:46 +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 B5F65168EF; Fri, 2 Mar 2018 10:57:46 +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 w22Avkhd013948; Fri, 2 Mar 2018 10:57:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22Avk3U013947; Fri, 2 Mar 2018 10:57:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803021057.w22Avk3U013947@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 10:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330275 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 330275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2018 10:57:47 -0000 Author: kib Date: Fri Mar 2 10:57:46 2018 New Revision: 330275 URL: https://svnweb.freebsd.org/changeset/base/330275 Log: MFC r329864: Do not return out of bound pointers from intr_lookup_source(). Modified: stable/11/sys/x86/x86/intr_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/intr_machdep.c ============================================================================== --- stable/11/sys/x86/x86/intr_machdep.c Fri Mar 2 08:59:53 2018 (r330274) +++ stable/11/sys/x86/x86/intr_machdep.c Fri Mar 2 10:57:46 2018 (r330275) @@ -167,6 +167,8 @@ struct intsrc * intr_lookup_source(int vector) { + if (vector < 0 || vector >= nitems(interrupt_sources)) + return (NULL); return (interrupt_sources[vector]); } From owner-svn-src-all@freebsd.org Fri Mar 2 13:04:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 14:14:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 14:16:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 14:40:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD5A1F290AD for ; Fri, 2 Mar 2018 14:40:19 +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 3C6CB83F6F 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 q69so13630881lfi.10 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=hxdJwvZKOn3lh7JsDzV3FOmtuV6hVWy26LW/03VhUwsVl3VCak+C6S7kTdY27wmcHf j9qT3MsFbroTwvQqvFqrpJ1fohuAD6fxZqScchWM0NruoiyH+2D5K88GOePwM0d59U+s sKgf1Y1Tgjdt+Bp2DPfB9z5RW1CxCJ73Ouss2Qjom5tnscsLixqSpNLoSxL0eEAqpepU gqjFjncnLozj3k0Z40dVpZFWiPFaFDNGMTYQzSI/BwBIQX65MnNDiWK0BGfJ89ffhVoR Mpe/LAnLZgnskV4tdMkk2ZeTh4Zg+6CvJF97QQsooC4L03kEzWX68TxzFsKo8QSehLEY ORYg== X-Gm-Message-State: AElRT7F2vOBfNCHJzHF6GjSUV8oAGgLTI8agzsCFPZf1D3gBIPt9Ru8m gbuEBIQHqAN2hyggp31cbbfTtHrBz+vecS6OMvOmpA== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 14:42:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 15:12:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 15:17:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECACCF2BEC3; Fri, 2 Mar 2018 15:17: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 9BD7085BB9; Fri, 2 Mar 2018 15:17: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 902EC19254; Fri, 2 Mar 2018 15:17: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 w22FHhXj046418; Fri, 2 Mar 2018 15:17:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22FHhSH046413; Fri, 2 Mar 2018 15:17:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803021517.w22FHhSH046413@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 15:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330280 - in stable/11: etc/defaults etc/rc.d share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/11: etc/defaults etc/rc.d share/man/man5 X-SVN-Commit-Revision: 330280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2018 15:17:44 -0000 Author: manu Date: Fri Mar 2 15:17:42 2018 New Revision: 330280 URL: https://svnweb.freebsd.org/changeset/base/330280 Log: MFC r320943-r320944, r321008, r321072, r321128 r320943: Add ipfw_status command to etc/rc.d/ipfw This is helpful when using service/conf management tools. Sonsored-By: Gandi.net r320944: Add an rc.d script to setup a netflow export via ng_netflow The default is to export netflow data on localhost on the netflow port. ngtee is used to have the lowest overhead possible. The ipfw ng hook is the netflow port (it can only be numeric) Default is netflow version 5. Sponsored-By: Gandi.net Reviewed by: bapt (earlier version), olivier (earlier version) r321008: etc/rc.d: Only install ipfw_netflow is MK_IPFW and MK_NETGRAPH is defined While here only install ipfw rc script if MK_IPFW is defined. Reported by: ngie r321072: ipfw_netflow: add +ipfw_netflow_enable="NO" to defaults/rc.conf and document usage in rc.conf(5) Reported by: markj Sponsored by: Gandi.net r321128: ipfw_netflow: Add support for FIB If ipfw_netflow_fib, the ipfw rule will only match packets in that FIB. While here correct some value in rc.conf(5) to be int and not str. Sponsored by: Gandi.net Added: stable/11/etc/rc.d/ipfw_netflow - copied, changed from r320944, head/etc/rc.d/ipfw_netflow Modified: stable/11/etc/defaults/rc.conf stable/11/etc/rc.d/Makefile stable/11/etc/rc.d/ipfw stable/11/share/man/man5/rc.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/defaults/rc.conf ============================================================================== --- stable/11/etc/defaults/rc.conf Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/etc/defaults/rc.conf Fri Mar 2 15:17:42 2018 (r330280) @@ -167,6 +167,7 @@ firewall_nat_enable="NO" # Enable kernel NAT (if firew firewall_nat_interface="" # Public interface or IPaddress to use firewall_nat_flags="" # Additional configuration parameters dummynet_enable="NO" # Load the dummynet(4) module +ipfw_netflow_enable="NO" # Enable netflow logging via ng_netflow ip_portrange_first="NO" # Set first dynamically allocated port ip_portrange_last="NO" # Set last dynamically allocated port ike_enable="NO" # Enable IKE daemon (usually racoon or isakmpd) Modified: stable/11/etc/rc.d/Makefile ============================================================================== --- stable/11/etc/rc.d/Makefile Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/etc/rc.d/Makefile Fri Mar 2 15:17:42 2018 (r330280) @@ -47,7 +47,6 @@ FILES= DAEMON \ ip6addrctl \ ipfilter \ ipfs \ - ipfw \ ipmon \ ipnat \ ipsec \ @@ -212,6 +211,13 @@ HASTPACKAGE= hast .if ${MK_INETD} != "no" FILES+= inetd +.endif + +.if ${MK_IPFW} != "no" +FILES+= ipfw +.if ${MK_NETGRAPH} != "no" +FILES+= ipfw_netflow +.endif .endif .if ${MK_ISCSI} != "no" Modified: stable/11/etc/rc.d/ipfw ============================================================================== --- stable/11/etc/rc.d/ipfw Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/etc/rc.d/ipfw Fri Mar 2 15:17:42 2018 (r330280) @@ -17,7 +17,9 @@ start_cmd="ipfw_start" start_precmd="ipfw_prestart" start_postcmd="ipfw_poststart" stop_cmd="ipfw_stop" +status_cmd="ipfw_status" required_modules="ipfw" +extra_commands="status" set_rcvar_obsolete ipv6_firewall_enable @@ -107,6 +109,18 @@ ipfw_stop() ${_coscript} quietstop fi done +} + +ipfw_status() +{ + status=$(sysctl -n net.inet.ip.fw.enable) + if [ ${status} -eq 0 ]; then + echo "ipfw is not enabled" + exit 1 + else + echo "ipfw is enabled" + exit 0 + fi } load_rc_config $name Copied and modified: stable/11/etc/rc.d/ipfw_netflow (from r320944, head/etc/rc.d/ipfw_netflow) ============================================================================== --- head/etc/rc.d/ipfw_netflow Thu Jul 13 13:40:18 2017 (r320944, copy source) +++ stable/11/etc/rc.d/ipfw_netflow Fri Mar 2 15:17:42 2018 (r330280) @@ -54,7 +54,7 @@ ipfw_netflow_status() ipfw_netflow_start() { ipfw_netflow_is_running && err 1 "ipfw_netflow is already active" - ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any + ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any ${ipfw_netflow_fib:+fib ${ipfw_netflow_fib}} ngctl -f - <<-EOF mkpeer ipfw: netflow ${ipfw_netflow_hook} iface0 name ipfw:${ipfw_netflow_hook} netflow Modified: stable/11/share/man/man5/rc.conf.5 ============================================================================== --- stable/11/share/man/man5/rc.conf.5 Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/share/man/man5/rc.conf.5 Fri Mar 2 15:17:42 2018 (r330280) @@ -594,6 +594,44 @@ module if is also set to .Dq Li YES . .\" ------------------------------------------------------------------- +.It Va ipfw_netflow_enable +.Pq Vt bool +Setting this to +.Dq Li YES +will enable netflow logging via +.Xr ng_netflow 4 +.Pp +By default a ipfw rule is inserted and all packets are duplicated with +the ngtee command and netflow packets are sent to 127.0.0.1 on the netflow +port using protocol version 5. +.It Va ipfw_netflow_hook +.Pq Vt int +netflow hook name, must be numerical +(default +.Pa 9995 ) . +.It Va ipfw_netflow_rule +.Pq Vt int +ipfw rule number +(default +.Pa 1000 ) . +.It Va ipfw_netflow_ip +.Pq Vt str +Destination server ip for receiving netflow data +(default +.Pa 127.0.0.1 ) . +.It Va ipfw_netflow_port +.Pq Vt int +Destination server port for receiving netflow data +(default +.Pa 9995 ) . +.It Va ipfw_netflow_version +.Pq Vt int +Do not set for using version 5 of the netflow protocol, set it to 9 for using version 9. +.It Va ipfw_netflow_fib +.Pq Vt int +Only match packet in FIB +.Pa ipfw_netflow_fib +(default is undefined meaning all FIBs). .It Va natd_program .Pq Vt str Path to From owner-svn-src-all@freebsd.org Fri Mar 2 15:28:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 15:46:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 16:06:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 16:31:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 16:47:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 16:47:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEE56F333DC for ; Fri, 2 Mar 2018 16:47:14 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) (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 0858D6B03F for ; Fri, 2 Mar 2018 16:47:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f49.google.com with SMTP id g72so14240425lfg.3 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=r8Renjq6Cv1MkMN5bSS50ENXbahwzARrqMuoRIePBAOkH3fTBpGjbXasnVC19K87mM insWzW4xqo9TmiB/P7WD5SGYtICneL2eBymqwtPYjKhDvYfmlsW9QiwKs8UqOQGJwIHV lZoGQcTVgm3NhdroRDZ1wqEqQnNuIhRqeBUSr+lyAZsXSARSpI8BdKDyESvp7FFTsZra yiJWcqAphOgUlCZZFi4WrBAP9aHTW4P/84VG7Rv3IioE8FlTgxWznVYRE3HlJV5cVVv0 8vzbduA2sGUUOvs6fGqgFnwDC3C8SRKf+yXjRnvZ+ZQY3JkYuki9vHW57G+/bRhmkfJD c6vQ== X-Gm-Message-State: APf1xPDCU6lfxYNAXXyQc4RlVHNMWiHPxN6KaH58lgPgR0H7A28oHAVa 9YH18HmyoaxQ+prtIcnuNDHhw07I X-Google-Smtp-Source: AG47ELsQwEeBrVFIwxinNsxVa2iNZHFVDV+a/Xf4H93IdqJUbEr5P1R5dJ8fACzI/5dNhOujUCr9dw== X-Received: by 10.46.64.131 with SMTP id r3mr4563463lje.52.1520009231274; Fri, 02 Mar 2018 08:47:11 -0800 (PST) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com. [209.85.215.50]) by smtp.gmail.com with ESMTPSA id u129sm1414690lff.72.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-f50.google.com with SMTP id l191so14187089lfe.1 for ; Fri, 02 Mar 2018 08:47:11 -0800 (PST) X-Received: by 10.46.114.26 with SMTP id n26mt5151017ljc.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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 16:51:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 17:07:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 17:53:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 838CBF38857 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 11EF56E7ED 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 17:59:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 18:19:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 18:48:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 18:57:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 19:07:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 19:50:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 20:59:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 21:26:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 21:26:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 21:49:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 22:10:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 22:13:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 22:31:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 22:32:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 23:25:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 23:31:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 23:32:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 23:33:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Mar 2 23:35:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Sat Mar 3 00:10:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C982F2F7A2; Sat, 3 Mar 2018 00:10:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B57381038; Sat, 3 Mar 2018 00:10:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25BEF1E869; Sat, 3 Mar 2018 00:10:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w230AcSF015289; Sat, 3 Mar 2018 00:10:38 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w230AcMa015288; Sat, 3 Mar 2018 00:10:38 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030010.w230AcMa015288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 00:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330301 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 330301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 00:10:38 -0000 Author: np Date: Sat Mar 3 00:10:37 2018 New Revision: 330301 URL: https://svnweb.freebsd.org/changeset/base/330301 Log: MFC r323221: Make LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that report extended media types. lacp_aggregator_bandwidth() uses the media to determine the speed of the interface and returns 0 for IFM_OTHER without the bits in the extended range. Reported by: kbowling@ Reviewed by: eugen_grosbein.net, mjoras@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D12188 Modified: stable/11/sys/net/ieee8023ad_lacp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/11/sys/net/ieee8023ad_lacp.c Fri Mar 2 23:31:55 2018 (r330300) +++ stable/11/sys/net/ieee8023ad_lacp.c Sat Mar 3 00:10:37 2018 (r330301) @@ -461,7 +461,11 @@ lacp_linkstate(struct lagg_port *lgp) uint16_t old_key; bzero((char *)&ifmr, sizeof(ifmr)); - error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + error = (*ifp->if_ioctl)(ifp, SIOCGIFXMEDIA, (caddr_t)&ifmr); + if (error != 0) { + bzero((char *)&ifmr, sizeof(ifmr)); + error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + } if (error != 0) return; From owner-svn-src-all@freebsd.org Sat Mar 3 00:22:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E427DF309EF; Sat, 3 Mar 2018 00:22:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99EBD81CB1; Sat, 3 Mar 2018 00:22:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9488F1EBB6; Sat, 3 Mar 2018 00:22:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w230MWdC024864; Sat, 3 Mar 2018 00:22:32 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w230MW8G024862; Sat, 3 Mar 2018 00:22:32 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030022.w230MW8G024862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 00:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330302 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys: netinet netinet6 X-SVN-Commit-Revision: 330302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 00:22:33 -0000 Author: np Date: Sat Mar 3 00:22:32 2018 New Revision: 330302 URL: https://svnweb.freebsd.org/changeset/base/330302 Log: MFC r328314: Do not generate illegal mbuf chains during IP fragment reassembly. Only the first mbuf of the reassembled datagram should have a pkthdr. Modified: stable/11/sys/netinet/ip_reass.c stable/11/sys/netinet6/frag6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_reass.c ============================================================================== --- stable/11/sys/netinet/ip_reass.c Sat Mar 3 00:10:37 2018 (r330301) +++ stable/11/sys/netinet/ip_reass.c Sat Mar 3 00:22:32 2018 (r330302) @@ -377,6 +377,7 @@ ip_reass(struct mbuf *m) q->m_nextpkt = NULL; m->m_pkthdr.csum_flags &= q->m_pkthdr.csum_flags; m->m_pkthdr.csum_data += q->m_pkthdr.csum_data; + m_demote_pkthdr(q); m_cat(m, q); } /* Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Sat Mar 3 00:10:37 2018 (r330301) +++ stable/11/sys/netinet6/frag6.c Sat Mar 3 00:22:32 2018 (r330302) @@ -539,6 +539,7 @@ insert: while (t->m_next) t = t->m_next; m_adj(IP6_REASS_MBUF(af6), af6->ip6af_offset); + m_demote_pkthdr(IP6_REASS_MBUF(af6)); m_cat(t, IP6_REASS_MBUF(af6)); free(af6, M_FTABLE); af6 = af6dwn; From owner-svn-src-all@freebsd.org Sat Mar 3 00:54:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ADBEF32B78; Sat, 3 Mar 2018 00:54:13 +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 0783883534; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 026441F090; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w230sCYr040099; Sat, 3 Mar 2018 00:54:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w230sCxR040095; Sat, 3 Mar 2018 00:54:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803030054.w230sCxR040095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Mar 2018 00:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330303 - in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet X-SVN-Commit-Revision: 330303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 00:54:13 -0000 Author: jhb Date: Sat Mar 3 00:54:12 2018 New Revision: 330303 URL: https://svnweb.freebsd.org/changeset/base/330303 Log: MFC 328608: Export tcp_always_keepalive for use by the Chelsio TOM module. This used to work by accident with ld.bfd even though always_keepalive was marked as static. LLD honors static more correctly, so export this variable properly (including moving it into the tcp_* namespace). Relative to HEAD the MFC includes two additional changes: - The t3_tom module used for cxgb(4) is also patched. - A strong reference from the new name (tcp_always_keepalive) to the old name (always_keepalive) has been added to preserve the KBI for existing modules. Suggested by: kib (strong reference) Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/netinet/tcp_timer.c stable/11/sys/netinet/tcp_timer.h Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Mar 3 00:54:12 2018 (r330303) @@ -86,7 +86,6 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); #define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -extern int always_keepalive; /* * For ULP connections HW may add headers, e.g., for digests, that aren't part @@ -839,7 +838,7 @@ calc_opt0h(struct socket *so, int mtu_idx, int rscale, if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0h |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.c Sat Mar 3 00:54:12 2018 (r330303) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #ifdef TCP_OFFLOAD @@ -549,8 +550,6 @@ select_rcv_wscale(void) return (wscale); } -extern int always_keepalive; - /* * socket so could be a listening socket too. */ @@ -569,7 +568,7 @@ calc_opt0(struct socket *so, struct vi_info *vi, struc if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0 |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/10/sys/netinet/tcp_timer.c ============================================================================== --- stable/10/sys/netinet/tcp_timer.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/10/sys/netinet/tcp_timer.c Sat Mar 3 00:54:12 2018 (r330303) @@ -110,9 +110,10 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLT &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); -static int always_keepalive = 1; +int tcp_always_keepalive = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, - &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); + &tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +__strong_reference(tcp_always_keepalive, always_keepalive); int tcp_fast_finwait2_recycle = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW, @@ -375,7 +376,8 @@ tcp_timer_keep(void *xtp) TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; - if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && + if ((tcp_always_keepalive || + inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; Modified: stable/10/sys/netinet/tcp_timer.h ============================================================================== --- stable/10/sys/netinet/tcp_timer.h Sat Mar 3 00:22:32 2018 (r330302) +++ stable/10/sys/netinet/tcp_timer.h Sat Mar 3 00:54:12 2018 (r330303) @@ -189,6 +189,7 @@ extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; extern int tcp_syn_backoff[]; +extern int tcp_always_keepalive; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle; From owner-svn-src-all@freebsd.org Sat Mar 3 00:54:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE09DF32B88; Sat, 3 Mar 2018 00:54:13 +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 A186083536; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C7B71F091; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w230sDWi040108; Sat, 3 Mar 2018 00:54:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w230sDP7040104; Sat, 3 Mar 2018 00:54:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803030054.w230sDP7040104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Mar 2018 00:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330303 - in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet X-SVN-Commit-Revision: 330303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 00:54:14 -0000 Author: jhb Date: Sat Mar 3 00:54:12 2018 New Revision: 330303 URL: https://svnweb.freebsd.org/changeset/base/330303 Log: MFC 328608: Export tcp_always_keepalive for use by the Chelsio TOM module. This used to work by accident with ld.bfd even though always_keepalive was marked as static. LLD honors static more correctly, so export this variable properly (including moving it into the tcp_* namespace). Relative to HEAD the MFC includes two additional changes: - The t3_tom module used for cxgb(4) is also patched. - A strong reference from the new name (tcp_always_keepalive) to the old name (always_keepalive) has been added to preserve the KBI for existing modules. Suggested by: kib (strong reference) Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/netinet/tcp_timer.c stable/11/sys/netinet/tcp_timer.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Mar 3 00:54:12 2018 (r330303) @@ -87,7 +87,6 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); #define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -extern int always_keepalive; /* * For ULP connections HW may add headers, e.g., for digests, that aren't part @@ -840,7 +839,7 @@ calc_opt0h(struct socket *so, int mtu_idx, int rscale, if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0h |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Mar 3 00:54:12 2018 (r330303) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #include @@ -535,8 +536,6 @@ select_rcv_wscale(void) return (wscale); } -extern int always_keepalive; - /* * socket so could be a listening socket too. */ @@ -555,7 +554,7 @@ calc_opt0(struct socket *so, struct vi_info *vi, struc if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0 |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/11/sys/netinet/tcp_timer.c ============================================================================== --- stable/11/sys/netinet/tcp_timer.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/netinet/tcp_timer.c Sat Mar 3 00:54:12 2018 (r330303) @@ -116,9 +116,10 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLT &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); -static int always_keepalive = 1; +int tcp_always_keepalive = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, - &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); + &tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +__strong_reference(tcp_always_keepalive, always_keepalive); int tcp_fast_finwait2_recycle = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW, @@ -428,7 +429,8 @@ tcp_timer_keep(void *xtp) TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; - if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && + if ((tcp_always_keepalive || + inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; Modified: stable/11/sys/netinet/tcp_timer.h ============================================================================== --- stable/11/sys/netinet/tcp_timer.h Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/netinet/tcp_timer.h Sat Mar 3 00:54:12 2018 (r330303) @@ -188,6 +188,7 @@ extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; extern int tcp_syn_backoff[]; +extern int tcp_always_keepalive; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle; From owner-svn-src-all@freebsd.org Sat Mar 3 01:53:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 02:04:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 02:06:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 02:30:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97ECEF384C3; Sat, 3 Mar 2018 02:30:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 470D187653; Sat, 3 Mar 2018 02:30:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41B11200C0; Sat, 3 Mar 2018 02:30:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w232Urjb085995; Sat, 3 Mar 2018 02:30:53 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w232UqcG085987; Sat, 3 Mar 2018 02:30:52 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030230.w232UqcG085987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 02:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330307 - in stable/11: share/man/man4 sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/cudbg sys/dev/cxgbe/firmware sys/dev/cxgbe/iw_cxgbe sys/dev/cxgbe/tom sys/modules/cxgbe/... X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/cudbg sys/dev/cxgbe/firmware sys/dev/cxgbe/iw_cxgbe sys/dev/cxgbe/tom sys/modules/cxgbe/if_cxgbe sys/modules/cxgb... X-SVN-Commit-Revision: 330307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 02:30:54 -0000 Author: np Date: Sat Mar 3 02:30:52 2018 New Revision: 330307 URL: https://svnweb.freebsd.org/changeset/base/330307 Log: MFC r319506, r319872, r321063, r321103, r321179, r321390, r321435, r321582, r321671, r322014, r322034, r322055, r322123, r322167, r322425, r322549, r322914, r322960, r322962, r322964, r322985, r322990, r323006, r323026, r323041, r323069, r323078, r323343, r323514, r323520, r324296, r324379, r324386, r324443, r324945, r325596, r325680, r325880, r325883-r325884, r325961, r326026, r326042, r327062, r327093, r327332, r327528, r328420, and r328423. r319506: cxgbe(4): Update the statistics for compound tx work requests once per work request, not once per frame. r319872: cxgbe(4): Do not request an FEC setting that the port does not support. r321063: cxgbe(4): Various link/media related improvements. - Deal with changes to port_type, and not just port_mod when a transceiver is changed. This fixes hot swapping of transceivers of different types (QSFP+ or QSA or QSFP28 in a QSFP28 port, SFP+ or SFP28 in a SFP28 port, etc.). - Always refresh media information for ifconfig if the port is down. The firmware does not generate tranceiver-change interrupts unless at least one VI is enabled on the physical port. Before this change ifconfig diplayed potentially stale information for ports that were administratively down. - Always recalculate and reapply L1 config on a transceiver change. - Display PAUSE settings in ifconfig. The driver sysctls for this continue to work as well. r321103: cxgbe(4): New ioctls to flash bootrom and boot config to the card. r321179: cxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the trace buffer. r321390: cxgbe(4): Install the firmware bundled with the driver to the card if it doesn't seem to have one. This lets the driver recover automatically from incomplete firmware upgrades (panic, reboot, power loss, etc. in the middle of an upgrade). r321435: cxgbe(4): Display some more TOE parameters related to retransmission and keepalive in the sysctl MIB. Provide tunables to change some of these parameters. These are supposed to be setup by the firmware so these tunables are for experimentation only. r321582: cxgbe(4): Some updates to the common code. - Updated register ranges. - Helper routines for access to TP registers. - Updated routine to read flash parameters. r321671: cxgbe/iw_cxgbe: Log the end point's history and flags to the trace buffer just before it's freed. r322014: cxgbe(4): Initial import of the "collect" component of Chelsio unified debug (cudbg) code, hooked up to the main driver via an ioctl. The ioctl can be used to collect the chip's internal state in a compressed dump file. These dumps can be decoded with the "view" component of cudbg. r322034: cxgbe(4): Always use the first and not the last virtual interface associated with a port in begin_synchronized_op. r322055: cxgbe(4): Allow the TOE timer tunables to be set with microsecond precision. These timers are already displayed in microseconds in the sysctl MIB. Add variables to track these tunables while here. r322123: cxgbe(4): Avoid a NULL dereference that would occur during module unload if there were problems earlier during attach. r322167: cxgbe(4): Add the T6 and T5 Unified Wire configuration files to the kernel, just like for T4, when the driver is compiled into the kernel. r322425: cxgbe(4): Save the last reported link parameters and compare them with the current state to determine whether to generate a link-state change notification. This fixes a bug introduced in r321063 that caused the driver to sometimes skip these notifications. r322549: cxgbe/t4_tom: Use correct name for the ISS-valid bit in options2. r322914: cxgbe(4): Dump the mailbox contents in the same format as CH_DUMP_MBOX. r322960: cxgbe(4): Verify that the driver accesses the firmware mailbox in a thread-safe manner. r322962: cxgbe(4): Remove write only variable from t4_port_init. r322964: cxgbe(4): vi_mac_funcs should include the base Ethernet function. It is already used in the driver as if it does. r322985: cxgbe(4): Maintain one ifmedia per physical port instead of one per Virtual Interface (VI). All autonomous VIs that share a port share the same media. r322990: cxgbe(4): Do not access the mailbox without appropriate locks while creating hardware VIs. This fixes a bad race on systems with hw.cxgbe.num_vis > 1. r323006: cxgbe(4): Update T6/T5/T4 firmwares to 1.16.59.0. r323026: cxgbe(4): Zero out the memory allocated for the debug dump. cudbg_collect seems to expect it this way. r323041: cxgbe(4): Add two new debug flags -- one to allow manual firmware install after full initialization, and another to disable the TCB cache (T6+). The latter works as a tunable only. Note that debug_flags are for debugging only and should not be set normally. r323069: cxgbe/t4_tom: Add a knob to select the congestion control algorigthm used by the TOE hardware for fully offloaded connections. The knob affects new connections only. r323078: cxgbe/t4_tom: There may not be a tid to update if the connection isn't established. r323343: cxgbe(4): Fix a couple of problems in the sge_wrq data path. - start_wrq_wr must not drain the wr_list if there are incomplete_wrs pending. This can happen when a t4_wrq_tx runs between two start_wrq_wr. - commit_wrq_wr must examine the cookie's pidx and ndesc with the queue's lock held. Otherwise there is a bad race when incomplete WRs are being completed and commit_wrq_wr for the WR that is ahead in the queue updates the next incomplete WR's cookie's pidx/ndesc but the commit_wrq_wr for the second one is using stale values that it read without the lock. r323514: cxgbetool(8): mode must be specified when creating the dump file. r323520: cxgbe(4): Ignore capabilities that depend on TOE when the firmware reports TOE is not available. r324296: cxgbe(4): Provide knobs to set the holdoff parameters of TOE rx queues separately from NIC rx queues instead of using the same parameters for both types of queues. r324379: cxgbetool(8): Do not create a large file devoid of useful content when the dumpstate ioctl fails. Make the file world-readable while here. r324386: cxgbe(4): Update T6, T5, and T4 firmwares to 1.16.63.0. r324443: cxgbetool(8): Do not close uninitialized fd on malloc failure. r324945: cxgbe(4): Read the MPS buffer group map from the firmware as it could be different from hardware defaults. The congestion channel map, which is still fixed, needs to be tracked separately now. Change the congestion setting for TOE rx queues to match the drivers on other OSes while here. r325596: cxgbe(4): Do not request settings not supported by the port. r325680: cxgbe(4): Excluce mdi from the check against port capabilities. r325880: cxgbe(4): Combine all _10g and _1g tunables and drop the suffix from their names. The finer-grained knobs weren't practically useful. r325883: cxgbe(4): Sanitize t4_num_vis during MOD_LOAD like all other t4_* tunables. Add num_vis to the intrs_and_queues structure as it affects the number of interrupts requested and queues created. In future cfg_itype_and_nqueues might lower it incrementally instead of going straight to 1 when enough interrupts aren't available. r325884: cxgbe(4): Remove rsrv_noflowq from intrs_and_queues structure as it does not influence or get affected by the number of interrupts or queues. r325961: cxgbe(4): Add core Vdd to the sysctl MIB. r326026: cxgbe(4): Add a custom board to the device id list. r326042: cxgbe(4): Fix unsafe mailbox access in cudbg. r327062: cxgbe(4): Read the MFG diags version from the VPD and make it available in the sysctl MIB. r327093: cxgbe(4): Do not forward interrupts to queues with freelists. This leaves the firmware event queue (fwq) as the only queue that can take interrupts for others. This simplifies cfg_itype_and_nqueues and queue allocation in the driver at the cost of a little (never?) used configuration. It also allows service_iq to be split into two specialized variants in the future. r327332: cxgbe(4): Reduce duplication by consolidating minor variations of the same code into a single routine. r327528: cxgbe(4): Add a knob to enable/disable PCIe relaxed ordering. Disable it by default when running on Intel CPUs. r328420: cxgbe(4): Do not display harmless warning in non-debug builds. r328423: cxgbe(4): Accept old names of a couple of tunables. Sponsored by: Chelsio Communications Added: stable/11/sys/dev/cxgbe/cudbg/ - copied from r322014, head/sys/dev/cxgbe/cudbg/ stable/11/sys/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu - copied unchanged from r324386, head/sys/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu - copied unchanged from r324386, head/sys/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu - copied unchanged from r324386, head/sys/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu Deleted: stable/11/sys/dev/cxgbe/firmware/t4fw-1.16.45.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t5fw-1.16.45.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t6fw-1.16.45.0.bin.uu Modified: stable/11/share/man/man4/cxgbe.4 stable/11/share/man/man4/cxgbev.4 stable/11/sys/conf/files stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/common/t4_hw.h stable/11/sys/dev/cxgbe/cudbg/cudbg_lib.c stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h stable/11/sys/dev/cxgbe/firmware/t6fw_cfg.txt stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c stable/11/sys/dev/cxgbe/offload.h stable/11/sys/dev/cxgbe/t4_ioctl.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_netmap.c stable/11/sys/dev/cxgbe/t4_sched.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/t4_vf.c stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/modules/cxgbe/if_cxgbe/Makefile stable/11/sys/modules/cxgbe/t4_firmware/Makefile stable/11/sys/modules/cxgbe/t5_firmware/Makefile stable/11/sys/modules/cxgbe/t6_firmware/Makefile stable/11/usr.sbin/cxgbetool/cxgbetool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/cxgbe.4 ============================================================================== --- stable/11/share/man/man4/cxgbe.4 Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/share/man/man4/cxgbe.4 Sat Mar 3 02:30:52 2018 (r330307) @@ -172,37 +172,22 @@ types. A negative value for such a tunable instructs the driver to create up to that many queues if there are enough CPU cores available. .Bl -tag -width indent -.It Va hw.cxgbe.ntxq10g -Number of tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.ntxq +Number of NIC tx queues used for a port. The default is 16 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq10g -Number of rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nrxq +Number of NIC rx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.ntxq1g -Number of tx queues used for a 1Gb port. -The default is 4 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq1g -Number of rx queues used for a 1Gb port. -The default is 2 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldtxq10g -Number of TOE tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nofldtxq +Number of TOE tx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldrxq10g -Number of TOE rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nofldrxq +Number of TOE rx queues used for a port. The default is 2 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldtxq1g -Number of TOE tx queues used for a 1Gb port. -The default is 2 or the -number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldrxq1g -Number of TOE rx queues used for a 1Gb port. -The default is 1. .It Va hw.cxgbe.num_vis Number of virtual interfaces (VIs) created for each port. Each virtual interface creates a separate network interface. @@ -213,25 +198,27 @@ name from the table above. Additional virtual interfaces use a single pair of queues for rx and tx as well an additional pair of queues for TOE rx and tx. The default is 1. -.It Va hw.cxgbe.holdoff_timer_idx_10G -.It Va hw.cxgbe.holdoff_timer_idx_1G +.It Va hw.cxgbe.holdoff_timer_idx +.It Va hw.cxgbe.holdoff_timer_idx_ofld Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. +holdoff_timer_idx_ofld applies to queues used for TOE rx. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev..X.holdoff_tmr_idx sysctl. -.It Va hw.cxgbe.holdoff_pktc_idx_10G -.It Va hw.cxgbe.holdoff_pktc_idx_1G +dev..X.holdoff_tmr_idx and dev..X.holdoff_tmr_idx_ofld sysctls. +.It Va hw.cxgbe.holdoff_pktc_idx +.It Va hw.cxgbe.holdoff_pktc_idx_ofld Packet-count index value used to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. +holdoff_pktc_idx_ofld applies to queues used for TOE rx. The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev..X.holdoff_pktc_idx sysctl. -This sysctl works only when the interface has never been marked up (as done by +dev..X.holdoff_pktc_idx and dev..X.holdoff_pktc_idx_ofld sysctls. +These sysctls work only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq Number of entries in a transmit queue's descriptor ring. @@ -256,6 +243,13 @@ Permitted interrupt types. Bit 0 represents INTx (line interrupts), bit 1 MSI, and bit 2 MSI-X. The default is 7 (all allowed). The driver selects the best possible type out of the allowed types. +.It Va hw.cxgbe.pcie_relaxed_ordering +PCIe Relaxed Ordering. +-1 indicates the driver should determine whether to enable or disable PCIe RO. +0 disables PCIe RO. +1 enables PCIe RO. +2 indicates the driver should not modify the PCIe RO setting. +The default is -1. .It Va hw.cxgbe.fw_install 0 prohibits the driver from installing a firmware on the card. 1 allows the driver to install a new firmware if internal driver Modified: stable/11/share/man/man4/cxgbev.4 ============================================================================== --- stable/11/share/man/man4/cxgbev.4 Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/share/man/man4/cxgbev.4 Sat Mar 3 02:30:52 2018 (r330307) @@ -172,24 +172,15 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.cxgbe.ntxq10g -Number of tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.ntxq +Number of tx queues used for a port. The default is 16 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq10g -Number of rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nrxq +Number of rx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.ntxq1g -Number of tx queues used for a 1Gb port. -The default is 4 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq1g -Number of rx queues used for a 1Gb port. -The default is 2 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.holdoff_timer_idx_10G -.It Va hw.cxgbe.holdoff_timer_idx_1G +.It Va hw.cxgbe.holdoff_timer_idx Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a @@ -197,8 +188,7 @@ value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the dev..X.holdoff_tmr_idx sysctl. -.It Va hw.cxgbe.holdoff_pktc_idx_10G -.It Va hw.cxgbe.holdoff_pktc_idx_1G +.It Va hw.cxgbe.holdoff_pktc_idx Packet-count index value used to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/sys/conf/files Sat Mar 3 02:30:52 2018 (r330307) @@ -1331,6 +1331,18 @@ dev/cxgbe/common/t4_hw.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/common/t4vf_hw.c optional cxgbev pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_common.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_flash_utils.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_lib.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_wtp.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/fastlz.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/fastlz_api.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" t4fw_cfg.c optional cxgbe \ compile-with "${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local \ @@ -1361,12 +1373,12 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.16.45.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" t5fw_cfg.c optional cxgbe \ - compile-with "${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg t5fw.fw:t5fw -mt5fw_cfg -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg t5fw_cfg_uwire.fw:t5fw_cfg_uwire t4fw.fw:t4fw -mt5fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "t5fw_cfg.c" t5fw_cfg.fwo optional cxgbe \ @@ -1379,18 +1391,28 @@ t5fw_cfg.fw optional cxgbe \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw_cfg.fw" +t5fw_cfg_uwire.fwo optional cxgbe \ + dependency "t5fw_cfg_uwire.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t5fw_cfg_uwire.fwo" +t5fw_cfg_uwire.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t5fw_cfg_uwire.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t5fw_cfg_uwire.fw" t5fw.fwo optional cxgbe \ dependency "t5fw.fw" \ compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.16.45.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" t6fw_cfg.c optional cxgbe \ - compile-with "${AWK} -f $S/tools/fw_stub.awk t6fw_cfg.fw:t6fw_cfg t6fw.fw:t6fw -mt6fw_cfg -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t6fw_cfg.fw:t6fw_cfg t6fw_cfg_uwire.fw:t6fw_cfg_uwire t6fw.fw:t6fw -mt6fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "t6fw_cfg.c" t6fw_cfg.fwo optional cxgbe \ @@ -1403,13 +1425,23 @@ t6fw_cfg.fw optional cxgbe \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw_cfg.fw" +t6fw_cfg_uwire.fwo optional cxgbe \ + dependency "t6fw_cfg_uwire.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t6fw_cfg_uwire.fwo" +t6fw_cfg_uwire.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t6fw_cfg_uwire.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t6fw_cfg_uwire.fw" t6fw.fwo optional cxgbe \ dependency "t6fw.fw" \ compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.16.45.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/sys/dev/cxgbe/adapter.h Sat Mar 3 02:30:52 2018 (r330307) @@ -151,7 +151,7 @@ enum { /* adapter flags */ FULL_INIT_DONE = (1 << 0), FW_OK = (1 << 1), - /* INTR_DIRECT = (1 << 2), No longer used. */ + CHK_MBOX_ACCESS = (1 << 2), MASTER_PF = (1 << 3), ADAP_SYSCTL_CTX = (1 << 4), /* TOM_INIT_DONE= (1 << 5), No longer used */ @@ -167,12 +167,11 @@ enum { DOOMED = (1 << 0), VI_INIT_DONE = (1 << 1), VI_SYSCTL_CTX = (1 << 2), - INTR_RXQ = (1 << 4), /* All NIC rxq's take interrupts */ - INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */ - INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ), /* adapter debug_flags */ - DF_DUMP_MBOX = (1 << 0), + DF_DUMP_MBOX = (1 << 0), /* Log all mbox cmd/rpl. */ + DF_LOAD_FW_ANYTIME = (1 << 1), /* Allow LOAD_FW after init */ + DF_DISABLE_TCB_CACHE = (1 << 2), /* Disable TCB cache (T6+) */ }; #define IS_DOOMED(vi) ((vi)->flags & DOOMED) @@ -186,7 +185,6 @@ struct vi_info { struct port_info *pi; struct ifnet *ifp; - struct ifmedia media; unsigned long flags; int if_flags; @@ -218,7 +216,9 @@ struct vi_info { int nnmrxq; int first_nm_rxq; int tmr_idx; + int ofld_tmr_idx; int pktc_idx; + int ofld_pktc_idx; int qsize_rxq; int qsize_txq; @@ -284,9 +284,12 @@ struct port_info { uint8_t mod_type; uint8_t port_id; uint8_t tx_chan; - uint8_t rx_chan_map; /* rx MPS channel bitmap */ + uint8_t mps_bg_map; /* rx MPS buffer group bitmap */ + uint8_t rx_e_chan_map; /* rx TP e-channel bitmap */ struct link_config link_cfg; + struct link_config old_link_cfg; + struct ifmedia media; struct timeval last_refreshed; struct port_stats stats; @@ -341,7 +344,7 @@ enum { /* iq flags */ IQ_ALLOCATED = (1 << 0), /* firmware resources allocated */ IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ - IQ_INTR = (1 << 2), /* iq takes direct interrupt */ + /* 1 << 2 Used to be IQ_INTR */ IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ IQ_ADJ_CREDIT = (1 << 4), /* hw is off by 1 credit for this iq */ @@ -790,7 +793,7 @@ struct adapter { struct taskqueue *tq[MAX_NCHAN]; /* General purpose taskqueues */ struct port_info *port[MAX_NPORTS]; - uint8_t chan_map[MAX_NCHAN]; + uint8_t chan_map[MAX_NCHAN]; /* channel -> port */ void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; @@ -945,6 +948,13 @@ struct adapter { /* One for firmware events */ #define T4VF_EXTRA_INTR 1 +static inline int +forwarding_intr_to_fwq(struct adapter *sc) +{ + + return (sc->intr_count == 1); +} + static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) { @@ -1034,10 +1044,10 @@ adap2pinfo(struct adapter *sc, int idx) } static inline void -t4_os_set_hw_addr(struct adapter *sc, int idx, uint8_t hw_addr[]) +t4_os_set_hw_addr(struct port_info *pi, uint8_t hw_addr[]) { - bcopy(hw_addr, sc->port[idx]->vi[0].hw_addr, ETHER_ADDR_LEN); + bcopy(hw_addr, pi->vi[0].hw_addr, ETHER_ADDR_LEN); } static inline bool @@ -1087,24 +1097,6 @@ port_top_speed(const struct port_info *pi) } static inline int -port_top_speed_raw(const struct port_info *pi) -{ - - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) - return (FW_PORT_CAP_SPEED_100G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) - return (FW_PORT_CAP_SPEED_40G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) - return (FW_PORT_CAP_SPEED_25G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) - return (FW_PORT_CAP_SPEED_10G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_1G) - return (FW_PORT_CAP_SPEED_1G); - - return (0); -} - -static inline int tx_resume_threshold(struct sge_eq *eq) { @@ -1124,15 +1116,11 @@ t4_use_ldst(struct adapter *sc) } /* t4_main.c */ -extern int t4_ntxq10g; -extern int t4_nrxq10g; -extern int t4_ntxq1g; -extern int t4_nrxq1g; +extern int t4_ntxq; +extern int t4_nrxq; extern int t4_intr_types; -extern int t4_tmr_idx_10g; -extern int t4_pktc_idx_10g; -extern int t4_tmr_idx_1g; -extern int t4_pktc_idx_1g; +extern int t4_tmr_idx; +extern int t4_pktc_idx; extern unsigned int t4_qsize_rxq; extern unsigned int t4_qsize_txq; extern device_method_t cxgbe_methods[]; @@ -1140,8 +1128,8 @@ extern device_method_t cxgbe_methods[]; int t4_os_find_pci_capability(struct adapter *, int); int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); -void t4_os_portmod_changed(const struct adapter *, int); -void t4_os_link_changed(struct adapter *, int, int); +void t4_os_portmod_changed(struct port_info *); +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 *); Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/sys/dev/cxgbe/common/common.h Sat Mar 3 02:30:52 2018 (r330307) @@ -42,6 +42,7 @@ enum { EC_LEN = 16, /* E/C length */ ID_LEN = 16, /* ID length */ PN_LEN = 16, /* Part Number length */ + MD_LEN = 16, /* MFG diags version length */ MACADDR_LEN = 12, /* MAC Address length */ }; @@ -254,6 +255,7 @@ struct vpd_params { u8 id[ID_LEN + 1]; u8 pn[PN_LEN + 1]; u8 na[MACADDR_LEN + 1]; + u8 md[MD_LEN + 1]; }; struct pci_params { @@ -332,6 +334,7 @@ struct adapter_params { struct devlog_params devlog; /* PF-only */ struct rss_params rss; /* VF-only */ struct vf_resources vfres; /* VF-only */ + unsigned int core_vdd; unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ @@ -369,6 +372,8 @@ struct adapter_params { unsigned int max_ordird_qp; unsigned int max_ird_adapter; + + uint32_t mps_bg_map; /* rx buffer group map for all ports (upto 4) */ }; #define CHELSIO_T4 0x4 @@ -399,16 +404,18 @@ struct trace_params { }; struct link_config { + /* OS-specific code owns all the requested_* fields */ + unsigned char requested_aneg; /* link aneg user has requested */ + unsigned char requested_fc; /* flow control user has requested */ + unsigned char requested_fec; /* FEC user has requested */ + unsigned int requested_speed; /* speed user has requested */ + unsigned short supported; /* link capabilities */ unsigned short advertising; /* advertised capabilities */ unsigned short lp_advertising; /* peer advertised capabilities */ - unsigned int requested_speed; /* speed user has requested */ unsigned int speed; /* actual link speed */ - unsigned char requested_fc; /* flow control user has requested */ unsigned char fc; /* actual link flow control */ - unsigned char requested_fec; /* FEC user has requested */ unsigned char fec; /* actual FEC */ - unsigned char autoneg; /* autonegotiating? */ unsigned char link_ok; /* link up? */ unsigned char link_down_rc; /* link down reason */ }; @@ -499,6 +506,12 @@ static inline unsigned int dack_ticks_to_usec(const st return (ticks << adap->params.tp.dack_re) / core_ticks_per_usec(adap); } +static inline u_int us_to_tcp_ticks(const struct adapter *adap, u_long us) +{ + + return (us * adap->params.vpd.cclk / 1000 >> adap->params.tp.tre); +} + void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask, u32 val); int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd, @@ -572,11 +585,11 @@ int t4_get_vpd_version(struct adapter *adapter, u32 *v int t4_get_version_info(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); const struct chip_params *t4_get_chip_params(int chipid); -int t4_prep_adapter(struct adapter *adapter, u8 *buf); +int t4_prep_adapter(struct adapter *adapter, u32 *buf); int t4_shutdown_adapter(struct adapter *adapter); int t4_init_devlog_params(struct adapter *adapter, int fw_attach); int t4_init_sge_params(struct adapter *adapter); -int t4_init_tp_params(struct adapter *adap); +int t4_init_tp_params(struct adapter *adap, bool sleep_ok); int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id); void t4_fatal_err(struct adapter *adapter); @@ -594,20 +607,21 @@ int t4_config_vi_rss(struct adapter *adapter, int mbox unsigned int flags, unsigned int defq, unsigned int skeyidx, unsigned int skey); int t4_read_rss(struct adapter *adapter, u16 *entries); -void t4_fw_tp_pio_rw(struct adapter *adap, u32 *vals, unsigned int nregs, - unsigned int start_index, unsigned int rw); -void t4_read_rss_key(struct adapter *adapter, u32 *key); -void t4_write_rss_key(struct adapter *adap, u32 *key, int idx); -void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, u32 *valp); -void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, u32 val); +void t4_read_rss_key(struct adapter *adapter, u32 *key, bool sleep_ok); +void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx, + bool sleep_ok); +void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, + u32 *valp, bool sleep_ok); +void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, + u32 val, bool sleep_ok); void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index, - u32 *vfl, u32 *vfh); + u32 *vfl, u32 *vfh, bool sleep_ok); void t4_write_rss_vf_config(struct adapter *adapter, unsigned int index, - u32 vfl, u32 vfh); -u32 t4_read_rss_pf_map(struct adapter *adapter); -void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap); -u32 t4_read_rss_pf_mask(struct adapter *adapter); -void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask); + u32 vfl, u32 vfh, bool sleep_ok); +u32 t4_read_rss_pf_map(struct adapter *adapter, bool sleep_ok); +void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap, bool sleep_ok); +u32 t4_read_rss_pf_mask(struct adapter *adapter, bool sleep_ok); +void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask, bool sleep_ok); int t4_mps_set_active_ports(struct adapter *adap, unsigned int port_mask); void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); @@ -653,19 +667,24 @@ void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, void t4_read_cong_tbl(struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]); void t4_read_pace_tbl(struct adapter *adap, unsigned int pace_vals[NTX_SCHED]); void t4_get_tx_sched(struct adapter *adap, unsigned int sched, unsigned int *kbps, - unsigned int *ipg); + unsigned int *ipg, bool sleep_ok); void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr, unsigned int mask, unsigned int val); void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr); -void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st); -void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st); -void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st); -void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st); -void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st); +void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st, + bool sleep_ok); +void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st, + bool sleep_ok); +void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st, + bool sleep_ok); +void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st, + bool sleep_ok); +void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st, + bool sleep_ok); void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4, - struct tp_tcp_stats *v6); + struct tp_tcp_stats *v6, bool sleep_ok); void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx, - struct tp_fcoe_stats *st); + struct tp_fcoe_stats *st, bool sleep_ok); void t4_load_mtus(struct adapter *adap, const unsigned short *mtus, const unsigned short *alpha, const unsigned short *beta); @@ -676,7 +695,8 @@ int t4_set_sched_ipg(struct adapter *adap, int sched, int t4_set_pace_tbl(struct adapter *adap, const unsigned int *pace_vals, unsigned int start, unsigned int n); void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate); -int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map); +int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map, + bool sleep_ok); void t4_mk_filtdelwr(unsigned int ftid, struct fw_filter_wr *wr, int qid); void t4_wol_magic_enable(struct adapter *adap, unsigned int port, const u8 *addr); @@ -691,6 +711,8 @@ int t4_fw_halt(struct adapter *adap, unsigned int mbox int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset); int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, const u8 *fw_data, unsigned int size, int force); +int t4_fw_forceinstall(struct adapter *adap, const u8 *fw_data, + unsigned int size); int t4_fw_initialize(struct adapter *adap, unsigned int mbox); int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, @@ -766,6 +788,7 @@ int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned i u32 *data); int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); const char *t4_link_down_rc_str(unsigned char link_down_rc); +int t4_update_port_info(struct port_info *pi); int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val); int t4_sched_config(struct adapter *adapter, int type, int minmaxen, @@ -787,6 +810,15 @@ int t4_config_watchdog(struct adapter *adapter, unsign int t4_get_devlog_level(struct adapter *adapter, unsigned int *level); int t4_set_devlog_level(struct adapter *adapter, unsigned int level); void t4_sge_decode_idma_state(struct adapter *adapter, int state); + +void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_pio_write(struct adapter *adap, const u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); static inline int t4vf_query_params(struct adapter *adapter, unsigned int nparams, const u32 *params, Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Sat Mar 3 02:30:52 2018 (r330307) @@ -286,6 +286,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int __be64 cmd_rpl[MBOX_LEN/8]; u32 pcie_fw; + if (adap->flags & CHK_MBOX_ACCESS) + ASSERT_SYNCHRONIZED_OP(adap); + if ((size & 15) || size > MBOX_LEN) return -EINVAL; @@ -333,9 +336,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * presaged the firmware crashing ... */ if (ctl & F_MBMSGVALID) { - CH_ERR(adap, "found VALID command in mbox %u: " - "%llx %llx %llx %llx %llx %llx %llx %llx\n", mbox, - (unsigned long long)t4_read_reg64(adap, data_reg), + CH_ERR(adap, "found VALID command in mbox %u: %016llx %016llx " + "%016llx %016llx %016llx %016llx %016llx %016llx\n", + mbox, (unsigned long long)t4_read_reg64(adap, data_reg), (unsigned long long)t4_read_reg64(adap, data_reg + 8), (unsigned long long)t4_read_reg64(adap, data_reg + 16), (unsigned long long)t4_read_reg64(adap, data_reg + 24), @@ -469,7 +472,7 @@ static int t4_edc_err_read(struct adapter *adap, int i CH_WARN(adap, "%s: T4 NOT supported.\n", __func__); return 0; } - if (idx != 0 && idx != 1) { + if (idx != MEM_EDC0 && idx != MEM_EDC1) { CH_WARN(adap, "%s: idx %d NOT supported.\n", __func__, idx); return 0; } @@ -886,7 +889,8 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0xd010, 0xd03c, 0xdfc0, 0xdfe0, 0xe000, 0xea7c, - 0xf000, 0x11190, + 0xf000, 0x11110, + 0x11118, 0x11190, 0x19040, 0x1906c, 0x19078, 0x19080, 0x1908c, 0x190e4, @@ -1424,8 +1428,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1ff00, 0x1ff84, 0x1ffc0, 0x1ffc8, 0x30000, 0x30030, - 0x30038, 0x30038, - 0x30040, 0x30040, 0x30100, 0x30144, 0x30190, 0x301a0, 0x301a8, 0x301b8, @@ -1536,8 +1538,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x33c3c, 0x33c50, 0x33cf0, 0x33cfc, 0x34000, 0x34030, - 0x34038, 0x34038, - 0x34040, 0x34040, 0x34100, 0x34144, 0x34190, 0x341a0, 0x341a8, 0x341b8, @@ -1648,8 +1648,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x37c3c, 0x37c50, 0x37cf0, 0x37cfc, 0x38000, 0x38030, - 0x38038, 0x38038, - 0x38040, 0x38040, 0x38100, 0x38144, 0x38190, 0x381a0, 0x381a8, 0x381b8, @@ -1760,8 +1758,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x3bc3c, 0x3bc50, 0x3bcf0, 0x3bcfc, 0x3c000, 0x3c030, - 0x3c038, 0x3c038, - 0x3c040, 0x3c040, 0x3c100, 0x3c144, 0x3c190, 0x3c1a0, 0x3c1a8, 0x3c1b8, @@ -2254,13 +2250,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1ff00, 0x1ff84, 0x1ffc0, 0x1ffc8, 0x30000, 0x30030, - 0x30038, 0x30038, - 0x30040, 0x30040, - 0x30048, 0x30048, - 0x30050, 0x30050, - 0x3005c, 0x30060, - 0x30068, 0x30068, - 0x30070, 0x30070, 0x30100, 0x30168, 0x30190, 0x301a0, 0x301a8, 0x301b8, @@ -2323,13 +2312,12 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x326a8, 0x326a8, 0x326ec, 0x326ec, 0x32a00, 0x32abc, - 0x32b00, 0x32b38, + 0x32b00, 0x32b18, + 0x32b20, 0x32b38, 0x32b40, 0x32b58, 0x32b60, 0x32b78, 0x32c00, 0x32c00, 0x32c08, 0x32c3c, - 0x32e00, 0x32e2c, - 0x32f00, 0x32f2c, 0x33000, 0x3302c, 0x33034, 0x33050, 0x33058, 0x33058, @@ -2394,13 +2382,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x33c38, 0x33c50, 0x33cf0, 0x33cfc, 0x34000, 0x34030, - 0x34038, 0x34038, - 0x34040, 0x34040, - 0x34048, 0x34048, - 0x34050, 0x34050, - 0x3405c, 0x34060, - 0x34068, 0x34068, - 0x34070, 0x34070, 0x34100, 0x34168, 0x34190, 0x341a0, 0x341a8, 0x341b8, @@ -2463,13 +2444,12 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x366a8, 0x366a8, 0x366ec, 0x366ec, 0x36a00, 0x36abc, - 0x36b00, 0x36b38, + 0x36b00, 0x36b18, + 0x36b20, 0x36b38, 0x36b40, 0x36b58, 0x36b60, 0x36b78, 0x36c00, 0x36c00, 0x36c08, 0x36c3c, - 0x36e00, 0x36e2c, - 0x36f00, 0x36f2c, 0x37000, 0x3702c, 0x37034, 0x37050, 0x37058, 0x37058, @@ -2682,13 +2662,16 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t } /* - * Partial EEPROM Vital Product Data structure. Includes only the ID and - * VPD-R sections. + * Partial EEPROM Vital Product Data structure. The VPD starts with one ID + * header followed by one or more VPD-R sections, each with its own header. */ struct t4_vpd_hdr { u8 id_tag; u8 id_len[2]; u8 id_data[ID_LEN]; +}; + +struct t4_vpdr_hdr { u8 vpdr_tag; u8 vpdr_len[2]; }; @@ -2700,6 +2683,7 @@ struct t4_vpd_hdr { #define EEPROM_MAX_POLL 5000 /* x 5000 == 50ms */ #define EEPROM_STAT_ADDR 0x7bfc +#define VPD_SIZE 0x800 #define VPD_BASE 0x400 #define VPD_BASE_OLD 0 #define VPD_LEN 1024 @@ -2922,32 +2906,43 @@ int t4_seeprom_wp(struct adapter *adapter, int enable) /** * get_vpd_keyword_val - Locates an information field keyword in the VPD - * @v: Pointer to buffered vpd data structure + * @vpd: Pointer to buffered vpd data structure * @kw: The keyword to search for + * @region: VPD region to search (starting from 0) * * Returns the value of the information field keyword or * -ENOENT otherwise. */ -static int get_vpd_keyword_val(const struct t4_vpd_hdr *v, const char *kw) +static int get_vpd_keyword_val(const u8 *vpd, const char *kw, int region) { - int i; - unsigned int offset , len; - const u8 *buf = (const u8 *)v; - const u8 *vpdr_len = &v->vpdr_len[0]; + int i, tag; + unsigned int offset, len; + const struct t4_vpdr_hdr *vpdr; + offset = sizeof(struct t4_vpd_hdr); - len = (u16)vpdr_len[0] + ((u16)vpdr_len[1] << 8); + vpdr = (const void *)(vpd + offset); + tag = vpdr->vpdr_tag; + len = (u16)vpdr->vpdr_len[0] + ((u16)vpdr->vpdr_len[1] << 8); + while (region--) { + offset += sizeof(struct t4_vpdr_hdr) + len; + vpdr = (const void *)(vpd + offset); + if (++tag != vpdr->vpdr_tag) + return -ENOENT; + len = (u16)vpdr->vpdr_len[0] + ((u16)vpdr->vpdr_len[1] << 8); + } + offset += sizeof(struct t4_vpdr_hdr); - if (len + sizeof(struct t4_vpd_hdr) > VPD_LEN) { + if (offset + len > VPD_LEN) { return -ENOENT; } for (i = offset; i + VPD_INFO_FLD_HDR_SIZE <= offset + len;) { - if(memcmp(buf + i , kw , 2) == 0){ + if (memcmp(vpd + i , kw , 2) == 0){ i += VPD_INFO_FLD_HDR_SIZE; return i; } - i += VPD_INFO_FLD_HDR_SIZE + buf[i+2]; + i += VPD_INFO_FLD_HDR_SIZE + vpd[i+2]; } return -ENOENT; @@ -2963,18 +2958,18 @@ static int get_vpd_keyword_val(const struct t4_vpd_hdr * Reads card parameters stored in VPD EEPROM. */ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p, - u8 *vpd) + u32 *buf) { int i, ret, addr; - int ec, sn, pn, na; + int ec, sn, pn, na, md; u8 csum; - const struct t4_vpd_hdr *v; + const u8 *vpd = (const u8 *)buf; /* * Card information normally starts at VPD_BASE but early cards had * it at 0. */ - ret = t4_seeprom_read(adapter, VPD_BASE, (u32 *)(vpd)); + ret = t4_seeprom_read(adapter, VPD_BASE, buf); if (ret) return (ret); @@ -2988,14 +2983,13 @@ static int get_vpd_params(struct adapter *adapter, str addr = *vpd == CHELSIO_VPD_UNIQUE_ID ? VPD_BASE : VPD_BASE_OLD; for (i = 0; i < VPD_LEN; i += 4) { - ret = t4_seeprom_read(adapter, addr + i, (u32 *)(vpd + i)); + ret = t4_seeprom_read(adapter, addr + i, buf++); if (ret) return ret; } - v = (const struct t4_vpd_hdr *)vpd; #define FIND_VPD_KW(var,name) do { \ - var = get_vpd_keyword_val(v , name); \ + var = get_vpd_keyword_val(vpd, name, 0); \ if (var < 0) { \ CH_ERR(adapter, "missing VPD keyword " name "\n"); \ return -EINVAL; \ @@ -3018,7 +3012,7 @@ static int get_vpd_params(struct adapter *adapter, str FIND_VPD_KW(na, "NA"); #undef FIND_VPD_KW - memcpy(p->id, v->id_data, ID_LEN); + memcpy(p->id, vpd + offsetof(struct t4_vpd_hdr, id_data), ID_LEN); strstrip(p->id); memcpy(p->ec, vpd + ec, EC_LEN); strstrip(p->ec); @@ -3032,6 +3026,14 @@ static int get_vpd_params(struct adapter *adapter, str memcpy(p->na, vpd + na, min(i, MACADDR_LEN)); strstrip((char *)p->na); + md = get_vpd_keyword_val(vpd, "VF", 1); + if (md < 0) { + snprintf(p->md, sizeof(p->md), "unknown"); + } else { + i = vpd[md - VPD_INFO_FLD_HDR_SIZE + 2]; + memcpy(p->md, vpd + md, min(i, MD_LEN)); + } + return 0; } @@ -3040,13 +3042,13 @@ enum { SF_ATTEMPTS = 10, /* max retries for SF operations */ /* flash command opcodes */ - SF_PROG_PAGE = 2, /* program page */ + SF_PROG_PAGE = 2, /* program 256B page */ SF_WR_DISABLE = 4, /* disable writes */ SF_RD_STATUS = 5, /* read status register */ SF_WR_ENABLE = 6, /* enable writes */ SF_RD_DATA_FAST = 0xb, /* read flash */ SF_RD_ID = 0x9f, /* read ID */ - SF_ERASE_SECTOR = 0xd8, /* erase sector */ + SF_ERASE_SECTOR = 0xd8, /* erase 64KB sector */ }; /** @@ -3683,9 +3685,6 @@ void t4_ulprx_read_la(struct adapter *adap, u32 *la_bu } } -#define ADVERT_MASK (V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED) | \ - FW_PORT_CAP_ANEG) - /** * t4_link_l1cfg - apply link configuration to MAC/PHY * @phy: the PHY to setup @@ -3704,7 +3703,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m { struct fw_port_cmd c; unsigned int mdi = V_FW_PORT_CAP_MDI(FW_PORT_CAP_MDI_AUTO); - unsigned int fc, fec; + unsigned int aneg, fc, fec, speed, rcap; fc = 0; if (lc->requested_fc & PAUSE_RX) @@ -3714,12 +3713,51 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m fec = 0; if (lc->requested_fec & FEC_RS) - fec |= FW_PORT_CAP_FEC_RS; - if (lc->requested_fec & FEC_BASER_RS) - fec |= FW_PORT_CAP_FEC_BASER_RS; - if (lc->requested_fec & FEC_RESERVED) - fec |= FW_PORT_CAP_FEC_RESERVED; + fec = FW_PORT_CAP_FEC_RS; + else if (lc->requested_fec & FEC_BASER_RS) + fec = FW_PORT_CAP_FEC_BASER_RS; + else if (lc->requested_fec & FEC_RESERVED) + fec = FW_PORT_CAP_FEC_RESERVED; + if (!(lc->supported & FW_PORT_CAP_ANEG) || + lc->requested_aneg == AUTONEG_DISABLE) { + aneg = 0; + switch (lc->requested_speed) { + case 100: + speed = FW_PORT_CAP_SPEED_100G; + break; + case 40: + speed = FW_PORT_CAP_SPEED_40G; + break; + case 25: + speed = FW_PORT_CAP_SPEED_25G; + break; + case 10: + speed = FW_PORT_CAP_SPEED_10G; + break; + case 1: + speed = FW_PORT_CAP_SPEED_1G; + break; + default: + return -EINVAL; + break; + } + } else { + aneg = FW_PORT_CAP_ANEG; + speed = lc->supported & + V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED); + } + + rcap = aneg | speed | fc | fec; + if ((rcap | lc->supported) != lc->supported) { +#ifdef INVARIANTS + CH_WARN(adap, "rcap 0x%08x, pcap 0x%08x\n", rcap, + lc->supported); +#endif + rcap &= lc->supported; + } + rcap |= mdi; + memset(&c, 0, sizeof(c)); c.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | F_FW_CMD_REQUEST | F_FW_CMD_EXEC | @@ -3727,21 +3765,9 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m c.action_to_len16 = cpu_to_be32(V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_L1_CFG) | FW_LEN16(c)); + c.u.l1cfg.rcap = cpu_to_be32(rcap); - if (!(lc->supported & FW_PORT_CAP_ANEG)) { - c.u.l1cfg.rcap = cpu_to_be32((lc->supported & ADVERT_MASK) | - fc | fec); - lc->fc = lc->requested_fc & ~PAUSE_AUTONEG; - lc->fec = lc->requested_fec; - } else if (lc->autoneg == AUTONEG_DISABLE) { - c.u.l1cfg.rcap = cpu_to_be32(lc->requested_speed | - fc | fec | mdi); - lc->fc = lc->requested_fc & ~PAUSE_AUTONEG; - lc->fec = lc->requested_fec; - } else - c.u.l1cfg.rcap = cpu_to_be32(lc->advertising | fc | fec | mdi); - - return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); + return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); } /** @@ -3980,6 +4006,9 @@ static void sge_intr_handler(struct adapter *adapter) "SGE too many priority ingress contexts", -1, 0 }, { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID", -1, 0 }, { F_EGRESS_SIZE_ERR, "SGE illegal egress QID", -1, 0 }, + { F_ERR_PCIE_ERROR0 | F_ERR_PCIE_ERROR1 | + F_ERR_PCIE_ERROR2 | F_ERR_PCIE_ERROR3, + "SGE PCIe error for a DBP thread", -1, 0 }, { 0 } }; @@ -3995,8 +4024,6 @@ static void sge_intr_handler(struct adapter *adapter) * For now, treat below interrupts as fatal so that we disable SGE and * get better debug */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Mar 3 02:39:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC989F38DD3; Sat, 3 Mar 2018 02:39:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F8FE87D09; Sat, 3 Mar 2018 02:39:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A8B82025B; Sat, 3 Mar 2018 02:39:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w232dsbM090145; Sat, 3 Mar 2018 02:39:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w232dss0090144; Sat, 3 Mar 2018 02:39:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030239.w232dss0090144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 02:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330308 - stable/11/sys/dev/cxgb X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgb X-SVN-Commit-Revision: 330308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 02:39:55 -0000 Author: np Date: Sat Mar 3 02:39:54 2018 New Revision: 330308 URL: https://svnweb.freebsd.org/changeset/base/330308 Log: MFC r328315: cxgb(4): Validate offset/len in the GET_EEPROM ioctl. Modified: stable/11/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/11/sys/dev/cxgb/cxgb_main.c Sat Mar 3 02:30:52 2018 (r330307) +++ stable/11/sys/dev/cxgb/cxgb_main.c Sat Mar 3 02:39:54 2018 (r330308) @@ -2958,8 +2958,14 @@ cxgb_extension_ioctl(struct cdev *dev, unsigned long c case CHELSIO_GET_EEPROM: { int i; struct ch_eeprom *e = (struct ch_eeprom *)data; - uint8_t *buf = malloc(EEPROMSIZE, M_DEVBUF, M_NOWAIT); + uint8_t *buf; + if (e->offset & 3 || e->offset >= EEPROMSIZE || + e->len > EEPROMSIZE || e->offset + e->len > EEPROMSIZE) { + return (EINVAL); + } + + buf = malloc(EEPROMSIZE, M_DEVBUF, M_NOWAIT); if (buf == NULL) { return (ENOMEM); } From owner-svn-src-all@freebsd.org Sat Mar 3 02:49:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 02:47:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 03:12:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A37F3A650; Sat, 3 Mar 2018 03:12:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF74569688; Sat, 3 Mar 2018 03:12:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA654208FD; Sat, 3 Mar 2018 03:12:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w233CJxc009309; Sat, 3 Mar 2018 03:12:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w233CJHf009308; Sat, 3 Mar 2018 03:12:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030312.w233CJHf009308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 03:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330310 - stable/11/usr.sbin/cxgbetool X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/usr.sbin/cxgbetool X-SVN-Commit-Revision: 330310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 03:12:20 -0000 Author: np Date: Sat Mar 3 03:12:19 2018 New Revision: 330310 URL: https://svnweb.freebsd.org/changeset/base/330310 Log: MFC r321105: cxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or remove bootrom and boot config. Modified: stable/11/usr.sbin/cxgbetool/cxgbetool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- stable/11/usr.sbin/cxgbetool/cxgbetool.c Sat Mar 3 02:49:49 2018 (r330309) +++ stable/11/usr.sbin/cxgbetool/cxgbetool.c Sat Mar 3 03:12:19 2018 (r330310) @@ -96,6 +96,10 @@ usage(FILE *fp) "\tfilter list list all filters\n" "\tfilter mode [] ... get/set global filter mode\n" "\ti2c [] read from i2c device\n" + "\tloadboot [pf|offset ] install boot image\n" + "\tloadboot clear [pf|offset ] remove boot image\n" + "\tloadboot-cfg install boot config\n" + "\tloadboot-cfg clear remove boot config\n" "\tloadcfg install configuration file\n" "\tloadcfg clear remove configuration file\n" "\tloadfw install firmware\n" @@ -1944,6 +1948,107 @@ done: return (rc); } +static int +loadboot(int argc, const char *argv[]) +{ + int rc, fd; + long l; + char *p; + struct t4_bootrom br = {0}; + const char *fname = argv[0]; + struct stat st = {0}; + + if (argc == 1) { + br.pf_offset = 0; + br.pfidx_addr = 0; + } else if (argc == 3) { + if (!strcmp(argv[1], "pf")) + br.pf_offset = 0; + else if (!strcmp(argv[1], "offset")) + br.pf_offset = 1; + else + return (EINVAL); + + p = str_to_number(argv[2], &l, NULL); + if (*p) + return (EINVAL); + br.pfidx_addr = l; + } else { + warnx("loadboot: incorrect number of arguments."); + return (EINVAL); + } + + if (strcmp(fname, "clear") == 0) + return (doit(CHELSIO_T4_LOAD_BOOT, &br)); + + fd = open(fname, O_RDONLY); + if (fd < 0) { + warn("open(%s)", fname); + return (errno); + } + + if (fstat(fd, &st) < 0) { + warn("fstat"); + close(fd); + return (errno); + } + + br.len = st.st_size; + br.data = mmap(0, br.len, PROT_READ, MAP_PRIVATE, fd, 0); + if (br.data == MAP_FAILED) { + warn("mmap"); + close(fd); + return (errno); + } + + rc = doit(CHELSIO_T4_LOAD_BOOT, &br); + munmap(br.data, br.len); + close(fd); + return (rc); +} + +static int +loadbootcfg(int argc, const char *argv[]) +{ + int rc, fd; + struct t4_data bc = {0}; + const char *fname = argv[0]; + struct stat st = {0}; + + if (argc != 1) { + warnx("loadbootcfg: incorrect number of arguments."); + return (EINVAL); + } + + if (strcmp(fname, "clear") == 0) + return (doit(CHELSIO_T4_LOAD_BOOTCFG, &bc)); + + fd = open(fname, O_RDONLY); + if (fd < 0) { + warn("open(%s)", fname); + return (errno); + } + + if (fstat(fd, &st) < 0) { + warn("fstat"); + close(fd); + return (errno); + } + + bc.len = st.st_size; + bc.data = mmap(0, bc.len, PROT_READ, MAP_PRIVATE, fd, 0); + if (bc.data == MAP_FAILED) { + warn("mmap"); + close(fd); + return (errno); + } + + rc = doit(CHELSIO_T4_LOAD_BOOTCFG, &bc); + munmap(bc.data, bc.len); + close(fd); + return (rc); +} + /* * Display memory as list of 'n' 4-byte values per line. */ @@ -2818,6 +2923,10 @@ run_cmd(int argc, const char *argv[]) rc = sched_queue(argc, argv); else if (!strcmp(cmd, "loadcfg")) rc = loadcfg(argc, argv); + else if (!strcmp(cmd, "loadboot")) + rc = loadboot(argc, argv); + else if (!strcmp(cmd, "loadboot-cfg")) + rc = loadbootcfg(argc, argv); else if (!strcmp(cmd, "dumpstate")) rc = dumpstate(argc, argv); else { From owner-svn-src-all@freebsd.org Sat Mar 3 03:48:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 06:37:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2FA6F44914; Sat, 3 Mar 2018 06:37: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 5480F70BDB; Sat, 3 Mar 2018 06:37: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 49B5422AF5; Sat, 3 Mar 2018 06:37: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 w236btv7009044; Sat, 3 Mar 2018 06:37:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w236brKR009030; Sat, 3 Mar 2018 06:37:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803030637.w236brKR009030@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 06:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330311 - in stable/11/stand/pc98: . boot0 boot0.5 boot2 btx/btx btx/btxldr btx/lib cdboot kgzldr libpc98 loader pc98boot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/pc98: . boot0 boot0.5 boot2 btx/btx btx/btxldr btx/lib cdboot kgzldr libpc98 loader pc98boot X-SVN-Commit-Revision: 330311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 06:37:56 -0000 Author: kevans Date: Sat Mar 3 06:37:53 2018 New Revision: 330311 URL: https://svnweb.freebsd.org/changeset/base/330311 Log: stand: Make pc98 build This is a direct commit to stable/11 due to pc98 removal from head. Several improvements in head that were MFC'd left the pc98 build broken in stable/11. Massage the pc98 bits to get it to at least build. Deleted: stable/11/stand/pc98/libpc98/time.c Modified: stable/11/stand/pc98/Makefile stable/11/stand/pc98/Makefile.inc stable/11/stand/pc98/boot0.5/Makefile stable/11/stand/pc98/boot0/Makefile stable/11/stand/pc98/boot2/Makefile stable/11/stand/pc98/btx/btx/Makefile stable/11/stand/pc98/btx/btxldr/Makefile stable/11/stand/pc98/btx/lib/Makefile stable/11/stand/pc98/cdboot/Makefile stable/11/stand/pc98/kgzldr/Makefile stable/11/stand/pc98/libpc98/Makefile stable/11/stand/pc98/loader/Makefile stable/11/stand/pc98/loader/main.c stable/11/stand/pc98/pc98boot/Makefile Modified: stable/11/stand/pc98/Makefile ============================================================================== --- stable/11/stand/pc98/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,5 +1,9 @@ # $FreeBSD$ +NO_OBJ=t + +.include + SUBDIR= boot0 boot0.5 pc98boot btx boot2 cdboot kgzldr libpc98 loader .include Modified: stable/11/stand/pc98/Makefile.inc ============================================================================== --- stable/11/stand/pc98/Makefile.inc Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/Makefile.inc Sat Mar 3 06:37:53 2018 (r330311) @@ -2,28 +2,24 @@ # # $FreeBSD$ -BINDIR?= /boot - LOADER_ADDRESS?=0x200000 -CFLAGS+= -march=i386 -ffreestanding -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib # BTX components -.if exists(${.OBJDIR}/../btx) -BTXDIR= ${.OBJDIR}/../btx -.else -BTXDIR= ${.CURDIR}/../btx -.endif +BTXDIR= ${BOOTOBJ}/pc98/btx BTXLDR= ${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx + +BTXSRC= ${BOOTSRC}/pc98/btx BTXCRT= ${BTXDIR}/lib/crt0.o # compact binary with no padding between text, data, bss -LDSCRIPT= ${SRCTOP}/stand/i386/boot.ldscript -LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary -LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections +LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript +#LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary +LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +#LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections +LD_FLAGS_BIN=-static -N --gc-sections + +WARNS?= 0 .include "../Makefile.inc" Modified: stable/11/stand/pc98/boot0.5/Makefile ============================================================================== --- stable/11/stand/pc98/boot0.5/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot0.5/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -3,10 +3,9 @@ PROG= ${BOOT}.out INTERNALPROG= FILES= ${BOOT} -MAN= SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s \ putssjis.s -CLEANFILES= ${BOOT} ${BOOT}.bin +CLEANFILES+= ${BOOT} ${BOOT}.bin BOOT= boot0.5 @@ -14,7 +13,7 @@ BOOT= boot0.5 # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x0000 -LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript +LDFLAGS+=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript # The size of boot0.5 must be 7168 bytes ${BOOT}: ${BOOT}.bin Modified: stable/11/stand/pc98/boot0/Makefile ============================================================================== --- stable/11/stand/pc98/boot0/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot0/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -3,9 +3,8 @@ PROG= ${BOOT} INTERNALPROG= FILES= ${BOOT} -MAN= SRCS= ${BOOT}.s -CLEANFILES= ${BOOT} +CLEANFILES+= ${BOOT} BOOT= boot0 @@ -14,6 +13,6 @@ BOOT= boot0 BOOT_BOOT0_ORG?= 0x0000 ORG=${BOOT_BOOT0_ORG} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/boot2/Makefile ============================================================================== --- stable/11/stand/pc98/boot2/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot2/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -27,10 +27,11 @@ CFLAGS= -fomit-frame-pointer \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${.CURDIR}/../../.. \ - -I${.CURDIR}/../../i386/boot2 \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../btx/lib -I. \ + -I${LDRSRC} \ + -I${SYSDIR} \ + -I${BOOTSRC}/i386/boot2 \ + -I${BOOTSRC}/common \ + -I${BOOTSRC}/pc98/btx/lib \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -52,14 +53,14 @@ CFLAGS.gcc+= -mno-align-long-strings CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} -LD_FLAGS=${LD_FLAGS_BIN} +LD_FLAGS+=${LD_FLAGS_BIN} # Pick up ../Makefile.inc early. .include -.PATH: ${.CURDIR}/../../i386/boot2 +.PATH: ${BOOTSRC}/i386/boot2 -CLEANFILES= boot +CLEANFILES+= boot boot: boot1 boot2 cat boot1 boot2 > boot @@ -98,7 +99,7 @@ boot2.o: boot2.s SRCS= boot2.c boot2.h -boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c +boot2.s: boot2.c boot2.h ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s rm -f boot2.s.tmp Modified: stable/11/stand/pc98/btx/btx/Makefile ============================================================================== --- stable/11/stand/pc98/btx/btx/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/btx/btx/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,8 +1,9 @@ # $FreeBSD$ +.include + PROG= btx INTERNALPROG= -MAN= SRCS= btx.S .if defined(BOOT_BTX_NOHANG) @@ -12,7 +13,7 @@ BOOT_BTX_FLAGS=0x0 .endif CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} -CFLAGS+=-I${.CURDIR}/../../../i386/common +CFLAGS+=-I${BOOTSRC}/i386/common .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x238 @@ -25,7 +26,7 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COMCONSOLE_PORT} ORG= 0x9000 -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/btx/btxldr/Makefile ============================================================================== --- stable/11/stand/pc98/btx/btxldr/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/btx/btxldr/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,19 +1,20 @@ # $FreeBSD$ +.include + PROG= btxldr INTERNALPROG= -MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} -CFLAGS+=-I${.CURDIR}/../../../i386/common +CFLAGS+=-I${BOOTSRC}/i386/common .if defined(BTXLDR_VERBOSE) CFLAGS+=-DBTXLDR_VERBOSE .endif ORG=${LOADER_ADDRESS} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/btx/lib/Makefile ============================================================================== --- stable/11/stand/pc98/btx/lib/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/btx/lib/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,10 +1,11 @@ # $FreeBSD$ +.include + PROG= crt0.o INTERNALPROG= -MAN= SRCS= btxcsu.S btxsys.s btxv86.s -CFLAGS+=-I${.CURDIR}/../../../i386/common -LDFLAGS=-Wl,-r +CFLAGS+=-I${BOOTSRC}/i386/common +LDFLAGS+=-Wl,-r .include Modified: stable/11/stand/pc98/cdboot/Makefile ============================================================================== --- stable/11/stand/pc98/cdboot/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/cdboot/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,16 +1,18 @@ # $FreeBSD$ +.include + PROG= cdboot STRIP= BINMODE=${NOBINMODE} MAN= SRCS= ${PROG}.S -CFLAGS+=-I${.CURDIR}/../../i386/common +CFLAGS+=-I${BOOTSRC}/i386/common ORG= 0x0000 -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/kgzldr/Makefile ============================================================================== --- stable/11/stand/pc98/kgzldr/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/kgzldr/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,18 +1,19 @@ # $FreeBSD$ +.include + PROG= kgzldr.o STRIP= BINMODE=${LIBMODE} BINDIR= ${LIBDIR} -MAN= SRCS= start.s boot.c inflate.c lib.c crt.s sio.s CFLAGS= -Os CFLAGS+=-DKZIP NO_SHARED= -LDFLAGS=-Wl,-r -.PATH: ${.CURDIR}/../../../kern -.PATH: ${.CURDIR}/../../i386/kgzldr +LDFLAGS+=-Wl,-r +.PATH: ${SYSDIR}/kern +.PATH: ${BOOTSRC}/i386/kgzldr BOOT_COMCONSOLE_PORT?= 0x238 AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT} Modified: stable/11/stand/pc98/libpc98/Makefile ============================================================================== --- stable/11/stand/pc98/libpc98/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/libpc98/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,25 +1,20 @@ # $FreeBSD$ # + +.include + LIB= pc98 -INTERNALLIB= -.PATH: ${.CURDIR}/../../i386/libi386 +.PATH: ${BOOTSRC}/i386/libi386 SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c \ comconsole.c devicename.c elf32_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c -.PATH: ${.CURDIR}/../../zfs +.PATH: ${BOOTSRC}/zfs SRCS+= devicename_stubs.c -# Enable PXE TFTP or NFS support, not both. -.if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT -.else -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif - BOOT_COMCONSOLE_PORT?= 0x238 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} @@ -37,13 +32,11 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../btx/lib \ - -I${.CURDIR}/../../i386/libi386 \ - -I${.CURDIR}/../../.. -I. -# the location of libstand -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ + -I${LDRSRC} -I${BOOTSRC}/common \ + -I${BOOTSRC}/pc98/btx/lib \ + -I${BOOTSRC}/i386/libi386 \ + -I${SYSDIR} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: stable/11/stand/pc98/loader/Makefile ============================================================================== --- stable/11/stand/pc98/loader/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/loader/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,26 +1,18 @@ # $FreeBSD$ -.include -MK_SSP= no -MAN= - LOADER?= loader PROG= ${LOADER}.sym -INTERNALPROG= NEWVERSWHAT= "bootstrap loader" pc98 -VERSION_FILE= ${.CURDIR}/../../i386/loader/version +VERSION_FILE= ${BOOTSRC}/i386/loader/version +LOADER_NET_SUPPORT= yes + +.include + # architecture-specific loader code SRCS= main.c conf.c vers.c -.PATH: ${.CURDIR}/../../i386/loader +.PATH: ${BOOTSRC}/i386/loader -# Enable PXE TFTP or NFS support, not both. -.if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT -.else -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif - # Include bcache code. HAVE_BCACHE= yes @@ -28,38 +20,19 @@ HAVE_BCACHE= yes HAVE_PNP= yes HAVE_ISABUS= yes -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - -.if defined(LOADER_BZIP2_SUPPORT) -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if !defined(LOADER_NO_GZIP_SUPPORT) -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif - # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -CFLAGS+= -I${.CURDIR}/../../i386 -CFLAGS+= -I. +.include "${BOOTSRC}/loader.mk" -CLEANFILES= ${LOADER} ${LOADER}.bin loader.help +CLEANFILES+= ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall -LDFLAGS= -static -Ttext 0x0 +LDFLAGS+= -static -Ttext 0x0 +CFLAGS+= -I${BOOTSRC} -I${BOOTSRC}/i386 # pc98 standalone support library -LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a -CFLAGS+= -I${.CURDIR}/.. +LIBPC98= ${BOOTOBJ}/pc98/libpc98/libpc98.a +CFLAGS+= -I${BOOTSRC}/pc98 -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib @@ -67,9 +40,6 @@ CFLAGS+= -I${.CURDIR}/../btx/lib #CFLAGS+= -g #LDFLAGS+= -g -# Pick up ../Makefile.inc early. -.include - ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin @@ -79,21 +49,16 @@ ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note ${.TARGET} loader.help: help.common help.pc98 - cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + cat ${.ALLSRC} | awk -f ${BOOTSRC}/common/merge_help.awk > ${.TARGET} FILES= ${LOADER} # XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" - -FILES+= ${.CURDIR}/../../i386/loader/loader.rc menu.rc - # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND} +DPADD= ${LDR_INTERP} ${LIBPC98} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBPC98} ${LIBSA} .include Modified: stable/11/stand/pc98/loader/main.c ============================================================================== --- stable/11/stand/pc98/loader/main.c Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/loader/main.c Sat Mar 3 06:37:53 2018 (r330311) @@ -191,7 +191,7 @@ main(void) extract_currdev(); /* set $currdev and $loaddev */ setenv("LINES", "24", 1); /* optional */ - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ /* if we ever get here, it is an error */ return (1); Modified: stable/11/stand/pc98/pc98boot/Makefile ============================================================================== --- stable/11/stand/pc98/pc98boot/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/pc98boot/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,19 +1,21 @@ # $FreeBSD$ +.include + FILES= ${BOOT} -CLEANFILES= ${BOOT} ${BOOT}.part +CLEANFILES+= ${BOOT} ${BOOT}.part BOOT= pc98boot -.if exists(${.OBJDIR}/../boot0) -BOOT0= ${.OBJDIR}/../boot0/boot0 +.if exists(${BOOTOBJ}/pc98/boot0) +BOOT0= ${BOOTOBJ}/pc98/boot0/boot0 .else -BOOT0= ${.CURDIR}/../boot0/boot0 +BOOT0= ${BOOTSRC}/pc98/boot0/boot0 .endif -.if exists(${.OBJDIR}/../boot0.5) -BOOT05= ${.OBJDIR}/../boot0.5/boot0.5 +.if exists(${BOOTOBJ}/pc98/boot0.5) +BOOT05= ${BOOTOBJ}/pc98/boot0.5/boot0.5 .else -BOOT05= ${.CURDIR}/../boot0.5/boot0.5 +BOOT05= ${BOOTSRC}/pc98/boot0.5/boot0.5 .endif ${BOOT}: ${BOOT0} ${BOOT05} ${BOOT}.part From owner-svn-src-all@freebsd.org Sat Mar 3 08:45:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A6ADF26DD5; Sat, 3 Mar 2018 08:45:57 +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 2E6AD752AF; Sat, 3 Mar 2018 08:45:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2507B2402C; Sat, 3 Mar 2018 08:45:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w238juin074466; Sat, 3 Mar 2018 08:45:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w238juXd074464; Sat, 3 Mar 2018 08:45:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201803030845.w238juXd074464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 3 Mar 2018 08:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330312 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 330312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 08:45:57 -0000 Author: delphij Date: Sat Mar 3 08:45:56 2018 New Revision: 330312 URL: https://svnweb.freebsd.org/changeset/base/330312 Log: Document SA-17:12 and correct EN-17:09 link [1] Reported by: eadler [1] Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Sat Mar 3 06:37:53 2018 (r330311) +++ stable/11/release/doc/share/xml/errata.xml Sat Mar 3 08:45:56 2018 (r330312) @@ -36,7 +36,7 @@ FreeBSD-EN-17:10.tzdata + xlink:href="&security.url;/FreeBSD-EN-17:09.tzdata.asc">FreeBSD-EN-17:09.tzdata 2 November 2017 Timezone database information update Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Sat Mar 3 06:37:53 2018 (r330311) +++ stable/11/release/doc/share/xml/security.xml Sat Mar 3 08:45:56 2018 (r330312) @@ -53,6 +53,13 @@ 29 November 2017 Multiple vulnerabilities + + + FreeBSD-SA-17:12.openssl + 09 December 2017 + Multiple vulnerabilities + From owner-svn-src-all@freebsd.org Sat Mar 3 08:48:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 08:52:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F907F2760D; Sat, 3 Mar 2018 08:52:03 +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 4098F75970; Sat, 3 Mar 2018 08:52:03 +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 3B81B241A4; Sat, 3 Mar 2018 08:52:03 +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 w238q3BH077047; Sat, 3 Mar 2018 08:52:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w238q3M3077045; Sat, 3 Mar 2018 08:52:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201803030852.w238q3M3077045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 3 Mar 2018 08:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330313 - stable/10/release/doc/share/xml X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/release/doc/share/xml X-SVN-Commit-Revision: 330313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 08:52:03 -0000 Author: delphij Date: Sat Mar 3 08:52:02 2018 New Revision: 330313 URL: https://svnweb.freebsd.org/changeset/base/330313 Log: Document SA-17:12 and correct EN-17:09 link [1] Reported by: eadler [1] Modified: stable/10/release/doc/share/xml/errata.xml stable/10/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/errata.xml ============================================================================== --- stable/10/release/doc/share/xml/errata.xml Sat Mar 3 08:45:56 2018 (r330312) +++ stable/10/release/doc/share/xml/errata.xml Sat Mar 3 08:52:02 2018 (r330313) @@ -20,7 +20,7 @@ FreeBSD-EN-17:10.tzdata + xlink:href="&security.url;/FreeBSD-EN-17:09.tzdata.asc">FreeBSD-EN-17:09.tzdata 2 November 2017 Timezone database information update Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Sat Mar 3 08:45:56 2018 (r330312) +++ stable/10/release/doc/share/xml/security.xml Sat Mar 3 08:52:02 2018 (r330313) @@ -61,6 +61,13 @@ 29 November 2017 Multiple vulnerabilities + + + FreeBSD-SA-17:12.openssl + 09 December 2017 + Multiple vulnerabilities + From owner-svn-src-all@freebsd.org Sat Mar 3 09:59:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AC18F2C3CD; Sat, 3 Mar 2018 09:59:05 +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 2AB4778338; Sat, 3 Mar 2018 09:59:05 +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 1F2B824BE7; Sat, 3 Mar 2018 09:59:05 +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 w239x4kC010914; Sat, 3 Mar 2018 09:59:04 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w239x4Zm010913; Sat, 3 Mar 2018 09:59:04 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803030959.w239x4Zm010913@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 09:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330314 - stable/11/usr.bin/units X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.bin/units X-SVN-Commit-Revision: 330314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 09:59:05 -0000 Author: eadler Date: Sat Mar 3 09:59:04 2018 New Revision: 330314 URL: https://svnweb.freebsd.org/changeset/base/330314 Log: MFC r322424: Correct the -H longopt equivillant PR: 209876 Modified: stable/11/usr.bin/units/units.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/units/units.1 ============================================================================== --- stable/11/usr.bin/units/units.1 Sat Mar 3 08:52:02 2018 (r330313) +++ stable/11/usr.bin/units/units.1 Sat Mar 3 09:59:04 2018 (r330314) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd July 4, 2014 +.Dd August 12, 2017 .Dt UNITS 1 .Os .Sh NAME @@ -18,7 +18,7 @@ The following options are available: Show an overview of options .It Fl f Ar filename \&No , Fl -file Ar filename Specify the name of the units data file to load. -.It Fl H Ar filename \&No , Fl -historyfile Ar filename +.It Fl H Ar filename \&No , Fl -history Ar filename Ignored, for compatibility with GNU units. .It Fl e , Fl -exponential Behave as if -o '%6e' was typed. From owner-svn-src-all@freebsd.org Sat Mar 3 10:01:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21BFAF2C70C; Sat, 3 Mar 2018 10:01:14 +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 C519D7854A; Sat, 3 Mar 2018 10:01:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C009E24D10; Sat, 3 Mar 2018 10:01:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23A1DDm011794; Sat, 3 Mar 2018 10:01:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23A1CkO011786; Sat, 3 Mar 2018 10:01:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031001.w23A1CkO011786@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 10:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330315 - in stable/11/usr.bin: calendar calendar/calendars/pt_BR.UTF-8 fortune/datfiles mkcsmapper unifdef units X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/usr.bin: calendar calendar/calendars/pt_BR.UTF-8 fortune/datfiles mkcsmapper unifdef units X-SVN-Commit-Revision: 330315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:01:14 -0000 Author: eadler Date: Sat Mar 3 10:01:12 2018 New Revision: 330315 URL: https://svnweb.freebsd.org/changeset/base/330315 Log: MFC r325095: Update URLs in usr.bin - http -> https - contents have moved locations - removal of URL if I could not find new location Modified: stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative stable/11/usr.bin/calendar/sunpos.c stable/11/usr.bin/fortune/datfiles/fortunes stable/11/usr.bin/mkcsmapper/mkcsmapper.1 stable/11/usr.bin/unifdef/unifdef.1 stable/11/usr.bin/unifdef/unifdef.c stable/11/usr.bin/units/definitions.units Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative ============================================================================== --- stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative Sat Mar 3 10:01:12 2018 (r330315) @@ -4,8 +4,6 @@ * Originally submitted by Renato Tambellini * * Brazilian commemorative days - * - * http://www.ibge.gov.br/ibgeteen/datas/home.html */ #ifndef _pt_BR_UTF_8_commemorative_ Modified: stable/11/usr.bin/calendar/sunpos.c ============================================================================== --- stable/11/usr.bin/calendar/sunpos.c Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/calendar/sunpos.c Sat Mar 3 10:01:12 2018 (r330315) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); /* * This code is created to match the formulas available at: * Formula and examples obtained from "How to Calculate alt/az: SAAO" at - * http://www.saao.ac.za/public-info/sun-moon-stars/sun-index/how-to-calculate-altaz/ + * http://old.saao.ac.za/public-info/sun-moon-stars/sun-index/how-to-calculate-altaz/ */ #include Modified: stable/11/usr.bin/fortune/datfiles/fortunes ============================================================================== --- stable/11/usr.bin/fortune/datfiles/fortunes Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/fortune/datfiles/fortunes Sat Mar 3 10:01:12 2018 (r330315) @@ -46260,7 +46260,7 @@ error: The operation completed successfully. For more information, see Help and Support Center at -http://go.microsoft.com/fwlink/events.asp. +https://go.microsoft.com/fwlink/events.asp. % The minute a man is convinced that he is interesting, he isn't. % Modified: stable/11/usr.bin/mkcsmapper/mkcsmapper.1 ============================================================================== --- stable/11/usr.bin/mkcsmapper/mkcsmapper.1 Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/mkcsmapper/mkcsmapper.1 Sat Mar 3 10:01:12 2018 (r330315) @@ -29,8 +29,8 @@ .\" Electrical and Electronics Engineers, Inc and The Open Group. In the .\" event of any discrepancy between this version and the original IEEE and .\" The Open Group Standard, the original IEEE and The Open Group Standard is -.\" the referee document. The original Standard can be obtained online at -.\" http://www.opengroup.org/unix/online.html. +.\" the referee document. The original Standard can be obtained at +.\" http://www.opengroup.org/standards/unix. .\" .\" $FreeBSD$ .\" Modified: stable/11/usr.bin/unifdef/unifdef.1 ============================================================================== --- stable/11/usr.bin/unifdef/unifdef.1 Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/unifdef/unifdef.1 Sat Mar 3 10:01:12 2018 (r330315) @@ -477,7 +477,7 @@ Unterminated char or string literal .Xr diff 1 .Pp The unifdef home page is -.Pa http://dotat.at/prog/unifdef +.Pa https://dotat.at/prog/unifdef .Sh HISTORY The .Nm Modified: stable/11/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/11/usr.bin/unifdef/unifdef.c Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/unifdef/unifdef.c Sat Mar 3 10:01:12 2018 (r330315) @@ -49,7 +49,7 @@ static const char copyright[] = "@(#) $Version: unifdef-2.11 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" - "@(#) $URL: http://dotat.at/prog/unifdef $\n" + "@(#) $URL: https://dotat.at/prog/unifdef $\n" ; /* types of input lines: */ Modified: stable/11/usr.bin/units/definitions.units ============================================================================== --- stable/11/usr.bin/units/definitions.units Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/units/definitions.units Sat Mar 3 10:01:12 2018 (r330315) @@ -332,7 +332,7 @@ lumen cd sr lux cd sr/m2 # EMU currencies have constant exchange rate against Euro since 1.1.1999. -# See http://en.wikipedia.org/wiki/Euro for details. +# See https://en.wikipedia.org/wiki/Euro for details. austriaschilling 1|13.7603 euro belgiumfranc 1|40.3399 euro finlandmarkka 1|5.94573 euro @@ -351,7 +351,7 @@ malteselira 1|0.429300 euro slovakkoruna 1|30.1260 euro # These ones are pegged to the Euro -# See http://en.wikipedia.org/wiki/Euro for details. +# See https://en.wikipedia.org/wiki/Euro for details. bosniaherzegovinamark 1|1.95583 euro bulgarianlev 1|1.95583 euro capeverdeanescudo 1|110.265 euro @@ -528,7 +528,7 @@ ZMW zambiakwacha ZWL zimbabwedollar # These ones are pegged on the US Dollar -# See http://en.wikipedia.org/wiki/USD for details. +# See https://en.wikipedia.org/wiki/USD for details. dollar usdollar arubanflorin 1|1.75 usdollar bahamiandollar 1|1 usdollar From owner-svn-src-all@freebsd.org Sat Mar 3 10:15:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E095DF2D769; Sat, 3 Mar 2018 10:15:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 907B978E32; Sat, 3 Mar 2018 10:15:37 +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 8A6DC24F0E; Sat, 3 Mar 2018 10:15:37 +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 w23AFb57020684; Sat, 3 Mar 2018 10:15:37 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AFb0N020683; Sat, 3 Mar 2018 10:15:37 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031015.w23AFb0N020683@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 10:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330316 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 330316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:15:38 -0000 Author: eadler Date: Sat Mar 3 10:15:37 2018 New Revision: 330316 URL: https://svnweb.freebsd.org/changeset/base/330316 Log: MFC r313276: Use kldload -n when loading if_deqna This fixes if_deqna from being loaded by accident twice if it's already loaded in the kernel. Modified: stable/11/etc/devd.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/devd.conf ============================================================================== --- stable/11/etc/devd.conf Sat Mar 3 10:01:12 2018 (r330315) +++ stable/11/etc/devd.conf Sat Mar 3 10:15:37 2018 (r330316) @@ -272,7 +272,7 @@ nomatch 10 { match "bus" "pccard[0-9]+"; match "manufacturer" "0x1234"; match "product" "0x2323"; - action "kldload if_deqna"; + action "kldload -n if_deqna"; }; attach 10 { device-name "deqna[0-9]+"; From owner-svn-src-all@freebsd.org Sat Mar 3 10:18:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD3A7F2DA86; Sat, 3 Mar 2018 10:18:32 +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 7B7D178FFB; Sat, 3 Mar 2018 10:18:32 +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 7621724F10; Sat, 3 Mar 2018 10:18:32 +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 w23AIWb7020829; Sat, 3 Mar 2018 10:18:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AIWMV020827; Sat, 3 Mar 2018 10:18:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031018.w23AIWMV020827@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 10:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330317 - stable/11/usr.bin/dc X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.bin/dc X-SVN-Commit-Revision: 330317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:18:33 -0000 Author: eadler Date: Sat Mar 3 10:18:32 2018 New Revision: 330317 URL: https://svnweb.freebsd.org/changeset/base/330317 Log: MFC r314409: dc(1): Introduce e command, equivalent to p, but writes to stderr Obtained from: OpenBSD MFC after: 2 weeks Modified: stable/11/usr.bin/dc/bcode.c stable/11/usr.bin/dc/dc.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/dc/bcode.c ============================================================================== --- stable/11/usr.bin/dc/bcode.c Sat Mar 3 10:15:37 2018 (r330316) +++ stable/11/usr.bin/dc/bcode.c Sat Mar 3 10:18:32 2018 (r330317) @@ -69,6 +69,7 @@ static __inline struct number *pop_number(void); static __inline char *pop_string(void); static __inline void clear_stack(void); static __inline void print_tos(void); +static void print_err(void); static void pop_print(void); static void pop_printn(void); static __inline void print_stack(void); @@ -198,6 +199,7 @@ static const struct jump_entry jump_table_data[] = { { 'a', to_ascii }, { 'c', clear_stack }, { 'd', dup }, + { 'e', print_err }, { 'f', print_stack }, { 'i', set_ibase }, { 'k', set_scale }, @@ -502,6 +504,18 @@ print_tos(void) if (value != NULL) { print_value(stdout, value, "", bmachine.obase); putchar('\n'); + } + else + warnx("stack empty"); +} + +static void +print_err(void) +{ + struct value *value = tos(); + if (value != NULL) { + print_value(stderr, value, "", bmachine.obase); + (void)putc('\n', stderr); } else warnx("stack empty"); Modified: stable/11/usr.bin/dc/dc.1 ============================================================================== --- stable/11/usr.bin/dc/dc.1 Sat Mar 3 10:15:37 2018 (r330316) +++ stable/11/usr.bin/dc/dc.1 Sat Mar 3 10:18:32 2018 (r330317) @@ -35,7 +35,7 @@ .\" .\" @(#)dc.1 8.1 (Berkeley) 6/6/93 .\" -.Dd April 16, 2014 +.Dd February 27, 2017 .Dt DC 1 .Os .Sh NAME @@ -196,6 +196,10 @@ operator is a non-portable extension. All values on the stack are popped. .It Ic d The top value on the stack is duplicated. +.It Ic e +Equivalent to +.Ic p , +except that the output is written to the standard error stream. .It Ic f All values on the stack are printed, separated by newlines. .It Ic G From owner-svn-src-all@freebsd.org Sat Mar 3 10:21:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 10:27:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F57F2E56A; Sat, 3 Mar 2018 10:27:34 +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 4879D796F3; Sat, 3 Mar 2018 10:27:34 +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 268C6250A0; Sat, 3 Mar 2018 10:27:34 +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 w23ARXIC026014; Sat, 3 Mar 2018 10:27:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23ARXMw026012; Sat, 3 Mar 2018 10:27:33 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031027.w23ARXMw026012@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 10:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330318 - in stable/11/usr.sbin/bsdconfig: console share X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/usr.sbin/bsdconfig: console share X-SVN-Commit-Revision: 330318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:27:34 -0000 Author: eadler Date: Sat Mar 3 10:27:33 2018 New Revision: 330318 URL: https://svnweb.freebsd.org/changeset/base/330318 Log: MFC r318891: Fix long standing issue in bsdconfig's keymap selection Since the translation to vt as terminal emulator, the keymaps files path has changed and this change does not get followed in bsdconfig. This implicates boot time warnings about a wrong keymap file, what is very confusing for the new users and for me too, so initialize the default keymaps search path depending on terminal type. Modified: stable/11/usr.sbin/bsdconfig/console/keymap stable/11/usr.sbin/bsdconfig/share/keymap.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdconfig/console/keymap ============================================================================== --- stable/11/usr.sbin/bsdconfig/console/keymap Sat Mar 3 10:18:32 2018 (r330317) +++ stable/11/usr.sbin/bsdconfig/console/keymap Sat Mar 3 10:27:33 2018 (r330318) @@ -172,6 +172,7 @@ dialog_menu_main() uk.iso) defaultitem="$msg_uk_iso" ;; ua.koi8-u) defaultitem="$msg_ukrainian_koi8_u" ;; ua.koi8-u.shift.alt) defaultitem="$msg_ukrainian_koi8_u_koi8_r" ;; + us.ctrl) defaultitem="$msg_usa_capslock_ctrl" ;; us.pc-ctrl) defaultitem="$msg_usa_capslock_ctrl" ;; us.dvorak) defaultitem="$msg_usa_dvorak" ;; us.dvorakl) defaultitem="$msg_usa_dvorak_left" ;; @@ -307,7 +308,12 @@ while :; do uk_iso) keymap_to_set="uk.iso" ;; ukrainian_koi8_u) keymap_to_set="ua.koi8-u" ;; ukrainian_koi8_u_koi8_r) keymap_to_set="ua.koi8-u.shift.alt" ;; - usa_capslock_ctrl) keymap_to_set="us.pc-ctrl" ;; + usa_capslock_ctrl) + case "$( sysctl -n kern.vty )" in + vt) keymap_to_set="us.ctrl" ;; + *) keymap_to_set="us.pc-ctrl" ;; + esac + ;; usa_dvorak) keymap_to_set="us.dvorak" ;; usa_dvorak_left) keymap_to_set="us.dvorakl" ;; usa_dvorak_right) keymap_to_set="us.dvorakr" ;; Modified: stable/11/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- stable/11/usr.sbin/bsdconfig/share/keymap.subr Sat Mar 3 10:18:32 2018 (r330317) +++ stable/11/usr.sbin/bsdconfig/share/keymap.subr Sat Mar 3 10:27:33 2018 (r330318) @@ -39,7 +39,10 @@ f_include $BSDCFG_SHARE/struct.subr # Defaults taken from usr.sbin/kbdmap/kbdmap.h # : ${DEFAULT_LANG:=en} -: ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps} +case "$( sysctl -n kern.vty )" in +vt) : ${DEFAULT_KEYMAP_DIR:=/usr/share/vt/keymaps} ;; +*) : ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps} ;; +esac ############################################################ GLOBALS From owner-svn-src-all@freebsd.org Sat Mar 3 10:29:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEE95F2E74F; Sat, 3 Mar 2018 10:29:29 +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 63FF67986D; Sat, 3 Mar 2018 10:29:29 +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 5EEC6250A2; Sat, 3 Mar 2018 10:29:29 +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 w23ATTqG026131; Sat, 3 Mar 2018 10:29:29 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23ATTVo026130; Sat, 3 Mar 2018 10:29:29 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031029.w23ATTVo026130@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 10:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330319 - stable/11/bin/pkill X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/pkill X-SVN-Commit-Revision: 330319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:29:29 -0000 Author: eadler Date: Sat Mar 3 10:29:29 2018 New Revision: 330319 URL: https://svnweb.freebsd.org/changeset/base/330319 Log: MFC r319602: Clarify -q is only for pgrep. Modified: stable/11/bin/pkill/pkill.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/pkill/pkill.1 ============================================================================== --- stable/11/bin/pkill/pkill.1 Sat Mar 3 10:27:33 2018 (r330318) +++ stable/11/bin/pkill/pkill.1 Sat Mar 3 10:29:29 2018 (r330319) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 21, 2015 +.Dd June 5, 2017 .Dt PKILL 1 .Os .Sh NAME @@ -176,6 +176,8 @@ Select only the newest (most recently started) of the .It Fl o Select only the oldest (least recently started) of the matching processes. .It Fl q +For +.Nm pgrep , Do not write anything to standard output. .It Fl s Ar sid Restrict matches to processes with a session ID in the comma-separated From owner-svn-src-all@freebsd.org Sat Mar 3 10:30:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61EC4F2E931; Sat, 3 Mar 2018 10:30:55 +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 12DBD79A1D; Sat, 3 Mar 2018 10:30:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DDC6250BF; Sat, 3 Mar 2018 10:30:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AUs1S026257; Sat, 3 Mar 2018 10:30:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AUsqm026256; Sat, 3 Mar 2018 10:30:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031030.w23AUsqm026256@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 10:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330320 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 330320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:30:55 -0000 Author: eadler Date: Sat Mar 3 10:30:54 2018 New Revision: 330320 URL: https://svnweb.freebsd.org/changeset/base/330320 Log: MFC 319851: Remove the outdated definition. Modified: stable/11/sys/compat/linux/linux_file.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_file.c ============================================================================== --- stable/11/sys/compat/linux/linux_file.c Sat Mar 3 10:29:29 2018 (r330319) +++ stable/11/sys/compat/linux/linux_file.c Sat Mar 3 10:30:54 2018 (r330320) @@ -307,8 +307,6 @@ struct l_dirent64 { roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1, \ sizeof(uint64_t)) -#define LINUX_DIRBLKSIZ 512 - /* * Linux l_dirent is bigger than FreeBSD dirent, thus the buffer size * passed to kern_getdirentries() must be smaller than the one passed From owner-svn-src-all@freebsd.org Sat Mar 3 10:32:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4DB7F2EA73; Sat, 3 Mar 2018 10:32:00 +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 611A379D23; Sat, 3 Mar 2018 10:32:00 +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 5BFDC25220; Sat, 3 Mar 2018 10:32:00 +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 w23AW0oO029991; Sat, 3 Mar 2018 10:32:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AW0Kk029990; Sat, 3 Mar 2018 10:32:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031032.w23AW0Kk029990@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 10:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330321 - stable/11/etc/rc.d X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/etc/rc.d X-SVN-Commit-Revision: 330321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:32:00 -0000 Author: eadler Date: Sat Mar 3 10:32:00 2018 New Revision: 330321 URL: https://svnweb.freebsd.org/changeset/base/330321 Log: MFC r319843: Fix 'restart' action: rc.subr only expects to restart one service, not two. PR: 217393 Modified: stable/11/etc/rc.d/sendmail Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.d/sendmail ============================================================================== --- stable/11/etc/rc.d/sendmail Sat Mar 3 10:30:54 2018 (r330320) +++ stable/11/etc/rc.d/sendmail Sat Mar 3 10:32:00 2018 (r330321) @@ -206,12 +206,14 @@ required_files= if checkyesno sendmail_submit_enable; then name="sendmail_submit" rcvar="sendmail_submit_enable" + _rc_restart_done=false run_rc_command "$1" fi if checkyesno sendmail_outbound_enable; then name="sendmail_outbound" rcvar="sendmail_outbound_enable" + _rc_restart_done=false run_rc_command "$1" fi @@ -219,4 +221,5 @@ name="sendmail_msp_queue" rcvar="sendmail_msp_queue_enable" pidfile="${sendmail_msp_queue_pidfile:-/var/spool/clientmqueue/sm-client.pid}" required_files="/etc/mail/submit.cf" +_rc_restart_done=false run_rc_command "$1" From owner-svn-src-all@freebsd.org Sat Mar 3 10:35:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCF94F2EF0D; Sat, 3 Mar 2018 10:35:00 +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 7C51879F60; Sat, 3 Mar 2018 10:35:00 +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 734012524B; Sat, 3 Mar 2018 10:35:00 +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 w23AZ0kU030872; Sat, 3 Mar 2018 10:35:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AZ089030871; Sat, 3 Mar 2018 10:35:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031035.w23AZ089030871@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 10:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330322 - stable/11/libexec/rshd X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/libexec/rshd X-SVN-Commit-Revision: 330322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:35:01 -0000 Author: eadler Date: Sat Mar 3 10:35:00 2018 New Revision: 330322 URL: https://svnweb.freebsd.org/changeset/base/330322 Log: MFC r320406: A little tweak for performance Modified: stable/11/libexec/rshd/rshd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rshd/rshd.c ============================================================================== --- stable/11/libexec/rshd/rshd.c Sat Mar 3 10:32:00 2018 (r330321) +++ stable/11/libexec/rshd/rshd.c Sat Mar 3 10:35:00 2018 (r330322) @@ -191,7 +191,7 @@ doit(struct sockaddr *fromp) struct passwd *pwd; u_short port; fd_set ready, readfrom; - int cc, fd, nfd, pv[2], pid, s; + int cc, nfd, pv[2], pid, s; int one = 1; const char *cp, *errorstr; char sig, buf[BUFSIZ]; @@ -493,8 +493,7 @@ doit(struct sockaddr *fromp) #ifdef USE_BLACKLIST blacklist(0, STDIN_FILENO, "success"); #endif - for (fd = getdtablesize(); fd > 2; fd--) - (void) close(fd); + closefrom(3); if (setsid() == -1) syslog(LOG_ERR, "setsid() failed: %m"); if (setlogin(pwd->pw_name) < 0) From owner-svn-src-all@freebsd.org Sat Mar 3 10:37:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4FBF2F2B2; Sat, 3 Mar 2018 10:37:54 +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 2CF0F7A12C; Sat, 3 Mar 2018 10:37:54 +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 27BFB2524D; Sat, 3 Mar 2018 10:37:54 +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 w23Absi9031016; Sat, 3 Mar 2018 10:37:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23Abss3031015; Sat, 3 Mar 2018 10:37:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031037.w23Abss3031015@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 10:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330323 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 330323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:37:54 -0000 Author: eadler Date: Sat Mar 3 10:37:53 2018 New Revision: 330323 URL: https://svnweb.freebsd.org/changeset/base/330323 Log: MFC r321426: cleanobj: Unhide removal of directory. Modified: stable/11/share/mk/bsd.obj.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.obj.mk ============================================================================== --- stable/11/share/mk/bsd.obj.mk Sat Mar 3 10:35:00 2018 (r330322) +++ stable/11/share/mk/bsd.obj.mk Sat Mar 3 10:37:53 2018 (r330323) @@ -159,7 +159,7 @@ whereobj: .if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) cleanobj: - @-rm -rf ${CANONICALOBJDIR} + -rm -rf ${CANONICALOBJDIR} .else cleanobj: clean cleandepend .endif From owner-svn-src-all@freebsd.org Sat Mar 3 10:43:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62B4BF2F980; Sat, 3 Mar 2018 10:43:42 +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 1382B7A5E2; Sat, 3 Mar 2018 10:43:42 +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 0E737253E4; Sat, 3 Mar 2018 10:43:42 +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 w23AhfaR035733; Sat, 3 Mar 2018 10:43:41 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23Ahf1F035732; Sat, 3 Mar 2018 10:43:41 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031043.w23Ahf1F035732@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 10:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330324 - stable/11/bin/pkill X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/pkill X-SVN-Commit-Revision: 330324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:43:42 -0000 Author: eadler Date: Sat Mar 3 10:43:41 2018 New Revision: 330324 URL: https://svnweb.freebsd.org/changeset/base/330324 Log: MFC r322210,r322613,r322831: pgrep naively appends the delimiter to all PIDs including the last e.g. "pgrep -d, getty" outputs "1399,1386,1309,1308,1307,1306,1305,1302," Ensure the list is correctly delimited by suppressing the emission of the delimiter after the final PID. The r322210 change to pgrep's PID delimiting behaviour causes pgrep's default output to not include a trailing new line, which is a potential POLA violation for existing consumers. Change pgrep to always emit a trailing new line on completion of its output, regardless of the delimeter in use (which technically is also a potential POLA violation for existing consumers that rely on the pre-r322210 buggy behaviour, but a line has to be drawn somewhere). Only emit the trailing new line added in r322613 when not operating in quiet mode. PR: 221534 (r322613) Modified: stable/11/bin/pkill/pkill.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/pkill/pkill.c ============================================================================== --- stable/11/bin/pkill/pkill.c Sat Mar 3 10:37:53 2018 (r330323) +++ stable/11/bin/pkill/pkill.c Sat Mar 3 10:43:41 2018 (r330324) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -567,6 +568,8 @@ main(int argc, char **argv) continue; rv |= (*action)(kp); } + if (rv && pgrep && !quiet) + putchar('\n'); if (!did_action && !pgrep && longfmt) fprintf(stderr, "No matching processes belonging to you were found\n"); @@ -656,10 +659,12 @@ killact(const struct kinfo_proc *kp) static int grepact(const struct kinfo_proc *kp) { + static bool first = true; - show_process(kp); - if (!quiet) + if (!quiet && !first) printf("%s", delim); + show_process(kp); + first = false; return (1); } From owner-svn-src-all@freebsd.org Sat Mar 3 10:45:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 553C2F2FAFA; Sat, 3 Mar 2018 10:45:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 079087A771; Sat, 3 Mar 2018 10:45:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02778253E7; Sat, 3 Mar 2018 10:45:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AjJQD035888; Sat, 3 Mar 2018 10:45:19 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AjJa7035887; Sat, 3 Mar 2018 10:45:19 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031045.w23AjJa7035887@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 10:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330325 - stable/11/usr.bin/mkesdb X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.bin/mkesdb X-SVN-Commit-Revision: 330325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:45:20 -0000 Author: eadler Date: Sat Mar 3 10:45:19 2018 New Revision: 330325 URL: https://svnweb.freebsd.org/changeset/base/330325 Log: MFC r322428: Set usage() to show -d flag mkesdb supports the -d flag for enabling debug mode, as documented in the manual. PR: 209865 Submitted by: Maya Rashish Reviewed by: imp Approved by: bcr (mentor) Obtained from: NetBSD MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D11987 Modified: stable/11/usr.bin/mkesdb/yacc.y Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkesdb/yacc.y ============================================================================== --- stable/11/usr.bin/mkesdb/yacc.y Sat Mar 3 10:43:41 2018 (r330324) +++ stable/11/usr.bin/mkesdb/yacc.y Sat Mar 3 10:45:19 2018 (r330325) @@ -278,8 +278,8 @@ usage(void) { errx(EXIT_FAILURE, "usage:\n" - "\t%s [-o outfile] [infile]\n" - "\t%s -m [-o outfile] [infile]", + "\t%s [-d] [-o outfile] [infile]\n" + "\t%s -m [-d] [-o outfile] [infile]", getprogname(), getprogname()); } From owner-svn-src-all@freebsd.org Sat Mar 3 10:47:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D9D6F2FE12; Sat, 3 Mar 2018 10:47:31 +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 5035A7AA05; Sat, 3 Mar 2018 10:47:31 +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 4697B253E9; Sat, 3 Mar 2018 10:47:31 +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 w23AlVON036038; Sat, 3 Mar 2018 10:47:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AlVNG036037; Sat, 3 Mar 2018 10:47:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031047.w23AlVNG036037@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 10:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330326 - stable/11/contrib/mdocml X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/contrib/mdocml X-SVN-Commit-Revision: 330326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:47:31 -0000 Author: eadler Date: Sat Mar 3 10:47:30 2018 New Revision: 330326 URL: https://svnweb.freebsd.org/changeset/base/330326 Log: MFC r322657: typo PR: 211160 Modified: stable/11/contrib/mdocml/lib.in Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/mdocml/lib.in ============================================================================== --- stable/11/contrib/mdocml/lib.in Sat Mar 3 10:45:19 2018 (r330325) +++ stable/11/contrib/mdocml/lib.in Sat Mar 3 10:47:30 2018 (r330326) @@ -34,7 +34,7 @@ LINE("libc", "Standard C\\~Library (libc, \\-lc)") LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") LINE("libcalendar", "Calendar Arithmetic Library (libcalendar, \\-lcalendar)") LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)") -LINE("libcasper", "Casper Library (libcasper, \\-lcapser)") +LINE("libcasper", "Casper Library (libcasper, \\-lcasper)") LINE("libcdk", "Curses Development Kit Library (libcdk, \\-lcdk)") LINE("libcipher", "FreeSec Crypt Library (libcipher, \\-lcipher)") LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") From owner-svn-src-all@freebsd.org Sat Mar 3 10:48:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6D7FF2FF01; Sat, 3 Mar 2018 10:48:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5330F7AB48; Sat, 3 Mar 2018 10:48:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34696253EB; Sat, 3 Mar 2018 10:48:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AmO27036132; Sat, 3 Mar 2018 10:48:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AmO14036131; Sat, 3 Mar 2018 10:48:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031048.w23AmO14036131@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 10:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330327 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 330327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:48:24 -0000 Author: eadler Date: Sat Mar 3 10:48:23 2018 New Revision: 330327 URL: https://svnweb.freebsd.org/changeset/base/330327 Log: MFC r322804 (record only) Correct typo in usage string. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Sat Mar 3 10:50:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A612F300D3; Sat, 3 Mar 2018 10:50:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7BB7ACF5; Sat, 3 Mar 2018 10:50:17 +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 412A5253EF; Sat, 3 Mar 2018 10:50:17 +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 w23AoH64036274; Sat, 3 Mar 2018 10:50:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AoHb6036273; Sat, 3 Mar 2018 10:50:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031050.w23AoHb6036273@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 10:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330328 - stable/11/sbin/sysctl X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sbin/sysctl X-SVN-Commit-Revision: 330328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 10:50:17 -0000 Author: eadler Date: Sat Mar 3 10:50:16 2018 New Revision: 330328 URL: https://svnweb.freebsd.org/changeset/base/330328 Log: MFC r323645: kern.osreldate is an integer, not a string PR: 217501 Modified: stable/11/sbin/sysctl/sysctl.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/sysctl/sysctl.8 ============================================================================== --- stable/11/sbin/sysctl/sysctl.8 Sat Mar 3 10:48:23 2018 (r330327) +++ stable/11/sbin/sysctl/sysctl.8 Sat Mar 3 10:50:16 2018 (r330328) @@ -214,7 +214,7 @@ String and integer values can be set using .It "kern.filedelay integer yes" .It "kern.dirdelay integer yes" .It "kern.metadelay integer yes" -.It "kern.osreldate string no" +.It "kern.osreldate integer no" .It "kern.bootfile string yes" .It "kern.corefile string yes" .It "kern.logsigexit integer yes" From owner-svn-src-all@freebsd.org Sat Mar 3 11:02:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5448F30F56; Sat, 3 Mar 2018 11:02:34 +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 939CB7B5A1; Sat, 3 Mar 2018 11:02:34 +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 8E79525727; Sat, 3 Mar 2018 11:02:34 +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 w23B2YaK046161; Sat, 3 Mar 2018 11:02:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23B2YDh046160; Sat, 3 Mar 2018 11:02:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031102.w23B2YDh046160@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 11:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330329 - stable/11/bin/uuidgen X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/uuidgen X-SVN-Commit-Revision: 330329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 11:02:35 -0000 Author: eadler Date: Sat Mar 3 11:02:34 2018 New Revision: 330329 URL: https://svnweb.freebsd.org/changeset/base/330329 Log: MFC r303727: uuid_to_string(3) is allocating memory and can fail on that. Check if any error accrued. Modified: stable/11/bin/uuidgen/uuidgen.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/uuidgen/uuidgen.c ============================================================================== --- stable/11/bin/uuidgen/uuidgen.c Sat Mar 3 10:50:16 2018 (r330328) +++ stable/11/bin/uuidgen/uuidgen.c Sat Mar 3 11:02:34 2018 (r330329) @@ -47,7 +47,7 @@ main(int argc, char *argv[]) FILE *fp; uuid_t *store, *uuid; char *p; - int ch, count, i, iterate; + int ch, count, i, iterate, status; count = -1; /* no count yet */ fp = stdout; /* default output file */ @@ -101,7 +101,9 @@ main(int argc, char *argv[]) uuid = store; while (count--) { - uuid_to_string(uuid++, &p, NULL); + uuid_to_string(uuid++, &p, &status); + if (status != uuid_s_ok) + err(1, "cannot stringify a UUID"); fprintf(fp, "%s\n", p); free(p); } From owner-svn-src-all@freebsd.org Sat Mar 3 11:11:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAF17F316C0; Sat, 3 Mar 2018 11:11:07 +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 885747B8B7; Sat, 3 Mar 2018 11:11:07 +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 8351425850; Sat, 3 Mar 2018 11:11:07 +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 w23BB7Z6047247; Sat, 3 Mar 2018 11:11:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BB7Hs047246; Sat, 3 Mar 2018 11:11:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031111.w23BB7Hs047246@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 11:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330330 - stable/11/tools/tools/syscall_timing X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/tools/tools/syscall_timing X-SVN-Commit-Revision: 330330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 11:11:08 -0000 Author: eadler Date: Sat Mar 3 11:11:07 2018 New Revision: 330330 URL: https://svnweb.freebsd.org/changeset/base/330330 Log: MFC r325319: Remove artificial limit for -i. Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- stable/11/tools/tools/syscall_timing/syscall_timing.c Sat Mar 3 11:02:34 2018 (r330329) +++ stable/11/tools/tools/syscall_timing/syscall_timing.c Sat Mar 3 11:11:07 2018 (r330330) @@ -706,7 +706,7 @@ main(int argc, char *argv[]) switch (ch) { case 'i': ll = strtol(optarg, &endp, 10); - if (*endp != 0 || ll < 1 || ll > 100000) + if (*endp != 0 || ll < 1) usage(); iterations = ll; break; From owner-svn-src-all@freebsd.org Sat Mar 3 11:12:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B612F317F6; Sat, 3 Mar 2018 11:12:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD0D77BBBA; Sat, 3 Mar 2018 11:12:09 +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 A8061258A4; Sat, 3 Mar 2018 11:12:09 +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 w23BC9er050981; Sat, 3 Mar 2018 11:12:09 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BC9ki050980; Sat, 3 Mar 2018 11:12:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031112.w23BC9ki050980@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 11:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330331 - stable/11/bin/rm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/rm X-SVN-Commit-Revision: 330331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 11:12:10 -0000 Author: eadler Date: Sat Mar 3 11:12:09 2018 New Revision: 330331 URL: https://svnweb.freebsd.org/changeset/base/330331 Log: MFC r325450: Fix cosmetic nit when printing out "override $mode" and "$owner/$group ..." The wrong index was being checked for == ' ' in the resulting stringified mode from strmode(3) -- it should have been the 11th value, not the 10th. PR: 76711 Modified: stable/11/bin/rm/rm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/rm/rm.c ============================================================================== --- stable/11/bin/rm/rm.c Sat Mar 3 11:11:07 2018 (r330330) +++ stable/11/bin/rm/rm.c Sat Mar 3 11:12:09 2018 (r330331) @@ -515,7 +515,7 @@ check(const char *path, const char *name, struct stat "%s: -P was specified, but file is not writable", path); (void)fprintf(stderr, "override %s%s%s/%s %s%sfor %s? ", - modep + 1, modep[9] == ' ' ? "" : " ", + modep + 1, modep[10] == ' ' ? "" : " ", user_from_uid(sp->st_uid, 0), group_from_gid(sp->st_gid, 0), *flagsp ? flagsp : "", *flagsp ? " " : "", From owner-svn-src-all@freebsd.org Sat Mar 3 11:17:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 904FEF31F9C; Sat, 3 Mar 2018 11:17:06 +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 3E79B7BE69; Sat, 3 Mar 2018 11:17:06 +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 3505F258C4; Sat, 3 Mar 2018 11:17:06 +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 w23BH5lY051222; Sat, 3 Mar 2018 11:17:05 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BH5Na051220; Sat, 3 Mar 2018 11:17:05 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031117.w23BH5Na051220@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 11:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330332 - stable/11/bin/pkill/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/pkill/tests X-SVN-Commit-Revision: 330332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 11:17:06 -0000 Author: eadler Date: Sat Mar 3 11:17:05 2018 New Revision: 330332 URL: https://svnweb.freebsd.org/changeset/base/330332 Log: MFC r307519,r307629: Increase timeout so low-end platforms have a chance to complete test procedures. This fixes operation in QEMU/MIPS64. Modified: stable/11/bin/pkill/tests/pgrep-j_test.sh stable/11/bin/pkill/tests/pkill-j_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- stable/11/bin/pkill/tests/pgrep-j_test.sh Sat Mar 3 11:12:09 2018 (r330331) +++ stable/11/bin/pkill/tests/pgrep-j_test.sh Sat Mar 3 11:17:05 2018 (r330332) @@ -20,12 +20,13 @@ sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep name="pgrep -j " -sleep_amount=5 +sleep_amount=15 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & +sleep 0.5 for i in `seq 1 10`; do jid1=$(jail_name_to_jid ${base}_1_1) @@ -53,7 +54,7 @@ fi wait name="pgrep -j any" -sleep_amount=6 +sleep_amount=16 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & @@ -74,7 +75,7 @@ fi wait name="pgrep -j none" -sleep_amount=7 +sleep_amount=17 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & @@ -91,7 +92,7 @@ wait # test 4 is like test 1 except with jname instead of jid. name="pgrep -j " -sleep_amount=8 +sleep_amount=18 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & Modified: stable/11/bin/pkill/tests/pkill-j_test.sh ============================================================================== --- stable/11/bin/pkill/tests/pkill-j_test.sh Sat Mar 3 11:12:09 2018 (r330331) +++ stable/11/bin/pkill/tests/pkill-j_test.sh Sat Mar 3 11:17:05 2018 (r330332) @@ -20,7 +20,7 @@ sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep name="pkill -j " -sleep_amount=5 +sleep_amount=15 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & @@ -54,7 +54,7 @@ fi 2>/dev/null wait name="pkill -j any" -sleep_amount=6 +sleep_amount=16 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & @@ -76,7 +76,7 @@ fi 2>/dev/null wait name="pkill -j none" -sleep_amount=7 +sleep_amount=17 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & @@ -94,7 +94,7 @@ wait # test 4 is like test 1 except with jname instead of jid. name="pkill -j " -sleep_amount=8 +sleep_amount=18 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & From owner-svn-src-all@freebsd.org Sat Mar 3 11:18:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D56B3F321C8; Sat, 3 Mar 2018 11:18:38 +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 808CB7C018; Sat, 3 Mar 2018 11:18:38 +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 7A6BE258C5; Sat, 3 Mar 2018 11:18:38 +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 w23BIcG7051321; Sat, 3 Mar 2018 11:18:38 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BIcpw051319; Sat, 3 Mar 2018 11:18:38 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031118.w23BIcpw051319@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 11:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330333 - stable/11/bin/freebsd-version X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/freebsd-version X-SVN-Commit-Revision: 330333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 11:18:39 -0000 Author: eadler Date: Sat Mar 3 11:18:38 2018 New Revision: 330333 URL: https://svnweb.freebsd.org/changeset/base/330333 Log: MFC r325800: Add a -r option to print the running kernel version. Modified: stable/11/bin/freebsd-version/freebsd-version.1 stable/11/bin/freebsd-version/freebsd-version.sh.in Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/freebsd-version/freebsd-version.1 ============================================================================== --- stable/11/bin/freebsd-version/freebsd-version.1 Sat Mar 3 11:17:05 2018 (r330332) +++ stable/11/bin/freebsd-version/freebsd-version.1 Sat Mar 3 11:18:38 2018 (r330333) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2013 +.Dd November 14, 2017 .Dt FREEBSD-VERSION 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd print the version and patch level of the installed system .Sh SYNOPSIS .Nm -.Op Fl ku +.Op Fl kru .Sh DESCRIPTION The .Nm @@ -50,6 +50,11 @@ if a new kernel has been installed but the system has rebooted, .Nm will print the version and patch level of the new kernel. +.It Fl r +Print the version and patch level of the running kernel. +Unlike +.Xr uname 1 , +this is unaffected by environment variables. .It Fl u Print the version and patch level of the installed userland. These are hardcoded into @@ -57,14 +62,10 @@ These are hardcoded into during the build. .El .Pp -If both -.Fl k -and -.Fl u -are specified, +If several of the above options are specified, .Nm -will print the kernel version first, then the userland version, on -separate lines. +will print the installed kernel version first, then the running kernel +version, and finally the userland version, on separate lines. If neither is specified, it will print the userland version only. .Sh IMPLEMENTATION NOTES The Modified: stable/11/bin/freebsd-version/freebsd-version.sh.in ============================================================================== --- stable/11/bin/freebsd-version/freebsd-version.sh.in Sat Mar 3 11:17:05 2018 (r330332) +++ stable/11/bin/freebsd-version/freebsd-version.sh.in Sat Mar 3 11:18:38 2018 (r330333) @@ -38,7 +38,7 @@ LOADER_RE1='^\([A-Z_a-z][0-9A-Z_a-z]*=[-./0-9A-Z_a-z]\ LOADER_RE2='^\([A-Z_a-z][0-9A-Z_a-z]*="[-./0-9A-Z_a-z]\{1,\}"\).*$' KERNEL_RE='^@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$' -progname=$(basename $0) +progname=${0##*/} # # Print an error message and exit. @@ -71,6 +71,13 @@ kernel_version() { } # +# Print the version of the currently running kernel. +# +running_version() { + sysctl -n kern.osrelease +} + +# # Print the hardcoded userland version. # userland_version() { @@ -81,7 +88,7 @@ userland_version() { # Print a usage string and exit. # usage() { - echo "usage: $progname [-ku]" >&2 + echo "usage: $progname [-kru]" >&2 exit 1 } @@ -90,11 +97,14 @@ usage() { # main() { # parse command-line arguments - while getopts "ku" option ; do + while getopts "kru" option ; do case $option in k) opt_k=1 ;; + r) + opt_r=1 + ;; u) opt_u=1 ;; @@ -108,13 +118,18 @@ main() { fi # default is -u - if [ $((opt_k + opt_u)) -eq 0 ] ; then + if [ $((opt_k + opt_r + opt_u)) -eq 0 ] ; then opt_u=1 fi - # print kernel version + # print installed kernel version if [ $opt_k ] ; then kernel_version + fi + + # print running kernel version + if [ $opt_r ] ; then + running_version fi # print userland version From owner-svn-src-all@freebsd.org Sat Mar 3 11:53:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69DCDF348CD; Sat, 3 Mar 2018 11:53:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED2D7D74F; Sat, 3 Mar 2018 11:53:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0687825F1C; Sat, 3 Mar 2018 11:53:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23BrisL071254; Sat, 3 Mar 2018 11:53:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BriKZ071253; Sat, 3 Mar 2018 11:53:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803031153.w23BriKZ071253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Mar 2018 11:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330334 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 330334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 11:53:45 -0000 Author: kib Date: Sat Mar 3 11:53:44 2018 New Revision: 330334 URL: https://svnweb.freebsd.org/changeset/base/330334 Log: MFC r329905: Hide all vm/vm_pageout.h content under #ifdef _KERNEL. Modified: stable/11/sys/vm/vm_pageout.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_pageout.h ============================================================================== --- stable/11/sys/vm/vm_pageout.h Sat Mar 3 11:18:38 2018 (r330333) +++ stable/11/sys/vm/vm_pageout.h Sat Mar 3 11:53:44 2018 (r330334) @@ -63,6 +63,8 @@ #ifndef _VM_VM_PAGEOUT_H_ #define _VM_VM_PAGEOUT_H_ +#ifdef _KERNEL + /* * Header file for pageout daemon. */ @@ -101,11 +103,10 @@ void pagedaemon_wakeup(void); void vm_wait(void); void vm_waitpfault(void); -#ifdef _KERNEL int vm_pageout_flush(vm_page_t *, int, int, int, int *, boolean_t *); void vm_pageout_oom(int shortage); void vm_swapout_run(void); void vm_swapout_run_idle(void); -#endif +#endif /* _KERNEL */ #endif /* _VM_VM_PAGEOUT_H_ */ From owner-svn-src-all@freebsd.org Sat Mar 3 12:09:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 12:43:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 13:19:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 13:20:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 15:10:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 15:17:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC787F44074 for ; Sat, 3 Mar 2018 15:17:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic315-27.consmr.mail.bf2.yahoo.com (sonic315-27.consmr.mail.bf2.yahoo.com [74.6.134.201]) (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 6C6228585C for ; Sat, 3 Mar 2018 15:17:02 +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 sonic315.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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 15:17:04 -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-all@freebsd.org Sat Mar 3 17:13:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 17:18:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 17:25:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 17:38:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:11:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE8D6F2E9D1; Sat, 3 Mar 2018 18:11:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0946E20C; Sat, 3 Mar 2018 18:11:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 655E71B2D; Sat, 3 Mar 2018 18:11:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23IB3GZ064426; Sat, 3 Mar 2018 18:11:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IB3gQ064425; Sat, 3 Mar 2018 18:11:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031811.w23IB3gQ064425@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 18:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330343 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 330343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 18:11:03 -0000 Author: eadler Date: Sat Mar 3 18:11:02 2018 New Revision: 330343 URL: https://svnweb.freebsd.org/changeset/base/330343 Log: MFC r302519: Audit the file-descriptor number argument for openat(2). Remove a comment about the desirability of auditing the number, as it was in fact in the wrong place (in the common path for open(2) and openat(2), and only the latter accepts a file-descriptor argument). Where other ABIs support openat(2), it may be necessary to do additional argument auditing as it is not performed in kern_openat(9). MFC after: 3 days Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Sat Mar 3 17:38:25 2018 (r330342) +++ stable/11/sys/kern/vfs_syscalls.c Sat Mar 3 18:11:02 2018 (r330343) @@ -959,6 +959,7 @@ int sys_openat(struct thread *td, struct openat_args *uap) { + AUDIT_ARG_FD(uap->fd); return (kern_openat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flag, uap->mode)); } @@ -979,7 +980,6 @@ kern_openat(struct thread *td, int fd, char *path, enu AUDIT_ARG_FFLAGS(flags); AUDIT_ARG_MODE(mode); - /* XXX: audit dirfd */ cap_rights_init(&rights, CAP_LOOKUP); flags_to_rights(flags, &rights); /* From owner-svn-src-all@freebsd.org Sat Mar 3 18:12:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:13:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:25:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:28:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:30:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:36:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:40:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:52:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 18:54:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 19:14:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DCFAF334F9 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 189F971368 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 19:15:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 19:26:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 19:28:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 20:42:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 20:49:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 20:54:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EA7BF3B879 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 D7E3E76052 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 21:02:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2AA7F3C25B 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 2597276630 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 21:05:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F423F3C4C9; Sat, 3 Mar 2018 21:05:29 +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 F38F6767FE; Sat, 3 Mar 2018 21:05:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED4D33CAC; Sat, 3 Mar 2018 21:05:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23L5SLW053019; Sat, 3 Mar 2018 21:05:28 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23L5SfD053018; Sat, 3 Mar 2018 21:05:28 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803032105.w23L5SfD053018@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:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330355 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 330355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 21:05:29 -0000 Author: eadler Date: Sat Mar 3 21:05:28 2018 New Revision: 330355 URL: https://svnweb.freebsd.org/changeset/base/330355 Log: MFC r305137: Eliminate unnecessary loop in _cap_check() Calling cap_rights_contains() several times with the same inputs is not going to produce a different output. The variable being iterated, i, is never used inside the for loop. The loop is actually done in cap_rights_contains() Modified: stable/11/sys/kern/sys_capability.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sys_capability.c ============================================================================== --- stable/11/sys/kern/sys_capability.c Sat Mar 3 20:42:39 2018 (r330354) +++ stable/11/sys/kern/sys_capability.c Sat Mar 3 21:05:28 2018 (r330355) @@ -154,16 +154,13 @@ static inline int _cap_check(const cap_rights_t *havep, const cap_rights_t *needp, enum ktr_cap_fail_type type) { - int i; - for (i = 0; i < nitems(havep->cr_rights); i++) { - if (!cap_rights_contains(havep, needp)) { + if (!cap_rights_contains(havep, needp)) { #ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(type, needp, havep); + if (KTRPOINT(curthread, KTR_CAPFAIL)) + ktrcapfail(type, needp, havep); #endif - return (ENOTCAPABLE); - } + return (ENOTCAPABLE); } return (0); } From owner-svn-src-all@freebsd.org Sat Mar 3 21:14:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 21:23:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 303A3F3D9B3; Sat, 3 Mar 2018 21:23:32 +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 D2866775AB; Sat, 3 Mar 2018 21:23:31 +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 CD6E9403C; Sat, 3 Mar 2018 21:23:31 +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 w23LNVWu062951; Sat, 3 Mar 2018 21:23:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23LNVWD062950; Sat, 3 Mar 2018 21:23:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803032123.w23LNVWD062950@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:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330357 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 330357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 21:23:32 -0000 Author: eadler Date: Sat Mar 3 21:23:31 2018 New Revision: 330357 URL: https://svnweb.freebsd.org/changeset/base/330357 Log: MFC r306767: Correctly calculate snd_max in persist case. In the persist case, take the SYN and FIN flags into account when updating the sequence space sent. Modified: stable/11/sys/netinet/tcp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_output.c ============================================================================== --- stable/11/sys/netinet/tcp_output.c Sat Mar 3 21:14:55 2018 (r330356) +++ stable/11/sys/netinet/tcp_output.c Sat Mar 3 21:23:31 2018 (r330357) @@ -1545,7 +1545,7 @@ timer: tp->t_flags |= TF_SENTFIN; } if (SEQ_GT(tp->snd_nxt + xlen, tp->snd_max)) - tp->snd_max = tp->snd_nxt + len; + tp->snd_max = tp->snd_nxt + xlen; } if (error) { From owner-svn-src-all@freebsd.org Sat Mar 3 21:41:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 21:50:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 22:07:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 22:10:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 22:28:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 22:40:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 23:08:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 23:09:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 23:23:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 23:23:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Mar 3 23:39:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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 +};